diff --git a/internal/4.10.0.10/1/CRGrid/Help/CRControls.cnt b/internal/4.10.0.10/1/CRGrid/Help/CRControls.cnt new file mode 100644 index 0000000..23619c8 --- /dev/null +++ b/internal/4.10.0.10/1/CRGrid/Help/CRControls.cnt @@ -0,0 +1,41 @@ +:TITLE TCRDBGrid Component +:BASE CRControls.hlp +1 Compatibility=Compatibility_CRControls@CRControls.hlp>Main +1 Support=Compatibility_CRControls_2@CRControls.hlp>Main +1 TCRColumn +2 Description=TCRColumn@CRControls.hlp>Main +2 Properties +3 FilterExpression=TCRColumn_FilterExpression@CRControls.hlp>Main +3 FloatDigits=TCRColumn_FloatDigits@CRControls.hlp>Main +3 FloatFormat=TCRColumn_FloatFormat@CRControls.hlp>Main +3 FloatPrecision=TCRColumn_FloatPrecision@CRControls.hlp>Main +3 SortOrder=TCRColumn_SortOrder@CRControls.hlp>Main +3 SortSequence=TCRColumn_SortSequence@CRControls.hlp>Main +3 SummaryMode=TCRColumn_SummaryMode1@CRControls.hlp>Main +3 TotalString=TCRColumn_TotalString@CRControls.hlp>Main +3 TotalValue=TCRColumn_TotalValue@CRControls.hlp>Main +1 TCRDBGrid +2 Description=TCRDBGrid@CRControls.hlp>Main +2 Properties +3 Filtered=TCRDBGrid_Filtered@CRControls.hlp>Main +3 LevelDelimiterChar=TCRDBGrid_LevelDelimiterChar@CRControls.hlp>Main +3 Columns=TCRDBGrid_Columns@CRControls.hlp>Main +3 OptionsMenu=TCRDBGrid_OptionsMenu@CRControls.hlp>Main +3 OptionsEx=TCRDBGrid_OptionsEx@CRControls.hlp>Main +2 Methods +3 ActivateFilterEdit=TCRDBGrid_ActivateFilterEdit@CRControls.hlp>Main +3 ActivateSearchEdit=TCRDBGrid_ActivateSearchEdit@CRControls.hlp>Main +3 AdjustColumns=TCRDBGrid_AdjustColumns@CRControls.hlp>Main +3 ApplyFilter=TCRDBGrid_ApplyFilter@CRControls.hlp>Main +3 CalcTitleLevel=TCRDBGrid_CalcTitleLevel@CRControls.hlp>Main +3 ClearFilters=TCRDBGrid_ClearFilters1@CRControls.hlp>Main +3 ClearSorting=TCRDBGrid_ClearSorting@CRControls.hlp>Main +3 DataChanged=TCRDBGrid_DataChanged@CRControls.hlp>Main +3 GetGridSize=TCRDBGrid_GetGridSize@CRControls.hlp>Main +3 GetTitleLevel=TCRDBGrid_GetTitleLevel@CRControls.hlp>Main +2 Events +3 OnGetCellParams=TCRDBGrid_OnGetCellParams@CRControls.hlp>Main +3 OnMemoClick=TCRDBGrid_OnMemoClick@CRControls.hlp>Main +2 Working with TCRDBGrid component +3 Using Filter Bar=TCRDBGrid_usingfilterbar@CRControls.hlp>Main +3 Using Search Bar=TCRDBGrid_usingsearchbar@CRControls.hlp>Main diff --git a/internal/4.10.0.10/1/CRGrid/Help/CRControls.hlp b/internal/4.10.0.10/1/CRGrid/Help/CRControls.hlp new file mode 100644 index 0000000..f8f1ba9 Binary files /dev/null and b/internal/4.10.0.10/1/CRGrid/Help/CRControls.hlp differ diff --git a/internal/4.10.0.10/1/CRGrid/Images/CoreLab.Vcl.CRGrid.TCRDBGrid.bmp b/internal/4.10.0.10/1/CRGrid/Images/CoreLab.Vcl.CRGrid.TCRDBGrid.bmp new file mode 100644 index 0000000..761b4c8 Binary files /dev/null and b/internal/4.10.0.10/1/CRGrid/Images/CoreLab.Vcl.CRGrid.TCRDBGrid.bmp differ diff --git a/internal/4.10.0.10/1/CRGrid/Images/CoreLab.Vcl.CRGrid.TCRDBGrid16.bmp b/internal/4.10.0.10/1/CRGrid/Images/CoreLab.Vcl.CRGrid.TCRDBGrid16.bmp new file mode 100644 index 0000000..1b37389 Binary files /dev/null and b/internal/4.10.0.10/1/CRGrid/Images/CoreLab.Vcl.CRGrid.TCRDBGrid16.bmp differ diff --git a/internal/4.10.0.10/1/CRGrid/Images/CoreLab.Vcl.CRGrid.TCRDBGrid32.bmp b/internal/4.10.0.10/1/CRGrid/Images/CoreLab.Vcl.CRGrid.TCRDBGrid32.bmp new file mode 100644 index 0000000..aad05e5 Binary files /dev/null and b/internal/4.10.0.10/1/CRGrid/Images/CoreLab.Vcl.CRGrid.TCRDBGrid32.bmp differ diff --git a/internal/4.10.0.10/1/CRGrid/Images/Delphi8/CoreLab.Vcl.CRGrid.TCRDBGrid.bmp b/internal/4.10.0.10/1/CRGrid/Images/Delphi8/CoreLab.Vcl.CRGrid.TCRDBGrid.bmp new file mode 100644 index 0000000..1b37389 Binary files /dev/null and b/internal/4.10.0.10/1/CRGrid/Images/Delphi8/CoreLab.Vcl.CRGrid.TCRDBGrid.bmp differ diff --git a/internal/4.10.0.10/1/CRGrid/Source/CBuilder5/crcontrols50.bpk b/internal/4.10.0.10/1/CRGrid/Source/CBuilder5/crcontrols50.bpk new file mode 100644 index 0000000..831b79c --- /dev/null +++ b/internal/4.10.0.10/1/CRGrid/Source/CBuilder5/crcontrols50.bpk @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=6 +MinorVer=10 +Release=1 +Build=10 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName=Core Lab +FileDescription= +FileVersion=6.10.1.10 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName=Core Lab Controls +ProductVersion=6.10.1.10 +Comments= + +[HistoryLists\hlIncludePath] +Count=5 +Item0=..\;..;..\..\..\Dac\Source;$(BCB)\include;$(BCB)\include\vcl +Item1=..\;..;$(BCB)\include;$(BCB)\include\vcl;..\..\..\Dac\Source;..\..\..\ODac\Source +Item2=..\;..;$(BCB)\include;$(BCB)\include\vcl;..\..\..\Dac\Source;..\..\..\Dac\Source\CBuilder5;..\..\..\ODac\Source;..\..\..\ODac\Source\CBuilder5 +Item3=..\;$(BCB)\include;$(BCB)\include\vcl;..\..\..\Dac\Source;..\..\..\Dac\Source\CBuilder5;..\..\..\ODac\Source;..\..\..\ODac\Source\CBuilder5 +Item4=..\;$(BCB)\include;$(BCB)\include\vcl + +[HistoryLists\hlLibraryPath] +Count=4 +Item0=..\;..;..\..\..\Dac\Source;..\..\..\Dac\Source\CBuilder5;..\..\..\ODac\Source;..\..\..\ODac\Source\CBuilder5;$(BCB)\lib;$(BCB)\lib\obj +Item1=..\;..;$(BCB)\lib\obj;$(BCB)\lib;..\..\..\Dac\Source;..\..\..\Dac\Source\CBuilder5;..\..\..\ODac\Source;..\..\..\ODac\Source\CBuilder5 +Item2=..\;$(BCB)\lib\obj;$(BCB)\lib;..\..\..\Dac\Source;..\..\..\Dac\Source\CBuilder5;..\..\..\ODac\Source;..\..\..\ODac\Source\CBuilder5 +Item3=D:\Program Files\Borland\CBuilder5\Projects\Lib;..\;$(BCB)\lib\obj;$(BCB)\lib + +[HistoryLists\hlDebugSourcePath] +Count=1 +Item0=$(BCB)\source\vcl + +[HistoryLists\hlConditionals] +Count=1 +Item0=_DEBUG + +[HistoryLists\hlIntOutputDir] +Count=1 +Item0=. + +[HistoryLists\hIBPIOutputDir] +Count=1 +Item0=. + +[Debugging] +DebugSourceDirs= + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +ShowInfoMsgs=0 +LinkDebugVcl=0 +LinkCGLIB=0 + +[CORBA] +AddServerUnit=1 +AddClientUnit=1 +PrecompiledHeaders=1 + +[Language] +ActiveLang= +RootDir= + + diff --git a/internal/4.10.0.10/1/CRGrid/Source/CBuilder5/crcontrols50.cpp b/internal/4.10.0.10/1/CRGrid/Source/CBuilder5/crcontrols50.cpp new file mode 100644 index 0000000..8eebbd2 --- /dev/null +++ b/internal/4.10.0.10/1/CRGrid/Source/CBuilder5/crcontrols50.cpp @@ -0,0 +1,22 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("CRControls50.res"); +USEPACKAGE("vcl50.bpi"); +USEPACKAGE("Vcldb50.bpi"); +USEUNIT("..\CRControlsReg.pas"); +USEPACKAGE("dac50.bpi"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/internal/4.10.0.10/1/CRGrid/Source/CBuilder5/crcontrols50.res b/internal/4.10.0.10/1/CRGrid/Source/CBuilder5/crcontrols50.res new file mode 100644 index 0000000..d50d7f1 Binary files /dev/null and b/internal/4.10.0.10/1/CRGrid/Source/CBuilder5/crcontrols50.res differ diff --git a/internal/4.10.0.10/1/CRGrid/Source/CBuilder6/crcontrols60.bpk b/internal/4.10.0.10/1/CRGrid/Source/CBuilder6/crcontrols60.bpk new file mode 100644 index 0000000..7eab5a8 --- /dev/null +++ b/internal/4.10.0.10/1/CRGrid/Source/CBuilder6/crcontrols60.bpk @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=6 +MinorVer=10 +Release=1 +Build=10 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName=Core Lab +FileDescription= +FileVersion=6.10.1.10 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName=Core Lab Controls +ProductVersion=6.10.1.10 +Comments= + +[HistoryLists\hlIncludePath] +Count=5 +Item0=..\;..;..\..\..\Dac\Source;$(BCB)\include;$(BCB)\include\vcl +Item1=..\;..;$(BCB)\include;$(BCB)\include\vcl;..\..\..\Dac\Source;..\..\..\ODac\Source +Item2=..\;..;$(BCB)\include;$(BCB)\include\vcl;..\..\..\Dac\Source;..\..\..\Dac\Source\CBuilder6;..\..\..\ODac\Source;..\..\..\ODac\Source\CBuilder6 +Item3=..\;$(BCB)\include;$(BCB)\include\vcl;..\..\..\Dac\Source;..\..\..\Dac\Source\CBuilder6;..\..\..\ODac\Source;..\..\..\ODac\Source\CBuilder6 +Item4=..\;$(BCB)\include;$(BCB)\include\vcl + +[HistoryLists\hlLibraryPath] +Count=4 +Item0=..\;..;..\..\..\Dac\Source;..\..\..\Dac\Source\CBuilder6;..\..\..\Odac\Source;..\..\..\Odac\Source\CBuilder6;$(BCB)\lib;$(BCB)\lib\obj +Item1=..\;..;$(BCB)\lib\obj;$(BCB)\lib;..\..\..\Dac\Source;..\..\..\Dac\Source\CBuilder6;..\..\..\Odac\Source;..\..\..\Odac\Source\CBuilder6 +Item2=..\;$(BCB)\lib\obj;$(BCB)\lib;..\..\..\Dac\Source;..\..\..\Dac\Source\CBuilder6;..\..\..\Odac\Source;..\..\..\Odac\Source\CBuilder6 +Item3=D:\Program Files\Borland\CBuilder6\Projects\Lib;..\;$(BCB)\lib\obj;$(BCB)\lib + +[HistoryLists\hlDebugSourcePath] +Count=1 +Item0=$(BCB)\source\vcl + +[HistoryLists\hlConditionals] +Count=1 +Item0=_DEBUG + +[HistoryLists\hlIntOutputDir] +Count=1 +Item0=. + +[HistoryLists\hIBPIOutputDir] +Count=1 +Item0=. + +[Debugging] +DebugSourceDirs= + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +ShowInfoMsgs=0 +LinkDebugVcl=0 +LinkCGLIB=0 + +[CORBA] +AddServerUnit=1 +AddClientUnit=1 +PrecompiledHeaders=1 + +[Language] +ActiveLang= +RootDir= + + diff --git a/internal/4.10.0.10/1/CRGrid/Source/CBuilder6/crcontrols60.cpp b/internal/4.10.0.10/1/CRGrid/Source/CBuilder6/crcontrols60.cpp new file mode 100644 index 0000000..7b61468 --- /dev/null +++ b/internal/4.10.0.10/1/CRGrid/Source/CBuilder6/crcontrols60.cpp @@ -0,0 +1,22 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("CRControls60.res"); +USEPACKAGE("vcl60.bpi"); +USEPACKAGE("Vcldb60.bpi"); +USEUNIT("..\CRControlsReg.pas"); +USEPACKAGE("dac60.bpi"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/internal/4.10.0.10/1/CRGrid/Source/CBuilder6/crcontrols60.res b/internal/4.10.0.10/1/CRGrid/Source/CBuilder6/crcontrols60.res new file mode 100644 index 0000000..d50d7f1 Binary files /dev/null and b/internal/4.10.0.10/1/CRGrid/Source/CBuilder6/crcontrols60.res differ diff --git a/internal/4.10.0.10/1/CRGrid/Source/CRControls.res b/internal/4.10.0.10/1/CRGrid/Source/CRControls.res new file mode 100644 index 0000000..25c4844 Binary files /dev/null and b/internal/4.10.0.10/1/CRGrid/Source/CRControls.res differ diff --git a/internal/4.10.0.10/1/CRGrid/Source/CRControls10p.res b/internal/4.10.0.10/1/CRGrid/Source/CRControls10p.res new file mode 100644 index 0000000..b688ddf Binary files /dev/null and b/internal/4.10.0.10/1/CRGrid/Source/CRControls10p.res differ diff --git a/internal/4.10.0.10/1/CRGrid/Source/CRControls9.res b/internal/4.10.0.10/1/CRGrid/Source/CRControls9.res new file mode 100644 index 0000000..f8f338f Binary files /dev/null and b/internal/4.10.0.10/1/CRGrid/Source/CRControls9.res differ diff --git a/internal/4.10.0.10/1/CRGrid/Source/CRControlsReg.pas b/internal/4.10.0.10/1/CRGrid/Source/CRControlsReg.pas new file mode 100644 index 0000000..8720445 --- /dev/null +++ b/internal/4.10.0.10/1/CRGrid/Source/CRControlsReg.pas @@ -0,0 +1,42 @@ + +////////////////////////////////////////////////// +// CRControls +// Copyright (c) 2000-2006 Core Lab. All right reserved. +// CRControls registration +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +unit CRControlsReg; +{$ENDIF} + +{$I CRGrid.inc} + +interface + +uses + Classes, CRGrid; + +procedure Register; + +implementation + +{$IFNDEF CLR} + {$IFDEF VER9} + {$R CRControls9.res} + {$ELSE} + {$R CRControls.res} + {$ENDIF} + {$IFDEF VER10P} + {$R CRControls10p.res} + {$ENDIF} +{$ELSE} + {$R CRControls.res} +{$ENDIF} + +procedure Register; +begin + RegisterComponents('Data Controls', [TCRDBGrid]); +end; + +end. diff --git a/internal/4.10.0.10/1/CRGrid/Source/CRGrid.inc b/internal/4.10.0.10/1/CRGrid/Source/CRGrid.inc new file mode 100644 index 0000000..898acf5 --- /dev/null +++ b/internal/4.10.0.10/1/CRGrid/Source/CRGrid.inc @@ -0,0 +1,168 @@ +{$DEFINE DAC600} + +{$IFNDEF LINUX} + {$DEFINE MSWINDOWS} +{$ENDIF} + +{$IFDEF VER120} { Delphi 4 } + {$DEFINE D4} + {$DEFINE VER4} + + {$DEFINE VER34} + {$DEFINE VER4P} +{$ENDIF} + +{$IFDEF VER130} { Delphi 5 } +{$IFNDEF BCB} + {$DEFINE D5} + {$DEFINE VER5} + + {$DEFINE VER5P} +{$ENDIF} +{$ENDIF} + +{$IFDEF VER140} { Delphi 6, Kylix 1, Kylix 2 } +{$IFNDEF BCB} + {$DEFINE D6} + {$DEFINE VER6} + + {$DEFINE VER5P} + {$DEFINE VER6P} +{$ENDIF} +{$ENDIF} + +{$IFDEF VER150} { Delphi 7 } +{$IFNDEF BCB} + {$DEFINE D7} + {$DEFINE VER7} + + {$DEFINE VER5P} + {$DEFINE VER6P} + {$DEFINE VER7P} +{$ENDIF} +{$ENDIF} + +{$IFDEF VER160} { Delphi 8 } +{$IFDEF DAC450} + DAC 4.50 does not support Delphi 8!!! +{$ENDIF} + {$DEFINE D8} + {$DEFINE VER8} + + {$DEFINE VER5P} + {$DEFINE VER6P} + {$DEFINE VER7P} + {$DEFINE VER8P} +{$ENDIF} + +{$IFDEF VER170} { Delphi 9 } + {$DEFINE D9} + {$DEFINE VER9} + + {$DEFINE VER5P} + {$DEFINE VER6P} + {$DEFINE VER7P} + {$DEFINE VER8P} + {$DEFINE VER9P} +{$ENDIF} + +{$IFDEF VER180} { Delphi 10 } + {$DEFINE D10} + {$DEFINE VER10} + + {$DEFINE VER5P} + {$DEFINE VER6P} + {$DEFINE VER7P} + {$DEFINE VER8P} + {$DEFINE VER9P} + {$DEFINE VER10P} +{$ENDIF} + +{$IFDEF VER185} { Delphi 11 } + {$DEFINE D11} + {$DEFINE VER11} + + {$DEFINE VER5P} + {$DEFINE VER6P} + {$DEFINE VER7P} + {$DEFINE VER8P} + {$DEFINE VER9P} + {$DEFINE VER10P} + {$DEFINE VER11P} +{$ENDIF} + + +{$IFDEF VER125} { C++ Builder 4 } + {$DEFINE BCB} + {$DEFINE CB4} + {$DEFINE VER4} + + {$DEFINE VER34} + {$DEFINE VER4P} + {$ObjExportAll On} +{$ENDIF} + +{$IFDEF VER130} { C++ Builder 5 } +{$IFDEF BCB} + {$DEFINE CB5} + {$DEFINE VER5} + + {$DEFINE VER5P} + {$ObjExportAll On} +{$ENDIF} +{$ENDIF} + +{$IFDEF VER140} { C++ Builder 6 } +{$IFDEF BCB} + {$DEFINE CB6} + {$DEFINE VER6} + + {$DEFINE VER5P} + {$DEFINE VER6P} + {$ObjExportAll On} +{$ENDIF} +{$ENDIF} + +{$IFDEF INTERNAL} +{$IFDEF BCB} + {$DEFINE BDE_SHARED} // Use TUpdateAction from DBTables +{$ENDIF} +{$ENDIF} + +// old + +{$IFDEF VER100} { Delphi 3 } + {$DEFINE D3} + {$DEFINE D3_CB3} + {$DEFINE VER34} + {$DEFINE VER3+} +{$ENDIF} + +{$IFDEF VER110} { C++ Builder 3 } + {$DEFINE CB} + {$DEFINE CB3} + {$DEFINE D3_CB3} + {$DEFINE VER34} + {$DEFINE VER3+} + {$ObjExportAll On} +{$ENDIF} + +{$IFDEF VER7} + {$WARN UNSAFE_TYPE OFF} + {$WARN UNSAFE_CODE OFF} + {$WARN UNSAFE_CAST OFF} +{$ENDIF} + +{$IFDEF VER6P} + {$WARN SYMBOL_PLATFORM OFF} + {$WARN SYMBOL_DEPRECATED OFF} + {$WARN UNIT_PLATFORM OFF} + {$WARN UNIT_DEPRECATED OFF} +{$ENDIF} + +{$IFDEF VER6P} + {$WARN SYMBOL_PLATFORM OFF} + {$WARN SYMBOL_DEPRECATED OFF} + {$WARN UNIT_PLATFORM OFF} + {$WARN UNIT_DEPRECATED OFF} +{$ENDIF} diff --git a/internal/4.10.0.10/1/CRGrid/Source/CRGrid.pas b/internal/4.10.0.10/1/CRGrid/Source/CRGrid.pas new file mode 100644 index 0000000..35dfc35 --- /dev/null +++ b/internal/4.10.0.10/1/CRGrid/Source/CRGrid.pas @@ -0,0 +1,4171 @@ + +////////////////////////////////////////////////// +// CRControls +// Copyright (c) 2000-2006 Core Lab. All right reserved. +// CRGrid component +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I CRGrid.inc} + +unit CRGrid; + +{$ENDIF} + +interface + +uses +{$IFDEF VER6P} + Variants, +{$ENDIF} + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + Grids, DBGrids, DB, StdCtrls, Menus, DBAccess, ComCtrls; + +type + TCRDBGrid = class; + +{ TCRColumn } + + TSortOrder = (soNone, soAsc, soDesc); + TSummaryMode = (smNone, smSum, smAvr, smMax, smMin, smLabel); + + TOnMemoClick = procedure (Sender: TObject; Column: TColumn) of object; + + TCRColumnTitle = class(TColumnTitle) + private + function GetCaption: string; + function IsCaptionStored: boolean; + + protected + procedure SetCaption(const Value: string); + + published + property Caption: string read GetCaption write SetCaption stored IsCaptionStored; + end; + + TCRColumn = class (TColumn) + private + FMinWidth: integer; + FTotalString: string; + FTotalValue: Variant; + FTotalLoaded: boolean; + FSummaryMode: TSummaryMode; + FTotalFloat: extended; + FTotalInt: int64; + FFloatDigits: integer; + FFloatPrecision: integer; + FFloatFormat: TFloatFormat; + FFilterExpression: string; + FTableSpacePercent: double; + + function GetSortOrder: TSortOrder; + procedure SetSortOrder(Value: TSortOrder); + function GetSortSequence: integer; + procedure SetSortSequence(Value: integer); + function GetTotalString: string; + function GetTotalValue: Variant; + procedure SetSummaryMode(Value: TSummaryMode); + procedure SetFloatDigits(const Value: integer); + procedure SetFloatFormat(const Value: TFloatFormat); + procedure SetFloatPrecision(const Value: integer); + procedure SetFilterExpression(const Value: string); + procedure SetWidth(const Value: integer); + function GetWidth: integer; + procedure SetVisible(Value: Boolean); + function GetVisible: Boolean; + procedure ResetTotal; + procedure LoadTotal; + procedure SetTotal; + function CanBeSorted: boolean; + + protected + function CreateTitle: TColumnTitle; override; + procedure ChangedTitle(Rebild: boolean); + function GetFilterExpression(const RawFilter: string): string; + + public + constructor Create(Collection: TCollection); override; + procedure Assign(Source: TPersistent); override; + property TotalString: string read GetTotalString write FTotalString; + property TotalValue: Variant read GetTotalValue; + + published + property Width: integer read GetWidth write SetWidth; + property Visible: Boolean read GetVisible write SetVisible; + property FilterExpression: string read FFilterExpression write SetFilterExpression; + property MinWidth: integer read FMinWidth write FMinWidth default 0; + property SortOrder: TSortOrder read GetSortOrder write SetSortOrder default soNone; + property SortSequence: integer read GetSortSequence write SetSortSequence default 0; + property SummaryMode: TSummaryMode read FSummaryMode write SetSummaryMode default smNone; + property FloatFormat: TFloatFormat read FFloatFormat write SetFloatFormat default ffGeneral; + property FloatPrecision: integer read FFloatPrecision write SetFloatPrecision default 0; + property FloatDigits: integer read FFloatDigits write SetFloatDigits default 0; + + end; + + TCRDBGridColumns = class(TDBGridColumns) + private + function GetColumn(Index: Integer): TCRColumn; + procedure SetColumn(Index: Integer; Value: TCRColumn); + procedure ColumnAdded; + public + property Items[Index: Integer]: TCRColumn read GetColumn write SetColumn; default; + end; + +{ TGridTitleEdit } + + TCRGridTitleEdit = class(TCustomStaticText) + private + FCRDBGrid: TCRDBGrid; + FEdit: TEdit; + FAsFilter: boolean; + FActiveColumn: TColumn; + FFilterExpressions: array of string; + FEditingFilter: boolean; + + procedure SetCRDBGrid(const Value: TCRDBGrid); + procedure FEditKeyPress(Sender: TObject; var Key: char); + procedure WMMouseWheel(var Message: TWMMouseWheel); message WM_MOUSEWHEEL; + procedure FEditKeyDown(Sender: TObject; var Key: word; + Shift: TShiftState); + procedure FEditChange(Sender: TObject); + procedure FEditExit(Sender: TObject); + procedure ProcessEdit; + procedure WMGetDlgCode(var Message: TWMGetDlgCode); message WM_GETDLGCODE; + procedure GotoUpperCell; + procedure GotoLowerCell; + procedure GotoNextCell; + procedure GotoPrevCell; + procedure SetEditingFilter(const Value: boolean); + procedure PostFilter; + + protected + procedure PaintWindow(DC: HDC); override; + procedure KeyDown(var Key: word; Shift: TShiftState); override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; + X, Y: integer); override; + procedure DoExit; override; + procedure WMChar(var Message: TWMChar); message WM_CHAR; + + public + constructor Create(AOwner: TComponent); override; + procedure SetFocus; override; + procedure ActivateAt(ARect: TRect; ActiveColumn: TColumn; AsFilter: boolean); + procedure SetClientRect(ARect: TRect); + procedure StartEdit; + procedure StopEdit(AcceptChanges: boolean); + + property CRDBGrid: TCRDBGrid read FCRDBGrid write SetCRDBGrid; + property Edit: TEdit read FEdit; + property EditingFilter: boolean read FEditingFilter write SetEditingFilter; + end; + +{ TMemoEditorForm } + + TMemoEditorForm = class (TCustomForm) + private + FMemo: TMemo; + FOKBtn: TButton; + FCancelBtn: TButton; + FReadOnly: boolean; + FCheckBox: TCheckBox; + procedure SetReadOnly(const Value: boolean); + procedure MemoKeyDown(Sender: TObject; var Key: word; + Shift: TShiftState); + procedure CheckBoxClick(Sender: tobject); + public + constructor Create(AOwner: TComponent); override; + function CloseQuery: boolean; override; + property ReadOnly: boolean read FReadOnly write SetReadOnly; + end; + +{ TCRDBGrid } + + TCRDBGridOptionEx = (dgeEnableSort, dgeFilterBar, dgeLocalFilter, {$IFNDEF DAC450}dgeLocalSorting, {$ENDIF}dgeRecordCount, + dgeSearchBar, dgeStretch, dgeSummary); + TCRDBGridOptionsEx = set of TCRDBGridOptionEx; + + TGridDrawStateEx = set of (geHighlight, geActiveRow, geMultiSelected); + + TGetCellParamsEvent = procedure (Sender: TObject; Field: TField; + AFont: TFont; var Background: TColor; State: TGridDrawState; StateEx: TGridDrawStateEx) of object; + + TSortColInfo = class + public + Index: integer; + Desc: boolean; + end; + + TIndicatorColButton = (icbNone, icbMenu, icbFilter, icbSearch); + +{$IFDEF VER6P} + TCRGridDataLink = class(TGridDataLink) + protected + FDataSetChanging: boolean; + + procedure DataSetChanged; override; + end; +{$ENDIF} + + TCRDBGrid = class(TCustomDBGrid) + private + FDefaultDrawing: boolean; + FOptionsEx: TCRDBGridOptionsEx; + FSoft: boolean; + FOnGetCellParams: TGetCellParamsEvent; + FExecSorting: boolean; + FExecColAjust: boolean; + FSortInfo: TList; + FActiveRowSelected: boolean; + FTitleButtonDown: integer; + FTitleBarUp: boolean; + FOldTitleButtonDown: integer; + FCellButtonDown: integer; + FCellButtonRow: integer; + FCellButtonCol: integer; + FCellButtonPressed: boolean; + FCellButtonRect: TRect; + FCellButtonBRect: TRect; + FTotalYOffset: integer; + FOnMemoClick: TOnMemoClick; + FLevelDelimiterChar: char; + FIndicatorColBtnDown: TIndicatorColButton; + FOldIndicatorColBtnDown: TIndicatorColButton; + FOptionsMenu: TPopupMenu; + FOptionsMenuDef: TPopupMenu; + CRGridTitleEdit: TCRGridTitleEdit; + FStatusRect: TRect; + FFiltered: boolean; + FContinueEditingFilter: boolean; + FMemoWidth: integer; + FMemoHeight: integer; + FMemoWordWrap: boolean; + + procedure SetOptionsEx(Value: TCRDBGridOptionsEx); + procedure UpdateHeaderHeight; + procedure RecordChanged(Field: TField); + procedure DrawButton(X,Y: integer; State: boolean); + function IsOnButton(X, Y: integer): boolean; + function GetButtonRect(Cell: TGridCoord): TRect; + procedure SetLevelDelimiterchar(const Value: char); + procedure WMSetCursor(var Message: TWMSetCursor); message WM_SetCursor; + function CalcSearchBar(Column: TColumn): TRect; + function CalcFilterBar(Column: TColumn): TRect; + function MouseInFilterBar(X, Y: integer; Column: TColumn = nil): boolean; + function MouseInFilterEdit(X, Y: integer; Column: TColumn = nil): boolean; + function MouseInSortBar(X, Y: integer; Column: TColumn = nil): boolean; + function MouseInSortEdit(X,Y: integer;Column: TColumn = nil): boolean; + function MouseInLowerstLevel(X, Y: integer; Column: TColumn = nil): boolean; + procedure DoOnMemoClick(Column: TColumn); + + procedure DrawTitleBarCell(Canvas: TCanvas; Column: TColumn; Rect: TRect; Text: string); + procedure DrawTitleIndicatorCell(Canvas: TCanvas; ARect: TRect); + function GetIndicatorButton(X,Y: integer): TIndicatorColButton; + procedure IndicatorClick(Button: TIndicatorColButton; X, Y: integer); + procedure BuildMenu; + procedure FilteredItemClick(Sender: TObject); + procedure FilterItemClick(Sender: TObject); + procedure SearchItemClick(Sender: TObject); + procedure CalcTableSpacePercent; + procedure SetFiltered(const Value: boolean); + procedure UpdateRowCount; + function GetColumns: TCRDBGridColumns; + procedure SetColumns(const Value: TCRDBGridColumns); + + protected + FHeaderHeight: integer; + FExecSizing: boolean; + + function GetClientRect: TRect; override; + procedure Loaded; override; + function CreateColumns: TDBGridColumns; override; + {$IFDEF VER6P} + function CreateDataLink: TGridDataLink; override; + {$ENDIF} + + procedure Reorder; + function FindSortColInfo(Index: integer; var SortNum: integer): TSortColInfo; + + procedure ColWidthsChanged; override; + procedure Resize; override; + procedure ResizeColumns(ResizedColumn: integer = -1); + function EndColumnDrag(var Origin, Destination: integer; + const MousePt: TPoint): boolean; override; + + procedure DrawColumnCell(const Rect: TRect; DataCol: integer; + Column: TColumn; State: TGridDrawState); override; + procedure GetCellProps(Field: TField; AFont: TFont; var Background: TColor; + State: TGridDrawState; StateEx:TGridDrawStateEx); dynamic; + procedure DrawCell(ACol, ARow: Longint; ARect: TRect; AState: TGridDrawState); override; + + procedure KeyDown(var Key: word; Shift: TShiftState); override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; + X, Y: integer); override; + procedure MouseMove(Shift: TShiftState; X, Y: integer); override; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; + X, Y: integer); override; + + procedure LinkActive(Value: boolean); override; + procedure Paint;override; + procedure ResetTotals; + procedure LoadTotals; + function CanEditShow: boolean; override; + procedure TopLeftChanged; override; + procedure DoExit; override; + procedure WMMouseWheel(var Message: TWMMouseWheel); message WM_MOUSEWHEEL; + procedure TitleClick(Column: TColumn); override; + + procedure MoveColRow(ACol, ARow: Longint; MoveAnchor, Show: Boolean); + function DataToRawColumn(ACol: Integer): Integer; + procedure InvalidateCol(ACol: Longint); + procedure InvalidateRow(ARow: Longint); + + procedure LayoutChanged; override; + + property DefaultRowHeight; + property DataLink; + public + function GetGridSize: integer; + constructor Create(Owner: TComponent); override; + procedure DataChanged; //override; + destructor Destroy; override; + + procedure ClearSorting; + procedure ClearFilters; + procedure ActivateFilterEdit(Column: TColumn); + procedure ActivateSearchEdit(Column: TColumn); + + property Canvas; + property SelectedRows; + procedure CalcTitleLevel(Level: integer; var aRect: TRect); + function GetTitleLevel(Level: integer): TRect; + procedure ApplyFilter; + procedure AdjustColumns; + property Col; + property Row; + property TopRow; + property LeftCol; + property OptionsMenu: TPopupMenu read FOptionsMenu write FOptionsMenu; + + published + property DefaultDrawing: boolean read FDefaultDrawing write FDefaultDrawing + default True; + property LevelDelimiterChar: char read FLevelDelimiterchar write SetLevelDelimiterchar default '|'; + property Filtered: boolean read FFiltered write SetFiltered default True; + property OptionsEx: TCRDBGridOptionsEx read FOptionsEx write SetOptionsEx + default [dgeEnableSort, dgeLocalFilter, {$IFNDEF DAC450}dgeLocalSorting, {$ENDIF}dgeRecordCount]; + property OnMemoClick: TOnMemoClick read FOnMemoClick write FOnMemoClick; + property OnGetCellParams: TGetCellParamsEvent read FOnGetCellParams + write FOnGetCellParams; + + property Align; + property Anchors; + property BiDiMode; + property BorderStyle; + property Color; + property Columns: TCRDBGridColumns read GetColumns write SetColumns stored False; + property Constraints; + property Ctl3D; + property DataSource; + property DragCursor; + property DragMode; + property Enabled; + property FixedColor; + property Font; + property ImeMode; + property ImeName; + property Options; + property ParentBiDiMode; + property ParentColor; + property ParentCtl3D; + property ParentFont; + property ParentShowHint; + property PopupMenu; + property ReadOnly; + property ShowHint; + property TabOrder; + property TabStop; + property TitleFont; + property Visible; + property OnCellClick; + property OnColEnter; + property OnColExit; + property OnColumnMoved; + property OnDrawDataCell; { obsolete } + property OnDrawColumnCell; + property OnDblClick; + property OnDragDrop; + property OnDragOver; + property OnEditButtonClick; + property OnEndDock; + property OnEndDrag; + property OnEnter; + property OnExit; + property OnKeyDown; + property OnKeyPress; + property OnKeyUp; + property OnMouseDown; + property OnMouseMove; + property OnMouseUp; + property OnStartDock; + property OnStartDrag; + property OnTitleClick; + end; + +resourcestring + SFiltered = 'Filtered'; + SFilterBar = 'Filter bar'; + SSearchBar = 'Search bar'; + sWordWrap = 'Word Wrap'; + SOK = '&OK'; + SCancel = '&Cancel'; + SClose = '&Close'; + fmtModifiedWarning = 'Field "%s" is modified. Save?'; + +implementation + +uses + Math, CRParser, MemDS +{$IFDEF CLR} + ,MemUtils ,System.Threading, Types, WinUtils +{$ENDIF} + ; + +{$R CRGrid.res} + +var + bmpSortAsc: TBitmap; + bmpSortDesc: TBitmap; + DrawBitmap: TBitmap; + bmpFilter: TBitmap; + bmpSearch: TBitmap; + bmpMenu: TBitmap; + bmpActiveFilter: TBitmap; + bmpEditMode: TBitmap; + UserCount: integer; + +type + TInthernalEdit = class(TEdit) + end; + +{$IFNDEF CLR} + _TCustomGrid = class(TCustomGrid) + end; +{$ENDIF} + +function GetCaptionDepth(const Str: string; Delim: char): integer; +var + i: integer; + St: string; +begin + Result := 0; + if Str = '' then + Exit; + Result := 1; + i := Pos(Delim, Str); + St := Str; + while i > 0 do begin + Inc(Result); + St[i] := #255; + i := Pos(Delim, St); + end; +end; + +function GetCaptionLevel(const Str: string; Level: integer; Delim: char): string; +var + i,j: integer; + St: string; +begin + j := 0; + Result := ''; + if Str = '' then + Exit; + i := Pos(Delim, Str); + St := Str; + while (Level > 0) and (I > 0) do begin + Dec(Level); + St[i] := #255; + if Level <= -2 then begin + Result := Copy(St, j + 1, i - 1); + exit; + end; + j := i; + i := Pos(Delim, St); + end; + if Level <= 0 then begin + if i = 0 then + i := Length(St) + j + else + Dec(i); + Result := Copy(Str, j + 1, i - j); + exit; + end; +end; + +{ TCRColumn } + +function TCRColumn.GetSortOrder: TSortOrder; +var + SortColInfo: TSortColInfo; + NumSort: integer; +begin + if not CanBeSorted then begin + Result := soNone; + exit; + end; + SortColInfo := TCRDBGrid(Grid).FindSortColInfo(Index, NumSort); + + if SortColInfo <> nil then + if SortColInfo.Desc then + Result := soDesc + else + Result := soAsc + else + Result := soNone; +end; + +procedure TCRColumn.SetSortOrder(Value: TSortOrder); +var + SortColInfo: TSortColInfo; + NumSort: integer; +begin + if not CanBeSorted then + Exit; + + SortColInfo := TCRDBGrid(Grid).FindSortColInfo(Index, NumSort); + if SortColInfo <> nil then begin + case Value of + soNone: begin + if NumSort > 0 then + Dec(NumSort); + TSortColInfo(TCRDBGrid(Grid).FSortInfo[NumSort]).Free; + TCRDBGrid(Grid).FSortInfo.Delete(NumSort) + end; + soAsc: + SortColInfo.Desc := False; + soDesc: + SortColInfo.Desc := True; + end; + TCRDBGrid(Grid).Reorder; + end + else + if Value <> soNone then begin + SortColInfo := TSortColInfo.Create; + SortColInfo.Index := Index; + SortColInfo.Desc := Value = soDesc; + TCRDBGrid(Grid).FSortInfo.Add(SortColInfo); + TCRDBGrid(Grid).Reorder; + end; +end; + +function TCRColumn.GetSortSequence: integer; +begin + TCRDBGrid(Grid).FindSortColInfo(Index, Result); +end; + +procedure TCRColumn.SetFilterExpression(const Value: string); +begin + FFilterExpression := Value; +end; + +procedure TCRColumn.SetSortSequence(Value: integer); +begin +end; + +function TCRColumn.GetTotalString: string; +begin + if Assigned(Field) and (Field.DataSet.Active) then + if (FSummaryMode = smNone) then + Result := '' + else begin + if not FTotalLoaded then + LoadTotal; + Result := FTotalString + end + else + Result := ''; +end; + +function TCRColumn.GetTotalValue: Variant; +begin + Result := Unassigned; + if Assigned(Field) and (Field.DataSet.Active) then + if (SummaryMode = smLabel) then + Result := FTotalString + else + if (FSummaryMode = smNone) then + Result := Unassigned + else begin + if not FTotalLoaded then + LoadTotal; + Result := FTotalValue + end + else + Result := Unassigned; +end; + +procedure TCRColumn.ResetTotal; +begin + FTotalLoaded := False; +end; + +procedure TCRColumn.LoadTotal; +begin + if (SummaryMode <> smLabel) and Assigned (Field) then begin + TCRDBGrid(Grid).LoadTotals; + if Assigned (Field) then + case Field.DataType of + ftSmallint, ftInteger, ftWord, ftLargeint: + if SummaryMode = smAvr then + begin + FTotalValue := FTotalFloat; + FTotalString := FloatToStrF(FTotalFloat, FFloatFormat, FFloatPrecision, FFloatDigits) + end + else + begin + FTotalValue := {$IFNDEF VER6P}Integer({$ENDIF}FTotalInt{$IFNDEF VER6P}){$ENDIF}; + FTotalString := IntToStr(FTotalInt); + end; + ftFloat, ftCurrency: + begin + FTotalValue := FTotalFloat; + FTotalString := FloatToStrF(FTotalFloat, FFloatFormat, FFloatPrecision, FFloatDigits); + end; + else + begin + FTotalValue := Unassigned; + FTotalString := ''; + end; + end + end; +end; + +procedure TCRColumn.SetSummaryMode(Value: TSummaryMode); +begin + if Value <> smNone then + if (Value <> smLabel) and Assigned(Field) then + if not (Field.DataType in [ftSmallint, ftInteger, ftWord, ftLargeint, ftFloat, ftCurrency]) then + Value := smNone; + if FSummaryMode <> Value then begin + FSummaryMode := Value; + ResetTotal; + if Assigned(Grid) then + Grid.Invalidate; + end; +end; + +procedure TCRColumn.SetTotal; +begin + FTotalLoaded := True; + if (SummaryMode <> smLabel) and Assigned (Field) then + case Field.DataType of + ftSmallint, ftInteger, ftWord, ftLargeint: + if SummaryMode = smAvr then + begin + FTotalValue := FTotalFloat; + FTotalString := FloatToStrF(FTotalFloat, FFloatFormat, FFloatPrecision, FFloatDigits) + end + else + begin + FTotalValue := {$IFNDEF VER6P}Integer({$ENDIF}FTotalInt{$IFNDEF VER6P}){$ENDIF}; + FTotalString := IntToStr(FTotalInt); + end; + ftFloat, ftCurrency: + begin + FTotalValue := FTotalFloat; + FTotalString := FloatToStrF(FTotalFloat, FFloatFormat, FFloatPrecision, FFloatDigits); + end; + else + begin + FTotalValue := Unassigned; + FTotalString := ''; + end; + end +end; + +procedure TCRColumn.SetFloatDigits(const Value: integer); +begin + FFloatDigits := Value; + if (SummaryMode <> smLabel) and Assigned (Field) then begin + case Field.DataType of + ftSmallint, ftInteger, ftWord, ftLargeint: + if SummaryMode = smAvr then + FTotalString := FloatToStrF(FTotalFloat,FFloatFormat,FFloatPrecision,FFloatDigits); + ftFloat, ftCurrency: + FTotalString := FloatToStrF(FTotalFloat,FFloatFormat,FFloatPrecision,FFloatDigits); + end; + if Assigned(Grid)then + Grid.Invalidate; + end; +end; + +procedure TCRColumn.SetFloatFormat(const Value: TFloatFormat); +begin + FFloatFormat := Value; + if (SummaryMode <> smLabel) and Assigned(Field) then begin + case Field.DataType of + ftSmallint, ftInteger, ftWord, ftLargeint: + if SummaryMode = smAvr then + FTotalString := FloatToStrF(FTotalFloat, FFloatFormat, FFloatPrecision, FFloatDigits); + ftFloat, ftCurrency: + FTotalString := FloatToStrF(FTotalFloat, FFloatFormat, FFloatPrecision, FFloatDigits); + end; + if Assigned(Grid) then + Grid.Invalidate; + end; +end; + +procedure TCRColumn.SetFloatPrecision(const Value: integer); +begin + FFloatPrecision := Value; + if (SummaryMode <> smLabel) and Assigned(Field) then begin + case Field.DataType of + ftSmallint, ftInteger, ftWord, ftLargeint: + if SummaryMode = smAvr then + FTotalString := FloatToStrF(FTotalFloat, FFloatFormat, FFloatPrecision, FFloatDigits); + ftFloat, ftCurrency: + FTotalString := FloatToStrF(FTotalFloat, FFloatFormat, FFloatPrecision, FFloatDigits); + end; + if Assigned(Grid) then + Grid.Invalidate; + end; +end; + +procedure TCRColumn.Assign(Source: TPersistent); +begin + if Source is TCRColumn then begin + if Assigned(Collection) then + Collection.BeginUpdate; + inherited Assign(Source); + try + FSummaryMode := TCRColumn(Source).FSummaryMode; + FMinWidth := TCRColumn(Source).FMinWidth; + FTotalString := TCRColumn(Source).FTotalString; + FTotalValue := TCRColumn(Source).FTotalValue; + FTotalLoaded := TCRColumn(Source).FTotalLoaded; + FSummaryMode := TCRColumn(Source).FSummaryMode; + FTotalFloat := TCRColumn(Source).FTotalFloat; + FTotalInt := TCRColumn(Source).FTotalInt; + FFloatDigits := TCRColumn(Source).FFloatDigits; + FFloatPrecision := TCRColumn(Source).FFloatPrecision; + FFloatFormat := TCRColumn(Source).FFloatFormat; + finally + if Assigned(Collection) then + Collection.EndUpdate; + end; + end + else + inherited Assign(Source); +end; + +function TCRColumn.CanBeSorted: boolean; +begin + if Assigned(Field) then + Result := {$IFNDEF DAC600} (Field.FieldKind = fkData) and {$ENDIF} not (Field.DataType in [ftFmtMemo, + ftMemo{$IFNDEF VER4}, ftOraClob {$ENDIF}]) + else + Result := False; +end; + +function TCRColumn.GetFilterExpression(const RawFilter: string): string; + + function GetSignString(var ConstStr: string): string; + var + Buf: string; + begin + Result := ''; + ConstStr := ''; + Buf := Trim(RawFilter); + if Buf = '' then + Exit; + + case Buf[1] of + '=': begin + Result := '='; + ConstStr := Copy(Buf, 2, Length(Buf) - 1); + end; + '<', '>': begin + if (Length(Buf) >= 2) and ((Buf[2] = '=') or (Buf[2] = '>')) then begin + Result := Copy(Buf, 1, 2); + ConstStr := Copy(Buf, 3, Length(Buf) - 2); + end + else begin + Result := Buf[1]; + ConstStr := Copy(Buf, 2, Length(Buf) - 1); + end; + end; + else + begin + Result := '='; + ConstStr := Copy(Buf, 1, Length(Buf)); + end; + end; + ConstStr := TrimLeft(ConstStr); + end; + +var + Sign, ConstStr: string; + s: string; + i: integer; +begin + Result := ''; + if RawFilter = '' then + Exit; + if Assigned (Field) then begin + Sign := GetSignString(ConstStr); + if (Sign = '') or (ConstStr = '') then + Exit; + case Field.DataType of + ftSmallint, ftInteger, ftWord, ftLargeint: + StrToInt(ConstStr); // test for exception + ftFloat, ftCurrency: + StrToFloat(ConstStr); // test for exception + ftDate: begin + StrToDate(ConstStr); // test for exception + ConstStr := '''' + ConstStr + ''''; + end; + ftDateTime: begin + StrToDateTime(ConstStr); // test for exception + ConstStr := '''' + ConstStr + ''''; + end; + ftTime: begin + StrToTime(ConstStr); // test for exception + ConstStr := '''' + ConstStr + ''''; + end; + ftString,ftWideString: begin + if not (dgeLocalFilter in TCRDBGrid(Grid).OptionsEx) + and ((Sign = '=') or (Sign = '<>')) then begin + for i := 1 to Length(ConstStr) do + if ConstStr[i] = '*' then + ConstStr[i] := '%'; + if Sign = '=' then + Sign := ' LIKE ' + else + Sign := ' NOT LIKE '; + end; + if (Field.DataSet is TCustomDADataSet) and (TCustomDADataSet(Field.DataSet).Options.QuoteNames) then + Result := TDBAccessUtils.QuoteName(TCustomDADataSet(Field.DataSet), Field.FieldName) + Sign + + AnsiQuotedStr(ConstStr,'''') + else + Result := Field.FieldName + Sign + AnsiQuotedStr(ConstStr,''''); + Exit; + end; + ftBoolean: begin /// (cr12227) + if (TBooleanField(Field).DisplayValues <> '') and (pos(';', TBooleanField(Field).DisplayValues) > 0) then begin + s := copy(TBooleanField(Field).DisplayValues, 0, pos(';', TBooleanField(Field).DisplayValues) - 1); + if AnsiUpperCase(ConstStr) = AnsiUpperCase(s) then begin + result := Field.FieldName + Sign + 'True'; + Exit; + end + else begin + s := copy(TBooleanField(Field).DisplayValues, pos(';', TBooleanField(Field).DisplayValues) + 1, length(TBooleanField(Field).DisplayValues)); + if AnsiUpperCase(ConstStr) = AnsiUpperCase(s) then begin + result := Field.FieldName + Sign + 'False'; + Exit; + end; + end; + end; + end; + end; + end; + Result := Field.FieldName + Sign + ConstStr; +end; + +procedure TCRColumn.ChangedTitle(Rebild: boolean); +begin + if Rebild then + if Assigned(Grid) then + TCRDBGrid(Grid).LayoutChanged; +end; + +function TCRColumn.CreateTitle: TColumnTitle; +begin + Result := TCRColumnTitle.Create(Self); +end; + +constructor TCRColumn.Create(Collection: TCollection); +begin + inherited; + FMinWidth := 0; + TCRDBGridColumns(Collection).ColumnAdded; +end; + +procedure TCRColumn.SetWidth(const Value: integer); +begin + if Value > FMinWidth then + inherited Width := Value + else + inherited Width := FMinWidth + //if assigned(grid) then + // FTableSpaceProcent := Width / TCRDBGrid(grid).GetGridSize; +end; + +function TCRColumn.GetWidth: integer; +begin + Result := inherited Width; +end; + +procedure TCRColumn.SetVisible(Value: Boolean); +var + OldVisible: boolean; +begin + OldVisible := inherited Visible; + + inherited Visible := Value; + + if (OldVisible <> Value) and Assigned(Grid) and + (dgeStretch in TCRDBGrid(Grid).OptionsEx) and (not TCRDBGrid(Grid).FExecSizing) then + begin + TCRDBGrid(Grid).FExecSizing := True; + TCRDBGrid(Grid).ResizeColumns; + TCRDBGrid(Grid).FExecSizing := False; + end; +end; + +function TCRColumn.GetVisible: Boolean; +begin + Result := inherited Visible; +end; + +{ TCRDBGridColumns } + +function TCRDBGridColumns.GetColumn(Index: Integer): TCRColumn; +begin + Result := TCRColumn(inherited Items[Index]); +end; + +procedure TCRDBGridColumns.SetColumn(Index: Integer; Value: TCRColumn); +begin + inherited Items[Index] := Value; +end; + +procedure TCRDBGridColumns.ColumnAdded; +begin + TCRDBGrid(Grid).CalcTableSpacePercent; +end; + +{ TCRDBGrid } + +procedure UsesBitmap; +begin + if UserCount = 0 then + DrawBitmap := TBitmap.Create; + Inc(UserCount); +end; + +procedure ReleaseBitmap; +begin + Dec(UserCount); + if UserCount = 0 then + DrawBitmap.Free; +end; + +constructor TCRDBGrid.Create(Owner: TComponent); +begin + inherited Create(Owner); + Columns.State := csDefault; + FSortInfo := TList.Create; + FOptionsMenuDef := TPopupMenu.Create(Self); + FFiltered := True; + UsesBitmap; + FOnMemoClick := nil; + FLevelDelimiterChar := '|'; + inherited DefaultDrawing := False; + FDefaultDrawing := True; + FSoft := False; + SetOptionsEx([dgeEnableSort, dgeLocalFilter, {$IFNDEF DAC450}dgeLocalSorting, {$ENDIF}dgeRecordCount]); + DefaultColWidth := 60; // DEBUG + + FExecSizing := False; + FTitleButtonDown := -1; + FOldTitleButtonDown := -1; + FIndicatorColBtnDown := icbNone; + FOldIndicatorColBtnDown := icbNone; + FCellButtonDown := -1; + CRGridTitleEdit := TCRGridTitleEdit.Create(Self); + InsertControl(CRGridTitleEdit); + BuildMenu; +end; + +procedure TCRDBGRid.ActivateSearchEdit(Column: TColumn); +var + CellRect: TRect; +begin + if not (Assigned(Column) and (dgeSearchBar in OptionsEx)) then + Exit; + CellRect := CalcSearchBar(Column); + InflateRect(CellRect, -5, -5); + if not (dgRowLines in Options) then + Dec(CellRect.Top); + CRGridTitleEdit.ActivateAt(CellRect, Column, False); +end; + +destructor TCRDBGrid.Destroy; +begin + ReleaseBitmap; + ClearSorting; + ClearFilters; + FSortInfo.Free; + FOptionsMenuDef.Free; + + inherited; +end; + +procedure TCRDBGrid.Loaded; +var + Stretched: Boolean; +begin + Stretched := False; + if dgeStretch in OptionsEx then begin + Stretched := True; + Exclude(FOptionsEx, dgeStretch); + end; + inherited; + if Stretched then Include(FOptionsEx, dgeStretch); + CalcTableSpacePercent; + FOptionsMenuDef.Items[0].Checked := FFiltered; + FOptionsMenuDef.Items[2].Checked := dgeFilterBar in OptionsEx; + FOptionsMenuDef.Items[3].Checked := dgeSearchBar in OptionsEx; + +end; + +function TCRDBGrid.CreateColumns: TDBGridColumns; +begin + Result := TCRDBGridColumns.Create(Self, TCRColumn); +end; + +{$IFDEF VER6P} +function TCRDBGrid.CreateDataLink: TGridDataLink; +begin + Result := TCRGridDataLink.Create(Self); +end; +{$ENDIF} + +procedure TCRDBGrid.Resize; +begin + inherited; + + CRGridTitleEdit.StopEdit(False); + if (dgeStretch in FOptionsEx) and not(csLoading in ComponentState) and + (not FExecSizing) then begin + FExecSizing := True; + try + ResizeColumns; + finally + FExecSizing := False; + end; + end; + if CRGridTitleEdit.Focused then begin + if CRGridTitleEdit.FAsFilter then + ActivateFilterEdit(CRGridTitleEdit.FActiveColumn) + else + ActivateSearchEdit(CRGridTitleEdit.FActiveColumn); + end; + Invalidate; +end; + +procedure TCRDBGrid.ColWidthsChanged; +var + i: integer; + ResizedColumn: integer; +begin + if (dgeStretch in FOptionsEx) and not(csLoading in ComponentState) and + (not FExecSizing) then begin + FExecSizing := True; + ResizedColumn := -1; + for i := 0 to Columns.Count - 1 do + if ColWidths[i + IndicatorOffset] <> Columns[i].Width then begin + ResizedColumn := i; + break; + end; + + if ResizedColumn <> -1 then begin + if ColWidths[ResizedColumn + IndicatorOffset] <= TCRColumn(Columns[ResizedColumn]).MinWidth then + ColWidths[ResizedColumn + IndicatorOffset] := TCRColumn(Columns[ResizedColumn]).MinWidth; + + ResizeColumns(ResizedColumn); + //ResizeColumns(-1); + end; + + FExecSizing := False; + end + else + if not (csLoading in ComponentState) and (not FExecSizing) then + CalcTableSpacePercent; + + inherited; +end; + +function TCRDBGrid.GetGridSize: integer; +begin + Result := ClientWidth - 1; + if dgIndicator in Options then + Dec(Result, IndicatorWidth); + if dgColLines in Options then + Dec(Result, Columns.Count*GridLineWidth); +end; + +procedure TCRDBGrid.ResizeColumns(ResizedColumn: integer); +const + MinWidth = 10; +var + i: integer; + GridSize, ColumnsSize:integer; + UnresizedSize: integer; + K: double; + Curr,Prev: double; + Width: integer; + MinimizeRest: boolean; + VisiblePercent: double; + //Sized : integer; + + function Max(i1,i2: integer): integer; + begin + if i1 > i2 then + Result := i1 + else + Result := i2 + end; + +begin + if Columns.Count = 0 then + Exit; + + GridSize := ClientWidth - 1; + if dgIndicator in Options then + Dec(GridSize, IndicatorWidth); + if dgColLines in Options then + for i := 0 to Columns.Count - 1 do + if TCRColumn(Columns[i]).Visible then + Dec(GridSize, GridLineWidth); + + if ResizedColumn > -1 then begin + ColumnsSize := 0; + UnresizedSize := 0; + MinimizeRest := False; + for i := 0 to Columns.Count - 1 do begin + if i <= ResizedColumn then begin + Inc(UnresizedSize, ColWidths[i + IndicatorOffset]); + if i = ResizedColumn then + if ColumnsSize + ColWidths[i + IndicatorOffset] + + (Columns.Count - i) * MinWidth > GridSize then begin + ColWidths[i + IndicatorOffset] := GridSize - ColumnsSize - + (Columns.Count - i - 1) * MinWidth; + MinimizeRest := True; + end + else + if i = Columns.Count - 1 then + ColWidths[i + IndicatorOffset] := GridSize - ColumnsSize; + end + else + if MinimizeRest {(ResizedColumn >= 0) and (ColumnsSize + (Columns.Count - i)*MinWidth >= GridSize)} then + ColWidths[i + IndicatorOffset] := MinWidth; + + Inc(ColumnsSize, ColWidths[i + IndicatorOffset]); + end; + + if ColumnsSize = UnresizedSize then + Exit; + + K := (GridSize - UnresizedSize) / (ColumnsSize - UnresizedSize); + + ColumnsSize := 0; + Prev := 0; + for i := 0 to Columns.Count - 1 do begin + if i <= ResizedColumn then + Curr := Prev + ColWidths[i + IndicatorOffset] + else + begin + Curr := Prev + ColWidths[i + IndicatorOffset]*K; + + if i < Columns.Count - 1 then + Width := Round(Curr - Prev) + else + Width := GridSize - ColumnsSize; + + if Width < TCRColumn(Columns[i]).MinWidth then + Width := TCRColumn(Columns[i]).MinWidth; + ColWidths[i + IndicatorOffset] := Width; + end; + Inc(ColumnsSize, ColWidths[i + IndicatorOffset]); + Prev := Curr; + end; + CalcTableSpacePercent; + end + else begin // for full resize + Inc(GridSize,2); + if (dgeStretch in FOptionsEx) then begin + VisiblePercent := 0; + for i := 0 to Columns.Count - 1 do + if TCRColumn(Columns[i]).Visible then + VisiblePercent := VisiblePercent + TCRColumn(Columns[i]).FTableSpacePercent; + if VisiblePercent < 0.0001 then + VisiblePercent := 1; + end + else + VisiblePercent := 1; + for i := 0 to Columns.Count - 1 do + ColWidths[i + IndicatorOffset] := Trunc(TCRColumn(Columns[i]).FTableSpacePercent * GridSize / VisiblePercent); + end; +end; + +{ Grid drawing } + +procedure TCRDBGrid.GetCellProps(Field: TField; AFont: TFont; + var Background: TColor; State: TGridDrawState; StateEx: TGridDrawStateEx); +begin + if Assigned(FOnGetCellParams) then + FOnGetCellParams(Self, Field, AFont, Background, State, StateEx); +end; + +procedure WriteText(ACanvas: TCanvas; ARect: TRect; DX, DY: integer; + const Text: string; Alignment: TAlignment; ARightToLeft: boolean); +const + AlignFlags : array [TAlignment] of integer = + ( DT_LEFT or DT_WORDBREAK or DT_EXPANDTABS or DT_NOPREFIX, + DT_RIGHT or DT_WORDBREAK or DT_EXPANDTABS or DT_NOPREFIX, + DT_CENTER or DT_WORDBREAK or DT_EXPANDTABS or DT_NOPREFIX ); + RTL: array [boolean] of integer = (0, DT_RTLREADING); +var + B, R: TRect; + Hold, Left: integer; + I: TColorRef; +begin + I := ColorToRGB(ACanvas.Brush.Color); + if GetNearestColor(ACanvas.Handle, I) = I then + begin { Use ExtTextOut for solid colors } + { In BiDi, because we changed the window origin, the text that does not + change alignment, actually gets its alignment changed. } + if (ACanvas.CanvasOrientation = coRightToLeft) and (not ARightToLeft) then + ChangeBiDiModeAlignment(Alignment); + case Alignment of + taLeftJustify: + Left := ARect.Left + DX; + taRightJustify: + Left := ARect.Right - ACanvas.TextWidth(Text) - 3; + else { taCenter } + Left := ARect.Left + (ARect.Right - ARect.Left) shr 1 + - (ACanvas.TextWidth(Text) shr 1); + end; + ACanvas.TextRect(ARect, Left, ARect.Top + DY, Text); + end + else begin { Use FillRect and Drawtext for dithered colors } + DrawBitmap.Canvas.Lock; + try + with DrawBitmap, ARect do { Use offscreen bitmap to eliminate flicker and } + begin { brush origin tics in painting / scrolling. } + Width := Max(Width, Right - Left); + Height := Max(Height, Bottom - Top); + R := Rect(DX, DY, Right - Left - 1, Bottom - Top - 1); + B := Rect(0, 0, Right - Left, Bottom - Top); + end; + with DrawBitmap.Canvas do + begin + Font := ACanvas.Font; + Font.Color := ACanvas.Font.Color; + Brush := ACanvas.Brush; + Brush.Style := bsSolid; + FillRect(B); + SetBkMode(Handle, TRANSPARENT); + if (ACanvas.CanvasOrientation = coRightToLeft) then + ChangeBiDiModeAlignment(Alignment); + DrawText(Handle, PChar(Text), Length(Text), R, + AlignFlags[Alignment] or RTL[ARightToLeft]); + end; + if (ACanvas.CanvasOrientation = coRightToLeft) then + begin + Hold := ARect.Left; + ARect.Left := ARect.Right; + ARect.Right := Hold; + end; + ACanvas.CopyRect(ARect, DrawBitmap.Canvas, B); + finally + DrawBitmap.Canvas.Unlock; + end; + end; +end; + +function TCRDBGrid.GetButtonRect(Cell: TGridCoord): TRect; +var + aCellRect: TRect; +begin + aCellRect := CellRect(Cell.X, Cell.Y); + if (aCellRect.Right - aCellRect.Left < aCellRect.Bottom - aCellRect.Top + 5) + then begin + Result := Rect(0,0,0,0); + exit; + end; + Result.Left := aCellRect.Right - (aCellRect.Bottom - aCellRect.Top)+1; + Result.Right := aCellRect.Right-1; + Result.Top := aCellRect.Top+1; + Result.Bottom := aCellRect.Bottom-1; +end; + +function TCRDBGrid.IsOnButton(X, Y: integer): boolean; +var + Cell: TGridCoord; + Column: TColumn; + aCellRect: TRect; + ButtonRect: TRect; +begin + Cell := MouseCoord(X,Y); + Column := Columns[RawToDataColumn(Cell.X)]; + // detecting - is there a button on cell? + if Assigned(Column.Field) then + Result := Column.Field.DataType in [ftMemo,ftFmtMemo + {$IFNDEF VER4}, ftOraClob {$ENDIF}] + else + Result := False; + aCellRect := CellRect(Cell.X, Cell.Y); + //Result := Result and (gdSelected in State); + if Result and (aCellRect.Right - aCellRect.Left < aCellRect.Bottom - aCellRect.Top + 5) then + Result := False; + if Result then begin // button present + ButtonRect := GetButtonRect(Cell); + Result := PtInRect(ButtonRect,Point(X,Y)) + end + else // there is no button on cell + Result := False; +end; + +procedure TCRDBGrid.DrawButton(X,Y: integer; State: boolean); +var + ButtonRect: TRect; + Cell: TGridCoord; + Hi, i, Diam: integer; + Flag: integer; +begin + Cell.X := X; Cell.Y := Y; + ButtonRect := GetButtonRect(Cell); + Canvas.Brush.Style := bsSolid; + Canvas.Brush.Color := clBtnFace; + Canvas.FillRect(ButtonRect); + Canvas.Pen.Color := clBlack; + Canvas.Pen.Style := psSolid; + Canvas.Brush.Color := clBlack; + + if State then + Flag := BDR_SUNKENINNER + else + Flag := BDR_RAISEDINNER; + + DrawEdge(Canvas.Handle, ButtonRect, Flag, BF_TOPLEFT ); + InflateRect(ButtonRect, -1, -1); + DrawEdge(Canvas.Handle, ButtonRect, Flag, BF_BOTTOMRIGHT); + InflateRect(ButtonRect, 1, 1); + Canvas.MoveTo(ButtonRect.Left, ButtonRect.Bottom - 1); + Canvas.LineTo(ButtonRect.Right - 1, ButtonRect.Bottom - 1); + Canvas.LineTo(ButtonRect.Right - 1, ButtonRect.Top - 1); + + Diam := (ButtonRect.Bottom - ButtonRect.Top) div 7; + Hi := (ButtonRect.Bottom - ButtonRect.Top - Diam) div 2; + inc(ButtonRect.Left,Diam * 2 - 1); + if State then begin + inc(ButtonRect.Left); + inc(ButtonRect.Top); + end; + for i := 0 to 2 do + Canvas.Ellipse(ButtonRect.Left + i * Diam * 2 ,ButtonRect.Top + Hi, ButtonRect.Left + i * Diam * 2 + Diam, ButtonRect.Top + Hi + Diam); +end; + +procedure TCRDBGrid.DrawColumnCell(const Rect: TRect; DataCol: integer; + Column: TColumn; State: TGridDrawState); +const + ThreeDot = '...'; +var + NewBackgrnd: TColor; + Field: TField; + Value: string; + TextWidth: integer; + ThreeDotWidth: integer; + Alignment: TAlignment; + ColWidth: integer; + StateEx: TGridDrawStateEx; + TextMargin: integer; + i: integer; + isDrawButton: boolean; + OldCanvasFont : TFont; + +begin + Field := Column.Field; + if Assigned(Column.Field) then begin + Value := Column.Field.DisplayText; + isDrawButton := Column.Field.DataType in [ftMemo, ftFmtMemo + {$IFNDEF VER4}, ftOraClob {$ENDIF}]; + end + else begin + Value := ''; + isDrawButton := False; + end; + + isDrawButton := isDrawButton and (gdSelected in State) + and not (dgRowSelect in Options); + if isDrawButton and (Rect.Right - Rect.Left < Rect.Bottom - Rect.Top + 5) then + isDrawButton := False; + Alignment := Column.Alignment; + + if Alignment = taRightJustify then + TextMargin:= 4 + else + TextMargin := 2; + + ThreeDotWidth := Canvas.TextWidth(ThreeDot); + TextWidth := Canvas.TextWidth(Value) + TextMargin; + + OldCanvasFont := TFont.Create; + OldCanvasFont.Assign(Canvas.Font); + try + ColWidth := Column.Width; // changes font and brush + Canvas.Font.Assign(OldCanvasFont); + finally + OldCanvasFont.Free; + end; + + if isDrawButton then begin + ColWidth := ColWidth - (Rect.Bottom - Rect.Top); + end; + if TextWidth > ColWidth then begin + if Field is TNumericField then begin + for i := 1 to Length(Value) do + if (Value[i] >= '0') and (Value[i] <= '9') then + Value[i] := '#'; + end + else begin + while (TextWidth > ColWidth) and (Length(Value) > 1) do begin + SetLength(Value, Length(Value) - 1); + TextWidth := Canvas.TextWidth(Value) + TextMargin + ThreeDotWidth; + end; + Value := Value + ThreeDot; + end; + Alignment := taLeftJustify; + end; + + if HighlightCell(Col, Row, Value, State) then begin + Include(StateEx, geHighlight); + if not FActiveRowSelected then + Include(StateEx, geMultiSelected); + end; + if FActiveRowSelected then + Include(StateEx, geActiveRow); + + if HighlightCell(Col, Row, Value, State) then begin + Canvas.Brush.Color := clHighlight; + Canvas.Font.Color := clHighlightText; + end; + + if Enabled then begin + NewBackgrnd := Canvas.Brush.Color; + + GetCellProps(Field, Canvas.Font, NewBackgrnd, State, StateEx); + Canvas.Brush.Color := NewBackgrnd; + end + else + Canvas.Font.Color := clGrayText; + + if FDefaultDrawing then + WriteText(Canvas, Rect, 2, 2, Value, Alignment, + UseRightToLeftAlignmentForField(Column.Field, Alignment)); + + if FDefaultDrawing and (gdSelected in State) + and ((dgAlwaysShowSelection in Options) or Focused) + and not (csDesigning in ComponentState) + and not (dgRowSelect in Options) + and (UpdateLock = 0) + and (ValidParentForm(Self).ActiveControl = Self) + then + Windows.DrawFocusRect(Canvas.Handle, Rect); + + inherited DrawColumnCell(Rect, DataCol, Column, State); + if isDrawButton then + if FCellButtonDown > -1 then + DrawButton(Col, Row, FCellButtonPressed) + else + DrawButton(COl, Row, False); +end; + +procedure TCRDBGrid.ClearSorting; +var + i: integer; +begin + for i := 0 to FSortInfo.Count - 1 do + TSortColInfo(FSortInfo[i]).Free; + FSortInfo.Clear; +end; + +procedure TCRDBGrid.ClearFilters; +var + i: integer; +begin + for i := 0 to Columns.Count - 1 do + TCRColumn(Columns[i]).FilterExpression := ''; +end; + +function TCRDBGrid.FindSortColInfo(Index: integer; var SortNum: integer): TSortColInfo; +var + i: integer; +begin + Result := nil; + SortNum := 0; + for i := 0 to FSortInfo.Count - 1 do + if TSortColInfo(FSortInfo[i]).Index = Index then begin + Result := TSortColInfo(FSortInfo[i]); + if FSortInfo.Count > 1 then + SortNum := i + 1; + break; + end; +end; + +function TCRDBGrid.GetTitleLevel(Level: integer): TRect; +begin + if Columns.Count = 0 then begin + Result := Rect(0, 0, 0, 0); + Exit; + end; + Result.Top := Level*(DefaultRowHeight + 1); + Result.Bottom := Result.Top + (DefaultRowHeight + 1); + Result.Left := 0; + Result.Right := 0; + if dgRowLines in Options then + dec(Result.Bottom); +end; + +procedure TCRDBGrid.CalcTitleLevel(Level: integer; var aRect: TRect); +var + X: TRect; +begin + if Columns.Count = 0 then begin + aRect.Top := 0; + aRect.Bottom:= 0; + Exit; + end; + X := GetTitleLevel(Level); + aRect.Top := X.Top; + aRect.Bottom := X.Bottom; +end; + +procedure TCRDBGrid.DrawCell(ACol,ARow: longint; ARect: TRect; AState: TGridDrawState); +var + FrameOffs: Byte; + + procedure DrawTitleCell(ACol, ARow: integer; Column: TColumn; var AState: TGridDrawState); + const + ScrollArrows: array [boolean, boolean] of integer = + ((DFCS_SCROLLRIGHT, DFCS_SCROLLLEFT), (DFCS_SCROLLLEFT, DFCS_SCROLLRIGHT)); + var + MasterCol: TColumn; + CellRect: TRect; + TitleRect, TextRect, ButtonRect: TRect; + LastTextRect,LastTitleRect: TRect; + i: integer; + InBiDiMode: boolean; + ArrowX, + ArrowY: integer; + SortColInfo: TSortColInfo; + OldBkMode: integer; + OldTextColor: TColor; + SortNum: integer; + Caption: string; + CaptionWidth: integer; + CharWidth: integer; + CurLevel: integer; + LevelHeight: integer; + CurCaption: string; + lvCheckLeft, + lvCheckRight, + lvShowCaption, + lvUpBorder, + lvDownBorder, + lvLeftBorder, + lvRightBorder, + lvCheckTextWidth : boolean; + TmpCaption: string; + lvTmpCol: TColumn; + lvTmpColIndex: integer; + lvCaptionXOffset: integer; + lvCaptionAligment : TAlignment; + CellFlag: cardinal; + CaptionDepth: integer; + PressOffset: integer; + begin + CellRect := CalcTitleRect(Column, ARow, MasterCol); + TitleRect := CellRect; + + if MasterCol = nil then begin + Canvas.FillRect(ARect); + Exit; + end; + // Prevent from drawing areas for SEARCH and FILTER Bars + if dgeFilterBar in OptionsEx then + dec(TitleRect.Bottom,DefaultRowHeight + 10); + if dgeSearchBar in OptionsEx then + dec(TitleRect.Bottom,DefaultRowHeight + 10); + + Canvas.Font := MasterCol.Title.Font; + Canvas.Brush.Color := MasterCol.Title.Color; + Canvas.FillRect(ARect); + TextRect := TitleRect; + + Caption := MasterCol.Title.Caption; + lvCheckLeft := True; + lvCheckRight := True; + lvShowCaption:= True; + lvLeftBorder := True; + lvRightBorder:= True; + if TCRColumnTitle(MasterCol.Title).IsCaptionStored then + CaptionDepth := GetCaptionDepth(Caption,FLevelDelimiterChar) + else + CaptionDepth := 1; + FrameOffs := 1; + if (Column.Index = FTitleButtonDown) and (dgRowLines in Options) then + PressOffset := 1 + else + PressOffset := 0; + for CurLevel := 0 to FHeaderHeight - 1 do begin + // Check dependencies + if TCRColumnTitle(MasterCol.Title).IsCaptionStored then + CurCaption := GetCaptionLevel(Caption,CurLevel,FLevelDelimiterChar) + else + if CurLevel = 0 then + CurCaption := Caption + else + CurCaption := ''; + lvDownBorder := (FHeaderHeight - 1 = CurLevel) or (GetCaptionLevel(Caption,CurLevel+1,FLevelDelimiterChar)<>''); + lvUpBorder := (CurCaption <> ''); + lvCaptionXOffset := 0; + if CurCaption <> '' then begin + if lvCheckLeft then begin + lvLeftBorder := True; + lvShowCaption:= True; + if (Column.Index = 0) or (CurLevel = (CaptionDepth-1)) then + lvCheckLeft := False + else begin + lvTmpColIndex := Column.Index-1; + while lvTmpColIndex >= 0 do begin + lvTmpCol := TColumn(MasterCol.Collection.Items[lvTmpColIndex]); + tmpCaption := GetCaptionLevel(lvTmpCol.Title.Caption,CurLevel,FLevelDelimiterChar); + if UpperCase(tmpCaption) <> UpperCase(CurCaption) then begin + if lvTmpColIndex = Column.Index - 1 then + lvCheckLeft := False; + break; + end + else begin + lvShowCaption := False; + lvLeftBorder := False; + inc(lvCaptionXOffset, lvTmpCol.Width); + if dgColLines in Options then + inc(lvCaptionXOffset); + dec(lvTmpColIndex) + end; + end; + end; + end; + if lvCheckRight then begin + lvRightBorder := True; + if (Column.Index = MasterCol.Collection.Count - 1) or (CurLevel = (CaptionDepth-1)) then + lvCheckRight := False + else begin + lvTmpColIndex := Column.Index+1; + lvTmpCol := TColumn(MasterCol.Collection.Items[lvTmpColIndex]); + tmpCaption := GetCaptionLevel(lvTmpCol.Title.Caption,CurLevel,FLevelDelimiterChar); + if UpperCase(tmpCaption) <> UpperCase(CurCaption) then + lvCheckRight := False + else + lvRightBorder := False; + end; + end; + end; + + //Check if we need to control caption width + if Column.Index = MasterCol.Collection.Count - 1 then + lvCheckTextWidth := True + else begin + lvTmpColIndex := Column.Index+1; + lvTmpCol := TColumn(MasterCol.Collection.Items[lvTmpColIndex]); + tmpCaption := GetCaptionLevel(lvTmpCol.Title.Caption,CurLevel,FLevelDelimiterChar); + if UpperCase(tmpCaption) <> UpperCase(CurCaption) then + lvCheckTextWidth := True + else + lvCheckTextWidth := False; + end; + + // draw text for level + TitleRect := CellRect; + CalcTitleLevel(CurLevel,TitleRect); + TextRect := TitleRect; + InflateRect(TextRect,-1,-1); + + if not lvRightBorder then begin + inc(TextRect.Right); + if (dgColLines in Options) then + inc(TextRect.Right); + end; + + if CurLevel <> (CaptionDepth-1) then begin + Canvas.Font := Self.TitleFont; + Canvas.Brush.Color := Self.FixedColor; + lvCaptionAligment := taLeftJustify; + end + else begin + Canvas.Font := MasterCol.Title.Font; + Canvas.Brush.Color := MasterCol.Title.Color; + lvCaptionAligment := MasterCol.Title.Alignment; + end; + Canvas.FillRect(TextRect); + + if lvShowCaption then begin + CaptionWidth := Canvas.TextWidth(CurCaption); + if lvCheckTextWidth and (CaptionWidth > TextRect.Right - TextRect.Left) then begin + while (CaptionWidth > TextRect.Right - TextRect.Left) and (Length(CurCaption) > 1) do begin + SetLength(CurCaption, Length(CurCaption) - 1); + CaptionWidth := Canvas.TextWidth(CurCaption) + Canvas.TextWidth('...'); + end; + CurCaption := CurCaption + '...'; + end; + WriteText(Canvas, TextRect, FrameOffs + PressOffset, + FrameOffs + PressOffset, CurCaption, lvCaptionAligment, IsRightToLeft); + end + else + if CurCaption = '' then + WriteText(Canvas, TextRect, FrameOffs, FrameOffs, '', lvCaptionAligment, + IsRightToLeft) + else begin // mean there is coninue of previous column + if dgColLines in Options then begin + dec(TextRect.Left,1); + dec(lvCaptionXOffset,1); + end; + CaptionWidth := Canvas.TextWidth(CurCaption) - lvCaptionXOffset; + if lvCheckTextWidth and (CaptionWidth > TextRect.Right - TextRect.Left) then begin + while (CaptionWidth > TextRect.Right - TextRect.Left) and (Length(CurCaption) > 1) do begin + SetLength(CurCaption, Length(CurCaption) - 1); + CaptionWidth := Canvas.TextWidth(CurCaption) + Canvas.TextWidth('...') - lvCaptionXOffset; + end; + CurCaption := CurCaption + '...'; + end; + WriteText(Canvas, TextRect, FrameOffs - lvCaptionXOffset, FrameOffs, CurCaption, lvCaptionAligment, + IsRightToLeft); + end; + // draw borders for level + CellFlag := BDR_RAISEDINNER; + if (FTitleButtonDown = Column.Index)and(CurLevel >= CaptionDepth-1) then + CellFlag := BDR_SUNKENINNER; + if not lvDownBorder then begin + Inc(TitleRect.Bottom,1); + Canvas.Pen.Color := clBtnFace; + Canvas.MoveTo(TitleRect.Left,TitleRect.Bottom - 2); + Canvas.LineTo(TitleRect.Right + 1, TitleRect.Bottom - 2); + if dgRowLines in Options then begin + Canvas.MoveTo(TitleRect.Left, TitleRect.Bottom - 1); + Canvas.LineTo(TitleRect.Right + 1, TitleRect.Bottom - 1); + end; + end; + if not lvUpBorder then begin + Canvas.Pen.Color := clBtnFace; + Canvas.MoveTo(TitleRect.Left, TitleRect.Top); + Canvas.LineTo(TitleRect.Right + 1, TitleRect.Top); + end; + if lvRightBorder then begin + if (dgRowLines in Options) and (dgColLines in Options) then + DrawEdge(Canvas.Handle, TitleRect, CellFlag, BF_RIGHT); + end + else + Inc(TitleRect.Right,1); + if dgColLines in Options then begin + Canvas.Pen.Color := clBlack; + Canvas.MoveTo(TitleRect.Right, TitleRect.Top); + Canvas.LineTo(TitleRect.Right, TitleRect.Bottom + 1); + end; + if lvDownBorder and ((dgRowLines in Options) and (dgColLines in Options)) then begin +// if not(dgRowlines in Options) then +// Inc(TitleRect.Bottom); + DrawEdge(Canvas.Handle, TitleRect, CellFlag, BF_BOTTOM); + end; + if dgRowLines in Options then begin + Canvas.Pen.Color := clBlack; + Canvas.MoveTo(TitleRect.Left,TitleRect.Bottom); + Canvas.LineTo(TitleRect.Right + 1,TitleRect.Bottom); + end; + if lvUpBorder and ((dgRowLines in Options) and (dgColLines in Options)) then + DrawEdge(Canvas.Handle, TitleRect, CellFlag, BF_TOP); + + if lvLeftBorder and ((dgRowLines in Options) and (dgColLines in Options)) then + DrawEdge(Canvas.Handle, TitleRect, CellFlag, BF_LEFT); + end; + + // Draw sort indicators + SortColInfo := FindSortColInfo(MasterCol.Index, SortNum); + if (SortColInfo <> nil) then begin + i := SaveDC(Canvas.Handle); + try + if SortNum = 0 then + case Column.Title.Alignment of + taRightJustify: ArrowX := TextRect.Left + 2; + else + ArrowX := TextRect.Right - 12; + end + else begin + Canvas.Font := TitleFont; + CharWidth := Canvas.TextWidth('0'); + ArrowX := TextRect.Right - 12 - CharWidth - 2; + end; + CaptionWidth := GetCaptionDepth(Caption, FLevelDelimiterChar); + CalcTitleLevel(CaptionWidth - 1, TextRect); + ArrowY := TextRect.Top + ((TextRect.Bottom - TextRect.Top - bmpSortAsc.Height) div 2); + CurCaption := GetCaptionLevel(Caption, CaptionWidth - 1, FLevelDelimiterChar); + CaptionWidth := Canvas.TextWidth(CurCaption); + + case Column.Title.Alignment of + taLeftJustify: begin + if TextRect.Left + CaptionWidth + 20 < ArrowX then + ArrowX := TextRect.Left + CaptionWidth + 20; + + if TextRect.Left + CaptionWidth + 4 > ArrowX then begin + ArrowX := TextRect.Left + CaptionWidth + 4; + IntersectClipRect(Canvas.Handle, TextRect.Left, + TextRect.Top, TextRect.Right - 1, TextRect.Bottom); + end; + end; + taRightJustify: begin + if TextRect.Right - CaptionWidth - 20 > ArrowX + 10 then + ArrowX := TextRect.Right - CaptionWidth - 30; + + if TextRect.Right - CaptionWidth - 4 < ArrowX + 10 then begin + ArrowX := TextRect.Right - CaptionWidth - 14; + IntersectClipRect(Canvas.Handle, TextRect.Left, + TextRect.Top, TextRect.Right - 1, TextRect.Bottom); + end; + end; + taCenter: begin + if TextRect.Left + CaptionWidth + + (TextRect.Right - TextRect.Left - CaptionWidth) div 2 + 4 > ArrowX then begin + ArrowX := TextRect.Left + CaptionWidth + (TextRect.Right - TextRect.Left - CaptionWidth) div 2 + 4; + IntersectClipRect(Canvas.Handle, TextRect.Left, + TextRect.Top, TextRect.Right - 1, TextRect.Bottom); + end; + end; + end; + + if SortColInfo.Desc then + Canvas.Draw(ArrowX + PressOffset, ArrowY + PressOffset, bmpSortDesc) + else + Canvas.Draw(ArrowX + PressOffset, ArrowY + PressOffset, bmpSortAsc); + + if SortNum > 0 then begin + OldBkMode := SetBkMode(Canvas.Handle, TRANSPARENT); + OldTextColor := GetTextColor(Canvas.Handle); + SetTextColor(Canvas.Handle, clWhite); + ArrowY := TextRect.Top + ((TextRect.Bottom - TextRect.Top - canvas.textHeight('X')) div 2); + Canvas.TextOut(ArrowX + 12 + PressOffset, ArrowY + PressOffset, IntToStr(SortNum)); + SetTextColor(Canvas.Handle, clGray); + Canvas.TextOut(ArrowX + 11 + PressOffset, ArrowY - 1 + PressOffset, IntToStr(SortNum)); + SetBkMode(Canvas.Handle, OldBkMode); + SetTextColor(Canvas.Handle, OldTextColor); + Canvas.Font := MasterCol.Title.Font; + end; + finally + RestoreDC(Canvas.Handle, i); + end; + end; + + if dgeFilterBar in OptionsEx then begin + TitleRect.Top := TitleRect.Bottom; + if dgRowLines in Options then + Inc(TitleRect.Top); +// if not(dgRowLines in Options) then +// Dec(TitleRect.Top); + TitleRect.Bottom := TitleRect.Top + DefaultRowHeight + 9; + if CRGridTitleEdit.EditingFilter then + DrawTitleBarCell(Canvas,Column,TitleRect, + CRGridTitleEdit.FFilterExpressions[Column.Index]) + else + DrawTitleBarCell(Canvas,Column,TitleRect,TCRColumn(Column).FilterExpression); + end; + if dgeSearchBar in OptionsEx then begin + TitleRect.Top := TitleRect.Bottom ; + if dgRowLines in Options then + Inc(TitleRect.Top); + TitleRect.Bottom := TitleRect.Top + DefaultRowHeight + 9; +// if not(dgRowLines in Options) then +// Dec(TitleRect.Top); + DrawTitleBarCell(Canvas,Column,TitleRect,''); + end; + AState := AState - [gdFixed]; // prevent box drawing later + end; + +var + DrawColumn: TColumn; +begin + if (ARow = 0) and (dgTitles in Options) then begin + if ACol >= IndicatorOffset then begin + DrawColumn := Columns[ACol - IndicatorOffset]; + DrawTitleCell(ACol - IndicatorOffset, ARow, DrawColumn, AState); + end + else begin + inherited DrawCell(ACol, ARow, ARect, AState); + DrawTitleIndicatorCell(Canvas,ARect); + end + end + else begin + if DataLink.Active then + if dgTitles in Options then + FActiveRowSelected := ARow - 1 = DataLink.ActiveRecord + else + FActiveRowSelected := ARow = DataLink.ActiveRecord + else + FActiveRowSelected := False; + inherited DrawCell(ACol, ARow, ARect, AState); + if gdFixed in AState then begin + if dgColLines in Options then begin + Canvas.Pen.color := clBlack; + Canvas.Pen.style := psSolid; + Canvas.MoveTo(aRect.Right, aRect.Top); + Canvas.LineTo(aRect.Right, aRect.Bottom + 1); + end; + if dgRowLines in Options then begin + Canvas.Pen.color := clBlack; + Canvas.Pen.style := psSolid; + Canvas.MoveTo(aRect.Left, aRect.Bottom); + Canvas.LineTo(aRect.Right, aRect.Bottom); + end; + end + end; +end; + +procedure TCRDBGrid.MouseDown(Button: TMouseButton; Shift: TShiftState; + X, Y: integer); +var + State: TGridState; + DrawInfo: TGridDrawInfo; + Index: longint; + Pos, Ofs: integer; + OldActive: integer; + Cell: TGridCoord; + i: integer; + Column: TColumn; + Value: string; + ColWidth, ValueWidth: integer; +begin + FExecColAjust := False; + + if FGridState = gsNormal then begin + CalcDrawInfo(DrawInfo); + CalcSizingState(X, Y, State, Index, Pos, Ofs, DrawInfo); + end + else + State := FGridState; + + if not (State in [gsColSizing]) and DataLink.Active then begin + if (Button = mbLeft) and (dgTitles in Options) then + begin + Cell := MouseCoord(X,Y); + if Cell.X >= IndicatorOffset then + begin + if not (dgRowSelect in Options) and (Cell.Y >= FixedRows) + and (TopRow + Cell.Y - FixedRows = Row) and IsOnButton(X,Y) + then begin + FCellButtonDown := RawToDataColumn(Cell.X); + FCellButtonRow := Cell.Y; + FCellButtonCol := Cell.X; + FCellButtonBRect := GetButtonRect(Cell); + FCellButtonRect := CellRect(Cell.X,Cell.Y); + //Paint; // ?? + HideEditor; + DrawButton(Cell.X,Cell.Y,PtInRect(FCellButtonBRect,Point(x,y))); + FCellButtonPressed := True; + //invalidaterect(GetButtonRect(Cell)); + Exit; + end; + + if Cell.Y = 0 then + begin + Column := Columns[RawToDataColumn(Cell.X)]; + + if MouseInFilterEdit(X, Y, Column) then + begin + FContinueEditingFilter := True; + ActivateFilterEdit(Column); + Exit; + end + else + if MouseInSortEdit(X, Y, Column) then + begin + ActivateSearchEdit(Column); + Exit; + end; + end; + + if DataLink.Active and (Cell.Y < FixedRows) + and (dgeEnableSort in OptionsEx) and MouseInLowerstLevel(X, Y, nil) + then begin + i := FTitleButtonDown; + FTitleButtonDown := RawToDataColumn(Cell.X); + FOldTitleButtonDown := FTitleButtonDown; + if i > -1 then + InvalidateCol(i+1); + invalidatecol(FTitleButtonDown+1); + + end; + end + else + begin + FIndicatorColBtnDown := GetIndicatorButton(X,Y); + FOldIndicatorColBtnDown := FIndicatorColBtnDown; + if FIndicatorColBtnDown <> icbNone then + InvalidateCol(0); + end; + end; + end; + + if (mbLeft = Button) and (State = gsColSizing) and DataLink.Active then begin + if ssDouble in Shift then begin + Index := Min(RawToDataColumn(MouseCoord(X, Y).X), RawToDataColumn(MouseCoord(X - 7, Y).X)); + if Index < 0 then + Index := Columns.Count - 1; + + Column := Columns[Index]; + ColWidth := 0; + OldActive := DataLink.ActiveRecord; + try + for i := TopRow - 1 to VisibleRowCount - 1 do begin + Datalink.ActiveRecord := i; + if Assigned(Column.Field) then + Value := Column.Field.DisplayText + else + Value := ''; + ValueWidth := Canvas.TextWidth(Value); + if ValueWidth > ColWidth then + ColWidth := ValueWidth; + end; + finally + DataLink.ActiveRecord := OldActive; + end; + + //Column.Width := ColWidth + 4; + ColWidths[Index + IndicatorOffset] := ColWidth + 4; + + FExecColAjust := True; + //MessageBox(0, PChar('Row ' + IntToStr(Row) + #13'Row Count ' + IntToStr(RowCount) + #13'TopRow ' + IntToStr(TopRow) + #13'Vis ' + IntToStr(VisibleRowCount)), '', MB_OK); + end; + if CRGridTitleEdit.Focused or CRGridTitleEdit.Edit.Focused then begin + SendMessage(Handle, WM_SETREDRAW, 0, 0); + try + inherited; + CRGridTitleEdit.Visible := True; + CRGridTitleEdit.SetFocus; + finally + SendMessage(Handle, WM_SETREDRAW, 1, 0); + end; + Column := CRGridTitleEdit.FActiveColumn; + if CRGridTitleEdit.FAsFilter then begin + ActivateFilterEdit(Column); + Exit; + end + else + ActivateSearchEdit(Column); + end; + end; + + InvalidateRect(Handle,{$IFNDEF CLR}@{$ENDIF}FStatusRect,False); + CRGridTitleEdit.EditingFilter := False; + FContinueEditingFilter := False; + inherited; +end; + +procedure TCRDBGrid.MouseMove(Shift: TShiftState; X, Y: integer); +var + State: TGridState; + DrawInfo: TGridDrawInfo; + Index: Longint; + Pos, Ofs: integer; +// Column:TColumn; +// Cell: TGridCoord; + Rect: TRect; + Col: TColumn; +begin + inherited; + + if FGridState = gsNormal then begin + CalcDrawInfo(DrawInfo); + CalcSizingState(X, Y, State, Index, Pos, Ofs, DrawInfo); + end + else + State := FGridState; + if FCellButtonDown > -1 then + begin + FCellButtonPressed := PtInRect(FCellButtonBRect,Point(x,y)); + DrawButton(FCellButtonCol,FCellButtonRow,FCellButtonPressed); + end; + + if (ssLeft in Shift) and (FOldTitleButtonDown > -1) then begin + Rect := CalcTitleRect(Columns[FOldTitleButtonDown], 0, Col); + + if dgeSearchBar in OptionsEx then + Dec(Rect.Bottom,DefaultRowHeight + 10); + if dgeFilterBar in OptionsEx then + Dec(Rect.Bottom,DefaultRowHeight + 10); + + if (FTitleButtonDown = -1) and PtInRect(Rect,Point(X,Y)) then begin + FTitleButtonDown := FOldTitleButtonDown; + InvalidateCol(FTitleButtonDown + 1); + end + else + if (FTitleButtonDown > -1) and ((Y < Rect.Top) or (Y > Rect.Bottom) + or ((X < Self.Left) and (Columns[FTitleButtonDown].Index = 0)) + or ((X > Self.Left + Self.Width) and (Columns[FTitleButtonDown].Index = Columns.Count - 1))) then begin + Index := FTitleButtonDown + 1; + FTitleButtonDown := -1; + InvalidateCol(Index) + end; + end; + + if (ssLeft in Shift) and (FOldIndicatorColBtnDown <> icbNone) then begin + if (FIndicatorColBtnDown = icbNone) + and (GetIndicatorButton(X, Y) = FOldIndicatorColBtnDown) then begin + FIndicatorColBtnDown := FOldIndicatorColBtnDown; + InvalidateCol(0); + end + else + if (FIndicatorColBtnDown <> icbNone) + and (FIndicatorColBtnDown <> GetIndicatorButton(X, Y)) then begin + FIndicatorColBtnDown := icbNone; + InvalidateCol(0) + end; + end; + +{ if not (State in [gsColSizing]) and DataLink.Active then begin + Cell := MouseCoord(X,Y); + if (Cell.X >= IndicatorOffset) and (Cell.Y >= 0) and + (ngTitles in FOptions) and (Cell.Y = 0) + then begin + FTitleButtonDown := RawToDataColumn(Cell.X); + Paint; // ?? + end + else begin + FTitleButtonDown := -1; + Paint; // ?? + end; + end;} +end; + +procedure TCRDBGrid.Reorder; +var + i: integer; + St: string; +begin + if DataLink.Active and + {$IFDEF DAC450} + (DataLink.DataSet is TCustomDADataSet) + {$ELSE} + ( ((DataLink.DataSet is TCustomDADataSet) and not(dgeLocalSorting in OptionsEx)) or + ((DataLink.DataSet is TMemDataSet) and (dgeLocalSorting in OptionsEx)) + ) + {$ENDIF} + then begin + St := ''; + for i := 0 to FSortInfo.Count - 1 do + if TCRColumn(Columns[TSortColInfo(FSortInfo[i]).Index]).CanBeSorted then + begin + if St <> '' then + St := St + ','; + {$IFNDEF DAC450} + if dgeLocalSorting in OptionsEx then + St := St + '''' + Columns[TSortColInfo(FSortInfo[i]).Index].Field.FieldName + '''' + else + {$ENDIF} + St := St + IntToStr(Columns[TSortColInfo(FSortInfo[i]).Index].Field.FieldNo); + if TSortColInfo(FSortInfo[i]).Desc then + St := St + ' DESC'; + end; + {$IFNDEF DAC450} + if dgeLocalSorting in OptionsEx then + TMemDataSet(DataLink.DataSet).IndexFieldNames := St + else + {$ENDIF} + begin + TCustomDADataSet(DataLink.DataSet).SetOrderBy(St); + DataLink.DataSet.Open; + end; + end; +end; + +procedure TCRDBGrid.MouseUp(Button: TMouseButton; Shift: TShiftState; + X, Y: integer); +var + State: TGridState; + DrawInfo: TGridDrawInfo; + Index, i: Longint; + Pos, Ofs: integer; + Column: TColumn; + Cell: TGridCoord; + SortColInfo: TSortColInfo; + Desc: boolean; + SortColNum: integer; + LastBtn: integer; + Widths: array of integer; +begin + if FGridState = gsNormal then begin + CalcDrawInfo(DrawInfo); + CalcSizingState(X, Y, State, Index, Pos, Ofs, DrawInfo); + end + else + State := FGridState; + + if (mbLeft = Button) and (State = gsColSizing) and DataLink.Active then begin + if CRGridTitleEdit.Focused then begin + inherited; + Column := CRGridTitleEdit.FActiveColumn; + if CRGridTitleEdit.FAsFilter then begin + ActivateFilterEdit(Column); + end + else + ActivateSearchEdit(Column); + end; + end; + + FTitleBarUp := False; + if not (State in [gsColSizing]) and DataLink.Active and not FExecColAjust + then begin + Cell := MouseCoord(X,Y); + + if not (dgRowSelect in Options) then + if FCellButtonDown > -1 then begin + DrawButton(Cell.X,Cell.Y,False); + if FCellButtonDown = RawToDataColumn(Cell.X) then + if FCellButtonPressed then + begin + FCellButtonDown := -1; + FCellButtonRow := -1; + FCellButtonCol := -1; + DoOnMemoClick(Columns[RawToDataColumn(Cell.X)]); + invalidate; + end; + end; + FCellButtonDown := -1; + FCellButtonRow := -1; + FCellButtonCol := -1; + LastBtn := FTitleButtonDown; + FOldTitleButtonDown := -1; + if FTitleButtonDown > -1 then begin + invalidatecol(FTitleButtonDown + 1); + FTitleButtonDown := - 1; + end; + + if (Button = mbLeft) and (Cell.Y = 0) and (dgTitles in Options) then begin + if Cell.X >= IndicatorOffset then + begin + Column := Columns[RawToDataColumn(Cell.X)]; + + if not (MouseInSortBar(X,Y,Column) or MouseInFilterBar(X,Y,Column)) + then begin + FTitleBarUp := True; + + if TCRColumn(Column).CanBeSorted and (dgeEnableSort in OptionsEx) + and MouseInLowerstLevel(X,Y,Column) and (LastBtn = Column.Index) + then begin + FExecSorting := True; + BeginLayout; + try + SetLength(Widths, Columns.Count); + for i := 0 to Columns.Count - 1 do + Widths[i] := Columns[i].Width; + if (DataLink.DataSet <> nil) and + {$IFDEF DAC450} + (DataLink.DataSet is TCustomDADataSet) + {$ELSE} + ( ((DataLink.DataSet is TCustomDADataSet) and not(dgeLocalSorting in OptionsEx)) or + ((DataLink.DataSet is TMemDataSet) and (dgeLocalSorting in OptionsEx)) + ) + {$ENDIF} + then begin + SortColInfo := FindSortColInfo(Column.Index, SortColNum); + Desc := (SortColInfo <> nil) and not SortColInfo.Desc; + + if (ssCtrl in Shift) and (SortColInfo <> nil) then begin + SortColInfo.Free; + if SortColNum > 0 then + Dec(SortColNum); + FSortInfo.Delete(SortColNum); + end + else begin + if not (ssShift in Shift) then + ClearSorting; + if not (ssShift in Shift) or (SortColInfo = nil) then begin + SortColInfo := TSortColInfo.Create; + SortColInfo.Index := Column.Index; + FSortInfo.Add(SortColInfo); + end; + + SortColInfo.Desc := Desc; + end; + + Reorder; + end; + finally + EndLayout; + for i := 0 to Columns.Count - 1 do + Columns[i].Width := Widths[i]; + FExecSorting := False; + end; + end; + end; + end + else + if FIndicatorColBtnDown <> icbNone then begin + FIndicatorColBtnDown := icbNone; + InvalidateCol(0); + IndicatorClick(FOldIndicatorColBtnDown, X, Y); + end; + end; + FOldIndicatorColBtnDown := icbNone; + end; + + inherited; + + FTitleBarUp := False; +end; + +procedure TCRDBGrid.LinkActive(Value: boolean); +var + St: string; + Parser: TParser; + Code: integer; + Lex: string; + i: integer; + FieldName: string; + SortColInfo: TSortColInfo; + Ind: integer; +begin + inherited; + // need to make header to have multilines + CRGridTitleEdit.StopEdit(False); + if not FExecSorting then begin + ClearSorting; + + if Value and (DataLink.DataSet is TCustomDADataSet) + and TCustomDADataSet(DataLink.DataSet).IsQuery + then begin + St := TCustomDADataSet(DataLink.DataSet).GetOrderBy; + //St := GetOrderBy(TOraDataSet(DataLink.DataSet).SQL.Text); + //St := ''; + if St <> '' then begin + Parser := TParser.Create(PChar(St)); + try + Parser.QuotedString := True; + repeat + SortColInfo := nil; + Code := Parser.GetNext(Lex); + + case Code of + lcString: + if Lex[1] = '"' then begin + Lex := Copy(Lex, 2, Length(Lex) - 2); + if Lex <> '' then + Code := lcIdent; + end; + lcNumber: + try + Ind := StrToInt(Lex); + if Ind <= DataLink.DataSet.FieldDefs.Count then begin + Lex := DataLink.DataSet.FieldDefs[Ind - 1].Name; + Code := lcIdent; + end; + except + Exit; + end; + end; + + if Code <> lcIdent then + Exit; + + FieldName := UpperCase(Lex); + + Code := Parser.GetNext(Lex); + if Lex = '.' then begin + Code := Parser.GetNext(Lex); + if Code = lcIdent then begin + FieldName := UpperCase(Lex); + Code := Parser.GetNext(Lex); + end + else + Exit; + end; + + for i := 0 to Columns.Count - 1 do + if (Columns[i].Field <> nil) and (UpperCase(Columns[i].Field.FieldName) = FieldName) + then begin + SortColInfo := TSortColInfo.Create; + SortColInfo.Index := i; + SortColInfo.Desc := False; + FSortInfo.Add(SortColInfo); + break; + end; + + if UpperCase(Lex) = 'DESC' then begin + if SortColInfo <> nil then + SortColInfo.Desc := True; + Code := Parser.GetNext(Lex); + end + else + if UpperCase(Lex) = 'ASC' then + Code := Parser.GetNext(Lex) + else + if (Code <> lcEnd) and (Lex <> ',') then + Exit; + until Code = lcEnd; + finally + Parser.Free; + end; + end; + end; + end; + if Value then + RecordChanged(nil); + + Invalidate; +end; + +procedure TCRDBGrid.UpdateHeaderHeight; +var + Cur, i: integer; + aHeight: integer; +begin + if not (dgTitles in Options) then begin + RowHeights[0]:= DefaultRowHeight; + Exit; + end; + FHeaderHeight := 1; + for i := 0 to Columns.Count - 1 do begin + if TCRColumnTitle(Columns[i].Title).IsCaptionStored then + Cur := GetCaptionDepth(Columns[i].Title.Caption,FLevelDelimiterChar) + else + Cur := 1; + if Cur > FHeaderHeight then + FHeaderHeight := Cur; + end; + aHeight := (DefaultRowHeight + 1) * FHeaderHeight; +// if dgRowLines in Options then +// aHeight := aHeight + FHeaderHeight; +// if not (dgRowLines in Options) then +// Dec(aHeight); // because of always-border cells + if dgeFilterBar in OptionsEx then + aHeight := aHeight + DefaultRowHeight + 10; + + if dgeSearchBar in OptionsEx then + aHeight := aHeight + DefaultRowHeight + 10; + + RowHeights[0]:= aHeight - 1; +end; + +procedure TCRDBGrid.SetOptionsEx(Value: TCRDBGridOptionsEx); +begin + if FOptionsEx <> Value then begin + if ((dgeFilterbar in FOptionsEx) <> (dgeFilterBar in Value)) + or ((dgeSearchbar in FOptionsEx) <> (dgeSearchBar in Value)) + then begin + FOptionsEx := Value; + FOptionsMenuDef.Items[2].Checked := dgeFilterBar in FOptionsEx; + FOptionsMenuDef.Items[3].Checked := dgeSearchBar in FOptionsEx; + LayoutChanged; + UpdateRowCount; + Invalidate; + Exit; + end; + FOptionsEx := Value; + if (dgeStretch in FOptionsEx) then begin + if not FSoft and not (csLoading in ComponentState) then begin + FExecSizing := True; + ResizeColumns; + FExecSizing := False; + end; + FSoft := True; + end + else + FSoft := False; + Invalidate; + end; +end; + +function TCRDBGrid.GetClientRect: TRect; +begin + Result := inherited GetClientRect; + if dgRowLines in options then + Inc(Result.Bottom); + if [dgeSummary,dgeRecordCount] * FOptionsEx <> [] then + Dec(Result.Bottom,DefaultRowHeight + 2); +end; + +procedure TCRDBGrid.LayoutChanged; +begin + inherited; + + CRGridTitleEdit.StopEdit(False); + UpdateHeaderHeight; + //DoubleBuffered := true; +end; + +procedure TCRDBGrid.Paint; +var + TotalWidth: integer; + TotalYOffs: integer; + TotalHeight: integer; + TmpText: string; + + procedure PaintStatusLine(YOffset: integer); + var + Column: TCRColumn; + MasterCol: TColumn; + BrdRect: TRect; + CellRect: TRect; + ColIndex: integer; + FullRect: TRect; + RightBorder: integer; + OldDC: HDC; + begin + OldDC := Canvas.Handle; + Canvas.Handle := 0; + try + FullRect := Rect(0, FTotalYOffset, TotalWidth, FTotalYOffset + DefaultRowHeight + 2); + FStatusRect := FullRect; + // if dgRowLines in Options then + // Inc(FullRect.Top); + Canvas.FillRect(FullRect); + with Canvas do begin + Pen.Color := clBlack; + Pen.Style := psSolid; + if dgRowLines in Options then begin + MoveTo(FullRect.Left, FullRect.Top - 1); + LineTo(FullRect.Right, FullRect.Top - 1); + MoveTo(FullRect.Left, FullRect.Bottom - 2); + LineTo(FullRect.Right, FullRect.Bottom - 2); + end; + if dgColLines in Options then begin + Dec(FullRect.Right); + MoveTo(FullRect.Right, FullRect.Top); + LineTo(FullRect.Right, FullRect.Bottom + 2); + // MoveTo(FullRect.Left , FullRect.Bottom + 2); + // LineTo(FullRect.Left, FullRect.Top); + end; + if (dgRowLines in Options) and (dgColLines in Options) then begin + Dec(FullRect.Bottom, 2); + DrawEdge(Canvas.Handle, FullRect, BDR_RAISEDINNER, BF_BOTTOMRIGHT); + DrawEdge(Canvas.Handle, FullRect, BDR_RAISEDINNER, BF_TOPLEFT); + end; + end; + + if (Columns.Count > 0) and (dgeSummary in FOptionsEx) then begin + RightBorder := GetClientRect.Right - 1; + for ColIndex := RawToDataColumn(LeftCol) to Columns.Count - 1 do begin + Column := TCRColumn(Columns[ColIndex]); + CellRect := CalcTitleRect(Column, 0, MasterCol); + if (CellRect.Left <> 0) or (CellRect.Right <> 0) or + (CellRect.Top <> 0) or (CellRect.Bottom <> 0) + then begin + CellRect.Top := YOffset; + CellRect.Bottom := CellRect.Top + DefaultRowHeight; + if Column.SummaryMode <> smNone then begin + tmpText := TCRColumn(Column).TotalString; + InflateRect(CellRect, 0, -2); + if tmpText <> '' then + WriteText(Canvas, CellRect, 3, 0, tmpText, Column.Alignment,True); + InflateRect(CellRect, 0, 2); + if dgColLines in Options then begin + if dgRowLines in Options then begin + BrdRect := CellRect; + Inc(BrdRect.Bottom); + DrawEdge(Canvas.Handle, BrdRect, BDR_RAISEDINNER, BF_RIGHT); + DrawEdge(Canvas.Handle, BrdRect, BDR_RAISEDINNER, BF_LEFT); + BrdRect.Right := CellRect.Left - 1; + BrdRect.Left := BrdRect.Right - 1; + DrawEdge(Canvas.Handle, BrdRect, BDR_RAISEDINNER, BF_RIGHT); + Dec(BrdRect.Bottom); + end; + + Canvas.Pen.Color := clBlack; + Canvas.MoveTo(CellRect.Left - 1, CellRect.Top - 1); + Canvas.LineTo(CellRect.Left - 1, CellRect.Bottom + 3); + + BrdRect.Left := CellRect.Right + 1; + BrdRect.Right:= BrdRect.Left + 1; + + if Column.Index < MasterCol.Collection.Count - 1 then begin + Inc(BrdRect.Bottom); + DrawEdge(Canvas.Handle, BrdRect, BDR_RAISEDINNER, BF_LEFT); + Dec(BrdRect.Bottom); + Canvas.Pen.Color := clBlack; + Canvas.MoveTo(CellRect.Right, CellRect.Top - 1); + Canvas.LineTo(CellRect.Right, CellRect.Bottom + 3); + end; + end; + end; + end; + if dgeRecordCount in FOptionsEx + then begin + CellRect := FullRect; + InflateRect(CellRect, -2, -2); + CellRect.Right := RightBorder; + if DataLink.Active then + tmpText := IntToStr(DataLink.DataSet.RecNo) + + '/' + IntToStr(DataLink.DataSet.RecordCount) + else + tmpText := '';//'Records count : INACTIVE'; + WriteText(Canvas, CellRect, 0, 0, tmpText, taLeftJustify,True); + end; + end; + end + else begin + if dgeRecordCount in FOptionsEx then begin + CellRect := FullRect; + InflateRect(CellRect, -2, -2); + if DataLink.Active then + tmpText := IntToStr(DataLink.DataSet.RecNo) + + '/' + IntToStr(DataLink.DataSet.RecordCount) + else + tmpText := '';//'Records count : INACTIVE'; + WriteText(Canvas, CellRect, 0, 0, tmpText, taLeftJustify,True); + end; + end; + finally + Canvas.Handle := OldDC; + end; + end; +{$IFNDEF CLR}//TODO +var + Opt: TGridOptions; + Last: TGridOptions; +{$ENDIF} +begin +{$IFNDEF CLR}//TODO + Opt := _TCustomGrid(Self).Options; + Last := Opt; + Opt := Opt - [goFixedVertLine , goFixedHorzLine]; + _TCustomGrid(Self).Options := Opt; +{$ENDIF} + inherited; // Draw standart grid + with Canvas do begin + TotalHeight := GetClientRect.Bottom; + TotalYOffs := TotalHeight; + TotalWidth := GetClientRect.Right; + FTotalYOffset := TotalYOffs; + Canvas.Font.Assign(TitleFont); + Canvas.Brush.Color := clBtnFace; + if [dgeSummary,dgeRecordCount] * FOptionsEx <> [] then + PaintStatusLine(FTotalYOffset); + end; + //_TCustomGrid(Self).Options := Last; +end; + +procedure TCRDBGrid.LoadTotals; +var + ColNom: integer; + Mode: TSummaryMode; + BookM: TBookmark; + Col: TCRColumn; + DataSet: TDataSet; + Field: TField; +begin + if not ((dgeSummary in OptionsEx) and DataLink.Active) or (Columns.Count = 0) then + Exit; + BookM := DataLink.DataSet.GetBookMark; + try + DataSet := DataLink.DataSet; + DataSet.DisableControls; + for ColNom := 0 to Columns.Count - 1 do begin + if (TCRColumn(Columns[ColNom]).SummaryMode <> smLabel) and (not TCRColumn(Columns[ColNom]).FTotalLoaded)and(Assigned(Columns[ColNom].Field)) then begin + Col := TCRColumn(Columns[ColNom]); + Field := Col.Field; + if Col.SummaryMode = smMin then + Col.FTotalInt := Field.AsInteger + else + Col.FTotalInt := 0; + if Col.SummaryMode = smMin then + Col.FTotalFloat := Field.AsFloat + else + Col.FTotalFloat := 0; + Col.FTotalString:= ''; + Col.FTotalValue:= Unassigned; + end; + end; + + DataSet.First; + while not DataSet.Eof do begin + for ColNom := 0 to Columns.Count - 1 do + if (not TCRColumn(Columns[ColNom]).FTotalLoaded) and + Assigned(TCRColumn(Columns[ColNom]).Field) + then begin + Col := TCRColumn(Columns.Items[ColNom]); + Field := Col.Field; + Mode := Col.SummaryMode; + case Col.Field.DataType of + ftSmallint, ftInteger, ftWord, ftLargeint: + case Mode of + smSum: + Col.FTotalInt := Col.FTotalInt + Field.AsInteger; + smAvr: + Col.FTotalInt := Col.FTotalInt + Field.AsInteger; + smMax: + if Col.FTotalInt < Field.AsInteger then + Col.FTotalInt := Field.AsInteger; + smMin: + if Col.FTotalInt > Field.AsInteger then + Col.FTotalInt := Field.AsInteger; + end; + ftFloat, ftCurrency: + case Mode of + smSum: + Col.FTotalFloat := Col.FTotalFloat + Field.AsFloat; + smAvr: + Col.FTotalFloat := Col.FTotalFloat + Field.AsFloat; + smMax: + if Col.FTotalFloat < Field.AsFloat then + Col.FTotalFloat := Field.AsFloat; + smMin: + if Col.FTotalFloat > Field.AsFloat then + Col.FTotalFloat := Field.AsFloat; + end; + end; + end; + DataSet.Next; + end; + for ColNom := 0 to Columns.Count - 1 do + if (not TCRColumn(Columns[ColNom]).FTotalLoaded) and + Assigned(TCRColumn(Columns[ColNom]).Field) + then begin + Col := TCRColumn(Columns.Items[ColNom]); + if (Col.SummaryMode = smAvr) and (DataLink.DataSet.RecordCount > 0) then + case Col.Field.DataType of + ftSmallint, ftInteger, ftWord, ftLargeint: + Col.FTotalFloat := Col.FTotalInt / DataLink.DataSet.RecordCount; + ftFloat, ftCurrency: + Col.FTotalFloat := Col.FTotalFloat / DataLink.DataSet.RecordCount; + end; + Col.SetTotal; + end; + finally + DataLink.DataSet.GotoBookMark(BookM); + DataLink.DataSet.FreeBookMark(BookM); + DataLink.DataSet.EnableControls; + end; +end; + +procedure TCRDBGrid.DataChanged; +begin + ResetTotals; + LoadTotals; + invalidate; +end; + +procedure TCRDBGrid.RecordChanged(Field: TField); +var + i: integer; +begin + if not HandleAllocated then + Exit; + if Field = nil then + DataChanged + else begin + for i := 0 to Columns.Count - 1 do + if Columns[i].Field = Field then + TCRColumn(Columns[i]).ResetTotal; + LoadTotals; + Invalidate; + end; + + inherited; +end; + +procedure TCRDBGrid.ResetTotals; +var + i: integer; +begin + for i := 0 to Columns.Count - 1 do + TCRColumn(Columns[i]).ResetTotal; +end; + +function TCRDBGrid.EndColumnDrag(var Origin, Destination: integer; + const MousePt: TPoint): boolean; +var + Mx,Mn, + Oi: integer; +begin + Result := inherited EndColumnDrag(Origin, Destination, MousePt); + + if Result and (Origin <> Destination) then begin + if Origin > Destination then begin + Mx := Origin; + Mn := Destination + end + else begin + Mx := Destination; + Mn := Origin + end; + Dec(mx); + Dec(mn); + for Oi := 0 to FSortInfo.Count - 1 do begin + if TSortColInfo(FSortInfo[Oi]).Index = Origin - 1 then begin + TSortColInfo(FSortInfo[Oi]).Index := Destination - 1; + //TSortColInfo(FSortInfo[Oi]).Desc := not TSortColInfo(FSortInfo[Oi]).Desc; + continue; + end; + if (TSortColInfo(FSortInfo[Oi]).Index > Mx)or(TSortColInfo(FSortInfo[Oi]).Index < Mn) then + continue; + if Destination < Origin then + Inc(TSortColInfo(FSortInfo[Oi]).Index) + else + Dec(TSortColInfo(FSortInfo[Oi]).Index); + end; + end; +end; + +procedure TCRDBGrid.SetLevelDelimiterchar(const Value: char); +begin + FLevelDelimiterchar := Value; +end; + +procedure TCRDBGrid.WMSetCursor(var Message: TWMSetCursor); +var + P: TPoint; +begin + GetCursorPos(P); + P := ScreenToClient(P); + if MouseInSortEdit(p.x,p.y) or MouseInFilterEdit(p.x,p.y) then + Windows.SetCursor(LoadCursor(0, IDC_IBEAM)) + else + inherited; +end; + +function TCRDBGrid.MouseInSortBar(X,Y: integer; Column: TColumn = nil): boolean; +var + Index: integer; + Rect: TRect; +begin + Result := False; + if not (dgeSearchBar in OptionsEx) then + Exit; + if Column = nil then begin + Index := DataToRawColumn(MouseCoord(X,Y).X); + Column := Columns[Index]; + end; + Rect := CalcSearchBar(Column); + Result := PtInRect(Rect,Point(x,y)); +end; + +function TCRDBGrid.MouseInSortEdit(X,Y: integer; Column: TColumn = nil): boolean; +var + Index: integer; + Rect: TRect; +begin + Result := False; + if not (dgeSearchBar in OptionsEx) then + exit; + if Column = nil then begin + Index := RawToDataColumn(MouseCoord(X,Y).X); + if Index < 0 then + exit; + Column := Columns[Index]; + end; + Rect := CalcSearchBar(Column); + InflateRect(Rect, -5, -5); + Result := PtInRect(Rect,Point(x,y)) and TCRColumn(Column).CanBeSorted; +end; + +function TCRDBGrid.MouseInFilterBar(X,Y: integer; Column: TColumn = nil): boolean; +var + Index: integer; + Rect: TRect; +begin + Result := False; + if not (dgeFilterBar in OptionsEx) then + Exit; + if Column = nil then begin + Index := DataToRawColumn(MouseCoord(X,Y).X); + if Index < 0 then + Exit; + Column := Columns[Index]; + end; + Rect := CalcFilterBar(Column); + Result := PtInRect(Rect, Point(x,y)); +end; + +function TCRDBGrid.MouseInFilterEdit(X,Y: integer; Column: TColumn = nil): boolean; +var + Index: integer; + Rect: TRect; +begin + Result := False; + if not (dgeFilterBar in OptionsEx) then + Exit; + if Column = nil then begin + Index := RawToDataColumn(MouseCoord(X, Y).X); + if Index < 0 then + Exit; + Column := Columns[Index]; + end; + Rect := CalcFilterBar(Column); + InflateRect(rect, -5, -5); + Result := PtInRect(Rect, Point(x,y)) and TCRColumn(Column).CanBeSorted; +end; + +function TCRDBGrid.CalcSearchBar(Column: TColumn): TRect; +var + Rect: TRect; + MasterCol: TColumn; + aRow: integer; +begin + aRow := 0; + Rect := CalcTitleRect(Column,aRow,MasterCol); + Rect.Top := Rect.Bottom - (DefaultRowHeight + 9); + if not (dgeSearchBar in OptionsEx) then begin + Result.Top := Result.Bottom; + exit; + end; + Result := Rect; +end; + +function TCRDBGrid.CalcFilterBar(Column: TColumn): TRect; +var + Rect: TRect; + MasterCol: TColumn; + aRow: integer; +begin + aRow := 0; + Rect := CalcTitleRect(Column, aRow, MasterCol); + if dgeSearchBar in OptionsEx then + begin + Rect.Bottom := Rect.Bottom - (DefaultRowHeight + 9); + if dgRowLines in Options then + Dec(Rect.Bottom); + end; + Rect.Top := Rect.Bottom - (DefaultRowHeight + 9); +// if not (dgRowLines in Options) then +// Inc(Rect.Top); + Result := Rect; + if not (dgeFilterBar in OptionsEx) then begin + Result.Top := Result.Bottom; + exit; + end; +end; + +procedure TCRDBGrid.ActivateFilterEdit(Column: TColumn); +var + CellRect: TRect; +begin + if not (Assigned(Column) and (dgeFilterBar in OptionsEx)) then + Exit; + CellRect := CalcFilterBar(Column); + InflateRect(CellRect, -5, -5); + if not (dgRowLines in Options) then + Dec(CellRect.Top); + CRGridTitleEdit.ActivateAt(CellRect, Column, True); +end; + +procedure TCRDBGrid.DoOnMemoClick(Column: TColumn); +var + Window: TMemoEditorForm; +begin + if Assigned(FOnMemoClick) then + FOnMemoClick(Self, Column) + else begin + Window := TMemoEditorForm.Create(GetParentForm(Self)); + try + Window.FMemo.Text := AdjustLineBreaks(Column.Field.AsString); + Window.ReadOnly := ReadOnly or Column.Field.ReadOnly or not (dgEditing in Options); + Window.Caption := Column.Field.DisplayName; + if (FMemoWidth > 0) and (FMemoHeight > 0) then begin + Window.Width := FMemoWidth; + Window.Height := FMemoHeight; + end; + Window.FCheckBox.Checked := FMemoWordWrap; + if Window.ShowModal = mrOK then begin + DataLink.DataSet.Edit; + Column.Field.AsString := Window.FMemo.Text; + end; + FMemoWidth := Window.Width; + FMemoHeight := Window.Height; + FMemoWordWrap := Window.FCheckBox.Checked; + finally + Window.Free; + end; + end; +end; + +function TCRDBGrid.MouseInLowerstLevel(X, Y: integer; Column: TColumn = nil): boolean; +var + Index: integer; + Rect: TRect; + MasterCol: TColumn; +begin + Result := False; + if Column = nil then begin + Index := RawToDataColumn(MouseCoord(X, Y).X); + if Index < 0 then + exit; + Column := Columns[Index]; + end; + Index := 0; + Rect := CalcTitleRect(Column, Index, MasterCol); + Index := GetCaptionDepth(Column.Title.Caption, FLevelDelimiterChar); + if Index > 0 then begin + Index := (Index-1) * (DefaultRowHeight + 1); + Rect.Top := Index; + Rect.Bottom := CalcFilterBar(Column).top; + Result := PtInRect(Rect, Point(X, Y)); + end + else + Result := True; +end; + +procedure TCRDBGrid.DrawTitleBarCell(Canvas: TCanvas; Column: TColumn; + Rect: TRect; Text: string); +var + TextRect: TRect; +begin + Canvas.Brush.Color := clBtnFace; + Canvas.Brush.Style := bsSolid; + Canvas.FillRect(Rect); + + if (dgRowLines in Options) and (dgColLines in Options) then begin + DrawEdge(Canvas.Handle, Rect, BDR_RAISEDINNER, BF_BOTTOMRIGHT); + DrawEdge(Canvas.Handle, Rect, BDR_RAISEDINNER, BF_TOPLEFT); + end; + + if TCRColumn(column).CanBeSorted then begin + if (dgRowLines in Options) and (dgColLines in Options) then begin + InflateRect(Rect, -4, -4); + if Rect.Right > Rect.Left then begin + DrawEdge(Canvas.Handle, Rect, BDR_SUNKENINNER, BF_TOPLEFT); + Rect.Bottom := Rect.Bottom + 1; + DrawEdge(Canvas.Handle, Rect, BDR_SUNKENINNER, BF_BOTTOMRIGHT); + InflateRect(Rect, 1, 1); + DrawEdge(Canvas.Handle, Rect, BDR_SUNKENOUTER, BF_TOPLEFT); + DrawEdge(Canvas.Handle, Rect, BDR_SUNKENOUTER, BF_BOTTOMRIGHT); + InflateRect(Rect, 3, 3); + Rect.Bottom := Rect.Bottom - 1; + end + else + InflateRect(Rect, 4, 4); + end; + + TextRect := Rect; + InflateRect(TextRect, -5, -5); + TextRect.Bottom := TextRect.Top + DefaultRowHeight; + if TextRect.Right >= TextRect.Left then begin + Canvas.Brush.Color := clWindow; + Canvas.Brush.Style := bsSolid; + Canvas.FillRect(TextRect); + end; + + InflateRect(TextRect, -2, -2); + if (Text <> '') and (TextRect.Right >= TextRect.Left) then + WriteText(Canvas, TextRect, 0, 0, Text, taLeftJustify, True); + end; + + Canvas.Pen.Color := clBlack; + if dgRowLines in options then begin + Canvas.MoveTo(Rect.Left, Rect.Bottom); + Canvas.LineTo(Rect.Right + 1, Rect.Bottom); + end; + if dgColLines in options then begin + Canvas.MoveTo(Rect.Right, Rect.Top); + Canvas.LineTo(Rect.Right, Rect.Bottom); + end; +end; + +procedure TCRDBGrid.DrawTitleIndicatorCell(Canvas: TCanvas; ARect: TRect); + procedure DrawButton(Rect: TRect; Bmp: TBitmap; IsPressed: boolean); + var + Delta, Flag, PressOffset: integer; + begin + PressOffset := 0; + Delta := Ceil((Rect.Bottom - Rect.Top - Bmp.Height) / 2); + if ((dgRowLines in Options) and (dgColLines in Options)) {or PtInRect(Rect,P)} then begin + if IsPressed then begin + PressOffset := 1; + Flag := BDR_SUNKENINNER + end + else + Flag := BDR_RAISEDINNER; + DrawEdge(Canvas.Handle, Rect, Flag, BF_BOTTOMRIGHT); + DrawEdge(Canvas.Handle, Rect, Flag, BF_TOPLEFT); + end; + Canvas.Draw(Rect.Left + 1 + PressOffset, Rect.Top + Delta + PressOffset, Bmp); + if dgRowLines in Options then begin + Canvas.Pen.Color := clBlack; + Canvas.MoveTo(Rect.Left, Rect.Bottom); + Canvas.LineTo(Rect.Right + 1, Rect.Bottom); + end; + end; +var + Rect: TRect; + Bmp: TBitmap; + i: integer; +begin + Canvas.FillRect(ARect); + Rect := ARect; + + if dgeSearchBar in OptionsEx then begin + Rect.Top := Rect.Bottom - DefaultRowHeight - 9; + if not((dgRowLines in Options) or (dgeFilterBar in OptionsEx)) then + Inc(Rect.Top); + DrawButton(Rect, bmpSearch, FIndicatorColBtnDown = icbSearch); + Dec(Rect.Bottom, DefaultRowHeight + 9); + if dgRowLines in Options then + Dec(Rect.Bottom) + end; + + if dgeFilterBar in OptionsEx then begin + Rect.Top := Rect.Bottom - DefaultRowHeight - 9; + if not((dgRowLines in Options) or (dgeSearchBar in OptionsEx)) then + Inc(Rect.Top); + + if CRGridTitleEdit.EditingFilter then + Bmp := bmpEditMode + else + if FFiltered then begin + Bmp := bmpFilter; + for i := 0 to Columns.Count - 1 do + if TCRColumn(Columns[i]).FilterExpression <> '' then begin + Bmp := bmpActiveFilter; + Break; + end; + end + else + Bmp := bmpFilter; + + DrawButton(Rect, Bmp, FIndicatorColBtnDown = icbFilter); + Dec(Rect.Bottom, DefaultRowHeight + 9); + if (dgRowLines in Options) then + Dec(Rect.Bottom); + end; + + Rect.Top := ARect.Top; + if not(dgRowLines in Options) + and ((dgeSearchBar in OptionsEx) xor (dgeFilterBar in OptionsEx)) then + Inc(Rect.Bottom); + DrawButton(Rect, bmpMenu, FIndicatorColBtnDown = icbMenu); + + Canvas.Pen.Color := clBlack; + if dgColLines in Options then begin + Canvas.MoveTo(ARect.Right, ARect.Top); + Canvas.LineTo(ARect.Right, ARect.Bottom + 1); + end; +end; + +function TCRDBGrid.GetIndicatorButton(X, Y: integer): TIndicatorColButton; +var + Rect: TRect; +begin + Result := icbNone; + Rect := CellRect(0,0); + + if dgeSearchBar in OptionsEx then begin + Rect.Top := Rect.Bottom - DefaultRowHeight - 9; + if not((dgRowLines in Options) or (dgeFilterBar in OptionsEx)) then + Inc(Rect.Top); + if PtInRect(Rect,Point(X,Y)) then + Result := icbSearch; + Dec(Rect.Bottom, DefaultRowHeight + 9); + if dgRowLines in Options then + Dec(Rect.Bottom); + end; + + if dgeFilterBar in OptionsEx then begin + Rect.Top := Rect.Bottom - DefaultRowHeight - 9; + if not((dgRowLines in Options) or (dgeSearchBar in OptionsEx)) then + Inc(Rect.Top); + if PtInRect(Rect,Point(X,Y)) then + Result := icbFilter; + Dec(Rect.Bottom, DefaultRowHeight + 9); + if dgRowLines in Options then + Dec(Rect.Bottom); + end; + + Rect.Top := CellRect(0,0).Top; + if not(dgRowLines in Options) + and ((dgeSearchBar in OptionsEx) xor (dgeFilterBar in OptionsEx)) then + Inc(Rect.Bottom); + if PtInRect(Rect,Point(X,Y)) then + Result := icbMenu; +end; + +procedure TCRDBGrid.IndicatorClick(Button: TIndicatorColButton; X, Y: integer); +var + P: TPoint; +begin + EditorMode := False; + case Button of + icbFilter: + FilterItemClick(FOptionsMenuDef.Items[2]); // watch it + icbSearch: + SearchItemClick(FOptionsMenuDef.Items[3]); // watch it + icbMenu: + begin + P := ClientToScreen(Point(X, Y)); + if FOptionsMenu <> nil then + FOptionsMenu.Popup(P.x, P.y) + else + FOptionsMenuDef.Popup(P.x, P.y); + end; + end; +end; + +procedure TCRDBGrid.BuildMenu; +var + Item: TMenuitem; +begin + while FOptionsMenuDef.Items.Count > 0 do + FOptionsMenuDef.Items.Delete(0); + + Item := TMenuItem.Create(Self); + Item.Caption := SFiltered; + Item.OnClick := FilteredItemClick; + Item.Checked := FFiltered; + FOptionsMenuDef.Items.Add(Item); + + Item := TMenuItem.Create(Self); + Item.Caption := '-'; + FOptionsMenuDef.Items.Add(Item); + + Item := TMenuItem.Create(Self); + Item.Caption := SFilterBar; + Item.OnClick := FilterItemClick; + Item.Checked := dgeFilterBar in OptionsEx; + FOptionsMenuDef.Items.Add(Item); + + Item := TMenuItem.Create(Self); + Item.Caption := SSearchBar; + Item.OnClick := SearchItemClick; + Item.Checked := dgeSearchBar in OptionsEx; + FOptionsMenuDef.Items.Add(Item); +end; + +procedure TCRDBGrid.FilterItemClick(Sender: TObject); +begin + if dgeFilterBar in OptionsEx then begin + OptionsEx := OptionsEx - [dgeFilterBar]; + UpdateRowCount; + end + else + OptionsEx := OptionsEx + [dgeFilterBar]; + (Sender as TMenuItem).Checked := dgeFilterBar in OptionsEx; +end; + +procedure TCRDBGrid.SearchItemClick(Sender: TObject); +begin + if dgeSearchBar in OptionsEx then begin + OptionsEx := OptionsEx - [dgeSearchBar]; + UpdateRowCount; + end + else + OptionsEx := OptionsEx + [dgeSearchBar]; + (Sender as TMenuItem).Checked := dgeSearchBar in OptionsEx; +end; + +procedure TCRDBGrid.CalcTableSpacePercent; +var + ColumnsSize, i: integer; +begin + ColumnsSize := 0; + for i := 0 to Columns.count - 1 do + if ColWidths[i + IndicatorOffset] > 0 then + ColumnsSize := ColumnsSize + ColWidths[i + IndicatorOffset]; + for i := 0 to Columns.Count - 1 do + if ColumnsSize > 0 then + TCRColumn(Columns[i]).FTableSpacePercent := ColWidths[i + IndicatorOffset] / ColumnsSize; +end; + +procedure TCRDBGrid.KeyDown(var Key: word; Shift: TShiftState); +var + Column: TColumn; + i: integer; + + procedure ActivateEdit; + begin + if dgeSearchBar in OptionsEx then begin + ActivateSearchEdit(Column); + Key := 0; + end + else if dgeFilterBar in OptionsEx then begin + ActivateFilterEdit(Column); + Key := 0; + end; + end; +begin + case Key of + VK_UP: + if (dgTitles in Options) and (Row = 1) and ((Shift = [ssShift]) + or (DataLink.Active and ((DataLink.DataSet.RecNo = 1) or (DataLink.DataSet.recordcount = 0)))) then begin + Column := Columns[RawToDataColumn(Col)]; + if TCRColumn(Column).CanBeSorted then + ActivateEdit; + end; + VK_TAB: + if (dgTitles in Options) and (Row = 1) and (Col = IndicatorOffset) + and (Shift = [ssShift]) then begin + for i := Columns.Count - 1 downto 0 do + if TCRColumn(Columns[i]).CanBeSorted then begin + Column := Columns[i]; + MoveColRow(DataToRawColumn(i), TopRow, True, True); + Break; + end; + if Column <> nil then + ActivateEdit; + end; + VK_RETURN: begin + if SelectedField is TMemoField then begin + DoOnMemoClick(Columns[RawToDataColumn(Col)]); + Key := 0; + HideEditor; + end; + end; + end; + case Key of + VK_UP, VK_PRIOR, VK_DOWN, VK_NEXT, VK_HOME, VK_END : + InvalidateRect(Handle,{$IFNDEF CLR}@{$ENDIF}FStatusRect,False); + end; + + inherited; +end; + +function TCRDBGrid.CanEditShow: boolean; +begin + if (Columns.Count > 0) and Assigned(SelectedField) and (SelectedField is TMemoField) then + Result := False + else + Result := inherited CanEditShow; +end; + +procedure TCRDBGrid.TopLeftChanged; +{$IFDEF VER4} +var + R: TRect; + DrawInfo: TGridDrawInfo; +{$ENDIF} +begin + inherited; +{$IFDEF VER4} + if HandleAllocated and (dgTitles in Options) then + begin + CalcFixedInfo(DrawInfo); + R := Rect(0, 0, Width, DrawInfo.Vert.FixedBoundary); + InvalidateRect(Handle, {$IFNDEF CLR}@{$ENDIF}R, False); + end; +{$ENDIF} + InvalidateRect(Handle,{$IFNDEF CLR}@{$ENDIF}FStatusRect,False); +end; + +procedure TCRDBGrid.SetFiltered(const Value: boolean); +begin + if FFiltered <> Value then begin + FFiltered := Value; + FOptionsMenuDef.Items[0].Checked := FFiltered; + if (DataSource = nil) or (DataSource.DataSet = nil) then + Exit; + + if Value then + ApplyFilter; + if dgeLocalFilter in OptionsEx then + DataSource.DataSet.Filtered := Value + else begin + if not Value then + if DataLink.DataSet is TCustomDADataSet then + TCustomDADataSet(DataSource.DataSet).FilterSQL := ''; + end; + end +end; + +procedure TCRDBGrid.UpdateRowCount; +begin + with DataLink do + if Active and (RecordCount > 0) and HandleAllocated then begin + RowCount := 1000; + BufferCount := VisibleRowCount; + if dgTitles in Options then + RowCount := RecordCount + 1 + else + RowCount := RecordCount; + end; + Invalidate; +end; + +procedure TCRDBGrid.ApplyFilter; +var + i: integer; + St, FilterText: string; + OldActiveColumn: integer; +begin + if not FFiltered then + Exit; + + FilterText := ''; + for i := 0 to Columns.Count - 1 do begin + St := TCRColumn(Columns[i]).GetFilterExpression(TCRColumn(Columns[i]).FilterExpression); + if St <> '' then begin + if FilterText <> '' then + FilterText := FilterText + ' AND '; + FilterText := FilterText + St; + end; + end; + + if dgeLocalFilter in OptionsEx then begin + DataSource.DataSet.Filter := FilterText; + DataSource.DataSet.Filtered := FFiltered; +// TOraDataSet(DataSource.DataSet).Filtered := FilterText <> ''; + end + else + if DataSource.DataSet is TCustomDADataSet then begin + OldActiveColumn := -1; + if CRGridTitleEdit.FActiveColumn <> nil then + for i := 0 to Columns.Count - 1 do + if CRGridTitleEdit.FActiveColumn = Columns[i] then begin + OldActiveColumn := i; + Break; + end; + + CRGridTitleEdit.FActiveColumn := nil; + TCustomDADataSet(DataSource.DataSet).FilterSQL := FilterText; + + if OldActiveColumn <> -1 then + CRGridTitleEdit.FActiveColumn := Columns[OldActiveColumn]; + for i := 0 to High(CRGridTitleEdit.FFilterExpressions) do + TCRColumn(Columns[i]).FilterExpression := CRGridTitleEdit.FFilterExpressions[i]; + end; + + ResetTotals; + LoadTotals; +end; + +procedure TCRDBGrid.FilteredItemClick(Sender: TObject); +begin + Filtered := not Filtered; + (Sender as TMenuItem).Checked := FFiltered; +end; + +procedure TCRDBGrid.DoExit; +begin + inherited; + + if not FContinueEditingFilter then + CRGridTitleEdit.EditingFilter := False + else + FContinueEditingFilter := False; +end; + +procedure TCRDBGrid.MoveColRow(ACol, ARow: Longint; MoveAnchor, Show: Boolean); +begin + inherited MoveColRow(ACol, ARow, MoveAnchor, Show); +end; + +function TCRDBGrid.DataToRawColumn(ACol: Integer): Integer; +begin + Result := inherited DataToRawColumn(ACol); +end; + +procedure TCRDBGrid.InvalidateCol(ACol: Longint); +begin + inherited InvalidateCol(ACol); +end; + +procedure TCRDBGrid.InvalidateRow(ARow: Longint); +begin + inherited InvalidateRow(ARow); +end; + +procedure TCRDBGrid.AdjustColumns; +var + Width: array of integer; + i, j, OldActive: integer; + CurWidth: Integer; +begin + if not DataLink.Active then + Exit; + SetLength(Width, Columns.Count); + + OldActive := DataLink.ActiveRecord; + try + for i := TopRow - 1 to VisibleRowCount - 1 do begin + Datalink.ActiveRecord := i; + for j := 0 to Columns.Count - 1 do begin + if Assigned(Columns[j].Field) then + CurWidth := Canvas.TextWidth(Columns[j].Field.DisplayText) + else + CurWidth := 0; + if CurWidth > Width[j] then + Width[j] := CurWidth; + end; + end; + finally + DataLink.ActiveRecord := OldActive; + end; + + for i := 0 to Columns.Count - 1 do begin + CurWidth := Canvas.TextWidth(Columns[i].Title.Caption); + if CurWidth > Width[i] then + ColWidths[i + IndicatorOffset] := CurWidth + 4 + else + ColWidths[i + IndicatorOffset] := Width[i] + 4; + end; +end; + +function TCRDBGrid.GetColumns: TCRDBGridColumns; +begin + Result := TCRDBGridColumns(inherited Columns); +end; + +procedure TCRDBGrid.SetColumns(const Value: TCRDBGridColumns); +begin + inherited Columns.Assign(Value); +end; + +procedure TCRDBGrid.WMMouseWheel(var Message: TWMMouseWheel); +begin + if Message.WheelDelta > 0 then + SendMessage(Handle, WM_KEYDOWN, VK_UP, 0) + else + SendMessage(Handle, WM_KEYDOWN, VK_DOWN, 0); +end; + +procedure TCRDBGrid.TitleClick(Column: TColumn); +begin + if FTitleBarUp then + inherited TitleClick(Column); +end; + +{ TCRColumnTitle } + +function TCRColumnTitle.GetCaption: string; +begin + Result := inherited Caption; +end; + +function TCRColumnTitle.IsCaptionStored: boolean; +begin + Result := (cvTitleCaption in Column.AssignedValues) and + (Caption <> DefaultCaption); +end; + +procedure TCRColumnTitle.SetCaption(const Value: string); +begin + if Value <> inherited Caption then begin + inherited Caption := Value; + + TCRColumn(Column).ChangedTitle(True); + end; +end; + +{ TCRGridTitleEdit } + +procedure TCRGridTitleEdit.ActivateAt(ARect: TRect; ActiveColumn: TColumn; AsFilter: boolean); +begin + if not Assigned(CRDBGrid) then + Exit; + + try + StopEdit(True); + FEdit.Visible := False; + FAsFilter := AsFilter; + FActiveColumn := ActiveColumn; + SetClientRect(ARect); + + if AsFilter then begin + if EditingFilter then + Caption := FFilterExpressions[FActiveColumn.Index] + else + Caption := TCRColumn(FActiveColumn).FilterExpression; + end + else + Caption := ''; + finally + Visible := True; + SetFocus; + end; +end; + +constructor TCRGridTitleEdit.Create(AOwner: TComponent); +begin + inherited; + + if AOwner is TCRDBGrid then + CRDBGrid := AOwner as TCRDBGrid; + Visible := False; + AutoSize := False; + Anchors := Anchors + [akRight]; + Width := 0; + Height := 0; + + FEdit := TEdit.Create(Self); + FEdit.Visible := False; + FEdit.TabStop := False; + FEdit.BorderStyle := bsNone; + FEdit.Width := 0; + FEdit.Height := 0; + InsertControl(FEdit); + FEdit.Parent := Self; + FEdit.ParentFont := False; + FEdit.OnKeyPress := FEditKeyPress; + FEdit.OnKeyDown := FEditKeyDown; + FEdit.OnChange := FEditChange; + FEdit.OnExit := FEditExit; +end; + +procedure TCRGridTitleEdit.DoExit; +begin + inherited; + + FEdit.Visible := False; + Visible := False; +end; + +procedure TCRGridTitleEdit.FEditChange(Sender: TObject); +begin + if not FEdit.Modified then + Exit; + if FAsFilter then + EditingFilter := True + else + ProcessEdit; +end; + +procedure TCRGridTitleEdit.FEditExit(Sender: TObject); +begin + StopEdit(True); +end; + +procedure TCRGridTitleEdit.WMMouseWheel(var Message: TWMMouseWheel); +begin + if Message.WheelDelta > 0 then + SendMessage(Handle, WM_KEYDOWN, VK_UP, 0) + else + SendMessage(Handle, WM_KEYDOWN, VK_DOWN, 0); +end; + +procedure TCRGridTitleEdit.FEditKeyDown(Sender: TObject; var Key: word; + Shift: TShiftState); +var + OldKey: word; + OldWidth : integer; +begin + OldKey := Key; + Key := 0; + case OldKey of + VK_RETURN: begin + OldWidth := Self.Width; + StopEdit(True); + Self.Width := OldWidth; + Visible := True; + SetFocus; + end; + VK_ESCAPE: begin + StopEdit(False); + Visible := True; + SetFocus; + end; + VK_UP: + GotoUpperCell; + VK_DOWN: + GotoLowerCell; + VK_TAB: begin + if Shift = [ssShift] then + GotoPrevCell + else if Shift = [] then + GotoNextCell; + end; + else + Key := OldKey; + end; +end; + +procedure TCRGridTitleEdit.FEditKeyPress(Sender: TObject; var Key: char); +begin + if (Key = #13) or (Key = #27) then + Key := #0; +end; + +procedure TCRGridTitleEdit.GotoLowerCell; +begin + if Assigned(CRDBGrid) then begin + if FAsFilter then begin + StopEdit(True); + EditingFilter := False; + if dgeSearchBar in CRDBGrid.OptionsEx then begin + CRDBGrid.ActivateSearchEdit(FActiveColumn); + Exit; + end; + end; + with CRDBGrid do + if DataLink.Active then begin + Col := DataToRawColumn(FActiveColumn.Index); + DataLink.DataSet.MoveBy(TopRow - Row); + end; + CRDBGrid.SetFocus; + end; +end; + +procedure TCRGridTitleEdit.GotoNextCell; +var + i, Start: integer; +begin + if not (Assigned(FActiveColumn) and Assigned(CRDBGrid)) then + Exit; + StopEdit(True); + if FAsFilter then begin + Start := 0; + for i := FActiveColumn.Index + 1 to CRDBGrid.Columns.Count - 1 do + if TCRColumn(CRDBGrid.Columns[i]).CanBeSorted then begin + CRDBGrid.MoveColRow(CRDBGrid.DataToRawColumn(i), CRDBGrid.TopRow, True, True); + CRDBGrid.ActivateFilterEdit(CRDBGrid.Columns[i]); + Exit; + end; + EditingFilter := False; + end + else + Start := FActiveColumn.Index + 1; + + if dgeSearchBar in CRDBGrid.OptionsEx then + for i := Start to CRDBGrid.Columns.Count - 1 do + if TCRColumn(CRDBGrid.Columns[i]).CanBeSorted then begin + CRDBGrid.MoveColRow(CRDBGrid.DataToRawColumn(i), CRDBGrid.TopRow, True, True); + CRDBGrid.ActivateSearchEdit(CRDBGrid.Columns[i]); + Exit; + end; + + with CRDBGrid do + if DataLink.Active then begin + LeftCol := 1; + Col := DataToRawColumn(0); + DataLink.DataSet.MoveBy(TopRow - Row); + end; + CRDBGrid.SetFocus; +end; + +procedure TCRGridTitleEdit.GotoPrevCell; +var + i, Start: integer; +begin + if not (Assigned(FActiveColumn) and Assigned(CRDBGrid)) then + Exit; + + StopEdit(True); + if not FAsFilter then begin + Start := CRDBGrid.Columns.Count - 1; + for i := FActiveColumn.Index - 1 downto 0 do + if TCRColumn(CRDBGrid.Columns[i]).CanBeSorted then begin + CRDBGrid.MoveColRow(CRDBGrid.DataToRawColumn(i), CRDBGrid.TopRow, True, True); + CRDBGrid.ActivateSearchEdit(CRDBGrid.Columns[i]); + Exit; + end; + end + else + Start := FActiveColumn.Index - 1; + + if dgeFilterBar in CRDBGrid.OptionsEx then + for i := Start downto 0 do + if TCRColumn(CRDBGrid.Columns[i]).CanBeSorted then begin + CRDBGrid.MoveColRow(CRDBGrid.DataToRawColumn(i), CRDBGrid.TopRow, True, True); + CRDBGrid.ActivateFilterEdit(CRDBGrid.Columns[i]); + Exit; + end; +end; + +procedure TCRGridTitleEdit.GotoUpperCell; +begin + if not FAsFilter and (dgeFilterBar in CRDBGrid.OptionsEx) + and Assigned(CRDBGrid) + then begin + CRDBGrid.ActivateFilterEdit(FActiveColumn); + end; +end; + +procedure TCRGridTitleEdit.KeyDown(var Key: word; Shift: TShiftState); +var + OldKey: word; +begin + inherited; + + OldKey := Key; + Key := 0; + case OldKey of + VK_RETURN : + StartEdit; + VK_UP: + GotoUpperCell; + VK_DOWN: + GotoLowerCell; + VK_RIGHT: + GotoNextCell; + VK_LEFT: + GotoPrevCell; + VK_TAB: begin + if Shift = [ssShift] then + GotoPrevCell + else if Shift = [] then + GotoNextCell; + end; + VK_ESCAPE: + if EditingFilter then begin + SetLength(FFilterExpressions,0); + EditingFilter := False; + Caption := TCRColumn(FActiveColumn).FilterExpression; + CRDBGrid.InvalidateRow(0); + Invalidate; + end; + else + Key := OldKey; + end; +end; + +procedure TCRGridTitleEdit.MouseDown(Button: TMouseButton; + Shift: TShiftState; X, Y: integer); +begin + inherited; + + if Focused and (Button = mbLeft) then + StartEdit; +end; + +procedure TCRGridTitleEdit.PaintWindow(DC: HDC); +var + Rect: TRect; + Brush: THandle; + OldBrush: THandle; + OldFont: THandle; + BrushColor: TColor; + FontColor: TColor; +begin + Rect := GetClientRect; + if Focused then begin + BrushColor := clHighlight; + FontColor := clWhite; + end + else begin + BrushColor := Color; + FontColor := Font.Color; + end; + + Brush := CreateSolidBrush(ColorToRGB(BrushColor)); + try + OldBrush := SelectObject(DC, Brush); + FillRect(DC, Rect, Brush); + if Focused then + DrawFocusRect(DC, Rect); + InflateRect(Rect, -2, -2); + SetTextColor(DC, ColorToRGB(FontColor)); + SetBkColor(DC, ColorToRGB(BrushColor)); + OldFont := SelectObject(DC, Font.Handle); + DrawText(DC, PChar(Caption), Length(Caption), Rect, DT_LEFT or DT_VCENTER); + SelectObject(DC, OldFont); + SelectObject(DC, OldBrush); + finally + DeleteObject(Brush); + end; +end; + +procedure TCRGridTitleEdit.PostFilter; +var + i: integer; +begin + StopEdit(True); + if (CRDBGrid = nil) or (Length(FFilterExpressions) = 0) then + Exit; + for i := 0 to High(FFilterExpressions) do begin + TCRColumn(CRDBGrid.Columns[i]).FilterExpression := FFilterExpressions[i]; + end; + CRDBGrid.ApplyFilter; +end; + +procedure TCRGridTitleEdit.ProcessEdit; +begin + if (FActiveColumn = nil) or (CRDBGrid = nil) or not FEdit.Modified then + Exit; + + if FAsFilter then + with CRDBGrid do begin + try + TCRColumn(FActiveColumn).GetFilterExpression(FEdit.Text); + FFilterExpressions[FActiveColumn.Index] := FEdit.Text; + Self.Caption := FFilterExpressions[FActiveColumn.Index]; + except + on EConvertError do begin + FEdit.SelectAll; + raise; + end; + end; + end + else + try + with FActiveColumn.Field do + DataSet.Locate(FieldName, {$IFDEF CLR}Variant{$ENDIF}(FEdit.Text), [loCaseInsensitive,loPartialKey]); + except + on EConvertError do + Exit; + end; +end; + +procedure TCRGridTitleEdit.SetClientRect(ARect: TRect); +begin + Top := ARect.Top; + Left := ARect.Left; + Width := ARect.Right - ARect.Left; + Height := CRDBGrid.DefaultRowHeight; + FEdit.Top := 2; + FEdit.Left := 2; + FEdit.Width := Width - 2; + FEdit.Height := Height - 2; +end; + +procedure TCRGridTitleEdit.SetCRDBGrid(const Value: TCRDBGrid); +begin + FCRDBGrid := Value; +end; + +procedure TCRGridTitleEdit.SetEditingFilter(const Value: boolean); +var + i: integer; +begin + if FEditingFilter <> Value then begin + FEditingFilter := Value; + if Assigned(CRDBGrid) then begin + if not Value then begin + PostFilter; + CRDBGrid.FContinueEditingFilter := False; + end + else + with CRDBGrid do begin + SetLength(FFilterExpressions, Columns.Count); + for i := 0 to Columns.Count - 1 do + FFilterExpressions[i] := TCRColumn(Columns[i]).FilterExpression; + end; + end; + if Assigned(CRDBGrid) and (dgIndicator in CRDBGrid.Options) then + CRDBGrid.InvalidateCol(0); + end; +end; + +procedure TCRGridTitleEdit.SetFocus; +begin + inherited; + Invalidate; +end; + +procedure TCRGridTitleEdit.StartEdit; +begin + if CRDBGrid = nil then + Exit; + if FAsFilter then begin + FEdit.Text := Caption; + end + else + FEdit.Text := ''; + FEdit.Font := CRDBGrid.Font; + FEdit.Modified := False; + FEdit.Visible := True; + FEdit.SetFocus; + Invalidate; +end; + +procedure TCRGridTitleEdit.StopEdit(AcceptChanges: boolean); +begin + if not FEdit.Visible then + Exit; + if AcceptChanges then + ProcessEdit; + CRDBGrid.FContinueEditingFilter := EditingFilter; + FEdit.Modified := False; + FEdit.Visible := False; + if AcceptChanges then + EditingFilter := False; + Invalidate; +// Visible := True; +// SetFocus; +end; + +procedure TCRGridTitleEdit.WMChar(var Message: TWMChar); +begin + inherited; + + if (Message.CharCode > 0) and (Message.CharCode <> VK_TAB) + and (Message.CharCode <> VK_ESCAPE) + then begin + StartEdit; + if Message.CharCode <> VK_RETURN then + SendMessage(FEdit.Handle, Message.Msg , {$IFDEF VER9P}Message.CharCode{$ELSE}TMessage(Message).WParam{$ENDIF}, + {$IFDEF VER9P}Message.KeyData{$ELSE}TMessage(Message).LParam{$ENDIF}); + end; +end; + +procedure TCRGridTitleEdit.WMGetDlgCode(var Message: TWMGetDlgCode); +begin + Message.Result := Message.Result or DLGC_WANTARROWS; + if Assigned(CRDBGrid) and (dgTabs in CRDBGrid.Options) then + Message.Result := Message.Result or DLGC_WANTTAB; +end; + +{ TMemoEditorForm } + +function TMemoEditorForm.CloseQuery: boolean; +begin + Result := inherited CloseQuery; + if FMemo.Modified and (ModalResult <> mrOK) then + case MessageDlg(Format(fmtModifiedWarning,[Caption]), mtConfirmation, mbYesNoCancel, 0) of + mrYes: + ModalResult := mrOK; + mrCancel: + Result := False; + end; +end; + +constructor TMemoEditorForm.Create(AOwner: TComponent); +{$IFDEF CLR} +var + Cookie: LockCookie; +{$ENDIF} +begin +{$IFDEF CLR} + Cookie := GlobalNameSpace.UpgradeToWriterLock(MaxInt); + try + inherited CreateNew(AOwner); + finally + GlobalNameSpace.DowngradeFromWriterLock(Cookie); + end; +{$ELSE} + GlobalNameSpace.BeginWrite; + try + CreateNew(AOwner); + finally + GlobalNameSpace.EndWrite; + end; +{$ENDIF} + + Visible := False; + Position := poScreenCenter; + Width := 530; + Height := 308; + BorderStyle := bsSizeable; + BorderIcons := [biSystemMenu]; + ParentFont := True; + Constraints.MinHeight := 100; + Constraints.MinWidth := 260; + + FMemo := TMemo.Create(Self); + InsertControl(FMemo); + FMemo.Top := 0; + FMemo.Height := 270; + FMemo.Align := alTop; + FMemo.Anchors := FMemo.Anchors + [akBottom]; + FMemo.ScrollBars := ssBoth; + FMemo.OnKeyDown := MemoKeyDown; + + FCheckBox := TCheckBox.Create(Self); + InsertControl(FCheckBox); + FCheckBox.Caption := sWordWrap; + FCheckBox.Left := 8; + FCheckBox.Top := 282; + FCheckBox.Anchors := [akLeft, akBottom]; + FCheckBox.OnClick := CheckBoxClick; + + + FCancelBtn := TButton.Create(Self); + InsertControl(FCancelBtn); + FCancelBtn.Top := 278; + FCancelBtn.Left := Width - FCancelBtn.Width - 4; + FCancelBtn.Anchors := [akRight, akBottom]; + FCancelBtn.Caption := SCancel; + FCancelBtn.Cancel := True; + FCancelBtn.ModalResult := mrCancel; + + FOKBtn := TButton.Create(Self); + InsertControl(FOKBtn); + FOKBtn.Top := FCancelBtn.Top; + FOKBtn.Left := FCancelBtn.Left - FOKBtn.Width - 4; + FOKBtn.Anchors := [akRight, akBottom]; + FOKBtn.Caption := SOK; + FOKBtn.ModalResult := mrOK; + FOKBtn.TabOrder := 1; +end; + +procedure TMemoEditorForm.MemoKeyDown(Sender: TObject; var Key: word; + Shift: TShiftState); +begin + case key of + VK_RETURN: + if Shift = [ssCtrl] then + ModalResult := mrOK; + VK_ESCAPE: + ModalResult := mrCancel; + end; +end; + +procedure TMemoEditorForm.CheckBoxClick(Sender: tobject); +begin + FMemo.WordWrap := FCheckBox.Checked; +end; + +procedure TMemoEditorForm.SetReadOnly(const Value: boolean); +begin + if FReadOnly <> Value then begin + FReadOnly := Value; + FOKBtn.Visible := not Value; + FMemo.ReadOnly := Value; + if Value then + FCancelBtn.Caption := SClose + else + FCancelBtn.Caption := SCancel; + end; +end; + +{$IFDEF VER6P} +{ TCRGridDataLink } + +procedure TCRGridDataLink.DataSetChanged; +begin + inherited; + + if FDataSetChanging or (DataSet.State <> dsBrowse) then + Exit; + + FDataSetChanging := True; + try + TCRDBGrid(Grid).DataChanged; + finally + FDataSetChanging := False; + end; +end; +{$ENDIF} + +initialization + bmpSortAsc := TBitmap.Create; + bmpSortAsc.Handle := LoadBitmap(hInstance, 'SORTASC'); + bmpSortAsc.Transparent := True; + + bmpSortDesc := TBitmap.Create; + bmpSortDesc.Handle := LoadBitmap(hInstance, 'SORTDESC'); + bmpSortDesc.Transparent := True; + + bmpFilter := TBitmap.Create; + bmpFilter.Handle := LoadBitmap(hInstance, 'FILTER'); + bmpFilter.Transparent := True; + + bmpSearch := TBitmap.Create; + bmpSearch.Handle := LoadBitmap(hInstance, 'SEARCH'); + bmpSearch.Transparent := True; + + bmpMenu := TBitmap.Create; + bmpMenu.Handle := LoadBitmap(hInstance, 'MENU'); + bmpMenu.Transparent := True; + + bmpActiveFilter := TBitmap.Create; + bmpActiveFilter.Handle := LoadBitmap(hInstance, 'ACTIVE_FILTER'); + bmpActiveFilter.Transparent := True; + + bmpEditMode := TBitmap.Create; + bmpEditMode.Handle := LoadBitmap(hInstance, 'EDIT'); + bmpEditMode.Transparent := True; + +finalization + bmpSortDesc.Free; + bmpSortAsc.Free; + bmpFilter.Free; + bmpSearch.Free; + bmpMenu.Free; + bmpActiveFilter.Free; + bmpEditMode.Free; +end. diff --git a/internal/4.10.0.10/1/CRGrid/Source/CRGrid.res b/internal/4.10.0.10/1/CRGrid/Source/CRGrid.res new file mode 100644 index 0000000..0c33e79 Binary files /dev/null and b/internal/4.10.0.10/1/CRGrid/Source/CRGrid.res differ diff --git a/internal/4.10.0.10/1/CRGrid/Source/Delphi10/CRControls.reg b/internal/4.10.0.10/1/CRGrid/Source/Delphi10/CRControls.reg new file mode 100644 index 0000000..0b59991 --- /dev/null +++ b/internal/4.10.0.10/1/CRGrid/Source/Delphi10/CRControls.reg @@ -0,0 +1,4 @@ +REGEDIT4 + +[HKEY_CURRENT_USER\Software\Borland\BDS\4.0\Known Packages] +"[IDEPATH4]bin\\CRControls100.bpl"="Core Lab controls" diff --git a/internal/4.10.0.10/1/CRGrid/Source/Delphi10/CRControls100.cfg b/internal/4.10.0.10/1/CRGrid/Source/Delphi10/CRControls100.cfg new file mode 100644 index 0000000..f92fde1 --- /dev/null +++ b/internal/4.10.0.10/1/CRGrid/Source/Delphi10/CRControls100.cfg @@ -0,0 +1,45 @@ +-$A8 +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-JL +-cg +-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-H+ +-W+ +-M +-$M16384,1048576 +-K$00400000 +-N0"." +-LE"D:\Documents and Settings\AlexH\My Documents\Borland Studio Projects\Bpl" +-LN"." +-U"..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi10;..\;..\..\..\Odac\source;..\..\..\ODac\source\Delphi10;D:\Program Files\Borland\BDS\4.0\source\ToolsAPI\" +-O"..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi10;..\;..\..\..\Odac\source;..\..\..\ODac\source\Delphi10;D:\Program Files\Borland\BDS\4.0\source\ToolsAPI\" +-I"..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi10;..\;..\..\..\Odac\source;..\..\..\ODac\source\Delphi10;D:\Program Files\Borland\BDS\4.0\source\ToolsAPI\" +-R"..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi10;..\;..\..\..\Odac\source;..\..\..\ODac\source\Delphi10;D:\Program Files\Borland\BDS\4.0\source\ToolsAPI\" +-Z +-w-UNSAFE_TYPE +-w-UNSAFE_CODE +-w-UNSAFE_CAST diff --git a/internal/4.10.0.10/1/CRGrid/Source/Delphi10/CRControls100.res b/internal/4.10.0.10/1/CRGrid/Source/Delphi10/CRControls100.res new file mode 100644 index 0000000..d50d7f1 Binary files /dev/null and b/internal/4.10.0.10/1/CRGrid/Source/Delphi10/CRControls100.res differ diff --git a/internal/4.10.0.10/1/CRGrid/Source/Delphi10/CoreLab.Vcl.bdsproj b/internal/4.10.0.10/1/CRGrid/Source/Delphi10/CoreLab.Vcl.bdsproj new file mode 100644 index 0000000..9c01c6f --- /dev/null +++ b/internal/4.10.0.10/1/CRGrid/Source/Delphi10/CoreLab.Vcl.bdsproj @@ -0,0 +1,220 @@ + + + + + + + + + + + + CoreLab.Vcl.dpk + + + 7.0 + + + 8 + 0 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 0 + 1 + True + True + WinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + Borland.Vcl;CoreLab.Vcl;CoreLab.Dac + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + + + + 0 + 0 + 1 + True + False + False + 4096 + 1048576 + 4194304 + Core Lab VCL + False + + + + . + + . + ..\;d:\winnt\microsoft.net\framework\v1.1.4322;d:\projects\dexter\dac\source\delphi10;d:\program files\common files\borland shared\bds\shared assemblies\4.0;D:\Projects\Dexter\Dac\Source + d:\winnt\microsoft.net\framework\v1.1.4322\System.Drawing.dll;Borland.VclDbCtrls;Borland.Vcl;Borland.Delphi;CoreLab.Dac + + + False + + + + + + False + + + + + + False + + True + + + + $00000000 + + + + True + False + 6 + 10 + 1 + 4010 + False + False + False + False + False + 1058 + 1251 + + + + + 6.10.1.10 + + + + + + 6.10.1.10 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/internal/4.10.0.10/1/CRGrid/Source/Delphi10/CoreLab.Vcl.cfg b/internal/4.10.0.10/1/CRGrid/Source/Delphi10/CoreLab.Vcl.cfg new file mode 100644 index 0000000..1319a36 --- /dev/null +++ b/internal/4.10.0.10/1/CRGrid/Source/Delphi10/CoreLab.Vcl.cfg @@ -0,0 +1,42 @@ +-$A8 +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-cg +-vn +-AWinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-NSBorland.Vcl;CoreLab.Vcl;CoreLab.Dac +-H+ +-W+ +-M +-$M4096,1048576 +-K$00400000 +-N0"." +-LN"." +-U"..\;d:\winnt\microsoft.net\framework\v1.1.4322;d:\projects\dexter\dac\source\delphi10;d:\program files\common files\borland shared\bds\shared assemblies\4.0;D:\Projects\Dexter\Dac\Source" +-O"..\;d:\winnt\microsoft.net\framework\v1.1.4322;d:\projects\dexter\dac\source\delphi10;d:\program files\common files\borland shared\bds\shared assemblies\4.0;D:\Projects\Dexter\Dac\Source" +-I"..\;d:\winnt\microsoft.net\framework\v1.1.4322;d:\projects\dexter\dac\source\delphi10;d:\program files\common files\borland shared\bds\shared assemblies\4.0;D:\Projects\Dexter\Dac\Source" +-R"..\;d:\winnt\microsoft.net\framework\v1.1.4322;d:\projects\dexter\dac\source\delphi10;d:\program files\common files\borland shared\bds\shared assemblies\4.0;D:\Projects\Dexter\Dac\Source" +-Z diff --git a/internal/4.10.0.10/1/CRGrid/Source/Delphi10/CoreLab.Vcl.dpk b/internal/4.10.0.10/1/CRGrid/Source/Delphi10/CoreLab.Vcl.dpk new file mode 100644 index 0000000..1a07250 --- /dev/null +++ b/internal/4.10.0.10/1/CRGrid/Source/Delphi10/CoreLab.Vcl.dpk @@ -0,0 +1,96 @@ +package CoreLab.Vcl; + +{$ALIGN 8} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Core Lab VCL'} +{$IMPLICITBUILD OFF} + +requires + CoreLab.Dac, + Borland.Delphi, + Borland.Vcl, + Borland.VclDbCtrls, + System.Drawing; + +contains + CoreLab.Vcl.CRControlsReg in '..\Net\CoreLab.Vcl.CRControlsReg.pas', + CoreLab.Vcl.CRGrid in '..\Net\CoreLab.Vcl.CRGrid.pas'; + +[assembly: AssemblyTitle('Core Lab VCL')] +[assembly: AssemblyDescription('Core Lab VCL')] +[assembly: AssemblyConfiguration('')] +[assembly: AssemblyCompany('Core Lab')] +[assembly: AssemblyProduct('Core Lab VCL')] +[assembly: AssemblyCopyright('')] +[assembly: AssemblyTrademark('')] +[assembly: AssemblyCulture('')] + + +// The Delphi compiler controls the AssemblyTitleAttribute via the ExeDescription. +// You can set this in the IDE via the Project Options. +// Manually setting the AssemblyTitle attribute below will override the IDE +// setting. +// [assembly: AssemblyTitle('')] + + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion('6.10.1.4010')] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile('mykey.snk')], provided your output +// directory is the project directory (the default). +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile('CoreLab.snk')] +[assembly: AssemblyKeyName('')] +end. diff --git a/internal/4.10.0.10/1/CRGrid/Source/Delphi10/CoreLab.Vcl.reg b/internal/4.10.0.10/1/CRGrid/Source/Delphi10/CoreLab.Vcl.reg new file mode 100644 index 0000000..7e8b4e5 --- /dev/null +++ b/internal/4.10.0.10/1/CRGrid/Source/Delphi10/CoreLab.Vcl.reg @@ -0,0 +1,7 @@ +REGEDIT4 + +[HKEY_CURRENT_USER\Software\Borland\BDS\4.0\Known Assemblies] +"[INSTALLDIR]Bin\\CoreLab.Vcl.dll"="CoreLab.Vcl" + +[HKEY_CURRENT_USER\Software\Borland\BDS\4.0\AssemblyFolders\CoreLab.Vcl] +@="[IDEPATH4]bin" diff --git a/internal/4.10.0.10/1/CRGrid/Source/Delphi10/CoreLab.snk b/internal/4.10.0.10/1/CRGrid/Source/Delphi10/CoreLab.snk new file mode 100644 index 0000000..a57bc46 Binary files /dev/null and b/internal/4.10.0.10/1/CRGrid/Source/Delphi10/CoreLab.snk differ diff --git a/internal/4.10.0.10/1/CRGrid/Source/Delphi10/crcontrols100.bdsproj b/internal/4.10.0.10/1/CRGrid/Source/Delphi10/crcontrols100.bdsproj new file mode 100644 index 0000000..6ff11a4 --- /dev/null +++ b/internal/4.10.0.10/1/CRGrid/Source/Delphi10/crcontrols100.bdsproj @@ -0,0 +1,181 @@ + + + + + + + + + + + + CRControls100.dpk + + + 7.0 + + + 8 + 0 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 0 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + + + + 0 + 44 + 1 + False + False + False + 16384 + 1048576 + 4194304 + CoreLab Controls + False + + + + . + + . + ..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi10;..\;..\..\..\Odac\source;..\..\..\ODac\source\Delphi10;D:\Program Files\Borland\BDS\4.0\source\ToolsAPI\ + + + + False + + + + + + False + + + + + + False + + True + False + + + + $00000000 + + + + True + False + 6 + 10 + 1 + 4010 + False + False + False + False + False 1033 + 1252 + + + Core Lab + + 6.10.1.10 + + + + + Core Lab Controls + 6.10.1.10 + + File D:\Program Files\Borland\BDS\4.0\Bin\dacvcl100.bpl not found + File D:\Program Files\Borland\BDS\4.0\Bin\dcldac100.bpl not found + + + diff --git a/internal/4.10.0.10/1/CRGrid/Source/Delphi10/crcontrols100.dpk b/internal/4.10.0.10/1/CRGrid/Source/Delphi10/crcontrols100.dpk new file mode 100644 index 0000000..97e20c3 --- /dev/null +++ b/internal/4.10.0.10/1/CRGrid/Source/Delphi10/crcontrols100.dpk @@ -0,0 +1,39 @@ +package CRControls100; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'CoreLab Controls'} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + dbrtl, + vcldb, + designide, + dac100; + +contains + CRControlsReg in '..\CRControlsReg.pas'; + +end. diff --git a/internal/4.10.0.10/1/CRGrid/Source/Delphi11/CRControls105.res b/internal/4.10.0.10/1/CRGrid/Source/Delphi11/CRControls105.res new file mode 100644 index 0000000..d50d7f1 Binary files /dev/null and b/internal/4.10.0.10/1/CRGrid/Source/Delphi11/CRControls105.res differ diff --git a/internal/4.10.0.10/1/CRGrid/Source/Delphi11/CoreLab.Vcl.bdsproj b/internal/4.10.0.10/1/CRGrid/Source/Delphi11/CoreLab.Vcl.bdsproj new file mode 100644 index 0000000..365bc27 --- /dev/null +++ b/internal/4.10.0.10/1/CRGrid/Source/Delphi11/CoreLab.Vcl.bdsproj @@ -0,0 +1,203 @@ + + + + + + + + + + + + CoreLab.Vcl.dpk + + + + + + + 7.0 + + + 8 + 0 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 0 + 1 + True + True + WinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + Borland.Vcl;CoreLab.Dac;CoreLab.Vcl + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 4096 + 1048576 + 4194304 + Core Lab VCL + + + + + + + D:\Projects\Delphi\CRControls\Source\Delphi11;D:\Program Files\Common Files\Borland Shared\BDS\Shared Assemblies\5.0;D:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 + D:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll;Borland.VclDbCtrls;Borland.Vcl;Borland.Delphi;D:\Projects\Delphi\CRControls\Source\Delphi11\CoreLab.Dac.dll + + + False + + + + + + False + + + True + False + + + False + + + True + False + 6 + 10 + 1 + 5010 + False + False + False + False + False + 1049 + 1251 + + + + + 6.10.1.10 + + + + + + 6.10.1.10 + + + + + + + + + + + + + + + + + + + + + diff --git a/internal/4.10.0.10/1/CRGrid/Source/Delphi11/CoreLab.Vcl.cfg b/internal/4.10.0.10/1/CRGrid/Source/Delphi11/CoreLab.Vcl.cfg new file mode 100644 index 0000000..076e430 --- /dev/null +++ b/internal/4.10.0.10/1/CRGrid/Source/Delphi11/CoreLab.Vcl.cfg @@ -0,0 +1,39 @@ +-$A8 +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-cg +-AWinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-NSBorland.Vcl;CoreLab.Dac;CoreLab.Vcl +-H+ +-W+ +-M +-$M4096,1048576 +-K$00400000 +-U"D:\Projects\Delphi\CRControls\Source\Delphi11;D:\Program Files\Common Files\Borland Shared\BDS\Shared Assemblies\5.0;D:\WINDOWS\Microsoft.NET\Framework\v2.0.50727" +-O"D:\Projects\Delphi\CRControls\Source\Delphi11;D:\Program Files\Common Files\Borland Shared\BDS\Shared Assemblies\5.0;D:\WINDOWS\Microsoft.NET\Framework\v2.0.50727" +-I"D:\Projects\Delphi\CRControls\Source\Delphi11;D:\Program Files\Common Files\Borland Shared\BDS\Shared Assemblies\5.0;D:\WINDOWS\Microsoft.NET\Framework\v2.0.50727" +-R"D:\Projects\Delphi\CRControls\Source\Delphi11;D:\Program Files\Common Files\Borland Shared\BDS\Shared Assemblies\5.0;D:\WINDOWS\Microsoft.NET\Framework\v2.0.50727" +-Z diff --git a/internal/4.10.0.10/1/CRGrid/Source/Delphi11/CoreLab.Vcl.dpk b/internal/4.10.0.10/1/CRGrid/Source/Delphi11/CoreLab.Vcl.dpk new file mode 100644 index 0000000..f4bc59a --- /dev/null +++ b/internal/4.10.0.10/1/CRGrid/Source/Delphi11/CoreLab.Vcl.dpk @@ -0,0 +1,96 @@ +package CoreLab.Vcl; + +{$ALIGN 8} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Core Lab VCL'} +{$IMPLICITBUILD OFF} + +requires + CoreLab.Dac, + Borland.Delphi, + Borland.Vcl, + Borland.VclDbCtrls, + System.Drawing; + +contains + CoreLab.Vcl.CRControlsReg in '..\Net\CoreLab.Vcl.CRControlsReg.pas', + CoreLab.Vcl.CRGrid in '..\Net\CoreLab.Vcl.CRGrid.pas'; + +[assembly: AssemblyTitle('Core Lab VCL')] +[assembly: AssemblyDescription('Core Lab VCL')] +[assembly: AssemblyConfiguration('')] +[assembly: AssemblyCompany('Core Lab')] +[assembly: AssemblyProduct('Core Lab VCL')] +[assembly: AssemblyCopyright('')] +[assembly: AssemblyTrademark('')] +[assembly: AssemblyCulture('')] + + +// The Delphi compiler controls the AssemblyTitleAttribute via the ExeDescription. +// You can set this in the IDE via the Project Options. +// Manually setting the AssemblyTitle attribute below will override the IDE +// setting. +// [assembly: AssemblyTitle('')] + + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion('6.10.1.5010')] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile('mykey.snk')], provided your output +// directory is the project directory (the default). +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile('CoreLab.snk')] +[assembly: AssemblyKeyName('')] +end. diff --git a/internal/4.10.0.10/1/CRGrid/Source/Delphi11/CoreLab.snk b/internal/4.10.0.10/1/CRGrid/Source/Delphi11/CoreLab.snk new file mode 100644 index 0000000..a57bc46 Binary files /dev/null and b/internal/4.10.0.10/1/CRGrid/Source/Delphi11/CoreLab.snk differ diff --git a/internal/4.10.0.10/1/CRGrid/Source/Delphi11/crcontrols105.bdsproj b/internal/4.10.0.10/1/CRGrid/Source/Delphi11/crcontrols105.bdsproj new file mode 100644 index 0000000..ae98623 --- /dev/null +++ b/internal/4.10.0.10/1/CRGrid/Source/Delphi11/crcontrols105.bdsproj @@ -0,0 +1,183 @@ + + + + + + + + + + + + crcontrols105.dpk + + + 7.0 + + + 8 + 0 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 0 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + + + + 0 + 44 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + CoreLab Controls + + + + + + + + + + + False + + + + + + False + + + True + False + + + False + + + True + False + 6 + 10 + 1 + 5010 + False + False + False + False + False + 1033 + 1252 + + + Core Lab + + 6.10.1.10 + + + + + Core Lab Controls + 6.10.1.10 + + + + + diff --git a/internal/4.10.0.10/1/CRGrid/Source/Delphi11/crcontrols105.cfg b/internal/4.10.0.10/1/CRGrid/Source/Delphi11/crcontrols105.cfg new file mode 100644 index 0000000..affd769 --- /dev/null +++ b/internal/4.10.0.10/1/CRGrid/Source/Delphi11/crcontrols105.cfg @@ -0,0 +1,42 @@ +-$A8 +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-JL +-cg +-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-H+ +-W+ +-M +-$M16384,1048576 +-K$00400000 +-N0"." +-LE"D:\Documents and Settings\AlexH\My Documents\Borland Studio Projects\Bpl" +-LN"." +-U"..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi11;..\;..\..\..\Odac\source;..\..\..\ODac\source\Delphi11;D:\Program Files\Borland\BDS\4.0\source\ToolsAPI\" +-O"..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi11;..\;..\..\..\Odac\source;..\..\..\ODac\source\Delphi11;D:\Program Files\Borland\BDS\4.0\source\ToolsAPI\" +-I"..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi11;..\;..\..\..\Odac\source;..\..\..\ODac\source\Delphi11;D:\Program Files\Borland\BDS\4.0\source\ToolsAPI\" +-R"..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi11;..\;..\..\..\Odac\source;..\..\..\ODac\source\Delphi11;D:\Program Files\Borland\BDS\4.0\source\ToolsAPI\" +-Z diff --git a/internal/4.10.0.10/1/CRGrid/Source/Delphi11/crcontrols105.dpk b/internal/4.10.0.10/1/CRGrid/Source/Delphi11/crcontrols105.dpk new file mode 100644 index 0000000..9f5af2a --- /dev/null +++ b/internal/4.10.0.10/1/CRGrid/Source/Delphi11/crcontrols105.dpk @@ -0,0 +1,39 @@ +package CRControls105; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'CoreLab Controls'} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + dbrtl, + vcldb, + designide, + dac105; + +contains + CRControlsReg in '..\CRControlsReg.pas'; + +end. diff --git a/internal/4.10.0.10/1/CRGrid/Source/Delphi5/crcontrols50.cfg b/internal/4.10.0.10/1/CRGrid/Source/Delphi5/crcontrols50.cfg new file mode 100644 index 0000000..3b78e1d --- /dev/null +++ b/internal/4.10.0.10/1/CRGrid/Source/Delphi5/crcontrols50.cfg @@ -0,0 +1,41 @@ +-$A+ +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-cg +-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-H+ +-W+ +-M +-$M16384,1048576 +-K$00400000 +-N"." +-LE"d:\program files\borland\delphi5\Projects\Bpl" +-LN"." +-U"..\..\..\Dac\Source;..\..\..\DBAccess\Source;..\..\..\DBAccess\Source\Delphi5;..\..\..\Dac\Source\Delphi5;..\" +-O"..\..\..\Dac\Source;..\..\..\DBAccess\Source;..\..\..\DBAccess\Source\Delphi5;..\..\..\Dac\Source\Delphi5;..\" +-I"..\..\..\Dac\Source;..\..\..\DBAccess\Source;..\..\..\DBAccess\Source\Delphi5;..\..\..\Dac\Source\Delphi5;..\" +-R"..\..\..\Dac\Source;..\..\..\DBAccess\Source;..\..\..\DBAccess\Source\Delphi5;..\..\..\Dac\Source\Delphi5;..\" +-Z diff --git a/internal/4.10.0.10/1/CRGrid/Source/Delphi5/crcontrols50.dof b/internal/4.10.0.10/1/CRGrid/Source/Delphi5/crcontrols50.dof new file mode 100644 index 0000000..6c46c43 --- /dev/null +++ b/internal/4.10.0.10/1/CRGrid/Source/Delphi5/crcontrols50.dof @@ -0,0 +1,110 @@ +[Compiler] +A=1 +B=0 +C=1 +D=0 +E=0 +F=0 +G=1 +H=1 +I=1 +J=1 +K=0 +L=0 +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=0 +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=Core Lab Controls +[Directories] +OutputDir= +UnitOutputDir=. +PackageDLLOutputDir= +PackageDCPOutputDir=. +SearchPath=..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi5;..\;..\..\..\ODac\source;..\..\..\ODac\source\delphi5 +Packages=vclx30;VCL30;vcldb30;vcldbx30;inetdb30;inet30;VclSmp30;Qrpt30;teeui30;teedb30;tee30;dss30;IBEVNT30;Vcl40;Vcldb40 +Conditionals= +DebugSourceDirs= +UsePackages=0 +[Parameters] +RunParams= +HostApplication= +[Language] +ActiveLang= +RootDir= +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=6 +MinorVer=10 +Release=1 +Build=10 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +[Version Info Keys] +CompanyName=Core Lab +FileDescription= +FileVersion=6.10.1.10 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName=Core Lab Controls +ProductVersion=6.10.1.10 +Comments= +[HistoryLists\hlDebugSourcePath] +Count=1 +Item0=$(DELPHI)\source\vcl;$(DELPHI)\source\rtl\Corba;$(DELPHI)\source\rtl\Sys;$(DELPHI)\source\rtl\Win;$(DELPHI)\source\Internet +[HistoryLists\hlConditionals] +Count=1 +Item0=ODAC +[HistoryLists\hlUnitAliases] +Count=1 +Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +[HistoryLists\hlSearchPath] +Count=14 +Item0=.. +Item1=..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi5;..\;..\Net;$(DELPHI)\Source\Property Editors +Item2=..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi5;..\ +Item3=..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi5;..\;..\Net +Item4=..\;..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi5;..\Net;$(DELPHI)\Source\Property Editors +Item5=..;$(DELPHI)\source\toolsapi +Item6=..\..\..\Dac\Source;..\;..\Net;$(DELPHI)\Source\Property Editors +Item7=..\..\..\Dac\Source;..\;..\Net +Item8=..\;..\..\..\Dac\Source;..\..\..\ODAC\source;..\..\..\ODAC\source\delphi5 +Item9=$(DELPHI)\Lib\Debug;..\ +Item10=$(DELPHI)\Lib\Debug +Item11=$(DELPHI)\Lib\Debug;$(DELPHI)\source\vcl +Item12=$(DELPHI)\Lib\Debug;$(DELPHI)\source\vcl;$(DELPHI)\source\rtl\Corba;$(DELPHI)\source\rtl\Win;$(DELPHI)\source\Internet +Item13=$(DELPHI)\Lib\Debug;$(DELPHI)\source\vcl;$(DELPHI)\source\rtl\Corba;$(DELPHI)\source\rtl\Sys;$(DELPHI)\source\rtl\Win;$(DELPHI)\source\Internet +[HistoryLists\hlUnitOutputDirectory] +Count=1 +Item0=. +[HistoryLists\hlDCPOutput] +Count=1 +Item0=. diff --git a/internal/4.10.0.10/1/CRGrid/Source/Delphi5/crcontrols50.dpk b/internal/4.10.0.10/1/CRGrid/Source/Delphi5/crcontrols50.dpk new file mode 100644 index 0000000..a11f9d7 --- /dev/null +++ b/internal/4.10.0.10/1/CRGrid/Source/Delphi5/crcontrols50.dpk @@ -0,0 +1,36 @@ +package CRControls50; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Core Lab Controls'} +{$IMPLICITBUILD OFF} + +requires + vcl50, + Vcldb50, + dac50; + +contains + CRControlsReg in '..\CRControlsReg.pas'; + +end. diff --git a/internal/4.10.0.10/1/CRGrid/Source/Delphi5/crcontrols50.res b/internal/4.10.0.10/1/CRGrid/Source/Delphi5/crcontrols50.res new file mode 100644 index 0000000..d50d7f1 Binary files /dev/null and b/internal/4.10.0.10/1/CRGrid/Source/Delphi5/crcontrols50.res differ diff --git a/internal/4.10.0.10/1/CRGrid/Source/Delphi6/crcontrols60.cfg b/internal/4.10.0.10/1/CRGrid/Source/Delphi6/crcontrols60.cfg new file mode 100644 index 0000000..72d476e --- /dev/null +++ b/internal/4.10.0.10/1/CRGrid/Source/Delphi6/crcontrols60.cfg @@ -0,0 +1,41 @@ +-$A8 +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-cg +-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-H+ +-W+ +-M +-$M16384,1048576 +-K$00400000 +-N"." +-LE"d:\program files\borland\delphi6\Projects\Bpl" +-LN"." +-U"..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi6;..\;..\..\..\DBAccess\Source;..\..\..\DBAccess\Source\Delphi6" +-O"..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi6;..\;..\..\..\DBAccess\Source;..\..\..\DBAccess\Source\Delphi6" +-I"..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi6;..\;..\..\..\DBAccess\Source;..\..\..\DBAccess\Source\Delphi6" +-R"..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi6;..\;..\..\..\DBAccess\Source;..\..\..\DBAccess\Source\Delphi6" +-Z diff --git a/internal/4.10.0.10/1/CRGrid/Source/Delphi6/crcontrols60.dof b/internal/4.10.0.10/1/CRGrid/Source/Delphi6/crcontrols60.dof new file mode 100644 index 0000000..240596d --- /dev/null +++ b/internal/4.10.0.10/1/CRGrid/Source/Delphi6/crcontrols60.dof @@ -0,0 +1,108 @@ +[FileVersion] +Version=6.0 +[Compiler] +A=8 +B=0 +C=1 +D=0 +E=0 +F=0 +G=1 +H=1 +I=1 +J=1 +K=0 +L=0 +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=0 +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=CoreLab Controls +[Directories] +OutputDir= +UnitOutputDir=. +PackageDLLOutputDir= +PackageDCPOutputDir=. +SearchPath=..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi6;..\;..\..\..\ODAC\source;..\..\..\ODAC\source\Delphi6 +Packages= +Conditionals= +DebugSourceDirs= +UsePackages=0 +[Parameters] +RunParams= +HostApplication= +Launcher= +UseLauncher=0 +DebugCWD= +[Language] +ActiveLang= +RootDir= +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=6 +MinorVer=10 +Release=1 +Build=10 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +[Version Info Keys] +CompanyName=Core Lab +FileDescription= +FileVersion=6.10.1.10 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName=Core Lab Controls +ProductVersion=6.10.1.10 +Comments= +[HistoryLists\hlConditionals] +Count=1 +Item0=ODAC +[HistoryLists\hlUnitAliases] +Count=1 +Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +[HistoryLists\hlSearchPath] +Count=10 +Item0=..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi6;..\;..\..\..\ODAC\source;..\..\..\ODAC\source\Delphi6 +Item1=..\;..\OraMemo;..\CRGrid;..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi6;..\..\..\ODAC\source;..\..\..\ODAC\source\Delphi6;$(DELPHI)\Source\Property Editors +Item2=..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi6;..\ +Item3=..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi6;..\;..\Net;$(DELPHI)\Source\ToolsAPI;$(DELPHI)\Source\Property Editors +Item4=..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi6;..\;..\Net +Item5=..\;$(DELPHI)\Source\ToolsAPI +Item6=..\ +Item7=..\;..\OraMemo;..\CRGrid;..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi6;..\..\..\ODAC\source;..\..\..\ODAC\source\Delphi6;$(DELPHI)\Source\Property Editors;$(DELPHI)\Source\ToolsApi +Item8=..\;..\..\..\Dac\Source;..\Net;..\..\SQLDes\D6;..\..\..\SQLDes;..\..\..\Common;..\..\OraMemo;..\..\..\OraDream;$(DELPHI)\Source\ToolsAPI;$(DELPHI)\Source\Property Editors +Item9=..\;..\..\..\Dac\Source;..\Net;..\..\SQLDes\D6;..\..\..\SQLDes;..\..\..\Common;..\..\OraMemo;..\..\..\OraDream;$(DELPHI)\Source\Property Editors +[HistoryLists\hlUnitOutputDirectory] +Count=1 +Item0=. +[HistoryLists\hlDCPOutput] +Count=1 +Item0=. diff --git a/internal/4.10.0.10/1/CRGrid/Source/Delphi6/crcontrols60.dpk b/internal/4.10.0.10/1/CRGrid/Source/Delphi6/crcontrols60.dpk new file mode 100644 index 0000000..6b05abe --- /dev/null +++ b/internal/4.10.0.10/1/CRGrid/Source/Delphi6/crcontrols60.dpk @@ -0,0 +1,38 @@ +package CRControls60; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'CoreLab Controls'} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + dbrtl, + vcldb, + dac60; + +contains + CRControlsReg in '..\CRControlsReg.pas'; + +end. diff --git a/internal/4.10.0.10/1/CRGrid/Source/Delphi6/crcontrols60.res b/internal/4.10.0.10/1/CRGrid/Source/Delphi6/crcontrols60.res new file mode 100644 index 0000000..d50d7f1 Binary files /dev/null and b/internal/4.10.0.10/1/CRGrid/Source/Delphi6/crcontrols60.res differ diff --git a/internal/4.10.0.10/1/CRGrid/Source/Delphi7/crcontrols70.cfg b/internal/4.10.0.10/1/CRGrid/Source/Delphi7/crcontrols70.cfg new file mode 100644 index 0000000..3521e66 --- /dev/null +++ b/internal/4.10.0.10/1/CRGrid/Source/Delphi7/crcontrols70.cfg @@ -0,0 +1,44 @@ +-$A8 +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-cg +-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-H+ +-W+ +-M +-$M16384,1048576 +-K$00400000 +-N"." +-LE"d:\program files\borland\delphi7\Projects\Bpl" +-LN"." +-U"..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi7;..\;..\..\..\ODac\source;..\..\..\ODac\source\Delphi7" +-O"..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi7;..\;..\..\..\ODac\source;..\..\..\ODac\source\Delphi7" +-I"..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi7;..\;..\..\..\ODac\source;..\..\..\ODac\source\Delphi7" +-R"..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi7;..\;..\..\..\ODac\source;..\..\..\ODac\source\Delphi7" +-Z +-w-UNSAFE_TYPE +-w-UNSAFE_CODE +-w-UNSAFE_CAST diff --git a/internal/4.10.0.10/1/CRGrid/Source/Delphi7/crcontrols70.dof b/internal/4.10.0.10/1/CRGrid/Source/Delphi7/crcontrols70.dof new file mode 100644 index 0000000..97c9390 --- /dev/null +++ b/internal/4.10.0.10/1/CRGrid/Source/Delphi7/crcontrols70.dof @@ -0,0 +1,150 @@ +[FileVersion] +Version=7.0 +[Compiler] +A=8 +B=0 +C=1 +D=0 +E=0 +F=0 +G=1 +H=1 +I=1 +J=1 +K=0 +L=0 +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=0 +Z=1 +ShowHints=1 +ShowWarnings=1 +UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +NamespacePrefix= +SymbolDeprecated=1 +SymbolLibrary=1 +SymbolPlatform=1 +UnitLibrary=1 +UnitPlatform=1 +UnitDeprecated=1 +HResultCompat=1 +HidingMember=1 +HiddenVirtual=1 +Garbage=1 +BoundsError=1 +ZeroNilCompat=1 +StringConstTruncated=1 +ForLoopVarVarPar=1 +TypedConstVarPar=1 +AsgToTypedConst=1 +CaseLabelRange=1 +ForVariable=1 +ConstructingAbstract=1 +ComparisonFalse=1 +ComparisonTrue=1 +ComparingSignedUnsigned=1 +CombiningSignedUnsigned=1 +UnsupportedConstruct=1 +FileOpen=1 +FileOpenUnitSrc=1 +BadGlobalSymbol=1 +DuplicateConstructorDestructor=1 +InvalidDirective=1 +PackageNoLink=1 +PackageThreadVar=1 +ImplicitImport=1 +HPPEMITIgnored=1 +NoRetVal=1 +UseBeforeDef=1 +ForLoopVarUndef=1 +UnitNameMismatch=1 +NoCFGFileFound=1 +MessageDirective=1 +ImplicitVariants=1 +UnicodeToLocale=1 +LocaleToUnicode=1 +ImagebaseMultiple=1 +SuspiciousTypecast=1 +PrivatePropAccessor=1 +UnsafeType=0 +UnsafeCode=0 +UnsafeCast=0 +[Linker] +MapFile=0 +OutputObjs=0 +ConsoleApp=1 +DebugInfo=0 +RemoteSymbols=0 +MinStackSize=16384 +MaxStackSize=1048576 +ImageBase=4194304 +ExeDescription=CoreLab Controls +[Directories] +OutputDir= +UnitOutputDir=. +PackageDLLOutputDir= +PackageDCPOutputDir=. +SearchPath=..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi7;..\;..\..\..\ODac\source;..\..\..\ODac\source\Delphi7 +Packages= +Conditionals= +DebugSourceDirs= +UsePackages=0 +[Parameters] +RunParams= +HostApplication= +Launcher= +UseLauncher=0 +DebugCWD= +[Language] +ActiveLang= +RootDir= +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=6 +MinorVer=10 +Release=1 +Build=10 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +[Version Info Keys] +CompanyName=Core Lab +FileDescription= +FileVersion=6.10.1.10 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName=Core Lab Controls +ProductVersion=6.10.1.10 +Comments= +[HistoryLists\hlConditionals] +Count=1 +Item0=SDAC_TEST;DEBUG +[HistoryLists\hlUnitAliases] +Count=1 +Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +[HistoryLists\hlSearchPath] +Count=3 +Item0=$(DELPHI)\Lib\Debug;D:\Projects\Delphi\Sdac2\Source +Item1=..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi7;..\;..\..\..\ODAC\source;..\..\..\ODAC\source\Delphi7 +Item2=$(DELPHI)\Lib\Debug +[HistoryLists\hlUnitOutputDirectory] +Count=1 +Item0=. +[HistoryLists\hlOutputDirectorry] +Count=1 +Item0=. diff --git a/internal/4.10.0.10/1/CRGrid/Source/Delphi7/crcontrols70.dpk b/internal/4.10.0.10/1/CRGrid/Source/Delphi7/crcontrols70.dpk new file mode 100644 index 0000000..2937dbf --- /dev/null +++ b/internal/4.10.0.10/1/CRGrid/Source/Delphi7/crcontrols70.dpk @@ -0,0 +1,38 @@ +package CRControls70; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'CoreLab Controls'} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + dbrtl, + vcldb, + dac70; + +contains + CRControlsReg in '..\CRControlsReg.pas'; + +end. diff --git a/internal/4.10.0.10/1/CRGrid/Source/Delphi7/crcontrols70.res b/internal/4.10.0.10/1/CRGrid/Source/Delphi7/crcontrols70.res new file mode 100644 index 0000000..d50d7f1 Binary files /dev/null and b/internal/4.10.0.10/1/CRGrid/Source/Delphi7/crcontrols70.res differ diff --git a/internal/4.10.0.10/1/CRGrid/Source/Delphi8/CoreLab.Vcl.bdsproj b/internal/4.10.0.10/1/CRGrid/Source/Delphi8/CoreLab.Vcl.bdsproj new file mode 100644 index 0000000..d574903 --- /dev/null +++ b/internal/4.10.0.10/1/CRGrid/Source/Delphi8/CoreLab.Vcl.bdsproj @@ -0,0 +1,170 @@ + + + + + + + + + + + + CoreLab.Vcl.dpk + + + 7.0 + + + 8 + 0 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 0 + 1 + True + True + WinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + Borland.Vcl;CoreLab.Vcl;CoreLab.Dac + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + + + 0 + 0 + 1 + True + False + False + 4096 + 1048576 + 4194304 + Core Lab VCL + + + + . + + . + d:\program files\common files\borland shared\bds\shared assemblies\2.0;d:\projects\delphi\dac\source\delphi8;d:\winnt\microsoft.net\framework\v1.1.4322 + d:\winnt\microsoft.net\framework\v1.1.4322\System.Drawing.dll;Borland.VclDbCtrls;CoreLab.Dac;Borland.Vcl;Borland.Delphi + + + False + + + + + + False + + + + + + False + + + + $00000000 + + + + True + False + 6 + 10 + 1 + 2010 + False + False + False + False + False + + + + + + + + + + + + + + diff --git a/internal/4.10.0.10/1/CRGrid/Source/Delphi8/CoreLab.Vcl.cfg b/internal/4.10.0.10/1/CRGrid/Source/Delphi8/CoreLab.Vcl.cfg new file mode 100644 index 0000000..7384060 --- /dev/null +++ b/internal/4.10.0.10/1/CRGrid/Source/Delphi8/CoreLab.Vcl.cfg @@ -0,0 +1,42 @@ +-$A8 +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-cg +-vn +-AWinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-NSBorland.Vcl;CoreLab.Vcl;CoreLab.Dac +-H+ +-W+ +-M +-$M4096,1048576 +-K$00400000 +-N"." +-LN"." +-U"d:\program files\common files\borland shared\bds\shared assemblies\2.0;d:\projects\delphi\dac\source\delphi8;d:\winnt\microsoft.net\framework\v1.1.4322" +-O"d:\program files\common files\borland shared\bds\shared assemblies\2.0;d:\projects\delphi\dac\source\delphi8;d:\winnt\microsoft.net\framework\v1.1.4322" +-I"d:\program files\common files\borland shared\bds\shared assemblies\2.0;d:\projects\delphi\dac\source\delphi8;d:\winnt\microsoft.net\framework\v1.1.4322" +-R"d:\program files\common files\borland shared\bds\shared assemblies\2.0;d:\projects\delphi\dac\source\delphi8;d:\winnt\microsoft.net\framework\v1.1.4322" +-Z diff --git a/internal/4.10.0.10/1/CRGrid/Source/Delphi8/CoreLab.Vcl.dpk b/internal/4.10.0.10/1/CRGrid/Source/Delphi8/CoreLab.Vcl.dpk new file mode 100644 index 0000000..e26e362 --- /dev/null +++ b/internal/4.10.0.10/1/CRGrid/Source/Delphi8/CoreLab.Vcl.dpk @@ -0,0 +1,96 @@ +package CoreLab.Vcl; + +{$ALIGN 8} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Core Lab VCL'} +{$IMPLICITBUILD OFF} + +requires + Borland.Delphi, + Borland.Vcl, + CoreLab.Dac, + Borland.VclDbCtrls, + System.Drawing; + +contains + CoreLab.Vcl.CRControlsReg in '..\Net\CoreLab.Vcl.CRControlsReg.pas', + CoreLab.Vcl.CRGrid in '..\Net\CoreLab.Vcl.CRGrid.pas'; + +[assembly: AssemblyTitle('Core Lab VCL')] +[assembly: AssemblyDescription('Core Lab VCL')] +[assembly: AssemblyConfiguration('')] +[assembly: AssemblyCompany('Core Lab')] +[assembly: AssemblyProduct('Core Lab VCL')] +[assembly: AssemblyCopyright('')] +[assembly: AssemblyTrademark('')] +[assembly: AssemblyCulture('')] + + +// The Delphi compiler controls the AssemblyTitleAttribute via the ExeDescription. +// You can set this in the IDE via the Project Options. +// Manually setting the AssemblyTitle attribute below will override the IDE +// setting. +// [assembly: AssemblyTitle('')] + + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion('6.10.1.2010')] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile('mykey.snk')], provided your output +// directory is the project directory (the default). +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile('CoreLab.snk')] +[assembly: AssemblyKeyName('')] +end. diff --git a/internal/4.10.0.10/1/CRGrid/Source/Delphi8/CoreLab.Vcl.reg b/internal/4.10.0.10/1/CRGrid/Source/Delphi8/CoreLab.Vcl.reg new file mode 100644 index 0000000..4c1e956 --- /dev/null +++ b/internal/4.10.0.10/1/CRGrid/Source/Delphi8/CoreLab.Vcl.reg @@ -0,0 +1,7 @@ +REGEDIT4 + +[HKEY_CURRENT_USER\Software\Borland\BDS\2.0\Known Assemblies] +"[INSTALLDIR]Bin\\CoreLab.Vcl.dll"="CoreLab.Vcl" + +[HKEY_CURRENT_USER\Software\Borland\BDS\2.0\AssemblyFolders\CoreLab.Vcl] +@="[INSTALLDIR]Bin" diff --git a/internal/4.10.0.10/1/CRGrid/Source/Delphi8/CoreLab.snk b/internal/4.10.0.10/1/CRGrid/Source/Delphi8/CoreLab.snk new file mode 100644 index 0000000..a57bc46 Binary files /dev/null and b/internal/4.10.0.10/1/CRGrid/Source/Delphi8/CoreLab.snk differ diff --git a/internal/4.10.0.10/1/CRGrid/Source/Delphi9/CRControls.reg b/internal/4.10.0.10/1/CRGrid/Source/Delphi9/CRControls.reg new file mode 100644 index 0000000..7912b85 --- /dev/null +++ b/internal/4.10.0.10/1/CRGrid/Source/Delphi9/CRControls.reg @@ -0,0 +1,4 @@ +REGEDIT4 + +[HKEY_CURRENT_USER\Software\Borland\BDS\3.0\Known Packages] +"[IDEPATH]bin\\CRControls90.bpl"="Core Lab controls" diff --git a/internal/4.10.0.10/1/CRGrid/Source/Delphi9/CRControls90.cfg b/internal/4.10.0.10/1/CRGrid/Source/Delphi9/CRControls90.cfg new file mode 100644 index 0000000..5adea3a --- /dev/null +++ b/internal/4.10.0.10/1/CRGrid/Source/Delphi9/CRControls90.cfg @@ -0,0 +1,43 @@ +-$A8 +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-cg +-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-H+ +-W+ +-M +-$M16384,1048576 +-K$00400000 +-N"." +-LN"." +-U"..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi9;..\;..\..\..\Odac\source;..\..\..\ODac\source\Delphi9;D:\Program Files\Borland\BDS\3.0\source\ToolsAPI\" +-O"..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi9;..\;..\..\..\Odac\source;..\..\..\ODac\source\Delphi9;D:\Program Files\Borland\BDS\3.0\source\ToolsAPI\" +-I"..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi9;..\;..\..\..\Odac\source;..\..\..\ODac\source\Delphi9;D:\Program Files\Borland\BDS\3.0\source\ToolsAPI\" +-R"..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi9;..\;..\..\..\Odac\source;..\..\..\ODac\source\Delphi9;D:\Program Files\Borland\BDS\3.0\source\ToolsAPI\" +-Z +-w-UNSAFE_TYPE +-w-UNSAFE_CODE +-w-UNSAFE_CAST diff --git a/internal/4.10.0.10/1/CRGrid/Source/Delphi9/CRControls90.res b/internal/4.10.0.10/1/CRGrid/Source/Delphi9/CRControls90.res new file mode 100644 index 0000000..d50d7f1 Binary files /dev/null and b/internal/4.10.0.10/1/CRGrid/Source/Delphi9/CRControls90.res differ diff --git a/internal/4.10.0.10/1/CRGrid/Source/Delphi9/CoreLab.Vcl.bdsproj b/internal/4.10.0.10/1/CRGrid/Source/Delphi9/CoreLab.Vcl.bdsproj new file mode 100644 index 0000000..15f0a38 --- /dev/null +++ b/internal/4.10.0.10/1/CRGrid/Source/Delphi9/CoreLab.Vcl.bdsproj @@ -0,0 +1,170 @@ + + + + + + + + + + + + CoreLab.Vcl.dpk + + + 7.0 + + + 8 + 0 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 0 + 1 + True + True + WinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + Borland.Vcl;CoreLab.Vcl;CoreLab.Dac + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + + + 0 + 0 + 1 + True + False + False + 4096 + 1048576 + 4194304 + Core Lab VCL + + + + . + + . + ..\;d:\program files\common files\borland shared\bds\shared assemblies\3.0;d:\projects\delphi\dac\source\delphi9;d:\winnt\microsoft.net\framework\v1.1.4322 + d:\winnt\microsoft.net\framework\v1.1.4322\System.Drawing.dll;Borland.VclDbCtrls;CoreLab.Dac;Borland.Vcl;Borland.Delphi + + + False + + + + + + False + + + + + + False + + + + $00000000 + + + + True + False + 6 + 10 + 1 + 3010 + False + False + False + False + False + + + + + + + + + + + + + + diff --git a/internal/4.10.0.10/1/CRGrid/Source/Delphi9/CoreLab.Vcl.cfg b/internal/4.10.0.10/1/CRGrid/Source/Delphi9/CoreLab.Vcl.cfg new file mode 100644 index 0000000..547855a --- /dev/null +++ b/internal/4.10.0.10/1/CRGrid/Source/Delphi9/CoreLab.Vcl.cfg @@ -0,0 +1,42 @@ +-$A8 +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-cg +-vn +-AWinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-NSBorland.Vcl;CoreLab.Vcl;CoreLab.Dac +-H+ +-W+ +-M +-$M4096,1048576 +-K$00400000 +-N"." +-LN"." +-U"..\;d:\program files\common files\borland shared\bds\shared assemblies\3.0;d:\projects\delphi\dac\source\delphi9;d:\winnt\microsoft.net\framework\v1.1.4322" +-O"..\;d:\program files\common files\borland shared\bds\shared assemblies\3.0;d:\projects\delphi\dac\source\delphi9;d:\winnt\microsoft.net\framework\v1.1.4322" +-I"..\;d:\program files\common files\borland shared\bds\shared assemblies\3.0;d:\projects\delphi\dac\source\delphi9;d:\winnt\microsoft.net\framework\v1.1.4322" +-R"..\;d:\program files\common files\borland shared\bds\shared assemblies\3.0;d:\projects\delphi\dac\source\delphi9;d:\winnt\microsoft.net\framework\v1.1.4322" +-Z diff --git a/internal/4.10.0.10/1/CRGrid/Source/Delphi9/CoreLab.Vcl.dpk b/internal/4.10.0.10/1/CRGrid/Source/Delphi9/CoreLab.Vcl.dpk new file mode 100644 index 0000000..b8fb23a --- /dev/null +++ b/internal/4.10.0.10/1/CRGrid/Source/Delphi9/CoreLab.Vcl.dpk @@ -0,0 +1,96 @@ +package CoreLab.Vcl; + +{$ALIGN 8} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Core Lab VCL'} +{$IMPLICITBUILD OFF} + +requires + Borland.Delphi, + Borland.Vcl, + CoreLab.Dac, + Borland.VclDbCtrls, + System.Drawing; + +contains + CoreLab.Vcl.CRControlsReg in '..\Net\CoreLab.Vcl.CRControlsReg.pas', + CoreLab.Vcl.CRGrid in '..\Net\CoreLab.Vcl.CRGrid.pas'; + +[assembly: AssemblyTitle('Core Lab VCL')] +[assembly: AssemblyDescription('Core Lab VCL')] +[assembly: AssemblyConfiguration('')] +[assembly: AssemblyCompany('Core Lab')] +[assembly: AssemblyProduct('Core Lab VCL')] +[assembly: AssemblyCopyright('')] +[assembly: AssemblyTrademark('')] +[assembly: AssemblyCulture('')] + + +// The Delphi compiler controls the AssemblyTitleAttribute via the ExeDescription. +// You can set this in the IDE via the Project Options. +// Manually setting the AssemblyTitle attribute below will override the IDE +// setting. +// [assembly: AssemblyTitle('')] + + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion('6.10.1.3010')] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile('mykey.snk')], provided your output +// directory is the project directory (the default). +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile('CoreLab.snk')] +[assembly: AssemblyKeyName('')] +end. diff --git a/internal/4.10.0.10/1/CRGrid/Source/Delphi9/CoreLab.Vcl.reg b/internal/4.10.0.10/1/CRGrid/Source/Delphi9/CoreLab.Vcl.reg new file mode 100644 index 0000000..a3cf991 --- /dev/null +++ b/internal/4.10.0.10/1/CRGrid/Source/Delphi9/CoreLab.Vcl.reg @@ -0,0 +1,7 @@ +REGEDIT4 + +[HKEY_CURRENT_USER\Software\Borland\BDS\3.0\Known Assemblies] +"[INSTALLDIR]Bin\\CoreLab.Vcl.dll"="CoreLab.Vcl" + +[HKEY_CURRENT_USER\Software\Borland\BDS\3.0\AssemblyFolders\CoreLab.Vcl] +@="[INSTALLDIR]Bin" diff --git a/internal/4.10.0.10/1/CRGrid/Source/Delphi9/CoreLab.snk b/internal/4.10.0.10/1/CRGrid/Source/Delphi9/CoreLab.snk new file mode 100644 index 0000000..a57bc46 Binary files /dev/null and b/internal/4.10.0.10/1/CRGrid/Source/Delphi9/CoreLab.snk differ diff --git a/internal/4.10.0.10/1/CRGrid/Source/Delphi9/crcontrols90.bdsproj b/internal/4.10.0.10/1/CRGrid/Source/Delphi9/crcontrols90.bdsproj new file mode 100644 index 0000000..db41b4e --- /dev/null +++ b/internal/4.10.0.10/1/CRGrid/Source/Delphi9/crcontrols90.bdsproj @@ -0,0 +1,172 @@ + + + + + + + + + + + + CRControls90.dpk + + + 7.0 + + + 8 + 0 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 0 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + + + 0 + 0 + 1 + False + False + False + 16384 + 1048576 + 4194304 + CoreLab Controls + + + + . + + . + ..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi9;..\;..\..\..\Odac\source;..\..\..\ODac\source\Delphi9;D:\Program Files\Borland\BDS\3.0\source\ToolsAPI\ + rtl;vcl;dbrtl;vcldb;vclx;dclado90;dbxcds;dbexpress;dclib90;dclindy90;xmlrtl;inet;inetdbbde;inetdbxpress;soaprtl;dsnap;dcl31w90;inetdb;bdertl;vcldbx;dclie90;webdsnap;websnap;dss;teeui;teedb;tee;dcldbxcds90;dclact90;dsnapcon;odacvcl90;odac90;CRControls90;dac90;oraprov90;dacvcl90;dcldac90 + + + False + + + + + + False + + + + + + False + + + + $00000000 + + + + True + False + 6 + 10 + 1 + 3010 + False + False + False + False + False + + + + + Core Lab + + 6.10.1.10 + + + + + + 6.10.1.10 + + + diff --git a/internal/4.10.0.10/1/CRGrid/Source/Delphi9/crcontrols90.dpk b/internal/4.10.0.10/1/CRGrid/Source/Delphi9/crcontrols90.dpk new file mode 100644 index 0000000..1692eef --- /dev/null +++ b/internal/4.10.0.10/1/CRGrid/Source/Delphi9/crcontrols90.dpk @@ -0,0 +1,39 @@ +package CRControls90; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'CoreLab Controls'} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + dbrtl, + vcldb, + dac90, + designide; + +contains + CRControlsReg in '..\CRControlsReg.pas'; + +end. diff --git a/internal/4.10.0.10/1/CRGrid/Source/Net/CRGrid.inc b/internal/4.10.0.10/1/CRGrid/Source/Net/CRGrid.inc new file mode 100644 index 0000000..16825eb --- /dev/null +++ b/internal/4.10.0.10/1/CRGrid/Source/Net/CRGrid.inc @@ -0,0 +1 @@ +{$I ..\CRGrid.inc} diff --git a/internal/4.10.0.10/1/CRGrid/Source/Net/CoreLab.Vcl.CRControlsReg.pas b/internal/4.10.0.10/1/CRGrid/Source/Net/CoreLab.Vcl.CRControlsReg.pas new file mode 100644 index 0000000..f703569 --- /dev/null +++ b/internal/4.10.0.10/1/CRGrid/Source/Net/CoreLab.Vcl.CRControlsReg.pas @@ -0,0 +1,17 @@ +{$I ..\CRGrid.inc} + +unit CoreLab.Vcl.CRControlsReg; + +{$IFDEF VER9P} + +{$R ..\..\Images\CoreLab.Vcl.CRGrid.TCRDBGrid.bmp} +{$R ..\..\Images\CoreLab.Vcl.CRGrid.TCRDBGrid16.bmp} +{$R ..\..\Images\CoreLab.Vcl.CRGrid.TCRDBGrid32.bmp} + +{$ELSE} + +{$R ..\..\Images\Delphi8\CoreLab.Vcl.CRGrid.TCRDBGrid.bmp} + +{$ENDIF} + +{$I ..\CRControlsReg.pas} diff --git a/internal/4.10.0.10/1/CRGrid/Source/Net/CoreLab.Vcl.CRGrid.pas b/internal/4.10.0.10/1/CRGrid/Source/Net/CoreLab.Vcl.CRGrid.pas new file mode 100644 index 0000000..a8af055 --- /dev/null +++ b/internal/4.10.0.10/1/CRGrid/Source/Net/CoreLab.Vcl.CRGrid.pas @@ -0,0 +1,5 @@ +{$I ..\CRGrid.inc} + +unit CoreLab.Vcl.CRGrid; + +{$I ..\CRGrid.pas} diff --git a/internal/4.10.0.10/1/DbToolsInterfaces/CoreLab.DbTools.Interfaces.dll b/internal/4.10.0.10/1/DbToolsInterfaces/CoreLab.DbTools.Interfaces.dll new file mode 100644 index 0000000..18e50a3 Binary files /dev/null and b/internal/4.10.0.10/1/DbToolsInterfaces/CoreLab.DbTools.Interfaces.dll differ diff --git a/internal/4.10.0.10/1/Demos/InstallDemoObjects.sql b/internal/4.10.0.10/1/Demos/InstallDemoObjects.sql new file mode 100644 index 0000000..f1bfcec --- /dev/null +++ b/internal/4.10.0.10/1/Demos/InstallDemoObjects.sql @@ -0,0 +1,155 @@ +CREATE TABLE SDAC_Long_char ( + Code INT IDENTITY (1, 1) PRIMARY KEY, + Title VARCHAR(30), + Value VARCHAR(5000) +); + +CREATE TABLE SDAC_Pictures ( + UID int IDENTITY (1, 1) PRIMARY KEY NOT NULL, + Name VARCHAR(50), + Picture IMAGE +); + +CREATE TABLE Loaded1 ( + uid INT IDENTITY (1, 1) NOT NULL PRIMARY KEY, + Field1 VARCHAR(20), + Field2 VARCHAR(20), + Field3 VARCHAR(20) +); + +CREATE TABLE Loaded2 ( + uid INT IDENTITY (1, 1) NOT NULL PRIMARY KEY, + Field1 VARCHAR(20), + Field2 VARCHAR(20), + Field3 VARCHAR(20) +); + +CREATE TABLE ThreadTable ( + ID INT, + NAME VARCHAR(30) +); + +CREATE TABLE SDAC_Text ( + UID INT IDENTITY PRIMARY KEY, + [Name] NVARCHAR(50), + TextField NTEXT +); + +CREATE TABLE Sdac_Loaded ( + Code INT, + Num INT, + Num1 FLOAT, + Str VARCHAR(50), + Dat DATETIME +); + +CREATE TABLE CRGRID_TEST( + Id int PRIMARY KEY, + Name VARCHAR(10), + Country VARCHAR(30), + City VARCHAR(30), + Street VARCHAR(30), + BirthDate DATETIME, + Job VARCHAR(9), + Hiredate DATETIME, + Sal NUMERIC(7, 2), + Remarks TEXT +); + +INSERT INTO CRGRID_TEST + (Id, Name, Country, City, Street, BirthDate, Job, HireDate, Sal) +VALUES + (5001, 'SMITH', 'ENGLAND', 'LONDON', 'BOND st.', '12-OCT-63', 'CLERK','17-DEC-80', 800); +INSERT INTO CRGRID_TEST + (Id, Name, Country, City, Street, BirthDate, Job, HireDate, Sal) +VALUES + (5002, 'ALLEN', 'ENGLAND', 'LONDON', 'BAKER st.', '04-MAR-61', 'SALESMAN','20-FEB-81', 1600); +INSERT INTO CRGRID_TEST + (Id, Name, Country, City, Street, BirthDate, Job, HireDate, Sal) +VALUES + (5003, 'MARTIN', 'FRANCE', 'LION', 'WEAVER st.', '23-JAN-57', 'MANAGER','02-APR-81', 2900); + + CREATE TABLE DEPT ( + DEPTNO INT PRIMARY KEY, + DNAME VARCHAR(14), + LOC VARCHAR(13) +); +INSERT INTO DEPT VALUES (10,'ACCOUNTING','NEW YORK'); +INSERT INTO DEPT VALUES (20,'RESEARCH','DALLAS'); +INSERT INTO DEPT VALUES (30,'SALES','CHICAGO'); +INSERT INTO DEPT VALUES (40,'OPERATIONS','BOSTON'); + +CREATE TABLE emp ( + EMPNO int IDENTITY(1,1) NOT NULL PRIMARY KEY, + ENAME varchar(10) default NULL, + JOB varchar(9) default NULL, + MGR int default NULL, + HIREDATE datetime default NULL, + SAL float default NULL, + COMM float default NULL, + DEPTNO int default NULL + ); +INSERT INTO emp VALUES ('SMITH', 'CLERK', 7902, '1980-12-17 00:00:00', 800, NULL, 20); +INSERT INTO emp VALUES ('ALLEN', 'SALESMAN', 7698, '1981-02-20 00:00:00', 1600, 300, 30); +INSERT INTO emp VALUES ('WARD', 'SALESMAN', 7698, '1981-02-22 00:00:00', 1250, 500, 30); +INSERT INTO emp VALUES ('JONES', 'MANAGER', 7839, '1981-04-02 00:00:00', 2975, NULL, 20); +INSERT INTO emp VALUES ('MARTIN', 'SALESMAN', 7698, '1981-09-28 00:00:00', 1250, 1400, 30); +INSERT INTO emp VALUES ('BLAKE', 'MANAGER', 7839, '1981-05-01 00:00:00', 2850, NULL, 30); +INSERT INTO emp VALUES ('CLARK', 'MANAGER', 7839, '1981-06-09 00:00:00', 2450, NULL, 10); +INSERT INTO emp VALUES ('SCOTT', 'ANALYST', 7566, '1987-07-13 00:00:00', 3000, NULL, 20); +INSERT INTO emp VALUES ('KING', 'PRESIDENT', NULL, '1981-11-17 00:00:00', 5000, NULL, 10); +INSERT INTO emp VALUES ('TURNER', 'SALESMAN', 7698, '1981-09-08 00:00:00', 1500, 0, 30); +INSERT INTO emp VALUES ('ADAMS', 'CLERK', 7788, '1987-07-13 00:00:00', 1100, NULL, 20); +INSERT INTO emp VALUES ('JAMES', 'CLERK', 7698, '1981-12-03 00:00:00', 950, NULL, 30); +INSERT INTO emp VALUES ('FORD', 'ANALYST', 7566, '1981-12-03 00:00:00', 3000, NULL, 20); +INSERT INTO emp VALUES ('MILLER', 'CLERK', 7782, '1982-01-23 00:00:00', 1300, NULL, 10); + +GO + +CREATE PROCEDURE SDAC_InsertEmp + @ENAME nvarchar(20), + @JOB nvarchar(10) +AS + INSERT INTO + EMP (ENAME, JOB) + VALUES + (@ENAME, @JOB) + RETURN @@Identity; + +GO + +CREATE PROCEDURE SDAC_UpdateEmp + @EMPNO int, + @ENAME nvarchar(20), + @JOB nvarchar(10), + @EMPINFO nvarchar(30) OUTPUT +AS + UPDATE EMP + SET + ENAME = @ENAME, JOB = @JOB + WHERE + EMPNO = @EMPNO + SET @EMPINFO = CAST(@EMPNO AS nvarchar) + ' ' + @JOB + RETURN @EMPNO; + +GO + +CREATE PROCEDURE SDAC_DeleteEmp + @EMPNO int, + @Result int OUTPUT +AS + DELETE Emp + WHERE + EmpNO = @EmpNO + SET @Result = @EmpNO + 2; + +GO + +CREATE PROCEDURE "Ten Most High-Paid Employees" AS +BEGIN + SET ROWCOUNT 10 + SELECT Emp.EName AS TenMostHighPaidEmployees, Emp.SAL + FROM Emp + ORDER BY Emp.SAL DESC + SET ROWCOUNT 0 +END; \ No newline at end of file diff --git a/internal/4.10.0.10/1/Demos/UninstallDemoObjects.sql b/internal/4.10.0.10/1/Demos/UninstallDemoObjects.sql new file mode 100644 index 0000000..36d755e --- /dev/null +++ b/internal/4.10.0.10/1/Demos/UninstallDemoObjects.sql @@ -0,0 +1,28 @@ +IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[Loaded1]') AND OBJECTPROPERTY(id, N'IsUserTable') = 1) + DROP TABLE [Loaded1]; +IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[Loaded2]') AND OBJECTPROPERTY(id, N'IsUserTable') = 1) + DROP TABLE [Loaded2]; +IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[SDAC_Long_char]') AND OBJECTPROPERTY(id, N'IsUserTable') = 1) + DROP TABLE [SDAC_Long_char]; +IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[SDAC_Pictures]') AND OBJECTPROPERTY(id, N'IsUserTable') = 1) + DROP TABLE [SDAC_Pictures]; +IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[SDAC_DeleteEmp]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1) + DROP PROCEDURE [dbo].[SDAC_DeleteEmp]; +IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[SDAC_InsertEmp]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1) + DROP PROCEDURE [dbo].[SDAC_InsertEmp]; +IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[SDAC_UpdateEmp]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1) + DROP PROCEDURE [dbo].[SDAC_UpdateEmp]; +IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[ThreadTable]') AND OBJECTPROPERTY(id, N'IsUserTable') = 1) + DROP TABLE [ThreadTable]; +IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[SDAC_Text]') AND OBJECTPROPERTY(id, N'IsUserTable') = 1) + DROP TABLE [SDAC_Text]; +IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[SDAC_Loaded]') AND OBJECTPROPERTY(id, N'IsUserTable') = 1) + DROP TABLE [SDAC_Loaded]; +IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[Ten Most High-Paid Employees]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1) + DROP PROCEDURE [dbo].[Ten Most High-Paid Employees]; +IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[CRGRID_TEST]') AND OBJECTPROPERTY(id, N'IsUserTable') = 1) + DROP TABLE [CRGRID_TEST]; +IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[emp]') AND OBJECTPROPERTY(id, N'IsUserTable') = 1) + DROP TABLE [emp]; +IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dept]') AND OBJECTPROPERTY(id, N'IsUserTable') = 1) + DROP TABLE [dept]; \ No newline at end of file diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/CBuilder/BDS2006.bdsproj b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/CBuilder/BDS2006.bdsproj new file mode 100644 index 0000000..11749a2 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/CBuilder/BDS2006.bdsproj @@ -0,0 +1,221 @@ + + + + + + + + + + + + BDS2006.cpp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1049 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + + + + + + False + + + + + + + False + + False + + True + False + + + False + False + + + + + + + + + + + + diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/CBuilder/BDS2006.cpp b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/CBuilder/BDS2006.cpp new file mode 100644 index 0000000..00754e6 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/CBuilder/BDS2006.cpp @@ -0,0 +1,34 @@ +//$$---- EXE CPP ---- +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +//--------------------------------------------------------------------------- +USEFORM("Main.cpp", fmMain); +//--------------------------------------------------------------------------- +WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) +{ + try + { + Application->Initialize(); + Application->CreateForm(__classid(TfmMain), &fmMain); + Application->Run(); + } + catch (Exception &exception) + { + Application->ShowException(&exception); + } + catch (...) + { + try + { + throw Exception(""); + } + catch (Exception &exception) + { + Application->ShowException(&exception); + } + } + return 0; +} +//--------------------------------------------------------------------------- diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/CBuilder/BDS2006.res b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/CBuilder/BDS2006.res new file mode 100644 index 0000000..29c38a3 Binary files /dev/null and b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/CBuilder/BDS2006.res differ diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/CBuilder/CBuilder2007.cbproj b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/CBuilder/CBuilder2007.cbproj new file mode 100644 index 0000000..8bc611a --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/CBuilder/CBuilder2007.cbproj @@ -0,0 +1,104 @@ + + + + {cbce157e-8e15-4ec4-a246-c41b36b92c56} + CppVCLApplication + CBuilder2007.cpp + Debug Build + + + true + + + true + true + Base + + + true + true + Base + + + exe + JPHNE + d:\Program Files\CoreLab\Sdac for Delphi2006\Demos\Win32\CBuilder + true + Windows + d:\Program Files\CoreLab\Sdac for Delphi2006\Demos\Win32\CBuilder + true + vcl.bpi;rtl.bpi;vclx.bpi;dbrtl.bpi;vcldb.bpi;adortl.bpi;dbxcds.bpi;dbexpress.bpi;vclib.bpi;ibxpress.bpi;xmlrtl.bpi;vclactnband.bpi;inet.bpi;IntrawebDB_90_100.bpi;Intraweb_90_100.bpi;vclie.bpi;inetdbbde.bpi;inetdbxpress.bpi;IndyCore.bpi;IndySystem.bpi;soaprtl.bpi;dsnap.bpi;IndyProtocols.bpi;teeui.bpi;teedb.bpi;tee.bpi;vcldbx.bpi;dsnapcon.bpi;websnap.bpi;webdsnap.bpi + d:\Program Files\CoreLab\Sdac for Delphi2006\Demos\Win32\CBuilder;D:\Documents and Settings\Ikar\My Documents\Borland Studio Projects;$(BDS)\lib;$(BDS)\lib\obj + true + bdertl.lib;dac105.lib;sdacvcl105.lib;sdac105.lib;dacvcl105.lib + $(BDS)\include;$(BDS)\include\dinkumware;$(BDS)\include\vcl;..\..\..\Include + true + d:\Program Files\CoreLab\Sdac for Delphi2006\Demos\Win32\CBuilder;$(BDS)\include;$(BDS)\include\dinkumware;$(BDS)\include\vcl;..\..\..\..\Include + d:\Program Files\CoreLab\Sdac for Delphi2006\Demos\Win32\CBuilder;$(BDS)\include;$(BDS)\include\dinkumware;$(BDS)\include\vcl;..\..\..\..\Include + rtl.lib;vcl.lib;dbrtl.lib;vcldb.lib;bdertl.lib;dac105.lib;sdacvcl105.lib;sdac105.lib;dacvcl105.lib + d:\Program Files\CoreLab\Sdac for Delphi2006\Demos\Win32\CBuilder;D:\Documents and Settings\Ikar\My Documents\Borland Studio Projects;$(BDS)\lib;$(BDS)\lib\obj + $(BDS)\lib;$(BDS)\lib\obj;$(BDS)\lib\psdk;..\..\..\Lib + NO_STRICT + true + d:\Program Files\CoreLab\Sdac for Delphi2006\Demos\Win32\CBuilder + + + false + true + true + false + true + DEBUG;$(DCC_Define) + true + Debug_Build + true + true + $(BDS)\lib\debug;$(ILINK_LibraryPath) + _DEBUG;$(BCC_Defines) + Full + true + + + true + false + Release_Build + $(BDS)\lib\release;$(ILINK_LibraryPath) + NDEBUG;$(BCC_Defines) + None + + + CPlusPlusBuilder.Personality + CppVCLApplication + +FalseFalse1000FalseFalseFalseFalseFalse104912511.0.0.01.0.0.0FalseFalseFalseTrueFalseFalseFalseCBuilder2007.cppFalseTrueTrue + 1 + $(BDS)\include;$(BDS)\include\dinkumware;$(BDS)\include\vcl;..\..\..\Include + + + 1 + $(BDS)\lib;$(BDS)\lib\obj;$(BDS)\lib\psdk;..\..\..\Lib + + + + + + + 0 + + + 2 + + +
fmMain
+ Main.h + 1 +
+ + + Cfg_1 + + + Cfg_2 + +
+
\ No newline at end of file diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/CBuilder/CBuilder2007.cpp b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/CBuilder/CBuilder2007.cpp new file mode 100644 index 0000000..00754e6 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/CBuilder/CBuilder2007.cpp @@ -0,0 +1,34 @@ +//$$---- EXE CPP ---- +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +//--------------------------------------------------------------------------- +USEFORM("Main.cpp", fmMain); +//--------------------------------------------------------------------------- +WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) +{ + try + { + Application->Initialize(); + Application->CreateForm(__classid(TfmMain), &fmMain); + Application->Run(); + } + catch (Exception &exception) + { + Application->ShowException(&exception); + } + catch (...) + { + try + { + throw Exception(""); + } + catch (Exception &exception) + { + Application->ShowException(&exception); + } + } + return 0; +} +//--------------------------------------------------------------------------- diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/CBuilder/CBuilder2007.res b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/CBuilder/CBuilder2007.res new file mode 100644 index 0000000..29c38a3 Binary files /dev/null and b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/CBuilder/CBuilder2007.res differ diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/CBuilder/CBuilder5.bpr b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/CBuilder/CBuilder5.bpr new file mode 100644 index 0000000..a94c525 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/CBuilder/CBuilder5.bpr @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[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= + +[HistoryLists\hlIncludePath] +Count=4 +Item0=$(BCB)\include;$(BCB)\include\vcl;$(BCB)\SDAC\Include +Item1=..\..\source;..\..\..\dbaccess\source;$(BCB)\include;$(BCB)\include\vcl +Item2=$(BCB)\include;$(BCB)\include\vcl;$(BCB)\Sdac\Include;..\..\source +Item3=$(BCB)\include;$(BCB)\include\vcl + +[HistoryLists\hlLibraryPath] +Count=6 +Item0=$(BCB)\lib\obj;$(BCB)\lib;$(BCB)\SDAC\lib +Item1=..\..\source;..\..\..\dbaccess\source;$(BCB)\Projects\Lib;$(BCB)\lib\obj;$(BCB)\lib;..\..\Source\CBuilder5 +Item2=$(BCB)\lib\obj;$(BCB)\lib;$(BCB)\Sdac\Lib;..\..\source;..\..\source\cbuilder4 +Item3=..\..\source\cbuilder3;d:\program files\borland\cbuilder3\lib\release;$(BCB)\lib\obj;$(BCB)\lib;$(BCB)\Sdac\Lib +Item4=d:\program files\borland\cbuilder3\lib\release;$(BCB)\lib\obj;$(BCB)\lib;$(BCB)\Sdac\Lib +Item5=d:\program files\borland\cbuilder3\lib\release;$(BCB)\lib\obj;$(BCB)\lib + +[HistoryLists\hlDebugSourcePath] +Count=2 +Item0=$(BCB)\source\vcl;..\..\source +Item1=$(BCB)\source\vcl + +[HistoryLists\hlConditionals] +Count=2 +Item0=_RTLDLL;USEPACKAGES +Item1=_RTLDLL + +[Debugging] +DebugSourceDirs= + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +ShowInfoMsgs=0 +LinkDebugVcl=1 +LinkCGLIB=0 + +[CORBA] +AddServerUnit=1 +AddClientUnit=1 +PrecompiledHeaders=1 + +[Language] +ActiveLang= +ProjectLang= +RootDir= + + \ No newline at end of file diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/CBuilder/CBuilder5.cpp b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/CBuilder/CBuilder5.cpp new file mode 100644 index 0000000..d176065 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/CBuilder/CBuilder5.cpp @@ -0,0 +1,21 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("CBuilder5.res"); +USEFORM("Main.cpp", fmMain); +//--------------------------------------------------------------------------- +WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) +{ + try + { + Application->Initialize(); + Application->CreateForm(__classid(TfmMain), &fmMain); + Application->Run(); + } + catch (Exception &exception) + { + Application->ShowException(&exception); + } + return 0; +} +//--------------------------------------------------------------------------- diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/CBuilder/CBuilder5.res b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/CBuilder/CBuilder5.res new file mode 100644 index 0000000..b369156 Binary files /dev/null and b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/CBuilder/CBuilder5.res differ diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/CBuilder/CBuilder6.bpr b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/CBuilder/CBuilder6.bpr new file mode 100644 index 0000000..d768e43 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/CBuilder/CBuilder6.bpr @@ -0,0 +1,146 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[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= + +[HistoryLists\hlIncludePath] +Count=4 +Item0=$(BCB)\include;$(BCB)\include\vcl;$(BCB)\SDAC\Include +Item1=..\..\source;..\..\..\dbaccess\source;$(BCB)\include;$(BCB)\include\vcl +Item2=$(BCB)\include;$(BCB)\include\vcl;$(BCB)\Sdac\Include;..\..\source +Item3=$(BCB)\include;$(BCB)\include\vcl + +[HistoryLists\hlLibraryPath] +Count=6 +Item0=$(BCB)\lib\obj;$(BCB)\lib;$(BCB)\SDAC\lib +Item1=..\..\source;..\..\..\dbaccess\source;$(BCB)\Projects\Lib;$(BCB)\lib\obj;$(BCB)\lib;..\..\Source\CBuilder5 +Item2=$(BCB)\lib\obj;$(BCB)\lib;$(BCB)\Sdac\Lib;..\..\source;..\..\source\cbuilder4 +Item3=..\..\source\cbuilder3;d:\program files\borland\cbuilder3\lib\release;$(BCB)\lib\obj;$(BCB)\lib;$(BCB)\Sdac\Lib +Item4=d:\program files\borland\cbuilder3\lib\release;$(BCB)\lib\obj;$(BCB)\lib;$(BCB)\Sdac\Lib +Item5=d:\program files\borland\cbuilder3\lib\release;$(BCB)\lib\obj;$(BCB)\lib + +[HistoryLists\hlDebugSourcePath] +Count=2 +Item0=$(BCB)\source\vcl;..\..\source +Item1=$(BCB)\source\vcl + +[HistoryLists\hlConditionals] +Count=2 +Item0=_RTLDLL;USEPACKAGES +Item1=_RTLDLL + +[Debugging] +DebugSourceDirs= + +[Parameters] +RunParams= +Launcher= +UseLauncher=0 +DebugCWD= +HostApplication= +RemoteHost= +RemotePath= +RemoteLauncher= +RemoteCWD= +RemoteDebug=0 + +[Compiler] +ShowInfoMsgs=0 +LinkDebugVcl=1 +LinkCGLIB=0 + +[CORBA] +AddServerUnit=1 +AddClientUnit=1 +PrecompiledHeaders=1 + +[Language] +ActiveLang= +ProjectLang= +RootDir= + + \ No newline at end of file diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/CBuilder/CBuilder6.cpp b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/CBuilder/CBuilder6.cpp new file mode 100644 index 0000000..4535698 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/CBuilder/CBuilder6.cpp @@ -0,0 +1,21 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("CBuilder6.res"); +USEFORM("Main.cpp", fmMain); +//--------------------------------------------------------------------------- +WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) +{ + try + { + Application->Initialize(); + Application->CreateForm(__classid(TfmMain), &fmMain); + Application->Run(); + } + catch (Exception &exception) + { + Application->ShowException(&exception); + } + return 0; +} +//--------------------------------------------------------------------------- diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/CBuilder/CBuilder6.res b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/CBuilder/CBuilder6.res new file mode 100644 index 0000000..b369156 Binary files /dev/null and b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/CBuilder/CBuilder6.res differ diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/CBuilder/Main.cpp b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/CBuilder/Main.cpp new file mode 100644 index 0000000..a8b8573 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/CBuilder/Main.cpp @@ -0,0 +1,60 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop + +#include "Main.h" +//--------------------------------------------------------------------------- +#pragma package(smart_init) +#pragma link "MemDS" +#pragma link "DBAccess" +#pragma link "MSAccess" +#pragma link "SdacVcl" +#pragma resource "*.dfm" +TfmMain *fmMain; +//--------------------------------------------------------------------------- +__fastcall TfmMain::TfmMain(TComponent* Owner) + : TForm(Owner) +{ +} +//--------------------------------------------------------------------------- +void __fastcall TfmMain::btOpenClick(TObject *Sender) +{ + MSQuery->Open(); +} +//--------------------------------------------------------------------------- +void __fastcall TfmMain::btCloseClick(TObject *Sender) +{ + MSQuery->Close(); +} +//--------------------------------------------------------------------------- +void __fastcall TfmMain::btDisconnectClick(TObject *Sender) +{ + MSConnection->Disconnect(); +} +//--------------------------------------------------------------------------- + +void __fastcall TfmMain::btExecuteClick(TObject *Sender) +{ + MSQuery->Execute(); +} +//--------------------------------------------------------------------------- + +void __fastcall TfmMain::FormShow(TObject *Sender) +{ + meSQL->Lines->Assign(MSQuery->SQL); +} +//--------------------------------------------------------------------------- + +void __fastcall TfmMain::meSQLExit(TObject *Sender) +{ + if (meSQL->Lines->Text != MSQuery->SQL->Text) + MSQuery->SQL->Assign(meSQL->Lines); +} +//--------------------------------------------------------------------------- + +void __fastcall TfmMain::btConnectClick(TObject *Sender) +{ + MSConnection->Connect(); +} +//--------------------------------------------------------------------------- + diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/CBuilder/Main.dfm b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/CBuilder/Main.dfm new file mode 100644 index 0000000..7ea3fe8 Binary files /dev/null and b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/CBuilder/Main.dfm differ diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/CBuilder/Main.h b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/CBuilder/Main.h new file mode 100644 index 0000000..1683afd --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/CBuilder/Main.h @@ -0,0 +1,53 @@ +//--------------------------------------------------------------------------- +#ifndef MainH +#define MainH +//--------------------------------------------------------------------------- +#include +#include +#include +#include +#include "MemDS.hpp" +#include +#include +#include +#include +#include +#include +#include "DBAccess.hpp" +#include "MSAccess.hpp" +#include +#include "SdacVcl.hpp" +#include +//--------------------------------------------------------------------------- +class TfmMain : public TForm +{ +__published: // IDE-managed Components + TPanel *ToolBar; + TButton *btOpen; + TButton *btClose; + TButton *btExecute; + TDBNavigator *DBNavigator; + TMemo *meSQL; + TDBGrid *DBGrid; + TDataSource *DataSource; + TButton *btDisconnect; + TSplitter *Splitter1; + TButton *btConnect; + TMSQuery *MSQuery; + TMSConnection *MSConnection; + TMSConnectDialog *MSConnectDialog; + void __fastcall btOpenClick(TObject *Sender); + void __fastcall btCloseClick(TObject *Sender); + void __fastcall btDisconnectClick(TObject *Sender); + void __fastcall btExecuteClick(TObject *Sender); + void __fastcall FormShow(TObject *Sender); + void __fastcall meSQLExit(TObject *Sender); + void __fastcall btConnectClick(TObject *Sender); +private: // User declarations +public: // User declarations + __fastcall TfmMain(TComponent* Owner); +}; +//--------------------------------------------------------------------------- +extern PACKAGE TfmMain *fmMain; +//--------------------------------------------------------------------------- +#endif diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/CBuilder/ReadMe.txt b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/CBuilder/ReadMe.txt new file mode 100644 index 0000000..6928be8 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/CBuilder/ReadMe.txt @@ -0,0 +1,7 @@ +SQL Server Data Access Components +Copyright 1997-2007, Core Lab. All Rights Reserved +-------------------------------------------------- + +A general demo project about how to create SDAC-based applications with +C++Builder. Lets you execute SQL scripts and work with result sets in a +grid. This is one of the two SDAC demos for C++Builder. diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Dll/DLLMain.dfm b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Dll/DLLMain.dfm new file mode 100644 index 0000000..12440a4 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Dll/DLLMain.dfm @@ -0,0 +1,92 @@ +object fmDllMain: TfmDllMain + Left = 448 + Top = 324 + Width = 599 + Height = 330 + Caption = 'MS Data Access Demo - DLL' + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + Position = poDefaultPosOnly + OnClose = FormClose + OnCreate = FormCreate + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 13 + object DBGrid: TDBGrid + Left = 0 + Top = 26 + Width = 591 + Height = 270 + Align = alClient + DataSource = DataSource + TabOrder = 0 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object pnToolBar: TPanel + Left = 0 + Top = 0 + Width = 591 + Height = 26 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object Panel1: TPanel + Left = 1 + Top = 1 + Width = 394 + Height = 24 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btOpen: TSpeedButton + Left = 1 + Top = 1 + Width = 75 + Height = 22 + Caption = 'Open' + Flat = True + Transparent = False + OnClick = btOpenClick + end + object btClose: TSpeedButton + Left = 77 + Top = 1 + Width = 75 + Height = 22 + Caption = 'Close' + Flat = True + Transparent = False + OnClick = btCloseClick + end + object DBNavigator: TDBNavigator + Left = 153 + Top = 1 + Width = 240 + Height = 22 + DataSource = DataSource + Flat = True + TabOrder = 0 + end + end + end + object MSQuery: TMSQuery + SQL.Strings = ( + 'SELECT * FROM Emp') + Left = 24 + Top = 56 + end + object DataSource: TDataSource + DataSet = MSQuery + Left = 56 + Top = 56 + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Dll/DLLMain.pas b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Dll/DLLMain.pas new file mode 100644 index 0000000..ddd2c17 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Dll/DLLMain.pas @@ -0,0 +1,149 @@ +unit DLLMain; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + Grids, DBGrids, Db, MemDS, StdCtrls, ExtCtrls, DBCtrls, DBAccess, + MSAccess, Buttons; + +type + TfmDllMain = class(TForm) + MSQuery: TMSQuery; + DBGrid: TDBGrid; + DataSource: TDataSource; + pnToolBar: TPanel; + Panel1: TPanel; + btOpen: TSpeedButton; + btClose: TSpeedButton; + DBNavigator: TDBNavigator; + procedure btOpenClick(Sender: TObject); + procedure btCloseClick(Sender: TObject); + procedure FormClose(Sender: TObject; var Action: TCloseAction); + procedure FormShow(Sender: TObject); + procedure FormCreate(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + end; + +procedure AssignConnection(MSConnection: TMSConnection); cdecl; +procedure ShowForm; cdecl; +procedure HideForms; cdecl; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} +{$IFDEF LINUX} +{$R *.xfm} +{$ENDIF} + +{$IFNDEF VER130} +{$IFNDEF VER140} +{$IFNDEF CLR} + {$DEFINE XPMAN} + {$R WindowsXP.res} +{$ENDIF} +{$ENDIF} +{$ENDIF} + +{$IFDEF XPMAN} +uses + UxTheme; +{$ENDIF} + +var + ExternalMSConnection: TMSConnection; + FormList: TList; + FormCount: integer; + +procedure AssignConnection(MSConnection: TMSConnection); cdecl; +begin + ExternalMSConnection:= MSConnection; +end; + +procedure ShowForm; cdecl; +begin + with TfmDllMain.Create(Application) do begin + Inc(FormCount); + Caption:= IntToStr(FormCount) + '. ' + Caption; + MSQuery.Connection := ExternalMSConnection; + MSQuery.Active := True; + Show; + end; +end; + +procedure HideForms; cdecl; +begin + while FormList.Count > 0 do begin + TForm(FormList[0]).Free; + FormList.Delete(0); + end; +end; + +procedure TfmDllMain.FormShow(Sender: TObject); +begin + FormList.Add(Self); +end; + +procedure TfmDllMain.FormClose(Sender: TObject; var Action: TCloseAction); +begin + FormList.Remove(Self); + Action := caFree; +end; + +procedure TfmDllMain.btOpenClick(Sender: TObject); +begin + MSQuery.Open; +end; + +procedure TfmDllMain.btCloseClick(Sender: TObject); +begin + MSQuery.Close; +end; + +procedure TfmDllMain.FormCreate(Sender: TObject); +{$IFDEF XPMAN} + procedure UpdateStyle(Control: TWinControl); + var + Panel: TPanel; + i: integer; + begin + for i := 0 to Control.ControlCount - 1 do begin + if Control.Controls[i] is TSpeedButton then + TSpeedButton(Control.Controls[i]).Flat := False + else + if Control.Controls[i] is TDBNavigator then + TDBNavigator(Control.Controls[i]).Flat := False; + if Control.Controls[i] is TWinControl then begin + if (Control.Controls[i] is TPanel) then begin + Panel := TPanel(Control.Controls[i]); + Panel.ParentBackground := False; + Panel.Color := clBtnFace; + end; + UpdateStyle(TWinControl(Control.Controls[i])); + end; + end; + end; +{$ENDIF} +begin +{$IFDEF XPMAN} + if UseThemes then + UpdateStyle(Self); +{$ENDIF} +end; + +initialization + FormCount:= 0; + FormList:= TList.Create; +finalization + HideForms; + FormList.Free; +end. + diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Dll/ExeMain.dfm b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Dll/ExeMain.dfm new file mode 100644 index 0000000..c3c6743 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Dll/ExeMain.dfm @@ -0,0 +1,203 @@ +object fmExeMain: TfmExeMain + Left = 387 + Top = 220 + Width = 625 + Height = 336 + Caption = 'MS Data Access Demo - Application' + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + OnClose = FormClose + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + object pnToolBar: TPanel + Left = 0 + Top = 0 + Width = 617 + Height = 48 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object Panel2: TPanel + Left = 2 + Top = 23 + Width = 574 + Height = 24 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btFreeDLL: TSpeedButton + Left = 250 + Top = 1 + Width = 82 + Height = 22 + Caption = '4. Free DLL' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + Transparent = False + OnClick = btFreeDLLClick + end + object btLoadDLL: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = '1. Load DLL' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + Transparent = False + OnClick = btLoadDLLClick + end + object btShowForm: TSpeedButton + Left = 84 + Top = 1 + Width = 82 + Height = 22 + Caption = '2. Show Form' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + Transparent = False + OnClick = btShowFormClick + end + object btHideForms: TSpeedButton + Left = 167 + Top = 1 + Width = 82 + Height = 22 + Caption = '3. Hide Form' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + Transparent = False + OnClick = btHideFormsClick + end + object DBNavigator: TDBNavigator + Left = 333 + Top = 1 + Width = 240 + Height = 22 + DataSource = DataSource + Flat = True + TabOrder = 0 + end + end + object Panel1: TPanel + Left = 2 + Top = 1 + Width = 333 + Height = 24 + BevelOuter = bvNone + Color = clGreen + TabOrder = 1 + object btConnect: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Connect' + Flat = True + Transparent = False + OnClick = btConnectClick + end + object btDisconnect: TSpeedButton + Left = 84 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Disconnect' + Flat = True + Transparent = False + OnClick = btDisconnectClick + end + object btOpen: TSpeedButton + Left = 167 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Open' + Flat = True + Transparent = False + OnClick = btOpenClick + end + object btClose: TSpeedButton + Left = 250 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Close' + Flat = True + Transparent = False + OnClick = btCloseClick + end + end + end + object DBGrid: TDBGrid + Left = 0 + Top = 48 + Width = 617 + Height = 261 + Align = alClient + DataSource = DataSource + TabOrder = 1 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object MSConnection: TMSConnection + Database = 'SDACDemos' + Username = 'Sa' + ConnectDialog = MSConnectDialog + Left = 16 + Top = 88 + end + object MSConnectDialog: TMSConnectDialog + SavePassword = True + Caption = 'Connect' + UsernameLabel = 'User Name' + PasswordLabel = 'Password' + ServerLabel = 'Server' + DatabaseLabel = 'Database' + ConnectButton = 'Connect' + CancelButton = 'Cancel' + Left = 48 + Top = 88 + end + object MSQuery: TMSQuery + Connection = MSConnection + SQL.Strings = ( + 'SELECT * FROM Emp') + Left = 16 + Top = 120 + end + object DataSource: TDataSource + DataSet = MSQuery + Left = 48 + Top = 120 + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Dll/ExeMain.pas b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Dll/ExeMain.pas new file mode 100644 index 0000000..719e0fd --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Dll/ExeMain.pas @@ -0,0 +1,193 @@ +unit ExeMain; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + StdCtrls, ExtCtrls, Grids, DBGrids, Db, MemDS, DBCtrls, DBAccess, SdacVcl, + MSAccess, Buttons; + +type + TfmExeMain = class(TForm) + MSConnection: TMSConnection; + MSConnectDialog: TMSConnectDialog; + pnToolBar: TPanel; + DBGrid: TDBGrid; + MSQuery: TMSQuery; + DataSource: TDataSource; + Panel2: TPanel; + btFreeDLL: TSpeedButton; + btLoadDLL: TSpeedButton; + btShowForm: TSpeedButton; + btHideForms: TSpeedButton; + DBNavigator: TDBNavigator; + Panel1: TPanel; + btConnect: TSpeedButton; + btDisconnect: TSpeedButton; + btOpen: TSpeedButton; + btClose: TSpeedButton; + procedure btLoadDLLClick(Sender: TObject); + procedure btFreeDLLClick(Sender: TObject); + procedure FormCreate(Sender: TObject); + procedure btConnectClick(Sender: TObject); + procedure btDisconnectClick(Sender: TObject); + procedure btOpenClick(Sender: TObject); + procedure btCloseClick(Sender: TObject); + procedure FormClose(Sender: TObject; var Action: TCloseAction); + procedure btShowFormClick(Sender: TObject); + procedure btHideFormsClick(Sender: TObject); + private + hDLL:HModule; + + public + + end; + + TAssignMSConnection = procedure (MSConnection: TMSConnection); cdecl; + TShowForm = procedure; cdecl; + THideForms = procedure; cdecl; + +var + fmExeMain: TfmExeMain; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} +{$IFDEF LINUX} +{$R *.xfm} +{$ENDIF} + +{$IFNDEF VER130} +{$IFNDEF VER140} +{$IFNDEF CLR} + {$DEFINE XPMAN} + {$R WindowsXP.res} +{$ENDIF} +{$ENDIF} +{$ENDIF} + +{$IFDEF XPMAN} +uses + UxTheme; +{$ENDIF} + +procedure TfmExeMain.btLoadDLLClick(Sender: TObject); +var + AssignMSConnection: TAssignMSConnection; +begin + if hDLL = 0 then begin + hDLL := LoadLibrary('MS_DLL.dll'); + if hDLL <> 0 then begin + @AssignMSConnection := GetProcAddress(hDLL, 'AssignConnection'); + if @AssignMSConnection <> nil then + AssignMSConnection(MSConnection); + MessageDlg('DLL is loaded', mtInformation, [mbOk], 0); + end + else + MessageDlg('Cannot load DLL', mtError, [mbOk], 0); + end; +end; + +procedure TfmExeMain.btShowFormClick(Sender: TObject); +var + ShowForm: TShowForm; +begin + if hDLL <> 0 then begin + @ShowForm := GetProcAddress(hDLL, 'ShowForm'); + if @ShowForm <> nil then + ShowForm; + SetFocus; + end + else + MessageDlg('DLL is not loaded', mtError, [mbOk], 0); +end; + +procedure TfmExeMain.btHideFormsClick(Sender: TObject); +var + HideForms: THideForms; +begin + if hDLL <> 0 then begin + @HideForms := GetProcAddress(hDLL, 'HideForms'); + if @HideForms <> nil then + HideForms; + end + else + MessageDlg('DLL is not loaded', mtError, [mbOk], 0); +end; + +procedure TfmExeMain.btFreeDLLClick(Sender: TObject); +begin + if hDLL <> 0 then begin + FreeLibrary(hDLL); + hDLL:= 0; + end + else + MessageDlg('DLL is not loaded', mtError, [mbOk], 0); +end; + +procedure TfmExeMain.FormCreate(Sender: TObject); +{$IFDEF XPMAN} + procedure UpdateStyle(Control: TWinControl); + var + Panel: TPanel; + i: integer; + begin + for i := 0 to Control.ControlCount - 1 do begin + if Control.Controls[i] is TSpeedButton then + TSpeedButton(Control.Controls[i]).Flat := False + else + if Control.Controls[i] is TDBNavigator then + TDBNavigator(Control.Controls[i]).Flat := False; + if Control.Controls[i] is TWinControl then begin + if (Control.Controls[i] is TPanel) then begin + Panel := TPanel(Control.Controls[i]); + Panel.ParentBackground := False; + Panel.Color := clBtnFace; + end; + UpdateStyle(TWinControl(Control.Controls[i])); + end; + end; + end; +{$ENDIF} + +begin +{$IFDEF XPMAN} + if UseThemes then + UpdateStyle(Self); +{$ENDIF} + hDLL:= 0; +end; + +procedure TfmExeMain.btConnectClick(Sender: TObject); +begin + MSConnection.Connect; +end; + +procedure TfmExeMain.btDisconnectClick(Sender: TObject); +begin + MSConnection.Disconnect; +end; + +procedure TfmExeMain.btOpenClick(Sender: TObject); +begin + MSQuery.Open; +end; + +procedure TfmExeMain.btCloseClick(Sender: TObject); +begin + MSQuery.Close; +end; + +procedure TfmExeMain.FormClose(Sender: TObject; var Action: TCloseAction); +begin + if hDLL <> 0 then + FreeLibrary(hDLL); +end; + +end. + diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Dll/MS_DLL.bdsproj b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Dll/MS_DLL.bdsproj new file mode 100644 index 0000000..effdff8 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Dll/MS_DLL.bdsproj @@ -0,0 +1,158 @@ + + + + + + + + + + + + MS_DLL.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + + + 0 + 0 + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + + + + False + + + + $00000000 + + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Dll/MS_DLL.cfg b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Dll/MS_DLL.cfg new file mode 100644 index 0000000..0cf637a --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Dll/MS_DLL.cfg @@ -0,0 +1,41 @@ +-$A+ +-$B- +-$C+ +-$D+ +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L+ +-$M- +-$N+ +-$O- +-$P+ +-$Q+ +-$R+ +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$YD +-$Z1 +-cg +-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-H+ +-W+ +-M +-$M16384,1048576 +-K$00400000 +-E"d:\program files\borland\delphi5\Projects" +-N"d:\program files\borland\delphi5\Projects" +-LE"d:\program files\borland\delphi5\Projects" +-LN"d:\program files\borland\delphi5\Projects" +-U"d:\program files\borland\delphi5\Lib\Debug;d:\program files\borland\delphi5\Vcl;d:\program files\borland\delphi5\lib" +-O"d:\program files\borland\delphi5\Lib\Debug;d:\program files\borland\delphi5\Vcl;d:\program files\borland\delphi5\lib" +-I"d:\program files\borland\delphi5\Lib\Debug;d:\program files\borland\delphi5\Vcl;d:\program files\borland\delphi5\lib" +-R"d:\program files\borland\delphi5\Lib\Debug;d:\program files\borland\delphi5\Vcl;d:\program files\borland\delphi5\lib" diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Dll/MS_DLL.dpr b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Dll/MS_DLL.dpr new file mode 100644 index 0000000..f7cf82b --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Dll/MS_DLL.dpr @@ -0,0 +1,36 @@ + +library MS_DLL; + +{ Important note about DLL memory management: ShareMem must be the + first unit in your library's USES clause AND your project's (select + Project-View Source) USES clause if your DLL exports any procedures or + functions that pass strings as parameters or function results. This + applies to all strings passed to and from your DLL--even those that + are nested in records and classes. ShareMem is the interface unit to + the BORLNDMM.DLL shared memory manager, which must be deployed along + with your DLL. To avoid using BORLNDMM.DLL, pass string information + using PChar or ShortString parameters. } + +uses + ShareMem, + SysUtils, + Classes, + DLLMain in 'DLLMain.pas' {fmDllMain}; + +exports + AssignConnection, + ShowForm, + HideForms; + +var + SaveExit: pointer; + +procedure DllExit; +begin + ExitProc := SaveExit; +end; + +begin +// SaveExit := ExitProc; +// ExitProc := @DllExit; +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Dll/MS_DLLGroup.bdsgroup b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Dll/MS_DLLGroup.bdsgroup new file mode 100644 index 0000000..80dbec5 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Dll/MS_DLLGroup.bdsgroup @@ -0,0 +1,20 @@ + + + + + + + + + + + + + MS_DLL.bdsproj + MS_Exe.bdsproj + MS_DLL.dll MS_Exe.exe + + + + diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Dll/MS_DLLGroup.bpg b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Dll/MS_DLLGroup.bpg new file mode 100644 index 0000000..bb9ffe8 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Dll/MS_DLLGroup.bpg @@ -0,0 +1,23 @@ +#------------------------------------------------------------------------------ +VERSION = BWS.01 +#------------------------------------------------------------------------------ +!ifndef ROOT +ROOT = $(MAKEDIR)\.. +!endif +#------------------------------------------------------------------------------ +MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$** +DCC = $(ROOT)\bin\dcc32.exe $** +BRCC = $(ROOT)\bin\brcc32.exe $** +#------------------------------------------------------------------------------ +PROJECTS = MS_DLL.dll MS_Exe.exe +#------------------------------------------------------------------------------ +default: $(PROJECTS) +#------------------------------------------------------------------------------ + +MS_Exe.exe: MS_Exe.dpr + $(DCC) + +MS_DLL.dll: MS_DLL.dpr + $(DCC) + + diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Dll/MS_Exe.bdsproj b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Dll/MS_Exe.bdsproj new file mode 100644 index 0000000..13766b8 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Dll/MS_Exe.bdsproj @@ -0,0 +1,158 @@ + + + + + + + + + + + + MS_Exe.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + + + 0 + 0 + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + + + + False + + + + $00000000 + + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Dll/MS_Exe.cfg b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Dll/MS_Exe.cfg new file mode 100644 index 0000000..0cf637a --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Dll/MS_Exe.cfg @@ -0,0 +1,41 @@ +-$A+ +-$B- +-$C+ +-$D+ +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L+ +-$M- +-$N+ +-$O- +-$P+ +-$Q+ +-$R+ +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$YD +-$Z1 +-cg +-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-H+ +-W+ +-M +-$M16384,1048576 +-K$00400000 +-E"d:\program files\borland\delphi5\Projects" +-N"d:\program files\borland\delphi5\Projects" +-LE"d:\program files\borland\delphi5\Projects" +-LN"d:\program files\borland\delphi5\Projects" +-U"d:\program files\borland\delphi5\Lib\Debug;d:\program files\borland\delphi5\Vcl;d:\program files\borland\delphi5\lib" +-O"d:\program files\borland\delphi5\Lib\Debug;d:\program files\borland\delphi5\Vcl;d:\program files\borland\delphi5\lib" +-I"d:\program files\borland\delphi5\Lib\Debug;d:\program files\borland\delphi5\Vcl;d:\program files\borland\delphi5\lib" +-R"d:\program files\borland\delphi5\Lib\Debug;d:\program files\borland\delphi5\Vcl;d:\program files\borland\delphi5\lib" diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Dll/MS_Exe.dpr b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Dll/MS_Exe.dpr new file mode 100644 index 0000000..565bad9 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Dll/MS_Exe.dpr @@ -0,0 +1,14 @@ +program MS_Exe; + +uses + ShareMem, + Forms, + ExeMain in 'ExeMain.pas' {fmExeMain}; + +{$R *.RES} + +begin + Application.Initialize; + Application.CreateForm(TfmExeMain, fmExeMain); + Application.Run; +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Dll/MS_Exe.res b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Dll/MS_Exe.res new file mode 100644 index 0000000..caf0117 Binary files /dev/null and b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Dll/MS_Exe.res differ diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Dll/ReadMe.txt b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Dll/ReadMe.txt new file mode 100644 index 0000000..46d96fc --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Dll/ReadMe.txt @@ -0,0 +1,10 @@ +SQL Server Data Access Components +Copyright 1997-2007, Core Lab. All Rights Reserved +-------------------------------------------------- + +Demonstrates creating and loading DLLs for SDAC-based projects. This demo +project consists of two parts - an MS_Dll project that creates a DLL of a +form that sends a query to the server and displays its results, and an +MS_Exe project that can be executed to display a form for loading and +running this DLL. Allows you to build a dll for one SDAC-based project +and load and test it from a separate application. diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/FailOver/About.dfm b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/FailOver/About.dfm new file mode 100644 index 0000000..0d8a146 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/FailOver/About.dfm @@ -0,0 +1,108 @@ +object AboutForm: TAboutForm + Left = 352 + Top = 192 + BorderIcons = [biSystemMenu] + BorderStyle = bsDialog + Caption = 'About FailOver Demo' + ClientHeight = 343 + ClientWidth = 416 + Color = clBtnFace + ParentFont = True + OldCreateOrder = True + Position = poScreenCenter + OnMouseMove = FormMouseMove + PixelsPerInch = 96 + TextHeight = 13 + object Label3: TLabel + Left = 16 + Top = 36 + Width = 156 + Height = 13 + Caption = 'Copyright '#169' 1997-2007 Core Lab' + end + object lbWeb: TLabel + Left = 16 + Top = 306 + Width = 73 + Height = 13 + Cursor = crHandPoint + Caption = 'www.crlab.com' + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlue + Font.Height = 13 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [fsUnderline] + ParentFont = False + OnClick = lbWebClick + OnMouseMove = lbWebMouseMove + end + object lbDemo: TLabel + Left = 16 + Top = 8 + Width = 119 + Height = 20 + Caption = 'FailOver Demo' + Font.Charset = DEFAULT_CHARSET + Font.Color = clGreen + Font.Height = -16 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + end + object OKBtn: TButton + Left = 319 + Top = 308 + Width = 75 + Height = 24 + Cancel = True + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 0 + end + object meAbout: TMemo + Left = 16 + Top = 56 + Width = 385 + Height = 241 + Color = clBtnFace + Lines.Strings = ( + 'This demo program shows how to use DisconnectedMode, Pooling, ' + + 'CachedUpdates and LocalMasterDetail options. Usage of these opti' + + 'ons and ' + + 'usage of the OnConectionLost event are recommended working in un' + + 'stable ' + 'and/or slow network.' + '' + + 'The '#39'Open'#39' button opens two data sets. They are linked by Master' + + '/Detail ' + + 'relationship. You can preconnect to database before opening the ' + + 'datasets, but ' + 'usage of disconnected mode has no advantages in this case.' + '' + + 'The grid above displays the master data set, the grid below disp' + + 'lays the detail ' + + 'data set. The '#39'Kill session'#39' button terminates session on the se' + + 'rver, which ' + + 'causes connection break. This does not work for with all SQL ser' + + 'vers and with ' + + 'all users. The memo at the bottom of the main form keeps track o' + + 'f connection ' + 'messages.' + '' + + 'See the "Working in unstable and slow networks" topic in help fo' + + 'r more ' + 'detailed information.') + TabOrder = 1 + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/FailOver/About.pas b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/FailOver/About.pas new file mode 100644 index 0000000..79a6909 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/FailOver/About.pas @@ -0,0 +1,67 @@ +unit About; + +interface +uses + Classes, SysUtils, +{$IFNDEF LINUX} + Windows, Menus, ImgList, StdCtrls, ComCtrls, Buttons, ExtCtrls, Graphics, + Controls, Forms, Dialogs, ShellApi; +{$ELSE} + QMenus, QImgList, QStdCtrls, QComCtrls, QButtons, QExtCtrls, QGraphics, + QControls, QForms, QDialogs; +{$ENDIF} + +type + TAboutForm = class(TForm) + OKBtn: TButton; + Label3: TLabel; + lbWeb: TLabel; + lbDemo: TLabel; + meAbout: TMemo; + procedure lbWebClick(Sender: TObject); + procedure lbWebMouseMove(Sender: TObject; Shift: TShiftState; X, + Y: Integer); + procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X, + Y: Integer); + private + { Private declarations } + public + { Public declarations } + end; + +var + AboutForm: TAboutForm; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} +{$IFDEF LINUX} +{$R *.xfm} +{$ENDIF} + +procedure TAboutForm.lbWebMouseMove(Sender: TObject; Shift: TShiftState; X, + Y: Integer); +begin + lbWeb.Font.Color := $4080FF; +end; + +procedure TAboutForm.FormMouseMove(Sender: TObject; Shift: TShiftState; X, + Y: Integer); +begin + lbWeb.Font.Color := $FF0000; +end; + +procedure TAboutForm.lbWebClick(Sender: TObject); +begin +{$IFDEF MSWINDOWS} + ShellExecute(0, 'open', 'www.crlab.com', '', '', SW_SHOW); + lbWeb.Font.Color := $FF0000; +{$ENDIF} +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/FailOver/Data.dfm b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/FailOver/Data.dfm new file mode 100644 index 0000000..9983c11 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/FailOver/Data.dfm @@ -0,0 +1,112 @@ +object DM: TDM + OldCreateOrder = False + Left = 185 + Top = 105 + Height = 227 + Width = 284 + object Connection: TMSConnection + Database = 'master' + Options.DisconnectedMode = True + Options.LocalFailover = True + Pooling = True + Left = 32 + Top = 32 + end + object quDetail: TMSQuery + Connection = Connection + SQL.Strings = ( + 'select * from emp') + Debug = True + CachedUpdates = True + Options.LocalMasterDetail = True + MasterSource = dsMaster + MasterFields = 'DEPTNO' + DetailFields = 'DEPTNO' + Left = 104 + Top = 88 + end + object quMaster: TMSQuery + Connection = Connection + SQL.Strings = ( + 'select * from dept' + '') + Debug = True + CachedUpdates = True + Left = 104 + Top = 32 + end + object dsDetail: TDataSource + DataSet = quDetail + Left = 136 + Top = 80 + end + object dsMaster: TDataSource + DataSet = quMaster + Left = 136 + Top = 24 + end + object scCreate: TMSScript + SQL.Strings = ( + 'CREATE TABLE DEPT (' + ' DEPTNO INT PRIMARY KEY ,' + ' DNAME VARCHAR(14) ,' + ' LOC VARCHAR(13)' + ');' + '' + 'CREATE TABLE EMP (' + ' EMPNO INT IDENTITY PRIMARY KEY,' + ' ENAME VARCHAR(10),' + ' JOB VARCHAR(9),' + ' MGR INT,' + ' HIREDATE DATETIME,' + ' SAL FLOAT,' + ' COMM FLOAT,' + ' DEPTNO INT CONSTRAINT FK_DEPTNO REFERENCES DEPT' + ');' + '' + 'INSERT INTO DEPT VALUES (10,'#39'ACCOUNTING'#39','#39'NEW YORK'#39');' + 'INSERT INTO DEPT VALUES (20,'#39'RESEARCH'#39','#39'DALLAS'#39');' + 'INSERT INTO DEPT VALUES (30,'#39'SALES'#39','#39'CHICAGO'#39');' + 'INSERT INTO DEPT VALUES (40,'#39'OPERATIONS'#39','#39'BOSTON'#39');' + '' + 'INSERT INTO EMP VALUES' + '('#39'SMITH'#39','#39'CLERK'#39',7902,CAST('#39'12/17/80'#39' AS DATETIME),800,NULL,20);' + 'INSERT INTO EMP VALUES' + '('#39'ALLEN'#39','#39'SALESMAN'#39',7698,'#39'02/20/81'#39',1600,300,30);' + 'INSERT INTO EMP VALUES' + '('#39'WARD'#39','#39'SALESMAN'#39',7698,'#39'02/22/81'#39',1250,500,30);' + 'INSERT INTO EMP VALUES' + '('#39'JONES'#39','#39'MANAGER'#39',7839,'#39'04/02/81'#39',2975,NULL,20);' + 'INSERT INTO EMP VALUES' + '('#39'MARTIN'#39','#39'SALESMAN'#39',7698,'#39'09/28/81'#39',1250,1400,30);' + 'INSERT INTO EMP VALUES' + '('#39'BLAKE'#39','#39'MANAGER'#39',7839,'#39'05/01/81'#39',2850,NULL,30);' + 'INSERT INTO EMP VALUES' + '('#39'CLARK'#39','#39'MANAGER'#39',7839,'#39'06/09/81'#39',2450,NULL,10);' + 'INSERT INTO EMP VALUES' + '('#39'SCOTT'#39','#39'ANALYST'#39',7566,'#39'07/13/87'#39',3000,NULL,20);' + 'INSERT INTO EMP VALUES' + '('#39'KING'#39','#39'PRESIDENT'#39',NULL,'#39'11/17/81'#39',5000,NULL,10);' + 'INSERT INTO EMP VALUES' + '('#39'TURNER'#39','#39'SALESMAN'#39',7698,'#39'09/08/81'#39',1500,0,30);' + 'INSERT INTO EMP VALUES' + '('#39'ADAMS'#39','#39'CLERK'#39',7788,'#39'07/13/87'#39',1100,NULL,20);' + 'INSERT INTO EMP VALUES' + '('#39'JAMES'#39','#39'CLERK'#39',7698,'#39'12/03/81'#39',950,NULL,30);' + 'INSERT INTO EMP VALUES' + '('#39'FORD'#39','#39'ANALYST'#39',7566,'#39'12/03/81'#39',3000,NULL,20);' + 'INSERT INTO EMP VALUES' + '('#39'MILLER'#39','#39'CLERK'#39',7782,'#39'01/23/82'#39',1300,NULL,10);') + Connection = Connection + Left = 200 + Top = 24 + end + object scDrop: TMSScript + SQL.Strings = ( + 'DROP TABLE EMP;' + 'DROP TABLE DEPT;') + Connection = Connection + Left = 200 + Top = 80 + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/FailOver/Data.pas b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/FailOver/Data.pas new file mode 100644 index 0000000..0bbfda2 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/FailOver/Data.pas @@ -0,0 +1,96 @@ +unit Data; + +interface + +uses + Classes, SysUtils, Windows, Menus, ImgList, StdCtrls, ComCtrls, Buttons, + ExtCtrls, Graphics, Controls, Forms, DB, + MemData, DBAccess, MSAccess, MemDS, SdacVcl, DAScript, MSScript; + +type + TDM = class(TDataModule) + Connection: TMSConnection; + quDetail: TMSQuery; + quMaster: TMSQuery; + dsMaster: TDataSource; + dsDetail: TDataSource; + scCreate: TMSScript; + scDrop: TMSScript; + private + public + procedure KillSession; + function InTransaction: boolean; + procedure StartTransaction; + procedure RollbackTransaction; + procedure CommitTransaction; + end; + +const + ProductColor: TColor = $5D5DCC; + +var + DM: TDM; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} + +uses + Main; + +{ TDM } + +procedure TDM.KillSession; +var + KillConnection: TMSConnection; + Query: TMSQuery; + SPID: string; +begin + Query := TMSQuery.Create(nil); + try + Query.Connection := Connection; + Query.SQL.Text := 'SELECT @@SPID AS ''SPID'''; + Query.Open; + SPID := Query.FieldByName('SPID').AsString; + finally + Query.Free; + end; + KillConnection := TMSConnection.Create(nil); + try + KillConnection.Server := Connection.Server; + KillConnection.Username := Connection.Username; + KillConnection.Password := Connection.Password; + KillConnection.Database := Connection.Database; + KillConnection.LoginPrompt := False; + KillConnection.ExecSQL(Format('KILL %s', [SPID]), []); + finally + KillConnection.Free; + end; +end; + +function TDM.InTransaction: boolean; +begin + Result := Connection.InTransaction; +end; + +procedure TDM.StartTransaction; +begin + Connection.StartTransaction; +end; + +procedure TDM.CommitTransaction; +begin + Connection.Commit; +end; + +procedure TDM.RollbackTransaction; +begin + Connection.Rollback; +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/FailOver/FailOver.bdsproj b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/FailOver/FailOver.bdsproj new file mode 100644 index 0000000..39611f9 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/FailOver/FailOver.bdsproj @@ -0,0 +1,173 @@ + + + + + + + + + + + + FailOver.dpr + + + 7.0 + + + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + + + 0 + 0 + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + + + + False + + + + $00000409 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1033 + 1252 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/FailOver/FailOver.dpr b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/FailOver/FailOver.dpr new file mode 100644 index 0000000..068f0a9 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/FailOver/FailOver.dpr @@ -0,0 +1,15 @@ +program FailOver; + +uses + Forms, + Main in 'Main.pas' {MainForm}, + Data in 'Data.pas' {DM: TDataModule}, + About in 'About.pas' {AboutForm}; + +{$R *.res} + +begin + Application.Initialize; + Application.CreateForm(TMainForm, MainForm); + Application.Run; +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/FailOver/FailOver.res b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/FailOver/FailOver.res new file mode 100644 index 0000000..c2869c8 Binary files /dev/null and b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/FailOver/FailOver.res differ diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/FailOver/FailOver_VclNet.bdsproj b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/FailOver/FailOver_VclNet.bdsproj new file mode 100644 index 0000000..3a6e56e --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/FailOver/FailOver_VclNet.bdsproj @@ -0,0 +1,184 @@ + + + + + + + + + + + + FailOver_VclNet.dpr + + + + + + + + + + + + + + 7.0 + + + 0 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + Borland.Vcl + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + + + 0 + 0 + 1 + True + False + False + 4096 + 1048576 + 4194304 + + + + + + + + d:\windows\microsoft.net\framework\v1.1.4322 + d:\windows\microsoft.net\framework\v1.1.4322\System.Drawing.dll + + + True + + + + + + False + + + + + + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1033 + 1252 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/FailOver/FailOver_VclNet.dpr b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/FailOver/FailOver_VclNet.dpr new file mode 100644 index 0000000..d4fc643 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/FailOver/FailOver_VclNet.dpr @@ -0,0 +1,17 @@ +program FailOver_VclNet; + +{%DelphiDotNetAssemblyCompiler '$(SystemRoot)\microsoft.net\framework\v1.1.4322\system.drawing.dll'} + +uses + Forms, + Main in 'Main.pas' {MainForm}, + Data in 'Data.pas' {DM: TDataModule}, + About in 'About.pas' {AboutForm}; + +{$R *.res} + +begin + Application.Initialize; + Application.CreateForm(TMainForm, MainForm); + Application.Run; +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/FailOver/FailOver_VclNet.res b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/FailOver/FailOver_VclNet.res new file mode 100644 index 0000000..c2869c8 Binary files /dev/null and b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/FailOver/FailOver_VclNet.res differ diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/FailOver/Main.dfm b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/FailOver/Main.dfm new file mode 100644 index 0000000..a30c0c5 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/FailOver/Main.dfm @@ -0,0 +1,758 @@ +object MainForm: TMainForm + Left = 200 + Top = 130 + Width = 820 + Height = 480 + Caption = 'FailOver Demo' + Color = clBtnFace + Constraints.MinHeight = 480 + Constraints.MinWidth = 820 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + OnActivate = FormActivate + OnCreate = FormCreate + OnDestroy = FormDestroy + PixelsPerInch = 96 + TextHeight = 13 + object pnRight: TPanel + Left = 256 + Top = 49 + Width = 556 + Height = 385 + Align = alClient + BevelOuter = bvNone + ParentColor = True + TabOrder = 0 + object Splitter1: TSplitter + Left = 0 + Top = 331 + Width = 556 + Height = 2 + Cursor = crVSplit + Align = alTop + Beveled = True + Color = clBtnFace + ParentColor = False + ResizeStyle = rsUpdate + end + object pnMiddle: TPanel + Left = 0 + Top = 0 + Width = 556 + Height = 331 + Align = alTop + BevelOuter = bvNone + Constraints.MinHeight = 160 + ParentColor = True + TabOrder = 0 + object Splitter: TSplitter + Left = 0 + Top = 153 + Width = 556 + Height = 2 + Cursor = crVSplit + Align = alTop + Beveled = True + Color = clBtnFace + MinSize = 100 + ParentColor = False + ResizeStyle = rsUpdate + end + object pnDetail: TPanel + Left = 0 + Top = 155 + Width = 556 + Height = 176 + Align = alClient + BevelOuter = bvNone + ParentColor = True + TabOrder = 0 + object DBGrid2: TDBGrid + Left = 0 + Top = 27 + Width = 556 + Height = 149 + Align = alClient + DataSource = DM.dsDetail + TabOrder = 0 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object Panel9: TPanel + Left = 0 + Top = 0 + Width = 556 + Height = 27 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object Panel7: TPanel + Left = 0 + Top = 2 + Width = 242 + Height = 24 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object DBNavigator2: TDBNavigator + Left = 1 + Top = 1 + Width = 240 + Height = 22 + DataSource = DM.dsDetail + Flat = True + TabOrder = 0 + end + end + end + end + object pnMaster: TPanel + Left = 0 + Top = 0 + Width = 556 + Height = 153 + Align = alTop + BevelOuter = bvNone + Constraints.MinHeight = 100 + ParentColor = True + TabOrder = 1 + object DBGrid1: TDBGrid + Left = 0 + Top = 1 + Width = 556 + Height = 152 + Align = alBottom + Anchors = [akLeft, akTop, akRight, akBottom] + DataSource = DM.dsMaster + TabOrder = 0 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + end + end + object pnBottom: TPanel + Left = 0 + Top = 333 + Width = 556 + Height = 52 + Align = alClient + BevelOuter = bvNone + Color = clGreen + TabOrder = 1 + object meLog: TMemo + Left = 0 + Top = 0 + Width = 556 + Height = 52 + Align = alClient + ReadOnly = True + ScrollBars = ssVertical + TabOrder = 0 + end + end + end + object pnLeft: TPanel + Left = 0 + Top = 49 + Width = 256 + Height = 385 + Align = alLeft + BevelOuter = bvNone + ParentColor = True + TabOrder = 1 + object Panel8: TPanel + Left = 1 + Top = 128 + Width = 243 + Height = 254 + BevelOuter = bvNone + TabOrder = 0 + object cbPooling: TCheckBox + Left = 8 + Top = 138 + Width = 150 + Height = 17 + Caption = 'Pooling' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + ParentFont = False + TabOrder = 6 + OnClick = cbPoolingClick + end + object pnPooling: TPanel + Left = 26 + Top = 157 + Width = 215 + Height = 95 + BevelOuter = bvNone + Color = clGreen + TabOrder = 7 + object Panel10: TPanel + Left = 1 + Top = 1 + Width = 213 + Height = 93 + Anchors = [akLeft, akTop, akRight, akBottom] + BevelOuter = bvNone + TabOrder = 0 + object Label2: TLabel + Left = 6 + Top = 54 + Width = 90 + Height = 13 + Caption = 'ConnectionLifetime' + end + object Label3: TLabel + Left = 6 + Top = 8 + Width = 61 + Height = 13 + Caption = 'MaxPoolSize' + end + object Label4: TLabel + Left = 6 + Top = 31 + Width = 58 + Height = 13 + Caption = 'MinPoolSize' + end + object cbValidate: TCheckBox + Left = 6 + Top = 77 + Width = 111 + Height = 14 + Alignment = taLeftJustify + Caption = 'Validate' + TabOrder = 3 + OnClick = cbValidateClick + end + object edMaxPoolSize: TEdit + Left = 104 + Top = 4 + Width = 103 + Height = 21 + TabOrder = 0 + OnExit = edMaxPoolSizeExit + end + object edMinPoolSize: TEdit + Left = 104 + Top = 27 + Width = 103 + Height = 21 + TabOrder = 1 + OnExit = edMinPoolSizeExit + end + object edConnectionLifetime: TEdit + Left = 104 + Top = 50 + Width = 103 + Height = 21 + TabOrder = 2 + OnExit = edConnectionLifetimeExit + end + end + end + object cbCachedUpdates: TCheckBox + Left = 8 + Top = 7 + Width = 150 + Height = 17 + Caption = 'CachedUpdates' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + ParentFont = False + TabOrder = 0 + OnClick = cbCachedUpdatesClick + end + object cbFailover: TCheckBox + Left = 8 + Top = 88 + Width = 73 + Height = 17 + Caption = 'Failover' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + ParentFont = False + TabOrder = 4 + OnClick = cbFailoverClick + end + object cbLocalMasterDetail: TCheckBox + Left = 8 + Top = 27 + Width = 150 + Height = 17 + Caption = 'LocalMasterDetail' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + ParentFont = False + TabOrder = 1 + OnClick = cbLocalMasterDetailClick + end + object cbDisconnectedMode: TCheckBox + Left = 8 + Top = 68 + Width = 150 + Height = 17 + Caption = 'DisconnectedMode' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + ParentFont = False + TabOrder = 3 + OnClick = cbDisconnectedModeClick + end + object cbFetchAll: TCheckBox + Left = 8 + Top = 48 + Width = 97 + Height = 17 + Caption = 'FetchAll' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + ParentFont = False + TabOrder = 2 + OnClick = cbFetchAllClick + end + object pnFailover: TPanel + Left = 26 + Top = 106 + Width = 215 + Height = 28 + BevelOuter = bvNone + Color = clGreen + TabOrder = 5 + object Panel16: TPanel + Left = 1 + Top = 1 + Width = 213 + Height = 26 + Anchors = [akLeft, akTop, akRight, akBottom] + BevelOuter = bvNone + TabOrder = 0 + object Label7: TLabel + Left = 5 + Top = 7 + Width = 52 + Height = 13 + Caption = 'RetryMode' + end + object coRetryMode: TComboBox + Left = 69 + Top = 3 + Width = 141 + Height = 21 + Style = csDropDownList + ItemHeight = 13 + TabOrder = 0 + Items.Strings = ( + 'Default' + 'Raise' + 'Reconnect' + 'ReconnectExecute') + end + end + end + end + object Panel2: TPanel + Left = 0 + Top = 0 + Width = 256 + Height = 122 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object Panel1: TPanel + Left = 2 + Top = 1 + Width = 253 + Height = 122 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object Panel15: TPanel + Left = 1 + Top = 1 + Width = 251 + Height = 60 + BevelOuter = bvNone + TabOrder = 0 + object Label1: TLabel + Left = 11 + Top = 6 + Width = 48 + Height = 13 + Alignment = taRightJustify + Caption = 'Updates' + Font.Charset = DEFAULT_CHARSET + Font.Color = clMaroon + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + end + object Panel12: TPanel + Left = 12 + Top = 26 + Width = 229 + Height = 24 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btApply: TSpeedButton + Left = 1 + Top = 1 + Width = 75 + Height = 22 + Caption = 'Apply' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clMaroon + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + Transparent = False + OnClick = btApplyClick + end + object btCancel: TSpeedButton + Left = 153 + Top = 1 + Width = 75 + Height = 22 + Caption = 'Cancel' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clMaroon + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + Transparent = False + OnClick = btCancelClick + end + object btCommit: TSpeedButton + Left = 77 + Top = 1 + Width = 75 + Height = 22 + Caption = 'Commit' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clMaroon + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + Transparent = False + OnClick = btCommitClick + end + end + end + object Panel17: TPanel + Left = 1 + Top = 62 + Width = 251 + Height = 58 + BevelOuter = bvNone + TabOrder = 1 + object Label6: TLabel + Left = 11 + Top = 6 + Width = 74 + Height = 13 + Alignment = taRightJustify + Caption = 'Transactions' + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + end + object Panel5: TPanel + Left = 12 + Top = 26 + Width = 229 + Height = 24 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btStartTrans: TSpeedButton + Left = 1 + Top = 1 + Width = 75 + Height = 22 + Caption = 'Start' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + Transparent = False + OnClick = btStartTransClick + end + object btCommitTrans: TSpeedButton + Left = 77 + Top = 1 + Width = 75 + Height = 22 + Caption = 'Commit' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + Transparent = False + OnClick = btCommitTransClick + end + object btRollbackTrans: TSpeedButton + Left = 153 + Top = 1 + Width = 75 + Height = 22 + Caption = 'Rollback' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + Transparent = False + OnClick = btRollbackTransClick + end + end + end + end + end + end + object StatusBar: TStatusBar + Left = 0 + Top = 434 + Width = 812 + Height = 19 + Panels = < + item + Width = 208 + end + item + Width = 208 + end + item + Width = 208 + end + item + Width = 50 + end> + end + object pnTop: TPanel + Left = 0 + Top = 0 + Width = 812 + Height = 49 + Align = alTop + BevelOuter = bvNone + ParentColor = True + TabOrder = 3 + OnMouseMove = pnTopMouseMove + object lbAbout: TLabel + Left = 762 + Top = 6 + Width = 34 + Height = 13 + Cursor = crHandPoint + Anchors = [akTop, akRight] + Caption = 'About' + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlue + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold, fsUnderline] + ParentFont = False + OnClick = lbAboutClick + OnMouseMove = lbAboutMouseMove + end + object Panel18: TPanel + Left = 2 + Top = 1 + Width = 418 + Height = 47 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btConnect: TSpeedButton + Left = 167 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Connect' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + NumGlyphs = 2 + ParentFont = False + Transparent = False + OnClick = btConnectClick + end + object btDisconnect: TSpeedButton + Left = 250 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Disconnect' + Enabled = False + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + NumGlyphs = 2 + ParentFont = False + Transparent = False + OnClick = btDisconnectClick + end + object btClose: TSpeedButton + Left = 84 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Close' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + Transparent = False + OnClick = btCloseClick + end + object btOpen: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Open' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + Transparent = False + OnClick = btOpenClick + end + object btKillSession: TSpeedButton + Left = 333 + Top = 1 + Width = 84 + Height = 22 + Caption = 'Kill session' + Enabled = False + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clRed + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + ParentFont = False + Transparent = False + OnClick = btKillSessionClick + end + object btCreate: TSpeedButton + Left = 1 + Top = 24 + Width = 82 + Height = 22 + Caption = 'Create' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + ParentFont = False + Transparent = False + OnClick = btCreateDropClick + end + object btDrop: TSpeedButton + Left = 84 + Top = 24 + Width = 82 + Height = 22 + Caption = 'Drop' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + ParentFont = False + Transparent = False + OnClick = btCreateDropClick + end + object DBNavigator1: TDBNavigator + Left = 167 + Top = 24 + Width = 250 + Height = 22 + DataSource = DM.dsMaster + Flat = True + TabOrder = 0 + end + end + object cbDebug: TCheckBox + Left = 685 + Top = 5 + Width = 64 + Height = 17 + Anchors = [akTop, akRight] + Caption = 'Debug' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + TabOrder = 1 + OnClick = cbDebugClick + end + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/FailOver/Main.pas b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/FailOver/Main.pas new file mode 100644 index 0000000..aee12c7 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/FailOver/Main.pas @@ -0,0 +1,533 @@ +unit Main; + +interface + +uses + Classes, SysUtils, + Windows, Menus, ImgList, StdCtrls, ComCtrls, Buttons, ExtCtrls, Graphics, + Controls, Forms, Dialogs, Grids, DBCtrls, DBGrids, + DB, MemData, DBAccess, Data, About; + +type + TMainForm = class(TForm) + DBGrid1: TDBGrid; + pnTop: TPanel; + btConnect: TSpeedButton; + btDisconnect: TSpeedButton; + btOpen: TSpeedButton; + btClose: TSpeedButton; + pnMaster: TPanel; + pnRight: TPanel; + pnLeft: TPanel; + pnMiddle: TPanel; + DBGrid2: TDBGrid; + Panel7: TPanel; + DBNavigator2: TDBNavigator; + Panel8: TPanel; + cbFailover: TCheckBox; + cbLocalMasterDetail: TCheckBox; + cbCachedUpdates: TCheckBox; + cbPooling: TCheckBox; + pnPooling: TPanel; + Panel10: TPanel; + cbValidate: TCheckBox; + edMaxPoolSize: TEdit; + edMinPoolSize: TEdit; + edConnectionLifetime: TEdit; + Label2: TLabel; + Label3: TLabel; + Label4: TLabel; + pnBottom: TPanel; + meLog: TMemo; + cbDisconnectedMode: TCheckBox; + cbFetchAll: TCheckBox; + Panel12: TPanel; + btApply: TSpeedButton; + btCancel: TSpeedButton; + btCommit: TSpeedButton; + Label1: TLabel; + Panel5: TPanel; + btStartTrans: TSpeedButton; + btCommitTrans: TSpeedButton; + btRollbackTrans: TSpeedButton; + Label6: TLabel; + StatusBar: TStatusBar; + btKillSession: TSpeedButton; + coRetryMode: TComboBox; + Label7: TLabel; + pnDetail: TPanel; + Splitter: TSplitter; + DBNavigator1: TDBNavigator; + Panel9: TPanel; + lbAbout: TLabel; + pnFailover: TPanel; + Panel16: TPanel; + Panel18: TPanel; + Splitter1: TSplitter; + Panel15: TPanel; + Panel17: TPanel; + Panel1: TPanel; + cbDebug: TCheckBox; + Panel2: TPanel; + btDrop: TSpeedButton; + btCreate: TSpeedButton; + procedure FormCreate(Sender: TObject); + procedure btConnectClick(Sender: TObject); + procedure btDisconnectClick(Sender: TObject); + procedure btOpenClick(Sender: TObject); + procedure btCloseClick(Sender: TObject); + procedure cbFailoverClick(Sender: TObject); + procedure FormDestroy(Sender: TObject); + procedure cbPoolingClick(Sender: TObject); + procedure edMaxPoolSizeExit(Sender: TObject); + procedure edMinPoolSizeExit(Sender: TObject); + procedure edConnectionLifetimeExit(Sender: TObject); + procedure cbValidateClick(Sender: TObject); + procedure cbCachedUpdatesClick(Sender: TObject); + procedure cbDisconnectedModeClick(Sender: TObject); + procedure FormActivate(Sender: TObject); + procedure cbLocalMasterDetailClick(Sender: TObject); + procedure cbFetchAllClick(Sender: TObject); + procedure btApplyClick(Sender: TObject); + procedure btCommitClick(Sender: TObject); + procedure btCancelClick(Sender: TObject); + procedure btStartTransClick(Sender: TObject); + procedure btCommitTransClick(Sender: TObject); + procedure btRollbackTransClick(Sender: TObject); + procedure btKillSessionClick(Sender: TObject); + procedure lbAboutClick(Sender: TObject); + procedure cbDebugClick(Sender: TObject); + procedure lbAboutMouseMove(Sender: TObject; Shift: TShiftState; X, + Y: Integer); + procedure pnTopMouseMove(Sender: TObject; Shift: TShiftState; X, + Y: Integer); + procedure btCreateDropClick(Sender: TObject); + private + FActivated, + FShouldNotUpdateControls: boolean; + procedure OptionsToEditors; + procedure EditorsToOptions; + function GetShouldNotUpdateControls: boolean; + + procedure ConnectionAfterConnect(Sender: TObject); + procedure ConnectionAfterDisconnect(Sender: TObject); + procedure ConnectionConnectionLost(Sender: TObject; + Component: TComponent; ConnLostCause: TConnLostCause; + var RetryMode: TRetryMode); + procedure dsUpdateData(Sender: TObject); + procedure dsDataChange(Sender: TObject; Field: TField); + + procedure ShowPending; + procedure ShowTrans; + public + property ShouldNotUpdateControls: boolean read GetShouldNotUpdateControls; + end; + +var + MainForm: TMainForm; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} + +{$IFNDEF VER130} +{$IFNDEF VER140} +{$IFNDEF CLR} + {$DEFINE XPMAN} + {$R WindowsXP.res} +{$ENDIF} +{$ENDIF} +{$ENDIF} + +{$IFDEF XPMAN} +uses + UxTheme; +{$ENDIF} + +function TMainForm.GetShouldNotUpdateControls: boolean; +begin + Result := not FActivated or FShouldNotUpdateControls; +end; + +procedure TMainForm.OptionsToEditors; +begin + FShouldNotUpdateControls := True; + cbFailover.Checked := DM.Connection.Options.LocalFailover; + cbPooling.Checked := DM.Connection.Pooling; + with DM.Connection.PoolingOptions do begin + edMaxPoolSize.Text := IntToStr(MaxPoolSize); + edMinPoolSize.Text := IntToStr(MinPoolSize); + edConnectionLifetime.Text := IntToStr(ConnectionLifetime); + cbValidate.Checked := Validate; + end; + cbCachedUpdates.Checked := DM.quDetail.CachedUpdates; + cbLocalMasterDetail.Checked := DM.quDetail.Options.LocalMasterDetail; + cbFetchAll.Checked := DM.quDetail.FetchAll; + cbDisconnectedMode.Checked := DM.Connection.Options.DisconnectedMode; + cbDebug.Checked := DM.quMaster.Debug; + FShouldNotUpdateControls := False; +end; + +procedure TMainForm.EditorsToOptions; +var + OnExit: TNotifyEvent; +begin + if ActiveControl is TEdit then + OnExit := TEdit(ActiveControl).OnExit + else + if ActiveControl is TMemo then + OnExit := TMemo(ActiveControl).OnExit + else + Exit; + if Assigned(OnExit) then + OnExit(nil); +end; + +procedure TMainForm.FormCreate(Sender: TObject); +{$IFDEF XPMAN} + procedure UpdateStyle(Control: TWinControl); + var + Panel: TPanel; + i: integer; + begin + for i := 0 to Control.ControlCount - 1 do begin + if Control.Controls[i] is TSpeedButton then + TSpeedButton(Control.Controls[i]).Flat := False + else + if Control.Controls[i] is TDBNavigator then + TDBNavigator(Control.Controls[i]).Flat := False; + if Control.Controls[i] is TWinControl then begin + if (Control.Controls[i] is TPanel) then begin + Panel := TPanel(Control.Controls[i]); + Panel.ParentBackground := False; + Panel.Color := clBtnFace; + end; + UpdateStyle(TWinControl(Control.Controls[i])); + end; + end; + end; +{$ENDIF} + +begin + DM := TDM.Create(nil); + AboutForm := TAboutForm.Create(nil); +{$IFDEF XPMAN} + if UseThemes then + UpdateStyle(Self); +{$ENDIF} + DM.Connection.AfterConnect := ConnectionAfterConnect; + DM.Connection.AfterDisconnect := ConnectionAfterDisconnect;; + DM.Connection.OnConnectionLost := ConnectionConnectionLost; + DM.dsDetail.OnStateChange := dsUpdateData; + DM.dsDetail.OnDataChange := dsDataChange; + DM.dsMaster.OnStateChange := dsUpdateData; + DM.dsMaster.OnDataChange := dsDataChange; + OptionsToEditors; +end; + +procedure TMainForm.FormDestroy(Sender: TObject); +begin + DM.Free; + AboutForm.Free; +end; + +procedure TMainForm.FormActivate(Sender: TObject); +begin + FActivated := True; +end; + +procedure TMainForm.btConnectClick(Sender: TObject); +begin + EditorsToOptions; + DM.Connection.Connect; +end; + +procedure TMainForm.btDisconnectClick(Sender: TObject); +begin + EditorsToOptions; + DM.Connection.Disconnect; +end; + +procedure TMainForm.btOpenClick(Sender: TObject); +begin + EditorsToOptions; + DM.quMaster.Open; + DM.quDetail.Open; +end; + +procedure TMainForm.btCloseClick(Sender: TObject); +begin + EditorsToOptions; + DM.quMaster.Close; + DM.quDetail.Close; +end; + +procedure TMainForm.cbDisconnectedModeClick(Sender: TObject); +begin + if ShouldNotUpdateControls then + Exit; + try + DM.Connection.Options.DisconnectedMode := cbDisconnectedMode.Checked; + except + OptionsToEditors; + raise; + end; +end; + +procedure TMainForm.cbFailoverClick(Sender: TObject); +begin + if ShouldNotUpdateControls then + Exit; + DM.Connection.Options.LocalFailover := cbFailover.Checked; +end; + +procedure TMainForm.cbPoolingClick(Sender: TObject); +begin + if ShouldNotUpdateControls then + Exit; + DM.Connection.Pooling := cbPooling.Checked; +end; + +procedure TMainForm.edMaxPoolSizeExit(Sender: TObject); +begin + try + DM.Connection.PoolingOptions.MaxPoolSize := StrToInt(edMaxPoolSize.Text); + except + OptionsToEditors; + raise; + end; +end; + +procedure TMainForm.edMinPoolSizeExit(Sender: TObject); +begin + try + DM.Connection.PoolingOptions.MinPoolSize := StrToInt(edMinPoolSize.Text); + except + OptionsToEditors; + raise; + end; +end; + +procedure TMainForm.edConnectionLifetimeExit(Sender: TObject); +begin + try + DM.Connection.PoolingOptions.ConnectionLifetime := StrToInt(edConnectionLifetime.Text); + except + OptionsToEditors; + raise; + end; +end; + +procedure TMainForm.cbValidateClick(Sender: TObject); +begin + if ShouldNotUpdateControls then + Exit; + DM.Connection.PoolingOptions.Validate := cbValidate.Checked; +end; + +procedure TMainForm.cbCachedUpdatesClick(Sender: TObject); +begin + if ShouldNotUpdateControls then + Exit; + try + DM.quDetail.CachedUpdates := cbCachedUpdates.Checked; + DM.quMaster.CachedUpdates := cbCachedUpdates.Checked; + except + OptionsToEditors; + raise; + end; +end; + +procedure TMainForm.ConnectionConnectionLost(Sender: TObject; + Component: TComponent; ConnLostCause: TConnLostCause; + var RetryMode: TRetryMode); +var + Msg: string; +begin + case ConnLostCause of + clUnknown: + Msg := 'for reasons not known'; + clExecute: + Msg := 'during SQL execution'; + clOpen: + Msg := 'during query opening'; + clApply: + Msg := 'during DataSet.ApplyUpdates'; + clServiceQuery: + Msg := 'during service information request'; + clTransStart: + Msg := 'during transaction start'; + clConnectionApply: + Msg := 'during Connection.ApplyUpdates'; + clConnect: + Msg := 'during connection establishing'; + end; + meLog.Lines.Add(TimeToStr(Now) + ' ' + Component.Name + ' - Connection lost ' + Msg); + if coRetryMode.ItemIndex <> 0 then + RetryMode := TRetryMode(coRetryMode.ItemIndex - 1) +end; + +procedure TMainForm.ConnectionAfterConnect(Sender: TObject); +begin + btConnect.Enabled := False; + btDisconnect.Enabled := True; + btKillSession.Enabled := True; +end; + +procedure TMainForm.ConnectionAfterDisconnect(Sender: TObject); +begin + btDisconnect.Enabled := False; + btKillSession.Enabled := False; + btConnect.Enabled := True; +end; + +procedure TMainForm.dsUpdateData(Sender: TObject); +begin + ShowPending; +end; + +procedure TMainForm.dsDataChange(Sender: TObject; Field: TField); +begin + ShowPending; +end; + +procedure TMainForm.cbLocalMasterDetailClick(Sender: TObject); +begin + try + DM.quDetail.Options.LocalMasterDetail := cbLocalMasterDetail.Checked; + except + OptionsToEditors; + raise; + end; +end; + +procedure TMainForm.cbFetchAllClick(Sender: TObject); +begin + DM.quDetail.FetchAll := cbFetchAll.Checked; + DM.quMaster.FetchAll := cbFetchAll.Checked; +end; + +procedure TMainForm.ShowPending; +begin + if DM.quMaster.UpdatesPending then + StatusBar.Panels[0].Text := 'Master Updates Pending' + else + StatusBar.Panels[0].Text := ''; + if DM.quDetail.UpdatesPending then + StatusBar.Panels[1].Text := 'Detail Updates Pending' + else + StatusBar.Panels[1].Text := ''; +end; + +procedure TMainForm.ShowTrans; +begin + if DM.InTransaction then + StatusBar.Panels[2].Text := 'UpdateTransaction is Active' + else + StatusBar.Panels[2].Text := ''; +end; + +procedure TMainForm.btApplyClick(Sender: TObject); +begin + if DM.quMaster.UpdatesPending then + DM.quMaster.ApplyUpdates; + if DM.quDetail.UpdatesPending then + DM.quDetail.ApplyUpdates; + ShowPending; +end; + +procedure TMainForm.btCommitClick(Sender: TObject); +begin + DM.quMaster.CommitUpdates; + DM.quDetail.CommitUpdates; + ShowPending; +end; + +procedure TMainForm.btCancelClick(Sender: TObject); +begin + if DM.quMaster.UpdatesPending then + DM.quMaster.CancelUpdates; + if DM.quDetail.UpdatesPending then + DM.quDetail.CancelUpdates; + ShowPending; +end; + +procedure TMainForm.btStartTransClick(Sender: TObject); +begin + DM.StartTransaction; + ShowTrans; +end; + +procedure TMainForm.btCommitTransClick(Sender: TObject); +begin + DM.CommitTransaction; + ShowTrans; +end; + +procedure TMainForm.btRollbackTransClick(Sender: TObject); +begin + DM.RollbackTransaction; + ShowTrans; +end; + +procedure TMainForm.btKillSessionClick(Sender: TObject); +begin + try + DM.KillSession; + btKillSession.Enabled := False; + meLog.Lines.Add(TimeToStr(Now) + ' Session was killed'); + except + on e: Exception do + meLog.Lines.Add(TimeToStr(Now) + ' ' + Trim(e.Message)); + end; +end; + +procedure TMainForm.lbAboutMouseMove(Sender: TObject; Shift: TShiftState; + X, Y: Integer); +begin + lbAbout.Font.Color := $4080FF; +end; + +procedure TMainForm.pnTopMouseMove(Sender: TObject; Shift: TShiftState; X, + Y: Integer); +begin + lbAbout.Font.Color := $FF0000; +end; + +procedure TMainForm.lbAboutClick(Sender: TObject); +begin + AboutForm.ShowModal; + lbAbout.Font.Color := $FF0000; +end; + +procedure TMainForm.cbDebugClick(Sender: TObject); +begin + DM.quMaster.Debug := cbDebug.Checked; + DM.quDetail.Debug := cbDebug.Checked; + DM.scCreate.Debug := cbDebug.Checked; + DM.scDrop.Debug := cbDebug.Checked; +end; + +procedure TMainForm.btCreateDropClick(Sender: TObject); +var + s: string; +begin + if Sender = btDrop then + s := 'removed from database' + else + s := 'created in database'; + if MessageDlg(Format('Objects required for the demo will be %s. Continue?', [s]), + mtConfirmation, [mbYes, mbNo], 0) = mrYes then begin + if Sender = btCreate then + DM.scCreate.Execute + else + DM.scDrop.Execute; + end; +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/FailOver/ReadMe.txt b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/FailOver/ReadMe.txt new file mode 100644 index 0000000..987563d --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/FailOver/ReadMe.txt @@ -0,0 +1,10 @@ +SQL Server Data Access Components +Copyright 1997-2007, Core Lab. All Rights Reserved +-------------------------------------------------- + +Demonstrates the recommended approach to working with unstable networks. +This sample lets you perform transactions and updates in several different +modes, simulate a sudden session termination, and view what happens to your +data state when connections to the server are unexpectedly lost. Shows off +CachedUpdates, LocalMasterDetail, FetchAll, Pooling, and different Failover +modes. diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/Client.bdsproj b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/Client.bdsproj new file mode 100644 index 0000000..67e59e6 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/Client.bdsproj @@ -0,0 +1,160 @@ + + + + + + + + + + + + Client.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/Client.cfg b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/Client.cfg new file mode 100644 index 0000000..23380bb --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/Client.cfg @@ -0,0 +1,37 @@ +-$A+ +-$B- +-$C+ +-$D+ +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L+ +-$M- +-$N+ +-$O- +-$P+ +-$Q+ +-$R+ +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$YD +-$Z1 +-cg +-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-H+ +-W+ +-M +-$M16384,1048576 +-K$00400000 +-E"." +-N"." +-LE"." +-LN"." \ No newline at end of file diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/Client.dpr b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/Client.dpr new file mode 100644 index 0000000..7cf2d7c --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/Client.dpr @@ -0,0 +1,13 @@ +program Client; + +uses + Forms, + ClientForm in 'ClientForm.pas' {fmClient}; + +{$R *.RES} + +begin + Application.Initialize; + Application.CreateForm(TfmClient, fmClient); + Application.Run; +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/Client.res b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/Client.res new file mode 100644 index 0000000..fab5689 Binary files /dev/null and b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/Client.res differ diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/ClientForm.dfm b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/ClientForm.dfm new file mode 100644 index 0000000..15ab75b --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/ClientForm.dfm @@ -0,0 +1,179 @@ +object fmClient: TfmClient + Left = 250 + Top = 155 + Width = 841 + Height = 523 + Caption = 'MS Data Access Demo - MIDAS Client' + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + object DBGrid: TDBGrid + Left = 0 + Top = 48 + Width = 833 + Height = 429 + Align = alClient + DataSource = DataSource + TabOrder = 0 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object StatusBar: TStatusBar + Left = 0 + Top = 477 + Width = 833 + Height = 19 + Panels = < + item + Width = 50 + end> + end + object Panel2: TPanel + Left = 0 + Top = 0 + Width = 833 + Height = 48 + Align = alTop + BevelOuter = bvNone + TabOrder = 2 + object Panel1: TPanel + Left = 2 + Top = 1 + Width = 499 + Height = 46 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btCancelUpd: TSpeedButton + Left = 416 + Top = 1 + Width = 82 + Height = 22 + Caption = 'CancelUpd' + Flat = True + Transparent = False + OnClick = btCancelUpdClick + end + object btApplyUpd: TSpeedButton + Left = 334 + Top = 1 + Width = 81 + Height = 22 + Caption = 'ApplyUpd' + Flat = True + Transparent = False + OnClick = btApplyUpdClick + end + object btClose: TSpeedButton + Left = 252 + Top = 1 + Width = 81 + Height = 22 + Caption = 'Close' + Flat = True + Transparent = False + OnClick = btCloseClick + end + object btOpen: TSpeedButton + Left = 167 + Top = 1 + Width = 84 + Height = 22 + Caption = 'Open' + Flat = True + Transparent = False + OnClick = btOpenClick + end + object btDisconnect: TSpeedButton + Left = 84 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Disconnect' + Flat = True + Transparent = False + OnClick = btDisconnectClick + end + object brConnect: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Connect' + Flat = True + Transparent = False + OnClick = brConnectClick + end + object DBNavigator1: TDBNavigator + Left = 1 + Top = 24 + Width = 250 + Height = 21 + DataSource = DataSource + Flat = True + TabOrder = 0 + end + object ToolBar1: TPanel + Left = 252 + Top = 24 + Width = 246 + Height = 21 + BevelOuter = bvNone + TabOrder = 1 + object DeptNo: TLabel + Left = 7 + Top = 1 + Width = 71 + Height = 21 + Alignment = taCenter + AutoSize = False + Caption = 'EmployeeID' + Layout = tlCenter + end + object edEmployeeID: TEdit + Left = 99 + Top = 1 + Width = 121 + Height = 21 + TabOrder = 0 + Text = '10' + end + end + end + end + object DataSource: TDataSource + DataSet = ClientDataSet + Left = 408 + Top = 252 + end + object ClientDataSet: TClientDataSet + Aggregates = <> + Params = < + item + DataType = ftInteger + Name = 'EmployeeID' + ParamType = ptInput + Value = 10 + end> + ProviderName = 'MSDataSetProvider' + RemoteServer = RemoteServer + Left = 376 + Top = 252 + end + object RemoteServer: TDCOMConnection + ServerGUID = '{706739B2-FB40-49CC-9041-2B82CFFC520C}' + ServerName = 'Server.Datas' + Left = 344 + Top = 253 + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/ClientForm.pas b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/ClientForm.pas new file mode 100644 index 0000000..c010d35 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/ClientForm.pas @@ -0,0 +1,149 @@ +unit ClientForm; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + Grids, DBGrids, ToolWin, ComCtrls, Db, DBClient, ExtCtrls, DBCtrls, + StdCtrls, MConnect, MidasCon, Buttons; + +type + TfmClient = class(TForm) + DBGrid: TDBGrid; + DataSource: TDataSource; + ClientDataSet: TClientDataSet; + StatusBar: TStatusBar; + RemoteServer: TDCOMConnection; + Panel2: TPanel; + Panel1: TPanel; + btCancelUpd: TSpeedButton; + btApplyUpd: TSpeedButton; + btClose: TSpeedButton; + btOpen: TSpeedButton; + btDisconnect: TSpeedButton; + brConnect: TSpeedButton; + DBNavigator1: TDBNavigator; + ToolBar1: TPanel; + DeptNo: TLabel; + edEmployeeID: TEdit; + procedure brConnectClick(Sender: TObject); + procedure RemoteServerAfterConnect(Sender: TObject); + procedure RemoteServerAfterDisconnect(Sender: TObject); + procedure btOpenClick(Sender: TObject); + procedure btCloseClick(Sender: TObject); + procedure btApplyUpdClick(Sender: TObject); + procedure btCancelUpdClick(Sender: TObject); + procedure btDisconnectClick(Sender: TObject); + procedure FormCreate(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + end; + +var + fmClient: TfmClient; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} +{$IFDEF LINUX} +{$R *.xfm} +{$ENDIF} + +{$IFNDEF VER130} +{$IFNDEF VER140} +{$IFNDEF CLR} + {$DEFINE XPMAN} + {$R WindowsXP.res} +{$ENDIF} +{$ENDIF} +{$ENDIF} + +{$IFDEF XPMAN} +uses + UxTheme; +{$ENDIF} + +procedure TfmClient.brConnectClick(Sender: TObject); +begin + RemoteServer.Connected:= True; +end; + +procedure TfmClient.btDisconnectClick(Sender: TObject); +begin + RemoteServer.Connected:= False; +end; + +procedure TfmClient.RemoteServerAfterConnect(Sender: TObject); +begin + StatusBar.Panels[0].Text:= 'Connected'; +end; + +procedure TfmClient.RemoteServerAfterDisconnect(Sender: TObject); +begin + if Assigned(StatusBar) then + StatusBar.Panels[0].Text:= 'Disconnected'; +end; + +procedure TfmClient.btOpenClick(Sender: TObject); +begin + if edEmployeeID.Text <> '' then + ClientDataSet.Params.ParamByName('EmployeeID').AsInteger:= StrToInt(edEmployeeID.Text); + ClientDataSet.Open; + edEmployeeID.Text:= IntToStr(ClientDataSet.Params.ParamByName('EmployeeID').AsInteger); +end; + +procedure TfmClient.btCloseClick(Sender: TObject); +begin + ClientDataSet.Close; +end; + +procedure TfmClient.btApplyUpdClick(Sender: TObject); +begin + ClientDataSet.ApplyUpdates(0); +end; + +procedure TfmClient.btCancelUpdClick(Sender: TObject); +begin + ClientDataSet.CancelUpdates; +end; + +procedure TfmClient.FormCreate(Sender: TObject); +{$IFDEF XPMAN} + procedure UpdateStyle(Control: TWinControl); + var + Panel: TPanel; + i: integer; + begin + for i := 0 to Control.ControlCount - 1 do begin + if Control.Controls[i] is TSpeedButton then + TSpeedButton(Control.Controls[i]).Flat := False + else + if Control.Controls[i] is TDBNavigator then + TDBNavigator(Control.Controls[i]).Flat := False; + if Control.Controls[i] is TWinControl then begin + if (Control.Controls[i] is TPanel) then begin + Panel := TPanel(Control.Controls[i]); + Panel.ParentBackground := False; + Panel.Color := clBtnFace; + end; + UpdateStyle(TWinControl(Control.Controls[i])); + end; + end; + end; +{$ENDIF} +begin +{$IFDEF XPMAN} + if UseThemes then + UpdateStyle(Self); +{$ENDIF} +end; + +end. + diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/Data.dfm b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/Data.dfm new file mode 100644 index 0000000..1db12e3 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/Data.dfm @@ -0,0 +1,55 @@ +object Datas: TDatas + OldCreateOrder = False + OnCreate = DatasCreate + Left = 246 + Top = 272 + Height = 485 + Width = 694 + object MSConnection: TMSConnection + Database = 'Northwind' + AfterConnect = ConnectionChange + AfterDisconnect = ConnectionChange + ConnectDialog = MSConnectDialog + Left = 24 + Top = 16 + end + object Query: TMSQuery + Connection = MSConnection + SQL.Strings = ( + 'SELECT *' + 'FROM Employees' + 'WHERE EmployeeID < :EmployeeID') + Debug = True + Left = 72 + Top = 16 + ParamData = < + item + DataType = ftInteger + Name = 'EmployeeID' + ParamType = ptInput + end> + end + object DataSetProvider: TDataSetProvider + DataSet = Query + ResolveToDataSet = True + Options = [poNoReset] + Left = 128 + Top = 64 + end + object MSConnectDialog: TMSConnectDialog + SavePassword = True + Caption = 'Connect' + UsernameLabel = 'User Name' + PasswordLabel = 'Password' + ServerLabel = 'Server' + ConnectButton = 'Connect' + CancelButton = 'Cancel' + Left = 24 + Top = 64 + end + object MSDataSetProvider: TDataSetProvider + DataSet = Query + Left = 128 + Top = 16 + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/Data.pas b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/Data.pas new file mode 100644 index 0000000..d4b8bc7 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/Data.pas @@ -0,0 +1,100 @@ +unit Data; + +interface + +uses + Windows, Messages, SysUtils, Classes, ComServ, ComObj, VCLCom, DataBkr, + DBClient, Server_TLB, StdVcl, Db, MemDS, Provider, + DBTables, DBAccess, MSAccess, Dialogs, SdacVcl; + +type + TDatas = class(TRemoteDataModule, IDatas) + MSConnection: TMSConnection; + Query: TMSQuery; + DataSetProvider: TDataSetProvider; + MSConnectDialog: TMSConnectDialog; + MSDataSetProvider: TDataSetProvider; + procedure DatasCreate(Sender: TObject); + procedure DatasDestroy(Sender: TObject); + procedure ConnectionChange(Sender: TObject); + private + { Private declarations } + protected + class procedure UpdateRegistry(Register: Boolean; const ClassID, ProgID: string); override; + public + { Public declarations } + end; + +var + Datas:TDatas; + +implementation +uses ServerForm; +var + CountConnection:integer; + +{$R *.DFM} + +class procedure TDatas.UpdateRegistry(Register: Boolean; const ClassID, ProgID: string); +begin + if Register then + begin + inherited UpdateRegistry(Register, ClassID, ProgID); + EnableSocketTransport(ClassID); + EnableWebTransport(ClassID); + end else + begin + DisableSocketTransport(ClassID); + DisableWebTransport(ClassID); + inherited UpdateRegistry(Register, ClassID, ProgID); + end; +end; + +procedure TDatas.DatasCreate(Sender: TObject); +var + St: string; +begin + if not Assigned(Datas) then begin + Datas := TDatas(Sender); + St := Query.SQL.Text; + + fmServer.meSQL.Lines.Text := St; + fmServer.cbDebug.Checked := Query.Debug; + fmServer.DataSource.DataSet := Query; + fmServer.rbDSResolve.Checked := MSDataSetProvider.ResolveToDataset; + fmServer.rbSQLResolve.Checked := not MSDataSetProvider.ResolveToDataset; + end; + + Inc(CountConnection); + fmServer.StatusBar.Panels[0].Text := 'Count connections ' + IntToStr(CountConnection); +end; + +procedure TDatas.DatasDestroy(Sender: TObject); +begin + if Datas = TDatas(Sender) then begin + if Assigned(fmServer) then + fmServer.DataSource.DataSet := nil; + Datas := nil; + end; + + Dec(CountConnection); + if Assigned(fmServer) then + fmServer.StatusBar.Panels[0].Text := 'Count connections ' + IntToStr(CountConnection); +end; + +procedure TDatas.ConnectionChange(Sender: TObject); +begin + if (Sender as TCustomDAConnection).Connected then + Inc(CountConnection) + else + Dec(CountConnection); + + if Assigned(fmServer) then + fmServer.StatusBar.Panels[0].Text := 'Count connections ' + IntToStr(CountConnection); +end; + +initialization + TComponentFactory.Create(ComServer, TDatas, + Class_Datas, ciMultiInstance{, tmApartment}); +end. + diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/MidasGroup.bpg b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/MidasGroup.bpg new file mode 100644 index 0000000..471b6ea --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/MidasGroup.bpg @@ -0,0 +1,24 @@ +#------------------------------------------------------------------------------ +VERSION = BWS.01 +#------------------------------------------------------------------------------ +!ifndef ROOT +ROOT = $(MAKEDIR)\.. +!endif +#------------------------------------------------------------------------------ +MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$** +DCC = $(ROOT)\bin\dcc32.exe $** +BRCC = $(ROOT)\bin\brcc32.exe $** +#------------------------------------------------------------------------------ +PROJECTS = Server.exe Client.exe +#------------------------------------------------------------------------------ +default: $(PROJECTS) +#------------------------------------------------------------------------------ + + +Server.exe: Server.dpr + $(DCC) + +Client.exe: Client.dpr + $(DCC) + + diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/Midas_TLB.dcr b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/Midas_TLB.dcr new file mode 100644 index 0000000..36f26e2 Binary files /dev/null and b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/Midas_TLB.dcr differ diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/Midas_TLB.pas b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/Midas_TLB.pas new file mode 100644 index 0000000..cce80cd --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/Midas_TLB.pas @@ -0,0 +1,100 @@ +unit Midas_TLB; + +// ************************************************************************ // +// WARNING +// ------- +// The types declared in this file were generated from data read from a +// Type Library. If this type library is explicitly or indirectly (via +// another type library referring to this type library) re-imported, or the +// 'Refresh' command of the Type Library Editor activated while editing the +// Type Library, the contents of this file will be regenerated and all +// manual modifications will be lost. +// ************************************************************************ // + +// PASTLWTR : $Revision: 1.88.1.0.1.0 $ +// File generated on 02.07.2001 15:36:17 from Type Library described below. + +// ************************************************************************ // +// Type Lib: C:\WINDOWS\SYSTEM\MIDAS.DLL (1) +// IID\LCID: {83F57D68-CA9A-11D2-9088-00C04FA35CFA}\0 +// Helpfile: +// DepndLst: +// (1) v2.0 stdole, (C:\WINDOWS\SYSTEM\stdole2.tlb) +// Parent TypeLibrary: +// (0) v1.0 Server, (D:\Projects\Delphi\MSDAC\Demos\Midas\Delphi5\Server.tlb) +// ************************************************************************ // +{$TYPEDADDRESS OFF} // Unit must be compiled without type-checked pointers. +interface + +uses Windows, ActiveX, Classes, Graphics, OleServer, OleCtrls, StdVCL; + +// *********************************************************************// +// GUIDS declared in the TypeLibrary. Following prefixes are used: +// Type Libraries : LIBID_xxxx +// CoClasses : CLASS_xxxx +// DISPInterfaces : DIID_xxxx +// Non-DISP interfaces: IID_xxxx +// *********************************************************************// +const + // TypeLibrary Major and minor versions + MidasMajorVersion = 1; + MidasMinorVersion = 0; + + LIBID_Midas: TGUID = '{83F57D68-CA9A-11D2-9088-00C04FA35CFA}'; + + IID_IAppServer: TGUID = '{1AEFCC20-7A24-11D2-98B0-C69BEB4B5B6D}'; +type + +// *********************************************************************// +// Forward declaration of types defined in TypeLibrary +// *********************************************************************// + IAppServer = interface; + IAppServerDisp = dispinterface; + +// *********************************************************************// +// Interface: IAppServer +// Flags: (4416) Dual OleAutomation Dispatchable +// GUID: {1AEFCC20-7A24-11D2-98B0-C69BEB4B5B6D} +// *********************************************************************// + IAppServer = interface(IDispatch) + ['{1AEFCC20-7A24-11D2-98B0-C69BEB4B5B6D}'] + function AS_ApplyUpdates(const ProviderName: WideString; Delta: OleVariant; + MaxErrors: Integer; out ErrorCount: Integer; var OwnerData: OleVariant): OleVariant; safecall; + function AS_GetRecords(const ProviderName: WideString; Count: Integer; out RecsOut: Integer; + Options: Integer; const CommandText: WideString; + var Params: OleVariant; var OwnerData: OleVariant): OleVariant; safecall; + function AS_DataRequest(const ProviderName: WideString; Data: OleVariant): OleVariant; safecall; + function AS_GetProviderNames: OleVariant; safecall; + function AS_GetParams(const ProviderName: WideString; var OwnerData: OleVariant): OleVariant; safecall; + function AS_RowRequest(const ProviderName: WideString; Row: OleVariant; RequestType: Integer; + var OwnerData: OleVariant): OleVariant; safecall; + procedure AS_Execute(const ProviderName: WideString; const CommandText: WideString; + var Params: OleVariant; var OwnerData: OleVariant); safecall; + end; + +// *********************************************************************// +// DispIntf: IAppServerDisp +// Flags: (4416) Dual OleAutomation Dispatchable +// GUID: {1AEFCC20-7A24-11D2-98B0-C69BEB4B5B6D} +// *********************************************************************// + IAppServerDisp = dispinterface + ['{1AEFCC20-7A24-11D2-98B0-C69BEB4B5B6D}'] + function AS_ApplyUpdates(const ProviderName: WideString; Delta: OleVariant; + MaxErrors: Integer; out ErrorCount: Integer; var OwnerData: OleVariant): OleVariant; dispid 20000000; + function AS_GetRecords(const ProviderName: WideString; Count: Integer; out RecsOut: Integer; + Options: Integer; const CommandText: WideString; + var Params: OleVariant; var OwnerData: OleVariant): OleVariant; dispid 20000001; + function AS_DataRequest(const ProviderName: WideString; Data: OleVariant): OleVariant; dispid 20000002; + function AS_GetProviderNames: OleVariant; dispid 20000003; + function AS_GetParams(const ProviderName: WideString; var OwnerData: OleVariant): OleVariant; dispid 20000004; + function AS_RowRequest(const ProviderName: WideString; Row: OleVariant; RequestType: Integer; + var OwnerData: OleVariant): OleVariant; dispid 20000005; + procedure AS_Execute(const ProviderName: WideString; const CommandText: WideString; + var Params: OleVariant; var OwnerData: OleVariant); dispid 20000006; + end; + +implementation + +uses ComObj; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/ReadMe.txt b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/ReadMe.txt new file mode 100644 index 0000000..eda39af --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/ReadMe.txt @@ -0,0 +1,9 @@ +SQL Server Data Access Components +Copyright 1997-2007, Core Lab. All Rights Reserved +-------------------------------------------------- + +Demonstrates using MIDAS technology with SDAC. This project consists of +two parts: a MIDAS server that processes requests to the database and a +thin MIDAS client that displays an interactive grid. This demo shows how +to build thin clients that display interactive components and delegate +all database interaction to a server application for processing. diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/Server.bdsproj b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/Server.bdsproj new file mode 100644 index 0000000..0af7363 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/Server.bdsproj @@ -0,0 +1,158 @@ + + + + + + + + + + + + Server.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + + + 0 + 0 + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + + + + False + + + + $00000000 + + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/Server.cfg b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/Server.cfg new file mode 100644 index 0000000..fc13625 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/Server.cfg @@ -0,0 +1,41 @@ +-$A+ +-$B- +-$C+ +-$D+ +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L+ +-$M- +-$N+ +-$O- +-$P+ +-$Q+ +-$R+ +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$YD +-$Z1 +-cg +-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-H+ +-W+ +-M +-$M16384,1048576 +-K$00400000 +-E"." +-N"." +-LE"." +-LN"." +-U"d:\program files\borland\delphi5\Lib\Debug;d:\program files\borland\delphi5\Vcl;d:\program files\borland\delphi5\lib" +-O"d:\program files\borland\delphi5\Lib\Debug;d:\program files\borland\delphi5\Vcl;d:\program files\borland\delphi5\lib" +-I"d:\program files\borland\delphi5\Lib\Debug;d:\program files\borland\delphi5\Vcl;d:\program files\borland\delphi5\lib" +-R"d:\program files\borland\delphi5\Lib\Debug;d:\program files\borland\delphi5\Vcl;d:\program files\borland\delphi5\lib" diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/Server.dpr b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/Server.dpr new file mode 100644 index 0000000..0223a83 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/Server.dpr @@ -0,0 +1,17 @@ +program Server; + +uses + Forms, + ServerForm in 'ServerForm.pas' {fmServer}, + Server_TLB in 'Server_TLB.pas', + Data in 'Data.pas' {Datas: TRemoteDataModule} {Datas: CoClass}; + +{$R *.TLB} + +{$R *.RES} + +begin + Application.Initialize; + Application.CreateForm(TfmServer, fmServer); + Application.Run; +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/Server.res b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/Server.res new file mode 100644 index 0000000..0d84694 Binary files /dev/null and b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/Server.res differ diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/Server.tlb b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/Server.tlb new file mode 100644 index 0000000..4d272e2 Binary files /dev/null and b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/Server.tlb differ diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/ServerForm.dfm b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/ServerForm.dfm new file mode 100644 index 0000000..17f95b5 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/ServerForm.dfm @@ -0,0 +1,180 @@ +object fmServer: TfmServer + Left = 219 + Top = 210 + Width = 876 + Height = 521 + Caption = 'MS Data Access Demo - MIDAS Server' + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + object ToolBar: TPanel + Left = 0 + Top = 0 + Width = 868 + Height = 48 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object Panel1: TPanel + Left = 0 + Top = 0 + Width = 477 + Height = 47 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btConnect: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Connect' + Flat = True + Transparent = False + OnClick = btConnectClick + end + object btDisconnect: TSpeedButton + Left = 84 + Top = 1 + Width = 84 + Height = 22 + Caption = 'Disconnect' + Flat = True + Transparent = False + OnClick = btDisconnectClick + end + object btOpen: TSpeedButton + Left = 169 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Open' + Flat = True + Transparent = False + OnClick = btOpenClick + end + object btClose: TSpeedButton + Left = 252 + Top = 1 + Width = 80 + Height = 22 + Caption = 'Close' + Flat = True + Transparent = False + OnClick = btCloseClick + end + object DBNavigator: TDBNavigator + Left = 1 + Top = 24 + Width = 250 + Height = 22 + DataSource = DataSource + Flat = True + TabOrder = 0 + end + object ToolBar1: TPanel + Left = 252 + Top = 24 + Width = 224 + Height = 22 + BevelOuter = bvNone + TabOrder = 1 + object ToolButton2: TToolButton + Left = 240 + Top = 2 + Width = 25 + Caption = 'ToolButton2' + ImageIndex = 0 + Style = tbsSeparator + end + object rbDSResolve: TRadioButton + Left = 5 + Top = 0 + Width = 120 + Height = 22 + Caption = 'Resolve to Dataset' + TabOrder = 0 + OnClick = rbDSResolveClick + end + object rbSQLResolve: TRadioButton + Left = 122 + Top = -1 + Width = 104 + Height = 22 + Caption = 'Resolve by SQL' + TabOrder = 1 + OnClick = rbSQLResolveClick + end + end + object Panel2: TPanel + Left = 333 + Top = 1 + Width = 143 + Height = 22 + BevelOuter = bvNone + TabOrder = 2 + object ToolButton1: TToolButton + Left = 240 + Top = 2 + Width = 25 + Caption = 'ToolButton2' + ImageIndex = 0 + Style = tbsSeparator + end + object cbDebug: TCheckBox + Left = 43 + Top = 0 + Width = 64 + Height = 22 + Caption = 'Debug' + TabOrder = 0 + OnClick = cbDebugClick + end + end + end + end + object meSQL: TMemo + Left = 0 + Top = 48 + Width = 868 + Height = 76 + Align = alTop + TabOrder = 1 + OnExit = meSQLExit + end + object DBGrid: TDBGrid + Left = 0 + Top = 124 + Width = 868 + Height = 344 + Align = alClient + DataSource = DataSource + TabOrder = 2 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object StatusBar: TStatusBar + Left = 0 + Top = 468 + Width = 868 + Height = 19 + Panels = < + item + Width = 50 + end> + end + object DataSource: TDataSource + Left = 8 + Top = 64 + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/ServerForm.pas b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/ServerForm.pas new file mode 100644 index 0000000..9259a3c --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/ServerForm.pas @@ -0,0 +1,160 @@ +unit ServerForm; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + Grids, DBGrids, StdCtrls, ToolWin, ComCtrls, ExtCtrls, DBCtrls, Db, + Buttons; + +type + TfmServer = class(TForm) + ToolBar: TPanel; + meSQL: TMemo; + DBGrid: TDBGrid; + DataSource: TDataSource; + StatusBar: TStatusBar; + Panel1: TPanel; + btConnect: TSpeedButton; + DBNavigator: TDBNavigator; + btDisconnect: TSpeedButton; + btOpen: TSpeedButton; + btClose: TSpeedButton; + ToolBar1: TPanel; + ToolButton2: TToolButton; + Panel2: TPanel; + ToolButton1: TToolButton; + cbDebug: TCheckBox; + rbDSResolve: TRadioButton; + rbSQLResolve: TRadioButton; + procedure btConnectClick(Sender: TObject); + procedure btDisconnectClick(Sender: TObject); + procedure btOpenClick(Sender: TObject); + procedure btCloseClick(Sender: TObject); + procedure cbDebugClick(Sender: TObject); + procedure meSQLExit(Sender: TObject); + procedure rbDSResolveClick(Sender: TObject); + procedure rbSQLResolveClick(Sender: TObject); + procedure FormCreate(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + end; + +var + fmServer: TfmServer; + +implementation + + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} +{$IFDEF LINUX} +{$R *.xfm} +{$ENDIF} + +{$IFNDEF VER130} +{$IFNDEF VER140} +{$IFNDEF CLR} + {$DEFINE XPMAN} + {$R WindowsXP.res} +{$ENDIF} +{$ENDIF} +{$ENDIF} + +uses +{$IFDEF XPMAN} + UxTheme, +{$ENDIF} + Data; + + + + +procedure TfmServer.btConnectClick(Sender: TObject); +begin + if Assigned(Datas) then + Datas.MSConnection.Connect; +end; + +procedure TfmServer.btDisconnectClick(Sender: TObject); +begin + if Assigned(Datas) then + Datas.MSConnection.Disconnect; +end; + +procedure TfmServer.btOpenClick(Sender: TObject); +begin + if Assigned(Datas) then + Datas.Query.Open; +end; + +procedure TfmServer.btCloseClick(Sender: TObject); +begin + if Assigned(Datas) then + Datas.Query.Close; +end; + +procedure TfmServer.cbDebugClick(Sender: TObject); +begin + if Assigned(Datas) then + Datas.Query.Debug:= cbDebug.Checked; +end; + +procedure TfmServer.meSQLExit(Sender: TObject); +begin + if Assigned(Datas) then + if meSQL.Lines.Text <> Datas.Query.SQL.Text then + Datas.Query.SQL.Assign(meSQL.Lines); +end; + +procedure TfmServer.rbDSResolveClick(Sender: TObject); +begin + if Assigned(Datas) then + Datas.MSDataSetProvider.ResolveToDataset:= rbDSResolve.Checked; +end; + +procedure TfmServer.rbSQLResolveClick(Sender: TObject); +begin + if Assigned(Datas) then + Datas.MSDataSetProvider.ResolveToDataset:= not rbSQLResolve.Checked; +end; + +procedure TfmServer.FormCreate(Sender: TObject); +{$IFDEF XPMAN} + procedure UpdateStyle(Control: TWinControl); + var + Panel: TPanel; + i: integer; + begin + for i := 0 to Control.ControlCount - 1 do begin + if Control.Controls[i] is TSpeedButton then + TSpeedButton(Control.Controls[i]).Flat := False + else + if Control.Controls[i] is TDBNavigator then + TDBNavigator(Control.Controls[i]).Flat := False; + if Control.Controls[i] is TWinControl then begin + if (Control.Controls[i] is TPanel) then begin + Panel := TPanel(Control.Controls[i]); + Panel.ParentBackground := False; + Panel.Color := clBtnFace; + end; + UpdateStyle(TWinControl(Control.Controls[i])); + end; + end; + end; +{$ENDIF} +begin +{$IFDEF XPMAN} + if UseThemes then + UpdateStyle(Self); +{$ENDIF} +end; + +end. + diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/Server_TLB.pas b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/Server_TLB.pas new file mode 100644 index 0000000..331a9cb --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Midas/Server_TLB.pas @@ -0,0 +1,119 @@ +unit Server_TLB; + +// ************************************************************************ // +// WARNING +// ------- +// The types declared in this file were generated from data read from a +// Type Library. If this type library is explicitly or indirectly (via +// another type library referring to this type library) re-imported, or the +// 'Refresh' command of the Type Library Editor activated while editing the +// Type Library, the contents of this file will be regenerated and all +// manual modifications will be lost. +// ************************************************************************ // + +// PASTLWTR : $Revision: 1.88.1.0.1.0 $ +// File generated on 02.07.2001 15:36:17 from Type Library described below. + +// ************************************************************************ // +// Type Lib: D:\Projects\Delphi\MSDAC\Demos\Midas\Delphi5\Server.tlb (1) +// IID\LCID: {07DB43ED-D8D6-4119-9861-2B7B79032B5F}\0 +// Helpfile: +// DepndLst: +// (1) v1.0 Midas, (C:\WINDOWS\SYSTEM\MIDAS.DLL) +// (2) v2.0 stdole, (C:\WINDOWS\SYSTEM\stdole2.tlb) +// (3) v4.0 StdVCL, (C:\WINDOWS\SYSTEM\STDVCL40.DLL) +// ************************************************************************ // +{$TYPEDADDRESS OFF} // Unit must be compiled without type-checked pointers. +interface + +uses Windows, ActiveX, Classes, Graphics, OleServer, OleCtrls, StdVCL, + MIDAS; + +// *********************************************************************// +// GUIDS declared in the TypeLibrary. Following prefixes are used: +// Type Libraries : LIBID_xxxx +// CoClasses : CLASS_xxxx +// DISPInterfaces : DIID_xxxx +// Non-DISP interfaces: IID_xxxx +// *********************************************************************// +const + // TypeLibrary Major and minor versions + ServerMajorVersion = 1; + ServerMinorVersion = 0; + + LIBID_Server: TGUID = '{07DB43ED-D8D6-4119-9861-2B7B79032B5F}'; + + IID_IDatas: TGUID = '{E79F2D5B-8F47-4CB6-B441-251950054002}'; + CLASS_Datas: TGUID = '{706739B2-FB40-49CC-9041-2B82CFFC520C}'; +type + +// *********************************************************************// +// Forward declaration of types defined in TypeLibrary +// *********************************************************************// + IDatas = interface; + IDatasDisp = dispinterface; + +// *********************************************************************// +// Declaration of CoClasses defined in Type Library +// (NOTE: Here we map each CoClass to its Default Interface) +// *********************************************************************// + Datas = IDatas; + + +// *********************************************************************// +// Interface: IDatas +// Flags: (4416) Dual OleAutomation Dispatchable +// GUID: {E79F2D5B-8F47-4CB6-B441-251950054002} +// *********************************************************************// + IDatas = interface(IAppServer) + ['{E79F2D5B-8F47-4CB6-B441-251950054002}'] + end; + +// *********************************************************************// +// DispIntf: IDatasDisp +// Flags: (4416) Dual OleAutomation Dispatchable +// GUID: {E79F2D5B-8F47-4CB6-B441-251950054002} +// *********************************************************************// + IDatasDisp = dispinterface + ['{E79F2D5B-8F47-4CB6-B441-251950054002}'] + function AS_ApplyUpdates(const ProviderName: WideString; Delta: OleVariant; + MaxErrors: Integer; out ErrorCount: Integer; var OwnerData: OleVariant): OleVariant; dispid 20000000; + function AS_GetRecords(const ProviderName: WideString; Count: Integer; out RecsOut: Integer; + Options: Integer; const CommandText: WideString; + var Params: OleVariant; var OwnerData: OleVariant): OleVariant; dispid 20000001; + function AS_DataRequest(const ProviderName: WideString; Data: OleVariant): OleVariant; dispid 20000002; + function AS_GetProviderNames: OleVariant; dispid 20000003; + function AS_GetParams(const ProviderName: WideString; var OwnerData: OleVariant): OleVariant; dispid 20000004; + function AS_RowRequest(const ProviderName: WideString; Row: OleVariant; RequestType: Integer; + var OwnerData: OleVariant): OleVariant; dispid 20000005; + procedure AS_Execute(const ProviderName: WideString; const CommandText: WideString; + var Params: OleVariant; var OwnerData: OleVariant); dispid 20000006; + end; + +// *********************************************************************// +// The Class CoDatas provides a Create and CreateRemote method to +// create instances of the default interface IDatas exposed by +// the CoClass Datas. The functions are intended to be used by +// clients wishing to automate the CoClass objects exposed by the +// server of this typelibrary. +// *********************************************************************// + CoDatas = class + class function Create: IDatas; + class function CreateRemote(const MachineName: string): IDatas; + end; + +implementation + +uses ComObj; + +class function CoDatas.Create: IDatas; +begin + Result := CreateComObject(CLASS_Datas) as IDatas; +end; + +class function CoDatas.CreateRemote(const MachineName: string): IDatas; +begin + Result := CreateRemoteComObject(MachineName, CLASS_Datas) as IDatas; +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Performance/Debug.pas b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Performance/Debug.pas new file mode 100644 index 0000000..5d4a025 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Performance/Debug.pas @@ -0,0 +1,76 @@ + +unit Debug; + +interface +uses + Windows; + +type + TTickInfo = class + private + StartTime: DWORD; + StopTime: DWORD; + Working: boolean; + public + procedure Start; + procedure Stop; + + function GetInterval:DWORD; + function GetIntervalSt:string; + end; + +function IntervalToStr(T:DWORD):string; + +implementation +uses + SysUtils; + +procedure TTickInfo.Start; +begin + Working := True; + StartTime := GetTickCount; +end; + +procedure TTickInfo.Stop; +begin + StopTime := GetTickCount; + Working := False; +end; + +function TTickInfo.GetInterval:DWORD; +begin + if Working then + Result := GetTickCount - StartTime + else + Result := StopTime - StartTime; +end; + +function TTickInfo.GetIntervalSt:string; +begin + Result := IntervalToStr(GetInterval); +end; + +function IntervalToStr(T:DWORD):string; +var + St:string; +begin + if T > 60000 then begin + Result := IntToStr(T div 60000) + ':'; + T:= T mod 60000; + end + else + Result:= '0:'; + + if T > 1000 then + Result := Result + IntToStr(T div 1000) + ':' + else + Result := Result + '0:'; + + St:= IntToStr(T mod 1000); + while Length(St) < 3 do + St := '0' + St; + + Result := Result + St; +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Performance/Main.dfm b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Performance/Main.dfm new file mode 100644 index 0000000..04ad5f9 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Performance/Main.dfm @@ -0,0 +1,808 @@ +object fmMain: TfmMain + Left = 271 + Top = 274 + Width = 814 + Height = 600 + Caption = 'MS SQL Data Access Demos - SDAC performance' + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + OnDestroy = FormDestroy + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 13 + object Splitter1: TSplitter + Left = 631 + Top = 66 + Height = 507 + Align = alRight + end + object Chart: TChart + Left = 0 + Top = 66 + Width = 631 + Height = 507 + BackWall.Brush.Color = clWhite + BackWall.Color = clSilver + Gradient.EndColor = 12615808 + MarginBottom = 2 + MarginLeft = 2 + MarginRight = 2 + Title.Text.Strings = ( + 'SDAC Performance') + BackColor = clSilver + BottomAxis.Automatic = False + BottomAxis.AutomaticMaximum = False + BottomAxis.AutomaticMinimum = False + BottomAxis.ExactDateTime = False + BottomAxis.Maximum = 5.000000000000000000 + BottomAxis.Title.Caption = 'record count' + Chart3DPercent = 20 + LeftAxis.Title.Caption = 'seconds' + MaxPointsPerPage = 10 + TopAxis.Automatic = False + TopAxis.AutomaticMaximum = False + TopAxis.AutomaticMinimum = False + TopAxis.Visible = False + View3D = False + View3DOptions.Elevation = 360 + View3DOptions.Perspective = 100 + View3DOptions.Rotation = 354 + View3DOptions.Zoom = 99 + Align = alClient + BevelInner = bvLowered + BevelOuter = bvLowered + TabOrder = 0 + object Series1: TLineSeries + HorizAxis = aBothHorizAxis + Marks.ArrowLength = 8 + Marks.BackColor = clRed + Marks.Style = smsValue + Marks.Visible = True + SeriesColor = clRed + Title = 'SDAC' + Pointer.InflateMargins = True + Pointer.Style = psRectangle + Pointer.Visible = False + XValues.DateTime = False + XValues.Name = 'X' + XValues.Multiplier = 1.000000000000000000 + XValues.Order = loAscending + YValues.DateTime = False + YValues.Name = 'Y' + YValues.Multiplier = 1.000000000000000000 + YValues.Order = loNone + end + object Series2: TLineSeries + Marks.ArrowLength = 8 + Marks.BackColor = clGreen + Marks.Style = smsValue + Marks.Visible = True + SeriesColor = clGreen + Title = 'BDE' + Pointer.InflateMargins = True + Pointer.Style = psRectangle + Pointer.Visible = False + XValues.DateTime = False + XValues.Name = 'X' + XValues.Multiplier = 1.000000000000000000 + XValues.Order = loAscending + YValues.DateTime = False + YValues.Name = 'Y' + YValues.Multiplier = 1.000000000000000000 + YValues.Order = loNone + end + object Series3: TLineSeries + Marks.ArrowLength = 20 + Marks.Style = smsValue + Marks.Visible = True + SeriesColor = clYellow + Title = 'ADO' + Pointer.InflateMargins = True + Pointer.Style = psRectangle + Pointer.Visible = False + XValues.DateTime = False + XValues.Name = 'X' + XValues.Multiplier = 1.000000000000000000 + XValues.Order = loAscending + YValues.DateTime = False + YValues.Name = 'Y' + YValues.Multiplier = 1.000000000000000000 + YValues.Order = loNone + end + object Series4: TLineSeries + Marks.ArrowLength = 20 + Marks.BackColor = clBlue + Marks.Style = smsValue + Marks.Visible = True + SeriesColor = clBlue + Title = 'dbExpress' + Pointer.InflateMargins = True + Pointer.Style = psRectangle + Pointer.Visible = False + XValues.DateTime = False + XValues.Name = 'X' + XValues.Multiplier = 1.000000000000000000 + XValues.Order = loAscending + YValues.DateTime = False + YValues.Name = 'Y' + YValues.Multiplier = 1.000000000000000000 + YValues.Order = loNone + end + object Series5: TLineSeries + Marks.ArrowLength = 20 + Marks.BackColor = clFuchsia + Marks.Style = smsValue + Marks.Visible = True + SeriesColor = clFuchsia + Title = 'dbExpSda' + Pointer.InflateMargins = True + Pointer.Style = psRectangle + Pointer.Visible = False + XValues.DateTime = False + XValues.Name = 'X' + XValues.Multiplier = 1.000000000000000000 + XValues.Order = loAscending + YValues.DateTime = False + YValues.Name = 'Y' + YValues.Multiplier = 1.000000000000000000 + YValues.Order = loNone + end + end + object Tollbar: TPanel + Left = 0 + Top = 0 + Width = 806 + Height = 66 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object Label1: TLabel + Left = 352 + Top = 37 + Width = 83 + Height = 13 + Caption = 'Fetch Block Size:' + Layout = tlCenter + end + object lbSDAC: TLabel + Left = 27 + Top = 50 + Width = 8 + Height = 13 + Caption = '0' + Font.Charset = DEFAULT_CHARSET + Font.Color = clRed + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + end + object lbBDE: TLabel + Left = 87 + Top = 50 + Width = 8 + Height = 13 + Caption = '0' + Font.Charset = DEFAULT_CHARSET + Font.Color = clGreen + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + end + object lbADO: TLabel + Left = 139 + Top = 50 + Width = 8 + Height = 13 + Caption = '0' + Font.Charset = DEFAULT_CHARSET + Font.Color = clYellow + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + end + object lbdbExpress: TLabel + Left = 191 + Top = 50 + Width = 8 + Height = 13 + Caption = '0' + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlue + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + end + object Bevel1: TBevel + Left = 154 + Top = 0 + Width = 2 + Height = 25 + end + object Bevel2: TBevel + Left = 639 + Top = 0 + Width = 2 + Height = 25 + end + object Bevel3: TBevel + Left = 0 + Top = 24 + Width = 800 + Height = 2 + end + object Bevel4: TBevel + Left = 0 + Top = 64 + Width = 800 + Height = 2 + end + object Bevel5: TBevel + Left = 334 + Top = 26 + Width = 2 + Height = 39 + end + object lbdbExpSda: TLabel + Left = 263 + Top = 50 + Width = 8 + Height = 13 + Caption = '0' + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clFuchsia + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentColor = False + ParentFont = False + end + object btFetchTest: TButton + Left = 160 + Top = 0 + Width = 75 + Height = 25 + Caption = 'Fetch Test' + TabOrder = 0 + OnClick = btFetchTestClick + end + object btConnect: TButton + Left = 0 + Top = 0 + Width = 75 + Height = 25 + Caption = 'Connect' + TabOrder = 1 + OnClick = btConnectClick + end + object btDisconnect: TButton + Left = 75 + Top = 0 + Width = 75 + Height = 25 + Caption = 'Disconnect' + TabOrder = 2 + OnClick = btDisconnectClick + end + object btMasterDetailTest: TButton + Left = 235 + Top = 0 + Width = 80 + Height = 25 + Caption = 'Master/Detail ' + TabOrder = 3 + OnClick = btMasterDetailTestClick + end + object btSPCallTest: TButton + Left = 315 + Top = 0 + Width = 80 + Height = 25 + Caption = 'StoredProc Call' + TabOrder = 4 + OnClick = btSPCallTestClick + end + object cbSDAC: TCheckBox + Left = 8 + Top = 29 + Width = 57 + Height = 17 + Caption = 'SDAC' + Checked = True + State = cbChecked + TabOrder = 5 + end + object cbBDE: TCheckBox + Left = 68 + Top = 29 + Width = 49 + Height = 17 + Caption = 'BDE' + Checked = True + State = cbChecked + TabOrder = 6 + end + object cbADO: TCheckBox + Left = 120 + Top = 29 + Width = 49 + Height = 17 + Caption = 'ADO' + Checked = True + State = cbChecked + TabOrder = 7 + end + object edFetchRows: TEdit + Left = 438 + Top = 35 + Width = 70 + Height = 21 + Hint = 'FetchRows for SDAC, ROWSET SIZE for BDE, ADO always uses 64' + ParentShowHint = False + ShowHint = True + TabOrder = 8 + Text = 'edFetchRows' + OnExit = edFetchRowsExit + end + object btCreate: TButton + Left = 645 + Top = 0 + Width = 73 + Height = 25 + Caption = 'Create' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + TabOrder = 9 + OnClick = btCreateClick + end + object btDrop: TButton + Left = 718 + Top = 0 + Width = 73 + Height = 25 + Caption = 'Drop' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + TabOrder = 10 + OnClick = btDropClick + end + object cbMark: TCheckBox + Left = 664 + Top = 37 + Width = 48 + Height = 17 + Caption = 'Marks' + Checked = True + State = cbChecked + TabOrder = 11 + OnClick = cbMarkClick + end + object cbdbExpress: TCheckBox + Left = 172 + Top = 29 + Width = 73 + Height = 17 + Caption = 'dbExpress' + TabOrder = 12 + end + object btnMultiExecuting: TButton + Left = 395 + Top = 0 + Width = 80 + Height = 25 + Caption = 'Multi Executing' + TabOrder = 13 + OnClick = btnMultiExecutingClick + end + object btnInsertPost: TButton + Left = 475 + Top = 0 + Width = 80 + Height = 25 + Caption = 'Insert/Post' + TabOrder = 14 + OnClick = btnInsertPostClick + end + object cbResultLog: TCheckBox + Left = 716 + Top = 37 + Width = 75 + Height = 17 + Caption = 'Result Log' + Checked = True + State = cbChecked + TabOrder = 15 + OnClick = cbResultLogClick + end + object cbdbExpSda: TCheckBox + Left = 244 + Top = 29 + Width = 73 + Height = 17 + Caption = 'dbExpSda' + Checked = True + State = cbChecked + TabOrder = 16 + end + object btEditPost: TButton + Left = 555 + Top = 0 + Width = 81 + Height = 25 + Caption = 'Edit/Post' + TabOrder = 17 + OnClick = btEditPostClick + end + end + object meResult: TMemo + Left = 634 + Top = 66 + Width = 172 + Height = 507 + Align = alRight + ScrollBars = ssVertical + TabOrder = 2 + end + object MSConnection: TMSConnection + Database = 'SDACDemos' + Username = 'Sa' + Left = 72 + Top = 112 + end + object MSQuery: TMSQuery + Connection = MSConnection + FetchRows = 64 + Left = 104 + Top = 112 + end + object scCreate: TMSSQL + Connection = MSConnection + SQL.Strings = ( + 'CREATE TABLE Master (' + ' Code INT,' + ' Field1 VARCHAR(100),' + ' Field2 VARCHAR(100),' + ' Field3 VARCHAR(100)' + ');' + '' + 'CREATE TABLE Detail (' + ' Code INT,' + ' Master INT,' + ' Field1 VARCHAR(100),' + ' Field2 VARCHAR(100)' + ');' + '' + 'CREATE TABLE Loaded (' + ' Code INT,' + ' Field1 VARCHAR(100),' + ' Field2 VARCHAR(100),' + ' Field3 VARCHAR(100),' + ' Field4 VARCHAR(100),' + ' Field5 VARCHAR(100)' + ');' + '' + 'declare' + ' @i INTEGER;' + 'begin' + ' SET @i = 0' + ' WHILE @i < 1000' + ' BEGIN' + ' SET @i = @i + 1' + ' INSERT INTO Master (' + ' Code,' + ' Field1,' + ' Field2,' + ' Field3)' + ' VALUES (' + ' @i,' + ' '#39'01234567890123456789'#39',' + ' '#39'12345678901234567890'#39',' + ' '#39'23456789012345678901'#39');' + ' END;' + '' + ' SET @i = 0' + ' WHILE @i < 100000 ' + ' BEGIN' + ' SET @i = @i + 1' + ' INSERT INTO Detail (' + ' Code,' + ' Master,' + ' Field1,' + ' Field2)' + ' VALUES (' + ' @i,' + ' @i % 1000 + 1,' + ' '#39'01234567890123456789'#39',' + ' '#39'12345678901234567890'#39');' + ' END;' + 'end;' + '' + '' + 'CREATE INDEX Detail_IND ON Detail (Master);') + Debug = True + CommandTimeout = 0 + Left = 648 + Top = 80 + end + object scDrop: TMSSQL + Connection = MSConnection + SQL.Strings = ( + + 'if exists (SELECT * FROM dbo.sysobjects WHERE id = object_id('#39'Ma' + + 'ster_Insert'#39'))' + 'DROP PROCEDURE Master_Insert' + '' + + 'if exists (SELECT * FROM dbo.sysobjects WHERE id = object_id('#39'De' + + 'tail'#39'))' + 'DROP TABLE Detail;' + '' + + 'if exists (SELECT * FROM dbo.sysobjects WHERE id = object_id('#39'Ma' + + 'ster'#39'))' + 'DROP TABLE Master;' + '' + + 'if exists (SELECT * FROM dbo.sysobjects WHERE id = object_id('#39'Lo' + + 'aded'#39'))' + 'DROP TABLE Loaded;') + Debug = True + CommandTimeout = 0 + Left = 680 + Top = 80 + end + object Database: TDatabase + DatabaseName = 'db' + DriverName = 'MSSQL' + LoginPrompt = False + Params.Strings = ( + 'USER NAME=Sa' + 'PASSWORD=' + 'SERVER NAME=ORA' + 'ROWSET SIZE=64') + SessionName = 'Default' + Left = 168 + Top = 112 + end + object BDEQuery: TQuery + DatabaseName = 'db' + Left = 200 + Top = 112 + end + object ADOConnection: TADOConnection + LoginPrompt = False + Provider = 'SQLOLEDB' + Left = 264 + Top = 112 + end + object ADOQuery: TADOQuery + CacheSize = 64 + Connection = ADOConnection + Parameters = <> + Left = 296 + Top = 112 + end + object MSQuery1: TMSQuery + Connection = MSConnection + FetchRows = 64 + Left = 104 + Top = 144 + end + object BDEQuery1: TQuery + DatabaseName = 'db' + Left = 200 + Top = 144 + end + object ADOQuery1: TADOQuery + Connection = ADOConnection + Parameters = <> + Left = 296 + Top = 144 + end + object ADOStoredProc: TADOStoredProc + Connection = ADOConnection + Parameters = <> + Left = 328 + Top = 144 + end + object MSStoredProc: TMSStoredProc + Connection = MSConnection + Left = 136 + Top = 144 + end + object BDEStoredProc: TStoredProc + DatabaseName = 'db' + Left = 232 + Top = 144 + end + object MSSQL: TMSSQL + Connection = MSConnection + CommandTimeout = 0 + Left = 136 + Top = 176 + end + object BorlandSQLConnection: TSQLConnection + ConnectionName = 'MSSQLConnection' + DriverName = 'MSSQL' + GetDriverFunc = 'getSQLDriverMSSQL' + LibraryName = 'dbexpmss.dll' + LoginPrompt = False + Params.Strings = ( + 'DriverName=MSSQL' + 'HostName=ServerName' + 'DataBase=Database Name' + 'User_Name=user' + 'Password=password' + 'BlobSize=-1' + 'LocaleCode=0000' + 'MSSQL TransIsolation=ReadCommited' + 'OS Authentication=False') + VendorLib = 'oledb' + Left = 360 + Top = 112 + end + object BorlandSQLQuery: TSQLQuery + MaxBlobSize = -1 + Params = <> + SQLConnection = BorlandSQLConnection + Left = 392 + Top = 112 + end + object BorlandSQLQuery1: TSQLQuery + MaxBlobSize = -1 + Params = <> + SQLConnection = BorlandSQLConnection + Left = 392 + Top = 144 + end + object BorlandSQLStoredProc: TSQLStoredProc + MaxBlobSize = -1 + Params = <> + SQLConnection = BorlandSQLConnection + Left = 424 + Top = 144 + end + object MSTable: TMSTable + Connection = MSConnection + Left = 136 + Top = 112 + end + object BDETable: TTable + DatabaseName = 'db' + SessionName = 'Default' + Left = 232 + Top = 112 + end + object ADOTable: TADOTable + Connection = ADOConnection + Left = 328 + Top = 112 + end + object DataSetProvider1: TDataSetProvider + DataSet = BorlandSQLTable + Left = 456 + Top = 144 + end + object BorlandClientDataSet: TClientDataSet + Aggregates = <> + Params = <> + ProviderName = 'DataSetProvider1' + Left = 456 + Top = 176 + end + object BorlandSQLTable: TSQLTable + MaxBlobSize = -1 + SQLConnection = BorlandSQLConnection + Left = 424 + Top = 176 + end + object CrLabSQLConnection: TSQLConnection + ConnectionName = 'SQLServerConnection' + DriverName = 'SQLServer' + GetDriverFunc = 'getSQLDriverSQLServer' + LibraryName = 'dbexpsda.dll' + LoginPrompt = False + Params.Strings = ( + 'BlobSize=-1' + 'HostName=Core' + 'DataBase=Northwind' + 'DriverName=SQLServer' + 'User_Name=sa' + 'Password=' + 'LongStrings=True' + 'EnableBCD=True' + 'FetchAll=True') + VendorLib = 'sqloledb.dll' + AfterConnect = CrLabSQLConnectionAfterConnect + Left = 360 + Top = 240 + end + object CrLabSQLQuery: TSQLQuery + MaxBlobSize = -1 + Params = <> + SQLConnection = CrLabSQLConnection + Left = 392 + Top = 240 + end + object CrLabSQLQuery1: TSQLQuery + MaxBlobSize = -1 + Params = <> + SQLConnection = CrLabSQLConnection + Left = 392 + Top = 272 + end + object CrLabSQLTable: TSQLTable + MaxBlobSize = -1 + SQLConnection = CrLabSQLConnection + Left = 424 + Top = 304 + end + object CrLabClientDataSet: TClientDataSet + Aggregates = <> + Params = <> + ProviderName = 'DataSetProvider2' + Left = 456 + Top = 304 + end + object DataSetProvider2: TDataSetProvider + DataSet = CrLabSQLTable + Left = 456 + Top = 272 + end + object CrLabSQLStoredProc: TSQLStoredProc + MaxBlobSize = -1 + Params = <> + SQLConnection = CrLabSQLConnection + Left = 424 + Top = 272 + end + object scCreate2: TMSSQL + Connection = MSConnection + SQL.Strings = ( + 'CREATE PROCEDURE Master_Insert ' + ' @p_Code INT,' + ' @p_Field1 VARCHAR(100),' + ' @p_Field2 VARCHAR(100),' + ' @p_Field3 VARCHAR(100)' + 'AS' + 'begin' + ' INSERT INTO Master (' + ' Code,' + ' Field1,' + ' Field2,' + ' Field3)' + ' VALUES (' + ' @p_Code,' + ' @p_Field1,' + ' @p_Field2,' + ' @p_Field3);' + 'end;') + Debug = True + CommandTimeout = 0 + Left = 648 + Top = 112 + end + object MSTable1: TMSTable + Connection = MSConnection + Left = 545 + Top = 186 + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Performance/Main.pas b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Performance/Main.pas new file mode 100644 index 0000000..935c134 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Performance/Main.pas @@ -0,0 +1,1171 @@ +unit Main; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, + Dialogs, ExtCtrls, Chart, StdCtrls, TeEngine, TeeProcs, Debug, Series, + MemDS, DBAccess, MSAccess, OLEDBAccess, OLEDBC, SdacVcl, + Db, DBTables, ADODB, DBXpress, SqlExpr, FMTBcd, DBClient, Provider; + +type + TfmMain = class(TForm) + MSConnection: TMSConnection; + MSQuery: TMSQuery; + scCreate: TMSSQL; + scDrop: TMSSQL; + Chart: TChart; + Tollbar: TPanel; + btFetchTest: TButton; + meResult: TMemo; + btConnect: TButton; + btDisconnect: TButton; + Database: TDatabase; + BDEQuery: TQuery; + btMasterDetailTest: TButton; + btSPCallTest: TButton; + cbSDAC: TCheckBox; + cbBDE: TCheckBox; + cbADO: TCheckBox; + edFetchRows: TEdit; + Label1: TLabel; + btCreate: TButton; + btDrop: TButton; + ADOConnection: TADOConnection; + ADOQuery: TADOQuery; + cbMark: TCheckBox; + MSQuery1: TMSQuery; + BDEQuery1: TQuery; + ADOQuery1: TADOQuery; + ADOStoredProc: TADOStoredProc; + MSStoredProc: TMSStoredProc; + BDEStoredProc: TStoredProc; + lbSDAC: TLabel; + lbBDE: TLabel; + lbADO: TLabel; + MSSQL: TMSSQL; + cbdbExpress: TCheckBox; + lbdbExpress: TLabel; + BorlandSQLConnection: TSQLConnection; + BorlandSQLQuery: TSQLQuery; + BorlandSQLQuery1: TSQLQuery; + BorlandSQLStoredProc: TSQLStoredProc; + btnMultiExecuting: TButton; + Bevel1: TBevel; + Bevel2: TBevel; + btnInsertPost: TButton; + MSTable: TMSTable; + BDETable: TTable; + ADOTable: TADOTable; + Splitter1: TSplitter; + DataSetProvider1: TDataSetProvider; + BorlandClientDataSet: TClientDataSet; + BorlandSQLTable: TSQLTable; + Bevel3: TBevel; + cbResultLog: TCheckBox; + Bevel4: TBevel; + Bevel5: TBevel; + cbdbExpSda: TCheckBox; + lbdbExpSda: TLabel; + CrLabSQLConnection: TSQLConnection; + CrLabSQLQuery: TSQLQuery; + Series2: TLineSeries; + Series3: TLineSeries; + Series4: TLineSeries; + Series5: TLineSeries; + CrLabSQLQuery1: TSQLQuery; + CrLabSQLTable: TSQLTable; + CrLabClientDataSet: TClientDataSet; + DataSetProvider2: TDataSetProvider; + Series1: TLineSeries; + CrLabSQLStoredProc: TSQLStoredProc; + scCreate2: TMSSQL; + MSTable1: TMSTable; + btEditPost: TButton; + procedure btConnectClick(Sender: TObject); + procedure btDisconnectClick(Sender: TObject); + procedure btFetchTestClick(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure edFetchRowsExit(Sender: TObject); + procedure btCreateClick(Sender: TObject); + procedure btDropClick(Sender: TObject); + procedure cbMarkClick(Sender: TObject); + procedure btMasterDetailTestClick(Sender: TObject); + procedure btSPCallTestClick(Sender: TObject); + procedure btnMultiExecutingClick(Sender: TObject); + procedure FormDestroy(Sender: TObject); + procedure btnInsertPostClick(Sender: TObject); + procedure cbSetInternalNameClick(Sender: TObject); + procedure cbResultLogClick(Sender: TObject); + procedure CrLabSQLConnectionAfterConnect(Sender: TObject); + procedure cbPermitPrepareClick(Sender: TObject); + procedure btEditPostClick(Sender: TObject); + private + TickInfo: TTickInfo; + //LoadCount: integer; + + function FetchTest(DataSet:TDataSet; Recs:integer): integer; + function MasterDetailTest(Master: TDataSet; Detail: TDataSet; Recs: integer): integer; + function SPCallTest(StoredProc: TComponent; Count: integer): integer; + function MultiExecutingTest(Query: TComponent; Count: integer): integer; + function InsertPostTest(Table: TDataSet; Count: integer): integer; + function EditPostTest(Table: TDataSet; Count: integer): integer; + + procedure ExecSQL(const SQL: string); + + procedure CheckConnected; + procedure PrintResults; + + public + constructor Create(Owner:TComponent); override; + destructor Destroy; override; + end; + +var + fmMain: TfmMain; + +implementation + +uses + Variants; + +{$R *.DFM} + +constructor TfmMain.Create(Owner:TComponent); +begin + inherited; + + TickInfo := TTickInfo.Create; + Caption := 'MS SQL Data Access Demos - SDAC ' + SDACVersion + ' performance'; +end; + +destructor TfmMain.Destroy; +begin + TickInfo.Free; + + inherited; +end; + +function TfmMain.FetchTest(DataSet:TDataSet; Recs:integer):integer; +var + i: integer; + OpenTime: integer; + FetchTime: integer; + SQL: string; +begin + SQL := 'SELECT * FROM Detail WHERE Code <= :Recs'; + + if DataSet is TMSQuery then begin + meResult.Lines.Add('> SDAC'); + TMSQuery(DataSet).SQL.Text := SQL; + TMSQuery(DataSet).ParamByName('Recs').AsInteger := Recs + end + else + if DataSet is TQuery then begin + meResult.Lines.Add('> BDE'); + TQuery(DataSet).SQL.Text := SQL; + TQuery(DataSet).ParamByName('Recs').AsInteger := Recs; + end + else + if DataSet is TADOQuery then begin + meResult.Lines.Add('> ADO'); + TADOQuery(DataSet).SQL.Text := SQL; + TADOQuery(DataSet).Parameters.ParamByName('Recs').Value := Recs; + end else + if DataSet is TSQLQuery then begin + meResult.Lines.Add('> dbExpress'); + TSQLQuery(DataSet).SQL.Text := SQL; + TSQLQuery(DataSet).ParamByName('Recs').DataType := ftString; + TSQLQuery(DataSet).ParamByName('Recs').Value := Recs; + end; + + TickInfo.Start; + DataSet.Open; + OpenTime := TickInfo.GetInterval; + meResult.Lines.Add('Opened in ' + IntervalToStr(OpenTime)); + + TickInfo.Start; + + i := 0; + while not DataSet.EOF do begin + Inc(i); + DataSet.Next; + end; + FetchTime := TickInfo.GetInterval; + meResult.Lines.Add('Fetched ' + IntToStr(i) + ' recs in ' + IntervalToStr(FetchTime)); + DataSet.Close; + + Result := OpenTime + FetchTime; +end; + +function TfmMain.MasterDetailTest(Master: TDataSet; Detail: TDataSet; Recs: integer):integer; +var + i, j: integer; + FetchTime: integer; + SQL,SQL1: string; +begin + SQL := 'SELECT * FROM Master WHERE Code <= :Recs'; //RowNum + SQL1 := 'SELECT * FROM Detail WHERE Master = :Code'; + if Master is TMSQuery then begin + meResult.Lines.Add('> SDAC'); + TMSQuery(Master).SQL.Text := SQL; + TMSQuery(Detail).SQL.Text := SQL1; + TMSQuery(Detail).Options.LocalMasterDetail := true; + TMSQuery(Master).ParamByName('Recs').AsInteger := Recs + end + else + if Master is TQuery then begin + meResult.Lines.Add('> BDE'); + TQuery(Master).SQL.Text := SQL; + TQuery(Detail).SQL.Text := SQL1; + TQuery(Master).ParamByName('Recs').AsInteger := Recs; + end + else + if Master is TADOQuery then begin + meResult.Lines.Add('> ADO'); + TADOQuery(Master).SQL.Text := SQL; + TADOQuery(Detail).SQL.Text := SQL1; + TADOQuery(Master).Parameters.ParamByName('Recs').Value := Recs; + end else + if Master is TSQLQuery then begin + meResult.Lines.Add('> dbExpress'); + TSQLQuery(Master).SQL.Text := SQL; + TSQLQuery(Detail).SQL.Text := SQL1; + TSQLQuery(Master).ParamByName('Recs').DataType := ftString; + TSQLQuery(Master).ParamByName('Recs').Value := Recs; + end; + + TickInfo.Start; + Master.Open; + + if Detail is TMSQuery then + TMSQuery(Detail).Prepare + else + if Detail is TQuery then + TQuery(Detail).Prepare + else + if Detail is TADOQuery then + TADOQuery(Detail).Prepared := True + else + if Detail is TSQLQuery then begin + TSQLQuery(Detail).Prepared := True; + TSQLQuery(Detail).ParamByName('Code').DataType := ftInteger; + end; + + i := 0; + j := 0; + while not Master.EOF do begin + if Detail is TMSQuery then + TMSQuery(Detail).ParamByName('Code').AsInteger := Master.FieldByName('Code').AsInteger + else + if Detail is TQuery then + TQuery(Detail).ParamByName('Code').AsInteger := Master.FieldByName('Code').AsInteger + else + if Detail is TADOQuery then + TADOQuery(Detail).Parameters.ParamByName('Code').Value := Master.FieldByName('Code').AsInteger + else + if Detail is TSQLQuery then + TSQLQuery(Detail).ParamByName('Code').Value := Master.FieldByName('Code').AsInteger; + + Detail.Open; + while not Detail.EOF do begin + Inc(j); + Detail.Next; + end; + Detail.Close; + + Inc(i); + Master.Next; + end; + FetchTime := TickInfo.GetInterval; + meResult.Lines.Add('Fetched ' + IntToStr(i) + ' master recs, ' + + IntToStr(j) + ' detail recs in ' + IntervalToStr(FetchTime)); + + if Detail is TMSQuery then + TMSQuery(Detail).UnPrepare + else + if Detail is TQuery then + TQuery(Detail).UnPrepare + else + if Detail is TADOQuery then + TADOQuery(Detail).Prepared := False + else + if Detail is TSQLQuery then + TSQLQuery(Detail).Prepared := False; + + Master.Close; + + Result := FetchTime; +end; + +procedure TMSSQLExecute(Query: TComponent); +begin + TMSSQL(Query).Execute; +end; + +procedure TQueryExecSQL(Query: TComponent); +begin + TQuery(Query).ExecSQL; +end; + +procedure TADOQueryExecSQL(Query: TComponent); +begin + TADOQuery(Query).ExecSQL; +end; + +procedure TSQLQueryExecSQL(Query: TComponent); +begin + TSQLQuery(Query).ExecSQL; +end; + +type + TExecSQLProc = procedure (Query: TComponent); + +function TfmMain.MultiExecutingTest(Query: TComponent; Count: integer): integer; +var + i:integer; + ExecTime:integer; + SQL: string; + ExecSQLProc: TExecSQLProc; +begin + SQL := 'DECLARE @a INT'; + + ExecSQLProc := nil; + if Query is TMSSQL then begin + meResult.Lines.Add('> SDAC'); + TMSSQL(Query).SQL.Text := SQL; + TMSSQL(Query).Prepared := True; + ExecSQLProc := TMSSQLExecute; + end + else + if Query is TQuery then begin + meResult.Lines.Add('> BDE'); + TQuery(Query).SQL.Text := SQL; + TQuery(Query).Prepared := True; + ExecSQLProc := TQueryExecSQL; + end + else + if Query is TADOQuery then begin + meResult.Lines.Add('> ADO'); + TADOQuery(Query).SQL.Text := SQL; + TADOQuery(Query).Prepared := True; + ExecSQLProc := TADOQueryExecSQL; + end else + if Query is TSQLQuery then begin + meResult.Lines.Add('> dbExpress'); + TSQLQuery(Query).SQL.Text := SQL; + TSQLQuery(Query).Prepared := True; + ExecSQLProc := TSQLQueryExecSQL; + end; + + TickInfo.Start; + + for i := 1 to Count do + ExecSQLProc(Query); + + ExecTime := TickInfo.GetInterval; + meResult.Lines.Add('Executed ' + IntToStr(Count) + ' count ' + IntervalToStr(ExecTime)); + + Result := ExecTime; +end; + +function TfmMain.InsertPostTest(Table: TDataSet; Count: integer): integer; +var + i:integer; + ExecTime:integer; + TableName: string; +begin + TableName := 'DETAIL'; + ExecSQL('TRUNCATE TABLE ' + TableName); + + if Table is TMSTable then begin + meResult.Lines.Add('> SDAC'); + TMSTable(Table).TableName := TableName; + + // ~10% performance + TMSTable(Table).SQLInsert.Text := 'INSERT INTO DETAIL (Code, Master, Field1, Field2) VALUES (:Code, :Master, :Field1, :Field2)'; + end + else + if Table is TTable then begin + meResult.Lines.Add('> BDE'); + TTable(Table).TableName := TableName; + end + else + if Table is TADOTable then begin + meResult.Lines.Add('> ADO'); + TADOTable(Table).TableName := TableName; + end else + if Table = BorlandClientDataSet then begin + meResult.Lines.Add('> dbExpress'); + BorlandSQLTable.TableName := TableName; + end else + if Table = CrLabClientDataSet then begin + meResult.Lines.Add('> dbExpSda'); + CrLabSQLTable.TableName := TableName; + end; + + Table.Open; + + TickInfo.Start; + + for i := 1 to Count do begin + Table.Insert; + Table.FieldByName('CODE').Value := i; + Table.FieldByName('Field1').AsString := '01234567890123456789'; + Table.FieldByName('Field2').AsString := '12345678901234567890'; + Table.Post; + end; + + if Table = BorlandClientDataSet then + BorlandClientDataSet.ApplyUpdates(0); + if Table = CrLabClientDataSet then + CrLabClientDataSet.ApplyUpdates(0); + + ExecTime := TickInfo.GetInterval; + Table.Close; + meResult.Lines.Add('Inserted ' + IntToStr(Count) + ' records ' + IntervalToStr(ExecTime)); + + Result := ExecTime; +end; + +procedure TfmMain.ExecSQL(const SQL: string); +var + MSSQL: TMSSQL; +begin + MSSQL := TMSSQL.Create(nil); + try + MSSQL.Connection := MSConnection; + MSSQL.SQL.Text := SQL; + MSSQL.Execute; + finally + MSSQL.Free; + end; +end; + +function TfmMain.SPCallTest(StoredProc: TComponent; Count: integer):integer; +var + i:integer; + ExecTime:integer; +begin + if StoredProc is TMSStoredProc then + meResult.Lines.Add('> SDAC') + else + if StoredProc is TStoredProc then + meResult.Lines.Add('> BDE') + else + if StoredProc is TADOStoredProc then + meResult.Lines.Add('> ADO'); + if StoredProc is TSQLStoredProc then + meResult.Lines.Add('> dbExpress'); + + TickInfo.Start; + for i := 1 to Count do begin + if StoredProc is TMSStoredProc then begin + with TMSStoredProc(StoredProc) do begin + if i = 1 then begin + StoredProcName := 'Master_Insert'; + Prepare; + end; + + ParamByName('p_Code').AsInteger := i; + ParamByName('p_Field1').AsString := '01234567890123456789'; + ParamByName('p_Field2').AsString := '12345678901234567890'; + ParamByName('p_Field3').AsString := '23456789012345678901'; + + Execute; + end; + end + else + if StoredProc is TStoredProc then begin + with TStoredProc(StoredProc) do begin + if i = 1 then begin + StoredProcName := 'MASTER_INSERT'; + Params.Clear; + with TParam(Params.Add) do begin + Name := '@p_Code'; + ParamType := ptInput; + DataType := ftInteger; + end; + + with TParam(Params.Add) do begin + Name := '@p_Field1'; + ParamType := ptInput; + DataType := ftString; + end; + + with TParam(Params.Add) do begin + Name := '@p_Field2'; + ParamType := ptInput; + DataType := ftString; + end; + + with TParam(Params.Add) do begin + Name := '@p_Field3'; + ParamType := ptInput; + DataType := ftString; + end; + Prepare; + end; + + ParamByName('@p_Code').AsInteger := i; + ParamByName('@p_Field1').AsString := '01234567890123456789'; + ParamByName('@p_Field2').AsString := '12345678901234567890'; + ParamByName('@p_Field3').AsString := '23456789012345678901'; + + ExecProc; + end; + end + else + if StoredProc is TADOStoredProc then begin + with TADOStoredProc(StoredProc) do begin + if i = 1 then begin + ProcedureName := 'MASTER_INSERT'; + Parameters.Refresh; + end; + Parameters.ParamByName('@p_Code').Value := i; + Parameters.ParamByName('@p_Field1').Value := '01234567890123456789'; + Parameters.ParamByName('@p_Field2').Value := '12345678901234567890'; + Parameters.ParamByName('@p_Field3').Value := '23456789012345678901'; + + ExecProc; + end; + end else + if StoredProc is TSQLStoredProc then begin + with TSQLStoredProc(StoredProc) do begin + if i = 1 then begin + StoredProcName := 'MASTER_INSERT'; + Prepared := True; + end; + + if StoredProc = BorlandSQLStoredProc then begin + Params.ParamValues['@p_Code'] := i; + Params.ParamValues['@p_Field1'] := '01234567890123456789'; + Params.ParamValues['@p_Field2'] := '12345678901234567890'; + Params.ParamValues['@p_Field3'] := '23456789012345678901'; + end + else + begin + Params.ParamValues['p_Code'] := i; + Params.ParamValues['p_Field1'] := '01234567890123456789'; + Params.ParamValues['p_Field2'] := '12345678901234567890'; + Params.ParamValues['p_Field3'] := '23456789012345678901'; + end; + ExecProc; +// Prepared := false; + end; + end + end; + + ExecTime := TickInfo.GetInterval; + meResult.Lines.Add('Executed ' + IntToStr(Count) + ' times in ' + IntervalToStr(ExecTime)); + + Result := ExecTime; +end; + +procedure TfmMain.FormShow(Sender: TObject); +begin + edFetchRows.Text := IntToStr(MSQuery.FetchRows); +end; + +procedure TfmMain.CheckConnected; +begin + if (not MSConnection.Connected) or + (cbBDE.Checked and not Database.Connected) or + (cbADO.Checked and not ADOConnection.Connected) or + (cbdbExpress.Checked and not BorlandSQLConnection.Connected) or + (cbdbExpSda.Checked and not CrLabSQLConnection.Connected) then + raise Exception.Create('You must connect first!'); +end; + +procedure TfmMain.PrintResults; + procedure Process(CheckBox: TCheckBox; Res: string); + begin + if CheckBox.Checked then + meResult.Lines.Add(CheckBox.Caption + ' ' + Res); + end; + +begin + meResult.Lines.Add('---------------'); + Process(cbSDAC, lbSDAC.Caption); + Process(cbBDE, lbBDE.Caption); + Process(cbADO, lbADO.Caption); + Process(cbdbExpress, lbdbExpress.Caption); + Process(cbdbExpSda, lbdbExpSda.Caption); + meResult.Lines.Add('==============='); +end; + +procedure TfmMain.btConnectClick(Sender: TObject); +begin + edFetchRowsExit(nil); + + if not MSConnection.Connected then begin + MSConnection.Connect; + meResult.Lines.Add('SDAC connected'); + end; + + if cbBDE.Checked and not Database.Connected then begin + Database.Params.Values['USER NAME'] := MSConnection.UserName; + Database.Params.Values['PASSWORD'] := MSConnection.Password; + Database.Params.Values['SERVER NAME'] := MSConnection.Server; + Database.Params.Values['DATABASE NAME'] := MSConnection.Database; + Database.Open; + meResult.Lines.Add('BDE connected'); + end; + + if cbADO.Checked and not ADOConnection.Connected then begin + ADOConnection.ConnectionString := MSConnection.ConnectString; + ADOConnection.Open; + meResult.Lines.Add('ADO connected'); + end; + + if cbdbExpress.Checked and not BorlandSQLConnection.Connected then begin + BorlandSQLConnection.Params.Values['User_Name'] := MSConnection.UserName; + BorlandSQLConnection.Params.Values['Password'] := MSConnection.Password; + BorlandSQLConnection.Params.Values['HostName'] := MSConnection.Server; + BorlandSQLConnection.Params.Values['DataBase'] := MSConnection.Database; + + BorlandSQLConnection.Connected := True; + meResult.Lines.Add('dbExpress connected'); + end; + + if cbdbExpSda.Checked and not CrLabSQLConnection.Connected then begin + CrLabSQLConnection.Params.Values['User_Name'] := MSConnection.UserName; + CrLabSQLConnection.Params.Values['Password'] := MSConnection.Password; + CrLabSQLConnection.Params.Values['HostName'] := MSConnection.Server; + CrLabSQLConnection.Params.Values['DataBase'] := MSConnection.Database; + + CrLabSQLConnection.Connected := True; + meResult.Lines.Add('dbExpSda connected'); + end; +end; + +procedure TfmMain.btDisconnectClick(Sender: TObject); +begin + MSConnection.Disconnect; + BorlandSQLConnection.Connected := false; + CrLabSQLConnection.Connected := false; + ADOConnection.Close; + Database.Close; + meResult.Lines.Add('Disconected'); +end; + +procedure TfmMain.btFetchTestClick(Sender: TObject); +const + Step = 10000; +var + i: integer; + ResSDAC, ResBDE, ResADO, ResdbExp, ResdbExpSda: integer; + mBDE, mADO, mdbExp, mdbExpSda: double; +begin + CheckConnected; + + Chart.Title.Text.Text := 'Fetch Test'; + for i := 0 to Chart.SeriesCount - 1 do + Chart.Series[i].Clear; + Chart.BottomAxis.Minimum := 0; + Chart.BottomAxis.Maximum := 11 * Step; + mBDE := 0; + mADO := 0; + mdbExp := 0; + mdbExpSda := 0; + + for i := 1 to 10 do begin + ResSDAC := 0; + ResBDE := 0; + ResADO := 0; + ResdbExp := 0; + ResdbExpSda := 0; + + meResult.Lines.Add('---------------'); + // BDE + if cbBDE.Checked then begin + ResBDE := FetchTest(BDEQuery, i*Step); + Chart.Series[1].AddXY(i*Step, ResBDE/1000, '', clTeeColor); + end; + // SDAC + if cbSDAC.Checked then begin + ResSDAC := FetchTest(MSQuery, i*Step); + Chart.Series[0].AddXY(i*Step, ResSDAC/1000, '', clTeeColor); + end; + // ADO + if cbADO.Checked then begin + ResADO := FetchTest(ADOQuery, i*Step); + Chart.Series[2].AddXY(i*Step, ResADO/1000, '', clTeeColor); + end; + // dbExpress + if cbdbExpress.Checked then begin + ResdbExp := FetchTest(BorlandSQLQuery, i*Step); + Chart.Series[3].AddXY(i*Step, ResdbExp/1000, '', clTeeColor); + end; + // dbExpSda + if cbdbExpSda.Checked then begin + ResdbExpSda := FetchTest(CrLabSQLQuery, i*Step); + Chart.Series[4].AddXY(i*Step, ResdbExpSda/1000, '', clTeeColor); + end; + + if ResSDAC > 0 then begin + mBDE := ((i - 1)*mBDE + ResBDE/ResSDAC)/i; + mADO := ((i - 1)*mADO + ResADO/ResSDAC)/i; + mdbExp := ((i - 1)*mdbExp + ResdbExp/ResSDAC)/i; + mdbExpSda := ((i - 1)*mdbExpSda + ResdbExpSda/ResSDAC)/i; + lbSDAC.Caption := FloatToStrF(1, ffGeneral, 5, 3); + lbBDE.Caption := FloatToStrF(mBDE, ffGeneral, 5, 3); + lbADO.Caption := FloatToStrF(mADO, ffGeneral, 5, 3); + lbdbExpress.Caption := FloatToStrF(mdbExp, ffGeneral, 5, 3); + lbdbExpSda.Caption := FloatToStrF(mdbExpSda, ffGeneral, 5, 3); + lbBDE.Update; + lbADO.Update; + lbdbExpress.Update; + lbdbExpSda.Update; + end; + + Chart.Update; + end; + PrintResults; +end; + +procedure TfmMain.btMasterDetailTestClick(Sender: TObject); +var + i:integer; + ResSDAC, ResBDE, ResADO, ResdbExp, ResdbExpSda: integer; + mBDE, mADO, mdbExp, mdbExpSda: double; +begin + CheckConnected; + + Chart.Title.Text.Text := 'Master/Detail Test'; + for i := 0 to Chart.SeriesCount - 1 do + Chart.Series[i].Clear; + Chart.BottomAxis.Minimum := 0; + Chart.BottomAxis.Maximum := 110; + + mBDE := 0; + mADO := 0; + mdbExp := 0; + mdbExpSda := 0; + for i := 1 to 10 do begin + ResSDAC := 0; + ResBDE := 0; + ResADO := 0; + ResdbExp := 0; + ResdbExpSda := 0; + + meResult.Lines.Add('---------------'); + // SDAC + if cbSDAC.Checked then begin + ResSDAC := MasterDetailTest(MSQuery, MSQuery1, i*10); + Chart.Series[0].AddXY(i*10, ResSDAC/1000, '', clTeeColor); + end; + // BDE + if cbBDE.Checked then begin + ResBDE := MasterDetailTest(BDEQuery, BDEQuery1, i*10); + Chart.Series[1].AddXY(i*10, ResBDE/1000, '', clTeeColor); + end; + // ADO + if cbADO.Checked then begin + ResADO := MasterDetailTest(ADOQuery, ADOQuery1, i*10); + Chart.Series[2].AddXY(i*10, ResADO/1000, '', clTeeColor); + end; + // dbExpress + if cbdbExpress.Checked then begin + ResdbExp := MasterDetailTest(BorlandSQLQuery, BorlandSQLQuery1, i*10); + Chart.Series[3].AddXY(i*10, ResdbExp/1000, '', clTeeColor); + end; + // dbExpSda + if cbdbExpSda.Checked then begin + ResdbExpSda := MasterDetailTest(CrLabSQLQuery, CrLabSQLQuery1, i*10); + Chart.Series[4].AddXY(i*10, ResdbExpSda/1000, '', clTeeColor); + end; + + if ResSDAC > 0 then begin + mBDE := ((i - 1)*mBDE + ResBDE/ResSDAC)/i; + mADO := ((i - 1)*mADO + ResADO/ResSDAC)/i; + mdbExp := ((i - 1)*mdbExp + ResdbExp/ResSDAC)/i; + mdbExpSda := ((i - 1)*mdbExpSda + ResdbExpSda/ResSDAC)/i; + lbSDAC.Caption := FloatToStrF(1, ffGeneral, 5, 3); + lbBDE.Caption := FloatToStrF(mBDE, ffGeneral, 5, 3); + lbADO.Caption := FloatToStrF(mADO, ffGeneral, 5, 3); + lbdbExpress.Caption := FloatToStrF(mdbExp, ffGeneral, 5, 3); + lbdbExpSda.Caption := FloatToStrF(mdbExpSda, ffGeneral, 5, 3); + lbBDE.Update; + lbADO.Update; + lbdbExpress.Update; + lbdbExpSda.Update; + end; + + Chart.Update; + end; + PrintResults; +end; + +procedure TfmMain.btSPCallTestClick(Sender: TObject); +var + i:integer; + ResSDAC, ResBDE, ResADO, ResdbExp, ResdbExpSda: integer; + mBDE, mADO, mdbExp, mdbExpSda: double; +const + Step = 10; +begin + CheckConnected; + + Chart.Title.Text.Text := 'StoredProc Call Test'; + for i := 0 to Chart.SeriesCount - 1 do + Chart.Series[i].Clear; + Chart.BottomAxis.Minimum := 0; + Chart.BottomAxis.Maximum := 11 * Step; + + mBDE := 0; + mADO := 0; + mdbExp := 0; + mdbExpSda := 0; + for i := 1 to 10 do begin + ResSDAC := 0; + ResBDE := 0; + ResADO := 0; + ResdbExp := 0; + ResdbExpSda := 0; + + meResult.Lines.Add('---------------'); + // SDAC + if cbSDAC.Checked then begin + ResSDAC := SPCallTest(MSStoredProc, i*Step); + Chart.Series[0].AddXY(i*Step, ResSDAC/(Step * 10), '', clTeeColor); + end; + // BDE + if cbBDE.Checked then begin + ResBDE := SPCallTest(BDEStoredProc, i*Step); + Chart.Series[1].AddXY(i*Step, ResBDE/(Step * 10), '', clTeeColor); + end; + // ADO + if cbADO.Checked then begin + ResADO := SPCallTest(ADOStoredProc, i*Step); + Chart.Series[2].AddXY(i*Step, ResADO/(Step * 10), '', clTeeColor); + end; + // dbExpress + if cbdbExpress.Checked then begin + ResdbExp := SPCallTest(BorlandSQLStoredProc, i*Step); + Chart.Series[3].AddXY(i*Step, ResdbExp/(Step * 10), '', clTeeColor); + end; + // dbExpSda + if cbdbExpSda.Checked then begin + ResdbExpSda := SPCallTest(CrLabSQLStoredProc, i*Step); + Chart.Series[4].AddXY(i*Step, ResdbExpSda/(Step * 10), '', clTeeColor); + end; + + if ResSDAC > 0 then begin + mBDE := ((i - 1)*mBDE + ResBDE/ResSDAC)/i; + mADO := ((i - 1)*mADO + ResADO/ResSDAC)/i; + mdbExp := ((i - 1)*mdbExp + ResdbExp/ResSDAC)/i; + mdbExpSda := ((i - 1)*mdbExpSda + ResdbExpSda/ResSDAC)/i; + lbSDAC.Caption := FloatToStrF(1, ffGeneral, 5, 3); + lbBDE.Caption := FloatToStrF(mBDE, ffGeneral, 5, 3); + lbADO.Caption := FloatToStrF(mADO, ffGeneral, 5, 3); + lbdbExpress.Caption := FloatToStrF(mdbExp, ffGeneral, 5, 3); + lbdbExpSda.Caption := FloatToStrF(mdbExpSda, ffGeneral, 5, 3); + lbBDE.Update; + lbADO.Update; + lbdbExpress.Update; + lbdbExpSda.Update; + end; + + Chart.Update; + end; + PrintResults; +end; + +procedure TfmMain.edFetchRowsExit(Sender: TObject); +var + Connected: boolean; +begin + try + MSQuery.FetchRows := StrToInt(edFetchRows.Text); + MSQuery1.FetchRows := StrToInt(edFetchRows.Text); + Connected := Database.Connected; + Database.Close; + Database.Params.Values['ROWSET SIZE'] := edFetchRows.Text; + if Connected then begin + Database.LoginPrompt := False; + Database.Open; + Database.LoginPrompt := True; + end; + ADOQuery.CacheSize := StrToInt(edFetchRows.Text); + ADOQuery1.CacheSize := StrToInt(edFetchRows.Text); + finally + edFetchRows.Text := IntToStr(MSQuery.FetchRows); + end; +end; + +procedure TfmMain.btCreateClick(Sender: TObject); +begin + scCreate.Execute; + scCreate2.Execute; +end; + +procedure TfmMain.btDropClick(Sender: TObject); +begin + scDrop.Execute; +end; + +procedure TfmMain.cbMarkClick(Sender: TObject); +var + i: integer; +begin + for i := 0 to Chart.SeriesCount - 1 do + Chart.Series[i].Marks.Visible := cbMark.Checked; +end; + +(* +procedure TfmMain.MSLoaderPutData(Sender: TMSLoader); +var + i: integer; +begin + for i := 1 to LoadCount do begin + Sender.PutColumnData(0, i, i); + Sender.PutColumnData(1, i, '01234567890123456789'); + end; +end;*) + +procedure TfmMain.btnMultiExecutingClick(Sender: TObject); +var + i:integer; + ResSDAC, ResBDE, ResADO, ResdbExp, ResdbExpSda: integer; + mBDE, mADO, mdbExp, mdbExpSda: double; +begin + CheckConnected; + + Chart.Title.Text.Text := 'MultiExecuting Test'; + for i := 0 to Chart.SeriesCount - 1 do + Chart.Series[i].Clear; + Chart.BottomAxis.Minimum := 0; + Chart.BottomAxis.Maximum := 1100; + + mBDE := 0; + mADO := 0; + mdbExp := 0; + mdbExpSda := 0; + for i := 1 to 10 do begin + ResSDAC := 0; + ResBDE := 0; + ResADO := 0; + ResdbExp := 0; + ResdbExpSda := 0; + + meResult.Lines.Add('---------------'); + // SDAC + if cbSDAC.Checked then begin + ResSDAC := MultiExecutingTest(MSSQL, i*100); + Chart.Series[0].AddXY(i*100, ResSDAC/1000, '', clTeeColor); + end; + // BDE + if cbBDE.Checked then begin + ResBDE := MultiExecutingTest(BDEQuery, i*100); + Chart.Series[1].AddXY(i*100, ResBDE/1000, '', clTeeColor); + end; + // ADO + if cbADO.Checked then begin + ResADO := MultiExecutingTest(ADOQuery, i*100); + Chart.Series[2].AddXY(i*100, ResADO/1000, '', clTeeColor); + end; + // dbExpress + if cbdbExpress.Checked then begin + ResdbExp := MultiExecutingTest(BorlandSQLQuery, i*100); + Chart.Series[3].AddXY(i*100, ResdbExp/1000, '', clTeeColor); + end; + // dbExpSda + if cbdbExpSda.Checked then begin + ResdbExpSda := MultiExecutingTest(CrLabSQLQuery, i*100); + Chart.Series[4].AddXY(i*100, ResdbExpSda/1000, '', clTeeColor); + end; + + if ResSDAC > 0 then begin + mBDE := ((i - 1)*mBDE + ResBDE/ResSDAC)/i; + mADO := ((i - 1)*mADO + ResADO/ResSDAC)/i; + mdbExp := ((i - 1)*mdbExp + ResdbExp/ResSDAC)/i; + mdbExpSda := ((i - 1)*mdbExpSda + ResdbExpSda/ResSDAC)/i; + lbSDAC.Caption := FloatToStrF(1, ffGeneral, 5, 3); + lbBDE.Caption := FloatToStrF(mBDE, ffGeneral, 5, 3); + lbADO.Caption := FloatToStrF(mADO, ffGeneral, 5, 3); + lbdbExpress.Caption := FloatToStrF(mdbExp, ffGeneral, 5, 3); + lbdbExpSda.Caption := FloatToStrF(mdbExpSda, ffGeneral, 5, 3); + lbBDE.Update; + lbADO.Update; + lbdbExpress.Update; + lbdbExpSda.Update; + end; + + Chart.Update; + end; + PrintResults; +end; + +procedure TfmMain.FormDestroy(Sender: TObject); +begin + btDisconnectClick(nil); +end; + +procedure TfmMain.btnInsertPostClick(Sender: TObject); +var + i: integer; + ResSDAC, ResBDE, ResADO, ResdbExp, ResdbExpSda: integer; + mBDE, mADO, mdbExp, mdbExpSda: double; +const + Step = 1000; +begin + CheckConnected; + + Chart.Title.Text.Text := 'Insert / Post Test'; + for i := 0 to Chart.SeriesCount - 1 do + Chart.Series[i].Clear; + Chart.BottomAxis.Minimum := 0; + Chart.BottomAxis.Maximum := 11 * Step; + + mBDE := 0; + mADO := 0; + mdbExp := 0; + mdbExpSda := 0; + for i := 1 to 10 do begin + ResSDAC := 0; + ResBDE := 0; + ResADO := 0; + ResdbExp := 0; + ResdbExpSda := 0; + + meResult.Lines.Add('---------------'); + // SDAC + if cbSDAC.Checked then begin + ResSDAC := InsertPostTest(MSTable, i*Step); + Chart.Series[0].AddXY(i*Step, ResSDAC, '', clTeeColor); + end; + // BDE + if cbBDE.Checked then begin + ResBDE := InsertPostTest(BDETable, i*Step); + Chart.Series[1].AddXY(i*Step, ResBDE, '', clTeeColor); + end; + // ADO + if cbADO.Checked then begin + ResADO := InsertPostTest(ADOTable, i*Step); + Chart.Series[2].AddXY(i*Step, ResADO, '', clTeeColor); + end; + // dbExpress + if cbdbExpress.Checked then begin + ResdbExp := InsertPostTest(BorlandClientDataSet, i*Step); + Chart.Series[3].AddXY(i*Step, ResdbExp, '', clTeeColor); + end; + // dbExpSda + if cbdbExpSda.Checked then begin + ResdbExpSda := InsertPostTest(CrLabClientDataSet, i*Step); + Chart.Series[4].AddXY(i*Step, ResdbExpSda, '', clTeeColor); + end; + + if ResSDAC > 0 then begin + mBDE := ((i - 1)*mBDE + ResBDE/ResSDAC)/i; + mADO := ((i - 1)*mADO + ResADO/ResSDAC)/i; + mdbExp := ((i - 1)*mdbExp + ResdbExp/ResSDAC)/i; + mdbExpSda := ((i - 1)*mdbExpSda + ResdbExpSda/ResSDAC)/i; + lbSDAC.Caption := FloatToStrF(1, ffGeneral, 5, 3); + lbBDE.Caption := FloatToStrF(mBDE, ffGeneral, 5, 3); + lbADO.Caption := FloatToStrF(mADO, ffGeneral, 5, 3); + lbdbExpress.Caption := FloatToStrF(mdbExp, ffGeneral, 5, 3); + lbdbExpSda.Caption := FloatToStrF(mdbExpSda, ffGeneral, 5, 3); + lbBDE.Update; + lbADO.Update; + lbdbExpress.Update; + lbdbExpSda.Update; + end; + + // Chart.Update; + end; + PrintResults; +end; + +procedure TfmMain.cbSetInternalNameClick(Sender: TObject); +var + AConnected: boolean; + ALoginPrompt: boolean; +begin + AConnected := MSConnection.Connected; + ALoginPrompt := MSConnection.LoginPrompt; + MSConnection.Connected := false; + MSConnection.LoginPrompt := false; + MSConnection.Connected := AConnected; + MSConnection.LoginPrompt := ALoginPrompt; +end; + +procedure TfmMain.cbResultLogClick(Sender: TObject); +begin + meResult.Visible := cbResultLog.Checked; + Splitter1.Visible := cbResultLog.Checked; +end; + +const + coFetchAll = TSQLConnectionOption(301); // boolean + coPermitPrepare = TSQLConnectionOption(104); + +procedure TfmMain.CrLabSQLConnectionAfterConnect(Sender: TObject); +begin + CrLabSQLConnection.SQLConnection.SetOption(coFetchAll, Integer(False)); + CrLabSQLConnection.SQLConnection.SetOption(coPermitPrepare, Integer(True)); +end; + +procedure TfmMain.cbPermitPrepareClick(Sender: TObject); +begin + CrLabSQLConnection.Close; +end; + + +function TfmMain.EditPostTest(Table: TDataSet; Count: integer): integer; +const + chrs: array [0..1] of char = ('a', 'b'); +var + i:integer; + ExecTime:integer; + TableName: string; +begin + TableName := 'DETAIL'; + + if Table is TMSTable then begin + meResult.Lines.Add('> SDAC'); + TMSTable(Table).TableName := TableName; + // ~10% performance + TMSTable(Table).SQLInsert.Text := 'INSERT INTO DETAIL (Code, Master, Field1, Field2) VALUES (:Code, :Master, :Field1, :Field2)'; + end; + Table.Open; + if Table.RecordCount = 0 then begin + MessageDlg('Record count in "DETAIL" table must be more than 0!', mtError, [mbOK], 0); + Abort; + end; + + TickInfo.Start; + + for i := 1 to Count do begin + Table.Edit; + Table.FieldByName('CODE').Value := i; + Table.FieldByName('Field1').AsString := '0123456789012345678' + chrs[i mod 2]; + Table.FieldByName('Field2').AsString := '1234567890123456789' + chrs[i mod 2]; + Table.Post; + end; + + if Table = CrLabClientDataSet then + CrLabClientDataSet.ApplyUpdates(0); + + ExecTime := TickInfo.GetInterval; + Table.Close; + meResult.Lines.Add('Edited ' + IntToStr(Count) + ' records ' + IntervalToStr(ExecTime)); + + Result := ExecTime; +end; + +procedure TfmMain.btEditPostClick(Sender: TObject); +const + Step = 100; +var + i: integer; + ResSDAC: integer; +begin + for i := 1 to 10 do begin + ResSDAC := EditPostTest(MSTable, i*Step); + Chart.Series[0].AddXY(i*Step, ResSDAC, '', clGreen); + end; + PrintResults; +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Performance/Performance.bdsproj b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Performance/Performance.bdsproj new file mode 100644 index 0000000..a0834c6 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Performance/Performance.bdsproj @@ -0,0 +1,158 @@ + + + + + + + + + + + + Performance.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + + + 0 + 0 + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + + + + False + + + + $00000000 + + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Performance/Performance.cfg b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Performance/Performance.cfg new file mode 100644 index 0000000..31d44ef --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Performance/Performance.cfg @@ -0,0 +1,41 @@ +-$A8 +-$B- +-$C+ +-$D+ +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L+ +-$M- +-$N+ +-$O- +-$P+ +-$Q+ +-$R+ +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$YD +-$Z1 +-cg +-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-H+ +-W+ +-M +-$M16384,1048576 +-K$00400000 +-E"." +-N"." +-LE"." +-LN"." +-U"d:\program files\borland\delphi7\Lib\Debug;d:\program files\borland\delphi7\Vcl;d:\program files\borland\delphi7\lib;d:\Projects\Delphi\dac\Source\;d:\Projects\Delphi\Sdac\Source\" +-O"d:\program files\borland\delphi7\Lib\Debug;d:\program files\borland\delphi7\Vcl;d:\program files\borland\delphi7\lib;d:\Projects\Delphi\dac\Source\;d:\Projects\Delphi\Sdac\Source\" +-I"d:\program files\borland\delphi7\Lib\Debug;d:\program files\borland\delphi7\Vcl;d:\program files\borland\delphi7\lib;d:\Projects\Delphi\dac\Source\;d:\Projects\Delphi\Sdac\Source\" +-R"d:\program files\borland\delphi7\Lib\Debug;d:\program files\borland\delphi7\Vcl;d:\program files\borland\delphi7\lib;d:\Projects\Delphi\dac\Source\;d:\Projects\Delphi\Sdac\Source\" diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Performance/Performance.dpr b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Performance/Performance.dpr new file mode 100644 index 0000000..c541065 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Performance/Performance.dpr @@ -0,0 +1,13 @@ +program Performance; + +uses + Forms, + Main in 'Main.pas' {fmMain}; + +{$R *.RES} + +begin + Application.Initialize; + Application.CreateForm(TfmMain, fmMain); + Application.Run; +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Performance/Performance.res b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Performance/Performance.res new file mode 100644 index 0000000..08ba56e Binary files /dev/null and b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Performance/Performance.res differ diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Performance/ReadMe.txt b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Performance/ReadMe.txt new file mode 100644 index 0000000..e913031 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/Performance/ReadMe.txt @@ -0,0 +1,8 @@ +SQL Server Data Access Components +Copyright 1997-2007, Core Lab. All Rights Reserved +-------------------------------------------------- + +Measures SDAC performance on several types of queries. This project lets +you compare SDAC performance to BDE, ADO, and dbExpress. Tests the +following functionality: Fetch, Master/Detail, Stored Procedure Call, +Multi Executing, and Insert/Post. diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/VirtualTableCB/Data1.vtd b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/VirtualTableCB/Data1.vtd new file mode 100644 index 0000000..f9fc5d2 Binary files /dev/null and b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/VirtualTableCB/Data1.vtd differ diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/VirtualTableCB/Main.cpp b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/VirtualTableCB/Main.cpp new file mode 100644 index 0000000..2636f8c --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/VirtualTableCB/Main.cpp @@ -0,0 +1,86 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop + +#include "Main.h" +//--------------------------------------------------------------------------- +#pragma package(smart_init) +#pragma link "MemDS" +#pragma link "VirtualTable" +#pragma resource "*.dfm" +TForm1 *Form1; +//--------------------------------------------------------------------------- +__fastcall TForm1::TForm1(TComponent* Owner) + : TForm(Owner) +{ +} +//--------------------------------------------------------------------------- + +void __fastcall TForm1::btOpenClick(TObject *Sender) +{ + VirtualTable->Open(); + edField->Text = VirtualTable->Fields->Fields[0]->FieldName; +} +//--------------------------------------------------------------------------- + +void __fastcall TForm1::btCloseClick(TObject *Sender) +{ + VirtualTable->Close(); +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::btAutoFillClick(TObject *Sender) +{ + TField* Field = VirtualTable -> FindField("STRING1"); + for( int i = 1; i <= 100; i++ ){ + VirtualTable -> Append(); + VirtualTable -> FieldByName("NUMBER")->AsInteger = i; + VirtualTable -> FieldByName("STRING")->AsString = "Use Oracle Data Access from Core Lab !!! (" + IntToStr(i) + ")"; + VirtualTable -> FieldByName("DATE")->AsDateTime = Date(); + VirtualTable -> FieldByName("MEMO")->AsString = "Memo value (" + IntToStr(i) + ")"; + + if( Field != NULL ) + VirtualTable -> FieldByName("STRING1")->AsString = "TVirtualTable"; + + VirtualTable -> Post(); + } +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::btAddFieldClick(TObject *Sender) +{ + VirtualTable -> AddField("STRING1", ftString, 30); +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::btDelFieldClick(TObject *Sender) +{ + VirtualTable->DeleteField("STRING1"); +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::btLoadClick(TObject *Sender) +{ + if( OpenDialog->Execute() ) + VirtualTable->LoadFromFile(OpenDialog->FileName); +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::btSaveClick(TObject *Sender) +{ + if( SaveDialog->Execute() ) + VirtualTable->SaveToFile(SaveDialog->FileName); +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::btClearClick(TObject *Sender) +{ + VirtualTable->Clear(); +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::cbFilteredClick(TObject *Sender) +{ + VirtualTable->Filtered = cbFiltered->Checked; +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::btLocateClick(TObject *Sender) +{ + VirtualTable->Locate(edField->Text, Variant(edValue->Text), TLocateOptions()); +} +//--------------------------------------------------------------------------- + diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/VirtualTableCB/Main.dfm b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/VirtualTableCB/Main.dfm new file mode 100644 index 0000000..a675d34 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/VirtualTableCB/Main.dfm @@ -0,0 +1,527 @@ +object Form1: TForm1 + Left = 146 + Top = 113 + Width = 696 + Height = 480 + Caption = 'Form1' + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + PixelsPerInch = 96 + TextHeight = 13 + object Splitter: TSplitter + Left = 0 + Top = 315 + Width = 688 + Height = 3 + Cursor = crVSplit + Align = alBottom + end + object ToolBar: TToolBar + Left = 0 + Top = 0 + Width = 688 + Height = 26 + TabOrder = 0 + object btOpen: TButton + Left = 0 + Top = 2 + Width = 75 + Height = 22 + Caption = 'Open' + TabOrder = 0 + OnClick = btOpenClick + end + object btClose: TButton + Left = 75 + Top = 2 + Width = 75 + Height = 22 + Caption = 'Close' + TabOrder = 2 + OnClick = btCloseClick + end + object btAutoFill: TButton + Left = 150 + Top = 2 + Width = 75 + Height = 22 + Caption = 'Append 100' + TabOrder = 3 + OnClick = btAutoFillClick + end + object btAddField: TButton + Left = 225 + Top = 2 + Width = 75 + Height = 22 + Caption = 'Add field' + TabOrder = 4 + OnClick = btAddFieldClick + end + object btDelField: TButton + Left = 300 + Top = 2 + Width = 75 + Height = 22 + Caption = 'Del field' + TabOrder = 5 + OnClick = btDelFieldClick + end + object DBNavigator: TDBNavigator + Left = 375 + Top = 2 + Width = 240 + Height = 22 + TabOrder = 1 + end + end + object Panel1: TPanel + Left = 0 + Top = 26 + Width = 688 + Height = 87 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object Label1: TLabel + Left = 8 + Top = 33 + Width = 22 + Height = 13 + Caption = 'Field' + end + object Label2: TLabel + Left = 184 + Top = 32 + Width = 27 + Height = 13 + Caption = 'Value' + end + object Label5: TLabel + Left = 7 + Top = 62 + Width = 22 + Height = 13 + Caption = 'Filter' + end + object edField: TEdit + Left = 40 + Top = 29 + Width = 121 + Height = 21 + TabOrder = 0 + end + object edValue: TEdit + Left = 222 + Top = 29 + Width = 121 + Height = 21 + TabOrder = 1 + end + object btLocate: TButton + Left = 357 + Top = 27 + Width = 75 + Height = 25 + Caption = 'Locate' + TabOrder = 2 + OnClick = btLocateClick + end + object edFilter: TEdit + Left = 40 + Top = 58 + Width = 303 + Height = 21 + TabOrder = 3 + end + object cbFiltered: TCheckBox + Left = 360 + Top = 62 + Width = 73 + Height = 17 + Caption = 'Filtered' + TabOrder = 4 + OnClick = cbFilteredClick + end + object btLoad: TButton + Left = 0 + Top = 1 + Width = 75 + Height = 22 + Caption = 'Load...' + TabOrder = 5 + OnClick = btLoadClick + end + object btSave: TButton + Left = 75 + Top = 1 + Width = 75 + Height = 22 + Caption = 'Save...' + TabOrder = 6 + OnClick = btSaveClick + end + object btClear: TButton + Left = 150 + Top = 0 + Width = 70 + Height = 23 + Caption = 'Clear' + TabOrder = 7 + OnClick = btClearClick + end + end + object DBGrid: TDBGrid + Left = 0 + Top = 113 + Width = 688 + Height = 202 + Align = alClient + DataSource = DataSource + TabOrder = 2 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object DBMemo: TDBMemo + Left = 0 + Top = 318 + Width = 688 + Height = 116 + Align = alBottom + DataField = 'MEMO' + DataSource = DataSource + TabOrder = 3 + end + object StatusBar: TStatusBar + Left = 0 + Top = 434 + Width = 688 + Height = 19 + Panels = < + item + Width = 120 + end + item + Width = 120 + end + item + Width = 50 + end> + SimplePanel = False + end + object VirtualTable: TVirtualTable + Active = True + FieldDefs = < + item + Name = 'NUMBER' + DataType = ftFloat + end + item + Name = 'STRING' + DataType = ftString + Size = 50 + end + item + Name = 'DATE' + DataType = ftDateTime + end + item + Name = 'MEMO' + DataType = ftMemo + end> + Left = 488 + Top = 42 + Data = { + 0100040006004E554D424552060000000600535452494E470100320004004441 + 54450B00000004004D454D4F100000000000640000000800000000000000F03F + 2C00557365204F7261636C652044617461204163636573732066726F6D20436F + 7265204C61622021212120283129080000007E3313B5CC420E004D656D6F2076 + 616C756520283129080000000000000000402C00557365204F7261636C652044 + 617461204163636573732066726F6D20436F7265204C61622021212120283229 + 080000007E3313B5CC420E004D656D6F2076616C756520283229080000000000 + 000008402C00557365204F7261636C652044617461204163636573732066726F + 6D20436F7265204C61622021212120283329080000007E3313B5CC420E004D65 + 6D6F2076616C756520283329080000000000000010402C00557365204F726163 + 6C652044617461204163636573732066726F6D20436F7265204C616220212121 + 20283429080000007E3313B5CC420E004D656D6F2076616C7565202834290800 + 00000000000014402C00557365204F7261636C65204461746120416363657373 + 2066726F6D20436F7265204C61622021212120283529080000007E3313B5CC42 + 0E004D656D6F2076616C756520283529080000000000000018402C0055736520 + 4F7261636C652044617461204163636573732066726F6D20436F7265204C6162 + 2021212120283629080000007E3313B5CC420E004D656D6F2076616C75652028 + 362908000000000000001C402C00557365204F7261636C652044617461204163 + 636573732066726F6D20436F7265204C61622021212120283729080000007E33 + 13B5CC420E004D656D6F2076616C756520283729080000000000000020402C00 + 557365204F7261636C652044617461204163636573732066726F6D20436F7265 + 204C61622021212120283829080000007E3313B5CC420E004D656D6F2076616C + 756520283829080000000000000022402C00557365204F7261636C6520446174 + 61204163636573732066726F6D20436F7265204C616220212121202839290800 + 00007E3313B5CC420E004D656D6F2076616C7565202839290800000000000000 + 24402D00557365204F7261636C652044617461204163636573732066726F6D20 + 436F7265204C6162202121212028313029080000007E3313B5CC420F004D656D + 6F2076616C75652028313029080000000000000026402D00557365204F726163 + 6C652044617461204163636573732066726F6D20436F7265204C616220212121 + 2028313129080000007E3313B5CC420F004D656D6F2076616C75652028313129 + 080000000000000028402D00557365204F7261636C6520446174612041636365 + 73732066726F6D20436F7265204C6162202121212028313229080000007E3313 + B5CC420F004D656D6F2076616C7565202831322908000000000000002A402D00 + 557365204F7261636C652044617461204163636573732066726F6D20436F7265 + 204C6162202121212028313329080000007E3313B5CC420F004D656D6F207661 + 6C7565202831332908000000000000002C402D00557365204F7261636C652044 + 617461204163636573732066726F6D20436F7265204C61622021212120283134 + 29080000007E3313B5CC420F004D656D6F2076616C7565202831342908000000 + 000000002E402D00557365204F7261636C652044617461204163636573732066 + 726F6D20436F7265204C6162202121212028313529080000007E3313B5CC420F + 004D656D6F2076616C75652028313529080000000000000030402D0055736520 + 4F7261636C652044617461204163636573732066726F6D20436F7265204C6162 + 202121212028313629080000007E3313B5CC420F004D656D6F2076616C756520 + 28313629080000000000000031402D00557365204F7261636C65204461746120 + 4163636573732066726F6D20436F7265204C6162202121212028313729080000 + 007E3313B5CC420F004D656D6F2076616C756520283137290800000000000000 + 32402D00557365204F7261636C652044617461204163636573732066726F6D20 + 436F7265204C6162202121212028313829080000007E3313B5CC420F004D656D + 6F2076616C75652028313829080000000000000033402D00557365204F726163 + 6C652044617461204163636573732066726F6D20436F7265204C616220212121 + 2028313929080000007E3313B5CC420F004D656D6F2076616C75652028313929 + 080000000000000034402D00557365204F7261636C6520446174612041636365 + 73732066726F6D20436F7265204C6162202121212028323029080000007E3313 + B5CC420F004D656D6F2076616C75652028323029080000000000000035402D00 + 557365204F7261636C652044617461204163636573732066726F6D20436F7265 + 204C6162202121212028323129080000007E3313B5CC420F004D656D6F207661 + 6C75652028323129080000000000000036402D00557365204F7261636C652044 + 617461204163636573732066726F6D20436F7265204C61622021212120283232 + 29080000007E3313B5CC420F004D656D6F2076616C7565202832322908000000 + 0000000037402D00557365204F7261636C652044617461204163636573732066 + 726F6D20436F7265204C6162202121212028323329080000007E3313B5CC420F + 004D656D6F2076616C75652028323329080000000000000038402D0055736520 + 4F7261636C652044617461204163636573732066726F6D20436F7265204C6162 + 202121212028323429080000007E3313B5CC420F004D656D6F2076616C756520 + 28323429080000000000000039402D00557365204F7261636C65204461746120 + 4163636573732066726F6D20436F7265204C6162202121212028323529080000 + 007E3313B5CC420F004D656D6F2076616C756520283235290800000000000000 + 3A402D00557365204F7261636C652044617461204163636573732066726F6D20 + 436F7265204C6162202121212028323629080000007E3313B5CC420F004D656D + 6F2076616C7565202832362908000000000000003B402D00557365204F726163 + 6C652044617461204163636573732066726F6D20436F7265204C616220212121 + 2028323729080000007E3313B5CC420F004D656D6F2076616C75652028323729 + 08000000000000003C402D00557365204F7261636C6520446174612041636365 + 73732066726F6D20436F7265204C6162202121212028323829080000007E3313 + B5CC420F004D656D6F2076616C7565202832382908000000000000003D402D00 + 557365204F7261636C652044617461204163636573732066726F6D20436F7265 + 204C6162202121212028323929080000007E3313B5CC420F004D656D6F207661 + 6C7565202832392908000000000000003E402D00557365204F7261636C652044 + 617461204163636573732066726F6D20436F7265204C61622021212120283330 + 29080000007E3313B5CC420F004D656D6F2076616C7565202833302908000000 + 000000003F402D00557365204F7261636C652044617461204163636573732066 + 726F6D20436F7265204C6162202121212028333129080000007E3313B5CC420F + 004D656D6F2076616C75652028333129080000000000000040402D0055736520 + 4F7261636C652044617461204163636573732066726F6D20436F7265204C6162 + 202121212028333229080000007E3313B5CC420F004D656D6F2076616C756520 + 28333229080000000000008040402D00557365204F7261636C65204461746120 + 4163636573732066726F6D20436F7265204C6162202121212028333329080000 + 007E3313B5CC420F004D656D6F2076616C756520283333290800000000000000 + 41402D00557365204F7261636C652044617461204163636573732066726F6D20 + 436F7265204C6162202121212028333429080000007E3313B5CC420F004D656D + 6F2076616C75652028333429080000000000008041402D00557365204F726163 + 6C652044617461204163636573732066726F6D20436F7265204C616220212121 + 2028333529080000007E3313B5CC420F004D656D6F2076616C75652028333529 + 080000000000000042402D00557365204F7261636C6520446174612041636365 + 73732066726F6D20436F7265204C6162202121212028333629080000007E3313 + B5CC420F004D656D6F2076616C75652028333629080000000000008042402D00 + 557365204F7261636C652044617461204163636573732066726F6D20436F7265 + 204C6162202121212028333729080000007E3313B5CC420F004D656D6F207661 + 6C75652028333729080000000000000043402D00557365204F7261636C652044 + 617461204163636573732066726F6D20436F7265204C61622021212120283338 + 29080000007E3313B5CC420F004D656D6F2076616C7565202833382908000000 + 0000008043402D00557365204F7261636C652044617461204163636573732066 + 726F6D20436F7265204C6162202121212028333929080000007E3313B5CC420F + 004D656D6F2076616C75652028333929080000000000000044402D0055736520 + 4F7261636C652044617461204163636573732066726F6D20436F7265204C6162 + 202121212028343029080000007E3313B5CC420F004D656D6F2076616C756520 + 28343029080000000000008044402D00557365204F7261636C65204461746120 + 4163636573732066726F6D20436F7265204C6162202121212028343129080000 + 007E3313B5CC420F004D656D6F2076616C756520283431290800000000000000 + 45402D00557365204F7261636C652044617461204163636573732066726F6D20 + 436F7265204C6162202121212028343229080000007E3313B5CC420F004D656D + 6F2076616C75652028343229080000000000008045402D00557365204F726163 + 6C652044617461204163636573732066726F6D20436F7265204C616220212121 + 2028343329080000007E3313B5CC420F004D656D6F2076616C75652028343329 + 080000000000000046402D00557365204F7261636C6520446174612041636365 + 73732066726F6D20436F7265204C6162202121212028343429080000007E3313 + B5CC420F004D656D6F2076616C75652028343429080000000000008046402D00 + 557365204F7261636C652044617461204163636573732066726F6D20436F7265 + 204C6162202121212028343529080000007E3313B5CC420F004D656D6F207661 + 6C75652028343529080000000000000047402D00557365204F7261636C652044 + 617461204163636573732066726F6D20436F7265204C61622021212120283436 + 29080000007E3313B5CC420F004D656D6F2076616C7565202834362908000000 + 0000008047402D00557365204F7261636C652044617461204163636573732066 + 726F6D20436F7265204C6162202121212028343729080000007E3313B5CC420F + 004D656D6F2076616C75652028343729080000000000000048402D0055736520 + 4F7261636C652044617461204163636573732066726F6D20436F7265204C6162 + 202121212028343829080000007E3313B5CC420F004D656D6F2076616C756520 + 28343829080000000000008048402D00557365204F7261636C65204461746120 + 4163636573732066726F6D20436F7265204C6162202121212028343929080000 + 007E3313B5CC420F004D656D6F2076616C756520283439290800000000000000 + 49402D00557365204F7261636C652044617461204163636573732066726F6D20 + 436F7265204C6162202121212028353029080000007E3313B5CC420F004D656D + 6F2076616C75652028353029080000000000008049402D00557365204F726163 + 6C652044617461204163636573732066726F6D20436F7265204C616220212121 + 2028353129080000007E3313B5CC420F004D656D6F2076616C75652028353129 + 08000000000000004A402D00557365204F7261636C6520446174612041636365 + 73732066726F6D20436F7265204C6162202121212028353229080000007E3313 + B5CC420F004D656D6F2076616C7565202835322908000000000000804A402D00 + 557365204F7261636C652044617461204163636573732066726F6D20436F7265 + 204C6162202121212028353329080000007E3313B5CC420F004D656D6F207661 + 6C7565202835332908000000000000004B402D00557365204F7261636C652044 + 617461204163636573732066726F6D20436F7265204C61622021212120283534 + 29080000007E3313B5CC420F004D656D6F2076616C7565202835342908000000 + 000000804B402D00557365204F7261636C652044617461204163636573732066 + 726F6D20436F7265204C6162202121212028353529080000007E3313B5CC420F + 004D656D6F2076616C7565202835352908000000000000004C402D0055736520 + 4F7261636C652044617461204163636573732066726F6D20436F7265204C6162 + 202121212028353629080000007E3313B5CC420F004D656D6F2076616C756520 + 2835362908000000000000804C402D00557365204F7261636C65204461746120 + 4163636573732066726F6D20436F7265204C6162202121212028353729080000 + 007E3313B5CC420F004D656D6F2076616C756520283537290800000000000000 + 4D402D00557365204F7261636C652044617461204163636573732066726F6D20 + 436F7265204C6162202121212028353829080000007E3313B5CC420F004D656D + 6F2076616C7565202835382908000000000000804D402D00557365204F726163 + 6C652044617461204163636573732066726F6D20436F7265204C616220212121 + 2028353929080000007E3313B5CC420F004D656D6F2076616C75652028353929 + 08000000000000004E402D00557365204F7261636C6520446174612041636365 + 73732066726F6D20436F7265204C6162202121212028363029080000007E3313 + B5CC420F004D656D6F2076616C7565202836302908000000000000804E402D00 + 557365204F7261636C652044617461204163636573732066726F6D20436F7265 + 204C6162202121212028363129080000007E3313B5CC420F004D656D6F207661 + 6C7565202836312908000000000000004F402D00557365204F7261636C652044 + 617461204163636573732066726F6D20436F7265204C61622021212120283632 + 29080000007E3313B5CC420F004D656D6F2076616C7565202836322908000000 + 000000804F402D00557365204F7261636C652044617461204163636573732066 + 726F6D20436F7265204C6162202121212028363329080000007E3313B5CC420F + 004D656D6F2076616C75652028363329080000000000000050402D0055736520 + 4F7261636C652044617461204163636573732066726F6D20436F7265204C6162 + 202121212028363429080000007E3313B5CC420F004D656D6F2076616C756520 + 28363429080000000000004050402D00557365204F7261636C65204461746120 + 4163636573732066726F6D20436F7265204C6162202121212028363529080000 + 007E3313B5CC420F004D656D6F2076616C756520283635290800000000000080 + 50402D00557365204F7261636C652044617461204163636573732066726F6D20 + 436F7265204C6162202121212028363629080000007E3313B5CC420F004D656D + 6F2076616C7565202836362908000000000000C050402D00557365204F726163 + 6C652044617461204163636573732066726F6D20436F7265204C616220212121 + 2028363729080000007E3313B5CC420F004D656D6F2076616C75652028363729 + 080000000000000051402D00557365204F7261636C6520446174612041636365 + 73732066726F6D20436F7265204C6162202121212028363829080000007E3313 + B5CC420F004D656D6F2076616C75652028363829080000000000004051402D00 + 557365204F7261636C652044617461204163636573732066726F6D20436F7265 + 204C6162202121212028363929080000007E3313B5CC420F004D656D6F207661 + 6C75652028363929080000000000008051402D00557365204F7261636C652044 + 617461204163636573732066726F6D20436F7265204C61622021212120283730 + 29080000007E3313B5CC420F004D656D6F2076616C7565202837302908000000 + 000000C051402D00557365204F7261636C652044617461204163636573732066 + 726F6D20436F7265204C6162202121212028373129080000007E3313B5CC420F + 004D656D6F2076616C75652028373129080000000000000052402D0055736520 + 4F7261636C652044617461204163636573732066726F6D20436F7265204C6162 + 202121212028373229080000007E3313B5CC420F004D656D6F2076616C756520 + 28373229080000000000004052402D00557365204F7261636C65204461746120 + 4163636573732066726F6D20436F7265204C6162202121212028373329080000 + 007E3313B5CC420F004D656D6F2076616C756520283733290800000000000080 + 52402D00557365204F7261636C652044617461204163636573732066726F6D20 + 436F7265204C6162202121212028373429080000007E3313B5CC420F004D656D + 6F2076616C7565202837342908000000000000C052402D00557365204F726163 + 6C652044617461204163636573732066726F6D20436F7265204C616220212121 + 2028373529080000007E3313B5CC420F004D656D6F2076616C75652028373529 + 080000000000000053402D00557365204F7261636C6520446174612041636365 + 73732066726F6D20436F7265204C6162202121212028373629080000007E3313 + B5CC420F004D656D6F2076616C75652028373629080000000000004053402D00 + 557365204F7261636C652044617461204163636573732066726F6D20436F7265 + 204C6162202121212028373729080000007E3313B5CC420F004D656D6F207661 + 6C75652028373729080000000000008053402D00557365204F7261636C652044 + 617461204163636573732066726F6D20436F7265204C61622021212120283738 + 29080000007E3313B5CC420F004D656D6F2076616C7565202837382908000000 + 000000C053402D00557365204F7261636C652044617461204163636573732066 + 726F6D20436F7265204C6162202121212028373929080000007E3313B5CC420F + 004D656D6F2076616C75652028373929080000000000000054402D0055736520 + 4F7261636C652044617461204163636573732066726F6D20436F7265204C6162 + 202121212028383029080000007E3313B5CC420F004D656D6F2076616C756520 + 28383029080000000000004054402D00557365204F7261636C65204461746120 + 4163636573732066726F6D20436F7265204C6162202121212028383129080000 + 007E3313B5CC420F004D656D6F2076616C756520283831290800000000000080 + 54402D00557365204F7261636C652044617461204163636573732066726F6D20 + 436F7265204C6162202121212028383229080000007E3313B5CC420F004D656D + 6F2076616C7565202838322908000000000000C054402D00557365204F726163 + 6C652044617461204163636573732066726F6D20436F7265204C616220212121 + 2028383329080000007E3313B5CC420F004D656D6F2076616C75652028383329 + 080000000000000055402D00557365204F7261636C6520446174612041636365 + 73732066726F6D20436F7265204C6162202121212028383429080000007E3313 + B5CC420F004D656D6F2076616C75652028383429080000000000004055402D00 + 557365204F7261636C652044617461204163636573732066726F6D20436F7265 + 204C6162202121212028383529080000007E3313B5CC420F004D656D6F207661 + 6C75652028383529080000000000008055402D00557365204F7261636C652044 + 617461204163636573732066726F6D20436F7265204C61622021212120283836 + 29080000007E3313B5CC420F004D656D6F2076616C7565202838362908000000 + 000000C055402D00557365204F7261636C652044617461204163636573732066 + 726F6D20436F7265204C6162202121212028383729080000007E3313B5CC420F + 004D656D6F2076616C75652028383729080000000000000056402D0055736520 + 4F7261636C652044617461204163636573732066726F6D20436F7265204C6162 + 202121212028383829080000007E3313B5CC420F004D656D6F2076616C756520 + 28383829080000000000004056402D00557365204F7261636C65204461746120 + 4163636573732066726F6D20436F7265204C6162202121212028383929080000 + 007E3313B5CC420F004D656D6F2076616C756520283839290800000000000080 + 56402D00557365204F7261636C652044617461204163636573732066726F6D20 + 436F7265204C6162202121212028393029080000007E3313B5CC420F004D656D + 6F2076616C7565202839302908000000000000C056402D00557365204F726163 + 6C652044617461204163636573732066726F6D20436F7265204C616220212121 + 2028393129080000007E3313B5CC420F004D656D6F2076616C75652028393129 + 080000000000000057402D00557365204F7261636C6520446174612041636365 + 73732066726F6D20436F7265204C6162202121212028393229080000007E3313 + B5CC420F004D656D6F2076616C75652028393229080000000000004057402D00 + 557365204F7261636C652044617461204163636573732066726F6D20436F7265 + 204C6162202121212028393329080000007E3313B5CC420F004D656D6F207661 + 6C75652028393329080000000000008057402D00557365204F7261636C652044 + 617461204163636573732066726F6D20436F7265204C61622021212120283934 + 29080000007E3313B5CC420F004D656D6F2076616C7565202839342908000000 + 000000C057402D00557365204F7261636C652044617461204163636573732066 + 726F6D20436F7265204C6162202121212028393529080000007E3313B5CC420F + 004D656D6F2076616C75652028393529080000000000000058402D0055736520 + 4F7261636C652044617461204163636573732066726F6D20436F7265204C6162 + 202121212028393629080000007E3313B5CC420F004D656D6F2076616C756520 + 28393629080000000000004058402D00557365204F7261636C65204461746120 + 4163636573732066726F6D20436F7265204C6162202121212028393729080000 + 007E3313B5CC420F004D656D6F2076616C756520283937290800000000000080 + 58402D00557365204F7261636C652044617461204163636573732066726F6D20 + 436F7265204C6162202121212028393829080000007E3313B5CC420F004D656D + 6F2076616C7565202839382908000000000000C058402D00557365204F726163 + 6C652044617461204163636573732066726F6D20436F7265204C616220212121 + 2028393929080000007E3313B5CC420F004D656D6F2076616C75652028393929 + 080000000000000059402E00557365204F7261636C6520446174612041636365 + 73732066726F6D20436F7265204C616220212121202831303029080000007E33 + 13B5CC4210004D656D6F2076616C7565202831303029} + end + object DataSource: TDataSource + DataSet = VirtualTable + Left = 520 + Top = 42 + end + object SaveDialog: TSaveDialog + DefaultExt = 'vtd' + FileName = 'Data1.vtd' + Filter = 'Virtual Table Data (*.vtd)|*.vtd|Any File (*.*)|*.*' + Left = 520 + Top = 74 + end + object OpenDialog: TOpenDialog + DefaultExt = 'vtd' + FileName = 'Data1.vtd' + Filter = 'Virtual Table Data (*.vtd)|*.vtd|Any File (*.*)|*.*' + Left = 488 + Top = 74 + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/VirtualTableCB/Main.h b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/VirtualTableCB/Main.h new file mode 100644 index 0000000..f609fcc --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/VirtualTableCB/Main.h @@ -0,0 +1,68 @@ +//--------------------------------------------------------------------------- + +#ifndef MainH +#define MainH +//--------------------------------------------------------------------------- +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "MemDS.hpp" +#include "VirtualTable.hpp" +#include +#include +//--------------------------------------------------------------------------- +class TForm1 : public TForm +{ +__published: // IDE-managed Components + TToolBar *ToolBar; + TButton *btOpen; + TButton *btClose; + TButton *btAutoFill; + TButton *btAddField; + TButton *btDelField; + TDBNavigator *DBNavigator; + TPanel *Panel1; + TLabel *Label1; + TLabel *Label2; + TLabel *Label5; + TEdit *edField; + TEdit *edValue; + TButton *btLocate; + TEdit *edFilter; + TCheckBox *cbFiltered; + TButton *btLoad; + TButton *btSave; + TButton *btClear; + TDBGrid *DBGrid; + TDBMemo *DBMemo; + TSplitter *Splitter; + TStatusBar *StatusBar; + TVirtualTable *VirtualTable; + TDataSource *DataSource; + TSaveDialog *SaveDialog; + TOpenDialog *OpenDialog; + void __fastcall btOpenClick(TObject *Sender); + void __fastcall btCloseClick(TObject *Sender); + void __fastcall btAutoFillClick(TObject *Sender); + void __fastcall btAddFieldClick(TObject *Sender); + void __fastcall btDelFieldClick(TObject *Sender); + void __fastcall btLoadClick(TObject *Sender); + void __fastcall btSaveClick(TObject *Sender); + void __fastcall btClearClick(TObject *Sender); + void __fastcall cbFilteredClick(TObject *Sender); + void __fastcall btLocateClick(TObject *Sender); +private: // User declarations +public: // User declarations + __fastcall TForm1(TComponent* Owner); +}; +//--------------------------------------------------------------------------- +extern PACKAGE TForm1 *Form1; +//--------------------------------------------------------------------------- +#endif diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/VirtualTableCB/ReadMe.txt b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/VirtualTableCB/ReadMe.txt new file mode 100644 index 0000000..e27f13b --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/VirtualTableCB/ReadMe.txt @@ -0,0 +1,9 @@ +DB Access Components +Copyright 1997-2007, Core Lab. All Rights Reserved +-------------------------------------------------- + +Demonstrates working with the TVirtualTable component. This sample shows +how to fill virtual dataset with data from other datasets, filter data by +a given criteria, locate specified records, perform file operations, and +change data and table structure. This is one of the two demo projects for +C++Builder. diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/VirtualTableCB/VTable.bpr b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/VirtualTableCB/VTable.bpr new file mode 100644 index 0000000..c670466 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/VirtualTableCB/VTable.bpr @@ -0,0 +1,134 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[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] +d:\program files\borland\cbuilder6\Bin\oraprov60.bpl=OraProvider package + +[HistoryLists\hlIncludePath] +Count=3 +Item0=$(BCB)\include;$(BCB)\include\vcl +Item1=$(BCB)\include;$(BCB)\include\vcl;C:\Program Files\CoreLab\VTable\Source\CBuilder6\VTable\Include +Item2=d:\projects\delphi\dac\source;..\..\Projects;..\VTable\Demos;$(BCB)\include;$(BCB)\include\vcl;D:\Program Files\Borland\CBuilder6\Odac\Include;D:\Program Files\Borland\CBuilder6\MyDac\Include;D:\Program Files\Borland\CBuilder6\Odac5004\Include;D:\Program Files\Borland\CBuilder6\Odac5003\Include;D:\Program Files\Borland\CBuilder6\VTable\Include + +[HistoryLists\hlLibraryPath] +Count=5 +Item0=$(BCB)\lib\obj;$(BCB)\lib +Item1=C:\Program Files\CoreLab\VTable\Source\CBuilder6\VTable\Lib;$(BCB)\lib\obj;$(BCB)\lib;D:\Projects\Delphi\Dac\Source +Item2=$(BCB)\lib\obj;$(BCB)\lib;D:\Projects\Delphi\Dac\Source +Item3=C:\Program Files\CoreLab\VTable\Source\CBuilder6\VTable\Lib;$(BCB)\lib\obj;$(BCB)\lib +Item4=d:\projects\delphi\dac\source\cbuilder6;d:\projects\delphi\dac\source;..\..\Projects;..\VTable\Demos;$(BCB)\lib\obj;$(BCB)\lib;D:\Program Files\Borland\CBuilder6\Odac\Lib;D:\Program Files\Borland\CBuilder6\MyDac\Lib;D:\Program Files\Borland\CBuilder6\Odac5004\Lib;D:\Program Files\Borland\CBuilder6\Odac5003\Lib;D:\Program Files\Borland\CBuilder6\VTable\Lib + +[HistoryLists\hlDebugSourcePath] +Count=1 +Item0=$(BCB)\source\vcl + +[HistoryLists\hlConditionals] +Count=1 +Item0=_DEBUG + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +Launcher= +UseLauncher=0 +DebugCWD= +HostApplication= +RemoteHost= +RemotePath= +RemoteLauncher= +RemoteCWD= +RemoteDebug=0 + +[Compiler] +ShowInfoMsgs=0 +LinkDebugVcl=0 + + \ No newline at end of file diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/VirtualTableCB/VTable.cpp b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/VirtualTableCB/VTable.cpp new file mode 100644 index 0000000..810eb2d --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/VirtualTableCB/VTable.cpp @@ -0,0 +1,33 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +//--------------------------------------------------------------------------- +USEFORM("Main.cpp", Form1); +//--------------------------------------------------------------------------- +WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) +{ + try + { + Application->Initialize(); + Application->CreateForm(__classid(TForm1), &Form1); + Application->Run(); + } + catch (Exception &exception) + { + Application->ShowException(&exception); + } + catch (...) + { + try + { + throw Exception(""); + } + catch (Exception &exception) + { + Application->ShowException(&exception); + } + } + return 0; +} +//--------------------------------------------------------------------------- diff --git a/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/VirtualTableCB/VTable.res b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/VirtualTableCB/VTable.res new file mode 100644 index 0000000..5468ae5 Binary files /dev/null and b/internal/4.10.0.10/1/Demos/Win32/Miscellaneous/VirtualTableCB/VTable.res differ diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Base/CategoryFrame.dfm b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Base/CategoryFrame.dfm new file mode 100644 index 0000000..6cf1e3d --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Base/CategoryFrame.dfm @@ -0,0 +1,5 @@ +inherited CategoryFrame: TCategoryFrame + Width = 451 + Height = 304 + Align = alClient +end diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Base/CategoryFrame.pas b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Base/CategoryFrame.pas new file mode 100644 index 0000000..becc115 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Base/CategoryFrame.pas @@ -0,0 +1,193 @@ +unit CategoryFrame; + +interface + +uses +{$IFDEF LINUX} + QControls, QStdCtrls, QComCtrls, QGraphics, QForms, +{$ELSE} + Controls, StdCtrls, ShellApi, Windows, Forms, +{$IFDEF WIN32} + OleCtrls, SHDocVw, mshtml, ActiveX, +{$ELSE} + Graphics, Types, +{$ENDIF} +{$ENDIF} +{$IFNDEF VER130} + Variants, +{$ENDIF} + SysUtils, Classes, DemoFrame; + +type +{$IFNDEF WIN32} + TOnNavigate = procedure (DemoDescription: string) of object; +{$ELSE} + TOnNavigate = procedure (Index: integer) of object; +{$ENDIF} + + TCategoryFrame = class(TDemoFrame) + protected + FOnNavigate: TOnNavigate; + FDemosDescription: {$IFNDEF WIN32}TListBox{$ELSE}TWebBrowser{$ENDIF}; + FTempFileName: string; // for Win98 problem avoidance + public + procedure SetDemoDescriptions(Descriptions: TStrings); + constructor Create(AOwner: TComponent); override; + {$IFNDEF WIN32} + procedure DemosDescriptionDblClick(Sender: TObject); + procedure DemoDescriptionMouseMove(Sender: TObject; + Shift: TShiftState; X, Y: Integer); + {$ELSE} + procedure DemosDescriptionBeforeNavigate2(Sender: TObject; + const pDisp: IDispatch; var URL, Flags, TargetFrameName, PostData, + Headers: OleVariant; var Cancel: WordBool); + {$ENDIF} + property OnNavigate: TOnNavigate read FOnNavigate write FOnNavigate; + {$IFNDEF WIN32} + property DemosDescription: TListBox read FDemosDescription; + {$ENDIF} + end; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} +{$IFDEF LINUX} +{$R *.xfm} +{$ENDIF} + +{$IFDEF VER130} +function TryStrToInt(const S: string; out Value: Integer): boolean; +begin + Result := True; + try + Value := StrToInt(S); + except + Result := False + end; +end; +{$ENDIF} + +constructor TCategoryFrame.Create(AOwner: TComponent); +begin + inherited; +{$IFNDEF WIN32} + FDemosDescription := TListBox.Create(self); +{$IFDEF LINUX} + FDemosDescription.Font.Name := 'adobe-courier'; + FDemosDescription.Font.Pitch := fpFixed; +{$ENDIF} +{$IFDEF CLR} + FDemosDescription.Font.Name := 'courier new'; + FDemosDescription.Font.Size := 11; +{$ENDIF} + FDemosDescription.OnDblClick := DemosDescriptionDblClick; + FDemosDescription.OnMouseMove := DemoDescriptionMouseMove; +{$ELSE} + FDemosDescription := TWebBrowser.Create(self); + FDemosDescription.Navigate('about:blank'); // to create document object + FDemosDescription.OnBeforeNavigate2 := DemosDescriptionBeforeNavigate2; +{$ENDIF} + InsertControl(FDemosDescription); + FDemosDescription.Align := alClient; +end; + +{$IFNDEF WIN32} + +procedure TCategoryFrame.SetDemoDescriptions(Descriptions: TStrings); +begin + FDemosDescription.Items.Assign(Descriptions); +end; + +procedure TCategoryFrame.DemoDescriptionMouseMove(Sender: TObject; + Shift: TShiftState; X, Y: Integer); +var + n: integer; +begin + n := FDemosDescription.ItemAtPos(Point(X, Y), True); + If (n = -1) or (Trim(FDemosDescription.Items[n]) = '') or (FDemosDescription.Items[n][1] = ' ') then + FDemosDescription.Cursor := crDefault + else + FDemosDescription.Cursor := crHandPoint; +end; + +// Navigation +procedure TCategoryFrame.DemosDescriptionDblClick(Sender: TObject); +begin + inherited; + if (Trim(FDemosDescription.Items[FDemosDescription.ItemIndex]) <> '') and (pos(' ', FDemosDescription.Items[FDemosDescription.ItemIndex]) <> 1) and Assigned(FOnNavigate) then begin + FOnNavigate(FDemosDescription.Items[FDemosDescription.ItemIndex]); + end; +end; + +{$ELSE} + +procedure TCategoryFrame.SetDemoDescriptions(Descriptions: TStrings); +var + v: Variant; + HTMLDocument: IHTMLDocument2; + Len: integer; +begin + HTMLDocument := FDemosDescription.Document as IHTMLDocument2; + if Assigned(HTMLDocument) then begin + v := VarArrayCreate([0, 0], varVariant); + v[0] := Descriptions.Text; + HTMLDocument.Write(PSafeArray(TVarData(v).VArray)); + HTMLDocument.Close; + end + else begin + Len := GetEnvironmentVariable(PChar('TEMP'), nil, 0); + if Len > 0 then + begin + SetLength(FTempFileName, Len - 1); + GetEnvironmentVariable(PChar('TEMP'), PChar(FTempFileName), Len); + end; + if Length(FTempFileName) > 1 then begin + if FTempFileName[length(FTempFileName) - 1] <> '\' then + FTempFileName := FTempFileName + '\'; + FTempFileName := FTempFileName + 'DAC_Demo_tmp.html'; + Descriptions.SaveToFile(FTempFileName); + FDemosDescription.Navigate(FTempFileName) + end; + end; +end; + +// Navigation +procedure TCategoryFrame.DemosDescriptionBeforeNavigate2(Sender: TObject; + const pDisp: IDispatch; var URL, Flags, TargetFrameName, PostData, + Headers: OleVariant; var Cancel: WordBool); +var + Index: integer; + str: string; +begin + str := ExtractFileName(URL); + if (str = 'blank') or (str = ExtractFileName(FTempFileName)) then // navigating 'about:blank', or the html temporary file + Exit; // let navigator to handle + // our handler + Cancel := True; +{$IFNDEF LINUX} + if not TryStrToInt(str, Index) then begin + str := ExtractFilePath(Application.Exename) + copy(url, 4, Length(url) - 3); + ShellExecute(0, 'open', PChar(str), '', '.', SW_SHOW); + exit; + end; +{$ENDIF} + if Assigned(FOnNavigate) then + FOnNavigate(Index); +end; + +{$ENDIF} + +{$IFDEF WIN32} +initialization + OleInitialize(nil); + +finalization + OleUninitialize; +{$ENDIF} + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Base/CategoryFrame.xfm b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Base/CategoryFrame.xfm new file mode 100644 index 0000000..506e173 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Base/CategoryFrame.xfm @@ -0,0 +1,5 @@ +inherited CategoryFrame: TCategoryFrame + Width = 451 + Height = 304 + Align = alClient +end diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Base/DacDemo.inc b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Base/DacDemo.inc new file mode 100644 index 0000000..27dc695 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Base/DacDemo.inc @@ -0,0 +1,13 @@ +{$IFNDEF LINUX} + { $DEFINE USE_SYNEDIT} + {$IFNDEF VER130} + {$IFNDEF VER140} + {$IFNDEF CLR} + {$DEFINE XPMAN} + {$ENDIF} + {$ENDIF} + {$ENDIF} +{$ENDIF} +{$IFNDEF CLR} + {$DEFINE HAVE_COMPRESS} +{$ENDIF} \ No newline at end of file diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Base/DemoBase.pas b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Base/DemoBase.pas new file mode 100644 index 0000000..5bebb5b --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Base/DemoBase.pas @@ -0,0 +1,416 @@ +unit DemoBase; + +interface + +uses + Classes, SysUtils, DemoFrame, CategoryFrame, DBAccess, MemUtils, +{$IFDEF LINUX} + QControls, QGraphics, QComCtrls, QForms +{$ELSE} + Windows, ComCtrls, Controls, Graphics, Forms, + HTMLConsts, ShellAPI +{$ENDIF} + ; + +type + TDemoType = (dtDemo, dtCategory); + + TDemo = class + protected + FName: string; + FFileName: string; + FHint: string; + FDescription: string; + FDemoType: TDemoType; + FFrameClass: TDemoFrameClass; + FFrame: TDemoFrame; + public + constructor Create(Name, Hint, Description: string; DemoType: TDemoType; FrameClass: TDemoFrameClass; FileName: string = ''); + destructor Destroy; override; + + procedure LoadDemoCode(Strings: TStrings); + procedure LoadFormCode(Strings: TStrings); + procedure OpenDemoFolder; + procedure FreeFrame; + + property Name: string read FName; + property Hint: string read FHint; + property Description: string read FDescription; + property DemoType: TDemoType read FDemoType; + property FrameClass: TDemoFrameClass read FFrameClass; + property Frame: TDemoFrame read FFrame; + end; + + TDemos = class + protected + FDemoTreeNodes: TTreeNodes; + FSelectedDemo: TDemo; + FSupplementaryDemosDescription: TStrings; + function GetSelectedDemo: TDemo; + function GetItems(Index: integer): TDemo; + + function WrapDescription(Demo: TDemo): TStrings; + public + constructor Create(TreeNodes: TTreeNodes); virtual; + destructor Destroy; override; + + procedure RegisterCategory(CategoryName, Hint: string; ImgIndex: integer = -1; SupplementaryDemo: boolean = False); + procedure RegisterDemo(DemoName, DemoHint, DemoDescription, DemoCategory: string; FrameClass: TDemoFrameClass; ImgIndex: integer; FileName: string = ''; SupplementaryDemo: boolean = False); + procedure Clear; + //Navigation + function SelectDemo(DemoIndex: integer): TDemo; //Create demo frame by DemoIndex + + function GetDemoIndex(AbsoluteIndex: integer): integer; + + property Items[Index: integer]: TDemo read GetItems; default; + property SelectedDemo: TDemo read GetSelectedDemo; + end; + +implementation + +const + MainDemosHeader = 'Main Demo Projects'; + SupplementaryDemosHeader = 'Supplementary Demo Projects'; + SupplementaryDemosNote = ' Note, the demo projects listed below are separate projects. ' {$IFNDEF WIN32} + #13#10 {$ENDIF} + ' This project contains only their descriptions and links to their folders.'; + +{$IFNDEF WIN32} +procedure WriteTable(CategoryName, CategoryDescription: string; List: TStrings); +var + strs: TStringList; +begin + List.Add(' '); + List.Add(' ' + CategoryName); + strs := TStringList.Create; + strs.Text := CategoryDescription; + List.AddStrings(strs); + strs.Free; +end; +{$ELSE} +procedure WriteTable(CategoryName, CategoryDescription: string; List: TStrings); +begin + if CategoryName = '' then begin // used to close virtual category + List.Add(''); + Exit; + end; + + List.Add('

' + CategoryName + '

'); + List.Add(''); + List.Add(''); + List.Add(''); + List.Add(''); + List.Add(''); + if CategoryDescription <> '' then begin + List.Add(CategoryDescription); + List.Add('
DemoDescription
'); + end; +end; +{$ENDIF} + +constructor TDemos.Create(TreeNodes: TTreeNodes); +begin + inherited Create; + + if not Assigned(TreeNodes) then + raise Exception.Create('TreeNodes should be set'); + FDemoTreeNodes := TreeNodes; + FSupplementaryDemosDescription := TStringList.Create; +{$IFNDEF WIN32} + FSupplementaryDemosDescription.Text := #13#10' ' + SupplementaryDemosHeader; + FSupplementaryDemosDescription.Add(SupplementaryDemosNote); +{$ENDIF} +end; + +destructor TDemos.Destroy; +begin + Clear; + inherited; +end; + +procedure TDemos.RegisterCategory(CategoryName, Hint: string; ImgIndex: integer = -1; SupplementaryDemo: boolean = False); +var + Node: TTreeNode; + Index: integer; + Category: TDemo; +begin + if SupplementaryDemo then + WriteTable(CategoryName, Hint, FSupplementaryDemosDescription) + else begin + Category := TDemo.Create(CategoryName, Hint, '', dtCategory, TCategoryFrame); + Node := FDemoTreeNodes.AddChildObject(FDemoTreeNodes.GetFirstNode, CategoryName, Category); + if ImgIndex < 0 then + Index := 0 + else + Index := ImgIndex; + Node.ImageIndex := Index; + Node.SelectedIndex := Index; + {$IFNDEF LINUX} + Node.StateIndex := Index; + {$ENDIF} + end; +end; + +procedure TDemos.RegisterDemo(DemoName, DemoHint, DemoDescription, DemoCategory: string; FrameClass: TDemoFrameClass; ImgIndex: integer; FileName: string = ''; SupplementaryDemo: boolean = False); + + function FindCategoryNode(CategoryName: string): TTreeNode; + var + RootNode: TTreeNode; + begin + RootNode := FDemoTreeNodes.GetFirstNode; + if RootNode <> nil then + Result := RootNode.getFirstChild + else + Result := nil; + while Result <> nil do begin + if Result.Text = CategoryName then + break; + Result := Result.getNextSibling; + end; + end; + +{$IFNDEF WIN32} + function CompleteWithSpaces(s: string; ResultLength: word): string; + var + n, i: integer; + begin + result := s; + n := ResultLength - Length(s); + if n > 0 then + for i := 1 to n do + result := result + ' '; + end; +{$ENDIF} + + function ToTableLine(Name, Description, DemoLink: string): string; + begin + {$IFDEF WIN32} + Result := Format(' ' + + '%s%s'#13#10, + [DemoLink, Name, Description]); + {$ELSE} + Result := CompleteWithSpaces(Name, 15) + '- ' + Description + {$IFDEF LINUX}#13{$ELSE}#13#10{$ENDIF}; + {$ENDIF} + end; + +var + CategoryNode, DemoNode: TTreeNode; + Index: integer; + Category, Demo: TDemo; +begin + if SupplementaryDemo then + FSupplementaryDemosDescription.Text := FSupplementaryDemosDescription.Text + ToTableLine(DemoName, DemoDescription, '..\' + DemoCategory + '\' + DemoName) + else begin + CategoryNode := FindCategoryNode(DemoCategory); + if not Assigned(CategoryNode) then + raise Exception.Create('DemoCategory is wrong'); + + Category := TDemo(CategoryNode.Data); + Demo := TDemo.Create(DemoName, DemoHint, DemoDescription, dtDemo, FrameClass, FileName); + DemoNode := FDemoTreeNodes.AddChildObject(CategoryNode, Demo.Name, Demo); + if ImgIndex < 0 then + Index := 1 + else + Index := ImgIndex; + DemoNode.ImageIndex := Index; + DemoNode.SelectedIndex := Index; + {$IFNDEF LINUX} + DemoNode.StateIndex := Index; + {$ENDIF} + + Category.FDescription := Category.FDescription + ToTableLine(DemoName, DemoDescription, IntToStr(DemoNode.AbsoluteIndex)); + end; +end; + +procedure TDemos.Clear; +var + i: integer; +begin + for i := 0 to FDemoTreeNodes.Count - 1 do + if FDemoTreeNodes[i].Data <> nil then + TDemo(FDemoTreeNodes[i].Data).Free; +end; + +function TDemos.GetSelectedDemo: TDemo; +begin + if FSelectedDemo <> nil then + Result := FSelectedDemo + else + raise Exception.Create('No selected demo'); +end; + +function TDemos.GetDemoIndex(AbsoluteIndex: integer): integer; +var + i: integer; +begin + Result := -1; + for i := 0 to FDemoTreeNodes.Count - 1 do + if FDemoTreeNodes[i].AbsoluteIndex = AbsoluteIndex then begin + if FDemoTreeNodes[i].Data <> nil then + Result := i; + Break; + end; +end; + +function TDemos.GetItems(Index: integer): TDemo; +var + i: integer; +begin + i := GetDemoIndex(Index); + if i >= 0 then + Result := TDemo(FDemoTreeNodes[i].Data) + else + raise Exception.Create('Wrong demo index'); +end; + +function TDemos.WrapDescription(Demo: TDemo): TStrings; + +var + CatNode, RootNode: TTreeNode; +begin + Result := TStringList.Create; +{$IFDEF WIN32} + Result.Add(HTMLHeader); + Result.Add('

' + MainDemosHeader + '

'); +{$ELSE} + Result.Add(''); + Result.Add(' ' + MainDemosHeader); + Result.Add(''); +{$ENDIF} + if Demo <> GetItems(0) then //RootCategory + WriteTable(Demo.Name, Demo.Description, Result) + else begin + RootNode := FDemoTreeNodes.GetFirstNode; + CatNode := RootNode.getFirstChild; + while CatNode <> nil do begin + WriteTable(TDemo(CatNode.Data).Name, TDemo(CatNode.Data).Description, Result); + CatNode := CatNode.getNextSibling; + end; +{$IFDEF WIN32} + Result.Add('


' + SupplementaryDemosHeader + '

'); + Result.Add('

' + SupplementaryDemosNote + '

'); +{$ENDIF} + + Result.AddStrings(FSupplementaryDemosDescription); + end; +{$IFDEF WIN32} + Result.Add(HTMLFooter); +{$ENDIF} +end; + +function TDemos.SelectDemo(DemoIndex: integer): TDemo; //Init and show demo by DemoIndex +var + Descriptions: TStrings; +begin + Result := GetItems(DemoIndex); + if (FSelectedDemo <> nil) and (Result <> FSelectedDemo) then + if FSelectedDemo.DemoType <> dtCategory then + FSelectedDemo.FreeFrame //In case of demo selection change we should free demo frame except category description + else + FSelectedDemo.Frame.Hide; + FSelectedDemo := Result; + with FSelectedDemo do + if FFrame = nil then begin + FFrame := FFrameClass.Create(nil); + if DemoType = dtCategory then begin + Descriptions := WrapDescription(FSelectedDemo); + try + TCategoryFrame(FFrame).SetDemoDescriptions(Descriptions); + finally + Descriptions.Free; + end; + end; + end + else + FFrame.Show; +end; + +{TDemo} +constructor TDemo.Create(Name, Hint, Description: string; DemoType: TDemoType; FrameClass: TDemoFrameClass; FileName: string = ''); +begin + inherited Create; + + FName := Name; + if FileName = '' then + FFileName := Name + else + FFileName := FileName; + FHint := Hint; + FDescription := Description; + FFrameClass := FrameClass; + FDemoType := DemoType; +end; + +destructor TDemo.Destroy; +begin + FreeFrame; + + inherited; +end; + +procedure TDemo.LoadDemoCode(Strings: TStrings); +var + FileName: string; +begin + if DemoType = dtCategory then + Strings.Clear + else begin + {$IFDEF LINUX} + FileName := Format('%s/%s/%s.pas', [ExtractFilePath(Application.ExeName), Name, FFileName]); + {$ELSE} + FileName := Format('%s\%s\%s.pas', [ExtractFilePath(Application.ExeName), Name, FFileName]); + {$ENDIF} + + if FileExists(FileName) then + Strings.LoadFromFile(FileName) + else + Strings.Clear; + end; +end; + +procedure TDemo.LoadFormCode(Strings: TStrings); +var + FileName: string; +begin + if DemoType = dtCategory then + Strings.Clear + else begin + {$IFDEF LINUX} + FileName := Format('%s/%s/%s.xfm', [ExtractFilePath(Application.ExeName), Name, FFileName]); + {$ENDIF} + {$IFDEF CLR} + FileName := Format('%s\%s\%s.nfm', [ExtractFilePath(Application.ExeName), Name, FFileName]); + {$ENDIF} + {$IFDEF WIN32} + FileName := Format('%s\%s\%s.dfm', [ExtractFilePath(Application.ExeName), Name, FFileName]); + {$ENDIF} + + if FileExists(FileName) then + Strings.LoadFromFile(FileName) + else + Strings.Clear; + end; +end; + +procedure TDemo.OpenDemoFolder; +{$IFNDEF LINUX} +var + FolderName: string; +begin + if DemoType = dtDemo then begin + FolderName := ExtractFilePath(Application.ExeName) + Name; + ShellExecute(0, 'open', PChar(FolderName), '', '.', SW_SHOW); + end; +end; +{$ELSE} +begin + +end; +{$ENDIF} + +procedure TDemo.FreeFrame; +begin + FFrame.Free; + FFrame := nil; +end; + + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Base/DemoForm.dfm b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Base/DemoForm.dfm new file mode 100644 index 0000000..631bd91 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Base/DemoForm.dfm @@ -0,0 +1,937 @@ +object DemoForm: TDemoForm + Left = 71 + Top = 139 + Width = 957 + Height = 500 + Caption = 'Data Access Components demos' + Color = clSilver + Constraints.MinHeight = 500 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + Scaled = False + ShowHint = True + WindowState = wsMaximized + OnCreate = FormCreate + OnDestroy = FormDestroy + OnResize = FormResize + PixelsPerInch = 96 + TextHeight = 13 + object TVSplitter: TSplitter + Left = 216 + Top = 69 + Height = 374 + Beveled = True + Color = 9790720 + MinSize = 150 + ParentColor = False + OnCanResize = TVSplitterCanResize + OnMoved = TVSplitterMoved + end + object MainPanel: TPanel + Left = 219 + Top = 69 + Width = 730 + Height = 374 + Align = alClient + BevelOuter = bvNone + Constraints.MinWidth = 730 + TabOrder = 2 + object pnDemo: TPanel + Left = 0 + Top = 0 + Width = 730 + Height = 374 + Align = alClient + BevelOuter = bvNone + TabOrder = 1 + end + object pnSource: TPanel + Left = 0 + Top = 0 + Width = 730 + Height = 374 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + Visible = False + end + end + object StatusBar: TStatusBar + Left = 0 + Top = 443 + Width = 949 + Height = 20 + Font.Charset = DEFAULT_CHARSET + Font.Color = clBtnText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + Panels = < + item + Width = 220 + end + item + Width = 100 + end + item + Width = 480 + end + item + Width = 50 + end> + UseSystemFont = False + end + object PanelUnderTree: TPanel + Left = 0 + Top = 69 + Width = 216 + Height = 374 + Align = alLeft + BevelOuter = bvNone + TabOrder = 0 + object TreeView: TTreeView + Left = 0 + Top = 22 + Width = 351 + Height = 352 + Align = alLeft + HideSelection = False + HotTrack = True + Images = ImageList1 + Indent = 21 + ParentShowHint = False + ReadOnly = True + ShowHint = True + TabOrder = 0 + OnChange = TreeViewChange + OnClick = TreeViewClick + OnKeyDown = TreeViewKeyDown + OnMouseMove = TreeViewMouseMove + end + object ToolBar: TToolBar + Left = 0 + Top = 0 + Width = 216 + Height = 22 + AutoSize = True + ButtonWidth = 28 + Caption = 'ToolBar' + DisabledImages = ilDisabledButtons + EdgeInner = esNone + EdgeOuter = esNone + Flat = True + Images = ilButtons + TabOrder = 1 + object tbBrowseBack: TToolButton + Left = 0 + Top = 0 + Hint = 'Back' + Caption = ' Back ' + DropdownMenu = BackHistoryPopup + ImageIndex = 0 + Style = tbsDropDown + OnClick = tbBrowseBackClick + end + object tbBrowseForward: TToolButton + Left = 41 + Top = 0 + Hint = 'Forward' + DropdownMenu = ForwardHistoryPopup + ImageIndex = 1 + Style = tbsDropDown + OnClick = tbBrowseForwardClick + end + end + end + object pnTopLabel: TPanel + Left = 0 + Top = 0 + Width = 949 + Height = 41 + Align = alTop + BevelOuter = bvNone + TabOrder = 3 + object lbTitle: TLabel + Left = 0 + Top = 0 + Width = 949 + Height = 42 + Cursor = crArrow + Align = alTop + Caption = 'DAC demos' + Color = 9790720 + Constraints.MinWidth = 130 + Font.Charset = RUSSIAN_CHARSET + Font.Color = clWhite + Font.Height = -35 + Font.Name = 'Verdana' + Font.Style = [fsBold, fsItalic] + ParentColor = False + ParentFont = False + OnMouseMove = lbTitleMouseMove + end + object lbAbout: TLabel + Left = 854 + Top = 12 + Width = 34 + Height = 13 + Caption = 'About' + Color = 9790720 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [fsBold, fsUnderline] + ParentColor = False + ParentFont = False + OnClick = lbAboutClick + OnMouseMove = lbAboutMouseMove + end + end + object Panel2: TPanel + Left = 0 + Top = 41 + Width = 949 + Height = 28 + Align = alTop + BevelOuter = bvNone + TabOrder = 4 + object Shape1: TShape + Left = 0 + Top = 25 + Width = 949 + Height = 3 + Align = alBottom + Brush.Color = 9790720 + Pen.Color = clBtnFace + end + object Panel1: TPanel + Left = 1 + Top = 1 + Width = 375 + Height = 24 + BevelOuter = bvNone + Color = 9790720 + TabOrder = 0 + object sbConnect: TSpeedButton + Left = 1 + Top = 1 + Width = 100 + Height = 22 + Hint = 'Connect to database' + Caption = 'Connect' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [fsBold] + Glyph.Data = { + F6050000424DF60500000000000036000000280000001E000000100000000100 + 180000000000C005000000000000000000000000000000000000800080800080 + 8000808000808000808000808000808000808000808000804B40388000808000 + 8080008080008080008080008080008080008080008080008080008080008080 + 00808000803E3E3E800080800080800080800080000080008080008080008080 + 00808000808000808000808000808000808000808000804C40373E352D800080 + 8000808000808000808000808000808000808000808000808000808000808000 + 808000803E3E3E33333380008080008000008000808000808000808000808000 + 808000808000808000807E6A5C80008066574B594B414C403880008080008080 + 0080800080800080800080800080800080800080800080686868800080555555 + 4949493E3E3E8000808000800000800080800080800080800080800080800080 + 8000808000808000807E6B5D72615466564B594B428000808000808000808000 + 808000808000808000808000808000808000808000806868685E5E5E54545449 + 49498000808000800000800080A2C8D864A8C0608D9F5D83964A768D346D8C30 + 70925C8AA38874647E6B5C73615466564B800080800080800080C8C8C8A7A7A7 + 8D8D8D8484847878787070707373738C8C8C7171716868685F5F5F5454548000 + 808000800000800080638CA53FBCE884D5E8A1EBF673E4FF24BEF3039FDE148B + BE45729080008080008080008066574B8000808000808E8E8EBBBBBBD1D1D1E6 + E6E6DFDFDFBCBCBCA0A0A08D8D8D767676800080800080800080555555800080 + 00008000806B94AD44C4F090EAFAA1EBF671D9F424BCF201A7E8039CDA2A6384 + 800080800080800080736154800080800080969696C3C3C3E4E4E4E6E6E6D5D5 + D5BBBBBBA8A8A89D9D9D6666668000808000808000805F5F5F80008000008000 + 806B94AD44C4F08DE4F4A1EBF670D7F224B9EE01A7E8039CDA2F688897806F91 + 7A6A887464800080800080800080969696C3C3C3DFDFDFE6E6E6D3D3D3B8B8B8 + A8A8A89D9D9D6B6B6B7D7D7D77777771717180008080008000008000806B9CAD + 3FBCE88EE4F5A1EBF670D7F224B9EE01A7E8039CDA306B8A8000808000808000 + 808000808000808000809B9B9BBBBBBBDFDFDFE6E6E6D3D3D3B8B8B8A8A8A89D + 9D9D6D6D6D80008080008080008080008080008000008000806B9CB53BB8E67E + E4FEA1EBF672D9F224B9EE01A7E8039CDA326D8D800080800080800080800080 + 8000808000809E9E9EB8B8B8E0E0E0E6E6E6D5D5D5B8B8B8A8A8A89D9D9D7070 + 708000808000808000808000808000800000800080739CB53BB8E67EE4FEA1EB + F66FD7F21FB7EE01A7E8039CDA346F8F80008080008080008080008080008080 + 00809E9E9EB8B8B8E0E0E0E6E6E6D3D3D3B6B6B6A8A8A89D9D9D727272800080 + 800080800080800080800080000080008073A5BD3BB8E67EE4FEA0EAF56ED6F2 + 1FB7EE01A7E8039CDA317092800080800080800080800080800080800080A6A6 + A6B8B8B8E0E0E0E5E5E5D2D2D2B6B6B6A8A8A89D9D9D73737380008080008080 + 0080800080800080000080008073A5BD58C9E78CECFFA0EAF5A6EDF894E7F871 + D9F63CBDE9437C97800080800080800080800080800080800080A6A6A6C5C5C5 + E7E7E7E5E5E5E8E8E8E2E2E2D6D6D6BCBCBC7D7D7D8000808000808000808000 + 8080008000008000806691A2A0DFEAC5F9FDC5F9FDC5F9FDC5F9FDC5F9FDA0DF + EA6691A2800080800080800080800080800080800080919191DBDBDBF4F4F4F4 + F4F4F4F4F4F4F4F4F4F4F4DBDBDB919191800080800080800080800080800080 + 0000800080B8D1DB84AFBF6FA2B46B9BAE6C9DAF6B9BAE6FA2B484AFBFB8D1DB + 800080800080800080800080800080800080D1D1D1AFAFAFA1A1A19B9B9B9D9D + 9D9B9B9BA1A1A1AFAFAFD1D1D180008080008080008080008080008000008000 + 8080008080008080008080008080008080008080008080008080008080008080 + 0080800080800080800080800080800080800080800080800080800080800080 + 8000808000808000808000808000808000808000808000800000} + NumGlyphs = 2 + ParentFont = False + Transparent = False + OnClick = sbConnectClick + end + object sbDisconnect: TSpeedButton + Left = 102 + Top = 1 + Width = 100 + Height = 22 + Hint = 'Dsisconnect from database' + Caption = 'Disconnect' + Enabled = False + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [fsBold] + Glyph.Data = { + 9A050000424D9A0500000000000036000000280000001E0000000F0000000100 + 1800000000006405000000000000000000000000000000000000800080800080 + 800080800080800080800080800080AFBBF7800080800080800080CFCBE38000 + 80800080800080800080800080800080800080800080800080800080CBCBCB80 + 0080800080800080D2D2D2800080800080800080000080008080008080008080 + 0080800080800080CFCBE31140FD6178EE8000806176EA3154F2CFCBE3800080 + 800080800080800080800080800080800080800080D2D2D27373739898988000 + 809696967F7F7FD2D2D280008080008000008000808000808000808000808000 + 808000808000803157F90134FF214BF90134FF3155F480008080008080008080 + 00808000808000808000808000808000808000808383836B6B6B7A7A7A6B6B6B + 8080808000808000808000800000800080A2C8D864A8C0608D9F5D83964A768D + 346D8CFFFFFF1140FD0134FF113FFC800080800080800080800080800080C8C8 + C8A7A7A78D8D8D848484787878707070FFFFFF7373736B6B6B72727280008080 + 00808000808000800000800080638CA53FBCE884D5E8A1EBF673E4FFFFFFFF61 + 7CF60134FF0134FF0134FF6178EE8000808000808000808000808E8E8EBBBBBB + D1D1D1E6E6E6DFDFDFFFFFFF9D9D9D6B6B6B6B6B6B6B6B6B9898988000808000 + 8080008000008000806B94AD44C4F090EAFAA1EBF671D9F4BFC8F70134FF3158 + FBFFFFFF3157F91140FDBFC8F7800080800080800080969696C3C3C3E4E4E4E6 + E6E6D5D5D5D5D5D56B6B6B848484FFFFFF838383737373D5D5D5800080800080 + 00008000806B94AD44C4F08DE4F4A1EBF670D7F224B9EEAFBBF7FFFFFF2F6888 + 800080CFCBE3800080800080800080800080969696C3C3C3DFDFDFE6E6E6D3D3 + D3B8B8B8CBCBCBFFFFFF6B6B6B800080D2D2D280008080008080008000008000 + 806B9CAD3FBCE88EE4F5A1EBF670D7F224B9EE01A7E8039CDA306B8A80008080 + 00808000808000808000808000809B9B9BBBBBBBDFDFDFE6E6E6D3D3D3B8B8B8 + A8A8A89D9D9D6D6D6D80008080008080008080008080008000008000806B9CB5 + 3BB8E67EE4FEA1EBF672D9F224B9EE01A7E8039CDA326D8D8000808000808000 + 808000808000808000809E9E9EB8B8B8E0E0E0E6E6E6D5D5D5B8B8B8A8A8A89D + 9D9D7070708000808000808000808000808000800000800080739CB53BB8E67E + E4FEA1EBF66FD7F21FB7EE01A7E8039CDA346F8F800080800080800080800080 + 8000808000809E9E9EB8B8B8E0E0E0E6E6E6D3D3D3B6B6B6A8A8A89D9D9D7272 + 72800080800080800080800080800080000080008073A5BD3BB8E67EE4FEA0EA + F56ED6F21FB7EE01A7E8039CDA31709280008080008080008080008080008080 + 0080A6A6A6B8B8B8E0E0E0E5E5E5D2D2D2B6B6B6A8A8A89D9D9D737373800080 + 800080800080800080800080000080008073A5BD58C9E78CECFFA0EAF5A6EDF8 + 94E7F871D9F63CBDE9437C97800080800080800080800080800080800080A6A6 + A6C5C5C5E7E7E7E5E5E5E8E8E8E2E2E2D6D6D6BCBCBC7D7D7D80008080008080 + 008080008080008000008000806691A2A0DFEAC5F9FDC5F9FDC5F9FDC5F9FDC5 + F9FDA0DFEA6691A2800080800080800080800080800080800080919191DBDBDB + F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4DBDBDB9191918000808000808000808000 + 808000800000800080B8D1DB84AFBF6FA2B46B9BAE6C9DAF6B9BAE6FA2B484AF + BFB8D1DB800080800080800080800080800080800080D1D1D1AFAFAFA1A1A19B + 9B9B9D9D9D9B9B9BA1A1A1AFAFAFD1D1D1800080800080800080800080800080 + 0000800080800080800080800080800080800080800080800080800080800080 + 8000808000808000808000808000808000808000808000808000808000808000 + 808000808000808000808000808000808000808000808000808000800000} + NumGlyphs = 2 + ParentFont = False + Transparent = False + OnClick = sbDisconnectClick + end + object btCreate: TSpeedButton + Left = 203 + Top = 1 + Width = 85 + Height = 22 + Hint = 'Create database objects' + Caption = 'Create' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [fsBold] + Glyph.Data = { + 36060000424D3606000000000000360000002800000020000000100000000100 + 1800000000000006000000000000000000000000000000000000800080800080 + AC9584785E4B785E4B785E4B785E4B785E4B785E4B785E4B785E4B785E4B785E + 4B785E4B785E4B8000808000808000809292925B5B5B5B5B5B5B5B5B5B5B5B5B + 5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B800080800080800080 + AC9584FEFCFCFAEEE8F8E9E2F7E5DCF5E0D6F4DCD0F3D7C9F2D2C4F1CFBFEFCB + B9EEC8B5785E4B800080800080800080929292FCFCFCEDEDEDE8E8E8E4E4E4DF + DFDFDBDBDBD5D5D5D1D1D1CDCDCDC9C9C9C6C6C65B5B5B800080800080800080 + AC9584FFFFFFFEFDFBFDF9F7FCF5F2FAF1ECF9EBE5F7E6DEF6E1D7F4DBCFF3D6 + C9F0CBB9785E4B800080800080800080929292FFFFFFFCFCFCF8F8F8F4F4F4F0 + F0F0EAEAEAE5E5E5E0E0E0DADADAD5D5D5C9C9C95B5B5B800080800080800080 + AD9786FFFFFFFFFFFFFEFDFBFEF9F7FCF5F29B9491020202F8E6DEF6E1D7F4DB + CFF0CEBD785E4B800080800080800080949494FFFFFFFFFFFFFCFCFCF8F8F8F4 + F4F4939393020202E5E5E5E0E0E0DADADACCCCCC5B5B5B800080800080800080 + AF9A89A8A6A3020202868381D8D6D6020202020202D6CCC8F9EBE50202020202 + 02A38D82785E4B800080800080800080979797A5A5A5020202828282D6D6D602 + 0202020202CBCBCBEAEAEA0202020202028C8C8C5B5B5B800080800080800080 + B29C8CD9D9D9FFFFFF020202020202FFFDFBD7D5D2020202D6CCC9020202F8E6 + DEF2D5C7785E4B800080800080800080999999D9D9D9FFFFFF020202020202FC + FCFCD4D4D4020202CCCCCC020202E5E5E5D3D3D35B5B5B800080800080800080 + B59F8FFFFFFF020202FFFFFF020202FFFFFFFEFCFC020202D6D0CE020202FAEC + E5F4D9CD785E4B8000808000808000809C9C9CFFFFFF020202FFFFFF020202FF + FFFFFCFCFC020202D0D0D0020202EBEBEBD8D8D85B5B5B800080800080800080 + B9A393020202D9D9D9FFFFFF020202D9D9D9FFFFFF020202D7D4D2020202FBF0 + EBF5DDD1785E4B800080800080800080A0A0A0020202D9D9D9FFFFFF020202D9 + D9D9FFFFFF020202D3D3D3020202EFEFEFDCDCDC5B5B5B800080800080800080 + BBA697D9D9D9020202020202D9D9D9020202020202B9B9B9FFFCFC020202FCF5 + F1F6E2D8785E4B800080800080800080A3A3A3D9D9D9020202020202D9D9D902 + 0202020202B9B9B9FCFCFC020202F4F4F4E1E1E15B5B5B8000808000802AAFDA + 44CBF06BE5FF3BBEE599D8DF91E1F681D0E9FFFFFFFFFFFFFFFFFFFEFCFBFDF9 + F7D9CBC0785E4B800080800080ADADADC7C7C7DFDFDFBBBBBBD3D3D3DEDEDECE + CECEFFFFFFFFFFFFFFFFFFFBFBFBF8F8F8C9C9C95B5B5B80008080008052DAFB + 32B7DF7FE9FD5FC6E693F0FF31B6DFA0E8F9FFFFFFFFFFFFFFFFFFFFFFFFFEFC + FCD9CBC0785E4B800080800080D4D4D4B4B4B4E3E3E3C4C4C4EAEAEAB3B3B3E5 + E5E5FFFFFFFFFFFFFFFFFFFFFFFFFCFCFCC9C9C95B5B5B8000808000807CEAFF + 93F1FFBFF8FFAFE8F4C7FBFF93F1FF9FF0FFFFFFFFFFFFFFFFFFFFFAF0EB785E + 4B785E4B785E4B800080800080E4E4E4EAEAEAF3F3F3E5E5E5F6F6F6EAEAEAEB + EBEBFFFFFFFFFFFFFFFFFFEFEFEF5B5B5B5B5B5B5B5B5B80008080008021AAD9 + 55BFE1AFE8F4F0FFFDB4EBF655BFE138BBE5FFFFFFFFFFFFFFFFFF967E6BF4DB + CED1BAAF785E4B800080800080A9A9A9BDBDBDE5E5E5FCFCFCE8E8E8BDBDBDB9 + B9B9FFFFFFFFFFFFFFFFFF7A7A7AD9D9D9B9B9B95B5B5B8000808000807CEAFF + 96F3FFC7FBFFADE5F3C3FBFF96F3FF8BD7E2FEFDFBFDFBF9FDF9F6967E6BD1BA + AFAC9584800080800080800080E4E4E4ECECECF6F6F6E3E3E3F6F6F6ECECECD1 + D1D1FCFCFCFAFAFAF8F8F87A7A7AB9B9B992929280008080008080008051D9FA + 33B8E08CF1FF5AC2E390F1FF30B6DF4BD2F4BBA696B9A293B69F8FB29C8BB099 + 88800080800080800080800080D3D3D3B5B5B5EAEAEAC0C0C0EAEAEAB3B3B3CD + CDCDA3A3A3A0A0A09C9C9C9999999696968000808000808000808000802AAFDA + 44CBF07CEAFF25AEDB72E8FF4CD4F52AAFDA8000808000808000808000808000 + 80800080800080800080800080ADADADC7C7C7E4E4E4ACACACE1E1E1CECECEAD + ADAD800080800080800080800080800080800080800080800080} + NumGlyphs = 2 + ParentFont = False + Transparent = False + OnClick = btScriptClick + end + object btDrop: TSpeedButton + Left = 289 + Top = 1 + Width = 85 + Height = 22 + Hint = 'Drop database objects' + Caption = 'Drop' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [fsBold] + Glyph.Data = { + 36060000424D3606000000000000360000002800000020000000100000000100 + 1800000000000006000000000000000000000000000000000000800080800080 + A37A77A37A77A37A77A37A77A37A77A37A77A37A77A37A77A37A77A37A77A37A + 77A37A779063608000808000808000807D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D + 7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D676767800080800080800080 + A67E78FFE8D2FFE8D2FFE8D1FFE6CEFFE3C5FFDEBDFFDDBAFFD8B2FFD6AEFFD2 + A5FFD2A3936662800080800080800080808080E3E3E3E3E3E3E3E3E3E1E1E1DD + DDDDD7D7D7D6D6D6D0D0D0CECECEC9C9C9C8C8C8696969800080800080800080 + AB817AFFE8D2FFE8D2FFE6CEFFE3C6FFE1C2FFDDBBFFDAB6FFD7B0FFD4A9FFD2 + A4FFD2A3966965800080800080800080838383E3E3E3E3E3E3E1E1E1DDDDDDDB + DBDBD6D6D6D3D3D3CFCFCFCBCBCBC9C9C9C8C8C86C6C6C800080800080800080 + B0837CFFECD9FFECD9FFE8D2FFE6CEFFE3C6FFE1C2FFDDBBFFD9B4FFD7B0FFD4 + A9FFD4A99A6C67800080800080800080858585E8E8E8E8E8E8E3E3E3E1E1E1DD + DDDDDBDBDBD6D6D6D2D2D2CFCFCFCBCBCBCBCBCB6F6F6F800080800080800080 + B6897FFFEEDDFFEEDDFFECD9DFD1D8FFE6CEFFE3C6FFE1C2EFD2BFFFD9B4FFD7 + B0FFD7B09E6F698000808000808000808A8A8AEAEAEAEAEAEAE8E8E8D4D4D4E1 + E1E1DDDDDDDBDBDBCFCFCFD2D2D2CFCFCFCFCFCF727272800080800080800080 + BC8E81FFF2E4FFF2E4CFCBE31342FD637AEEFFE6CE6378EA3356F2EFD2BFFFD9 + B4FFD9B4A2726B8000808000808000808F8F8FEFEFEFEFEFEFD2D2D27474749A + 9A9AE1E1E1979797808080CFCFCFD2D2D2D2D2D2757575800080800080800080 + C39581FFF4E8FFF4E8EFE6E63359F90336FF234DF90336FF3357F4EFD6C5FFDD + BBFFDDBBA5766D800080800080800080949494F1F1F1F1F1F1E6E6E68484846C + 6C6C7B7B7B6C6C6C828282D3D3D3D6D6D6D6D6D6787878800080800080800080 + CA9B84FFF7F0FFF7F0FFF4E8EFE6E61342FD0336FF1341FCEFDBD0FFE3C6FFE0 + C1FFE1C2A8796F800080800080800080999999F5F5F5F5F5F5F1F1F1E6E6E674 + 74746C6C6C747474D9D9D9DDDDDDDADADADBDBDB7B7B7B800080800080800080 + D2A187FFF9F4FFF9F4FFF7F0637EF60336FF0336FF0336FF637AEEFFE6CEFFE3 + C6FFE3C6AC7C718000808000808000809E9E9EF8F8F8F8F8F8F5F5F59F9F9F6C + 6C6C6C6C6C6C6C6C9A9A9AE1E1E1DDDDDDDDDDDD7D7D7D800080800080800080 + D9A88AFFFDFBFFFDFBBFC8F70336FF335AFBDFDAE73359F91342FDDFD1D8FFE6 + CEFFE6CEAE7E74800080800080800080A4A4A4FCFCFCFCFCFCD5D5D56C6C6C86 + 8686DEDEDE848484747474D4D4D4E1E1E1E1E1E1808080800080800080800080 + DFAE8CFFFFFFFFFFFFFFFDFBAFBBF7EFEBF0FFF4E8EFE6E6CFCBE3FFECD9FFC8 + C2FFB0B0B08075800080800080800080A9A9A9FFFFFFFFFFFFFCFCFCCBCBCBEC + ECECF1F1F1E6E6E6D2D2D2E8E8E8CCCCCCB8B8B8818181800080800080800080 + E5B38FFDFDFDFDFDFDFFFFFFFFFFFFFFFFFEFFFAF6FFF9F3FFF5EAF4DECEB281 + 76B28176B28176800080800080800080ADADADFCFCFCFCFCFCFFFFFFFFFFFFFE + FEFEF9F9F9F7F7F7F2F2F2DBDBDB838383838383838383800080800080800080 + EAB891FEFEFEFEFEFEFFFFFFFFFFFFFFFFFFFFFFFEFFFAF6FFF9F3F5E1D2B281 + 76EDA757D2AA95800080800080800080B1B1B1FEFEFEFEFEFEFFFFFFFFFFFFFF + FFFFFEFEFEF9F9F9F7F7F7DEDEDE838383969696A8A8A8800080800080800080 + EFBC92FFFFFFFFFFFFFCFCFCFAFAFAF7F7F7F5F5F5F2F1F1F0EDEAE9DAD0B281 + 76D9B198800080800080800080800080B5B5B5FFFFFFFFFFFFFBFBFBFAFAFAF7 + F7F7F5F5F5F1F1F1ECECECD8D8D8838383ADADAD800080800080800080800080 + F2BF94DCA987DCA987DCA987DCA987DCA987DCA987DCA987DCA987DCA987B281 + 76800080800080800080800080800080B7B7B7A4A4A4A4A4A4A4A4A4A4A4A4A4 + A4A4A4A4A4A4A4A4A4A4A4A4A4A4838383800080800080800080800080800080 + 8000808000808000808000808000808000808000808000808000808000808000 + 8080008080008080008080008080008080008080008080008080008080008080 + 0080800080800080800080800080800080800080800080800080} + NumGlyphs = 2 + ParentFont = False + Transparent = False + OnClick = btScriptClick + end + end + object cbDebug: TCheckBox + Left = 871 + Top = 8 + Width = 68 + Height = 13 + Hint = 'Set Debug property for connection and query components' + Caption = 'Debug' + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentColor = False + ParentFont = False + TabOrder = 1 + OnClick = cbDebugClick + end + object pnShowSource: TPanel + Left = 440 + Top = 1 + Width = 259 + Height = 24 + BevelOuter = bvNone + Color = 9790720 + TabOrder = 2 + object sbDemo: TSpeedButton + Left = 1 + Top = 1 + Width = 85 + Height = 22 + Hint = 'Show demo' + GroupIndex = 1 + Down = True + Caption = 'Demo' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [fsBold] + ParentFont = False + Transparent = False + OnClick = sbDemoClick + end + object sbSource: TSpeedButton + Left = 87 + Top = 1 + Width = 85 + Height = 22 + Hint = 'Show demo source code' + GroupIndex = 1 + Caption = 'Demo source' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [fsBold] + ParentFont = False + Transparent = False + OnClick = sbSourceClick + end + object sbFormText: TSpeedButton + Left = 173 + Top = 1 + Width = 85 + Height = 22 + Hint = 'Show demo form as text' + GroupIndex = 1 + Caption = 'Form as text' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [fsBold] + ParentFont = False + Transparent = False + OnClick = sbFormTextClick + end + end + object pnOpenDemoDir: TPanel + Left = 720 + Top = 1 + Width = 138 + Height = 24 + BevelOuter = bvNone + Color = 9790720 + TabOrder = 3 + object sbOpenDemoDir: TSpeedButton + Left = 1 + Top = 1 + Width = 136 + Height = 22 + Hint = 'Open folder containing the demo source files' + Caption = 'Open demo folder' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + Glyph.Data = { + 36030000424D3603000000000000360000002800000010000000100000000100 + 1800000000000003000000000000000000000000000000000000FFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFF728890628190627A81527281526272425A62424A5232 + 3A42223232222232121A22121212121222FFFFFFFFFFFFFFFFFF72889090A0B0 + 72B0D00290D00290D00290D00290C01288C01281B01281B0227AA0227290224A + 62FFFFFFFFFFFFFFFFFF81889081C0D090A8B081E0FF62D0FF52C8FF52C8FF42 + C0F032B0F032A8F022A0E01290D0226A815B6369FFFFFFFFFFFF8190A081D0F0 + 90A8B090C0D072D8FF62D0FF62D0FF52C8FF52C0FF42B8F032B0F032A8F01288 + D0224A62FFFFFFFFFFFF8190A081D8F081C8E090A8B081E0FF72D0FF62D8FF62 + D0FF62D0FF52C8FF42C0F042B8F032B0F0226A816C8B9AFFFFFF8198A090E0F0 + 90E0FF90A8B090B8C072D8FF62D8FF62D8FF62D8FF62D0FF52D0FF52C8FF42B8 + F032A0E04B6979FFFFFF8198A090E0F0A0E8FF81C8E090A8B081E0FF81E0FF81 + E0FF81E0FF81E0FF81E0FF81E0FF72D8FF72D8FF52A8D087929D90A0A0A0E8F0 + A0E8FFA0E8FF90B0C090B0C090A8B090A8B081A0B081A0B08198A08198A08190 + A08190A081889072889090A0B0A0E8F0A0F0FFA0E8FFA0E8FF81D8FF62D8FF62 + D8FF62D8FF62D8FF62D8FF62D8FF728890FFFFFFFFFFFFFFFFFF90A0B0A0F0F0 + B0F0F0A0F0FFA0E8FFA0E8FF72D8FF90A0A08198A08198A08190A08190907288 + 90FFFFFFFFFFFFFFFFFF90A8B0A0D0E0B0F0F0B0F0F0A0F0FFA0E8FF90A0B0B3 + C9CEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF906A52906A52906A52CDD6DA90A8B0 + 90A8B090A8B090A8B090A8B0B6C5CAFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFD2C7C6906A52906A52FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFF907A62C8BAB3FFFFFFFFFFFFA09081D2CDC7907A62FFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD8D8D3A09081A08881B098 + 81C5BEB7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF} + ParentFont = False + Transparent = False + OnClick = sbOpenDemoDirClick + end + end + end + object ImageList1: TImageList + Height = 17 + Left = 616 + Top = 8 + end + object BackHistoryPopup: TPopupMenu + OnPopup = BackHistoryPopupPopup + Left = 8 + Top = 133 + end + object ForwardHistoryPopup: TPopupMenu + OnPopup = ForwardHistoryPopupPopup + Left = 40 + Top = 133 + end + object ilButtons: TImageList + Left = 88 + Top = 141 + Bitmap = { + 494C010102000400040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000001000000001002000000000000010 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000C0D0 + C9007DAC86002C7D31000269090002640700005E0400206323006D967200C3CF + CB0000000000000000000000000000000000000000000000000000000000C0D0 + C9007DAC86002C7D31000269090002640700005E0400206323006D967200C3CF + CB00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000AEC7B600328C + 36000C98220011B62F000DB4250009B21C0006B0160001AE0B00009107001065 + 1400B4C6BB000000000000000000000000000000000000000000AEC7B600328C + 36000C98220011B62F000DB4250009B21C0006B0160001AE0B00009107001065 + 1400B4C6BB000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000B0C9B800178C23001CB6 + 45001BBA440017B83A0012B630003CC352001AB72D0008B21B0004AF110000AD + 090000670500B6C7BD00000000000000000000000000B0C9B800178C23001CB6 + 45001BBA440017B83A005DCD720079D588000BB3210008B21B0004AF110000AD + 090000670500B6C7BD0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000CCDDD30043A4480023B7530024BE + 580021BD51001CBA45006FD38800FFFFFF00B5E8BE000EB426000AB21D0007B1 + 180002AE0D0010691400C9D5D00000000000CCDDD30043A4480023B7530024BE + 580021BD51001CBA4500D4F2DC00FFFFFF00A6E4B1000EB426000AB21D0007B1 + 180002AE0D0010691400C9D5D000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000009CCEA10017A437002EC26B002CC1 + 660025BF5A0076D69500FFFFFF00FFFFFF009AE0AB0013B6310011B62E000BB3 + 210009B21C00078E120086A88B00000000009CCEA10017A437002EC26B002CC1 + 660025BF5A001CBB470075D69400FFFFFF00FFFFFF00A6E4B10011B62E000BB3 + 210009B21C00078E120086A88B00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000040B1410028BB5E002EC26B002EC2 + 6B007CD9A100FFFFFF00FFFFFF00ACE6BF001CBB47001ABA430015B8380012B6 + 30000FB52A000AB21D00227A27000000000040B1410028BB5E002EC26B002EC2 + 6B001CBB47001CBB470025BE590076D69700FFFFFF00FFFFFF00A6E4B10014B7 + 34000FB52A000AB21D00227A2700000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000040B141002EC26B002EC26B007CD9 + A300FFFFFF00FFFFFF00F1FBF50092DFAC0092DFAC008EDDA3008DDDA2008BDC + 9D0014B7340011B62F00057710000000000040B141002EC26B0062D19000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00A8E5 + B60014B7340011B62F0005771000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000040B841002EC26B0048CA7E00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF001BBA440017B83A00097E14000000000040B841002EC26B0062D19000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00D5F3 + DE001BBA440017B83A00097E1400000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000040BB410033C36E002EC26B007CD9 + A300FFFFFF00FFFFFF00FFFFFF00A4E4BE0097E1B50097E1B50095E0B10092DF + AC0021BD51001CBA4500077F13000000000040BB410033C36E002EC26B002EC2 + 6B002EC26B002EC26B002EC26B0089DDAC00FFFFFF00FFFFFF00D7F3E2002EC2 + 6B0021BD51001CBA4500077F1300000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000040BB410044C665003FC776002EC2 + 6B007CD9A300FFFFFF00FFFFFF00D8F4E3003BC674002EC26B002EC26B002CC1 + 660025BF5A0023BE5700238B2C000000000040BB410044C665003FC776002EC2 + 6B002EC26B002EC26B0055CD8700F2FBF600FFFFFF00D8F4E3002EC26B002CC1 + 660025BF5A0023BE5700238B2C00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000A2D7A50031BE3C0072D5950052CC + 820035C470007CD9A300FFFFFF00FFFFFF00A4E4BE002EC26B002EC26B002EC2 + 6B002DC26A0033963B009EC8A40000000000A2D7A50031BE3C0072D5950052CC + 820035C470002EC26B00BEECD100FFFFFF00D8F4E3002EC26B002EC26B002EC2 + 6B002DC26A001AA73E009EC8A400000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000D7E7DC0040C2400075D6830082DA + A00066D28E0044C879007FDAA400F2FBF60089DDAC002EC26B002EC26B002EC2 + 6B002BBF640023962900C3E2C70000000000D7E7DC0040BB410075D6830082DA + A00066D28E002EC26B002EC26B0097E1B5002EC26B002EC26B002EC26B002EC2 + 6B002BBF640023962900C3E2C700000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000C9E3CD0040C2400077D7 + 800098E0AD0076D798005ACE86003AC573002EC26B002EC26B002EC26B0028BD + 5E00189E2600C9E4CD00000000000000000000000000C9E3CD0040BB410077D7 + 800098E0AD0076D798005ACE86003AC573002EC26B002EC26B002EC26B0028BD + 5E00189E2600C9E4CD0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000CAE4CE0040C2 + 400047CB490084DA91008CDCA6006AD391004ECB7F002DBF610017B1360043B5 + 4700CAE5CE000000000000000000000000000000000000000000CAE4CE0040BB + 410047CB490084DA91008CDCA6006AD391004ECB7F002DBF610017B1360043B5 + 4700CAE5CE000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000DBE9 + DF009AD99D0040C2400040C2400040C2400040C2400040C240009AD99D00DBEA + DE0000000000000000000000000000000000000000000000000000000000DBE9 + DF009AD99D0040C2400040C2400040C2400040C2400040C240009AD99D00DBEA + DE00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000100000000100010000000000800000000000000000000000 + 000000000000000000000000FFFFFF00FFFFFFFF00000000E00FE00F00000000 + C007C00700000000800380030000000000010001000000000001000100000000 + 0001000100000000000100010000000000010001000000000001000100000000 + 0001000100000000000100010000000000010001000000008003800300000000 + C007C00700000000E00FE00F0000000000000000000000000000000000000000 + 000000000000} + end + object ilDisabledButtons: TImageList + Left = 120 + Top = 141 + Bitmap = { + 494C010102000400040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000001000000001002000000000000010 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000CCCC + CC009B9B9B005D5D5D00404040003D3D3D00383838004848480086868600CCCC + CC0000000000000000000000000000000000000000000000000000000000CCCC + CC009B9B9B005D5D5D00404040003D3D3D00383838004848480086868600CCCC + CC00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000BFBFBF006868 + 6800656565007B7B7B0076767600727272006F6F6F006A6A6A00575757004343 + 4300C0C0C0000000000000000000000000000000000000000000BFBFBF006868 + 6800656565007B7B7B0076767600727272006F6F6F006A6A6A00575757004343 + 4300C0C0C0000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000C1C1C1005F5F5F008383 + 830085858500808080007B7B7B00929292007C7C7C00727272006C6C6C006868 + 68003E3E3E00C2C2C200000000000000000000000000C1C1C1005F5F5F008383 + 83008585850080808000A5A5A500B3B3B30074747400727272006C6C6C006868 + 68003E3E3E00C2C2C20000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000D8D8D8007D7D7D00888888008E8E + 8E008B8B8B0085858500B1B1B100FFFFFF00D5D5D50077777700727272007070 + 70006A6A6A0045454500D2D2D20000000000D8D8D8007D7D7D00888888008E8E + 8E008B8B8B0085858500E8E8E800FFFFFF00CDCDCD0077777700727272007070 + 70006A6A6A0045454500D2D2D200000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000BBBBBB0073737300979797009595 + 95008F8F8F00B7B7B700FFFFFF00FFFFFF00C8C8C8007C7C7C007B7B7B007474 + 740072727200595959009B9B9B0000000000BBBBBB0073737300979797009595 + 95008F8F8F0086868600B7B7B700FFFFFF00FFFFFF00CDCDCD007B7B7B007474 + 740072727200595959009B9B9B00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000828282008E8E8E00979797009797 + 9700BDBDBD00FFFFFF00FFFFFF00D3D3D30086868600848484007F7F7F007B7B + 7B0079797900727272005757570000000000828282008E8E8E00979797009797 + 970086868600868686008E8E8E00B8B8B800FFFFFF00FFFFFF00CDCDCD007D7D + 7D00797979007272720057575700000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000828282009797970097979700BEBE + BE00FFFFFF00FFFFFF00F8F8F800C7C7C700C7C7C700C2C2C200C2C2C200C0C0 + C0007D7D7D007B7B7B004B4B4B00000000008282820097979700B1B1B100FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00D0D0 + D0007D7D7D007B7B7B004B4B4B00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008787870097979700A4A4A400FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00858585008080800051515100000000008787870097979700B1B1B100FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00E9E9 + E900858585008080800051515100000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000888888009999990097979700BEBE + BE00FFFFFF00FFFFFF00FFFFFF00D1D1D100CBCBCB00CBCBCB00C9C9C900C7C7 + C7008B8B8B008585850051515100000000008888880099999900979797009797 + 9700979797009797970097979700C5C5C500FFFFFF00FFFFFF00EAEAEA009797 + 97008B8B8B008585850051515100000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000888888009A9A9A009F9F9F009797 + 9700BEBEBE00FFFFFF00FFFFFF00EBEBEB009E9E9E0097979700979797009595 + 95008F8F8F008E8E8E006363630000000000888888009A9A9A009F9F9F009797 + 97009797970097979700AAAAAA00F8F8F800FFFFFF00EBEBEB00979797009595 + 95008F8F8F008E8E8E0063636300000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000C2C2C20087878700B6B6B600A8A8 + A8009B9B9B00BEBEBE00FFFFFF00FFFFFF00D1D1D10097979700979797009797 + 9700979797006F6F6F00B8B8B80000000000C2C2C20087878700B6B6B600A8A8 + A8009B9B9B0097979700DEDEDE00FFFFFF00EBEBEB0097979700979797009797 + 97009797970077777700B8B8B800000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000E1E1E1008C8C8C00B2B2B200BEBE + BE00B1B1B100A1A1A100BFBFBF00F8F8F800C5C5C50097979700979797009797 + 97009393930068686800D6D6D60000000000E1E1E10088888800B2B2B200BEBE + BE00B1B1B1009797970097979700CBCBCB009797970097979700979797009797 + 97009393930068686800D6D6D600000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000D9D9D9008C8C8C00B2B2 + B200C8C8C800B9B9B900ABABAB009D9D9D009797970097979700979797009090 + 90006B6B6B00DADADA00000000000000000000000000D9D9D90088888800B2B2 + B200C8C8C800B9B9B900ABABAB009D9D9D009797970097979700979797009090 + 90006B6B6B00DADADA0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000DADADA008C8C + 8C0095959500BABABA00C3C3C300B3B3B300A6A6A600929292007B7B7B008787 + 8700DBDBDB000000000000000000000000000000000000000000DADADA008888 + 880095959500BABABA00C3C3C300B3B3B300A6A6A600929292007B7B7B008787 + 8700DBDBDB000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000E4E4 + E400C0C0C0008C8C8C008C8C8C008C8C8C008C8C8C008C8C8C00C0C0C000E4E4 + E40000000000000000000000000000000000000000000000000000000000E4E4 + E400C0C0C0008C8C8C008C8C8C008C8C8C008C8C8C008C8C8C00C0C0C000E4E4 + E400000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000100000000100010000000000800000000000000000000000 + 000000000000000000000000FFFFFF00FFFFFFFF00000000E00FE00F00000000 + C007C00700000000800380030000000000010001000000000001000100000000 + 0001000100000000000100010000000000010001000000000001000100000000 + 0001000100000000000100010000000000010001000000008003800300000000 + C007C00700000000E00FE00F0000000000000000000000000000000000000000 + 000000000000} + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Base/DemoForm.pas b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Base/DemoForm.pas new file mode 100644 index 0000000..95bbae7 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Base/DemoForm.pas @@ -0,0 +1,667 @@ +{$I DacDemo.inc} + +unit DemoForm; + +interface + +uses +{$IFNDEF WIN32} + Types, +{$ENDIF} + SysUtils, Classes, DB, +{$IFDEF LINUX} + QControls, QStdCtrls, QComCtrls, QGraphics, QMenus, QTypes, QImgList, QForms, + QButtons, QExtCtrls, Qt, QDialogs, +{$ELSE} + Windows, Forms, Messages, Controls, StdCtrls, + Graphics, ImgList, ToolWin, + ComCtrls, Dialogs, ExtCtrls, Tabs, Menus, DBCtrls, Buttons, ShellAPI, +{$IFNDEF VER130} + Variants, +{$ENDIF} +{$ENDIF} +{$IFDEF CLR} + System.ComponentModel, +{$ENDIF} + DBAccess, + DAScript, + DemoBase, + DemoFrame, + CategoryFrame + {$IFDEF XPMAN}, UxTheme{$ENDIF} + {$IFDEF USE_SYNEDIT}, SynMemo, SynEdit, SynEditHighlighter, SynHighlighterPas{$ENDIF} + ; +const + MAX_HISTORY_SIZE = 6; + +type + TDemoForm = class(TForm) + StatusBar: TStatusBar; + ImageList1: TImageList; + PanelUnderTree: TPanel; + TreeView: TTreeView; + MainPanel: TPanel; + Shape1: TShape; + TVSplitter: TSplitter; + pnTopLabel: TPanel; + lbTitle: TLabel; + lbAbout: TLabel; + Panel2: TPanel; + Panel1: TPanel; + sbConnect: TSpeedButton; + sbDisconnect: TSpeedButton; + btCreate: TSpeedButton; + btDrop: TSpeedButton; + cbDebug: TCheckBox; + pnSource: TPanel; + pnDemo: TPanel; + sbDemo: TSpeedButton; + pnShowSource: TPanel; + ToolBar: TToolBar; + tbBrowseBack: TToolButton; + tbBrowseForward: TToolButton; + BackHistoryPopup: TPopupMenu; + ForwardHistoryPopup: TPopupMenu; + ilButtons: TImageList; + ilDisabledButtons: TImageList; + sbSource: TSpeedButton; + sbFormText: TSpeedButton; + pnOpenDemoDir: TPanel; + sbOpenDemoDir: TSpeedButton; + + procedure FormCreate(Sender: TObject); virtual; + procedure TreeViewChange(Sender: TObject; Node: TTreeNode); + procedure TreeViewKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); + procedure TreeViewClick(Sender: TObject); + procedure TreeViewMouseMove(Sender: TObject; Shift: TShiftState; X, + Y: Integer); + procedure TVSplitterMoved(Sender: TObject); + procedure TVSplitterCanResize(Sender: TObject; var NewSize: Integer; + var Accept: Boolean); + procedure lbAboutClick(Sender: TObject); virtual; + procedure lbAboutMouseMove(Sender: TObject; Shift: TShiftState; X, + Y: Integer); + procedure lbTitleMouseMove(Sender: TObject; Shift: TShiftState; X, + Y: Integer); + procedure cbDebugClick(Sender: TObject); + procedure sbOpenDemoDirClick(Sender: TObject); + procedure sbConnectClick(Sender: TObject); + procedure sbDisconnectClick(Sender: TObject); + procedure FormDestroy(Sender: TObject); + procedure HistoryItemClick(Sender: TObject); + procedure sbDemoClick(Sender: TObject); + procedure FormResize(Sender: TObject); + procedure BackHistoryPopupPopup(Sender: TObject); + procedure ForwardHistoryPopupPopup(Sender: TObject); + procedure tbBrowseBackClick(Sender: TObject); + procedure tbBrowseForwardClick(Sender: TObject); + procedure btScriptClick(Sender: TObject); + procedure OnScriptError(Sender: TObject; E: Exception; SQL: String; + var Action: TErrorAction); + procedure sbSourceClick(Sender: TObject); + procedure sbFormTextClick(Sender: TObject); + protected + Demos: TDemos; + ActiveNode: TTreeNode; + //History + History: Array of integer; //Absolute indexes in TreeView + HistoryIndex: integer; //Current History index + HistoryEnd: integer; + IgnoreScriptErrors: boolean; + DropScriptActive: boolean; + DemoSourceLoaded, FormSourceLoaded: boolean; + + //Product customization + function GetConnection: TCustomDAConnection; virtual; abstract; //This function should return DAC product specific connection (i.e. OraSession, MyConnection) + function ApplicationTitle: string; virtual; abstract; //This function should return DAC product specific title + function ProductName: string; virtual; abstract; ////This function should return product name + procedure RegisterDemos; virtual; abstract; //This procedure should regiter DAC product specific demos + //XP manifest + {$IFDEF XPMAN} + procedure ReplaceFlatStyle(Control: TWinControl; Flat: boolean); + {$ENDIF} + //Demo selection + procedure InitializeDemoFrame(Frame: TDemoFrame; DemoType: TDemoType); virtual; + procedure UpdateDemo; + procedure ShowDemo; + procedure ShowDemoSource; + procedure ShowFormSource; + {$IFNDEF WIN32} + procedure OnNavigate(DemoDescription: string); + {$ELSE} + procedure OnNavigate(Index: integer); + {$ENDIF} + //History + procedure SelectDemo; + procedure NavigateHistory(Offset: integer); + procedure GetBackHistory(BackList: TStrings); + procedure GetForwardHistory(ForwardList: TStrings); + procedure DisableBrowse(Back, Forward: boolean); + procedure FillHistoryPopup(BackHistory: boolean); + //Connection + procedure AfterConnect(Sender: TObject); + procedure AfterDisconnect(Sender: TObject); + public +{$IFDEF USE_SYNEDIT} + SourceBrowser: TSynMemo; +{$ELSE} + SourceBrowser: TMemo; +{$ENDIF} + function GetIsXPMan: boolean; + function ProductColor: TColor; virtual; abstract; //This function should return DAC product specific color + procedure ExecCreateScript; virtual; abstract; + procedure ExecDropScript; virtual; abstract; + end; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} +{$IFDEF LINUX} +{$R *.xfm} +{$ENDIF} + +{$IFDEF XPMAN} + {$R WindowsXP.res} +{$ENDIF} + +procedure TDemoForm.FormCreate(Sender: TObject); +begin + SetLength(History, MAX_HISTORY_SIZE); + HistoryIndex := -1; + Demos := TDemos.Create(TreeView.Items); + RegisterDemos; +{$IFDEF XPMAN} + if GetIsXPMan then begin + ReplaceFlatStyle(Self, False); + pnTopLabel.Color := ProductColor; + end; +{$ENDIF} + +{$IFDEF USE_SYNEDIT} + SourceBrowser := TSynMemo.Create(pnSource); + + SourceBrowser.Highlighter := TSynPasSyn.Create(SourceBrowser); + SourceBrowser.Options := [eoAltSetsColumnMode, eoAutoIndent, eoAutoSizeMaxScrollWidth, eoDisableScrollArrows, eoDragDropEditing, eoDropFiles, eoEnhanceEndKey, eoGroupUndo, eoHideShowScrollbars, eoKeepCaretX, eoShowScrollHint, eoSmartTabDelete, eoSmartTabs, eoTabIndent, eoTabsToSpaces]; + with SourceBrowser.Gutter do begin + Visible := True; + AutoSize := True; + DigitCount := 3; + LeftOffset := 0; + RightOffset := 0; + ShowLineNumbers := True; + Width := 1; + end; +{$ELSE} + SourceBrowser := TMemo.Create(pnSource); + SourceBrowser.ScrollBars := ssVertical; + SourceBrowser.Font.Name := 'Courier New'; + SourceBrowser.Font.Size := 10; +{$ENDIF} + with SourceBrowser do begin + Parent := pnSource; + Align := alClient; + ReadOnly := True; + end; + Resize; + TreeView.Items[0].Expand(True); + TreeView.Items[0].Selected := True; + with GetConnection do begin + AfterConnect := Self.AfterConnect; + AfterDisconnect := Self.AfterDisconnect; + end; + SelectDemo; +end; + +procedure TDemoForm.FormDestroy(Sender: TObject); +begin + with GetConnection do begin + AfterConnect := nil; + AfterDisconnect := nil; + end; + SetLength(History, 0); + Demos.Free; +end; + +//TreeView routines +procedure TDemoForm.TreeViewChange(Sender: TObject; Node: TTreeNode); +begin + if (TreeView.Selected.Data <> nil) then + StatusBar.Panels[0].Text := TDemo(TreeView.Selected.Data).Hint + else + StatusBar.Panels[0].Text := TreeView.Selected.Text; + StatusBar.Repaint; +end; + +procedure TDemoForm.TreeViewKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); +begin + if Key = {$IFDEF LINUX}4100{$ELSE}13{$ENDIF} then + SelectDemo; +end; + +procedure TDemoForm.TreeViewClick(Sender: TObject); +begin + SelectDemo; +end; + +//TreeView Hints +procedure TDemoForm.TreeViewMouseMove(Sender: TObject; + Shift: TShiftState; X, Y: Integer); +var + Node: TTreeNode; +begin + Node := TreeView.GetNodeAt(X, Y); + if (Node <> nil) and (Node.Data <> nil) then + TreeView.Hint := TDemo(Node.Data).Hint + else + TreeView.Hint := ''; +end; + +//Sizing constraints +procedure TDemoForm.TVSplitterMoved(Sender: TObject); +begin + if PanelUnderTree.ClientWidth = 0 then + PanelUnderTree.ClientWidth := 150; +end; + +procedure TDemoForm.TVSplitterCanResize(Sender: TObject; + var NewSize: Integer; var Accept: Boolean); +begin + Accept := (NewSize >= PanelUnderTree.Constraints.MinWidth) and + ((ClientWidth - MainPanel.Constraints.MinWidth - NewSize) > 0); +end; + +function TDemoForm.GetIsXPMan: boolean; +begin + Result := {$IFDEF XPMAN}UseThemes; {$ELSE} False;{$ENDIF} +end; + +{$IFDEF XPMAN} +procedure TDemoForm.ReplaceFlatStyle(Control: TWinControl; Flat: boolean); +var + i: integer; +begin + for i := 0 to Control.ControlCount - 1 do + if Control.Controls[i] is TSpeedButton then + TSpeedButton(Control.Controls[i]).Flat := Flat + else + if Control.Controls[i] is TDBNavigator then + TDBNavigator(Control.Controls[i]).Flat := Flat + else + if Control.Controls[i] is TWinControl then begin + if Control.Controls[i] is TPanel then begin + TPanel(Control.Controls[i]).ParentBackground := False; + TPanel(Control.Controls[i]).Color := clBtnFace; + end; + ReplaceFlatStyle(TWinControl(Control.Controls[i]), Flat); + end; +end; +{$ENDIF} + +//Demo Change +procedure TDemoForm.InitializeDemoFrame(Frame: TDemoFrame; DemoType: TDemoType); +begin + Frame.Connection := GetConnection; + Frame.SetDebug(cbDebug.Checked); + Frame.Parent := pnDemo; + if DemoType = dtCategory then //Attach browser event handlers + TCategoryFrame(Frame).OnNavigate := OnNavigate; +{$IFDEF XPMAN} + if GetIsXPMan then + ReplaceFlatStyle(Frame, False); +{$ENDIF} + Frame.Initialize; +end; + +procedure TDemoForm.UpdateDemo; +var + i: integer; +begin + for i := 1 to StatusBar.Panels.Count - 1 do + StatusBar.Panels[i].Text := ''; + ActiveNode := TreeView.Selected; + if (ActiveNode <> nil) then + with Demos.SelectDemo(ActiveNode.AbsoluteIndex) do begin + InitializeDemoFrame(Frame, DemoType); + DemoSourceLoaded := False; + FormSourceLoaded := False; + if DemoType = dtCategory then begin + pnShowSource.Visible := False; + pnOpenDemoDir.Visible := False; + ShowDemo; + end + else begin + pnShowSource.Visible := True; + {$IFNDEF LINUX} + pnOpenDemoDir.Visible := True; + {$ELSE} + pnOpenDemoDir.Visible := False; + {$ENDIF} + if sbDemo.Down then + ShowDemo + else + if sbSource.Down then + ShowDemoSource + else + ShowFormSource; + end; + Self.Caption := ApplicationTitle + ' - ' + Name; + Application.Title := ApplicationTitle; + end; + StatusBar.Repaint; +end; + +procedure TDemoForm.ShowDemo; +begin + pnSource.Visible := False; + pnDemo.Visible := True; +end; + +procedure TDemoForm.ShowDemoSource; +begin + if not DemoSourceLoaded then begin + Demos.SelectedDemo.LoadDemoCode(SourceBrowser.Lines); + DemoSourceLoaded := True; + FormSourceLoaded := False; + end; + pnSource.Visible := True; + pnDemo.Visible := False; +end; + +procedure TDemoForm.ShowFormSource; +begin + if not FormSourceLoaded then begin + Demos.SelectedDemo.LoadFormCode(SourceBrowser.Lines); + FormSourceLoaded := True; + DemoSourceLoaded := False; + end; + pnSource.Visible := True; + pnDemo.Visible := False; +end; + +//User control +procedure TDemoForm.sbOpenDemoDirClick(Sender: TObject); +begin + Demos.SelectedDemo.OpenDemoFolder; +end; + +procedure TDemoForm.cbDebugClick(Sender: TObject); +begin + Demos.SelectedDemo.Frame.SetDebug(cbDebug.Checked); +end; + +{$IFNDEF WIN32} +procedure TDemoForm.OnNavigate(DemoDescription: string); +var + Node: TTreeNode; + DemoName, CategoryName, FolderName: string; + ListBox: TListBox; + i: integer; +begin + Node := TreeView.Items.GetFirstNode; + DemoName := Trim(Copy(DemoDescription, 1, pos('-', DemoDescription) - 1)); + while Node <> nil do begin + if TDemo(Node.Data).Name = DemoName then begin + TreeView.Selected := Node; + SelectDemo; + break; + end; + Node := Node.GetNext; + end; + // Demo was not found in the tree. This is supplementary demo. + + if (Demos.SelectedDemo.DemoType = dtCategory) and (DemoName <> '') then begin + ListBox := TCategoryFrame(Demos.SelectedDemo.Frame).DemosDescription; + for i := ListBox.ItemIndex downto 0 do + if (ListBox.Items[i] <> '') and (ListBox.Items[i][1] = ' ') then begin + CategoryName := Trim(ListBox.Items[i]); + Break; + end; + end; +{$IFNDEF LINUX} + FolderName := ExtractFilePath(ExtractFileDir(Application.ExeName)) + CategoryName + '\' + DemoName; + ShellExecute(0, 'open', FolderName, '', '.', SW_SHOW); +{$ENDIF} +end; + +{$ELSE} +procedure TDemoForm.OnNavigate(Index: integer); +begin + TreeView.Items[Index].Selected := True; + SelectDemo; +end; +{$ENDIF} + +procedure TDemoForm.lbAboutClick(Sender: TObject); +begin + lbAbout.Font.Color := $FFFFFF; + lbAbout.Cursor := crDefault; +end; + +//About highlite +procedure TDemoForm.lbAboutMouseMove(Sender: TObject; + Shift: TShiftState; X, Y: Integer); +begin + lbAbout.Font.Color := TColor($FF00001A); //clHotLight + lbAbout.Cursor := crHandPoint; +end; + +procedure TDemoForm.lbTitleMouseMove(Sender: TObject; + Shift: TShiftState; X, Y: Integer); +begin + lbAbout.Font.Color := $FFFFFF; + lbAbout.Cursor := crDefault; +end; + +procedure TDemoForm.sbConnectClick(Sender: TObject); +begin + GetConnection.Connect; +end; + +procedure TDemoForm.sbDisconnectClick(Sender: TObject); +begin + GetConnection.Disconnect; +end; + +procedure TDemoForm.AfterConnect(Sender: TObject); +begin + sbDisconnect.Enabled := True; + sbConnect.Enabled := False; +end; + +procedure TDemoForm.AfterDisconnect(Sender: TObject); +begin + sbDisconnect.Enabled := False; + sbConnect.Enabled := True; +end; + +//History +procedure TDemoForm.SelectDemo; +var + i: integer; +begin + if TreeView.Selected = ActiveNode then //Same demo selected + Exit; + UpdateDemo; + if HistoryIndex = (MAX_HISTORY_SIZE - 1) then + for i := 0 to MAX_HISTORY_SIZE - 2 do + History[i] := History[i + 1] + else + Inc(HistoryIndex); + History[HistoryIndex] := ActiveNode.AbsoluteIndex; + HistoryEnd := HistoryIndex; + DisableBrowse(HistoryIndex = 0, True); +end; + +procedure TDemoForm.NavigateHistory(Offset: integer); +begin + if ((HistoryIndex + Offset) < 0) or ((HistoryIndex + Offset) >= MAX_HISTORY_SIZE) then + raise Exception.Create('Wrong history index'); + HistoryIndex := HistoryIndex + Offset; + TreeView.Items[Demos.GetDemoIndex(History[HistoryIndex])].Selected := True; + DisableBrowse(HistoryIndex = 0, HistoryIndex = HistoryEnd); + UpdateDemo; +end; + +procedure TDemoForm.GetBackHistory(BackList: TStrings); +var + i: integer; +begin + BackList.Clear; + for i := HistoryIndex - 1 downto 0 do + BackList.Add(Demos[History[i]].Name); +end; + +procedure TDemoForm.GetForwardHistory(ForwardList: TStrings); +var + i: integer; +begin + ForwardList.Clear; + for i := HistoryIndex + 1 to HistoryEnd do + ForwardList.Add(Demos[History[i]].Name); +end; + +procedure TDemoForm.DisableBrowse(Back, Forward: boolean); +begin + tbBrowseBack.Enabled := not Back; + tbBrowseForward.Enabled := not Forward; +end; + +procedure TDemoForm.FillHistoryPopup(BackHistory: boolean); +var + NewItem: TMenuItem; + List: TStrings; + i: integer; + HistoryPopup: TPopupMenu; +begin + if BackHistory then + HistoryPopup := BackHistoryPopup + else + HistoryPopup := ForwardHistoryPopup; + HistoryPopup.Items.Clear; + List := TStringList.Create; + if BackHistory then + GetBackHistory(List) + else + GetForwardHistory(List); + for i := 1 to List.Count do begin + NewItem := TMenuItem.Create(HistoryPopup); + HistoryPopup.Items.Add(NewItem); + NewItem.Caption := List[i - 1]; + if BackHistory then + NewItem.Tag := -i + else + NewItem.Tag := i; + NewItem.OnClick := HistoryItemClick; + end; + List.Free; +end; + +procedure TDemoForm.HistoryItemClick(Sender: TObject); +begin + if Sender is TMenuItem then + NavigateHistory(TMenuItem(Sender).Tag); +end; + +procedure TDemoForm.BackHistoryPopupPopup(Sender: TObject); +begin + FillHistoryPopup(True); +end; + +procedure TDemoForm.ForwardHistoryPopupPopup(Sender: TObject); +begin + FillHistoryPopup(False); +end; + +procedure TDemoForm.tbBrowseBackClick(Sender: TObject); +begin + NavigateHistory(-1); +end; + +procedure TDemoForm.tbBrowseForwardClick(Sender: TObject); +begin + NavigateHistory(1); +end; + +procedure TDemoForm.sbDemoClick(Sender: TObject); +begin + ShowDemo; +end; + +procedure TDemoForm.sbSourceClick(Sender: TObject); +begin + ShowDemoSource; +end; + +procedure TDemoForm.sbFormTextClick(Sender: TObject); +begin + ShowFormSource; +end; + +procedure TDemoForm.FormResize(Sender: TObject); +begin + lbAbout.Left := lbAbout.Parent.ClientWidth - 100; + cbDebug.Left := cbDebug.Parent.ClientWidth - 100; + pnOpenDemoDir.Left := cbDebug.Left - (pnOpenDemoDir.Width + 15); + pnShowSource.Left := pnOpenDemoDir.Left - (pnShowSource.Width + 15); +end; + +procedure TDemoForm.OnScriptError(Sender: TObject; E: Exception; + SQL: String; var Action: TErrorAction); +var + OperationStr, + ScriptFileStr, + MessageStr: string; +begin + if DropScriptActive then begin + OperationStr := 'drop'; + ScriptFileStr := 'UninstallDemoObjects.sql'; + end + else begin + OperationStr := 'create'; + ScriptFileStr := 'InstallDemoObjects.sql'; + end; + MessageStr := Format('An error has been occured: %s' + + #$d#$d'You can manually %s objects required for demo by using the ' + + 'following file: %%%s%%\Demos\%s' + + #$d'%%%s%% is the %s installation path on your computer.' + #13#10 + 'Ignore this exception?', + [E.Message, OperationStr, ProductName, ScriptFileStr, ProductName, ProductName]); + Action := eaContinue; + if not IgnoreScriptErrors then + case MessageDlg(MessageStr, mtError, [mbYes, mbNo{$IFNDEF LINUX}, mbYesToAll{$ENDIF}], 0) of + mrNo: + Action := eaAbort; + {$IFNDEF LINUX} + mrYesToAll: + IgnoreScriptErrors := True; + {$ENDIF} + end; +end; + +procedure TDemoForm.btScriptClick(Sender: TObject); +var + s: string; +begin + DropScriptActive := Sender = btDrop; + if DropScriptActive then + s := 'removed from database' + else + s := 'created in database'; + if MessageDlg(Format('Objects required for the demo will be %s. Continue?', [s]), + mtConfirmation, [mbYes, mbNo], 0) = mrYes then begin + IgnoreScriptErrors := False; + GetConnection.Connect; + if Sender = btCreate then + ExecCreateScript + else + ExecDropScript; + end; +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Base/DemoForm.xfm b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Base/DemoForm.xfm new file mode 100644 index 0000000..d21e0f9 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Base/DemoForm.xfm @@ -0,0 +1,792 @@ +object DemoForm: TDemoForm + Left = 75 + Top = 162 + Width = 957 + Height = 500 + HorzScrollBar.Range = 219 + VertScrollBar.Range = 89 + ActiveControl = TreeView + Caption = 'Data Access Components demos' + Color = clSilver + Constraints.MinHeight = 500 + Font.Color = clText + Font.Height = 13 + Font.Name = 'helvetica' + Font.Pitch = fpVariable + Font.Style = [] + Font.Weight = 40 + ParentFont = False + Position = poScreenCenter + Scaled = False + ShowHint = True + WindowState = wsMaximized + OnCreate = FormCreate + OnDestroy = FormDestroy + OnResize = FormResize + PixelsPerInch = 75 + object TVSplitter: TSplitter + Left = 216 + Top = 69 + Height = 411 + Beveled = True + Color = 9790720 + MinSize = 150 + OnCanResize = TVSplitterCanResize + OnMoved = TVSplitterMoved + end + object MainPanel: TPanel + Left = 219 + Top = 69 + Width = 738 + Height = 411 + Align = alClient + BevelOuter = bvNone + Constraints.MinWidth = 730 + TabOrder = 2 + object pnDemo: TPanel + Left = 0 + Top = 0 + Width = 738 + Height = 411 + Align = alClient + BevelOuter = bvNone + Color = clButton + ParentColor = False + TabOrder = 1 + end + object pnSource: TPanel + Left = 0 + Top = 0 + Width = 738 + Height = 411 + Align = alClient + BevelOuter = bvNone + Color = clButton + ParentColor = False + TabOrder = 0 + Visible = False + end + end + object StatusBar: TStatusBar + Left = 0 + Top = 480 + Width = 957 + Height = 20 + Font.Color = clButtonText + Font.Height = 11 + Font.Name = 'Tahoma' + Font.Pitch = fpVariable + Font.Style = [] + Font.Weight = 40 + Panels = < + item + Width = 220 + end + item + Width = 100 + end + item + Width = 480 + end + item + end> + ParentFont = False + end + object PanelUnderTree: TPanel + Left = 0 + Top = 69 + Width = 216 + Height = 411 + Align = alLeft + BevelOuter = bvNone + TabOrder = 0 + object TreeView: TTreeView + Left = 0 + Top = 25 + Width = 351 + Height = 386 + Align = alLeft + Columns = <> + Images = ImageList1 + Indent = 21 + ParentShowHint = False + ReadOnly = True + ShowHint = True + TabOrder = 0 + OnChange = TreeViewChange + OnClick = TreeViewClick + OnKeyDown = TreeViewKeyDown + OnMouseMove = TreeViewMouseMove + end + object ToolBar: TToolBar + Left = 0 + Top = 0 + Width = 216 + Height = 25 + AutoSize = True + ButtonHeight = 23 + ButtonWidth = 28 + Caption = 'ToolBar' + Color = clButton + DisabledImages = ilDisabledButtons + EdgeInner = esNone + EdgeOuter = esNone + Flat = True + Images = ilButtons + ParentColor = False + TabOrder = 1 + object tbBrowseBack: TToolButton + Left = 1 + Top = 2 + Height = 23 + Hint = 'Back' + Style = tbsDropDown + Caption = ' Back ' + DropDownMenu = BackHistoryPopup + ImageIndex = 0 + OnClick = tbBrowseBackClick + end + object tbBrowseForward: TToolButton + Left = 43 + Top = 2 + Height = 23 + Hint = 'Forward' + Style = tbsDropDown + Caption = 'tbBrowseForward' + DropDownMenu = ForwardHistoryPopup + ImageIndex = 1 + OnClick = tbBrowseForwardClick + end + end + end + object pnTopLabel: TPanel + Left = 0 + Top = 0 + Width = 957 + Height = 41 + Align = alTop + BevelOuter = bvNone + TabOrder = 3 + object lbTitle: TLabel + Left = 0 + Top = 0 + Width = 957 + Height = 42 + Cursor = crArrow + Align = alTop + Caption = 'DAC demos' + Color = 9790720 + Constraints.MinWidth = 130 + Font.CharSet = fcsUnicode + Font.Color = clWhite + Font.Height = 35 + Font.Name = 'Verdana' + Font.Pitch = fpVariable + Font.Style = [fsItalic] + Font.Weight = 40 + ParentColor = False + ParentFont = False + OnMouseMove = lbTitleMouseMove + end + object lbAbout: TLabel + Left = 854 + Top = 12 + Width = 28 + Height = 18 + Caption = 'About' + Color = 9790720 + Font.Color = clWhite + Font.Height = 11 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [fsUnderline] + Font.Weight = 40 + ParentColor = False + ParentFont = False + OnClick = lbAboutClick + OnMouseMove = lbAboutMouseMove + end + end + object Panel2: TPanel + Left = 0 + Top = 41 + Width = 957 + Height = 28 + Align = alTop + BevelOuter = bvNone + Color = clButton + ParentColor = False + TabOrder = 4 + object Shape1: TShape + Left = 0 + Top = 25 + Width = 957 + Height = 3 + Align = alBottom + Brush.Color = 9790720 + Pen.Color = clButton + Pen.Width = 0 + end + object Panel1: TPanel + Left = 1 + Top = 1 + Width = 375 + Height = 24 + BevelOuter = bvNone + Color = 9790720 + ParentColor = False + TabOrder = 0 + object sbConnect: TSpeedButton + Left = 1 + Top = 1 + Width = 100 + Height = 22 + Hint = 'Connect to database' + Caption = 'Connect' + Flat = True + Font.Color = clBlack + Font.Height = 11 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [] + Font.Weight = 40 + Glyph.Data = { + FA050000424DF60500000000000036000000280000001E000000100000000100 + 180000000000C005000000000000000000000000000000000000800080800080 + 8000808000808000808000808000808000808000808000804B40388000808000 + 8080008080008080008080008080008080008080008080008080008080008080 + 00808000803E3E3E800080800080800080800080000080008080008080008080 + 00808000808000808000808000808000808000808000804C40373E352D800080 + 8000808000808000808000808000808000808000808000808000808000808000 + 808000803E3E3E33333380008080008000008000808000808000808000808000 + 808000808000808000807E6A5C80008066574B594B414C403880008080008080 + 0080800080800080800080800080800080800080800080686868800080555555 + 4949493E3E3E8000808000800000800080800080800080800080800080800080 + 8000808000808000807E6B5D72615466564B594B428000808000808000808000 + 808000808000808000808000808000808000808000806868685E5E5E54545449 + 49498000808000800000800080A2C8D864A8C0608D9F5D83964A768D346D8C30 + 70925C8AA38874647E6B5C73615466564B800080800080800080C8C8C8A7A7A7 + 8D8D8D8484847878787070707373738C8C8C7171716868685F5F5F5454548000 + 808000800000800080638CA53FBCE884D5E8A1EBF673E4FF24BEF3039FDE148B + BE45729080008080008080008066574B8000808000808E8E8EBBBBBBD1D1D1E6 + E6E6DFDFDFBCBCBCA0A0A08D8D8D767676800080800080800080555555800080 + 00008000806B94AD44C4F090EAFAA1EBF671D9F424BCF201A7E8039CDA2A6384 + 800080800080800080736154800080800080969696C3C3C3E4E4E4E6E6E6D5D5 + D5BBBBBBA8A8A89D9D9D6666668000808000808000805F5F5F80008000008000 + 806B94AD44C4F08DE4F4A1EBF670D7F224B9EE01A7E8039CDA2F688897806F91 + 7A6A887464800080800080800080969696C3C3C3DFDFDFE6E6E6D3D3D3B8B8B8 + A8A8A89D9D9D6B6B6B7D7D7D77777771717180008080008000008000806B9CAD + 3FBCE88EE4F5A1EBF670D7F224B9EE01A7E8039CDA306B8A8000808000808000 + 808000808000808000809B9B9BBBBBBBDFDFDFE6E6E6D3D3D3B8B8B8A8A8A89D + 9D9D6D6D6D80008080008080008080008080008000008000806B9CB53BB8E67E + E4FEA1EBF672D9F224B9EE01A7E8039CDA326D8D800080800080800080800080 + 8000808000809E9E9EB8B8B8E0E0E0E6E6E6D5D5D5B8B8B8A8A8A89D9D9D7070 + 708000808000808000808000808000800000800080739CB53BB8E67EE4FEA1EB + F66FD7F21FB7EE01A7E8039CDA346F8F80008080008080008080008080008080 + 00809E9E9EB8B8B8E0E0E0E6E6E6D3D3D3B6B6B6A8A8A89D9D9D727272800080 + 800080800080800080800080000080008073A5BD3BB8E67EE4FEA0EAF56ED6F2 + 1FB7EE01A7E8039CDA317092800080800080800080800080800080800080A6A6 + A6B8B8B8E0E0E0E5E5E5D2D2D2B6B6B6A8A8A89D9D9D73737380008080008080 + 0080800080800080000080008073A5BD58C9E78CECFFA0EAF5A6EDF894E7F871 + D9F63CBDE9437C97800080800080800080800080800080800080A6A6A6C5C5C5 + E7E7E7E5E5E5E8E8E8E2E2E2D6D6D6BCBCBC7D7D7D8000808000808000808000 + 8080008000008000806691A2A0DFEAC5F9FDC5F9FDC5F9FDC5F9FDC5F9FDA0DF + EA6691A2800080800080800080800080800080800080919191DBDBDBF4F4F4F4 + F4F4F4F4F4F4F4F4F4F4F4DBDBDB919191800080800080800080800080800080 + 0000800080B8D1DB84AFBF6FA2B46B9BAE6C9DAF6B9BAE6FA2B484AFBFB8D1DB + 800080800080800080800080800080800080D1D1D1AFAFAFA1A1A19B9B9B9D9D + 9D9B9B9BA1A1A1AFAFAFD1D1D180008080008080008080008080008000008000 + 8080008080008080008080008080008080008080008080008080008080008080 + 0080800080800080800080800080800080800080800080800080800080800080 + 8000808000808000808000808000808000808000808000800000} + NumGlyphs = 2 + ParentFont = False + Transparent = False + OnClick = sbConnectClick + end + object sbDisconnect: TSpeedButton + Left = 102 + Top = 1 + Width = 100 + Height = 22 + Hint = 'Dsisconnect from database' + Caption = 'Disconnect' + Enabled = False + Flat = True + Font.Color = clBlack + Font.Height = 11 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [] + Font.Weight = 40 + Glyph.Data = { + 9E050000424D9A0500000000000036000000280000001E0000000F0000000100 + 1800000000006405000000000000000000000000000000000000800080800080 + 800080800080800080800080800080AFBBF7800080800080800080CFCBE38000 + 80800080800080800080800080800080800080800080800080800080CBCBCB80 + 0080800080800080D2D2D2800080800080800080000080008080008080008080 + 0080800080800080CFCBE31140FD6178EE8000806176EA3154F2CFCBE3800080 + 800080800080800080800080800080800080800080D2D2D27373739898988000 + 809696967F7F7FD2D2D280008080008000008000808000808000808000808000 + 808000808000803157F90134FF214BF90134FF3155F480008080008080008080 + 00808000808000808000808000808000808000808383836B6B6B7A7A7A6B6B6B + 8080808000808000808000800000800080A2C8D864A8C0608D9F5D83964A768D + 346D8CFFFFFF1140FD0134FF113FFC800080800080800080800080800080C8C8 + C8A7A7A78D8D8D848484787878707070FFFFFF7373736B6B6B72727280008080 + 00808000808000800000800080638CA53FBCE884D5E8A1EBF673E4FFFFFFFF61 + 7CF60134FF0134FF0134FF6178EE8000808000808000808000808E8E8EBBBBBB + D1D1D1E6E6E6DFDFDFFFFFFF9D9D9D6B6B6B6B6B6B6B6B6B9898988000808000 + 8080008000008000806B94AD44C4F090EAFAA1EBF671D9F4BFC8F70134FF3158 + FBFFFFFF3157F91140FDBFC8F7800080800080800080969696C3C3C3E4E4E4E6 + E6E6D5D5D5D5D5D56B6B6B848484FFFFFF838383737373D5D5D5800080800080 + 00008000806B94AD44C4F08DE4F4A1EBF670D7F224B9EEAFBBF7FFFFFF2F6888 + 800080CFCBE3800080800080800080800080969696C3C3C3DFDFDFE6E6E6D3D3 + D3B8B8B8CBCBCBFFFFFF6B6B6B800080D2D2D280008080008080008000008000 + 806B9CAD3FBCE88EE4F5A1EBF670D7F224B9EE01A7E8039CDA306B8A80008080 + 00808000808000808000808000809B9B9BBBBBBBDFDFDFE6E6E6D3D3D3B8B8B8 + A8A8A89D9D9D6D6D6D80008080008080008080008080008000008000806B9CB5 + 3BB8E67EE4FEA1EBF672D9F224B9EE01A7E8039CDA326D8D8000808000808000 + 808000808000808000809E9E9EB8B8B8E0E0E0E6E6E6D5D5D5B8B8B8A8A8A89D + 9D9D7070708000808000808000808000808000800000800080739CB53BB8E67E + E4FEA1EBF66FD7F21FB7EE01A7E8039CDA346F8F800080800080800080800080 + 8000808000809E9E9EB8B8B8E0E0E0E6E6E6D3D3D3B6B6B6A8A8A89D9D9D7272 + 72800080800080800080800080800080000080008073A5BD3BB8E67EE4FEA0EA + F56ED6F21FB7EE01A7E8039CDA31709280008080008080008080008080008080 + 0080A6A6A6B8B8B8E0E0E0E5E5E5D2D2D2B6B6B6A8A8A89D9D9D737373800080 + 800080800080800080800080000080008073A5BD58C9E78CECFFA0EAF5A6EDF8 + 94E7F871D9F63CBDE9437C97800080800080800080800080800080800080A6A6 + A6C5C5C5E7E7E7E5E5E5E8E8E8E2E2E2D6D6D6BCBCBC7D7D7D80008080008080 + 008080008080008000008000806691A2A0DFEAC5F9FDC5F9FDC5F9FDC5F9FDC5 + F9FDA0DFEA6691A2800080800080800080800080800080800080919191DBDBDB + F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4DBDBDB9191918000808000808000808000 + 808000800000800080B8D1DB84AFBF6FA2B46B9BAE6C9DAF6B9BAE6FA2B484AF + BFB8D1DB800080800080800080800080800080800080D1D1D1AFAFAFA1A1A19B + 9B9B9D9D9D9B9B9BA1A1A1AFAFAFD1D1D1800080800080800080800080800080 + 0000800080800080800080800080800080800080800080800080800080800080 + 8000808000808000808000808000808000808000808000808000808000808000 + 808000808000808000808000808000808000808000808000808000800000} + NumGlyphs = 2 + ParentFont = False + Transparent = False + OnClick = sbDisconnectClick + end + object btCreate: TSpeedButton + Left = 203 + Top = 1 + Width = 85 + Height = 22 + Hint = 'Create database objects' + Caption = 'Create' + Flat = True + Font.Color = clBlack + Font.Height = 11 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [] + Font.Weight = 40 + Glyph.Data = { + 3A060000424D3606000000000000360000002800000020000000100000000100 + 1800000000000006000000000000000000000000000000000000800080800080 + AC9584785E4B785E4B785E4B785E4B785E4B785E4B785E4B785E4B785E4B785E + 4B785E4B785E4B8000808000808000809292925B5B5B5B5B5B5B5B5B5B5B5B5B + 5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B800080800080800080 + AC9584FEFCFCFAEEE8F8E9E2F7E5DCF5E0D6F4DCD0F3D7C9F2D2C4F1CFBFEFCB + B9EEC8B5785E4B800080800080800080929292FCFCFCEDEDEDE8E8E8E4E4E4DF + DFDFDBDBDBD5D5D5D1D1D1CDCDCDC9C9C9C6C6C65B5B5B800080800080800080 + AC9584FFFFFFFEFDFBFDF9F7FCF5F2FAF1ECF9EBE5F7E6DEF6E1D7F4DBCFF3D6 + C9F0CBB9785E4B800080800080800080929292FFFFFFFCFCFCF8F8F8F4F4F4F0 + F0F0EAEAEAE5E5E5E0E0E0DADADAD5D5D5C9C9C95B5B5B800080800080800080 + AD9786FFFFFFFFFFFFFEFDFBFEF9F7FCF5F29B9491020202F8E6DEF6E1D7F4DB + CFF0CEBD785E4B800080800080800080949494FFFFFFFFFFFFFCFCFCF8F8F8F4 + F4F4939393020202E5E5E5E0E0E0DADADACCCCCC5B5B5B800080800080800080 + AF9A89A8A6A3020202868381D8D6D6020202020202D6CCC8F9EBE50202020202 + 02A38D82785E4B800080800080800080979797A5A5A5020202828282D6D6D602 + 0202020202CBCBCBEAEAEA0202020202028C8C8C5B5B5B800080800080800080 + B29C8CD9D9D9FFFFFF020202020202FFFDFBD7D5D2020202D6CCC9020202F8E6 + DEF2D5C7785E4B800080800080800080999999D9D9D9FFFFFF020202020202FC + FCFCD4D4D4020202CCCCCC020202E5E5E5D3D3D35B5B5B800080800080800080 + B59F8FFFFFFF020202FFFFFF020202FFFFFFFEFCFC020202D6D0CE020202FAEC + E5F4D9CD785E4B8000808000808000809C9C9CFFFFFF020202FFFFFF020202FF + FFFFFCFCFC020202D0D0D0020202EBEBEBD8D8D85B5B5B800080800080800080 + B9A393020202D9D9D9FFFFFF020202D9D9D9FFFFFF020202D7D4D2020202FBF0 + EBF5DDD1785E4B800080800080800080A0A0A0020202D9D9D9FFFFFF020202D9 + D9D9FFFFFF020202D3D3D3020202EFEFEFDCDCDC5B5B5B800080800080800080 + BBA697D9D9D9020202020202D9D9D9020202020202B9B9B9FFFCFC020202FCF5 + F1F6E2D8785E4B800080800080800080A3A3A3D9D9D9020202020202D9D9D902 + 0202020202B9B9B9FCFCFC020202F4F4F4E1E1E15B5B5B8000808000802AAFDA + 44CBF06BE5FF3BBEE599D8DF91E1F681D0E9FFFFFFFFFFFFFFFFFFFEFCFBFDF9 + F7D9CBC0785E4B800080800080ADADADC7C7C7DFDFDFBBBBBBD3D3D3DEDEDECE + CECEFFFFFFFFFFFFFFFFFFFBFBFBF8F8F8C9C9C95B5B5B80008080008052DAFB + 32B7DF7FE9FD5FC6E693F0FF31B6DFA0E8F9FFFFFFFFFFFFFFFFFFFFFFFFFEFC + FCD9CBC0785E4B800080800080D4D4D4B4B4B4E3E3E3C4C4C4EAEAEAB3B3B3E5 + E5E5FFFFFFFFFFFFFFFFFFFFFFFFFCFCFCC9C9C95B5B5B8000808000807CEAFF + 93F1FFBFF8FFAFE8F4C7FBFF93F1FF9FF0FFFFFFFFFFFFFFFFFFFFFAF0EB785E + 4B785E4B785E4B800080800080E4E4E4EAEAEAF3F3F3E5E5E5F6F6F6EAEAEAEB + EBEBFFFFFFFFFFFFFFFFFFEFEFEF5B5B5B5B5B5B5B5B5B80008080008021AAD9 + 55BFE1AFE8F4F0FFFDB4EBF655BFE138BBE5FFFFFFFFFFFFFFFFFF967E6BF4DB + CED1BAAF785E4B800080800080A9A9A9BDBDBDE5E5E5FCFCFCE8E8E8BDBDBDB9 + B9B9FFFFFFFFFFFFFFFFFF7A7A7AD9D9D9B9B9B95B5B5B8000808000807CEAFF + 96F3FFC7FBFFADE5F3C3FBFF96F3FF8BD7E2FEFDFBFDFBF9FDF9F6967E6BD1BA + AFAC9584800080800080800080E4E4E4ECECECF6F6F6E3E3E3F6F6F6ECECECD1 + D1D1FCFCFCFAFAFAF8F8F87A7A7AB9B9B992929280008080008080008051D9FA + 33B8E08CF1FF5AC2E390F1FF30B6DF4BD2F4BBA696B9A293B69F8FB29C8BB099 + 88800080800080800080800080D3D3D3B5B5B5EAEAEAC0C0C0EAEAEAB3B3B3CD + CDCDA3A3A3A0A0A09C9C9C9999999696968000808000808000808000802AAFDA + 44CBF07CEAFF25AEDB72E8FF4CD4F52AAFDA8000808000808000808000808000 + 80800080800080800080800080ADADADC7C7C7E4E4E4ACACACE1E1E1CECECEAD + ADAD800080800080800080800080800080800080800080800080} + NumGlyphs = 2 + ParentFont = False + Transparent = False + OnClick = btScriptClick + end + object btDrop: TSpeedButton + Left = 289 + Top = 1 + Width = 85 + Height = 22 + Hint = 'Drop database objects' + Caption = 'Drop' + Flat = True + Font.Color = clBlack + Font.Height = 11 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [] + Font.Weight = 40 + Glyph.Data = { + 3A060000424D3606000000000000360000002800000020000000100000000100 + 1800000000000006000000000000000000000000000000000000800080800080 + A37A77A37A77A37A77A37A77A37A77A37A77A37A77A37A77A37A77A37A77A37A + 77A37A779063608000808000808000807D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D + 7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D676767800080800080800080 + A67E78FFE8D2FFE8D2FFE8D1FFE6CEFFE3C5FFDEBDFFDDBAFFD8B2FFD6AEFFD2 + A5FFD2A3936662800080800080800080808080E3E3E3E3E3E3E3E3E3E1E1E1DD + DDDDD7D7D7D6D6D6D0D0D0CECECEC9C9C9C8C8C8696969800080800080800080 + AB817AFFE8D2FFE8D2FFE6CEFFE3C6FFE1C2FFDDBBFFDAB6FFD7B0FFD4A9FFD2 + A4FFD2A3966965800080800080800080838383E3E3E3E3E3E3E1E1E1DDDDDDDB + DBDBD6D6D6D3D3D3CFCFCFCBCBCBC9C9C9C8C8C86C6C6C800080800080800080 + B0837CFFECD9FFECD9FFE8D2FFE6CEFFE3C6FFE1C2FFDDBBFFD9B4FFD7B0FFD4 + A9FFD4A99A6C67800080800080800080858585E8E8E8E8E8E8E3E3E3E1E1E1DD + DDDDDBDBDBD6D6D6D2D2D2CFCFCFCBCBCBCBCBCB6F6F6F800080800080800080 + B6897FFFEEDDFFEEDDFFECD9DFD1D8FFE6CEFFE3C6FFE1C2EFD2BFFFD9B4FFD7 + B0FFD7B09E6F698000808000808000808A8A8AEAEAEAEAEAEAE8E8E8D4D4D4E1 + E1E1DDDDDDDBDBDBCFCFCFD2D2D2CFCFCFCFCFCF727272800080800080800080 + BC8E81FFF2E4FFF2E4CFCBE31342FD637AEEFFE6CE6378EA3356F2EFD2BFFFD9 + B4FFD9B4A2726B8000808000808000808F8F8FEFEFEFEFEFEFD2D2D27474749A + 9A9AE1E1E1979797808080CFCFCFD2D2D2D2D2D2757575800080800080800080 + C39581FFF4E8FFF4E8EFE6E63359F90336FF234DF90336FF3357F4EFD6C5FFDD + BBFFDDBBA5766D800080800080800080949494F1F1F1F1F1F1E6E6E68484846C + 6C6C7B7B7B6C6C6C828282D3D3D3D6D6D6D6D6D6787878800080800080800080 + CA9B84FFF7F0FFF7F0FFF4E8EFE6E61342FD0336FF1341FCEFDBD0FFE3C6FFE0 + C1FFE1C2A8796F800080800080800080999999F5F5F5F5F5F5F1F1F1E6E6E674 + 74746C6C6C747474D9D9D9DDDDDDDADADADBDBDB7B7B7B800080800080800080 + D2A187FFF9F4FFF9F4FFF7F0637EF60336FF0336FF0336FF637AEEFFE6CEFFE3 + C6FFE3C6AC7C718000808000808000809E9E9EF8F8F8F8F8F8F5F5F59F9F9F6C + 6C6C6C6C6C6C6C6C9A9A9AE1E1E1DDDDDDDDDDDD7D7D7D800080800080800080 + D9A88AFFFDFBFFFDFBBFC8F70336FF335AFBDFDAE73359F91342FDDFD1D8FFE6 + CEFFE6CEAE7E74800080800080800080A4A4A4FCFCFCFCFCFCD5D5D56C6C6C86 + 8686DEDEDE848484747474D4D4D4E1E1E1E1E1E1808080800080800080800080 + DFAE8CFFFFFFFFFFFFFFFDFBAFBBF7EFEBF0FFF4E8EFE6E6CFCBE3FFECD9FFC8 + C2FFB0B0B08075800080800080800080A9A9A9FFFFFFFFFFFFFCFCFCCBCBCBEC + ECECF1F1F1E6E6E6D2D2D2E8E8E8CCCCCCB8B8B8818181800080800080800080 + E5B38FFDFDFDFDFDFDFFFFFFFFFFFFFFFFFEFFFAF6FFF9F3FFF5EAF4DECEB281 + 76B28176B28176800080800080800080ADADADFCFCFCFCFCFCFFFFFFFFFFFFFE + FEFEF9F9F9F7F7F7F2F2F2DBDBDB838383838383838383800080800080800080 + EAB891FEFEFEFEFEFEFFFFFFFFFFFFFFFFFFFFFFFEFFFAF6FFF9F3F5E1D2B281 + 76EDA757D2AA95800080800080800080B1B1B1FEFEFEFEFEFEFFFFFFFFFFFFFF + FFFFFEFEFEF9F9F9F7F7F7DEDEDE838383969696A8A8A8800080800080800080 + EFBC92FFFFFFFFFFFFFCFCFCFAFAFAF7F7F7F5F5F5F2F1F1F0EDEAE9DAD0B281 + 76D9B198800080800080800080800080B5B5B5FFFFFFFFFFFFFBFBFBFAFAFAF7 + F7F7F5F5F5F1F1F1ECECECD8D8D8838383ADADAD800080800080800080800080 + F2BF94DCA987DCA987DCA987DCA987DCA987DCA987DCA987DCA987DCA987B281 + 76800080800080800080800080800080B7B7B7A4A4A4A4A4A4A4A4A4A4A4A4A4 + A4A4A4A4A4A4A4A4A4A4A4A4A4A4838383800080800080800080800080800080 + 8000808000808000808000808000808000808000808000808000808000808000 + 8080008080008080008080008080008080008080008080008080008080008080 + 0080800080800080800080800080800080800080800080800080} + NumGlyphs = 2 + ParentFont = False + Transparent = False + OnClick = btScriptClick + end + end + object cbDebug: TCheckBox + Left = 871 + Top = 8 + Width = 68 + Height = 13 + Hint = 'Set Debug property for connection and query components' + Caption = 'Debug' + Color = clButton + Font.Color = clBlack + Font.Height = 11 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [] + Font.Weight = 40 + ParentColor = False + ParentFont = False + TabOrder = 1 + OnClick = cbDebugClick + end + object pnShowSource: TPanel + Left = 440 + Top = 1 + Width = 259 + Height = 24 + BevelOuter = bvNone + Color = 9790720 + ParentColor = False + TabOrder = 2 + object sbDemo: TSpeedButton + Left = 1 + Top = 1 + Width = 85 + Height = 22 + Hint = 'Show demo' + GroupIndex = 1 + Down = True + Caption = 'Demo' + Flat = True + Font.Color = clBlack + Font.Height = 11 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [] + Font.Weight = 40 + ParentFont = False + Transparent = False + OnClick = sbDemoClick + end + object sbSource: TSpeedButton + Left = 87 + Top = 1 + Width = 85 + Height = 22 + Hint = 'Show demo source code' + GroupIndex = 1 + Caption = 'Demo source' + Flat = True + Font.Color = clBlack + Font.Height = 11 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [] + Font.Weight = 40 + ParentFont = False + Transparent = False + OnClick = sbSourceClick + end + object sbFormText: TSpeedButton + Left = 173 + Top = 1 + Width = 85 + Height = 22 + Hint = 'Show demo form as text' + GroupIndex = 1 + Caption = 'Form as text' + Flat = True + Font.Color = clBlack + Font.Height = 11 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [] + Font.Weight = 40 + ParentFont = False + Transparent = False + OnClick = sbFormTextClick + end + end + object pnOpenDemoDir: TPanel + Left = 720 + Top = 1 + Width = 138 + Height = 24 + BevelOuter = bvNone + Color = 9790720 + ParentColor = False + TabOrder = 3 + object sbOpenDemoDir: TSpeedButton + Left = 1 + Top = 1 + Width = 136 + Height = 22 + Hint = 'Open folder containing the demo source files' + Caption = 'Open demo folder' + Flat = True + Font.Color = clText + Font.Height = 11 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [] + Font.Weight = 40 + Glyph.Data = { + 3A030000424D3603000000000000360000002800000010000000100000000100 + 18000000000000030000120B0000120B00000000000000000000FFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFF728890628190627A81527281526272425A62424A5232 + 3A42223232222232121A22121212121222FFFFFFFFFFFFFFFFFF72889090A0B0 + 72B0D00290D00290D00290D00290C01288C01281B01281B0227AA0227290224A + 62FFFFFFFFFFFFFFFFFF81889081C0D090A8B081E0FF62D0FF52C8FF52C8FF42 + C0F032B0F032A8F022A0E01290D0226A815B6369FFFFFFFFFFFF8190A081D0F0 + 90A8B090C0D072D8FF62D0FF62D0FF52C8FF52C0FF42B8F032B0F032A8F01288 + D0224A62FFFFFFFFFFFF8190A081D8F081C8E090A8B081E0FF72D0FF62D8FF62 + D0FF62D0FF52C8FF42C0F042B8F032B0F0226A816C8B9AFFFFFF8198A090E0F0 + 90E0FF90A8B090B8C072D8FF62D8FF62D8FF62D8FF62D0FF52D0FF52C8FF42B8 + F032A0E04B6979FFFFFF8198A090E0F0A0E8FF81C8E090A8B081E0FF81E0FF81 + E0FF81E0FF81E0FF81E0FF81E0FF72D8FF72D8FF52A8D087929D90A0A0A0E8F0 + A0E8FFA0E8FF90B0C090B0C090A8B090A8B081A0B081A0B08198A08198A08190 + A08190A081889072889090A0B0A0E8F0A0F0FFA0E8FFA0E8FF81D8FF62D8FF62 + D8FF62D8FF62D8FF62D8FF62D8FF728890FFFFFFFFFFFFFFFFFF90A0B0A0F0F0 + B0F0F0A0F0FFA0E8FFA0E8FF72D8FF90A0A08198A08198A08190A08190907288 + 90FFFFFFFFFFFFFFFFFF90A8B0A0D0E0B0F0F0B0F0F0A0F0FFA0E8FF90A0B0B3 + C9CEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF906A52906A52906A52CDD6DA90A8B0 + 90A8B090A8B090A8B090A8B0B6C5CAFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFD2C7C6906A52906A52FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFF907A62C8BAB3FFFFFFFFFFFFA09081D2CDC7907A62FFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD8D8D3A09081A08881B098 + 81C5BEB7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF} + ParentFont = False + Transparent = False + OnClick = sbOpenDemoDirClick + end + end + end + object ImageList1: TImageList + Height = 17 + Left = 616 + Top = 8 + end + object BackHistoryPopup: TPopupMenu + OnPopup = BackHistoryPopupPopup + Left = 8 + Top = 133 + end + object ForwardHistoryPopup: TPopupMenu + OnPopup = ForwardHistoryPopupPopup + Left = 40 + Top = 133 + end + object ilButtons: TImageList + Left = 88 + Top = 141 + Bitmap = { + 494D474C01000100100000001000000002000000424D36060000000000003600 + 0000280000002000000010000000010018000000000000060000120B0000120B + 00000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC0D0C97DAC862C7D3102690902 + 6407005E042063236D9672C3CFCBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFC0D0C97DAC862C7D31026909026407005E042063236D9672C3CFCBFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFAEC7B6328C360C982211B62F0DB42509 + B21C06B01601AE0B009107106514B4C6BBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + AEC7B6328C360C982211B62F0DB42509B21C06B01601AE0B009107106514B4C6 + BBFFFFFFFFFFFFFFFFFFFFFFFFB0C9B8178C231CB6451BBA4417B83A12B6303C + C3521AB72D08B21B04AF1100AD09006705B6C7BDFFFFFFFFFFFFFFFFFFB0C9B8 + 178C231CB6451BBA4417B83A5DCD7279D5880BB32108B21B04AF1100AD090067 + 05B6C7BDFFFFFFFFFFFFCCDDD343A44823B75324BE5821BD511CBA456FD388FF + FFFFB5E8BE0EB4260AB21D07B11802AE0D106914C9D5D0FFFFFFCCDDD343A448 + 23B75324BE5821BD511CBA45D4F2DCFFFFFFA6E4B10EB4260AB21D07B11802AE + 0D106914C9D5D0FFFFFF9CCEA117A4372EC26B2CC16625BF5A76D695FFFFFFFF + FFFF9AE0AB13B63111B62E0BB32109B21C078E1286A88BFFFFFF9CCEA117A437 + 2EC26B2CC16625BF5A1CBB4775D694FFFFFFFFFFFFA6E4B111B62E0BB32109B2 + 1C078E1286A88BFFFFFF40B14128BB5E2EC26B2EC26B7CD9A1FFFFFFFFFFFFAC + E6BF1CBB471ABA4315B83812B6300FB52A0AB21D227A27FFFFFF40B14128BB5E + 2EC26B2EC26B1CBB471CBB4725BE5976D697FFFFFFFFFFFFA6E4B114B7340FB5 + 2A0AB21D227A27FFFFFF40B1412EC26B2EC26B7CD9A3FFFFFFFFFFFFF1FBF592 + DFAC92DFAC8EDDA38DDDA28BDC9D14B73411B62F057710FFFFFF40B1412EC26B + 62D190FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA8E5B614B7 + 3411B62F057710FFFFFF40B8412EC26B48CA7EFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFF1BBA4417B83A097E14FFFFFF40B8412EC26B + 62D190FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD5F3DE1BBA + 4417B83A097E14FFFFFF40BB4133C36E2EC26B7CD9A3FFFFFFFFFFFFFFFFFFA4 + E4BE97E1B597E1B595E0B192DFAC21BD511CBA45077F13FFFFFF40BB4133C36E + 2EC26B2EC26B2EC26B2EC26B2EC26B89DDACFFFFFFFFFFFFD7F3E22EC26B21BD + 511CBA45077F13FFFFFF40BB4144C6653FC7762EC26B7CD9A3FFFFFFFFFFFFD8 + F4E33BC6742EC26B2EC26B2CC16625BF5A23BE57238B2CFFFFFF40BB4144C665 + 3FC7762EC26B2EC26B2EC26B55CD87F2FBF6FFFFFFD8F4E32EC26B2CC16625BF + 5A23BE57238B2CFFFFFFA2D7A531BE3C72D59552CC8235C4707CD9A3FFFFFFFF + FFFFA4E4BE2EC26B2EC26B2EC26B2DC26A33963B9EC8A4FFFFFFA2D7A531BE3C + 72D59552CC8235C4702EC26BBEECD1FFFFFFD8F4E32EC26B2EC26B2EC26B2DC2 + 6A1AA73E9EC8A4FFFFFFD7E7DC40C24075D68382DAA066D28E44C8797FDAA4F2 + FBF689DDAC2EC26B2EC26B2EC26B2BBF64239629C3E2C7FFFFFFD7E7DC40BB41 + 75D68382DAA066D28E2EC26B2EC26B97E1B52EC26B2EC26B2EC26B2EC26B2BBF + 64239629C3E2C7FFFFFFFFFFFFC9E3CD40C24077D78098E0AD76D7985ACE863A + C5732EC26B2EC26B2EC26B28BD5E189E26C9E4CDFFFFFFFFFFFFFFFFFFC9E3CD + 40BB4177D78098E0AD76D7985ACE863AC5732EC26B2EC26B2EC26B28BD5E189E + 26C9E4CDFFFFFFFFFFFFFFFFFFFFFFFFCAE4CE40C24047CB4984DA918CDCA66A + D3914ECB7F2DBF6117B13643B547CAE5CEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + CAE4CE40BB4147CB4984DA918CDCA66AD3914ECB7F2DBF6117B13643B547CAE5 + CEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDBE9DF9AD99D40C24040C24040 + C24040C24040C2409AD99DDBEADEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFDBE9DF9AD99D40C24040C24040C24040C24040C2409AD99DDBEADEFFFF + FFFFFFFFFFFFFFFFFFFF424D7E000000000000003E0000002800000020000000 + 10000000010001000000000040000000120B0000120B00000200000002000000 + FFFFFF0000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000} + end + object ilDisabledButtons: TImageList + Left = 120 + Top = 141 + Bitmap = { + 494D474C01000100100000001000000002000000424D36060000000000003600 + 0000280000002000000010000000010018000000000000060000120B0000120B + 00000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCCCCCC9B9B9B5D5D5D4040403D + 3D3D383838484848868686CCCCCCFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFCCCCCC9B9B9B5D5D5D4040403D3D3D383838484848868686CCCCCCFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFBFBF6868686565657B7B7B76767672 + 72726F6F6F6A6A6A575757434343C0C0C0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + BFBFBF6868686565657B7B7B7676767272726F6F6F6A6A6A575757434343C0C0 + C0FFFFFFFFFFFFFFFFFFFFFFFFC1C1C15F5F5F8383838585858080807B7B7B92 + 92927C7C7C7272726C6C6C6868683E3E3EC2C2C2FFFFFFFFFFFFFFFFFFC1C1C1 + 5F5F5F838383858585808080A5A5A5B3B3B37474747272726C6C6C6868683E3E + 3EC2C2C2FFFFFFFFFFFFD8D8D87D7D7D8888888E8E8E8B8B8B858585B1B1B1FF + FFFFD5D5D57777777272727070706A6A6A454545D2D2D2FFFFFFD8D8D87D7D7D + 8888888E8E8E8B8B8B858585E8E8E8FFFFFFCDCDCD7777777272727070706A6A + 6A454545D2D2D2FFFFFFBBBBBB7373739797979595958F8F8FB7B7B7FFFFFFFF + FFFFC8C8C87C7C7C7B7B7B7474747272725959599B9B9BFFFFFFBBBBBB737373 + 9797979595958F8F8F868686B7B7B7FFFFFFFFFFFFCDCDCD7B7B7B7474747272 + 725959599B9B9BFFFFFF8282828E8E8E979797979797BDBDBDFFFFFFFFFFFFD3 + D3D38686868484847F7F7F7B7B7B797979727272575757FFFFFF8282828E8E8E + 9797979797978686868686868E8E8EB8B8B8FFFFFFFFFFFFCDCDCD7D7D7D7979 + 79727272575757FFFFFF828282979797979797BEBEBEFFFFFFFFFFFFF8F8F8C7 + C7C7C7C7C7C2C2C2C2C2C2C0C0C07D7D7D7B7B7B4B4B4BFFFFFF828282979797 + B1B1B1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD0D0D07D7D + 7D7B7B7B4B4B4BFFFFFF878787979797A4A4A4FFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFF858585808080515151FFFFFF878787979797 + B1B1B1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE9E9E98585 + 85808080515151FFFFFF888888999999979797BEBEBEFFFFFFFFFFFFFFFFFFD1 + D1D1CBCBCBCBCBCBC9C9C9C7C7C78B8B8B858585515151FFFFFF888888999999 + 979797979797979797979797979797C5C5C5FFFFFFFFFFFFEAEAEA9797978B8B + 8B858585515151FFFFFF8888889A9A9A9F9F9F979797BEBEBEFFFFFFFFFFFFEB + EBEB9E9E9E9797979797979595958F8F8F8E8E8E636363FFFFFF8888889A9A9A + 9F9F9F979797979797979797AAAAAAF8F8F8FFFFFFEBEBEB9797979595958F8F + 8F8E8E8E636363FFFFFFC2C2C2878787B6B6B6A8A8A89B9B9BBEBEBEFFFFFFFF + FFFFD1D1D19797979797979797979797976F6F6FB8B8B8FFFFFFC2C2C2878787 + B6B6B6A8A8A89B9B9B979797DEDEDEFFFFFFEBEBEB9797979797979797979797 + 97777777B8B8B8FFFFFFE1E1E18C8C8CB2B2B2BEBEBEB1B1B1A1A1A1BFBFBFF8 + F8F8C5C5C5979797979797979797939393686868D6D6D6FFFFFFE1E1E1888888 + B2B2B2BEBEBEB1B1B1979797979797CBCBCB9797979797979797979797979393 + 93686868D6D6D6FFFFFFFFFFFFD9D9D98C8C8CB2B2B2C8C8C8B9B9B9ABABAB9D + 9D9D9797979797979797979090906B6B6BDADADAFFFFFFFFFFFFFFFFFFD9D9D9 + 888888B2B2B2C8C8C8B9B9B9ABABAB9D9D9D9797979797979797979090906B6B + 6BDADADAFFFFFFFFFFFFFFFFFFFFFFFFDADADA8C8C8C959595BABABAC3C3C3B3 + B3B3A6A6A69292927B7B7B878787DBDBDBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + DADADA888888959595BABABAC3C3C3B3B3B3A6A6A69292927B7B7B878787DBDB + DBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE4E4E4C0C0C08C8C8C8C8C8C8C + 8C8C8C8C8C8C8C8CC0C0C0E4E4E4FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFE4E4E4C0C0C08C8C8C8C8C8C8C8C8C8C8C8C8C8C8CC0C0C0E4E4E4FFFF + FFFFFFFFFFFFFFFFFFFF424D7E000000000000003E0000002800000020000000 + 10000000010001000000000040000000120B0000120B00000200000002000000 + FFFFFF0000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000} + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Base/DemoFrame.dfm b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Base/DemoFrame.dfm new file mode 100644 index 0000000..08110ca --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Base/DemoFrame.dfm @@ -0,0 +1,7 @@ +object DemoFrame: TDemoFrame + Left = 0 + Top = 0 + Width = 308 + Height = 228 + TabOrder = 0 +end diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Base/DemoFrame.pas b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Base/DemoFrame.pas new file mode 100644 index 0000000..6636031 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Base/DemoFrame.pas @@ -0,0 +1,57 @@ +unit DemoFrame; + +interface + +uses + Classes, +{$IFDEF LINUX} + QControls, QStdCtrls, QGraphics, QForms, +{$ELSE} + Forms, Windows, Messages, SysUtils, StdCtrls, Graphics, Controls, Dialogs, + ComCtrls, Buttons, ExtCtrls, DBCtrls, +{$ENDIF} + DBAccess + {$IFNDEF VER130}, Variants{$ENDIF} + ; + +type + TDemoFrame = class(TFrame) + public + Connection: TCustomDAConnection; + procedure Initialize; virtual; + procedure SetDebug(Value: boolean); virtual; + + procedure AssignConnectionTo(Dest: TCustomDAConnection); + end; + + TDemoFrameClass = class of TDemoFrame; + + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} +{$IFDEF LINUX} +{$R *.xfm} +{$ENDIF} + +procedure TDemoFrame.Initialize; +begin +end; + +procedure TDemoFrame.SetDebug(Value: boolean); +begin +end; + +procedure TDemoFrame.AssignConnectionTo(Dest: TCustomDAConnection); +begin + Dest.Assign(Connection); + Dest.AfterConnect := nil; + Dest.AfterDisconnect := nil; +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Base/DemoFrame.xfm b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Base/DemoFrame.xfm new file mode 100644 index 0000000..aac3159 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Base/DemoFrame.xfm @@ -0,0 +1,13 @@ +object DemoFrame: TDemoFrame + Left = 0 + Top = 0 + Width = 308 + Height = 228 + Font.Color = clBlack + Font.Height = 11 + Font.Name = 'helvetica' + Font.Pitch = fpVariable + Font.Style = [] + ParentFont = False + TabOrder = 0 +end diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Base/HtmlConsts.pas b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Base/HtmlConsts.pas new file mode 100644 index 0000000..32944d8 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Base/HtmlConsts.pas @@ -0,0 +1,142 @@ +unit HtmlConsts; + +interface + +const + HTMLHeader: string = + ''#13#10 + + ''#13#10 + + ''#13#10 + + ' Samples - Oracle Data Access Components'#13#10 + + ''#13#10 + + ''#13#10 + + ''#13#10; + + HTMLFooter: string = '' + #13#10 + ''; + +implementation + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Base/SdacAbout.dfm b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Base/SdacAbout.dfm new file mode 100644 index 0000000..0067eb0 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Base/SdacAbout.dfm @@ -0,0 +1,3078 @@ +object SdacAboutForm: TSdacAboutForm + Left = 582 + Top = 202 + BorderIcons = [biSystemMenu] + BorderStyle = bsDialog + Caption = 'About SDAC' + ClientHeight = 276 + ClientWidth = 386 + Color = clBtnFace + ParentFont = True + OldCreateOrder = True + Position = poScreenCenter + OnMouseMove = FormMouseMove + PixelsPerInch = 96 + TextHeight = 13 + object Bevel1: TBevel + Left = 8 + Top = 8 + Width = 123 + Height = 263 + end + object Image1: TImage + Left = 9 + Top = 9 + Width = 120 + Height = 260 + AutoSize = True + Picture.Data = { + 07544269746D6170D66D0100424DD66D01000000000036000000280000007800 + 0000040100000100180000000000A06D0100C30E0000C30E0000000000000000 + 0000020000020000020000020000020000020000020000020000020000020000 + 0200000200000200000200000200000200000200000200000200000200000200 + 0002000002000002000002000002000002000002000002000002000002000002 + 0000020000020000020000020000020000020000020000020000020000020000 + 0200000200000200000200000200000200000200000200000200000200000200 + 0002000002000002000002000002000002000002000002000002000002000002 + 0000020000020000020000020000020000020000020000020000020000020000 + 0200000200000200000200000200000200000200000200000200000200000200 + 0002000002000002000002000002000002000002000002000002000002000002 + 0000020000020000020000020000020000020000020000020000020000020000 + 0200000200000200000200000200000200000200000200000200000200000200 + 0002000002000002000002000025258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C02000002000025258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C02000002000025258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C02 + 000002000025258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C02000002000025258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C02000002000025258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C02000002000025258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C02 + 000002000025258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C26268C26268C26268C26268C27278D27278D27278D27278D27278D27278D27 + 278D26268C26268C26268C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C02000002000025258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C26268C26268C + 27278D28288D28288E29298E2A2A8F2B2B8F2C2C902D2D902D2D902E2E912E2E + 912E2E912E2E912E2E912D2D902C2C902B2B8F29298E28288E28288D27278D26 + 268C26268C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C02000002000025258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C26268C27278D28 + 288D28288E29298E2A2A8F2C2C902D2D902E2E91303092323293333393343494 + 3636953737953939963A3A973A3A973A3A973A3A973838963636953434943232 + 933030922E2E912B2B8F29298E28288D27278D26268C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C02000002000025258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C26268C26268C2727 + 8D28288D28288E29298E2A2A8F2B2B8F2C2C902D2D902E2E9130309232329334 + 34943737953A3A973C3C9840409A42429B45459D47479E49499F4A4A9F49499F + 48489E46469E43439C40409A3C3C983838963434943030922D2D902A2A8F2828 + 8E27278D26268C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C02 + 000002000025258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C26268C + 26268C27278D27278D27278D26268C26268C25258C25258C25258C25258C2525 + 8C25258C26268C28288E2C2C902F2F913434943A3A9740409A45459D4B4BA051 + 51A35555A55858A75959A85A5AA85858A75555A55151A34B4BA046469E40409A + 3A3A973535953030922D2D9029298E28288D26268C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C02000002000025258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C26268C26268C26268C + 27278D27278D27278D27278D27278D27278D27278D26268C26268C25258C2525 + 8C2E2E9139399644449C4D4DA15757A65E5EAA6363AD6767AF6868AF6767AF63 + 63AD5E5EAA5757A75050A348489E40409A3A3A973434942E2E912B2B8F28288E + 27278D26268C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C02000002000025258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C26268C27278D27278D28288D28 + 288E29298E29298E2A2A8F2B2B8F2B2B8F2B2B8F2B2B8F2B2B8F2B2B8F2A2A8F + 2A2A8F29298E28288E28288D27278D25258C28288E39399648489E5656A66262 + AC6A6AB17171B47474B57373B56F6FB36969B06262AC5858A74F4FA245459D3D + 3D993535952F2F912B2B8F28288E27278D26268C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C02000002000025258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C26268C27278D28288D28288E2929 + 8E2B2B8F2C2C902D2D902E2E912F2F9130309231319231319232329332329331 + 31923131923030922F2F912E2E912E2E912D2D902B2B8F2A2A8F28288E27278D + 26268C2A2A8F3F3F9A5151A36262AC6F6FB37878B87C7CBA7D7DBA7A7AB97373 + B56969B05E5EAA5353A448489E3F3F9A3636953030922C2C9028288E27278D26 + 268C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C02 + 000002000025258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C26268C27278D28288D28288E29298E + 2B2B8F2D2D902E2E913030923232933434943535953636953737953838963838 + 963838963838963838963737953636953535953434943333933232933030922F + 2F912E2E912C2C902A2A8F28288E27278D25258C3636954D4DA16262AC7272B5 + 7E7EBB8484BE8686BF8181BD7A7AB96F6FB36363AC5656A649499F3F3F9A3636 + 952F2F912B2B8F28288D26268C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C02000002000025258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C26268C27278D28288D29298E2B + 2B8F2D2D902F2F913131923434943636953838963A3A973B3B983C3C983E3E99 + 3E3E993E3E993E3E993E3E993D3D993C3C983B3B983A3A973A3A973838963737 + 953535953434943333933232933030922E2E912D2D902B2B8F29298E28288D26 + 268C3030924B4BA06363AC7575B68383BE8B8BC28C8CC28787C07E7EBB7272B5 + 6363AD5656A649499F3D3D993434942E2E912A2A8F28288D26268C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C02000002000025258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C26268C27278D28288D2929 + 8E2C2C902E2E913030923434943636953939963B3B983E3E9940409A41419B42 + 429B43439C43439C43439C3E3E963333872929772424711C1C651B1B6317175E + 12125612125617175E1919631A1A6520206F2323742A2A822F2F8F3030922E2E + 912E2E912C2C902A2A8F28288D26268C2E2E914C4CA16666AE7B7BBA8989C191 + 91C59191C58B8BC28080BC7272B56363AC5353A446469E3B3B983333932D2D90 + 29298E27278D26268C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C02000002000025258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C26268C27278D28288D + 29298E2C2C902E2E913131923434943838963B3B983E3E9941419B43439C4545 + 9D46469E46469E44449B35358725257119196012125612125612125612125612 + 1256121256121256121256121256121256121256121256121256121256121256 + 1212561717601F1F6F26267F2D2D902D2D902B2B8F29298E28288D26268C3333 + 935151A36D6DB28181BD9090C49696C89494C78C8CC38080BC6F6FB35F5FAB50 + 50A342429B3838963030922B2B8F28288D26268C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C02 + 000002000025258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C26268C27278D28 + 288D29298E2B2B8F2E2E913131923535953939963D3D9940409A43439C46469E + 48489E49499F4A4A9F3A3A8A26267115155A1212561212561212561212561212 + 5612125612125612125612125612125612125612125612125612125612125612 + 125612125612125612125612125612125612125614145A1D1D6C2727822D2D90 + 2B2B8F29298E28288D25258C3A3A975A5AA87575B68A8AC19696C89A9ACA9696 + C88C8CC27C7CBA6B6BB15A5AA84B4BA03E3E993434942E2E9129298E27278D26 + 268C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C02000002000025258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2626 + 8C27278D28288E2B2B8F2E2E913131923434943939963D3D9941419B45459D48 + 489E4B4BA04B4BA048489B2E2E7A17175D121256121256121256121256121256 + 12125612125612125613135814145A15155B16165C16165D17175D17175D1616 + 5D16165C15155B14145A13135812125612125612125612125612125612125612 + 125612125615155C2020742B2B8D2A2A8F28288E27278D25258C45459D6464AD + 7F7FBB9292C69C9CCB9D9DCB9696C88888C07777B76464AD5353A444449C3939 + 963030922B2B8F28288D26268C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C02000002000025258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 26268C27278D28288E2A2A8F2D2D903030923434943838963D3D9941419B4545 + 9D49499F4C4CA14E4EA247479A2C2C7714145912125612125612125612125612 + 125612125714145A16165D1818601A1A621B1B641D1D661D1D671E1E681E1E69 + 1F1F691F1F691E1E691E1E681D1D671C1C651B1B6419196118186016165D1414 + 5A1212571212561212561212561212561212561313591E1E7129298B29298E28 + 288D26268C3030925252A47272B58B8BC29A9ACAA0A0CD9E9ECC9292C68282BD + 6F6FB35C5CA94B4BA03E3E993434942D2D9028288E27278D25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C02000002000025258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C26268C27278D28288D29298E2C2C902E2E913333933737953C3C9840409A + 45459D4A4A9F4D4DA14F4FA249499B2A2A731313571212561212561212561212 + 5612125715155B17175E1A1A621C1C651E1E6820206B21216D23236F24247125 + 257225257326267427277527277526267425257325257224247123236F21216D + 20206A1E1E681C1C651A1A6217175E15155B1212571212561212561212561212 + 561313581C1C6E28288A28288E27278D25258C40409A6363AC8080BC9696C8A1 + A1CDA3A3CE9B9BCA8C8CC27979B86565AE5252A443439C3737952F2F912A2A8F + 27278D26268C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C02 + 000002000025258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C26268C27278D28288E2A2A8F2E2E913131923535953A3A9740 + 409A44449C49499F4C4CA15050A35050A1343480141459121256121256121256 + 12125614145917175D1919611D1D661F1F6921216D2323702525732727752929 + 782A2A7A2B2B7B2C2C7D2D2D7E2D2D7E2D2D7F2D2D7F2D2D7E2D2D7E2C2C7D2B + 2B7B2A2A7A29297827277525257323237021216D1F1F691C1C6519196117175D + 1313581212561212561212561212561313591F1F7429298D28288D26268C2E2E + 915252A47474B58E8EC39F9FCCA6A6D0A2A2CE9595C78282BD6E6EB25A5AA849 + 499F3B3B983232932C2C9028288D26268C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C02000002000025258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C26268C27278D28288D29298E2C2C902F2F913434943939 + 963E3E9943439C48489E4C4CA15050A35151A34343921D1D6312125612125612 + 125612125614145A18185F1B1B631E1E6821216C2323702626742828772B2B7B + 2D2D7E2E2E803030823131843232863333873434883434883434893434893434 + 883434883333873232863131843030822E2E802D2D7E2B2B7B28287726267423 + 237021216C1E1E681B1B6318185F14145A12125612125612125612125615155E + 22227D28288E27278D25258C43439C6767AF8686BF9B9BCAA6A6D0A6A6D09C9C + CB8B8BC27676B76262AC4F4FA240409A3434942E2E9128288E27278D25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C02000002000025258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C26268C27278D28288E2B2B8F2E2E91323293 + 3636953B3B9840409A46469E4B4BA04F4FA25151A34E4E9E2A2A721212561212 + 5612125612125614145A18185F1B1B641F1F6922226E2525722828762B2B7B2D + 2D7E2F2F8131318433338735358A36368C37378D39398F3939903A3A913A3A92 + 3B3B933B3B933A3A923A3A9139399039398F37378D36368C35358A3333873131 + 842F2F812E2E7E2C2C7B28287625257222226E1F1F691B1B6418185F14145A12 + 125612125612125612125618186525258728288D26268C3535955A5AA87B7BBA + 9595C7A5A5D0AAAAD2A2A2CE9292C67F7FBB6969B05555A545459D3838962F2F + 912A2A8F27278D26268C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C02000002000025258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C26268C28288D29298E2C2C902F + 2F913434943939963F3F9A44449C49499F4E4EA25151A35353A43A3A8516165A + 12125612125612125614145918185F1B1B641F1F6923236F2626742929782C2C + 7D2F2F8131318434348836368B38388E3939903B3B933C3C953E3E973F3F983F + 3F9940409A41419B41419B41419B40409A40409A3F3F993F3F983E3E973C3C95 + 3B3B9339399038388E3C3C8D43438F3E3E8A3232822C2C7D2929782626742222 + 6E1F1F691B1B6418185F14145912125612125612125613135821217728288D27 + 278D28288E4C4CA17070B48E8EC3A2A2CEAAAAD2A7A7D19999C98686BF7070B4 + 5C5CA94A4A9F3B3B983232932C2C9028288D26268C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C02 + 000002000025258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C26268C27278D28288D2A2A + 8F2E2E913131923636953B3B9841419B47479E4C4CA15151A35353A44949971F + 1F6612125612125612125613135817175D1A1A631F1F6922226E252574292979 + 2C2C7E2F2F8232328634348A37378D3939913B3B943D3D973F3F9940409C4242 + 9D43439F4343A04444A14545A24545A24545A34545A34545A24545A24444A143 + 43A042429E42429D40409C40409948489B54549F55559D505099474793383889 + 2F2F822C2C7D28287825257422226E1E1E691A1A6317175D1313581212561212 + 561616591D1D6825258527278D25258C40409A6565AE8686BF9E9ECCAAAAD2AA + AAD29F9FCC8D8DC37878B86363AC4F4FA240409A3434942E2E9128288E27278D + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C02000002000025258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C26268C27278D + 28288E2B2B8F2E2E913333933838963E3E9944449C4A4A9F4F4FA25353A45454 + A332327C12125612125612125612125615155C1A1A621D1D6821216D25257328 + 28782C2C7E2F2F8232328735358B38388F3A3A933D3D963F3F9941419C43439F + 4444A14646A44747A54848A74848A74949A94A4AAA4A4AAA4A4AAA4A4AAA4A4A + AA4A4AAA4949A94848A74848A74646A54646A45151A76060AC6060AA4E4EA04B + 4B9C55559F4F4F9A3B3B8D3232872F2F822C2C7D28287825257221216D1D1D67 + 19196115155B12125616165919195C16165A1F1F7627278D26268C3434945959 + A87B7BBA9797C8A7A7D1ABABD3A4A4CF9494C78080BC6969B05555A544449C38 + 38962F2F912A2A8F27278D26268C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C02000002000025258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C26268C26 + 268C28288D29298E2C2C903030923434943A3A9740409A46469E4C4CA15151A3 + 5555A54E4E9C21216812125612125612125614145A1818601C1C6620206C2424 + 722828772B2B7D2F2F8232328735358B3838903B3B943E3E9840409C42429E44 + 44A14646A44848A74949A94A4AAA4B4BAC4C4CAD4D4DAF4E4EB04E4EB04E4EB1 + 4E4EB14E4EB14E4EB14E4EB04E4EB04D4DAF4C4CAD4B4BAC5757AF6B6BB76A6A + B55656AA4545A142429E5050A25A5AA452529E41419435358B3232872F2F822B + 2B7D28287724247121216C2020681C1C611C1C5F1A1A5D141458121256191968 + 27278A26268C29298E4D4DA17171B49090C4A4A4CFACACD3A8A8D19A9ACA8686 + BF7070B45B5BA849499F3A3A973131922B2B8F28288D26268C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C02000002000025258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C26268C27278D28288E2A2A8F2E2E913232933737953D3D9943439C49499F4F + 4FA25353A45656A641418D16165A12125612125612125616165D1A1A631F1F69 + 2323702727752A2A7B2F2F8132328635358B3838903B3B943E3E9840409C4343 + A04545A34747A64949A94B4BAB4C4CAD4E4EAF4F4FB15050B35151B45252B552 + 52B65252B65353B75353B75353B75353B75252B65252B65252B55151B45A5AB7 + 7373C07474BF5B5BB34D4DAC4949A94747A64545A34F4FA45E5EA85757A44444 + 9738389035358B32328630308133337F34347C3131782C2C712424691B1B6013 + 135612125612125615155D23238127278D25258C42429B6666AE8787C09F9FCC + ABABD3ABABD3A0A0CD8D8DC37777B76161AC4D4DA13E3E993333932C2C902828 + 8E26268C25258C25258C25258C25258C25258C25258C25258C25258C25258C02 + 000002000025258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C26268C27278D28288E2B2B8F2E2E913434943939963F3F9A4545 + 9D4B4BA05151A35555A55555A42E2E7612125512125512125514145918185F1D + 1D6621216C2525722929782D2D7E30308334348938388E3B3B923E3E9740409B + 43439F4646A34848A64A4AA94C4CAC4E4EAE4F4FB15050B25252B55353B65454 + B75454B85555B95656BA5656BB5656BB5656BB5656BB5656BB5656BB5656BA55 + 55B95C5CBC7676C67C7CC76262BB5252B34F4FB14E4EAE4C4CAC4A4AA94848A6 + 5454A96262AC5A5AA649499B3E3E9440409248489346468E40408736367F2C2C + 7624246D1D1D6618185E1313571212551212551212561E1E7227278D26268C37 + 37955C5CA97E7EBB9999C9AAAAD2ADADD4A4A4CF9393C67E7EBB6767AF5252A4 + 41419B3535952E2E9129298E27278D25258C25258C25258C25258C25258C2525 + 8C25258C25258C02000002000025258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C26268C28288D29298E2C2C903030923535953A3A97 + 41419B47479E4D4DA15252A45656A64C4C991D1D631212551212551212551616 + 5B1A1A621F1F6823236F2727752B2B7C2F2F8133338736368C3A3A923D3D9640 + 409B43439F4646A34848A64A4AA94C4CAC4E4EAF5050B25252B55353B65454B8 + 5555BA5656BB5757BC5858BE5858BE5959BF5959BF5959C05959C05959C05959 + C05959BF5959BF5959BF6C6CC68787D06E6EC55555BA5454B85353B65252B450 + 50B24E4EAF4C4CAC4C4CAA5454AB6464B06161AC5757A45858A254549D464694 + 3A3A8A3131822B2B7A27277522226E1F1F681A1A6215155A1212561212551212 + 5518186526268A26268C2D2D905151A37575B69393C6A7A7D1AEAED4A9A9D199 + 99C98484BE6D6DB25757A745459D3838962F2F912A2A8F27278D26268C25258C + 25258C25258C25258C25258C25258C02000002000025258C25258C25258C2525 + 8C25258C25258C25258C25258C26268C27278D28288D2A2A8F2E2E9131319237 + 37953D3D9943439C4A4A9F5050A35454A55757A73C3C86141458121255121255 + 13135718185F1D1D6621216C2525722A2A792D2D7E32328535358A39398F3C3C + 943F3F9942429D4545A24848A64A4AA94D4DAD4E4EB05050B25252B55454B755 + 55BA5656BB5858BD5858BE5959C05A5AC15B5BC25B5BC35C5CC35C5CC45C5CC4 + 5C5CC45C5CC45C5CC45C5CC45C5CC35B5BC26E6EC98C8CD57474CA5A5ABF5858 + BD5656BB5555BA5454B75252B55050B24E4EB04D4DAD5656AE6666B36464AF58 + 58A745459B3F3F9638388F3535893131832D2D7E29297929297326266E222268 + 1C1C6016165916165915155816165E23238127278D25258C46469E6C6CB18C8C + C3A4A4CFAEAED4ABABD39E9ECC8A8AC17373B55D5DA94A4A9F3B3B983131922B + 2B8F28288D26268C25258C25258C25258C25258C25258C02000002000025258C + 25258C25258C25258C25258C25258C25258C26268C27278D28288E2B2B8F2E2E + 913333933939963F3F9A45459D4B4BA05151A35656A65454A229297012125512 + 125512125515155A1A1A611F1F6823236F2727752B2B7C30308233338737378D + 3B3B923E3E9742429C4444A04747A54A4AA94C4CAC4E4EB05050B25252B55454 + B85656BA5757BC5858BE5959C05A5AC15B5BC35C5CC45D5DC45D5DC65E5EC65E + 5EC75E5EC75E5EC75E5EC75E5EC75E5EC75E5EC75E5EC75E5EC66565C87E7ED2 + 8B8BD67373CC5E5EC25959C05858BE5757BC5656BA5454B85252B55050B24E4E + AF5454AF5656AE4A4AA64444A041419C3E3E973D3D933C3C8F3D3D8B3F3F8938 + 388233337B2E2E7527276D2222661B1B5F17175A17175A17175A1F1F7427278D + 25258C3D3D996363AC8585BF9F9FCCADADD4AEAED4A3A3CE9090C47979B86262 + AC4E4EA23F3F9A3434942D2D9028288E26268C25258C25258C25258C25258C02 + 000002000025258C25258C25258C25258C25258C25258C26268C27278D29298E + 2C2C902F2F913434943A3A9740409A47479E4D4DA15353A45757A64F4F9C1E1E + 6312125512125512125617175C1B1B6420206B2525712929782D2D7E32328535 + 358A3939903D3D9540409A43439F4646A34949A84C4CAC4E4EAF5050B25252B5 + 5454B85656BB5757BC5959BF5A5AC05B5BC25C5CC45D5DC45E5EC65E5EC75E5E + C75F5FC86060C96060C96060C96060C96060C96060C96060C96060C96060C960 + 60C95F5FC86565CA8181D49292DA7575CE5E5EC55B5BC25A5AC05858BE5757BC + 5656BA5454B85252B55050B24E4EAF4B4BAB4949A74848A44E4EA35252A25353 + 9E4F4F9942428F3C3C893535812D2D7929297322226B1E1E641A1A5E16165917 + 175A19195C1C1C6A26268A26268C3434945959A87D7DBA9999C9AAAAD2AFAFD5 + A6A6D09595C77F7FBB6868AF5353A442429B3636952E2E9129298E27278D2525 + 8C25258C25258C02000002000025258C25258C25258C25258C25258C26268C28 + 288D29298E2D2D903030923535953C3C9842429B49499F4F4FA25454A55757A7 + 43438E15155A11115511115514145918185F1D1D6722226D2626742A2A7A2E2E + 8133338736368C3A3A923D3D9741419D4444A14747A64A4AAA4D4DAE4F4FB151 + 51B55353B75555BA5656BC5A5AC05F5FC36161C46262C66363C76464C96363C9 + 6464CA6565CB6464CB6565CD6464CC6363CC6161CC6060CC6060CC6060CC6060 + CC6060CC6060CB6060CB6060CB5F5FC96464CB8080D68F8FDB7A7AD15F5FC75B + 5BC45A5AC25959C15757BE5656BC5555BA5353B75151B54F4FB15252B06161B3 + 6262B15D5DAC5050A34242993C3C9338388D3232862E2E802A2A792525732020 + 6C1C1C6518185F13135812125615155819196125258526268C2C2C905050A374 + 74B59292C6A7A7D1AFAFD5AAAAD29A9ACA8585BF6E6EB25858A746469E3A3A97 + 3030922A2A8F28288D26268C25258C02000002000025258C25258C25258C2626 + 8C27278D28288E2A2A8F2E2E913232933737953E3E9944449C4B4BA05151A356 + 56A65858A733337C11115511115511115515155B1A1A621F1F69232370282876 + 2C2C7D30308334348938388F3C3C943F3F9A43439F4646A44949A84B4BAC4E4E + B05050B35252B65454B95656BC5757BE5D5DC16262C56464C76565C86565C966 + 66CA6565CB6666CB6767CD6666CD6666CE6767CE6666CE6666CE6565CE6262CD + 6161CD6161CD6161CD6161CD6161CC6161CC6161CC6060CC6060CB6767CE7C7C + D59393DD7A7AD26262C95D5DC65B5BC45A5AC25959C05757BE5656BB5656BA5E + 5EBB6F6FC06B6BBB5D5DB35050AB4646A342429E3F3F993B3B9437378E343489 + 3030822B2B7C27277522226E1D1D6719196014145912125612125616165B2222 + 7C26268C25258C45459D6A6AB18B8BC2A3A3CEADADD4ABABD39E9ECC8B8BC275 + 75B65E5EAA4B4BA03D3D993333932C2C9028288E26268C02000002000025258C + 25258C26268C27278D28288E2B2B8F2E2E9134349439399640409A46469E4C4C + A15252A45757A65454A225256C11115511115512125617175D1C1C6420206B25 + 25722929792E2E8032328636368C3A3A923D3D9741419C4444A14747A64A4AAA + 4D4DAE4F4FB25151B55353B85555BB5757BE5959C05C5CC36464C76565C86666 + CA6767CB6767CC6767CB6868CD6767CD6868CE6868CE6767CE6767CF6868CF67 + 67CF6767CF6666CE6363CE6262CE6262CD6262CD6262CD6262CD6161CD6161CC + 6161CC6161CC6868CE8282D88F8FDC7B7BD46565CB5D5DC75C5CC55B5BC45A5A + C25959C06969C57A7AC96F6FC35C5CB94F4FB14C4CAD4A4AA94747A54444A040 + 409B3D3D9639399035358B3131852D2D7E2828772424711F1F691A1A6216165B + 1111551111551313561E1E7227278D25258C3B3B986060AB8282BD9D9DCBABAB + D3ACACD3A3A3CE9191C57B7BBA6565AE5151A341419B3636952E2E9129298E02 + 000002000025258C26268C28288D29298E2C2C903030923535953A3A9741419B + 48489E4E4EA25353A45757A74B4B971A1A5F11115511115514145918185F1D1D + 6722226E2626742B2B7B2F2F8233338837378E3B3B943F3F9942429E4545A348 + 48A84B4BAC4E4EB05050B35353B75454BA5656BC5858BF5959C15B5BC36060C6 + 6767CA6767CA6868CC6868CC6969CE6969CE6868CE6969CE6868CE6868CF6969 + CF6868CF6868D06868D06767D06767D06464CF6262CE6262CE6262CE6262CE62 + 62CE6262CD6262CD6161CD6161CC6161CC6666CE8080D89595DF7878D35F5FC9 + 5D5DC75D5DC65E5EC56A6AC88282D17474CA5A5ABE5454B95252B65050B34D4D + AF4B4BAC4848A74545A342429D3E3E983A3A9236368C3232862E2E802A2A7A25 + 257320206C1C1C6517175E1313571111551212561A1A6726268A26268C323293 + 5656A67979B89595C7A7A7D1ACACD3A6A6D09797C88282BD6C6CB15757A74646 + 9E3A3A9731319202000002000027278D28288D2A2A8F2E2E913232933737953D + 3D9943439C4A4A9F5050A35454A55757A73E3E8814145811115511115515155B + 1A1A621F1F692323702828772C2C7D30308335358A3939903C3C9640409B4444 + A04747A54A4AA94D4DAE4F4FB25151B55353B85555BB5757BE5959C05A5AC25B + 5BC45C5CC66464C96969CB6969CC6969CD6A6ACE6969CF6A6ACF6A6ACF6969CF + 6A6ACF6969CF6969D06969D06868D06868D06868D06767D06565CF6262CE6262 + CE6262CE6262CE6262CE6262CE6262CE6262CD6262CD6161CD6161CC7979D597 + 97E18080D75F5FCA5F5FC95E5EC86E6ECD8383D57676CE6060C45959C05757BE + 5555BB5353B85151B54E4EB14C4CAD4949A94646A443439F3F3F9A3C3C943838 + 8F3434893030822B2B7C27277522226E1D1D6718185F14145911115512125517 + 175F24248426268C28288D4A4A9F6E6EB28C8CC3A2A2CEAAAAD2A8A8D19C9CCB + 8989C17474B55E5EAA4C4CA13F3F9A02000002000028288E2B2B8F2E2E913333 + 933939963F3F9A45459D4B4BA05151A35656A65555A42E2E7611115511115512 + 125617175D1C1C6420206B2525722929792E2E8032328636368C3A3A923D3D97 + 41419D4545A24848A64B4BAB4D4DAF5050B35252B65454BA5656BC5858BF5959 + C15B5BC35C5CC55D5DC75E5EC86565CB6B6BCD6B6BCE6A6ACF6B6BCF6B6BCF68 + 68CF6868CF6969CF6868CF6868D06868D06969D06969D06868D06868D06868D0 + 6565CF6262CE6262CE6262CE6262CE6262CE6262CE6262CE6262CE6262CD6262 + CD6B6BD18B8BDD8D8DDD6D6DD16060CC6060CB6B6BCE8484D87F7FD56464CA5C + 5CC45B5BC35959C15757BE5656BC5454B95252B65050B24D4DAE4A4AAA4747A6 + 4444A140409C3D3D9639399035358B3131842D2D7E2828772424701F1F691A1A + 6215155B11115512125617175B22227C27278D25258C3E3E996262AC8282BD9A + 9ACAA7A7D1A9A9D19F9FCC8F8FC47B7BBA6767AF5454A50200000200002C2C90 + 3030923434943A3A9740409A47479E4D4DA15252A45757A64C4C991D1D631111 + 5511115514145918185F1D1D6722226D2626742B2B7B2F2F8233338837378E3B + 3B943F3F9942429F4646A44949A94C4CAD4E4EB15151B55353B85555BB5757BE + 5959C05A5AC25B5BC45C5CC65D5DC75E5EC85F5FC96666CC6C6CCF6C6CD06C6C + CF6B6BD06B6BD06464CE6262CD6262CE6262CE6262CE6464CF6969D06969D069 + 69D06868D06868D06565CF6262CE6262CE6262CE6262CE6262CE6262CE6262CE + 6262CE6262CE6262CE7E7ED89898E27A7AD76363CE6161CC6060CC8181D88585 + D96A6ACD5E5EC85D5DC75C5CC65B5BC45A5AC25858BF5757BD5555BA5353B750 + 50B34E4EB04B4BAC4848A74545A342429D3E3E983A3A9236368C3232862E2E80 + 2A2A7925257220206B1C1C6417175D1212561212561616591F1F7127278C2626 + 8C3131925454A57575B69191C5A2A2CEA7A7D1A2A2CE9595C78383BE6F6FB302 + 00000200003232933737953C3C9843439C49499F4F4FA25353A45757A641418C + 15155A11115511115515155B1A1A621F1F692323702828772C2C7D3030833434 + 8A3939903C3C9640409B4444A04747A54A4AAA4D4DAE4F4FB25151B55454B956 + 56BC5757BE5959C15B5BC35C5CC45D5DC75E5EC85F5FC95F5FC96060CB6767CE + 6D6DD06D6DD06D6DD16D6DD06C6CD06464CF6262CE6262CE6262CE6262CE6464 + CF6969D06969D06969D06969D06868D06666CF6262CE6262CE6262CE6262CE62 + 62CE6262CE6262CE6262CE6262CE6464CF8D8DDE9292E06969D06262CD6161CD + 7070D28F8FDE7272D36060CB5F5FC95F5FC95D5DC75D5DC65C5CC45A5AC35959 + C05757BE5555BB5353B85151B54F4FB14C4CAD4949A94646A443439F3F3F9A3C + 3C9438388F3434892F2F822B2B7B26267422226D1D1D6718185F141459131356 + 18185B1A1A6425258826268C25258C45459D6767AF8484BE9898C9A3A3CEA2A2 + CE9999C98A8AC10200000200003939963F3F9A45459D4B4BA05050A35454A555 + 55A42D2D7611115511115512125717175E1B1B6420206B2424722929792D2D80 + 31318635358C3939923D3D9741419D4545A24848A64B4BAC4D4DB04F4FB35252 + B75454BA5656BD5757BF5959C25A5AC45B5BC65C5CC75D5DC85E5EC95E5ECA5F + 5FCB6060CC6868CE6D6DD16C6CD16D6DD16D6DD16C6CD16363CF6161CE6161CE + 6161CE6161CE6363CF6969D06969D06868D06868D06868D06565CF6161CE6161 + CE6161CE6161CE6161CE6161CE6161CE6161CE6262CE7070D49696E27F7FDA61 + 61CE6161CD6666CF8282DA8686DB6262CD6060CC5F5FCB5E5ECA5E5EC95D5DC8 + 5C5CC75B5BC55A5AC35858C15757BF5555BC5454BA5353B75151B34D4DAE4B4B + AB4747A64343A03F3F9B3C3C9638389034348A3030832C2C7D2727762323701E + 1E681A1A6215155B16165918185B16165D22227E27278D26268C3434945555A5 + 7474B58C8CC29A9ACA9E9ECC9A9ACA02000002000040409A46469E4C4CA15151 + A35555A54B4B991D1D6311115511115514145A1818601D1D6722226E2626742A + 2A7B2F2F8233338837378E3B3B943E3E994444A04D4DA65555AC5858B15A5AB5 + 5858B75353B85454BB5656BE5858C05959C25B5BC45C5CC65D5DC75E5EC95E5E + C95F5FCB6060CC6060CC6060CC6868CF6E6ED16E6ED16D6DD26D6DD26C6CD163 + 63CF6161CE6161CE6161CE6161CE6363CF6969D06969D06969D06868D06868D0 + 6565CF6161CE6161CE6161CE6161CE6161CE6161CE6161CE6161CE6464CF7B7B + D89595E27272D46161CE6262CE7272D48A8ADD7676D56161CD6161CC6060CC5F + 5FCB5F5FCB5E5EC95D5DC85D5DC75B5BC65A5AC45959C25D5DC26868C46A6AC2 + 6A6AC16B6BBF6262B85959B14F4FAA4646A441419D3D3D9739399235358C3131 + 862D2D8029297924247220206B1B1B641A1A6019195C1616591212561C1C7028 + 288C27278D25258C41419B5F5FAB7979B88C8CC29595C702000002000048489E + 4D4DA15252A45555A53B3B8613135811115512125616165C1A1A631F1F692323 + 702828772C2C7D30308334348A3838903C3C963F3F9B4747A25555AA5A5AB05E + 5EB46060B86262BB6464BE6161C05858BF5858C15A5AC35B5BC55C5CC75D5DC8 + 5E5EC95E5ECA5F5FCB6060CC6060CC6060CC6060CD6969CF6F6FD16E6ED26E6E + D26D6DD26D6DD26363CF6161CE6161CE6161CE6161CE6363CF6A6AD16A6AD169 + 69D06969D06868D06565CF6262CE6363CF6161CE6161CE6161CE6161CE6464CF + 6262CE6868D18989DE8D8DDF6969D16161CE6565CF8080D98B8BDE6969D06262 + CD6161CD6161CC6060CC6060CC5F5FCB5E5EC95E5EC95D5DC85D5DC86565C879 + 79CF8484D18686D18383CD8080CA7A7AC57575C26868B85858AF4646A442429F + 3E3E993B3B9437378E3333882F2F822A2A7B26267422226E1E1E681E1E641C1C + 6012125611115517176226268628288D26268C29298E46469E6161AC7575B602 + 00000200004F4FA25252A44F4F9E27276F11115511115514145918185F1C1C66 + 21216C2525732929792E2E8031318535358B3939913D3D9741419C4848A35656 + AB5C5CB05F5FB46161B86464BC6767BF6868C36969C46666C55B5BC35B5BC55C + 5CC65D5DC75E5EC95F5FCA5F5FCA6060CB6060CB6060CC6161CC6161CC6A6AD0 + 6F6FD26F6FD16E6ED16E6ED16D6DD16464CE6161CD6161CD6161CD6161CD6363 + CE6A6AD06A6AD06A6AD06969D06969D06A6AD07272D47676D57B7BD87A7AD77A + 7AD77D7DD87C7CD87878D68383DB9A9AE48383DB6363CE6363CE6A6AD18686DC + 8181D96565CF6262CC6262CC6161CC6161CC6060CB6060CB5F5FCA5E5EC95E5E + C96C6CCD8383D58F8FD98C8CD78989D48585D08484CE8282CB7D7DC77979C36F + 6FBD5B5BB14646A54343A03F3F9A3C3C9538388F3434893030832C2C7D282877 + 23237024246C25256919195E12125611115516165B23237D28288E28288D2626 + 8C28288E40409A0200000200005151A339398415155911115512125716165C1A + 1A621E1E6923236F2727762B2B7C2F2F8233338837378E3B3B933E3E9942429E + 4949A45959AD5D5DB16161B66363BA6666BD6868C06A6AC36C6CC66D6DC86D6D + C96969CA5D5DC65E5EC85E5EC95F5FCA6060CB6060CB6060CB6060CC6161CC61 + 61CC6161CD6A6AD06F6FD26F6FD26F6FD16E6ED16D6DD16464CE6161CD6161CD + 6161CD6161CD6363CE6A6AD06A6AD06A6AD06A6AD06B6BD08282DA9292E19B9B + E49393E19494E19494E19595E29393E19393E19A9AE48F8FDF7474D56464CE64 + 64CE7272D48B8BDE7777D66464CF6363CE6262CD6262CC6262CC6161CC6060CB + 6060CB5F5FCA6666CD8181D69292DD9191DC8A8AD77E7ED17070CA6969C67272 + C87C7CCA7F7FC97B7BC46E6EBD5454AE4747A64444A141419C3D3D9739399135 + 358B3131852E2E802929792929752C2C7323236A181860141459121256151558 + 1A1A6726268828288E28288D27278D0200000200002020671111551111551515 + 5B1919601D1D6621216D2525732929782D2D7E31318535358A3838903C3C953F + 3F9B4343A04A4AA65959AE5F5FB46262B86565BA6767BE6969C16B6BC46D6DC7 + 6E6EC97070CB7070CC7070CD6C6CCD6060CA5F5FCA6060CB6060CB6060CC6060 + CC6161CC6161CC6262CD6464CE6C6CD07070D26F6FD26F6FD26F6FD16E6ED164 + 64CE6161CD6161CD6161CD6161CD6363CE6B6BD06B6BD06A6AD06A6AD07070D3 + 9B9BE49393E06A6AD07777D67777D67878D67070D37474D47474D56969D06F6F + D26868D06565CE6565CE7878D68B8BDE7070D36363CE6363CE6363CE6262CD62 + 62CC6262CC6161CC6060CB6060CB7474D39090DD9393DE8F8FDB7676D15F5FC6 + 5C5CC35B5BC25C5CC16868C47A7AC98080CA7C7CC66767BA4E4EAD4848A74545 + A242429E3E3E993B3B9337378E3333882F2F822E2E7D32327C2D2D752020691B + 1B6316165D1313571111551313581F1F7529298E29298E020000020000121256 + 15155A18185F1C1C651F1F6A2424702727762B2B7C2F2F8233338737378D3A3A + 923D3D9741419D4444A14C4CA75C5CB06060B56464B96666BC6868C06B6BC26D + 6DC56E6EC76F6FCA7070CB7171CC7272CE7272CF7272CF6D6DCF6161CB6060CB + 6060CC6161CC6161CC6464CE6A6AD06E6ED17070D27070D27070D27070D26F6F + D26F6FD26E6ED16464CE6161CD6161CD6161CD6161CD6363CE6B6BD06B6BD06B + 6BD06A6AD07777D59C9CE48484DB6767CF6767CF6262CD6161CD6161CD6161CD + 6161CD6262CD6464CE6565CE6565CE6666CE7777D68F8FE06868CF6363CE6363 + CE6363CE6363CE6262CD6262CC6262CC6161CC6464CE8383D99595E19595E082 + 82D86262CA5D5DC75C5CC65B5BC45A5AC25858C06969C57F7FCD8080CA7474C3 + 5656B44C4CAD4949A94646A54343A03F3F9B3C3C9538389035358A3232853939 + 8536368028287421216D1E1E6719196116165C12125711115515155F23237C02 + 00000200001818601C1C651F1F6A22226F2626742929792E2E8031318535358A + 38388F3B3B943F3F9A42429E4545A34E4EAA5E5EB26363B76565BB6868BE6A6A + C16C6CC46D6DC66C6CC76767C87272CC7272CD7373CF7373CF7373D17474D274 + 74D16E6ED06161CC6161CC6565CD6C6CD17272D27272D27272D27272D27171D2 + 7070D27070D27070D26F6FD26F6FD16464CE6161CD6161CD6161CD6161CD6464 + CE6C6CD06C6CD06B6BD06B6BD07D7DD79898E38888DC6969D06868CF6868CF65 + 65CE6363CE6161CD6262CD6565CE6666CF6666CF6565CE6666CF7878D68F8FDF + 6A6AD16363CE6363CE6363CE6363CE6363CE6262CD6262CD6262CC6A6ACF8C8C + DE9797E19292DF7272D25F5FCA5E5EC95D5DC75C5CC65B5BC55A5AC36060C37D + 7DCE8585D07F7FCB5D5DBB4F4FB24D4DAE4A4AAA4747A64444A141419D3D3D97 + 3A3A9237378D40408E3E3E8A2F2F7F28287724247120206B1C1C661919611616 + 5C1313581111550200000200001F1F6A22226F2525742929792C2C7D2F2F8233 + 338836368D3939923D3D9740409C4343A14646A54B4BAA5E5EB36363B86666BB + 6868BF6B6BC26D6DC56E6EC86C6CC85F5FC55B5BC66767CB7373CF7373D07474 + D17474D27474D27474D27474D26E6ED16C6CD07373D37373D37373D37272D371 + 71D27171D27171D27070D27070D27070D26F6FD26E6ED16262CE6060CD6060CD + 6060CD6060CD6262CE6B6BD16B6BD16B6BD06A6AD07D7DD89B9BE48484DB6B6B + D16868D06767CF6767CF6767CF6464CE6464CE6666CF6666CF6565CF6565CF66 + 66CF7B7BD78888DD6E6ED36060CD6161CD6262CE6262CE6262CE6262CE6161CD + 6161CD6C6CD08D8DDF9797E38E8EDE6B6BD05F5FCB5E5ECA5D5DC95D5DC85C5C + C65B5BC55C5CC47C7CD08888D48282CF6262C05252B74F4FB34D4DB04A4AAB48 + 48A84444A342429F3E3E9A3B3B954646974848943333872D2D802A2A7B262676 + 2323701F1F6B1D1D661A1A6217175F0200000200002626742929792C2C7D2F2F + 8232328735358B3838903C3C953E3E9A41419E4444A34747A74A4AAB5757B365 + 65BB6868BE6A6AC06C6CC36D6DC56F6FC86E6ECA6060C65B5BC65C5CC75D5DC9 + 6868CD7575D17575D27575D27575D37575D37575D37575D37575D37474D37373 + D37373D37373D37272D37171D27171D27171D27070D27070D27070D26969D060 + 60CD6060CD6060CD6060CD6060CD6060CD6767CF6B6BD16B6BD16B6BD07373D4 + 9E9EE58686DB6B6BD16969D06868D06767CF6767CF6767CF6767CF6666CF6666 + CF6666CF6565CF6565CF7D7DD88484DB6B6BD16060CD6060CD6161CD6262CE62 + 62CE6262CE6262CE6161CD6A6AD18C8CDE9898E39292E07474D46060CB5F5FCB + 5E5ECA5D5DC95D5DC85C5CC76868CB8484D58B8BD78181D16262C35454BA5252 + B85050B44E4EB14B4BAE4848A94646A54343A141419C49499D51519D38388F33 + 33893030842D2D7F29297A26267624247121216D1E1E690200000200002D2D7F + 2F2F8232328735358B37378F3A3A943D3D9840409D4343A14646A54848A94B4B + AD4E4EB16262BA6969BF6B6BC26D6DC56F6FC67171C96E6ECA6161C75C5CC65C + 5CC75D5DC95E5ECA5E5ECA6A6ACF7676D27676D37676D37676D37575D47575D4 + 7575D37474D37474D37373D37373D37373D37272D37171D27171D26F6FD26D6D + D16969D06161CD6060CD6060CD6060CD6060CD6060CD6060CD6161CD6767CF69 + 69D06A6AD07272D39E9EE58585DB6B6BD16969D06969D06868D06868D06767CF + 6767CF6767CF6666CF6666CF6666CF6565CF7979D78989DD6969D06060CD6060 + CD6060CD6161CD6262CE6262CE6262CE6262CE6565CF8585DB9999E49797E286 + 86DC6969D05F5FCB5F5FCB5E5ECA5D5DC96161CA7777D28F8FDB8E8ED98080D2 + 5F5FC35656BE5555BC5353B95151B64F4FB34C4CAF4A4AAB4747A74747A55353 + A75555A43E3E9839399136368D3333883030842D2D802B2B7C29297826267402 + 000002000033338835358C3838903A3A943D3D9840409C4242A04545A44747A7 + 4A4AAB4C4CAF4E4EB25151B56767BF6D6DC36F6FC67070C97272CA7373CB6A6A + CB5C5CC75D5DC85D5DC95E5ECA5F5FCB5F5FCB5F5FCB6A6AD07777D37777D376 + 76D47676D47575D47575D47575D37474D37474D37373D37373D37171D26B6BD1 + 6767CF6363CE6161CD6060CD6060CD6060CD6060CD6060CD6060CD6060CD6060 + CD6060CD6060CD6060CD6262CE7272D49A9AE38D8DDE6A6AD06A6AD16C6CD16D + 6DD26C6CD16969D06B6BD16767CF6A6AD06666CF6666CF6262CE6A6AD18C8CDF + 6D6DD26060CD6060CD6060CD6060CD6262CE6262CE6262CE6262CE6262CE7575 + D59494E19999E49595E28383DA6C6CD16464CD6060CB6767CD7878D48D8DDB91 + 91DD9090DC7676D05B5BC45858C15757BF5555BD5353BA5252B75050B44E4EB1 + 4B4BAD4E4EAC5B5BAF5757AA43439E3E3E993D3D9641419543439341418F3F3F + 8C3B3B883838840200000200003939913B3B943D3D9840409C4242A04444A247 + 47A64949AA4B4BAE4E4EB15050B45252B75454BA6868C37171C77272C97373CB + 7474CD7575CE7575CF6969CC5D5DC95E5ECA5F5FCB5F5FCB5F5FCC5F5FCC6060 + CC6B6BD07777D47676D47676D47676D47575D47575D47575D37474D37070D268 + 68D06363CE6060CD6060CD6060CD6060CD6060CD6060CD6060CD6060CD6060CD + 6060CD6060CD6060CD6060CD6060CD6060CD6060CD6C6CD29191E19393E18383 + DB8686DB8B8BDD8787DC8888DC8686DC8B8BDE8D8DDE8484DB7373D46363CE60 + 60CD6D6DD28989DD7676D66060CD6060CD6060CD6262CE6363CE6363CE6262CE + 6262CE6262CE6868D08181DA9797E39999E49797E38E8EDF8080D97D7DD78484 + DA9292E09595DF9292DE8888D96767CC5B5BC65A5AC35959C25858C05656BD54 + 54BB5252B85151B54E4EB25757B36666B75757AE4646A44343A04848A05757A5 + 5B5BA353539E4F4F9A4D4D974A4A940200000200003E3E9940409D4242A04444 + A24646A64848A94B4BAC4D4DB04F4FB35151B55252B85454BB5656BD6363C373 + 73CA7474CB7575CE7676CF7676D07777D17878D16A6ACE5F5FCB5F5FCB5F5FCC + 6060CC6060CC6060CD6060CD6B6BD17777D47676D47676D47676D47575D47272 + D36969D06161CD6060CD6060CD6060CD6060CD6060CD6060CD6060CD6060CD60 + 60CD6060CD6060CD6060CD6060CD6060CD6060CD6060CD6060CD6060CD6262CE + 7575D58E8EDF9898E39797E39393E19898E39898E39E9EE59696E29797E29F9F + E58383DB6363CE6060CD6868D08484DB8181DA6161CE6060CD6262CE6464CE64 + 64CE6363CE6363CE6262CE6262CE6363CE6B6BD18787DD9595E29999E49898E3 + 9696E29696E29797E29696E19494E18A8ADC6E6ED05F5FC95C5CC75B5BC65A5A + C45959C35858C15656BE5555BC5353BA5252B75E5EBA7070C05555B24A4AAB47 + 47A75252AA6464AF5555A749499F48489C4747994242960200000200004343A1 + 4545A44747A64848A94A4AAC4C4CAF4E4EB25050B45252B75353BA5555BC5656 + BE5858C05B5BC36D6DCA7777CE7878D07878D17979D27878D27979D47A7AD36B + 6BCF5F5FCC6060CC6060CC6060CD6060CD6060CD6060CD6B6BD07676D47676D4 + 7575D46C6CD16262CE6060CD6060CD6060CD6060CD6060CD6060CD6060CD6060 + CD6060CD6060CD6060CD6060CD6060CD6060CD6060CD6060CD6060CD6060CD60 + 60CD6060CD6060CD6060CD6E6ED37171D46F6FD37171D47575D57676D67070D2 + 7373D47979D69393E18E8EDF6A6AD16060CD6363CE7B7BD88B8BDE6B6BD26262 + CE6464CE6464CE6464CE6363CE6363CE6363CE6262CE6161CD6161CD6C6CD27B + 7BD89090E09696E39999E49797E29696E28D8DDE8080D86B6BD05F5FCB5E5ECA + 5D5DC95C5CC75C5CC65B5BC55959C35959C25757C05656BD5656BC6A6AC26F6F + C25454B54D4DB04C4CAD6262B56767B54E4EA84343A141419E40409C3E3E9902 + 00000200004747A84848AA4A4AAC4C4CAF4D4DB24F4FB45151B75252B95454BC + 5555BD5757C05858C25858C35A5AC55C5CC77070CD7878D17979D27979D37979 + D47A7AD47A7AD57878D46C6CD05F5FCC5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F + 5FCD6363CE6565CF6363CE5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD + 5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5F + CD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD6060CD5F5FCD5F5FCD5F + 5FCD5F5FCD6161CE6262CE6161CD7A7AD89797E37575D65F5FCD5F5FCD6F6FD3 + 8C8CDF7C7CD86565CF6464CF6363CE6363CE6363CE6363CE6262CE6161CE5F5F + CD5F5FCD5F5FCD6161CE6767D07979D77B7BD87C7CD87A7AD66F6FD26363CE5E + 5ECB5E5ECB5E5ECB5D5DCA5C5CC95C5CC85B5BC75A5AC65959C45858C25858C1 + 6060C37979CB6666C25252B84F4FB55353B46F6FBE6969BB4C4CAD4747A84545 + A64343A24242A10200000200004B4BAE4C4CB04D4DB24F4FB45151B75252B953 + 53BB5454BD5656BF5757C15858C35959C45A5AC65B5BC75C5CC85F5FC97171D0 + 7A7AD47B7BD47A7AD47A7AD57B7BD57B7BD57A7AD56C6CD15F5FCD5F5FCD5F5F + CD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F + 5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD + 5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5F + CD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD6E6ED39696E38181DA63 + 63CF5F5FCD6363CE8484DC8C8CDE6F6FD46464CF6464CF6363CE6363CE6363CE + 6262CE5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD6060CE6363CE6363CF5F5F + CD5F5FCC5F5FCC5E5ECC5E5ECB5E5ECB5E5ECB5D5DCA5C5CC95C5CC95B5BC75A + 5AC65A5AC55C5CC57171CC7C7CCF5E5EC25454BC5353BA6262BE7B7BC76262BB + 4C4CB04B4BAE4949AB4848AA4747A80200000200004F4FB35050B55151B65252 + B95353BA5454BC5656BE5757BF5858C15959C35A5AC45B5BC55B5BC65C5CC85C + 5CC85D5DC96060CB7373D17B7BD37B7BD47B7BD47B7BD47B7BD57B7BD57A7AD5 + 6C6CD05F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5F + CC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F + 5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC + 5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC6565 + CE8787DC9393E16C6CD15F5FCC6262CD7171D39292E08080D86767CF6464CE64 + 64CE6363CD6262CD5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC + 5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCB5F5FCB5E5ECB5E5ECA5E5ECA5E5E + CA5D5DC95C5CC85C5CC75B5BC66A6ACB8181D27272CB5858C05656BF5B5BBF74 + 74C87C7CCA5D5DBB5050B54F4FB34D4DB14C4CAF4B4BAD0200000200005252B7 + 5353B95454BB5555BC5656BE5757BF5858C15959C35A5AC45A5AC55B5BC65C5C + C75C5CC85D5DC95E5ECA5E5ECA5E5ECA6060CC7373D27C7CD47C7CD47B7BD57B + 7BD57B7BD57B7BD57A7AD56C6CD05F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC + 5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5F + CC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F + 5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC + 5F5FCC5F5FCC6060CD7171D39A9AE38080D96464CD6666CE6666CE8383DA9494 + E06F6FD26565CE6464CE6262CD5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F + 5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCB5F5FCB + 5E5ECB5E5ECA5E5ECA5E5ECA5D5DC95C5CC86262C97E7ED47E7ED36363C85959 + C35858C16969C78383D07373C85858BD5353B95252B75151B64F4FB44F4FB302 + 00000200005454BC5555BD5656BF5757C05858C15959C35A5AC45A5AC55B5BC6 + 5C5CC75C5CC85D5DC95D5DC95E5ECA5E5ECA5E5ECA5E5ECB5F5FCB6262CC7474 + D37C7CD57C7CD57B7BD57B7BD57B7BD57B7BD57979D46464CE5F5FCC5F5FCC5F + 5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC + 5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5F + CC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F + 5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC6565CE8989DD9393E07676D46767CE + 6767CE6C6CD18888DC9090DE7171D36363CD6060CC5F5FCC5F5FCC5F5FCC5F5F + CC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F + 5FCC5F5FCC5F5FCB5F5FCB5E5ECB5E5ECB5E5ECA5E5ECA6161CB7C7CD58787DA + 6C6CCD5C5CC65A5AC55F5FC67E7ED28282D26464C65757BF5555BD5454BC5353 + BA5353B95252B80200000200005757C05858C15858C25959C35A5AC45A5AC55B + 5BC65C5CC75C5CC85C5CC85D5DC95E5ECA5E5ECA5E5ECA5E5ECB5E5ECB5F5FCB + 5F5FCB5F5FCC6262CD7474D37C7CD57C7CD57B7BD57B7BD57B7BD57B7BD56666 + CE5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F + 5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC + 5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5F + CC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC6060CC7373D496 + 96E18E8EDE6D6DD06767CE6767CE7272D39191DF8989DD6C6CD15F5FCC5F5FCC + 5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5F + CC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCB5F5FCB5E5ECB6161CB7A + 7AD58C8CDC7272D15E5EC95C5CC85C5CC76868CB8E8ED97B7BD25D5DC55858C2 + 5858C15757BF5656BF5555BD5454BC0200000200005959C35A5AC45A5AC55B5B + C55B5BC65C5CC75C5CC85C5CC85D5DC95E5ECA5E5ECA5E5ECA5E5ECB5E5ECB5F + 5FCB5F5FCB5F5FCC5F5FCC5F5FCC5F5FCC7171D27C7CD57C7CD57C7CD57B7BD5 + 7B7BD57979D46464CE5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5F + CC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F + 5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC + 5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5F + CC5F5FCC6B6BD19595E19898E27373D46767CF6767CE6767CE7676D58B8BDD89 + 89DC7272D36060CC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC + 5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5F + CB6363CC7E7ED78A8ADC7777D45E5ECA5E5ECA5D5DC95D5DC96666CB8888D981 + 81D66E6ECD5A5AC55A5AC45959C35858C25858C15757C00200000200005A5AC5 + 5A5AC65B5BC75B5BC85B5BC85C5CC95C5CC95D5DCA5D5DCA5D5DCA5D5DCA5D5D + CB5E5ECB5E5ECB5E5ECB5E5ECC5E5ECC5E5ECC5E5ECC6565CE7B7BD57C7CD57C + 7CD57B7BD57B7BD57A7AD56E6ED15E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC + 5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5E + CC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E + 5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC + 5E5ECC5E5ECC5E5ECC6464CE8686DC9797E27E7ED86C6CD16767CF6666CF6666 + CE6767CE7272D38B8BDE8A8ADE7171D36060CD5E5ECC5E5ECC5E5ECC5E5ECC5E + 5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC + 5E5ECC6161CD6C6CD28282DA8B8BDD7676D55D5DCB5D5DCB5D5DCA5D5DCA5D5D + CA5E5ECA6A6ACE8484D98B8BDA6D6DCE5B5BC65A5AC55959C55959C45858C302 + 00000200005B5BC85B5BC85C5CC95C5CC95C5CC95D5DCA5D5DCA5D5DCA5D5DCB + 5D5DCB5E5ECB5E5ECB5E5ECB5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC7171 + D27C7CD67C7CD67C7CD57C7CD57B7BD57777D46161CD5E5ECC5E5ECC5E5ECC5E + 5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC + 5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5E + CC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E + 5ECC5E5ECC5E5ECC5E5ECC5E5ECC6464CE8484DB9B9BE47A7AD76464CE6666CF + 6767CF6767CF6666CF6666CE6666CE7070D28181DA8E8EDF8383DA6E6ED26363 + CE5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E + 5ECC5E5ECC5E5ECC6C6CD17979D78989DD8686DC7171D46060CD5E5ECB5E5ECB + 5D5DCB5D5DCB5D5DCA5D5DCA5D5DCA6565CD8B8BDB8C8CDB7070D05E5EC95B5B + C75A5AC65A5AC60200000200005C5CC95D5DCA5D5DCA5D5DCA5D5DCA5D5DCA5D + 5DCB5D5DCB5E5ECB5E5ECB5E5ECB5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC + 5E5ECC6363CE7B7BD57C7CD67C7CD67C7CD57C7CD57C7CD56B6BD05E5ECC5E5E + CC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E + 5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC + 5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5E + CC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC6464CE8282DA9696E27E7ED860 + 60CD5E5ECC6262CD6767CF6767CF6666CF6666CF6666CE6565CE6767CF7272D4 + 8D8DDF8A8ADD8080D97474D56A6AD16464CE5F5FCC5E5ECC5E5ECC6060CD6161 + CD6060CD5F5FCC6666CF6E6ED27C7CD88585DB8C8CDE7D7DD86A6AD15E5ECC5E + 5ECC5E5ECC5E5ECC5E5ECB5E5ECB5D5DCB5D5DCB5D5DCA5D5DCA6666CD8787DB + 9191DF7474D35F5FCA5B5BC85B5BC80200000200005D5DCA5D5DCA5D5DCB5D5D + CB5D5DCB5E5ECB5E5ECB5E5ECB5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E + 5ECC5E5ECC5E5ECC5E5ECC6E6ED17D7DD67D7DD67C7CD67C7CD67C7CD67777D4 + 5F5FCC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5E + CC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E + 5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC + 5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC6464CE8181DA9898 + E37F7FD96161CD5E5ECC5E5ECC5F5FCC6666CF6767CF6767CF6767CF6666CF66 + 66CE6262CD5F5FCC6262CE7C7CD88484DB8A8ADD8585DB7F7FD97C7CD87272D4 + 7B7BD87979D67676D57373D48181DA8585DB8484DB8989DD7B7BD86F6FD36161 + CD5E5ECC5E5ECC5F5FCC6060CD5F5FCC5E5ECC5E5ECC5E5ECB5E5ECB5E5ECB5D + 5DCB5D5DCB6767CE8787DB8E8EDE7676D46161CC5D5DCA0200000200005E5ECB + 5E5ECB5E5ECB5E5ECB5E5ECB5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5E + CC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5F5FCC7777D47E7ED67D7DD67D7DD67C + 7CD67C7CD66B6BD05E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC + 5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5E + CC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E + 5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC6363CE + 8282DA9595E28282DA6464CE5E5ECC5E5ECC5E5ECC5E5ECC6262CD6767CF6767 + CF6868D07373D47070D26464CE5F5FCC5E5ECC6161CD6868D07171D47B7BD781 + 81DA8282DA8888DC8282DA8282DA8282DA8989DD7F7FD97979D67676D66969D0 + 5E5ECC5E5ECC5E5ECC5E5ECC6060CD7878D67676D66868D05E5ECC5E5ECC5E5E + CC5E5ECC5E5ECC5E5ECB5E5ECB5E5ECB6969CF8282D99292E07171D35F5FCC02 + 00000200005E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC + 5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC6666CF7C7CD57E7E + D67E7ED67D7DD67D7DD67979D56262CD5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E + 5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC + 5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5F5FCC6161CD6363CE6363CE6161CD5F5F + CC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E + 5ECC5E5ECC7676D59999E38282DA6464CE5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC + 5F5FCC6767CF6767CF7B7BD79696E29595E17A7AD66868D05E5ECC5E5ECC5E5E + CC5E5ECC5E5ECC6060CD6565CF6565CF6868D06969D06969D16161CD6161CD64 + 64CE6060CD5E5ECC5E5ECC5F5FCC6262CD6F6FD38585DB9494E19898E38282DA + 6060CD5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC6464CF9393 + E08484DA6363CD0200000200005E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC63 + 63CE6D6DD17272D27171D27171D27171D27171D27171D27171D27171D27070D2 + 7676D47E7ED67E7ED67E7ED67D7DD67D7DD67272D25F5FCC5E5ECC5E5ECC5E5E + CC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E + 5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC6262CD6969CF7070D27373D37373D3 + 7373D37272D26E6ED16767CF6161CD5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5E + CC5E5ECC5E5ECC5E5ECC6262CE8A8ADE9393E16C6CD25E5ECC5E5ECC5E5ECC5E + 5ECC5E5ECC5E5ECC5E5ECC6666CE7D7DD89797E29898E29898E29C9CE48E8EDE + 7A7AD66868CF6262CD6262CD6262CD6161CD6161CD6161CD6161CD6060CD5F5F + CC5E5ECC5E5ECC5E5ECC5E5ECC5F5FCC6666CF7070D38181DA9292E09595E281 + 81DA8383DB9393E18181DA6464CE5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC + 5F5FCC7272D49090E08181DA5E5ECC0200000200005D5DCC5D5DCC5D5DCC5D5D + CC5D5DCC6868D07A7AD57D7DD67D7DD67D7DD67D7DD67D7DD67D7DD67D7DD67D + 7DD67D7DD67D7DD67D7DD67D7DD67D7DD67D7DD67D7DD67C7CD66969D05D5DCC + 5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5D + CC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC6767CF7373D37575D475 + 75D37474D37474D37373D37373D37272D37272D36F6FD26565CF5D5DCC5D5DCC + 5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC6262CE7F7FD99999E47B7BD86161 + CE5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5E5ECC7070D39D9DE49595E17575D574 + 74D58888DC9696E29C9CE49191E18787DC7A7AD77070D36767D06363CE6363CE + 6262CE6161CD6161CD5E5ECC5D5DCC6363CE6E6ED37A7AD78585DC9292E19494 + E18585DC7171D46161CD6060CD7676D69494E28888DD6464CF5D5DCC5D5DCC5D + 5DCC5D5DCC5D5DCC7171D48F8FE08C8CDF6C6CD25D5DCC0200000200005D5DCC + 5D5DCC5D5DCC5D5DCC6464CE7C7CD67D7DD67D7DD67D7DD67D7DD67D7DD67D7D + D67D7DD67D7DD67D7DD67D7DD67D7DD67D7DD67D7DD67D7DD67D7DD67D7DD67A + 7AD56363CE5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC + 5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC6A6AD07676 + D47676D47575D47575D37575D37474D37474D37373D37373D37373D37272D371 + 71D26868CF5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC6868D1 + 8B8BDE9696E27B7BD86565CF5D5DCC5D5DCC5D5DCC5E5ECC7070D49292E09696 + E17878D66767CF6767CF6767CF7272D48080D99090E09595E19595E19494E07F + 7FD96666CF6363CE6363CE6262CE6161CD6161CD5E5ECC7D7DD98E8EDF9191E1 + 8E8EDF8181DA7070D46464CF5D5DCC5D5DCC5D5DCC5F5FCD7A7AD79494E28787 + DD6868D05D5DCC5D5DCC5D5DCC7171D48F8FE09191E17272D45D5DCC5D5DCC02 + 00000200005D5DCB5D5DCB5D5DCB5D5DCB7171D27D7DD57D7DD57D7DD57D7DD5 + 7D7DD57D7DD57D7DD57D7DD57D7DD57D7DD57D7DD57D7DD57D7DD57D7DD57D7D + D57D7DD57D7DD57777D35E5ECB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D + 5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB + 6868CE7777D37676D37676D37676D37575D37272D26F6FD16E6ED17171D17373 + D27373D27272D27272D27171D26565CE5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D + 5DCB5D5DCB5E5ECB6B6BD18A8ADE9898E37B7BD76060CC5D5DCB5D5DCB6F6FD3 + 8F8FDF9191E07373D36969CE6868CE6767CE6767CE6767CE6767CE6D6DD07676 + D58080D99B9BE39595E16C6CD16363CD6363CD6363CD6262CD6161CC6161CC87 + 87DC9696E37575D56363CD6262CD5E5ECC5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB + 6363CD7777D69393E18B8BDE6767CF5E5ECB6F6FD29090E09191E07373D45D5D + CB5D5DCB5D5DCB0200000200005D5DCB5D5DCB5D5DCB5D5DCB7A7AD47D7DD57D + 7DD57D7DD57D7DD57D7DD57D7DD57D7DD57D7DD57D7DD57D7DD57D7DD57D7DD5 + 7D7DD57D7DD57D7DD57D7DD57D7DD56F6FD15D5DCB5D5DCB5D5DCB5D5DCB5D5D + CB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D + 5DCB5D5DCB6161CC7575D37777D37777D37676D37474D26868CF6161CC5D5DCB + 5D5DCB6161CC6868CE7171D17373D27272D27272D26F6FD16060CC5D5DCB5D5D + CB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB6969D08B8BDE9999E47C7CD863 + 63CD7272D48F8FE08E8EDF6F6FD26464CD6868CF6868CE6868CE6767CE6767CE + 6767CE6666CE6565CE6767CF8888DC9696E16E6ED16363CD6363CD6363CD6363 + CD6262CD6868CF8888DC8D8DDF5E5ECB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D + 5DCB5D5DCB5D5DCB5D5DCB6060CC7979D69393E18686DC7B7BD78F8FDF9292E1 + 7272D45E5ECC5D5DCB5D5DCB5D5DCB0200000200005D5DCB5D5DCB5D5DCB5D5D + CB7B7BD57D7DD57D7DD57D7DD57D7DD57D7DD57C7CD57C7CD57C7CD57C7CD57C + 7CD57C7CD57C7CD57C7CD57C7CD57C7CD57C7CD57272D26060CC5D5DCB5D5DCB + 5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5D + CB5D5DCB5D5DCB5D5DCB5D5DCB6A6ACF7878D47878D47777D37474D26464CD5D + 5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB6363CD7171D27373D27272D27272D2 + 6767CE5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB6666 + CF8787DC9999E48C8CDE9393E19090E06E6ED25D5DCB5E5ECB6565CD6868CE68 + 68CE6767CE6767CE6767CE6666CE6666CE6969D08686DB9494E17070D26464CD + 6363CD6363CD6363CD6262CD6969CF8787DC8989DD6161CD5D5DCB5D5DCB5D5D + CB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB6262CD7474D58C8CDE98 + 98E38C8CDE7373D45D5DCB5D5DCB5D5DCB5D5DCB5D5DCB0200000200005D5DCB + 5D5DCB5D5DCB5D5DCB7B7BD57D7DD57D7DD57D7DD57D7DD57878D46565CE6565 + CD6565CD6565CD6565CD6565CD6565CD6565CD6565CD6565CE6262CD5D5DCB5D + 5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB + 5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5E5ECB7373D27878D47878D47777 + D36969CF5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB6868CE73 + 73D27373D27272D26E6ED05E5ECB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB + 5D5DCB5D5DCB5D5DCB6565CE7E7ED99090E08989DD6F6FD25D5DCB5D5DCB5D5D + CB5D5DCB5F5FCC6060CC6060CC6060CC6060CC6060CC5F5FCC6262CD8686DB8F + 8FDF6C6CD16363CD6464CD6363CD6363CD6363CD6565CE8787DC8C8CDE6464CE + 5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5D + CB5E5ECB6B6BD17272D46D6DD15E5ECB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB02 + 00000200005D5DCB5D5DCB5D5DCB5D5DCB7B7BD57D7DD57D7DD57D7DD57D7DD5 + 7676D35D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5D + CB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D + 5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB6161CC7878D4 + 7878D47878D47575D36161CC5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5D + CB5D5DCB6161CC7171D17373D27373D27171D26060CC5D5DCB5D5DCB5D5DCB5D + 5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB6363CD6868CF6666CF5E5ECB + 5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5D + CB5D5DCB8686DC8E8EDF6A6AD06363CD6565CD6464CD6363CD6363CD6363CD86 + 86DC8D8DDF6767CF5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB + 5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5E5ECC5E5ECB5D5DCB5D5DCB5D5DCB5D5D + CB5D5DCB5D5DCB0200000200005C5CCB5C5CCB5C5CCB5C5CCB7B7BD57D7DD57D + 7DD57D7DD57D7DD57575D35D5DCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB + 5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5C + CB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C + 5CCB6363CD7777D47878D47777D47171D25C5CCB5C5CCB5C5CCB5C5CCB5C5CCB + 5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB6D6DD17272D27272D27171D26161CD5C5C + CB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C + 5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB + 5C5CCB5C5CCB5C5CCB5C5CCB8181DA8F8FE06868D06262CD6464CD6464CD6363 + CD6262CD6464CE8787DD8B8BDE6666CF5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C + 5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB + 5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB0200000200005C5CCB5C5CCB5C5CCB5C5C + CB7B7BD57D7DD57D7DD57D7DD57D7DD57575D35D5DCB5C5CCB5C5CCB5C5CCB5C + 5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB + 5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5C + CB5C5CCB5C5CCB5C5CCB6363CD7878D47979D47878D47171D25C5CCB5C5CCB5C + 5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB6E6ED17373D27272D2 + 7272D26161CD5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5C + CB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C + 5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5F5FCC7D7DD99191E16969D06262CD + 6464CE6464CD6363CD6363CD6262CD8888DD8B8BDE6565CF5C5CCB5C5CCB5C5C + CB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C + 5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB0200000200005C5CCB + 5C5CCB5C5CCB5C5CCB7B7BD57D7DD57D7DD57D7DD57D7DD57575D35C5CCB5C5C + CB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C + 5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB + 5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB6060CC7878D47979D47979D47575 + D36060CC5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB6060CC71 + 71D27474D37373D27272D25F5FCC5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB + 5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5C + CB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB6161CD8181DA8E + 8EDF6868D06363CD6464CE6464CE6464CD6363CD6464CE7F7FDA9090E06363CE + 5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5C + CB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB02 + 00000200005C5CCB5C5CCB5C5CCB5C5CCB7B7BD57D7DD57D7DD57D7DD57D7DD5 + 7777D46464CE6464CD6464CD6464CD6464CD6464CD6464CD6464CD6464CD6464 + CE6161CD5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C + 5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5D5DCB7474D3 + 7979D47979D47878D46969CF5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5C + CB5C5CCB6868CF7474D37474D37474D36F6FD15D5DCB5C5CCB5C5CCB5C5CCB5C + 5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB + 5C5CCB5C5CCB5C5CCB5C5CCB5E5ECC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5F + CC6161CD8181DA9797E27474D56969D07171D36E6ED16F6FD16C6CD17373D489 + 89DE9090E06363CE5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB + 5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5C + CB5C5CCB5C5CCB0200000200005C5CCB5C5CCB5C5CCB5C5CCB7B7BD57D7DD57D + 7DD57D7DD57D7DD57D7DD57B7BD57B7BD57B7BD57B7BD57B7BD57B7BD57B7BD5 + 7B7BD57B7BD57B7BD57B7BD57171D25F5FCC5C5CCB5C5CCB5C5CCB5C5CCB5C5C + CB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C + 5CCB5C5CCB6A6ACF7979D47979D47979D47676D36464CD5C5CCB5C5CCB5C5CCB + 5C5CCB5C5CCB5C5CCB6363CD7272D27575D37474D37474D36767CE5C5CCB5C5C + CB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C + 5CCB5C5CCB5C5CCB5C5CCB5C5CCB5D5DCB6666CE6A6ACF6A6ACF6969CF6969CF + 6868CF6868CF6868CF6767CE7A7AD69696E29999E49595E19090DF9191E09191 + E09797E39898E39393E17C7CD85E5ECC5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C + 5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB + 5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB0200000200005C5CCB5C5CCB5C5CCB5C5C + CB7979D47D7DD57D7DD57D7DD57D7DD57D7DD57D7DD57D7DD57D7DD57D7DD57D + 7DD57D7DD57D7DD57D7DD57D7DD57D7DD57D7DD57D7DD56F6FD15C5CCB5C5CCB + 5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5C + CB5C5CCB5C5CCB5C5CCB5C5CCB6060CC7777D47979D47979D47979D47676D369 + 69CF6060CC5C5CCB5C5CCB6060CC6868CF7474D37676D37575D37575D37272D2 + 6060CC5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5C + CB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB6565CE6B6BD06B6BD06B + 6BD06A6ACF6969CF6969CF6969CF6868CF6868CF6A6AD07B7BD78989DC8B8BDD + 8C8CDE8F8FDF8E8EDF8282DA8787DD7878D66363CE5C5CCB5C5CCB5C5CCB5C5C + CB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C + 5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB0200000200005B5BCB + 5B5BCB5B5BCB5B5BCB7070D27C7CD57C7CD57C7CD57C7CD57C7CD57C7CD57C7C + D57C7CD57C7CD57C7CD57C7CD57C7CD57C7CD57C7CD57C7CD57C7CD57C7CD575 + 75D35C5CCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB + 5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB6767CF7979D47979 + D47979D47878D47777D47474D37070D27070D27373D37676D47575D37575D375 + 75D37474D36565CE5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB + 5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5C5CCB6969 + CF6B6BD06A6AD06A6AD06A6AD06969CF6969CF6969CF6868CF6767CF6767CF68 + 68CF6B6BD06A6AD06D6DD16666CE6464CE6969D06565CF5D5DCC5B5BCB5B5BCB + 5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5B + CB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB02 + 00000200005B5BCA5B5BCA5B5BCA5B5BCA6262CC7B7BD47C7CD57C7CD57C7CD5 + 7C7CD57C7CD57C7CD57C7CD57C7CD57C7CD57C7CD57C7CD57C7CD57C7CD57C7C + D57C7CD57C7CD57979D46161CC5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B + 5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA + 5B5BCA6B6BCF7979D47979D47878D37878D37777D37777D37777D37777D37676 + D37676D37575D37575D26969CE5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B + 5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA + 5B5BCA5E5ECB6A6ACF6C6CCF6B6BCF6A6ACF6A6ACF6A6ACF6969CF6969CE6969 + CE6868CE6767CE6767CE6767CE6666CE6666CE6565CD6565CD6464CD5D5DCB5B + 5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA + 5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5B + CA5B5BCA5B5BCA0200000200005B5BCA5B5BCA5B5BCA5B5BCA5B5BCA6767CE79 + 79D47C7CD57C7CD57C7CD57C7CD57C7CD57C7CD57C7CD57C7CD57C7CD57C7CD5 + 7C7CD57C7CD57C7CD57C7CD57C7CD57B7BD46767CE5B5BCA5B5BCA5B5BCA5B5B + CA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B + 5BCA5B5BCA5B5BCA5B5BCA5B5BCA6767CE7575D37979D47878D37878D37777D3 + 7777D37777D37777D37676D37373D26666CE5B5BCA5B5BCA5B5BCA5B5BCA5B5B + CA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B + 5BCA5B5BCA5B5BCA5B5BCA6161CC6C6CCF6C6CCF6C6CCF6B6BCF6A6ACF6A6ACF + 6A6ACF6969CF6969CE6969CE6868CE6767CE6767CE6767CE6666CE6565CD6464 + CD5F5FCB5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B + 5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA + 5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA0200000200005B5BCA5B5BCA5B5BCA5B5B + CA5B5BCA5B5BCA6060CC6A6ACF6F6FD06E6ED06E6ED06E6ED06E6ED06E6ED06E + 6ED06E6ED06E6ED07373D27C7CD57C7CD57C7CD57C7CD57C7CD57070D15C5CCA + 5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5B + CA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA6060CB6969CE73 + 73D27777D37777D37777D37676D37272D16868CE6060CB5B5BCA5B5BCA5B5BCA + 5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5B + CA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA6767CE6D6DD06C6CD06C6CCF6C + 6CCF6B6BCF6767CE6363CD6464CD6363CD6363CD6363CC6363CC6262CC6262CC + 6262CC6060CC5D5DCB5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5B + CA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B + 5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA0200000200005B5BCA + 5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5B + CA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA6464CD7A7AD47C7CD57C7CD57C7CD57C + 7CD57878D36060CB5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA + 5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5B + CA5B5BCA5B5BCA5C5CCA5F5FCB6262CC6262CC5F5FCB5C5CCA5B5BCA5B5BCA5B + 5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA + 5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5E5ECB6C6CCF6D6D + D06D6DD06C6CD06C6CCF6A6ACF6060CB5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B + 5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA + 5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5B + CA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA02 + 00000200005B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA + 5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5C5CCA7575D27C7C + D57C7CD57C7CD57C7CD57C7CD56969CF5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B + 5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA + 5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5B + CA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B + 5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA + 6363CD6E6ED06E6ED06D6DD06D6DD06C6CD06969CE5C5CCA5B5BCA5B5BCA5B5B + CA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B + 5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA + 5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5B + CA5B5BCA5B5BCA0200000200005A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A + 5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA + 5A5ACA6B6BD07B7BD57B7BD57B7BD57B7BD57B7BD57575D35B5BCA5A5ACA5A5A + CA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A + 5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA + 5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5A + CA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A + 5ACA5A5ACA5B5BCA6B6BCF6D6DD06D6DD06D6DD06C6CD06C6CD06363CD5A5ACA + 5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5A + CA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A + 5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA + 5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA0200000200005A5ACA5A5ACA5A5ACA5A5A + CA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A + 5ACA5A5ACA5A5ACA5A5ACA5F5FCC7979D47B7BD57B7BD57B7BD57B7BD57B7BD5 + 6868CF5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5A + CA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A + 5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA + 5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5A + CA5A5ACA5A5ACA5A5ACA5A5ACA6363CD6F6FD16E6ED06E6ED06D6DD06D6DD06B + 6BD05D5DCB5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA + 5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5A + CA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A + 5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA0200000200005A5ACA + 5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5A + CA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA6F6FD17B7BD57B7BD57B + 7BD57B7BD57B7BD57676D35D5DCB5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA + 5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5A + CA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A + 5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA + 5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5D5DCB6C6CD06F6FD16F6FD16E6E + D06D6DD06D6DD06666CE5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A + 5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA + 5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5A + CA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA02 + 00000200005A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA + 5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA6262 + CD7A7AD47B7BD57B7BD57B7BD57B7BD57B7BD56C6CD05A5ACA5A5ACA5A5ACA5A + 5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA + 5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5A + CA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A + 5ACA5A5ACA5A5ACA5A5ACA5A5AC95959C85959C85959C75959C76565CC7070D0 + 6F6FD06F6FD16F6FD16E6ED06D6DD05F5FCC5A5ACA5A5ACA5A5ACA5A5ACA5A5A + CA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A + 5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA + 5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5A + CA5A5ACA5A5ACA0200000200005A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A + 5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA + 5A5ACA5A5ACA5A5ACA6E6ED07B7BD57B7BD57B7BD57B7BD57B7BD57979D46060 + CC5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A + 5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5AC95A5AC95A5ACA5A5ACA + 5A5ACA5A5ACA5A5AC95A5AC95A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5A + CA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5AC95959C75858C55757C45656C25A + 5AC36C6CCB6E6ECD6F6FCF6F6FD06F6FD16F6FD16666CE5A5AC95A5AC95A5ACA + 5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5A + CA5A5ACA5A5ACA5A5AC95A5AC95A5AC95A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A + 5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5AC95A5AC95A5AC95A5AC9 + 5A5AC95A5AC95A5AC95A5ACA5A5ACA0200000200005A5ACA5A5ACA5A5ACA5A5A + CA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A + 5ACA5A5ACA5A5ACA5A5ACA5A5ACA5D5DCB7171D17B7BD57B7BD57B7BD57B7BD5 + 7B7BD57B7BD56363CD5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5A + CA5A5ACA5A5ACA5A5ACA5A5ACA5A5AC95A5AC95959C85959C75858C55858C458 + 58C45858C55858C55858C55858C45858C45858C45858C55959C75959C75959C8 + 5959C85959C85959C85959C75959C75959C75959C85959C75858C45656C25555 + BF5353BB5252B95858BA6969C16A6AC56C6CC96D6DCC6D6DCE6D6DCE6666CB59 + 59C55858C45858C55858C65959C75959C85959C85959C85959C85959C85959C8 + 5959C85959C85959C75959C75858C55858C45858C45858C45858C45858C65959 + C75959C75959C75959C85959C85959C75959C75959C75959C75858C55858C458 + 58C45757C45757C35757C35757C45858C45858C55959C70200000200005959CA + 5959CA5959CA5959CA5959CA5959CA5959CA5959CA5959CA5959CA5959CA5959 + CA5959CA5959CA5959CA5959CA5959CA5959CA5C5CCB7070D17A7AD57A7AD57A + 7AD57A7AD57A7AD57A7AD57878D45F5FCC5959CA5959CA5959CA5959CA5959CA + 5959CA5959CA5959CA5959CA5959CA5959CA5959C95858C85757C65656C25454 + C05353BD5353BD5353BD5353BD5353BD5353BD5353BC5353BC5353BD5353BD54 + 54BF5555C05656C25555C15555C15656C25555C15555C15555C15656C25555C1 + 5353BD5252BA5050B54D4DB04B4BAB5050AC6161B56464BA6666BF6969C56969 + C66868C66868C56060C15454BD5353BD5454BE5555C05656C25656C25656C256 + 56C25656C25656C25555C15555C15555C05454BF5353BD5353BD5353BC5353BC + 5353BD5454BF5454C05555C05555C05656C25656C25555C15555C15555C15454 + C05454BE5353BD5353BD5252BB5252BB5252BB5353BC5353BD5454BF5555C102 + 00000200005959C95959C95959C95959C95959C95959C95959C95959C95959C9 + 5959C95959C95959C95959C95959C95959C95959C95959C95B5BCA7070D17A7A + D47A7AD47A7AD47A7AD47A7AD47A7AD47A7AD46969CE5959C95959C95959C959 + 59C95959C95959C95959C95959C95959C95959C95959C95959C95858C75757C3 + 5555C05252BA5050B54F4FB34F4FB24F4FB14F4FB24F4FB34E4EB14E4EB04D4D + AF4E4EB14E4EB14F4FB35151B65151B85151B75151B75151B85151B85151B751 + 51B75151B85151B74F4FB34D4DAE4B4BA94848A245459B45459B5050A35C5CAB + 6060B36363B86565BC6363BA6161B86161B75A5AB54F4FB14F4FB35050B55151 + B85252B85151B85151B85252B85151B85151B75151B75151B64F4FB34E4EB14E + 4EB14E4EB14E4EB14F4FB25050B55151B65151B65151B65151B85151B85151B8 + 5151B85151B85050B54F4FB34F4FB24F4FB14E4EB14E4EB14E4EB04E4EB04E4E + B14F4FB35151B80200000200005959C95959C95959C95959C95959C95959C959 + 59C95959C95959C95959C95959C95959C95959C95959C95959C95959C95C5CCA + 7070D17A7AD47A7AD47A7AD47A7AD47A7AD47A7AD47A7AD46969CE5959C95959 + C95959C95959C95959C95959C95959C95959C95959C95959C95959C95959C959 + 59C85757C55555C05252B94F4FB14B4BAA4A4AA84A4AA64949A64A4AA74A4AA7 + 4949A44848A24848A24848A24848A24949A64B4BA94C4CAB4B4BA94B4BAA4C4C + AC4C4CAC4B4BA94C4CAB4C4CAD4C4CAB4A4AA64848A246469E4242953E3E8D3E + 3E8D4141924C4C9A5757A35B5BAA5E5EAE5D5DAC5A5AA95959A85959A85454A7 + 4B4BA64B4BA94C4CAD4D4DAD4C4CAC4C4CAD4D4DAD4C4CAC4B4BA94B4BA94A4A + A84848A34747A04747A04747A04747A14848A34A4AA84B4BAA4B4BA94B4BA94C + 4CAC4C4CAC4C4CAB4C4CAB4C4CAC4B4BA94A4AA64949A54949A54949A44848A2 + 4747A14747A14848A24949A64D4DAD0200000200005959C95959C95959C95959 + C95959C95959C95959C95959C95959C95959C95959C95959C95959C95959C959 + 59C95C5CCA7070D17A7AD47A7AD47A7AD47A7AD47A7AD47A7AD47A7AD46969CE + 5959C95959C95959C95959C95959C95959C95959C95959C95959C95959C95959 + C95959C95959C95858C75656C25252BA4F4FB14A4AA646469E45459B44449A44 + 449944449A44449A42429540409141419241419241419242429444449A45459B + 44449A44449A46469E45459D44449A45459B46469E45459C4343974242944141 + 923D3D8A3939813939813B3B853C3C8846468F52529954549D53539A51519751 + 51975050985151994D4D9945459A46469E46469E45459D46469E46469E45459C + 4444994444994343974040913E3E8D3F3F8F40408F4040904141934444994545 + 9B44449944449A45459D45459D45459B45459B45459D44449A43439743439743 + 43984343974242944141924141924141934343984848A20200000200005959C9 + 5959C95959C95959C95959C95959C95959C95959C95959C95959C95959C95959 + C95959C95959C95C5CCA7070D17A7AD47A7AD47A7AD47A7AD47A7AD47A7AD47A + 7AD46969CE5959C95959C95959C95959C95959C95959C95959C95F5FCB6161CC + 5F5FCB5959C95959C95959C95959C95858C75454BF5050B54B4BAA46469E4242 + 9441419240409140408F4040914040903D3D8A3B3B853B3B853B3B863B3B853C + 3C883E3E8C3E3E8D3D3D8B3E3E8C3F3F8F3E3E8D3D3D8B3E3E8C40408F42428F + 4D4D926D6DA45D5D9A3A3A8236367A35357937377D37377D38387F4242874D4D + 8F4B4B8C4949884A4A8A4B4B8C4A4A8C4B4B8D4848914141924040913F3F8F40 + 408F4040913E3E8D3D3D8A3D3D8B3C3C883A3A8238387F3939813A3A843B3B84 + 3C3C883E3E8D40408F3E3E8C3E3E8C40408F3F3F8F3E3E8C3F3F8E40408F3E3E + 8D3D3D8B3E3E8C3F3F8F3E3E8D3D3D8B3C3C883C3C883C3C883F3F8E44449A02 + 00000200005959C95959C95959C95959C95959C95959C95959C95959C95959C9 + 5959C95959C95959C95959C95B5BCA7070D07A7AD47A7AD47A7AD47A7AD47A7A + D47A7AD47A7AD46969CE5959C95959C95959C95959C95959C95959C95959C969 + 69CE7878D37A7AD47878D36B6BCF5D5DCA5959C95959C95858C65454BE4F4FB3 + 4A4AA743439840408F3F3F8E3E3E8D3E3E8C3E3E8D3E3E8C3B3B8438387F3939 + 8039398038387F3939803B3B853B3B853939813939813B3B843A3A8338387F3B + 3B824646894C4C8A7777A3E8E8E8B7B7C939398035357835357736367A363679 + 35357837377D41418447478445458147478347478647478647478749498B4747 + 8E3D3D883B3B853B3B863C3C883A3A843939803A3A8239398036367934347636 + 367937377D37377D3939803C3C873C3C883A3A833A3A823B3B863B3B853A3A82 + 3A3A843C3C873A3A843A3A823B3B843C3C883C3C873A3A843939813939803939 + 813C3C884242950200000200005959C95959C95959C95959C95959C95959C959 + 59C95959C95959C95959C95959C95959C95959C96868CE7A7AD47A7AD47A7AD4 + 7A7AD47A7AD47A7AD47A7AD46969CE5959C95959C95959C95959C95959C95959 + C95959C96969CE7A7AD47A7AD47A7AD47A7AD47A7AD47575D26767CE5A5AC958 + 58C65454BD4F4FB35F5FAF6F6FAD6161A13E3E8D3E3E8D3E3E8C4949936A6AA3 + 67679D38387F38387F39398037377D38387F3A3A843A3A8438387F38387E3939 + 8138387E3E3E7D4747814C4C884C4C877777A2EBEBEBBBBBCC57579164649736 + 367A37377D36367A35357837377C5B5B946A6A9A5A5A8D464683484885474785 + 47478649498B4B4B8D4242893A3A823A3A833A3A8439398037377D3939805959 + 9262629362629135357735357936367A37377D3A3A843B3B8439398038387F3A + 3A8239398138387E39398068689D66669A4E4E8B39398051519167679C66669A + 38387E38387E3939803C3C884343970200000200005858C95858C95858C95858 + C95858C95858C95858C95858C95858C95858C95858C95858C95959C97070D179 + 79D47979D47979D47979D47979D47878D36868CE5858C95858C95858C95858C9 + 5858C95858C95858C96868CE7979D47979D47979D47979D47979D47979D47979 + D47979D47474D26464CB6363C5C5C5E0ECECECECECECEAEAEAB0B0CC3F3F8F83 + 83B4E6E6E6E3E3E3E3E3E3D7D7DC5B5B963A3A8466669DE3E3E3B4B4C93B3B88 + 66669DE2E2E2B6B6C848488573739DE9E9E9C0C0D04D4D8A7A7AA7F1F1F1E9E9 + E9E6E6E6E3E3E3C7C7D1505090393981434385C1C1CFE3E3E3E3E3E3E3E3E3A3 + A3BC4A4A8B4A4A8A9292B5E4E4E49393B848488E8A8AB2E3E3E38989B1393983 + 5B5B95CBCBD5E0E0E0E2E2E2E2E2E2E0E0E05A5A9366669BE4E4E4B5B5CA3C3C + 8967679EE3E3E3B5B5C9393983383880C4C4D3E7E7E7E9E9E9BCBCCEAFAFC7E9 + E9E9E6E6E6E4E4E4D6D6DB7D7DA93B3B883F3F8F44449C0200000200005858C9 + 5858C95858C95858C95858C95858C95858C95858C95858C95858C95858C95858 + C95959C97474D27979D47979D47979D47979D47979D46C6CD05858C95858C958 + 58C95858C95858C95858C95858C96868CE7979D37979D37979D37979D37979D3 + 7979D47979D47979D47979D47979D47878D2C6C6EAF8F8F8C0C0DE7979BA8A8A + BEB8B8D46666AAF6F6F6E5E5EB7B7BB49191BDECECECDDDDE23E3E8F6C6CA7E9 + E9E9BBBBD14949957676A8E7E7E7BDBDCE50508D7878A5EEEEEEC6C6D7525293 + 8080B1FBFBFBD5D5E38080B2B1B1CBE9E9E9ADADC83D3D8CB2B2CCECECECA7A7 + C76C6CA8CACADAE9E9E99696BB5050959999BFEAEAEA9999C04F4F999090BAE9 + E9E98E8EB83D3D8CD7D7E1EAEAEA8F8FBB6C6CA66B6BA59999BE60609F6D6DA7 + ECECECBBBBD14141946C6CA7E9E9E9BABACF3D3D8C6B6BA4ECECECD5D5DF4646 + 8C5252929090B860609E3D3D8C4A4A93E6E6E6D8D8DD4040924343984747A302 + 00000200005858C95858C95858C95858C95858C95858C95858C95858C95858C8 + 5858C85757C75757C65757C47070CD7676CF7676CF7777D07777D07777D07171 + CD5D5DC65656C45656C45656C55757C65757C66666CB7676CF7676CE7676CE76 + 76CE7676CE7676CE7676CE7676CE7777D07777D17878D27878D2FFFFFFFFFFFF + 7777C36464B45D5DAA5555A49D9DCBFFFFFFA7A7D14646A045459ED4D4E5F4F4 + F47474B27E7EB5F6F6F6C9C9DD5E5EA58484B7F2F2F2C6C6D857579A8080B1F7 + F7F7CDCDDF58589E8585BAFFFFFFD4D4E75C5CA56464A7F7F7F7F2F2F2424297 + FAFAFAF8F8F85151A344449B8282B9F5F5F5C9C9DC55559FA2A2CBF5F5F5A1A1 + CC5656A89999C8F5F5F59797C77575B5FBFBFBDEDEEA7575B77474B57373B472 + 72B25050A27474B5F7F7F7C4C4DD4747A27474B5F2F2F2C2C2DA44449B7272B2 + F2F2F2C2C2D83F3F913E3E8E3F3F8F8A8ABCBABAD6DCDCE7EFEFEFDFDFE54646 + 9F4848A54C4CAD0200000200005858C95858C95858C95858C95858C95858C958 + 58C95858C85757C75656C55555C35454BF5252BC6262C17171C67171C77171C7 + 7272C87272C87171C76D6DC45A5ABF5252BC5353BE5454BF6363C47373C97272 + C87171C77070C57070C57070C47070C47070C57171C77272C87373CA7575CD76 + 76CFFFFFFFFFFFFF6F6FC36A6AB96565B06262ABA6A6D0FFFFFF9D9DCE4848A6 + 4848A4CECEE6FFFFFF8585BE8A8AC0FFFFFFD5D5E96363AE8A8AC0FEFEFECFCF + E35B5BA28787BAFFFFFFD4D4E75D5DA58888BEFFFFFFD4D4E95F5FAA5E5EA9FF + FFFFFFFFFF5050A2FFFFFFFFFFFF4848A44C4CA58585BEFFFFFFD3D3E75A5AA7 + A8A8D2FFFFFFAAAAD75757B2A0A0D3FFFFFF9F9FD37B7BC2FFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFDFDFD7B7BC27B7BC2FFFFFFCFCFE94D4DB17C7CC3FEFEFECC + CCE64B4BAB7A7AC0FBFBFBC9C9E246469F44449C9C9CCBFFFFFFFFFFFFFFFFFF + C0C0E06D6DBA4C4CAE4E4EB25050B80200000200005858C95858C95858C95858 + C95858C95858C95858C95858C85656C55555C15252BC5050B64E4EB25252B167 + 67B96A6ABA6B6BBB6C6CBD6B6BBC6A6ABA6A6AB96767B85454B34E4EB35E5EBA + 6E6EC06D6DBF6C6CBD6B6BBB6A6ABA6A6AB96969B86161B55E5EB46A6ABA6C6C + BD6E6EC17272C87474CBDADAF1FFFFFFB2B2DF6A6AB97979BAABABD29595C5FF + FFFFE6E6F35454AC6D6DB8FFFFFFFFFFFF6B6BB08C8CC1FFFFFFE0E0EF6E6EB4 + ABABD2FFFFFFDFDFEE6868ABA9A9CFFFFFFFD4D4E85555A48484BEFFFFFFDFDF + EE6B6BB28A8AC2FFFFFFE9E9F35C5CA7DCDCEDFFFFFFA0A0D05B5BAAC9C9E2FF + FFFFB2B2D55B5BA8A8A8D3FFFFFFC0C0E35353B8C5C5E7FFFFFFA2A2D95D5DBD + F3F3FAE8E8F65252BC5252BCDCDCF1FFFFFF6868C37F7FCCFFFFFFDCDCF25E5E + C0A2A2DAFFFFFFD1D1EC5050B87F7FC9FFFFFFD0D0EA4C4CAE4B4BACCFCFE9FF + FFFF9595D14F4FB55050B87E7ECB5151BA5252BC5454BF0200000200005858C9 + 5858C95858C95858C95858C95858C95858C95757C65555C15252BC4F4FB44B4B + AB4848A54747A24E4EA55E5EAA6262AC6464AF6262AC6060A96060A96161AA5E + 5EAA5959AA6666B26666B46666B36565B06363AE6262AC6262AB5959A647479E + 45459E4D4DA25959A96565B36D6DBE7070C58D8DD2F6F6FBFFFFFFFFFFFFFFFF + FFD4D4E65C5CA1B7B7D7FFFFFFFFFFFFFFFFFFFFFFFF9494C76060A88A8AC0FF + FFFFF5F5F9FFFFFFFFFFFFFFFFFFD4D4E7FFFFFFFFFFFFFFFFFF9E9ECB434399 + 7676B5FFFFFFF4F4F9FFFFFFFFFFFFFFFFFFA7A7CD5959A17A7AB4F3F3F9FFFF + FFFFFFFFFFFFFFDEDEEC6363A75858A2A7A7D0FFFFFFF4F4FAFFFFFFFFFFFFFF + FFFF7777CE5555C29A9ADBFFFFFFE8E8F7DDDDF3FFFFFFBBBBE75555C38282D3 + FFFFFFF4F4FBFFFFFFFFFFFFFFFFFFA4A4DE5555C1FFFFFFFFFFFFFFFFFFFFFF + FFD1D1EC8B8BD0FFFFFFF4F4FBD1D1EEF4F4FBD2D2EE5555C15555C35656C302 + 00000200005757C85757C85757C85757C85757C85757C85757C75555C35252BC + 4E4EB44949A944449D4040943F3F913F3F9145459256569A5B5B9E59599C5656 + 9756569656569757579759599B5C5CA15D5DA35D5DA35C5CA15C5CA05B5B9E52 + 52994141913D3D8C3D3D8C3E3E8F3F3F9147479D5959AE6565BB6D6DC07979C5 + A6A6D6ACACD3A8A8CC6D6DA554549543438E7E7EB49999C59A9AC76666A94747 + 975B5BA16767A78787B97D7DB47272AEA6A6CB9B9BC455559D6666A79C9CC88D + 8DC03F3F913D3D8C4A4A947272AC7171A96C6CA6A5A5CA9A9AC3535396535395 + 5252956969A3A4A4C8A4A4CA9898C15D5D9D5151965252986A6AAA7C7CBE6565 + BB7F7FCDA4A4DE8383D55757C75757C75757C76D6DCEA5A5E1A5A5E18F8FDA57 + 57C75757C76262CB8484D67979D26D6DCEA5A5E19A9ADD5757C75757C7A5A5E1 + FFFFFFDDDDF38282D37676CD5454C26C6CCBA4A4E0A5A5E0A5A5E16D6DCE5757 + C75757C75757C70200000200005757C85757C85757C85757C85757C85757C857 + 57C75454C25151B94C4CAE4646A23F3F923B3B883A3A85393984393983414189 + 52529352528F4F4F8A4F4F894F4F8A4F4F8951518D5454935656975656975555 + 955555954E4E923F3F8C3B3B873939823838813838813A3A853F3F914747A24C + 4CAD5656B66464BA6868B65F5FA656569651518D4E4E8A3D3D823838813B3B88 + 3C3C8A3C3C8942428E5656985757985757975858995656974E4E9043438E3F3F + 8F3E3E8F3E3E8E3D3D8D3B3B873838813838813939823B3B844A4A8C52529351 + 51914E4E8D4D4D8B4D4D8B4D4D8B4E4E8E5050924E4E8F4C4C8B4C4C8D4B4B8F + 43439145459E4B4BAD5050B85454C15656C65757C85757C85757C85757C85757 + C85757C85757C85757C85757C85757C85757C85757C85757C85757C85757C857 + 57C85757C88484D7FFFFFFD2D2F05656C65656C65656C65757C75757C75757C7 + 5757C85757C85757C85757C85757C80200000200005757C85757C85757C85757 + C85757C85757C85757C75454C14F4FB74A4AAB44449D3D3D8C38388137377E36 + 367C36367B3838804040874C4C884B4B834A4A824A4A824A4A804B4B834F4F8A + 51518D51518D51518D4B4B8C3C3C883A3A8639398236367C35357A35357A3737 + 7D3C3C8A45459E4A4AAB4D4DB15E5EB76767B45D5DA35353914D4D8649498139 + 397934347837377F393983393982404088545494555594555594555594545492 + 47478A3B3B883C3C8B3C3C8B3C3C8A3B3B8838388135357935357935357A3636 + 7C39398148488A4D4D8A4A4A854949844949834949834A4A864C4C8B4A4A8648 + 48844646833D3D833C3C8A4343994A4AA94F4FB75454C05656C65757C85757C8 + 5757C85757C85757C85757C85757C85757C85757C85757C85757C85757C85757 + C85757C85757C85757C85757C85757C85757C85757C85757C85757C85757C857 + 57C85757C85757C85757C85757C85757C85757C85757C80200000200005757C8 + 5757C85757C85757C85757C85757C85757C75454C04F4FB77474BC5959A63C3C + 8B37377F36367B3535793434774D4D8B65659C3E3E834848824A4A814A4A8048 + 487E49497F56568C7777A27777A152528C3B3B845B5B975B5B9839398336367D + 35357A35357936367C3C3C8944449D4A4AAB4D4DB27575C18D8DC65E5EA45454 + 924C4C8548488038387734347737377E5E5E986A6AA057579553539355559454 + 549360609A8080AD7676A73B3B883C3C8B3C3C8A3C3C8A5E5E9C67679B656596 + 33337634347735357950508D6B6BA07272A14848814848824949834848826C6C + 9C7777A56B6B9B4545813B3B7F3939823C3C8A43439B4A4AAB5050B85454C156 + 56C65757C85757C85757C85757C85757C85757C85757C85757C85757C85757C8 + 5757C85757C85757C85757C85757C85757C85757C85757C85757C85757C85757 + C85757C85757C85757C85757C85757C85757C85757C85757C85757C85757C802 + 00000200005757C85757C85757C85757C85757C85757C85757C75454C2B2B2DC + ECECECE6E6E6B8B8CDE2E2E2B3B3C635357A70709EE7E7E7E3E3E3CCCCD6CBCB + D4DDDDDD7575A04C4C85616192DFDFE3EAEAEAECECEC8D8DB39999BCE8E8E8E3 + E3E3B4B4C9DDDDDDDBDBDB3838813939833E3E8F4646A14B4BAD8989CDFAFAFA + F2F2F2DADAE3D5D5DDE3E3E37575A13C3C7F5B5B94D4D4DEEFEFEFF1F1F1EFEF + EF9D9DC0565697A8A8C6EFEFEFF1F1F1F2F2F2E6E6EB3E3E8E6262A2D5D5DFE8 + E8E8E7E7E7E7E7E7E8E8E85B5B95B2B2CAEFEFEFECECECECECECDEDEE28B8BB0 + 4E4E8BE4E4E8EEEEEEECECECEAEAEAD0D0D95C5C983C3C893F3F914646A04C4C + AF5151BA5454C25757C75757C85757C85757C85757C85757C85757C85757C857 + 57C85757C85757C85757C85757C85757C85757C85757C85757C85757C85757C8 + 5757C85757C85757C85757C85757C85757C85757C85757C85757C85757C85757 + C85757C85757C80200000200005757C85757C85757C85757C85757C85757C857 + 57C78282D3FDFDFDDFDFEC8080BE9D9DC5EAEAEABABACE383880C0C0D3F1F1F1 + 7878AC4A4A95D2D2DDE5E5E57373A74F4F909999BBEFEFEFB7B7CF3C3C885353 + 95F6F6F6F2F2F24B4B976161A3E5E5E5E0E0E03D3D8C3E3E9043439A4949A94E + 4EB4D1D1ECFFFFFF9B9BD16F6FB6D9D9E2E7E7E77B7BAB42428DD6D6E1EDEDED + 9393BF7070AD9797C2A1A1C69999C1F4F4F4D3D3E18E8EBA8686B6D0D0E14141 + 96DEDEE9F1F1F19191BE6D6DA96B6BA59999BE6161A09292BC6262A34040934B + 4B97EDEDEDE0E0E54E4E94A6A6C76666A44C4C997A7AB0E6E6E6ADADC9404093 + 43439A4848A64E4EB35252BC5555C35757C75757C85757C85757C85757C85757 + C85757C85757C85757C85757C85757C85757C85757C85757C85757C85757C857 + 57C85757C85757C85757C85757C85757C85757C85757C85757C85757C85757C8 + 5757C85757C85757C85757C85757C80200000200005656C85656C85656C85656 + C85656C85656C85656C8A4A4E0FFFFFFA1A1D94C4CB07575BAF3F3F3C1C1D63C + 3C8CBCBCD7FBFBFB9696C44E4EA1C5C5DDEFEFEF7171B343439B9595C4F4F4F4 + 9595C33F3F933E3E91F2F2F8FEFEFE8080BB44449EEFEFEFE6E6E643439C4444 + 9F4747A64D4DB25050BAC5C5E9FFFFFFB3B3E07474BFD0D0E4F2F2F28484B977 + 77B5F7F7F7D2D2E44646A44646A24C4CA46060ABD4D4E8FCFCFC9494C66262AC + 5555A64545A17676BBFFFFFFE3E3EF7575B97373B57272B27070B24F4FA14343 + 9B8C8CC2BBBBDADFDFEBF6F6F6E9E9EF45459E5151A49999CAC6C6DFE6E6EDEE + EEEEB3B3D14545A14747A64C4CB05050B95353C05555C55656C75656C85656C8 + 5656C85656C85656C85656C85656C85656C85656C85656C85656C85656C85656 + C85656C85656C85656C85656C85656C85656C85656C85656C85656C85656C856 + 56C85656C85656C85656C85656C85656C85656C85656C80200000200005656C8 + 5656C85656C85656C85656C85656C85656C8A4A4E1FFFFFFA3A3DD5050B97C7C + C5FBFBFBC8C8E04242995A5AA5CDCDE4FFFFFFFFFFFFFFFFFFFEFEFE7979C24A + 4AAB9D9DD0FBFBFB9A9ACD44449F44449E7777B9E6E6F3FFFFFFFFFFFFFCFCFC + F2F2F24A4AAC4B4BAE4D4DB35050BA5252BF6B6BCBD6D6F0FFFFFFFFFFFFFFFF + FFFFFFFF8F8FC97F7FC3FFFFFFCFCFE94D4DB24C4CB05151B16767B9D7D7ECFF + FFFF9191CC6969B95C5CB34B4BAD7B7BC3FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FDFDFD7A7AC19E9ED2FFFFFFFFFFFFFFFFFFC3C3E36E6EBD4B4BADCFCFE9FFFF + FFFFFFFFF3F3FAB3B3DB5656B24C4CB04D4DB35050B95252BF5454C35555C656 + 56C85656C85656C85656C85656C85656C85656C85656C85656C85656C85656C8 + 5656C85656C85656C85656C85656C85656C85656C85656C85656C85656C85656 + C85656C85656C85656C85656C85656C85656C85656C85656C85656C85656C802 + 00000200005656C85656C85656C85656C85656C85656C85656C88E8EDAFFFFFF + E8E8F75E5EC47F7FCCFFFFFFCFCFE94848A85353AB5555AF4B4BAE7C7CC7E7E7 + F5FFFFFF7F7FCC4F4FB8A1A1D9FFFFFFA0A0D64B4BAE4A4AAD6363B84C4CB059 + 59B98A8ACFFFFFFFFEFEFE5050B95050BA5151BD5353C15454C46060C97272CE + 7575CE9898D9ECECF8FFFFFF9494D36363C0F3F3FAFFFFFF8080CE5252BB8585 + CFA7A7DBB2B2DEFFFFFFCFCFEB7979C76C6CC3ADADDE5B5BBDF3F3FAE8E8F650 + 50BA5050BADCDCF1FFFFFF6767C2D0D0ECFFFFFF9797D65050BB5050B97F7FCC + 5050B9FFFFFFFFFFFF6868C45050BA5C5CBE7272C65050BA5151BB5252BF5454 + C35555C55656C75656C85656C85656C85656C85656C85656C85656C85656C856 + 56C85656C85656C85656C85656C85656C85656C85656C85656C85656C85656C8 + 5656C85656C85656C85656C85656C85656C85656C85656C85656C85656C85656 + C85656C85656C80200000200005656C85656C85656C85656C85656C85656C856 + 56C85656C8D2D2F0FFFFFFFFFFFFFFFFFFFFFFFFD0D0EC4E4EB57C7CC7FFFFFF + D0D0ECDCDCF1FFFFFFE8E8F75E5EC48181D1FFFFFFFFFFFFFFFFFFFFFFFFA1A1 + D9A2A2DAF3F3FAD1D1EDE8E8F6FFFFFFC6C6EA5353C15353C25454C35555C555 + 55C68383D6FFFFFFDBDBF3E4E4F5FFFFFFECECF87D7DCF6E6ECAA7A7DFFFFFFF + FFFFFFFFFFFFFFFFFFB5B5E47C7CCEE3E3F5FFFFFFFFFFFFFFFFFFFFFFFF5353 + C19898DAFFFFFFE8E8F7DDDDF3FFFFFFBABAE65353C28C8CD6FFFFFFF4F4FBD1 + D1EFF4F4FBD1D1EE5353C1AFAFE2FFFFFFE8E8F7D1D1EFFFFFFFA3A3DE5353C1 + 5454C35454C35555C55656C75656C75656C85656C85656C85656C85656C85656 + C85656C85656C85656C85656C85656C85656C85656C85656C85656C85656C856 + 56C85656C85656C85656C85656C85656C85656C85656C85656C85656C85656C8 + 5656C85656C85656C85656C85656C80200000200005656C85656C85656C85656 + C85656C85656C85656C85656C85656C89A9ADEA5A5E1A4A4E1FFFFFFD1D1EE52 + 52BF5E5EC28C8CD4A3A3DDA4A4DF9898DC6060CA5656C76060CABBBBE8FFFFFF + BBBBE78282D36A6ACA6B6BCB9898DBA4A4E0A4A4E08E8ED95555C65656C75656 + C75656C75656C85656C86161CC9C9CDFB7B7E7B7B7E7AEAEE48181D57878D278 + 78D27878D28A8AD8B7B7E7B7B7E7AEAEE48181D57878D27878D2A5A5E1B7B7E7 + B0B0E57878D25656C75656C76D6DCEA5A5E1A5A5E18E8EDA5656C75656C75656 + C76D6DCEA5A5E1A5A5E1A5A5E16D6DCE5656C75656C77878D2A5A5E1A5A5E19A + 9ADD6161CB5656C75656C75656C75656C75656C85656C85656C85656C85656C8 + 5656C85656C85656C85656C85656C85656C85656C85656C85656C85656C85656 + C85656C85656C85656C85656C85656C85656C85656C85656C85656C85656C856 + 56C85656C85656C85656C85656C85656C85656C85656C80200000200005656C8 + 5656C85656C85656C85656C85656C85656C85656C85656C85656C85656C88383 + D6FFFFFFD2D2F05555C55454C45555C55555C55555C65656C75656C85656C856 + 56C8A5A5E2FFFFFFA5A5E15555C65555C65555C65656C75656C75656C85656C8 + 5656C85656C85656C85656C85656C85656C85656C86666CD7878D37878D37878 + D37878D37878D37878D37878D37878D37878D37878D37878D37878D37878D378 + 78D37878D37878D36666CD5656C85656C85656C85656C85656C85656C85656C8 + 5656C85656C85656C85656C85656C85656C85656C85656C85656C85656C85656 + C85656C85656C85656C85656C85656C85656C85656C85656C85656C85656C856 + 56C85656C85656C85656C85656C85656C85656C85656C85656C85656C85656C8 + 5656C85656C85656C85656C85656C85656C85656C85656C85656C85656C85656 + C85656C85656C85656C85656C85656C85656C85656C85656C85656C85656C802 + 00000200005555C75555C75555C75555C75555C75555C75555C75555C75555C7 + 5555C75555C76C6CCEA4A4E19898DC5555C55454C45454C45454C45454C55555 + C65555C65555C65555C75555C75555C75555C75555C75555C75555C75555C755 + 55C75555C75555C65555C65454C55454C55454C45454C45454C55454C55A5AC8 + 7474D07777D27777D27777D27777D27777D27777D27777D27777D27777D27777 + D27777D27777D27777D27777D27474D15A5AC95555C75555C75555C75555C755 + 55C75555C75555C75555C75555C75555C75555C65555C65555C75555C75555C7 + 5555C75555C75555C75555C75555C75555C75555C75555C75555C75555C75555 + C75555C65555C65454C55454C55454C45454C45454C55454C55555C65555C655 + 55C75555C75555C75555C75555C75555C75555C75555C75555C75555C75555C7 + 5555C75555C75555C75555C75555C75555C75555C75555C75555C75555C75555 + C75555C75555C70200000200005555C75555C75555C75555C75555C75555C755 + 55C75555C75555C75555C75555C65454C55454C45353C25252BF5151BE5151BD + 5151BD5151BD5151BE5252C05353C25454C45454C55555C65555C65555C75555 + C75555C75555C75555C65454C55353C35252C15151BE5151BD5050BB5050BB51 + 51BD5151BE5252C15F5FC77474D07777D17777D17777D17676D07575CF7575CE + 7575CE7575CE7474CD7474CD7575CE7575CE7373CE5F5FC85454C55555C65555 + C65555C75555C75555C75555C75555C75555C65454C55454C45353C35353C253 + 53C25353C35454C45454C55555C65555C75555C75555C75555C75555C75555C7 + 5555C75555C65454C55353C35252C15151BE5151BD5050BB5050BB5151BD5151 + BE5252C15353C35454C55555C65555C65555C65454C55454C45353C35353C353 + 53C35353C25353C25353C35353C35353C35454C45454C55555C65555C65555C7 + 5555C75555C75555C75555C75555C70200000200005555C75555C75555C75555 + C75555C75555C75555C75555C75555C75555C65454C45252C15151BD4F4FB84D + 4DB44C4CB24B4BB04B4BB04C4CB14D4DB34E4EB64F4FB85050BB5252BF5353C2 + 5454C45555C65555C65555C65454C55353C35252BF5050BB4E4EB74C4CB24B4B + AF4A4AAC4A4AAC4B4BAF4C4CB24E4EB75050BB5959C26767C87171CD7272CD71 + 71CB6F6FC86E6EC66E6EC56D6DC36C6CC26C6CC26B6BC26363C05858BE5151BE + 5252C15353C35454C55555C65555C75555C75555C75555C65454C55353C25252 + BF5050BB4F4FB94F4FB95050BB5151BE5353C25454C45555C65555C75555C755 + 55C75555C75555C65454C55353C35252BF5050BB4E4EB74C4CB24B4BAF4A4AAC + 4A4AAC4B4BAF4C4CB24E4EB75050BB5252BF5353C25353C35353C25252C15151 + BE5050BB5050BB4F4FB94F4FB84F4FB84F4FB94F4FBA5050BB5151BE5252C153 + 53C35454C55555C65555C75555C75555C75555C75555C70200000200005555C7 + 5555C75555C75555C75555C75555C75555C75555C75555C65454C45252BF4F4F + B94C4CB24949AB4747A54646A34545A24646A34646A54747A74848A94A4AAC4B + 4BB04D4DB54F4FBA5151BE5353C25454C45454C45353C25151BD4E4EB64B4BAF + 4747A64444A042429B41419942429A43439C4545A24848A84B4BAF4E4EB65050 + BB5151BD5151BD5050BB4E4EB64C4CB14A4AAE4949AB4848A94848A94949AB4A + 4AAD4C4CB14E4EB75050BC5252C15454C45555C65555C75555C75555C75454C5 + 5353C25151BD4E4EB64B4BAF4949AC4949AC4A4AAE4D4DB35050BB5252C05454 + C45555C65555C75555C75555C65454C55353C25151BD4E4EB64B4BAF4747A644 + 44A042429B41419942429A43439C4545A24848A84B4BAF4E4EB65050BB5151BD + 5151BD5050BB4E4EB64C4CB14A4AAE4949AB4848A94848A94949AB4A4AAD4C4C + B14E4EB75050BC5252C15454C45555C65555C75555C75555C75555C75555C702 + 00000200005555C75555C75555C75555C75555C75555C75555C75555C75454C5 + 5252C04F4FB94B4BB04646A542429B4040953E3E923E3E924040954141974242 + 9A43439C44449E4545A24848A84A4AAE4D4DB55050BB5151BE5151BE5050BB4C + 4CB24848A843439C3E3E913B3B893838833737823838843B3B893E3E9042429A + 4545A24949AB4C4CB14D4DB44D4DB54C4CB24949AC4747A544449E4141994040 + 9640409641419944449E4747A54B4BAF4E4EB75151BE5353C25454C55555C755 + 55C75555C65454C45151BD4D4DB54949AA44449F41419941419943439D4747A5 + 4C4CB15050BB5353C25454C55555C75555C65454C55353C25050BB4C4CB34848 + A843439C3E3E913B3B893838833737823838843B3B893E3E9042429A4545A249 + 49AB4C4CB14D4DB44D4DB54C4CB24949AC4747A544449E414199404096404096 + 41419944449E4747A54B4BAF4E4EB75151BE5353C25454C55555C75555C75555 + C75555C75555C70200000200005555C75555C75555C75555C75555C75555C755 + 55C75555C65353C35050BC4C4CB14646A44040953B3B8B393985383884393986 + 3B3B8B3D3D8E3E3E903E3E913E3E913F3F9341419744449E4747A74B4BAF4D4D + B44D4DB44B4BAF4646A34040953A3A8734347B3131722F2F6F30307031317334 + 347B3838833C3C8D4040974444A04747A74949AC4A4AAC4848A84545A1404097 + 3C3C8C38388336367E36367E3838833C3C8C4141994747A54C4CB15050BB5353 + C25454C55555C75555C75555C65252C14F4FB84949AB43439C3C3C8C38388338 + 38823A3A894040954747A54D4DB35151BD5454C45555C65454C55353C25050BB + 4C4CB14646A44040953A3A8734347B3131722F2F6F30307031317334347B3838 + 833C3C8D4040974444A04747A74949AC4A4AAC4848A84545A14040973C3C8C38 + 388336367E36367E3838833C3C8C4141994747A54C4CB15050BB5353C25454C5 + 5555C75555C75555C75555C75555C70200000200005454C75454C75454C75454 + C75454C75454C75454C75454C65151C14D4DB74848AA41419A3A3A8A36368035 + 357E36367F3838853B3B8C3D3D913E3E923C3C8F3B3B8B3939883939883C3C8D + 3F3F9643439F4646A54646A643439E3D3D913737823030722B2B672929622A2A + 622B2B672E2E6E3232773636803A3A893D3D904141994444A04646A54646A645 + 45A341419B3C3C8E3636803131732E2E6C2E2E6C3131733636813E3E924444A2 + 4A4AB04F4FBB5252C25353C55454C75454C75353C45050BD4B4BB14444A13C3C + 8D34347B2F2F702F2F7033337839398741419B4949AC4E4EB95252C25353C552 + 52C35050BD4C4CB34646A53E3E933737823030722B2B672929622A2A622B2B67 + 2E2E6E3232773636803A3A893D3D904141994444A04646A54646A64545A34141 + 9B3C3C8E3636803131732E2E6C2E2E6C3131733636813E3E924444A24A4AB04F + 4FBB5252C25353C55454C75454C75454C75454C75454C70200000200005454C7 + 5454C75454C75454C75454C75454C75454C75353C55050BE4C4CB34646A53E3E + 9338388535357E35357E3838853C3C8E40409742429C42429B3F3F953B3B8C37 + 378335357D35357E3838853B3B8C3E3E933F3F943B3B8C35357E2F2F6F292962 + 26265B26265B2929612D2D6A31317436367F3939873C3C8E3E3E934141994343 + 9E4545A24545A44545A241419A3B3B8C34347B2D2D6A2929622929622D2D6A34 + 347B3D3D904545A34B4BB35050BD5252C35454C65454C75454C65252C24E4EB8 + 4848AA3F3F953636802E2E6C2929622929622E2E6C35357E3E3E934646A54C4C + B55050BE5252C25151BF4D4DB74747A93F3F963737822F2F7029296226265B26 + 265B2929612D2D6A31317436367F3939873C3C8E3E3E9341419943439E4545A2 + 4545A44545A241419A3B3B8C34347B2D2D6A2929622929622D2D6A34347B3D3D + 904545A34B4BB35050BD5252C35454C65454C75454C75454C75454C75454C702 + 00000200005454C75454C75454C75454C75454C75454C75454C75353C55050BD + 4B4BB14444A26A6AA78888B18787AF8888B18B8BB87878B46666B24747A94646 + A643439E3D3D9037378232327630307231317433337936368036368033337839 + 39746F6F9084849BA7A7B4A7A7B69393AB75759E3838853D3D9040409742429C + 43439E4444A14545A34646A54646A64545A441419B3B3B8C3333782B2B652727 + 5B27275B2B2B6533337A3E3E924646A54C4CB55151BF5353C55454C65454C753 + 53C55151BF4C4CB37A7AB86565A03C3C7B2A2A6226265926265B2B2B67333379 + 3C3C8D4444A24B4BB14F4FBB5151BF4F4FBB4A4AAF43439E3939873C3C797070 + 9184849BA7A7B4A7A7B69393AB75759E3838853D3D9040409742429C43439E44 + 44A14545A34646A54646A64545A441419B3B3B8C3333782B2B6527275B27275B + 2B2B6533337A3E3E924646A54C4CB55151BF5353C55454C65454C75454C75454 + C75454C75454C70200000200005454C75454C75454C75454C75454C75454C754 + 54C75353C44F4FBC8E8ECBE4E4EAECECECECECECEFEFEFF2F2F2F5F5F5F5F5F5 + F2F2F2E1E1E8A7A7D05A5AAD4040973737833030722C2C692B2B662C2C692E2E + 6C2E2E6D8181A1D4D4D7E0E0E0E0E0E0E2E2E2E3E3E3E5E5E5E5E5E5CFCFDB85 + 85BD4747A94848AB4848AB4848AC7777C0F7F7F7F3F3F3CBCBDFB9B9D1B0B0C6 + AAAABDA7A7B6B4B4BEDDDDDDE5E5E56565993F3F954747A94E4EB85252C25454 + C65454C65454C65353C44F4FBB4949ACD2D2DEDDDDDDD5D5D5BABAC175759026 + 265B2C2C693333793B3B8C43439E4949AE4D4DB74F4FBB4D4DB64747A83E3E93 + 8686ABD4D4D8E0E0E0E0E0E0E2E2E2E3E3E3E5E5E5E5E5E5CFCFDB8585BD4747 + A94848AB4848AB4848AC7777C0F7F7F7F3F3F3CBCBDFB9B9D1B0B0C6AAAABDA7 + A7B6B4B4BEDDDDDDE5E5E56565993F3F954747A94E4EB85252C25454C65454C6 + 5454C75454C75454C75454C75454C70200000200005454C75454C75454C75454 + C75454C75454C75454C75353C46767C6FDFDFDFAFAFAFAFAFAFBFBFBF1F1F7B4 + B4D99D9DD2A0A0D8C5C5E9FEFEFEF2F2F2E5E5E59393BD42428A2F2F6F292962 + 26265B26265B27275D9C9CB1E9E9E9E9E9E9EBEBEBEFEFEFF3F3F3F7F7F7F8F8 + F8F9F9F9F7F7F7F4F4F4D1D1E67979C74D4DB74D4DB65959BB7C7CC9C4C4E7FC + FCFCF2F2F2E8E8E8E0E0E0DDDDDDDEDEDEA5A5B76C6C9543438841419A4949AE + 5050BD5353C55454C75454C75454C65151C14D4DB66A6AB6EFEFEFE5E5E5DDDD + DDD7D7D7BDBDC32929602F2F7036367F3C3C8D42429D4848AB4C4CB34D4DB64A + 4AB04444A1A5A5C4E9E9E9E9E9E9EBEBEBEFEFEFF3F3F3F7F7F7F8F8F8F9F9F9 + F7F7F7F4F4F4D1D1E67979C74D4DB74D4DB65959BB7C7CC9C4C4E7FCFCFCF2F2 + F2E8E8E8E0E0E0DDDDDDDEDEDEA5A5B76C6C9543438841419A4949AE5050BD53 + 53C55454C75454C75454C75454C75454C75454C75454C70200000200005353C6 + 5353C65353C65353C65353C65353C65353C65252C4A1A1DCFFFFFFFFFFFFFFFF + FF9B9BCC5151AB4848AC4C4CB54F4FBD5252C37474CEF3F3FAF2F2F2E2E2E2B7 + B7C638387126265C2323532222519A9AAEEDEDEDEFEFEFF2F2F2F6F6F6FCFCFC + FFFFFFF2F2F6BFBFDB9C9CCF9F9FD6B8B8E3E7E7F6FEFEFEB8B8E36666C34D4D + B94D4DB94D4DB9CFCFEBFFFFFFF5F5F5EBEBEBE4E4E4B1B1C028285F2D2D6A36 + 368241419B4A4AAF4F4FBD5252C45353C65353C65252C34F4FBC4949AFB1B1D6 + F6F6F6EFEFEFE6E6E6E0E0E0DCDCDC4F4F7F3232783838863D3D9041419B4646 + A74949AE4949AF4747A9ABABCFF1F1F1F0F0F0F2F2F2F6F6F6FCFCFCFFFFFFF2 + F2F6BFBFDB9C9CCF9F9FD6B8B8E3E7E7F6FEFEFEB8B8E36666C34D4DB94D4DB9 + 4D4DB9CFCFEBFFFFFFF5F5F5EBEBEBE4E4E4B1B1C028285F2D2D6A3636824141 + 9B4A4AAF4F4FBD5252C45353C65353C65353C65353C65353C65353C65353C602 + 00000200005353C65353C65353C65353C65353C65353C65353C65252C4A2A2DD + FFFFFFFFFFFF9292CE4848AC4A4AB04C4CB64E4EBB5151C15252C35050BE7C7C + C9FEFEFEECECECDEDEDEA9A9B824245722225070708BECECECF2F2F2F7F7F7FB + FBFBFFFFFFFFFFFF8F8FB13737833F3F974646A74A4AB14C4CB54C4CB69494D3 + E7E7F5FFFFFF4C4CB54C4CB64D4DB7A0A0D7FFFFFFFFFFFFF4F4F4EAEAEA8181 + 9E28285F2D2D6B37378241419C4A4AAF4F4FBD5353C55353C65353C55151C14D + 4DB75353AEF2F2F8FDFDFDF8F8F8F0F0F09B9BB0CDCDD58F8FAF3737833C3C8E + 3E3E9541419B4444A34747A94747A98D8DC6F8F8F8F7F7F7F8F8F8FBFBFBFFFF + FFFFFFFF8F8FB13737833F3F974646A74A4AB14C4CB54C4CB69494D3E7E7F5FF + FFFF4C4CB54C4CB64D4DB7A0A0D7FFFFFFFFFFFFF4F4F4EAEAEA81819E28285F + 2D2D6B37378241419C4A4AAF4F4FBD5353C55353C65353C65353C65353C65353 + C65353C65353C60200000200005353C65353C65353C65353C65353C65353C653 + 53C65353C5B9B9E7FFFFFFD0D0ED4D4DB74C4CB64D4DB94F4FBC5050BE5151C1 + 5050BE4D4DB74747AAE6E6F1F6F6F6E8E8E8DEDEDE6D6D8A222250CFCFD6F1F1 + F1F7F7F7FBFBFBFEFEFEFFFFFF51517C2E2E6E3838853F3F974545A44848AB48 + 48AC4848AB4747A85252ADC1C1E24747A94949AE4A4AB17A7AC5FFFFFFFFFFFF + FBFBFBEFEFEF5B5B842828602D2D6B37378341419C4A4AAF4F4FBD5252C45353 + C55252C34F4FBD4B4BB28E8EC6FFFFFFFFFFFFFFFFFFF9F9F9797999A3A3BCD4 + D4DD3B3B8D3F3F9740409A41419B43439F4545A44545A5E6E6F2FEFEFEFDFDFD + FDFDFDFEFEFEFFFFFF51517C2E2E6E3838853F3F974545A44848AB4848AC4848 + AB4747A85252ADC1C1E24747A94949AE4A4AB17A7AC5FFFFFFFFFFFFFBFBFBEF + EFEF5B5B842828602D2D6B37378341419C4A4AAF4F4FBD5252C45353C55353C5 + 5353C55353C65353C65353C65353C60200000200005353C65353C65353C65353 + C65353C65353C65353C65353C5D1D1EFFFFFFF8A8AD55050BE4F4FBD5050BE50 + 50BF5050BE4F4FBC4C4CB54747AA41419BCACAE0FEFEFEF2F2F2E9E9E99898AC + 666687F1F1F1F5F5F5F9F9F9FBFBFBFBFBFB8989A226265C2E2E6D3737833E3E + 9442429E4444A24343A141419C3F3F973E3E943E3E943F3F9742429E4646A678 + 78C0FFFFFFFFFFFFFEFEFEF1F1F15B5B8428285F2D2D6A37378241419B4949AE + 4E4EBB5151C25252C35050BF4D4DB74747A9D9D9EAFFFFFFFFFFFFFFFFFFFEFE + FE454576676798F4F4F46E6EAE42429E42429E41419B41419B42429E8181BEFF + FFFFFFFFFFFFFFFFFDFDFDFBFBFB8989A326265C2E2E6D3737833E3E9442429E + 4444A24343A141419C3F3F973E3E943E3E943F3F9742429E4646A67878C0FFFF + FFFFFFFFFEFEFEF1F1F15B5B8428285F2D2D6A37378241419B4949AE4E4EBB51 + 51C25252C35252C35252C45252C45353C55353C65353C60200000200005353C6 + 5353C65353C65353C65353C65353C65353C65353C6D1D1F0FFFFFF5252C45252 + C35151C15151C15050BE4E4EBA4B4BB24646A7404099393988E4E4EDFFFFFFFA + FAFAF3F3F3BBBBC98888A6F8F8F8F9F9F9F9F9F9F7F7F7E4E4E823235526265B + 2D2D6B35357F3B3B8D3F3F963F3F973E3E943A3A8B36368234347C34347B3636 + 803A3A8B3F3F977575B9FFFFFFFFFFFFFBFBFBEEEEEE5A5A8127275C2C2C6835 + 357F4040984747AA4C4CB64F4FBD4F4FBC4C4CB64949AE6868B1FFFFFFFFFFFF + FFFFFFFFFFFFD3D3DE2B2B6735357EE2E2EDADADD24545A54444A241419B3F3F + 963F3F979999C8FFFFFFFFFFFFFFFFFFF8F8F8E4E4E824245526265B2D2D6B35 + 357F3B3B8D3F3F963F3F973E3E943A3A8B36368234347C34347B3636803A3A8B + 3F3F977575B9FFFFFFFFFFFFFBFBFBEEEEEE5A5A8127275C2C2C6835357F4040 + 984747AA4C4CB64F4FBD4F4FBD5050BE5050C05151C15252C35353C55353C602 + 00000200005353C65353C65353C65353C65353C65353C65353C65353C69898DD + A3A3E15353C55252C45151C25050BE4D4DB74949AF4444A23E3E943737846767 + 99FFFFFFFFFFFFFFFFFFFEFEFEC5C5D5C8C8D9FFFFFFFEFEFEF9F9F9F3F3F39D + 9DB225255927275D2D2D6B35357E3B3B8D3E3E953E3E953C3C8E373782313174 + 2D2D6B2C2C6A2F2F6F34347B3B3B8C7272B3FFFFFFFFFFFFFAFAFAECECEC5858 + 7F26265A2A2A6533337B3D3D924444A24949AD4B4BB24949AF4747A843439FB1 + B1D3FFFFFFFFFFFFFEFEFEFEFEFE8B8BA82E2E6D3838869A9ACAECECF35252AE + 4545A44040993C3C903B3B8DCBCBE1FFFFFFFFFFFFFFFFFFF5F5F59E9EB42525 + 5927275D2D2D6B35357E3B3B8D3E3E953E3E953C3C8E3737823131742D2D6B2C + 2C6A2F2F6F34347B3B3B8C7272B3FFFFFFFFFFFFFAFAFAECECEC58587F26265A + 2A2A6533337B3D3D924444A24949AD4B4BB34B4BB34C4CB44D4DB74F4FBC5151 + C15252C45353C60200000200005252C65252C65252C65252C65252C65252C652 + 52C65252C65252C65252C65252C55151C34F4FBE4C4CB64747AC42429F3B3B90 + 35357F2E2E70D3D3DFFFFFFFFFFFFFFFFFFFFFFFFF9191B5C9C9DEFFFFFFFFFF + FFFBFBFBF2F2F28484A42828612929632E2E6E35357F3B3B8E3E3E963E3E953A + 3A8D34347D2D2D6C28286127275F2A2A653030733737846F6FAEFFFFFFFFFFFF + F8F8F8EAEAEA57577D24245728286131317639398A3F3F974242A04343A24141 + 9E3E3E96474795F2F2F6FFFFFFFEFEFEFBFBFBFBFBFB4444722F2F713A3A8B5B + 5BADFDFDFD9898CE4444A33E3E95393989373784CACADEFFFFFFFFFFFFFFFFFF + F2F2F28383A32828602929632E2E6E35357F3B3B8E3E3E963E3E953A3A8D3434 + 7D2D2D6C28286127275F2A2A653030733737846F6FAEFFFFFFFFFFFFF8F8F8EA + EAEA57577D24245728286131317639398A3F3F974242A04444A34444A34444A5 + 4747AC4B4BB44D4DBB5050C15252C50200000200005252C65252C65252C65252 + C65252C65252C65252C65252C65252C65252C55151C34F4FBE4C4CB64747AB41 + 419C3A3A8C33337B2D2D6CA3A3B9FBFBFBFFFFFFFFFFFFFFFFFFFFFFFF60609E + CCCCE3FFFFFFFFFFFFFEFEFEF1F1F16161942D2D6D2C2C6B3030733535813B3B + 8E3D3D943D3D933939893232782B2B6727275D26265C2929632F2F723636836F + 6FABFFFFFFFFFFFFF7F7F7E8E8E856567B2424562828602F2F713636823A3A8D + 3C3C913C3C9139398A3636828585B0FFFFFFFFFFFFFCFCFCF8F8F8CECED82929 + 633232783C3C904444A5CECEE9E0E0ED4343A23D3D9437378434347DC9C9DCFF + FFFFFFFFFFFFFFFFF1F1F16060902C2C6A2C2C6A3030733535813B3B8E3D3D94 + 3D3D933939893232782B2B6727275D26265C2929632F2F723636836F6FABFFFF + FFFFFFFFF7F7F7E8E8E856567B2424562828602F2F713636823A3A8D3C3C913D + 3D933C3C923E3E9642429F4747AB4B4BB64F4FBE5151C40200000200005252C6 + 5252C65252C65252C65252C65252C65252C65252C65252C65151C44F4FBF4C4C + B74747AC40409B3939893232783838719F9FB5F5F5F5FCFCFCFFFFFFFFFFFFFF + FFFFCACAE03F3F999C9CD0FFFFFFFFFFFFFFFFFFF5F5F5C6C6D5B6B6C9B9B9CC + E3E3E8F4F4F4F4F4F4EFEFEFE6E6E6DDDDDDD4D4D4BBBBC3A4A4B3ABABBA2C2C + 6A3232793838886F6FAEFFFFFFFFFFFFF5F5F5E6E6E657577E26265B2929632F + 2F7234347E37378437378636368333337B303074D5D5E2FFFFFFFEFEFEF9F9F9 + F4F4F48787A52D2D6D3535813E3E974545A89292CFF8F8F88888C13D3D943737 + 8433337B9292B9FFFFFFFFFFFFFFFFFFF5F5F5C5C5D3B6B6C9B9B9CCE3E3E8F4 + F4F4F4F4F4EFEFEFE6E6E6DDDDDDD4D4D4BBBBC3A4A4B3ABABBA2C2C6A323279 + 3838886F6FAEFFFFFFFFFFFFF5F5F5E6E6E657577E26265B2929632F2F723434 + 7E3737843838863737863737843939893E3E954444A44949B14E4EBC5151C302 + 00000200005252C65252C65252C65252C65252C65252C65252C65252C65252C5 + 5050C14D4DBA4848AF41419E3A3A8B323278515181C4C4CFF2F2F2FAFAFAFFFF + FFFFFFFFFFFFFFF2F2F75A5AA94646A98787CDFFFFFFFFFFFFFFFFFFFDFDFDCD + CDDF9A9AC08F8FB99393BD9696C29898C5B1B1D5EAEAEFECECECE2E2E2DBDBDB + D8D8D8C6C6CF33337B3838863C3C917171B1FFFFFFFFFFFFF4F4F4E5E5E55959 + 852A2A662D2D6D32327835358036368235358033337B30307456568AFCFCFCFE + FEFEFBFBFBF5F5F5EFEFEF3A3A7632327939398A40409B4646AA5555B5F9F9F9 + D8D8E53E3E9638388735357F7878AAFFFFFFFFFFFFFFFFFFFCFCFCCCCCDC9999 + BE8F8FB89393BD9696C29898C5B1B1D5EAEAEFECECECE2E2E2DBDBDBD8D8D8C6 + C6CF33337B3838863C3C917171B1FFFFFFFFFFFFF4F4F4E5E5E55959852A2A66 + 2D2D6D32327835358036368235358134347F34347D3636823B3B904242A04848 + AF4D4DBA5151C30200000200005252C65252C65252C65252C65252C65252C652 + 52C65252C65151C44F4FBE4B4BB44444A53C3C9033337B77779CDEDEE1F1F1F1 + F9F9F9FFFFFFFFFFFFFFFFFFF2F2F86868B24747AC4B4BB54D4DBBE8E8F6FFFF + FFFFFFFFFFFFFF9898CC41419E3E3E963D3D933D3D943E3E973E3E97CBCBE2F8 + F8F8F0F0F0E9E9E9E4E4E4A0A0BF3B3B8D3E3E9741419E9A9ACBFFFFFFFFFFFF + F6F6F6E8E8E85F5F9232327834347D38388639398A8888B37C7CAB35357F3232 + 78A9A9C4FEFEFEFFFFFFFCFCFCF5F5F5B0B0C835358139398A3E3E974444A448 + 48AE4A4AB3CECEE9F3F3F39292C43C3C923A3A8B39398AE5E5F0FFFFFFFFFFFF + FFFFFF9696C73F3F993D3D943D3D933D3D943E3E973E3E97CBCBE2F8F8F8F0F0 + F0E9E9E9E4E4E4A0A0BF3B3B8D3E3E9741419E9A9ACBFFFFFFFFFFFFF6F6F6E8 + E8E85F5F9232327834347D38388639398A8787B27A7AA936368235357F373784 + 3C3C904242A04848AF4D4DBA5151C30200000200005252C65252C65252C65252 + C65252C65252C65252C65252C65151C34D4DBB4848AE40409B43438BABABC1EC + ECECF2F2F2FAFAFAFFFFFFFFFFFFFFFFFFF2F2F86969B54848AD4B4BB54D4DBA + 4E4EBC8A8AD4FFFFFFFFFFFFFFFFFFC3C3E64747AC4545A64343A242429F4141 + 9E41419DF2F2F8FFFFFFFFFFFFF8F8F8F2F2F27B7BB74242A04545A74747AC9C + 9CD2FFFFFFFFFFFFFEFEFEF0F0F0C5C5D54646933C3C913E3E973F3F999898C1 + D0D0DC3B3B8D515195FFFFFFFFFFFFFFFFFFFFFFFFFAFAFA8585BA3F3F984141 + 9E4545A64848AE4B4BB64D4DB9CFCFECFBFBFBF5F5F56767B341419E41419C81 + 81BFFFFFFFFFFFFFFFFFFFC1C1E34646A94444A54343A242429F41419E41419D + F2F2F8FFFFFFFFFFFFF8F8F8F2F2F27B7BB74242A04545A74747AC9C9CD2FFFF + FFFFFFFFFEFEFEF0F0F0C5C5D54646933C3C913E3E973F3F999595BEC8C8D33B + 3B8F3A3A8D3B3B9040409A4545A74A4AB34E4EBD5151C30200000200005151C5 + 5151C55151C55151C55151C55151C55151C55151C54F4FC04B4BB64545A86060 + A5C8C8D6EFEFEFF5F5F5FBFBFBFFFFFFFFFFFFFFFFFFD8D8EA5D5DB24848AF4A + 4AB54B4BB74C4CB84C4CB84D4DBAB8B8E5FFFFFFFFFFFFFFFFFF6363C04949B2 + 4747AE4646AB4646A97777BEFFFFFFFFFFFFFFFFFFFFFFFFCDCDE74646AA4848 + AF4A4AB44A4AB5DBDBF0FFFFFFFFFFFFFFFFFFFEFEFED1D1E4E7E7EE8989C35C + 5CB17E7EC0E6E6EDF2F2F29696C8D9D9EBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + 6969B74646AA4747AD4949B24B4BB64D4DBB4D4DBCDBDBF1FFFFFFFFFFFFF2F2 + F96C6CBD4646AB4747ADB6B6DFFFFFFFFFFFFFFFFFFF6262BF4949B24747AE46 + 46AB4646A97777BEFFFFFFFFFFFFFFFFFFFFFFFFCDCDE74646AA4848AF4A4AB4 + 4A4AB5DBDBF0FFFFFFFFFFFFFFFFFFFEFEFED1D1E4E7E7EE8989C35C5CB17D7D + BFDEDEE5E4E4E48181BA40409D4242A04444A64848AF4C4CB84E4EBF5050C302 + 00000200005151C55151C55151C55151C55151C55151C55151C55151C44F4FC0 + 4A4AB46767B4E6E6EBF3F3F3F7F7F7FEFEFEFFFFFFFFFFFFFFFFFFA4A4CE5151 + AD4A4AB34B4BB74B4BB74A4AB54949B24848B04A4AB34C4CB8ACACE0FFFFFFFF + FFFFDCDCF25959C04C4CB94B4BB65656B9DBDBF0FFFFFFFFFFFFFFFFFFF3F3FA + 5656B96363C1A0A0DAA0A0DBC4C4E8FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5252 + AFCECEE9FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFC3C3E79E9ED74C4CB94D4DBB4E4EBD7E7ED1C4C4EAFFFFFF + FFFFFFFFFFFFFFFFFFF3F3FAABABDE4C4CB94D4DBBACACE0FFFFFFFFFFFFDCDC + F25959C04C4CB94B4BB65656B9DBDBF0FFFFFFFFFFFFFFFFFFF3F3FA5656B963 + 63C1A0A0DBA1A1DCC4C4E9FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5555B7CECEEA + FFFFFFFFFFFFFEFEFEF9F9F9F1F1F1E1E1E85252B14848AF4949B24C4CB94E4E + BD4F4FC15151C40200000200005151C55151C55151C55151C55151C55151C551 + 51C55151C44E4EBF5656B9E1E1EDF8F8F8FBFBFBFEFEFEFFFFFFFFFFFFF1F1F6 + 7B7BB24242A14949B14C4CB94C4CB94A4AB44747AE4545A84444A54646AA4949 + B24C4CB97D7DD0DCDCF3FFFFFFE8E8F7ADADE2A1A1DCE7E7F6FFFFFFFFFFFFFF + FFFFC4C4E85959C04E4EBD7171CAD0D0EDD0D0EDDBDBF1FFFFFFFFFFFFFFFFFF + FFFFFFFFFFFF4646AA4747AC9D9DD4FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFD0D0EDD0D0EDD0D0EDD0D0EED0D0EED0D0EED0D0EE5050C25050C25050C396 + 96DBD0D0EFD0D0EFD0D0EFD0D0EFD0D0EFD0D0EFD0D0EE5050C25050C25050C3 + 7F7FD3DCDCF3FFFFFFE8E8F7ADADE2A1A1DCE7E7F6FFFFFFFFFFFFFFFFFFC4C4 + E85A5AC14E4EBE7272CDD0D0EFD0D0EFDCDCF3FFFFFFFFFFFFFFFFFFFFFFFFFF + FFFF4E4EBD4E4EBDA1A1DCFFFFFFFFFFFFFFFFFFFFFFFFFAFAFA9B9BD64D4DBB + 4E4EBD4F4FC05050C25050C35151C40200000200005151C55151C55151C55151 + C55151C55151C55151C55151C44F4FC09E9ED7FFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFD5D5E14D4D8B3B3B904343A44949B24B4BB74949B24646AB4343A240409B + 3F3F9A4242A14747AC4A4AB54E4EBE5151C47474D1A2A2E0C5C5EBD1D1EFD0D0 + EFC5C5EBA2A2DE6767CA5050C24F4FC14F4FC04E4EBD4C4CB94A4AB44848AF46 + 46AB5050AC7575BC9B9BCED9D9EC4343A44444A64646AB6060BAB7B7E2F3F3FA + F3F3FBA1A1DE5050C25050C25050C35151C45151C45151C55151C55151C55151 + C55151C55151C55151C55151C55151C55151C55151C55151C55151C55151C551 + 51C55151C55151C55151C55151C57474D1A2A2E0C5C5EBD1D1EFD0D0EFC5C5EB + A2A2DE6767CA5050C25050C35151C45151C45151C55151C55151C55151C55D5D + C97F7FD4A2A2E0DCDCF35151C45151C45151C46868CCB9B9E7F3F3FBF3F3FBA2 + A2DF5050C25050C25050C35151C45151C45151C55151C50200000200005151C5 + 5151C55151C55151C55151C55151C55151C55151C54F4FC0F3F3FAFFFFFFFFFF + FFFFFFFFFFFFFFAAAAC32C2C6C33337C3B3B8F41419F4646AB4848AF4545A841 + 419F3E3E963B3B903B3B9040409B4545A74A4AB34E4EBD5151C45151C55151C5 + 5151C55151C55151C55151C55151C55151C45050C34F4FC04D4DBB4A4AB44747 + AD4444A641419F3F3F9A3E3E973E3E963E3E963E3E963E3E973F3F9941419E44 + 44A54747AD4B4BB64E4EBD5050C25151C45151C55151C55151C55151C55151C5 + 5151C55151C55151C55151C55151C55151C55151C55151C55151C55151C55151 + C55151C55151C55151C55151C55151C55151C55151C55151C55151C55151C551 + 51C55151C55151C55151C55151C55151C55151C55151C55151C55151C55151C5 + 5151C55151C55151C55151C55151C55151C55151C55151C55151C55151C55151 + C55151C55151C55151C55151C55151C55151C55151C55151C55151C55151C502 + 00000200005151C55151C55151C55151C55151C55151C55151C55151C57373CE + FFFFFFFFFFFFFFFFFFFFFFFFD4D4E33D3D7B2F2F7233337D3A3A8D3F3F9A4343 + A34444A541419E6C6CAD52529A38388839398B3E3E974444A64949B24E4EBD50 + 50C35151C45151C45050C35050C35151C45151C45050C34F4FC14E4EBD4C4CB8 + 4848AF4444A640409D3D3D943A3A8D39398A38388839398A39398A39398B3939 + 8B39398C3B3B8F3E3E964242A04747AC4B4BB64E4EBF5050C35151C55151C551 + 51C55151C55151C55151C55151C55151C55151C55151C55151C55151C55151C5 + 5151C55151C55151C55151C55151C55151C55151C55151C55151C55151C55151 + C55151C55151C55151C55151C55151C55151C55151C55151C55151C55151C551 + 51C55151C55151C55151C55151C55151C55151C55151C55151C55151C55151C5 + 5151C55151C55151C55151C55151C55151C55151C55151C55151C55151C55151 + C55151C55151C50200000200005050C55050C55050C55050C55050C55050C550 + 50C55050C57E7ED3FFFFFFFFFFFFFFFFFFFDFDFD7676AC33337E32327C343481 + 38388A3C3C943F3F9B3F3F9B5555A2E9E9E97D7DAE37378639398C3E3E994444 + A84949B44D4DBD4F4FC24F4FC24E4EC04E4EC04D4DBF4E4EC04E4EC04D4DBE4C + 4CBB4949B54646AC4242A13D3D9639398C35358334347F34347F353583373788 + 38388A38388B37378836368636368638388B3D3D964343A44848B24D4DBD4F4F + C25050C55050C55050C55050C55050C55050C55050C55050C55050C55050C550 + 50C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050C5 + 5050C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050 + C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050C550 + 50C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050C5 + 5050C55050C55050C55050C55050C50200000200005050C55050C55050C55050 + C55050C55050C55050C55050C57F7FD4FFFFFFFFFFFFFFFFFFFBFBFB3E3E9839 + 398D37378837378839398C3B3B913C3C943D3D958282B6E9E9E96666A338388B + 3B3B9141419F4646AC4A4AB74D4DBE4E4EC04D4DBF4C4CBB4B4BB94A4AB64A4A + B64A4AB64949B44747AF4444A840409D3B3B9137378733337F32327B32327B34 + 34803737873A3A8F3C3C943C3C9339398D3737883535833737863B3B9141419F + 4747AE4C4CBA4F4FC25050C55050C55050C55050C55050C55050C55050C55050 + C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050C550 + 50C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050C5 + 5050C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050 + C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050C550 + 50C55050C55050C55050C55050C55050C55050C55050C50200000200005050C5 + 5050C55050C55050C55050C55050C55050C55050C55050C5F3F3FBFFFFFFFFFF + FFFFFFFF4F4FAD41419F3E3E983D3D963D3D963D3D973E3E983E3E98C1C1D9EC + ECEC6A6AAB3D3D9740409E4444A84848B24C4CBB4E4EC04E4EC04C4CBB4A4AB6 + 4848B14646AD4646AD4646AC4444A84343A43F3F9B3B3B9137378633337F3232 + 7A3E3E8263639B8A8AB58C8CBA8D8DBE7777B640409D3D3D963A3A8E37378738 + 38893B3B9141419F4646AD4B4BB94F4FC25050C55050C55050C55050C55050C5 + 5050C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050 + C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050C550 + 50C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050C5 + 5050C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050 + C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050C502 + 00000200005050C55050C55050C55050C55050C55050C55050C55050C55050C5 + A2A2E0FFFFFFFFFFFFFFFFFF9A9AD34646AD4444A74242A34242A14242A14242 + A17F7FBFF7F7F7F2F2F27070B74343A64545AB4848B24B4BB94D4DBF4E4EC04D + 4DBD4B4BB94848B24545AB4343A54343A44242A140409E3E3E983B3B90373787 + 3434807B7BA6B8B8CBEBEBEBEFEFEFF3F3F3F4F4F4F1F1F1EBEBEBD9D9E08080 + B93E3E983B3B913B3B913E3E984343A44848B04C4CBB4F4FC25050C55050C550 + 50C55050C55050C55050C45050C45050C44F4FC34F4FC34F4FC34F4FC34F4FC3 + 5050C45050C45050C55050C55050C55050C55050C55050C55050C55050C55050 + C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050C550 + 50C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050C5 + 5050C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050 + C55050C55050C50200000200005050C55050C55050C55050C55050C55050C550 + 50C55050C55050C55C5CC8DCDCF3FFFFFFFFFFFFFFFFFF9999D14646AC4444A8 + 4343A64343A58E8EC9F3F3F9FFFFFFFBFBFB7676C14848B24A4AB64C4CBB4D4D + BF4F4FC24E4EC14D4DBD4A4AB64747AF4343A641419F3F3F9B3D3D973B3B9239 + 398D36368665659DD4D4DEF0F0F0F4F4F4F9F9F9FFFFFFB3B3DA7777C38686CE + DADAF0F3F3F3E9E9E97878BA41419F40409E4242A14444A84848B24B4BB94D4D + BE4E4EC04E4EC04E4EC04E4EC04E4EC04D4DBF4D4DBD4D4DBD4C4CBC4C4CBB4C + 4CBB4C4CBC4D4DBD4D4DBF4E4EC14F4FC35050C45050C55050C55050C55050C5 + 5050C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050 + C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050C550 + 50C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050C5 + 5050C55050C55050C55050C55050C50200000200005050C55050C55050C55050 + C55050C55050C55050C55050C55050C55050C44F4FC2A0A0DCFFFFFFFFFFFFFF + FFFFF2F2F8CBCBE6CDCDE7F2F2F9FFFFFFFFFFFFFFFFFFFFFFFF7979C74A4AB7 + 4C4CBB4E4EC04F4FC24F4FC34F4FC34D4DBE4B4BB84747AF4343A53F3F9C3D3D + 953A3A8E37378842428AA6A6C4F5F5F5F9F9F9FDFDFDFFFFFFD8D8E95959AA44 + 44A84848B24B4BB95858C0FFFFFFF6F6F6E3E3EA4545AB4444A84444A84646AC + 4747AF4848B24949B54A4AB64A4AB64A4AB64A4AB64949B44949B44848B24848 + B24848B04747AF4747AF4747AF4848B24A4AB64B4BB94D4DBE4E4EC15050C450 + 50C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050C5 + 5050C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050 + C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050C550 + 50C55050C55050C55050C55050C55050C55050C55050C50200000200005050C4 + 5050C45050C45050C45050C45050C45050C45050C45050C34F4FC14D4DBC4A4A + B65454B48F8FCBA7A7D4CCCCE5CCCCE5CCCCE5C0C0DF9A9ACD9B9BCE8F8FCA77 + 77C15454B44A4AB54C4CBA4E4EBF4F4FC15050C34F4FC24E4EBF8383CB4848B1 + 4444A63F3F9B3C3C9338388A5C5C9ADEDEE8FCFCFCFFFFFFFFFFFFFFFFFF9595 + C13C3C933F3F9A4343A34646AB4848B14A4AB5FFFFFFFFFFFFFAFAFA7777C448 + 48AF4646AC4545AA4545A84444A84444A74444A64343A54343A54343A54343A5 + 4444A64343A54343A54343A44242A24242A14242A14343A44545A84747AE4A4A + B64D4DBC4F4FC15050C35050C45050C45050C45050C45050C45050C45050C450 + 50C45050C45050C45050C45050C45050C45050C45050C45050C45050C45050C4 + 5050C45050C45050C45050C45050C45050C45050C45050C45050C45050C45050 + C45050C45050C45050C45050C45050C45050C45050C45050C45050C45050C402 + 00000200004F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44E4EC2 + 4C4CBD4949B64646AD4141A23E3E993B3B933A3A903A3A903B3B933C3C953D3D + 973E3E9A3F3F9C4040A04343A54545AB4848B24A4AB84D4DBE4E4EC14E4EC1AA + AADFBCBCE14747AF4242A43D3D9839398D8282B1EBEBF0FCFCFCFFFFFFFFFFFF + C9C9DD5E5E9D37378A39398E3B3B933D3D9740409E4242A45E5EB6FFFFFFFFFF + FFCFCFEC6D6DC54848B34646AE4343A74040A03E3E9A3C3C953B3B923B3B913B + 3B923B3B933C3C953D3D973E3E993E3E9A3D3D983C3C963B3B943B3B933C3C95 + 3E3E9A4242A34646AE4A4AB74D4DBE4E4EC24F4FC44F4FC44F4FC44F4FC44F4F + C44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F + 4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC4 + 4F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4F + C44F4FC44F4FC40200000200004F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F + 4FC44F4FC34D4DC04B4BB94646AE4141A13B3B93373789353583343482353584 + 37378938388C39398E3A3A8F3A3A8F3A3A913C3C953F3F9C4343A54646AE4A4A + B74C4CBC7C7CD0FFFFFFFCFCFC9898CE40409E52529EB3B3CEF6F6F6FBFBFBFE + FEFEC8C8DB6969A034348236368537378737378737378737378939398D3B3B93 + 9999CACDCDE77777C44949B54949B64848B34545AB4040A03C3C943737893333 + 8031317A31317931317933337E35358337378A39398D3A3A913A3A9139398E38 + 388A37378837378939398D3D3D974242A44747B04B4BBA4E4EC14F4FC34F4FC4 + 4F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4F + C44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F + 4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC4 + 4F4FC44F4FC44F4FC44F4FC44F4FC40200000200004F4FC44F4FC44F4FC44F4F + C44F4FC44F4FC44F4FC44F4FC34D4DBE4949B54444A83D3D9737378833337E32 + 327C32327D35358338388A3A3A8F3A3A9039398D37378936368636368638388B + 3C3C954141A14545AC4949B54A4AB89292D3E6E6F4FFFFFFFBFBFBF8F8F8F9F9 + F9E0E0E9ABABC768689D33337F36368538388A39398D38388C37378735358333 + 337E33337E3434814444923C3C954141A24545AC4848B24747B14444AA3F3F9C + 39398D32327D2D2D6F2A2A672929652A2A682D2D6F31317A36368539398D3B3B + 933C3C943B3B9238388C3737873636853737873A3A8F3F3F9C4444AA4949B54D + 4DBF4F4FC34F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC4 + 4F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4F + C44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F + 4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC40200000200004F4FC4 + 4F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44E4EC24C4CBC4747B14141A23A3A + 9135358332327C32327C35358338388C3C3C953E3E9A3E3E993B3B9338388A34 + 348132327B32327C3535843B3B914040A04545AB4646AE4545AB4040A05555A0 + 6B6BA467679B3C3C7B2E2E7330307834348038388A3B3B933D3D983E3E9A3D3D + 973A3A9036368732327D3030762F2F743131793535833B3B9140409F4444AA46 + 46AE4444A93F3F9D38388C30307829296625255B24245825255D2A2A69313179 + 3737893C3C943F3F9C40409F3F3F9D3C3C963A3A8F38388A37378939398D3E3E + 994343A74848B34C4CBC4E4EC24F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F + 4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC4 + 4F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4F + C44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC402 + 00000200004F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44E4EC24B4BBA + 4646AE40409F6868A68787B08686AF8888B28C8CB87777B36363B04343A74242 + A43F3F9B39398E3434802F2F742D2D702F2F763434823A3A9140409E4141A13F + 3F9C3A3A8F3333802E2E732B2B6B3939756565979191B99393C09696C69595C9 + 7171B94E4EAA4242A33F3F9B3A3A903434822F2F752C2C6D2B2B6C2E2E733333 + 803A3A9040409F4444A84444A840409E39398D30307727276222225521215123 + 235850508063639A7676AE9191C39191C79090C78D8DC36060AE3E3E9A3B3B94 + 3A3A903A3A913E3E9A4343A64848B24C4CBC4E4EC24F4FC44F4FC44F4FC44F4F + C44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F + 4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC4 + 4F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4F + C44F4FC44F4FC40200000200004F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F + 4FC44E4EC14B4BB98B8BCAE3E3EAECECECECECECEFEFEFF2F2F2F5F5F5F5F5F5 + F2F2F2E1E1E8A5A5CE5757AC3C3C943434812D2D702A2A682A2A692F2F743535 + 833A3A8F3B3B9138388A32327D2D2D6F7C7CA0C1C1D1FBFBFBFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFF8F8F8EFEFEFC6C6DB8181BD3F3F9C38388C32327B2B2B6C + 2828642929652D2D6F6969A2FFFFFFF8F8F8D7D7E4B8B8D1AFAFC6A9A9BCA5A5 + B5B3B3BDDDDDDDE6E6E6EFEFEFF7F7F7FCFCFCFEFEFEFBFBFBF5F5F5EEEEEEE6 + E6E68D8DC34141A13E3E9A3E3E9940409E4444A94848B34C4CBC4E4EC24F4FC4 + 4F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4F + C44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F + 4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC4 + 4F4FC44F4FC44F4FC44F4FC44F4FC40200000200004E4EC44E4EC44E4EC44E4E + C44E4EC44E4EC44E4EC44D4DC16262C3FDFDFDFAFAFAFAFAFAFBFBFBF1F1F7B2 + B2D89B9BD19D9DD6C3C3E9FEFEFEF2F2F2E5E5E59191BC3F3F882B2B6D272762 + 2727612A2A692E2E753333803434823030796F6F9BDADAE1F9F9F9FEFEFEFFFF + FFFFFFFFD8D8EAA7A7D69D9DD6B7B7E3F3F3FBFFFFFFF7F7F7E9E9E9C8C8D56F + 6FAD3535852D2D7127276225255D272762494984A1A1C6D8D8EBFEFEFEF3F3F3 + E7E7E7E0E0E0DEDEDEE0E0E0E9E9E9D8D8E0B8B8CE9494C19999CD9C9CD5ABAB + E0E7E7F7FFFFFFF6F6F6E1E1E84545AE4343A84141A44242A74545AE4848B54B + 4BBC4D4DC24E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC4 + 4E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4E + C44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E + 4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC40200000200004E4EC4 + 4E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44D4DC29E9EDBFFFFFFFFFFFFFFFF + FF9999CB4E4EA94444AA4747B34B4BBC4D4DC17070CDF3F3FAF2F2F2E2E2E2B6 + B6C635357025255D24245B2626602B2B6B2E2E742E2E739393B1F0F0F0F4F4F4 + F9F9F9FFFFFFD6D6E56F6FAE4242A54747B34B4BBC4D4DC14E4EC3A1A1DFFFFF + FFFCFCFCEBEBEBDBDBDB9494B730307928286423235923235928286530307939 + 398ECCCCE5FFFFFFF5F5F5ECECECE8E8E8E8E8E89D9DB125255E2E2E7339398E + 4141A44848B54C4CBF4E4EC4A1A1DFFFFFFFF9F9F97575C74747B34646AF4646 + B04848B54A4ABA4C4CBF4D4DC24E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E + 4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC4 + 4E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4E + C44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC402 + 00000200004E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44D4DC29F9FDC + FFFFFFFFFFFF8F8FCD4444AA4545AE4848B44A4AB94C4CBF4D4DC14B4BBC7878 + C7FEFEFEECECECDDDDDDA6A6B623235923235724245B2828652B2B6B9F9FB7EF + EFEFF1F1F1F5F5F5FBFBFBABABC53636873E3E9D4545AE4A4ABB4D4DC14E4EC3 + 4E4EC44E4EC49595DBFFFFFFFEFEFEE9E9E9D9D9D99191B02A2A692323582222 + 5524245B2B2B6D3434839696C6FFFFFFFFFFFFF6F6F6EFEFEFECECEC30306026 + 265F2E2E733939904242A54848B54C4CC04E4EC44E4EC4C4C4EBFFFFFF9D9DD9 + 4A4ABA4949B84949B84A4ABB4C4CBE4D4DC14E4EC34E4EC44E4EC44E4EC44E4E + C44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E + 4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC4 + 4E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4E + C44E4EC44E4EC40200000200004E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E + 4EC44E4EC3B7B7E6FFFFFFCECEEC4848B54848B54949B74A4ABA4B4BBC4C4CBF + 4B4BBC4848B54343A8E5E5F1F5F5F5E5E5E5D9D9D96A6A8822225624245B2727 + 629E9EB7F0F0F0F2F2F2F5F5F5F9F9F9A8A8C03030783A3A914242A54848B54C + 4CBF4E4EC34E4EC44E4EC44E4EC44E4EC4A1A1DFFFFFFFFBFBFBE6E6E6D6D6D6 + 8383A224245A20205122225528286431317A6D6DABFFFFFFFFFFFFFEFEFEF5F5 + F5B8B8C622225626265F2E2E743939904242A54848B54C4CC04E4EC44E4EC45A + 5AC7F3F3FBD0D0EE4C4CBF4C4CBF4C4CBE4C4CBF4D4DC14D4DC24E4EC34E4EC4 + 4E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4E + C44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E + 4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC4 + 4E4EC44E4EC44E4EC44E4EC44E4EC40200000200004E4EC44E4EC44E4EC44E4E + C44E4EC44E4EC44E4EC44E4EC3D0D0EFFFFFFF8888D44B4BBC4B4BBC4B4BBC4B + 4BBD4B4BBC4A4ABA4747B34343A83D3D99C9C9DFFBFBFBECECECE0E0E09090A5 + 23235826265F696992F0F0F0F4F4F4F6F6F6F8F8F8DEDEE53737703333803D3D + 984545AC4A4ABA4D4DC24E4EC44E4EC44E4EC44E4EC44E4EC44E4EC4E7E7F6FF + FFFFF4F4F4E0E0E0D3D3D352527A20205020205125255E2E2E736C6CA7FFFFFF + FFFFFFFFFFFFF5F5F5B6B6C522225626265F2E2E743939904242A54848B54C4C + C04E4EC44E4EC44E4EC4B8B8E7FFFFFF4D4DC24D4DC24D4DC24D4DC24E4EC34E + 4EC34E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC4 + 4E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4E + C44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E + 4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC40200000200004E4EC3 + 4E4EC34E4EC34E4EC34E4EC34E4EC34E4EC34E4EC3D0D0EFFFFFFF4D4DC14D4D + C04C4CBE4C4CBE4B4BBB4949B74646AF4242A43C3C97363686E3E3ECFDFDFDF2 + F2F2E9E9E9B0B0BE26265F36366FE3E3E7F4F4F4F7F7F7F8F8F8F8F8F8797999 + 2B2B6A3535853F3F9D4646AF4B4BBB4E4EC24E4EC34E4EC34E4EC34E4EC34E4E + C34E4EC3A0A0DDFFFFFFFFFFFFECECECDADADAAFAFBA2020501F1F4E2323592B + 2B6D6969A2FFFFFFFFFFFFFFFFFFF2F2F2B3B3C122225626265F2E2E7339398F + 4242A44848B44C4CBF4E4EC34E4EC34E4EC35A5AC77D7DD34E4EC34E4EC35858 + C69999DC8383D55656C64E4EC34E4EC34E4EC34E4EC34E4EC34E4EC35F5FC97A + 7AD26565CB4E4EC34E4EC34E4EC34E4EC34E4EC34E4EC34E4EC34E4EC34E4EC3 + 4E4EC34E4EC34E4EC34E4EC34E4EC34E4EC34E4EC34E4EC34E4EC34E4EC34E4E + C34E4EC34E4EC34E4EC34E4EC34E4EC34E4EC34E4EC34E4EC34E4EC34E4EC302 + 00000200004D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC39494DB + A0A0DF4D4DC24C4CC14B4BBF4A4ABB4747B44444AC3F3FA03A3A923333826565 + 98FFFFFFFEFEFEF8F8F8F2F2F2B8B8C82A2A6A8989AEF6F6F6F8F8F8F8F8F8F7 + F7F7D8D8DF2323592B2B6D3636893F3FA14646B24B4BBE4D4DC34D4DC34D4DC3 + 4D4DC34D4DC34D4DC34D4DC36464C8FFFFFFFFFFFFF6F6F6E3E3E3D5D5D55050 + 741E1E4D2222562929696969A0FFFFFFFFFFFFFEFEFEEFEFEFB0B0BE22225625 + 255F2E2E7338388F4141A44747B44B4BBF4D4DC34D4DC34D4DC34D4DC34D4DC3 + 4D4DC34D4DC35757C79A9ADD9B9BDD8F8FD95D5DC84E4EC34D4DC34D4DC34D4D + C34D4DC35E5EC97979D27878D26B6BCD4F4FC44D4DC34D4DC34D4DC34D4DC34D + 4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC3 + 4D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4D + C34D4DC34D4DC30200000200004D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D + 4DC34D4DC34D4DC34D4DC34D4DC24C4CC04A4ABB4747B44343A93E3E9D38388D + 32327D2B2B6ED3D3DFFFFFFFFEFEFEFCFCFCF9F9F98B8BAF303079E2E2ECFBFB + FBFAFAFAF8F8F8F3F3F381819B24245A2C2C7037378C4040A24747B34B4BBE4D + 4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34C4CC0F3F3FAFFFFFFFEFEFE + EBEBEBDBDBDB8E8EA21E1E4C21215428286668689EFFFFFFFFFFFFFCFCFCEFEF + EFB0B0BE22225625255F2E2E7338388F4141A44747B44B4BBF4D4DC34D4DC34D + 4DC34D4DC34D4DC34D4DC34D4DC35757C79B9BDD8E8ED99D9DDE9A9ADD7272CF + 5252C54D4DC34D4DC34D4DC35F5FC97A7AD27373D07A7AD27373D05A5AC74E4E + C34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D + 4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC3 + 4D4DC34D4DC34D4DC34D4DC34D4DC30200000200004D4DC34D4DC34D4DC34D4D + C34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC24C4CC04A4ABB4747B44242A83D + 3D9A36368A3030792A2A6AA2A2B9FBFBFBFEFEFEFFFFFFFFFFFFFFFFFF5C5C9B + 5E5EA1FFFFFFFFFFFFFBFBFBF6F6F6EFEFEF48486F24245B2C2C7038388D4040 + A34747B44B4BBE4D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34C4CC0CE + CEECFFFFFFFFFFFFF2F2F2E2E2E2C3C3C91E1E4C22225529296768689FFFFFFF + FFFFFFFCFCFCEEEEEEAFAFBD22225625255F2E2E7338388F4141A44747B44B4B + BF4D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC35858C79C9CDE7878D265 + 65CB9494DB9E9EDE8383D55A5AC74D4DC34D4DC36060C97979D26161CA6060C9 + 7B7BD37878D16565CB4E4EC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4D + C34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D + 4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC30200000200004D4DC3 + 4D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34C4CC14A4ABC4747 + B44343A93C3C993535872F2F7735356F9E9EB4F5F5F5FCFCFCFFFFFFFFFFFFFF + FFFFC9C9DF3B3B949797C9FFFFFFFFFFFFFCFCFCF4F4F4ECECEC1F1F5024245A + 2C2C7037378C4040A34747B44B4BBE4D4DC34D4DC34D4DC34D4DC34D4DC34D4D + C34D4DC34C4CC0AAAADDFFFFFFFFFFFFF7F7F7E7E7E7E0E0E02B2B5722225629 + 29696969A0FFFFFFFFFFFFFCFCFCEEEEEEAFAFBD22225625255F2E2E7338388F + 4141A44747B44B4BBF4D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC35858 + C79C9CDE7474D04E4EC35B5BC88585D6A0A0DF9191DA6363CA4D4DC36161CA79 + 79D25B5BC84D4DC35C5CC87373D07C7CD36D6DCE5353C54D4DC34D4DC34D4DC3 + 4D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4D + C34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC302 + 00000200004D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC2 + 4B4BBE4848B84444AC3D3D9B3636892F2F764F4F80C4C4CFF2F2F2FAFAFAFFFF + FFFFFFFFFFFFFFF2F2F75757A74141A4A7A7D6FFFFFFFFFFFFFBFBFBF1F1F1BF + BFC92020502323592B2B6E37378A4040A14646B24B4BBE4D4DC34D4DC34D4DC3 + 4D4DC34D4DC34D4DC34D4DC34B4BBE9D9DD7FFFFFFFFFFFFFAFAFAECECECE3E3 + E35555772323592B2B6D6969A3FFFFFFFFFFFFFCFCFCEEEEEEAFAFBD22225625 + 255F2E2E7338388F4141A44747B44B4BBF4D4DC34D4DC34D4DC34D4DC34D4DC3 + 4D4DC34D4DC35858C79C9CDE7575D14F4FC44D4DC35656C67676D19B9BDD9A9A + DD7373D06666CC7979D25C5CC84D4DC34E4EC35757C66A6ACD7C7CD37474D05D + 5DC84E4EC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC3 + 4D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4D + C34D4DC34D4DC30200000200004D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D + 4DC34D4DC34C4CC14A4ABB4646B14040A238388E30307975759BDEDEE1F1F1F1 + F9F9F9FFFFFFFFFFFFFFFFFFF2F2F76565B14343A94545B0CDCDE9FFFFFFFFFF + FFFBFBFBEEEEEEB0B0BE2020512323592A2A6B3535873F3F9E4545B04A4ABC4D + 4DC24D4DC34D4DC34D4DC34D4DC34D4DC34D4DC24B4BBD9C9CD5FFFFFFFFFFFF + FCFCFCEFEFEFE6E6E656567A25255D2E2E736B6BA7FFFFFFFFFFFFFCFCFCEEEE + EEAFAFBD22225625255F2E2E7338388F4141A44747B44B4BBF4D4DC34D4DC34D + 4DC34D4DC34D4DC34D4DC34D4DC35858C79D9DDE7575D14F4FC44D4DC34D4DC3 + 4E4EC36868CC9595DBA3A3E09292DA8585D65C5CC84D4DC34D4DC34D4DC35050 + C46363CB7B7BD37A7AD26767CC5252C54D4DC34D4DC34D4DC34D4DC34D4DC34D + 4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC3 + 4D4DC34D4DC34D4DC34D4DC34D4DC30200000200004C4CC34C4CC34C4CC34C4C + C34C4CC34C4CC34C4CC34C4CC34B4BC04848B84343AB3C3C993F3F89AAAAC0EC + ECECF2F2F2FAFAFAFFFFFFFFFFFFFFFFFFF2F2F86565B44242AB4545B24747B5 + CDCDEAFFFFFFFFFFFFFBFBFBECECECAEAEBD2020532222572929683333823C3C + 9A4444AE4949BB4B4BC14C4CC34C4CC34C4CC34C4CC34C4CC34B4BC14848BA9B + 9BD4FFFFFFFFFFFFFDFDFDF1F1F1EAEAEA58587D27276430307B6C6CABFFFFFF + FFFFFFFCFCFCEEEEEEAFAFBD21215625255F2D2D7338388F4040A44646B44B4B + BF4C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC35757C79D9DDE7575D14E + 4EC44C4CC34C4CC34C4CC34C4CC35E5EC98A8AD8ADADE4AEAEE47171CF4C4CC3 + 4C4CC34C4CC34C4CC34C4CC35C5CC87575D17E7ED46D6DCE5454C64C4CC34C4C + C34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C + 4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC30200000200004C4CC3 + 4C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34A4ABE4646B44141A65D5D + A4C7C7D6EFEFEFF5F5F5FBFBFBFFFFFFFFFFFFFFFFFFD8D8EA5959B04444AE46 + 46B34747B54646B4CDCDEAFFFFFFFFFFFFFBFBFBECECECAEAEBE222256222257 + 27276430307C3A3A944242A84747B74B4BC04C4CC24C4CC34C4CC34C4CC34C4C + C24A4ABE4747B59A9AD0FFFFFFFFFFFFFDFDFDF2F2F2ECECEC4C4C782B2B6D34 + 34846F6FB1FFFFFFFFFFFFFCFCFCEEEEEEAFAFBD21215625255F2D2D7338388F + 4040A44646B44B4BBF4C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC35757 + C79D9DDE7575D14E4EC44C4CC34C4CC34C4CC34C4CC34C4CC35656C68989D8B8 + B8E7A6A6E17171CF5454C64C4CC34C4CC34C4CC34C4CC35555C66C6CCE7E7ED4 + 7474D05B5BC84E4EC44C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4C + C34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC302 + 00000200004D4DC34D4DC34D4DC34D4DC34E4EC34E4EC34E4EC34E4EC24C4CBE + 4747B26464B3E6E6EBF3F3F3F7F7F7FEFEFEFFFFFFFFFFFFFFFFFFA4A4CD4F4F + AB4646B14848B54848B54747B34646B0C1C1E3FFFFFFFFFFFFFDFDFDECECECBA + BAC725255D2323592727622E2E7538388C4141A14747B14B4BBC4D4DC14E4EC3 + 4D4DC34D4DC24C4CC04949BA4646AEBFBFDFFFFFFFFFFFFFFDFDFDF3F3F3EFEF + EF2828643131793A3A8F7272B6FFFFFFFFFFFFFCFCFCEEEEEEAFAFBD22225526 + 265F2F2F743A3A904343A54A4AB54E4EC05050C45050C45050C45050C45050C4 + 5050C44E4EC35A5AC79E9EDE7676D14F4FC44D4DC34D4DC34D4DC34D4DC34D4D + C34C4CC36262CA9090DAA2A2E0A3A3E08080D45959C74D4DC34C4CC34C4CC34C + 4CC34E4EC46565CB7D7DD37B7BD36363CB5050C44C4CC34C4CC34C4CC34C4CC3 + 4C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4C + C34C4CC34C4CC30200000200005656C65757C75858C75B5BC85D5DC95D5DC95E + 5EC95E5EC85C5CC36161BDE1E1EEF8F8F8FBFBFBFEFEFEFFFFFFFFFFFFF2F2F6 + 8484B45151A65858B55858BD5858BC5656B85454B15656AEA4A4D1FFFFFFFFFF + FFFFFFFFEEEEEEDEDEDE3030692A2A602C2C643333724646895454A05E5EB366 + 66C06A6AC86969CB6464C96363C76161C36060BB5E5EAFDDDDEBFFFFFFFFFFFF + FDFDFDF5F5F5D9D9DF42427850508F5C5CA48C8CC4FFFFFFFFFFFFFCFCFCEEEE + EEB4B4BF34345B3A3A6447477B5959996767B17171C27878CE7C7CD37D7DD37D + 7DD37D7DD37E7ED47E7ED47E7ED38585D6A8A8E28585D66161CA6060CA6060CA + 6060CA6060CA6060CA5E5EC96C6CCE7878D26868CC8F8FDAA7A7E19696DC6262 + CB4F4FC44C4CC34C4CC34C4CC34C4CC35C5CC87878D28080D46E6ECE5252C54C + 4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC3 + 4C4CC34C4CC34C4CC34C4CC34C4CC30200000200006262CB6464CB6868CC6F6F + CF6F6FCF7070CF7171D07272CF7070CAB0B0DCFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFD9D9E26464935A5A9A6868B07070BE6E6EC26868BC6464B46363AD6767A8 + 8F8FBDFFFFFFFFFFFFFFFFFFF2F2F2E0E0E059598835356D33336A3B3B725A5A + 8A68689D7474B07F7FBF8787CB8A8ACE7F7FCB7A7AC87676C07777B77E7EB0FF + FFFFFFFFFFFFFFFFFDFDFDF6F6F6ACACBD66668F7777A68484B9A8A8CFFFFFFF + FFFFFFFCFCFCEEEEEEB9B9C046465E4E4E696060817777A08B8BB99A9ACDA5A5 + DAABABE1ADADE3AEAEE4AEAEE4AFAFE4B0B0E4B1B1E5B2B2E5ACACE39191DA77 + 77D17777D17777D17777D17878D27878D27979D27979D27171CF5A5AC85252C5 + 7C7CD3A4A4E0A7A7E16F6FCF5454C64D4DC34C4CC34C4CC34C4CC35454C66F6F + CF8080D47878D25858C74E4EC44C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C + 4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC30200000200005151C4 + 5151C45656C65B5BC75757C65353C45555C55555C55656C1F5F5FBFFFFFFFFFF + FFFFFFFFFFFFFFB0B0C439396F38387C3E3E8F4B4BA25858AF4F4FB04848A844 + 449F4444974C4C95454592F3F3F8FFFFFFFFFFFFFAFAFAE5E5E57676A4313177 + 2E2E6F3434725050824B4B8C4646974A4AA25B5BB06161B65353B24D4DAC4949 + A54E4E9D9797BDFFFFFFFFFFFFFFFFFFFDFDFDF8F8F86363974646914E4EA253 + 53AE8181C4FFFFFFFFFFFFFBFBFBEDEDEDB1B1BE2A2A572F2F6038387345458C + 4F4FA25858B45E5EC06161C76363C96363CA6363CA6363CA6464CA6565CA6666 + CB6464CA5858C65555C55555C55555C55555C55555C55656C55656C55757C654 + 54C54D4DC24C4CC24E4EC36767CB9D9DDEA9A9E28686D65757C64C4CC24C4CC2 + 4C4CC24C4CC24F4FC36565CB8181D47F7FD36464CA4D4DC24C4CC24C4CC24C4C + C24C4CC24C4CC24C4CC24C4CC24C4CC24C4CC24C4CC24C4CC24C4CC24C4CC202 + 00000200004C4CC24C4CC25151C45757C65151C44C4CC24C4CC24C4CC27272CD + FFFFFFFFFFFFFFFFFFFFFFFFD4D4E24A4A7F38387531317B36368A42429A4E4E + A54444A43D3D9B6D6DAE55559B42428B3B3B8A9696C6FFFFFFFFFFFFFFFFFFED + EDEDA1A1C234348631317C3434794F4F8442428637378A3A3A944C4CA25252A8 + 4444A33D3D9D3B3B9641418ECDCDDFFFFFFFFFFFFFFFFFFFFEFEFEC5C5D93737 + 8D3D3D9C4242A84444AD7474C1FFFFFFFFFFFFFAFAFAECECECAEAEBD23235B26 + 26612C2C713535873C3C9A4242AA4747B64A4ABD4B4BC04C4CC24C4CC24C4CC2 + 4C4CC24C4CC24C4CC24C4CC24C4CC24C4CC24C4CC24C4CC24C4CC24C4CC24C4C + C24C4CC24C4CC24C4CC24C4CC24C4CC24C4CC24D4DC25656C59292DAAAAAE29B + 9BDD6565CA4C4CC24C4CC24C4CC24C4CC24C4CC25A5AC77C7CD28181D47171CF + 5151C44C4CC24C4CC24C4CC24C4CC24C4CC24C4CC24C4CC24C4CC24C4CC24C4C + C24C4CC24C4CC20200000200004B4BC24B4BC25050C45656C65050C44B4BC24B + 4BC24B4BC27D7DD2FFFFFFFFFFFFFFFFFFFDFDFD7676AB4444833D3D7E32327F + 3535883E3E9449499D40409A5252A0F1F1F18585B44141893B3B8C48489DE5E5 + F3FFFFFFFFFFFFFAFAFAE5E5E546469C36368D39398655558D43438835358737 + 378E4747984C4C9C3F3F9738389236368B7171A7FFFFFFFFFFFFFFFFFFFFFFFF + FFFFFF6D6DAD3D3D9D4242AA4444B14545B17474C1FFFFFFFFFFFFF8F8F8EAEA + EAADADBF2828672A2A6D2E2E783535893B3B994141A84545B44949BC4A4AC04B + 4BC14B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC2 + 4B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24C4C + C24C4CC27979D2A5A5E1AAAAE27474D04C4CC24B4BC24B4BC24B4BC24B4BC251 + 51C46E6ECE8181D47B7BD25858C74C4CC24B4BC24B4BC24B4BC24B4BC24B4BC2 + 4B4BC24B4BC24B4BC24B4BC24B4BC20200000200004B4BC24B4BC25151C45656 + C65151C44B4BC24B4BC24B4BC27E7ED2FFFFFFFFFFFFFFFFFFFBFBFB3D3D974D + 4D9343438B34348635358A3D3D914646973D3D948181B5EEEEEE6B6BA643438E + 3D3D913D3D9D7474C0FFFFFFFFFFFFFFFFFFF4F4F49797C73D3D9F4141985E5E + 9C49499337378C37378E4545934949963C3C9136368C424290E5E5EFFFFFFFFF + FFFFFFFFFFFFFFFFA3A3CE3E3EA14343AD4545B44747B74646B48282C8FFFFFF + FFFFFFFCFCFCEEEEEEB2B2C62F2F7A30307D3333853838913D3D9D4141A84545 + B44848BA4A4ABF4B4BC14B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B + 4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC2 + 4B4BC24B4BC24B4BC24B4BC24C4CC26767CC9D9DDEACACE38888D75858C64B4B + C24B4BC24B4BC24B4BC24F4FC36363CA8181D48181D46666CB4F4FC34B4BC24B + 4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC20200000200004B4BC2 + 4B4BC25151C45656C65151C44B4BC24B4BC24B4BC24F4FC3F5F5FCFFFFFFFFFF + FFFFFFFF4E4EAB5656A64B4B9B3B3B9439399440409749499B3F3F97C1C1D9EF + EFEF6D6DAD4A4A9A42429E4141A64444B09191D4FFFFFFFFFFFFFFFFFFF2F2F2 + 6E6EBC4848A86A6AAF5050A23C3C983A3A9748489B4C4C9B3E3E95383891BCBC + DAFFFFFFFFFFFFFFFFFFFFFFFFD8D8EC4141A74444B04747B74848BA4848BB47 + 47B89C9CD6FFFFFFFFFFFFFFFFFFF7F7F7BABAD23838913939933B3B973D3D9E + 4040A64343AE4646B64949BC4A4AC04B4BC14B4BC24B4BC24B4BC24B4BC24B4B + C24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B + 4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24C4CC25959C79090D9 + ADADE39B9BDD6767CC4B4BC24B4BC24B4BC24B4BC24D4DC35959C77C7CD38383 + D57272CF5454C54B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC202 + 00000200004B4BC24B4BC25151C45656C65151C44B4BC24B4BC24B4BC24F4FC3 + B1B1E4FFFFFFFFFFFFFFFFFF9999D25E5EB55454AD4141A43E3EA14545A44E4E + A67F7FBFF8F8F8F4F4F47272B85151A94848AB4545B04747B74949BC9E9EDDF6 + F6FCFFFFFFFFFFFFE9E9F18282C87474BE5757B14141A63F3FA44D4DA65252A7 + 4E4EA7CBCBE5FFFFFFFFFFFFFFFFFFFFFFFFCCCCE85050B44646B44848BA4949 + BD4A4ABF4A4ABE4848BBC2C2E7FFFFFFFFFFFFFFFFFFFFFFFFE7E7EE4B4BA940 + 40A54141A74242AA4444AF4646B44848BA4949BD4A4AC04B4BC24B4BC24B4BC2 + 4B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4B + C24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B + 4BC24B4BC25353C57F7FD3ABABE3A7A7E17575D04B4BC24B4BC24B4BC24B4BC2 + 4B4BC25353C57070CF8383D57B7BD25B5BC74B4BC24B4BC24B4BC24B4BC24B4B + C24B4BC24B4BC20200000200004B4BC24B4BC25151C45656C65151C44B4BC24B + 4BC24B4BC24F4FC37676D0DEDEF4FFFFFFFFFFFFFFFFFFA8A8D95A5ABA4646B1 + 4343AD4A4AAF9797D0F3F3FAFFFFFFFBFBFB7777C35757B64D4DB64848B84949 + BC4A4ABF6060C88A8AD7D5D5F0FFFFFFFFFFFFFBFBFBC3C3E38E8ECE4646B244 + 44AF7373BFA4A4D4F3F3F9FFFFFFFFFFFFFFFFFFFFFFFFA0A0D74646B64848BA + 4949BD4A4ABF4B4BC14B4BC17A7AD19E9EDCFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFBCBCE17373C55C5CBC4646B54747B74848BA4949BD4A4ABF4B4BC14B + 4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC2 + 4B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4B + C24B4BC24B4BC24B4BC24B4BC24B4BC25050C46E6ECE9D9DDEAFAFE48888D755 + 55C54B4BC24B4BC24B4BC24B4BC25151C46666CB7F7FD48181D46666CB4D4DC3 + 4B4BC24B4BC24B4BC24B4BC24B4BC20200000200004B4BC24B4BC25151C45656 + C65151C44B4BC24B4BC24B4BC24F4FC36D6DCD5D5DC8A0A0DEFFFFFFFFFFFFFF + FFFFF3F3FACDCDEBCECEECF3F3FAFFFFFFFFFFFFFFFFFFFFFFFF7C7CCC5C5CC1 + 5050BF4B4BBE4A4AC04B4BC16060C97878D16161C97B7BD2C3C3EAFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF3F3FABBBBE57979CB52 + 52BF4A4ABE4A4AC04B4BC14B4BC14B4BC24B4BC2FFFFFFFFFFFFF3F3FBCFCFEE + CECEEDCECEEDCECEEDDBDBF2FFFFFFFEFEFE9C9CD94949BD4949BD4A4ABF4A4A + C04B4BC14B4BC14B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B + 4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC2 + 4B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC26161 + C99494DBB0B0E49494DB6868CC4B4BC24B4BC24B4BC24B4BC24C4CC25D5DC87C + 7CD38585D66E6ECE5454C54B4BC24B4BC24B4BC24B4BC20200000200004B4BC2 + 4B4BC25151C45656C65151C44B4BC24B4BC24B4BC24F4FC36E6ECE5D5DC84C4C + C25757C69595DBBABAE7D5D5F1CFCFEECFCFEEC5C5EBA9A9E1A2A2DE9292D97A + 7AD05C5CC66060C75353C44C4CC14B4BC24B4BC26060C97878D16161C94B4BC2 + 4B4BC25F5FC9ABABE2ACACE3C3C3EACFCFEED4D4F0D5D5F0A2A2DE8686D45656 + C35A5AC66868CA5555C44B4BC14B4BC24B4BC24B4BC24B4BC24B4BC27B7BD26F + 6FCE4B4BC24B4BC24B4BC24B4BC24B4BC24B4BC26363CA7B7BD26363CA4B4BC2 + 4B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4B + C24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B + 4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC2 + 4B4BC24B4BC24B4BC25858C78787D6AFAFE4A6A6E17575D05050C44B4BC24B4B + C24B4BC24B4BC25858C67575D08585D67777D15B5BC74B4BC24B4BC24B4BC202 + 00000200004A4AC24A4AC25050C45656C65050C44A4AC24A4AC24A4AC24E4EC3 + 6D6DCE5C5CC84B4BC24A4AC24E4EC36C6CCD6161CA4C4CC34A4AC25353C55E5E + C95151C44A4AC24A4AC25050C46060C95353C54B4BC24A4AC24A4AC26060C978 + 78D26161CA4A4AC24A4AC25353C58181D56464CB4B4BC24A4AC25D5DC86363CA + 5050C44A4AC24A4AC25A5AC86969CC5454C54A4AC24A4AC24A4AC24A4AC24A4A + C24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A + 4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC2 + 4A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4A + C24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A + 4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24F4FC47676D1A2A2E0B1B1E5 + 8383D55A5AC84B4BC24A4AC24A4AC24A4AC25050C46B6BCD8282D58080D46161 + CA4E4EC34A4AC20200000200004A4AC24A4AC25050C45656C65050C44A4AC24A + 4AC24A4AC24E4EC36D6DCE5C5CC84B4BC24A4AC24E4EC36D6DCE6262CA4C4CC3 + 4A4AC25353C55F5FC95151C44A4AC24A4AC25050C46161CA5353C54B4BC24A4A + C24A4AC26060C97878D26161CA4A4AC24A4AC25353C58282D56464CB4B4BC24A + 4AC25D5DC86464CB5050C44A4AC24A4AC25A5AC86969CD5454C54A4AC24A4AC2 + 4A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4A + C24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A + 4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC2 + 4A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4A + C24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24B + 4BC26060C99191DAB2B2E59696DC6363CA4A4AC24A4AC24A4AC24A4AC24C4CC3 + 5F5FC97A7AD28484D66B6BCD5252C50200000200004A4AC24A4AC25050C45656 + C65050C44A4AC24A4AC24A4AC24E4EC36E6ECE5C5CC84B4BC24A4AC24E4EC36D + 6DCE6262CA4C4CC34A4AC25353C55F5FC95151C44A4AC24A4AC25050C46161CA + 5353C54B4BC24A4AC24A4AC26060C97979D26161CA4A4AC24A4AC25454C58383 + D56464CB4B4BC24A4AC25D5DC86464CB5050C44A4AC24A4AC25A5AC86969CD54 + 54C54A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC2 + 4A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4A + C24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A + 4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC2 + 4A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4A + C24A4AC24A4AC24A4AC24B4BC26060C9ABABE3B3B3E58080D44A4AC24A4AC24A + 4AC24A4AC24A4AC24B4BC26262CA8686D68282D55E5EC90200000200004A4AC2 + 4A4AC25050C45656C65050C44A4AC24A4AC24A4AC24E4EC36E6ECE5C5CC84B4B + C24A4AC24E4EC36D6DCE6262CA4C4CC34A4AC25353C55F5FC95151C44A4AC24A + 4AC25050C46161CA5353C54B4BC24A4AC24A4AC26161CA7A7AD26161CA4A4AC2 + 4A4AC25454C58383D56464CB4B4BC24A4AC25D5DC86464CB5151C44A4AC24A4A + C25A5AC86969CD5454C54A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A + 4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC2 + 4A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4A + C24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A + 4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC2 + 4A4AC24A4AC24A4AC24A4AC24A4AC24D4DC36262CA9E9EDEAEAEE49999DD5959 + C74A4AC24A4AC24A4AC24A4AC24C4CC36262CA8080D48181D56C6CCD4B4BC202 + 00000200004A4AC24A4AC25050C45757C65050C44A4AC24A4AC24A4AC24E4EC3 + 6F6FCE5C5CC84B4BC24A4AC24F4FC46D6DCE6363CA4C4CC34A4AC25353C55F5F + C95151C44A4AC24A4AC25050C46161CA5353C54B4BC24A4AC24A4AC26161CA7A + 7AD26161CA4A4AC24A4AC25454C58383D56464CB4B4BC24A4AC25E5EC96464CB + 5151C44A4AC24A4AC25B5BC86A6ACD5454C54A4AC24A4AC24A4AC24A4AC24A4A + C24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A + 4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC2 + 4A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4A + C24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A + 4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC25050C47070CFAEAEE4B0B0E4 + 8383D55050C44A4AC24A4AC24A4AC24A4AC24F4FC46B6BCD8686D67F7FD46060 + C94A4AC24A4AC20200000200004A4AC14A4AC15050C35757C55050C34A4AC14A + 4AC14A4AC14E4EC27070CE5D5DC84B4BC14A4AC14F4FC36D6DCD6363CA4C4CC2 + 4A4AC15353C45F5FC85151C34A4AC14A4AC15050C36161C95353C44B4BC14A4A + C14A4AC16161C97A7AD26161C94A4AC14A4AC15454C48484D56565CA4B4BC14A + 4AC15E5EC86464CA5151C34A4AC14A4AC15B5BC76A6ACC5454C44A4AC14A4AC1 + 4A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4A + C14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A + 4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC1 + 4A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4A + C14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC15656C58A8AD7B2 + B2E4A6A6E16969CB4B4BC14A4AC14A4AC14A4AC14A4AC15757C57777D08585D5 + 7575D05353C44A4AC14A4AC14A4AC10200000200004A4AC14A4AC15050C35757 + C55050C34A4AC14A4AC14A4AC14E4EC27070CE5E5EC84B4BC14A4AC14F4FC36F + 6FCE6464CA4C4CC24A4AC15353C45F5FC85252C44A4AC14A4AC15050C36262C9 + 5353C44B4BC14A4AC14A4AC16161C97B7BD26262C94A4AC14A4AC15454C48585 + D56565CA4B4BC14A4AC15E5EC86565CA5151C34A4AC14A4AC15B5BC76B6BCC54 + 54C44A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC1 + 4A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4A + C14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A + 4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC1 + 4A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC16464 + CAA1A1DFB2B2E49797DB5656C54B4BC14A4AC14A4AC14A4AC14A4AC16161C980 + 80D38585D56B6BCC4B4BC14A4AC14A4AC14A4AC14A4AC10200000200004949C1 + 4949C14F4FC35757C64F4FC34949C14949C14949C14D4DC27070CE5D5DC84A4A + C14949C14E4EC36E6ECE6363CA4B4BC24949C15252C45F5FC95151C44949C14A + 4AC14F4FC36161C95252C44A4AC14949C14949C16060C97B7BD26161C94949C1 + 4949C15353C48484D56464CA4A4AC14949C15D5DC86464CA5050C34949C14949 + C15A5AC76A6ACC5454C54949C14949C14949C14949C14949C14949C14949C149 + 49C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949C1 + 4949C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949 + C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949C149 + 49C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949C1 + 4949C17272CFADADE3ACACE37E7ED34C4CC24949C14949C14949C14949C14A4A + C16C6CCD8484D57D7DD35E5EC84949C14949C14949C14949C14949C14949C102 + 00000200004949C14949C15050C35757C65050C34949C14949C14949C14D4DC2 + 7070CE5D5DC84A4AC14949C14E4EC36F6FCE6363CA4B4BC24949C15252C45F5F + C95151C44949C14A4AC14F4FC36161C95252C44A4AC14949C14949C16161C97B + 7BD26161C94949C14949C15353C48585D56565CA4A4AC14949C15E5EC86464CA + 5050C34949C14949C15A5AC76A6ACC5454C54949C14949C14949C14949C14949 + C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949C149 + 49C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949C1 + 4949C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949 + C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949C149 + 49C14949C15757C68B8BD7B0B0E4A0A0DF6868CC4C4CC24949C14949C14949C1 + 4949C15656C57777D18484D57272CF5656C54A4AC14949C14949C14949C14949 + C14949C14949C10200000200004949C14949C15050C35757C65050C34949C149 + 49C14949C14D4DC27070CE5D5DC84A4AC14949C14E4EC36F6FCE6363CA4B4BC2 + 4949C15252C45F5FC95151C44949C14A4AC14F4FC36262CA5252C44A4AC14949 + C14949C16161C97C7CD26161C94949C14949C15353C48686D66565CA4A4AC149 + 49C15E5EC86565CA5050C34949C14949C15A5AC76B6BCC5454C54949C14949C1 + 4949C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949 + C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949C149 + 49C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949C1 + 4949C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949 + C14949C14949C14949C16565CA9999DCB0B0E49696DB5C5CC74A4AC14949C149 + 49C14949C14949C16262CA7C7CD28484D56A6ACC5050C34949C14949C14949C1 + 4949C14949C14949C14949C14949C10200000200004949C14949C15050C35757 + C65050C34949C14949C14949C14D4DC27171CF5E5EC84A4AC14949C14E4EC370 + 70CE6363CA4B4BC24949C15353C46060C95151C44949C14A4AC15050C36262CA + 5252C44A4AC14949C14949C16161C97C7CD26262CA4949C14949C15353C48686 + D66666CB4A4AC14949C15E5EC86565CA5050C34949C14949C15B5BC76B6BCC54 + 54C54949C14949C14949C14949C14949C14949C14949C14949C14949C14949C1 + 4949C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949 + C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949C149 + 49C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949C1 + 4949C14949C14949C14949C14949C17676D0A9A9E2ADADE37F7FD35252C44949 + C14949C14949C14949C14D4DC26C6CCD8484D57D7DD35F5FC94C4CC24949C149 + 49C14949C14949C14949C14949C14949C14949C14949C10200000200004949C1 + 4949C15050C35757C65050C34949C14949C14949C14D4DC27171CF5E5EC84A4A + C14949C14E4EC37070CE6363CA4B4BC24949C15353C46060C95151C44949C14A + 4AC15050C36262CA5252C44A4AC14949C14949C16161C97C7CD26262CA4949C1 + 4949C15353C48686D66666CB4A4AC14949C15E5EC86565CA5050C34949C14949 + C15B5BC76B6BCC5454C54949C14949C14949C14949C14949C14949C14949C149 + 49C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949C1 + 4949C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949 + C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949C149 + 49C14949C14949C14949C14949C14949C15959C78787D6AEAEE49E9EDE6E6ECE + 4E4EC34949C14949C14949C14A4AC15959C77575D08484D57171CF5858C64A4A + C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949C102 + 00000200004949C14949C15050C35757C65050C34949C14949C14949C14D4DC2 + 7272CF5E5EC84A4AC14949C14E4EC37171CF6262CA4A4AC14949C15353C46060 + C95151C44949C14A4AC15050C36363CA5151C44A4AC14949C14949C16161C97C + 7CD26262CA4949C14949C15454C58686D66363CA4A4AC14949C15E5EC86565CA + 5050C34949C14949C15B5BC76B6BCC5353C44949C14949C14949C14949C14949 + C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949C149 + 49C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949C1 + 4949C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949 + C14949C14949C14949C14949C14949C14949C14A4AC16666CB9595DBAFAFE492 + 92DA6161C94A4AC14949C14949C14949C14D4DC26262CA7C7CD28383D56969CC + 5050C34949C14949C14949C14949C14949C14949C14949C14949C14949C14949 + C14949C14949C10200000200005454C55454C55C5CC86262CA5F5FC95959C65B + 5BC75B5BC75F5FC87777D16464CA5050C34F4FC35555C57676D07171CE6060C8 + 5D5DC86565CB6E6ECE6262C95959C75A5AC76060C87272CF6868CC6363CA6363 + CA6060C97474D08686D66B6BCD5252C45353C45D5DC78E8ED87979D16767CB66 + 66CB7575D07979D16565CB5F5FC95F5FC96F6FCE7F7FD37070CF6969CC6B6BCD + 6B6BCD6C6CCD6C6CCD6C6CCD6C6CCD6D6DCD6D6DCD6D6DCD6E6ECD6F6FCE6F6F + CE6F6FCE6F6FCE7070CE7070CE7070CE7070CE7171CF7171CF7171CF7272CF72 + 72CF7373CF7373CF7373CF7373CF7474CF7171CE6363CA5A5AC75959C75959C7 + 5959C75959C75959C75A5AC75A5AC75656C54D4DC24949C14E4EC37575D0A8A8 + E1AAAAE28383D55252C44949C14949C14949C14949C15050C36C6CCD8383D57B + 7BD26161C94949C14949C14949C14949C14949C14949C14949C14949C14949C1 + 4949C14949C14949C14949C14949C10200000200006767CB6767CB6D6DCE7474 + D07878D17777D17878D17979D27A7AD27C7CD36969CC5B5BC75B5BC75E5EC979 + 79D28383D58282D58282D58585D68282D57979D27676D17777D17B7BD28989D7 + 8A8AD78B8BD88C8CD88C8CD89191DA8C8CD97373CF6363CA6363CA6B6BCD9898 + DC9696DB9595DB9595DB9999DC9494DB8888D78484D58585D69090D99F9FDE9D + 9DDE9D9DDE9E9EDE9F9FDEA0A0DEA0A0DFA1A1DFA2A2E0A3A3E0A4A4E0A4A4E0 + A6A6E1A7A7E1A7A7E1A7A7E1A8A8E2A9A9E2AAAAE2ABABE2ABABE3ACACE3ADAD + E3AEAEE4AEAEE4AFAFE4AFAFE4B0B0E4B0B0E4B2B2E5B2B2E5B3B3E59292DA75 + 75D07575D07575D07575D07676D17676D17676D17A7AD27272CF5757C65B5BC7 + 8484D5AEAEE49C9CDD6D6DCE4C4CC24848C14848C14848C14949C15757C67373 + D08282D57171CF5555C54848C14848C14848C14848C14848C14848C14848C148 + 48C14848C14848C14848C14848C14848C14848C14848C10200000200005B5BC8 + 5C5CC85D5DC86262CA6666CB6767CB6767CB6868CB6969CC6565CB5858C75454 + C55353C55454C56363CA6C6CCD6E6ECE6E6ECE6E6ECE6C6CCD6666CB6565CB65 + 65CB6767CC7171CF7272D07474D07474D07575D07878D16D6DCE5D5DC85959C7 + 5959C75D5DC87575D07A7AD27B7BD27C7CD27C7CD27474D06F6FCE6F6FCE6F6F + CE7474D07E7ED38181D48181D48181D48383D58383D58383D58484D68484D685 + 85D68585D68686D68787D68787D68888D78989D78989D78989D78989D78B8BD8 + 8B8BD88B8BD88C8CD88C8CD88E8ED98E8ED98E8ED98E8ED98E8ED98E8ED99595 + DBB3B3E58D8DD86666CB6565CB6565CB6565CB6565CB6565CB6363CA7171CF7C + 7CD37474D09595DBAEAEE49191DA5A5AC74949C14848C14848C14848C14B4BC2 + 5F5FC97A7AD28181D46868CC4C4CC24848C14848C14848C14848C14848C14848 + C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848C102 + 00000200004848C14848C14848C14848C14848C14848C14848C14848C14848C1 + 4848C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848 + C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848C148 + 48C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848C1 + 4848C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848 + C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848C148 + 48C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848C1 + 4848C14848C15656C6A6A6E17777D14A4AC24848C14848C14848C14848C14848 + C14848C16464CB9B9BDEB0B0E4A9A9E27F7FD44949C14848C14848C14848C148 + 48C14D4DC36A6ACC8181D47C7CD35E5EC84848C14848C14848C14848C14848C1 + 4848C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848 + C14848C14848C10200000200004848C14848C14848C14848C14848C14848C148 + 48C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848C1 + 4848C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848 + C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848C148 + 48C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848C1 + 4848C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848 + C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848C148 + 48C14848C14848C14848C14848C15656C6A7A7E17878D14A4AC24848C14848C1 + 4848C14848C14848C15252C49191DAC4C4EBA9A9E26B6BCD4848C14848C14848 + C14848C14949C15151C47373D08181D47272CF5555C54848C14848C14848C148 + 48C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848C1 + 4848C14848C14848C14848C14848C10200000200004848C14848C14848C14848 + C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848C148 + 48C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848C1 + 4848C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848 + C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848C148 + 48C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848C1 + 4848C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848 + C14848C14848C14848C14848C14848C14848C14848C15656C6A7A7E17878D14A + 4AC24848C14848C14848C14848C16060C99898DCB7B7E7AFAFE46868CB4848C1 + 4848C14848C14848C14848C15D5DC87C7CD38181D46767CB4C4CC24848C14848 + C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848C148 + 48C14848C14848C14848C14848C14848C14848C14848C10200000200004848C0 + 4848C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848 + C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848C048 + 48C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848C0 + 4848C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848 + C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848C048 + 48C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848C0 + 4848C04848C04848C04848C04848C04848C04848C04848C04848C04848C05656 + C5A7A7E17878D14A4AC14848C04848C04848C07272CFA5A5E0ACACE38D8DD87E + 7ED25B5BC64848C04848C04848C04B4BC16B6BCC7F7FD37E7ED35C5CC74848C0 + 4848C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848 + C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848C002 + 00000200004848C04848C04848C04848C04848C04848C04848C04848C04848C0 + 4848C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848 + C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848C048 + 48C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848C0 + 4848C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848 + C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848C048 + 48C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848C0 + 4848C04848C05656C5A7A7E17878D14A4AC14848C04B4BC18585D5ABABE29E9E + DE6868CB5F5FC87D7DD25B5BC64848C04949C05050C37474CF8181D47373CF53 + 53C44848C04848C04848C04848C04848C04848C04848C04848C04848C04848C0 + 4848C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848 + C04848C04848C00200000200004848C04848C04848C04848C04848C04848C048 + 48C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848C0 + 4848C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848 + C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848C048 + 48C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848C0 + 4848C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848 + C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848C048 + 48C04848C04848C04848C04848C05656C5A8A8E17878D14949C05F5FC89797DB + ACACE28C8CD75B5BC64848C06060C87E7ED35A5AC64848C05F5FC87C7CD28181 + D46565CA4F4FC24848C04848C04848C04848C04848C04848C04848C04848C048 + 48C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848C0 + 4848C04848C04848C04848C04848C00200000200004747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C05555C5A8A8E17878D178 + 78D19F9FDEABABE27878D15151C34747C04747C05F5FC87C7CD26060C86868CB + 7F7FD37C7CD25959C64B4BC14747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C00200000200004747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C05555 + C5A8A8E19E9EDEAAAAE29D9DDD6A6ACC4B4BC14747C04747C04747C05D5DC87F + 7FD37A7AD17F7FD36F6FCE5353C44747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C002 + 00000200004747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C05454C4A9A9E2A9A9E28888D65F5FC84949C14747C04747C04747 + C04747C05D5DC87F7FD37B7BD26464CA4E4EC24747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C00200000200004747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C05050C38F8FD97A7AD15252C44848C04747C0 + 4747C04747C04747C04747C05858C67070CE5D5DC84848C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C00200000200004747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04848C05555C54747C047 + 47C04747C04747C04747C04747C04747C04747C04B4BC14D4DC24747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C00200000200004747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C002 + 00000200004747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C00200000200004747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C00200000200004646C04646C04646C04646 + C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646C046 + 46C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646C0 + 4646C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646 + C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646C046 + 46C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646C0 + 4646C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646 + C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646C046 + 46C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646C0 + 4646C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646 + C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646C046 + 46C04646C04646C04646C04646C04646C04646C04646C00200000200004646C0 + 4646C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646 + C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646C046 + 46C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646C0 + 4646C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646 + C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646C046 + 46C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646C0 + 4646C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646 + C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646C046 + 46C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646C0 + 4646C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646 + C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646C002 + 00000200004545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD + 4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545 + BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD45 + 45BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD + 4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545 + BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD45 + 45BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD + 4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545 + BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD45 + 45BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD + 4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545 + BD4545BD4545BD0200000200004242B84242B84242B84242B84242B84242B842 + 42B84242B84242B84242B84242B84242B84242B84242B84242B84242B84242B8 + 4242B84242B84242B84242B84242B84242B84242B84242B84242B84242B84242 + B84242B84242B84242B84242B84242B84242B84242B84242B84242B84242B842 + 42B84242B84242B84242B84242B84242B84242B84242B84242B84242B84242B8 + 4242B84242B84242B84242B84242B84242B84242B84242B84242B84242B84242 + B84242B84242B84242B84242B84242B84242B84242B84242B84242B84242B842 + 42B84242B84242B84242B84242B84242B84242B84242B84242B84242B84242B8 + 4242B84242B84242B84242B84242B84242B84242B84242B84242B84242B84242 + B84242B84242B84242B84242B84242B84242B84242B84242B84242B84242B842 + 42B84242B84242B84242B84242B84242B84242B84242B84242B84242B84242B8 + 4242B84242B84242B84242B84242B80200000200003F3FB13F3FB13F3FB13F3F + B13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F + 3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB1 + 3F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3F + B13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F + 3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB1 + 3F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3F + B13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F + 3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB1 + 3F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3F + B13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F + 3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB10200000200003A3AA6 + 3A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3A + A63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A + 3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA6 + 3A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3A + A63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A + 3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA6 + 3A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3A + A63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A + 3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA6 + 3A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3A + A63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA602 + 0000020000333399333399333399333399333399333399333399333399333399 + 3333993333993333993333993333993333993333993333993333993333993333 + 9933339933339933339933339933339933339933339933339933339933339933 + 3399333399333399333399333399333399333399333399333399333399333399 + 3333993333993333993333993333993333993333993333993333993333993333 + 9933339933339933339933339933339933339933339933339933339933339933 + 3399333399333399333399333399333399333399333399333399333399333399 + 3333993333993333993333993333993333993333993333993333993333993333 + 9933339933339933339933339933339933339933339933339933339933339933 + 3399333399333399333399333399333399333399333399333399333399333399 + 3333993333993333993333993333993333993333993333993333993333993333 + 993333993333990200000200002C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C + 2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A + 2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C + 8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C + 2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A + 2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C + 8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C + 2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A + 2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C + 8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C + 2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A + 2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A0200000200002323782323782323782323 + 7823237823237823237823237823237823237823237823237823237823237823 + 2378232378232378232378232378232378232378232378232378232378232378 + 2323782323782323782323782323782323782323782323782323782323782323 + 7823237823237823237823237823237823237823237823237823237823237823 + 2378232378232378232378232378232378232378232378232378232378232378 + 2323782323782323782323782323782323782323782323782323782323782323 + 7823237823237823237823237823237823237823237823237823237823237823 + 2378232378232378232378232378232378232378232378232378232378232378 + 2323782323782323782323782323782323782323782323782323782323782323 + 7823237823237823237823237823237823237823237823237823237823237823 + 2378232378232378232378232378232378232378232378020000020000191964 + 1919641919641919641919641919641919641919641919641919641919641919 + 6419196419196419196419196419196419196419196419196419196419196419 + 1964191964191964191964191964191964191964191964191964191964191964 + 1919641919641919641919641919641919641919641919641919641919641919 + 6419196419196419196419196419196419196419196419196419196419196419 + 1964191964191964191964191964191964191964191964191964191964191964 + 1919641919641919641919641919641919641919641919641919641919641919 + 6419196419196419196419196419196419196419196419196419196419196419 + 1964191964191964191964191964191964191964191964191964191964191964 + 1919641919641919641919641919641919641919641919641919641919641919 + 6419196419196419196419196419196419196419196419196419196419196402 + 00000200000E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C + 0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E + 4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E + 0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C + 0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E + 4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E + 0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C + 0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E + 4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E + 0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C + 0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E + 4C0E0E4C0E0E4C02000002000008083F08083F08083F08083F08083F08083F08 + 083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F + 08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F0808 + 3F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08 + 083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F + 08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F0808 + 3F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08 + 083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F + 08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F0808 + 3F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08 + 083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F + 08083F08083F08083F08083F08083F02000002000008083F08083F08083F0808 + 3F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08 + 083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F + 08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F0808 + 3F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08 + 083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F + 08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F0808 + 3F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08 + 083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F + 08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F0808 + 3F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08 + 083F08083F08083F08083F08083F08083F08083F08083F02000002000008083F + 08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F0808 + 3F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08 + 083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F + 08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F0808 + 3F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08 + 083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F + 08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F0808 + 3F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08 + 083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F + 08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F0808 + 3F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F02 + 00000200005E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB0 + 5E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5E + B05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E + 5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB0 + 5E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5E + B05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E + 5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB0 + 5E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5E + B05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E + 5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB0 + 5E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5E + B05E5EB05E5EB00200000200005757AC5757AC5757AC5757AC5757AC5757AC57 + 57AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC + 5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757 + AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC57 + 57AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC + 5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757 + AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC57 + 57AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC + 5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757 + AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC57 + 57AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC + 5757AC5757AC5757AC5757AC5757AC0200000200004A4AA64A4AA64A4AA64A4A + A64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A + 4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA6 + 4A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4A + A64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A + 4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA6 + 4A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4A + A64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A + 4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA6 + 4A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4A + A64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A + 4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA60200000200003B3B9F + 3B3B9F3B3B9F3B3B9F3B3B9F3B3B9F3B3B9F3B3B9F3B3B9F3B3B9F3B3B9F3B3B + 9E3A3A9C39399A38389838389738389738389738389839399B3A3A9D3B3B9E3B + 3B9F3B3B9F3B3B9F3B3B9F3B3B9F3B3B9E3A3A9C39399A383898383898383898 + 39399A3A3A9D3B3B9E3B3B9F3B3B9E3B3B9E3A3A9C39399B39399A39399A3939 + 9A39399A39399B3A3A9C3B3B9E3B3B9E3B3B9F3B3B9F3B3B9F3B3B9F3B3B9E3A + 3A9D39399A38389838389738389839399A39399B3A3A9D3B3B9E3B3B9F3B3B9F + 3B3B9F3B3B9F3B3B9E3A3A9D39399B39399A39399A39399A39399A39399A3939 + 9A39399A39399A39399A39399A39399A39399A39399A39399B3A3A9C3A3A9D3B + 3B9E3A3A9D39399A38389838389838389939399A39399B39399B39399A39399A + 39399A3A3A9C3B3B9E3B3B9E3B3B9E3A3A9D3A3A9D3A3A9D3A3A9D3A3A9C3939 + 9A38389838389838389939399B3A3A9D3B3B9E3B3B9F3B3B9F3B3B9F3B3B9F02 + 00000200002C2C972C2C972C2C972C2C972C2C972C2C972C2C972C2C972C2C96 + 2B2B952A2A9229298D2727872525832525812424802525812525822525832626 + 8628288B2A2A902B2B952C2C962C2C972B2B952A2A9229298D27278725258225 + 258125258125258226268427278829298D2A2A922B2B942A2A9229298D272787 + 25258325258225258225258327278729298D2A2A922C2C962C2C972C2C972C2C + 962B2B9429298F27278926268425258124248025258126268427278729298D2A + 2A922B2B952C2C972C2C972C2C962B2B942A2A9028288A262686252583252582 + 2525812525822525832626842626852626852626842525822525822525822626 + 8528288A29298F29298F28288A26268424248024248025258226268526268626 + 268525258225258125258327278829298F2A2A922A2A9229298E28288A28288A + 28288927278726268425258124247F25258126268528288B2A2A912B2B952C2C + 972C2C972C2C970200000200001F1F911F1F911F1F911F1F911F1F911F1F911F + 1F911F1F901E1E8D1D1D871B1B7E18187416166C15156815156916166B16166D + 17176E17176F1717711818751A1A7D1C1C861E1E8C1E1E8D1D1D881B1B7F1818 + 7416166C15156815156916166A16166A16166A16166E1818751B1B801D1D871D + 1D871B1B7E1818731515691414631414631515691818731B1B7F1D1D891F1F8F + 1F1F911F1F901E1E8D1C1C8519197A17176E15156715156615156916166C1717 + 701818731919791B1B811D1D891F1F8F1F1F911F1F901E1E8D1C1C861A1A7C18 + 187216166A14146514146214146315156817176F18187318187417177116166C + 15156814146516166A1818741A1A7D1A1A7B1717711515661313611414631616 + 6A17176F17176F16166A1414641414621515681818731B1B801D1D871C1C841A + 1A7B18187317177017177017177016166E16166A151566141463151568181872 + 1B1B7F1D1D8A1F1F8F1F1F911F1F9102000002000016168C16168C16168C1616 + 8C16168C16168C16168C1515881414801212730F0F630D0D570C0C520C0C550E + 0E5D0F0F6610106B10106B1010690F0F640F0F6310106812127313137D141480 + 1212760F0F660D0D570C0C510C0C560E0E5E0F0F630E0E5F0C0C560C0C530D0D + 580F0F6712127613137D1212760F0F670C0C540A0A490A0A490C0C540F0F6712 + 127815158516168A16168C1515891414811111710E0E5F0C0C520B0B4E0C0C55 + 0E0E5E0F0F650F0F660F0F6610106911117113137D15158716168C16168C1515 + 881414811212761010680D0D580B0B4C0909450A0A490C0C530F0F6210106B11 + 116E1010690E0E620D0D580B0B500C0C540E0E6010106D1010690D0D5A0A0A4B + 0A0A470B0B4E0D0D5A0E0E5E0D0D5A0B0B500A0A480A0A490C0C530F0F641212 + 7413137E13137910106A0D0D5A0C0C530C0C560D0D5C0E0E610E0E600D0D580B + 0B4E0B0B4D0D0D5710106913137A15158616168C16168C0200000200000F0F89 + 0F0F890F0F890F0F890F0F890F0F890F0F860E0E7E0C0C6E09095B4545778383 + A1A3A3BAC2C2D5C2C2D9C3C3DCA5A5CC7777B22A2A840B0B6A0A0A610A0A5E0B + 0B660C0C710C0C710A0A635555868383A1C1C1D1C2C2D4A4A4C58585B5383881 + 0808510606440606430808516767A08686BB8686BA8585B28383A582829D8282 + 9D64648F0B0B650D0D780E0E850F0F880F0F890E0E820C0C7438387C8383A4A2 + A2B7C1C1D0C2C2D49494B867679F0A0A640A0A5F0A0A5D0A0A640C0C720E0E80 + 0F0F882D2D988787C38787C18686BC8585B58484AA8383A182829B82829D8383 + A58585B18686B88686BB8686B98585B58585AF65659308085009095B39398485 + 85B2A3A3BFC1C1D19393AB8383A336367328286C8484A8C1C1D082829C54547A + 08084D0A0A640C0C754A4A9E7777B119196907074A54547D8383A4A3A3C1C3C3 + D9A4A4C77575A426266006063F0606420808540B0B6B0E0E7D0F0F870F0F8902 + 00000200000C0C870C0C870C0C870C0C870C0C870C0C870B0B800A0A7265659A + E1E1E9FFFFFFFFFFFFF0F0F4A3A3C38585B88585BEA4A4D0F1F1F8FFFFFF7676 + B209096B08086409096709096B565697F0F0F5FFFFFFFFFFFFE1E1E87474A0C2 + C2DBFFFFFFFFFFFFE1E1EA53537B0404380505436464989494C2FFFFFFFFFFFF + FFFFFFFFFFFF9292A864648E0909650A0A770B0B800B0B800B0B800B0B7AA3A3 + C7FFFFFFFFFFFFFFFFFFC1C1D08383A8B2B2CDF0F0F6E1E1EC55558C07075408 + 085C09096D0B0B7C0C0C852A2A968686C39595CAF1F1F7FFFFFFFFFFFFFFFFFF + FFFFFF9292A88383A59494BCC3C3DEF1F1F8FFFFFFFFFFFFFFFFFFC2C2D70808 + 5B555593FFFFFFFFFFFFFFFFFFFFFFFFA2A2B8B2B2C6FFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFE0E0E7B2B2C81818710B0B798585BFFFFFFFD1D1E1C1C1D0FFFFFF + E1E1E8A3A3C2FFFFFFFFFFFFFFFFFFF0F0F433335F04043705054608085E0A0A + 760C0C830C0C870200000200000B0B870B0B870B0B870B0B870B0B870B0B8619 + 1984B2B2D1FFFFFFFFFFFFFFFFFFD1D1DB1616580808680A0A7B0B0B860B0B87 + 1A1A8FD2D2E9FFFFFFC2C2DE18187E0909756666A8FFFFFFFFFFFFFFFFFFB1B1 + C0040441070758090971E1E1EFFFFFFFFFFFFFFFFFFF52527504044107075809 + 0972FFFFFFFFFFFFFFFFFFFFFFFF04043705054807076109096F090973090972 + 090973A3A3CAFFFFFFFFFFFFFFFFFF81819A04044006065307075E171769B2B2 + CAFFFFFF44447706065508086A0A0A7B0B0B850B0B870B0B870B0B879595C9FF + FFFFFFFFFFFFFFFFFFFFFF04043806064C0808690A0A7D1A1A8F6767B4FFFFFF + FFFFFFC2C2DD0909707575B0FFFFFFFFFFFFFFFFFFE1E1EA05054805054B7373 + 9FFFFFFFFFFFFFFFFFFFC1C1CD14144944447E09096E0A0A7F8585C1FFFFFFFF + FFFFFFFFFFA1A1B505054307075C282884FFFFFFFFFFFFFFFFFFF0F0F323234E + 05054307075C0909740B0B820B0B870200000200000B0B870B0B870B0B870B0B + 870B0B870B0B859494C5FFFFFFFFFFFFFFFFFFFFFFFF43436D06065109096D0A + 0A7F0B0B870B0B870B0B871A1A8FD2D2E9FFFFFF8585BF0A0A7DF1F1F7FFFFFF + FFFFFFFFFFFF82829D0404400606520808668484B7FFFFFFFFFFFFFFFFFFC1C1 + CF05054807075E090972FFFFFFFFFFFFFFFFFFFFFFFF03033505054306065507 + 075D07075B07075836367DFFFFFFFFFFFFFFFFFFFFFFFF62628444447144447F + 45458645458344447763638924245C07075709096E0A0A7E0B0B860B0B870B0B + 870B0B878585C1FFFFFFFFFFFFFFFFFFFFFFFF04043806064C0808690A0A7D0B + 0B870B0B878585C3FFFFFFC2C2E00A0A7F191988C2C2E0FFFFFFFFFFFFFFFFFF + B2B2C744447A454581FFFFFFFFFFFFFFFFFFC1C1CE0505410707580909720A0A + 818585C1FFFFFFFFFFFFFFFFFF53537604043F060654080866D1D1E4FFFFFFFF + FFFFFFFFFFA1A1B605054A0808630A0A780B0B840B0B870200000200000B0B87 + 0B0B870B0B870B0B870B0B872A2A93FFFFFFFFFFFFFFFFFFFFFFFFD1D1D90404 + 3C06065209096D0A0A800B0B870B0B870B0B870B0B870B0B840A0A7E0A0A790A + 0A79FFFFFFFFFFFFFFFFFFFFFFFF63638D05054606064F07075D8484B1FFFFFF + FFFFFFFFFFFFC1C1D207075908086B090977FFFFFFFFFFFFFFFFFFFFFFFF0404 + 3C05054506064F06065106064D06064C444480FFFFFFFFFFFFFFFFFFFFFFFFC1 + C1D2C1C1D2C1C1D5FFFFFFFFFFFFFFFFFFFFFFFF73739B0808610909750B0B82 + 0B0B870B0B870B0B870B0B878585C1FFFFFFFFFFFFFFFFFFFFFFFF0404380606 + 4C0808690A0A7D0B0B870B0B870B0B874848A539399E0B0B860B0B860B0B8438 + 38959393BFC2C2D6FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC1C1D006064D + 0808620A0A770B0B838585C1FFFFFFFFFFFFFFFFFF43436804043B06064C0707 + 5AC2C2D7FFFFFFFFFFFFFFFFFFC1C1D207075A09096F0A0A7E0B0B860B0B8702 + 00000200000B0B870B0B870B0B870B0B870B0B876767B3FFFFFFFFFFFFFFFFFF + FFFFFFC1C1CC04043A06064F08086B0A0A7D0B0B870B0B870B0B870B0B840A0A + 7C09096F080866080869C2C2DDFFFFFFFFFFFFFFFFFF9393B907075706065607 + 075AB2B2CDFFFFFFFFFFFFFFFFFFA3A3C409096E0A0A780A0A7AFFFFFFFFFFFF + FFFFFFFFFFFF35356F252569C2C2D5E1E1EAB2B2C9353572171766F0F0F6FFFF + FFFFFFFFFFFFFF17176707075907075CC2C2D7FFFFFFFFFFFFE1E1EB17176C09 + 09720A0A7E0B0B850B0B870B0B870B0B870B0B878585C1FFFFFFFFFFFFFFFFFF + FFFFFF04043806064C0808690A0A7D0B0B870B0B870B0B870B0B870B0B870B0B + 870B0B875858ACC2C2E0E1E1EE9393BC07075B07075B64649CFFFFFFFFFFFFFF + FFFFC1C1D50707600909700A0A7E0B0B858585C1FFFFFFFFFFFFFFFFFF72728E + 04043A050549060656F0F0F5FFFFFFFFFFFFFFFFFF64649A09096C0A0A7B0B0B + 840B0B870B0B870200000200000B0B870B0B870B0B870B0B870B0B877676BCFF + FFFFFFFFFFFFFFFFFFFFFFC1C1CE04043A0505480707610909740A0A800B0B83 + 0A0A810A0A7A09096D07075B06065307075A282881D2D2E7FFFFFFFFFFFFF1F1 + F76666A508086B6565A1FFFFFFFFFFFFFFFFFFD2D2E51818800A0A7E0B0B8229 + 2990FFFFFFFFFFFFFFFFFFFFFFFFD1D1E3B2B2D1FFFFFFFFFFFFFFFFFFA3A3C7 + 0909706666ABFFFFFFFFFFFFFFFFFF7575B009096E27277EFFFFFFFFFFFFFFFF + FF6666A50909760A0A7F0B0B840B0B870B0B870B0B870B0B870B0B858585BFFF + FFFFFFFFFFFFFFFFFFFFFF0404370505490808650A0A790B0B850B0B860B0B87 + 0B0B870B0B870B0B870B0B879595CBFFFFFFFFFFFFF1F1F709097009096D7575 + ADFFFFFFFFFFFFFFFFFF9494BF0909750A0A7E0B0B840B0B868585C0FFFFFFFF + FFFFFFFFFFE0E0E7727292545486C2C2D8FFFFFFFFFFFFFFFFFFB2B2D1090974 + 0A0A7C0B0B830B0B870B0B870B0B870200000200000B0B870B0B870B0B870B0B + 870B0B8739399EFFFFFFFFFFFFFFFFFFFFFFFFC1C1D104044005054606065608 + 08670909730A0A7709097509096DB2B2CDC1C1D405054906065409096C191986 + 8585C3E1E1F0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD2D2E66666AE0A0A800B0B + 830B0B86C3C3E1FFFFFFFFFFFFFFFFFFFFFFFFB3B3D7C2C2DFFFFFFFFFFFFFFF + FFFFF1F1F747479D0A0A7F0B0B832A2A95A4A4D2F1F1F8FFFFFFD2D2E7FFFFFF + FFFFFFE1E1EF8585BE0A0A7F0B0B820B0B850B0B870B0B870B0B870B0B870B0B + 850A0A818585BBFFFFFFFFFFFFFFFFFFFFFFFF04043A0505490707600909730A + 0A800B0B840B0B870B0B870B0B870B0B870B0B870B0B877676BCE1E1F0FFFFFF + C2C2E0D2D2E7FFFFFFFFFFFFFFFFFF8585BD0A0A7E0B0B820B0B850B0B860B0B + 858585BEFFFFFFFFFFFFFFFFFFD1D1DAF0F0F4FFFFFFFFFFFFFFFFFFFFFFFFA4 + A4CE1919860A0A810B0B850B0B870B0B870B0B870B0B870200000200000B0B87 + 0B0B870B0B870B0B870B0B870B0B87C3C3E1FFFFFFFFFFFFFFFFFFFFFFFF1616 + 5C06064E06065307075D08086708086B08086B8484B2FFFFFFFFFFFF06065107 + 075D0909710A0A800B0B870B0B871A1A8F4848A54848A54848A40B0B850B0B86 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B8739399E2A2A960B0B + 870B0B8739399E39399E0B0B870B0B870B0B870B0B870B0B870B0B870B0B8739 + 399E4848A54848A42A2A940B0B850B0B860B0B870B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B830A0A7D8484B8FFFFFFFFFFFFFFFFFFFFFFFF0505460606 + 4F07075E09096D0A0A7A0B0B820B0B860B0B870B0B870B0B870B0B870B0B870B + 0B870B0B871A1A8F4848A54848A54848A439399C0B0B850B0B860B0B870B0B87 + 0B0B870B0B860B0B828585BCFFFFFFFFFFFFFFFFFF8282A106064C0707604747 + 982A2A920B0B860B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B8702 + 00000200000B0B870B0B870B0B870B0B870B0B870B0B871A1A8FD2D2E9FFFFFF + FFFFFFFFFFFFA3A3C70808620707600808620808660808697474ABFFFFFFFFFF + FFFFFFFF08086609096D0A0A7A0B0B830B0B870B0B870B0B870B0B870B0B870B + 0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B + 0B870B0B870B0B870B0B870B0B870B0B830A0A7D9494C2FFFFFFFFFFFFFFFFFF + FFFFFF07075D0707600808680909710A0A7A0B0B820B0B860B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B + 0B870B0B870B0B870B0B870B0B860A0A818585BCFFFFFFFFFFFFFFFFFF8383AB + 07075C08086B0A0A7A0B0B840B0B870B0B870B0B870B0B870B0B870B0B870B0B + 870B0B870B0B870200000200000B0B870B0B870B0B870B0B870B0B870B0B870B + 0B871A1A8F9595CBFFFFFFFFFFFFFFFFFFE1E1EE7575B14747956666A8C2C2DD + FFFFFFFFFFFFFFFFFFF1F1F70A0A790A0A7D0A0A810B0B850B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B + 0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B872A2A968585C2A4A4D0F1F1F7FF + FFFFFFFFFFFFFFFFFFFFFFC2C2DC8484BA4747990A0A7A0A0A800B0B840B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B872A2A964848A2C2C2DFFFFFFFFF + FFFFFFFFFF8484B70909720A0A790A0A810B0B860B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B870B0B870B0B870200000200000B0B870B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B871A1A8F6767B49595CAC3C3E1C3C3E0C2 + C2E0C2C2E08585C05757A90B0B827676BA6767B30B0B850B0B850B0B860B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B + 0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B872A2A968585 + C38585C28585C28585C18585C18585C18585C18585C18585C14848A10B0B830B + 0B850B0B860B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B876767B4C3C3 + E1C3C3E1C2C2E0C2C2E0F1F1F88585C00A0A800B0B820B0B850B0B870B0B870B + 0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870200000200000B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B + 0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B + 0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B + 0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B8702 + 00000200000B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B + 0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B + 0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B + 0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B + 870B0B870B0B870200000200000B0B870B0B870B0B870B0B870B0B870B0B870B + 0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B + 0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B + 0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B + 0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B870B0B870B0B870200000200000B0B870B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B + 0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B + 0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B + 0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B + 0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B87020000020000020000 + 0200000200000200000200000200000200000200000200000200000200000200 + 0002000002000002000002000002000002000002000002000002000002000002 + 0000020000020000020000020000020000020000020000020000020000020000 + 0200000200000200000200000200000200000200000200000200000200000200 + 0002000002000002000002000002000002000002000002000002000002000002 + 0000020000020000020000020000020000020000020000020000020000020000 + 0200000200000200000200000200000200000200000200000200000200000200 + 0002000002000002000002000002000002000002000002000002000002000002 + 0000020000020000020000020000020000020000020000020000020000020000 + 0200000200000200000200000200000200000200000200000200000200000200 + 0002000002000002000002000002000002000002000002000002000002000002 + 0000} + end + object Label1: TLabel + Left = 146 + Top = 22 + Width = 230 + Height = 20 + Caption = 'SQL Server Data Access' + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Height = -17 + Font.Name = 'Verdana' + Font.Pitch = fpVariable + Font.Style = [fsBold, fsItalic] + ParentFont = False + end + object Label3: TLabel + Left = 146 + Top = 108 + Width = 156 + Height = 13 + Caption = 'Copyright '#169' 1997-2007 Core Lab' + end + object Label5: TLabel + Left = 146 + Top = 132 + Width = 26 + Height = 13 + Caption = 'Web:' + end + object Label6: TLabel + Left = 146 + Top = 156 + Width = 31 + Height = 13 + Caption = 'E-mail:' + end + object lbMail: TLabel + Left = 186 + Top = 156 + Width = 80 + Height = 13 + Cursor = crHandPoint + Caption = 'sdac@crlab.com' + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlue + Font.Height = 13 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [fsUnderline] + ParentColor = False + ParentFont = False + OnClick = lbMailClick + OnMouseMove = lbMailMouseMove + end + object lbWeb: TLabel + Left = 186 + Top = 132 + Width = 101 + Height = 13 + Cursor = crHandPoint + Caption = 'www.crlab.com/sdac' + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlue + Font.Height = 13 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [fsUnderline] + ParentFont = False + OnClick = lbWebClick + OnMouseMove = lbWebMouseMove + end + object Label4: TLabel + Left = 186 + Top = 46 + Width = 119 + Height = 20 + Caption = 'Components' + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Height = -17 + Font.Name = 'Verdana' + Font.Pitch = fpVariable + Font.Style = [fsBold, fsItalic] + ParentFont = False + end + object Label10: TLabel + Left = 146 + Top = 180 + Width = 32 + Height = 13 + Caption = 'Forum:' + end + object lbForum: TLabel + Left = 186 + Top = 180 + Width = 109 + Height = 13 + Cursor = crHandPoint + Caption = 'www.crlab.com/forums' + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlue + Font.Height = 13 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [fsUnderline] + ParentFont = False + OnClick = lbForumClick + OnMouseMove = lbForumMouseMove + end + object OKBtn: TButton + Left = 308 + Top = 248 + Width = 75 + Height = 24 + Cancel = True + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 0 + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Base/SdacAbout.pas b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Base/SdacAbout.pas new file mode 100644 index 0000000..6438bb5 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Base/SdacAbout.pas @@ -0,0 +1,127 @@ + +////////////////////////////////////////////////// +// MS SQL Server Data Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +// SDAC About Window +// Created: 24.07.01 +// Last modified: 14.01.02 +////////////////////////////////////////////////// + +unit SdacAbout; + +interface +uses + Windows, SysUtils, Classes, Graphics, Forms, Controls, StdCtrls, +{$IFDEF WIN32} + Jpeg, +{$ENDIF} + Buttons, ExtCtrls; +type + TSdacAboutForm = class(TForm) + OKBtn: TButton; + Image1: TImage; + Label1: TLabel; + Label3: TLabel; + Label5: TLabel; + Label6: TLabel; + lbMail: TLabel; + lbWeb: TLabel; + Label4: TLabel; + Bevel1: TBevel; + Label10: TLabel; + lbForum: TLabel; + procedure lbWebClick(Sender: TObject); + procedure lbMailClick(Sender: TObject); + procedure lbWebMouseMove(Sender: TObject; Shift: TShiftState; X, + Y: Integer); + procedure lbMailMouseMove(Sender: TObject; Shift: TShiftState; X, + Y: Integer); + procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X, + Y: Integer); + procedure lbForumMouseMove(Sender: TObject; Shift: TShiftState; X, + Y: Integer); + procedure lbForumClick(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + end; + +var + SdacAboutForm: TSdacAboutForm; + +procedure ShowAbout; + +implementation + +uses + ShellApi; + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} + +procedure ShowAbout; +begin + with TSdacAboutForm.Create(Application) do + try + ShowModal; + finally + Free; + end; +end; + +procedure TSdacAboutForm.lbWebClick(Sender: TObject); +begin +{$IFDEF MSWINDOWS} + ShellExecute(0, 'open', 'http://www.crlab.com/sdac', '', '', SW_SHOW); + lbWeb.Font.Color := $FF0000; +{$ENDIF} +end; + +procedure TSdacAboutForm.lbMailClick(Sender: TObject); +begin +{$IFDEF MSWINDOWS} + ShellExecute(0, 'open', 'mailto:sdac@crlab.com', 'zxczxc', '', SW_SHOW); + lbMail.Font.Color := $FF0000; +{$ENDIF} +end; + +procedure TSdacAboutForm.lbForumClick(Sender: TObject); +begin +{$IFDEF MSWINDOWS} + ShellExecute(0, 'open', 'www.crlab.com/forums/viewforum.php?f=6', '', '', SW_SHOW); + lbWeb.Font.Color := $FF0000; +{$ENDIF} +end; + +procedure TSdacAboutForm.lbWebMouseMove(Sender: TObject; Shift: TShiftState; X, + Y: Integer); +begin + lbWeb.Font.Color := $4080FF; +end; + +procedure TSdacAboutForm.lbMailMouseMove(Sender: TObject; Shift: TShiftState; + X, Y: Integer); +begin + lbMail.Font.Color := $4080FF; +end; + +procedure TSdacAboutForm.lbForumMouseMove(Sender: TObject; + Shift: TShiftState; X, Y: Integer); +begin + lbForum.Font.Color := $4080FF; +end; + +procedure TSdacAboutForm.FormMouseMove(Sender: TObject; Shift: TShiftState; X, + Y: Integer); +begin + lbWeb.Font.Color := $FF0000; + lbMail.Font.Color := $FF0000; + lbForum.Font.Color := $FF0000; +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Base/SdacDemoForm.dfm b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Base/SdacDemoForm.dfm new file mode 100644 index 0000000..d4b657d --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Base/SdacDemoForm.dfm @@ -0,0 +1,896 @@ +inherited SDACForm: TSDACForm + Left = 190 + Top = 236 + Caption = 'SDACForm' + PixelsPerInch = 96 + TextHeight = 13 + inherited TVSplitter: TSplitter + Color = clGreen + end + inherited pnTopLabel: TPanel + inherited lbTitle: TLabel + Caption = ' SDAC' + Color = clGreen + end + inherited lbAbout: TLabel + Left = 939 + Color = clGreen + end + end + inherited Panel2: TPanel + inherited Shape1: TShape + Brush.Color = clGreen + end + inherited Panel1: TPanel + Color = clGreen + end + inherited pnShowSource: TPanel + Color = clGreen + end + inherited pnOpenDemoDir: TPanel + Color = clGreen + end + end + inherited ImageList1: TImageList + Left = 593 + Top = 15 + Bitmap = { + 494C01010C000E00040010001100FFFFFFFFFF00FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000004400000001002000000000000044 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000800000000000000000 + 0000000000000080000000000000008000000080000000800000000000000000 + 0000000000000000000000000000000000000000000000800000000000000000 + 0000000000000080000000000000008000000080000000800000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000800000000000000000 + 0000000000000080000000000000008000000080000000800000000000008BB8 + CB00317DA400317DA400317DA400699BB7000000000000800000000000000080 + 0000000000000080000000000000000000000000000000800000000000000000 + 0000000000000000000000000000000000000000000000800000000000000080 + 0000000000000080000000000000000000000000000000800000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000800000000000000080 + 00000000000000800000000000000000000000000000008000000000000063B6 + D50082E9F70054D5FB003296CF001479B4000000000000800000000000000080 + 0000000000000080000000000000008000000080000000000000000000000000 + 0000000000000000000000000000000000000000000000800000000000000080 + 0000000000000080000000000000008000000080000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000800000000000000080 + 00000000000000800000000000000080000000800000000000000000000063B6 + D50082E9F70054D5FB003296CF001479B400000000000080000000800000B1A4 + 9A000080000000800000B1A49A00B1A49A000080000000800000634935006349 + 350063493500634935006349350063493500000000000080000000800000B1A4 + 9A000080000000800000B1A49A00B1A49A000080000000800000634935006349 + 3500634935006349350063493500634935000000000000000000000000000000 + 0000BBB0A700000000000000000000000000BBB0A7000000000000000000BBB0 + A7000000000000000000BBB0A700573E2B000000000000800000008000000000 + 00000080000000800000000000000000000000800000008000000000000063B6 + D50082E9F70054D5FB003296CF001479B40000000000BBA69700D2BDA800D4BD + AA00E9D6CA00E9D6CA00E9D7CC00E9D6CA00E9D6CA00E9D6CA00E9D6CA00E7CF + C200E6CEC000E6CCBE00E6CCBD006349350000000000BBA69700D2BDA800D4BD + AA00E9D6CA00E9D6CA00E9D7CC00E9D6CA00E9D6CA00E9D6CA00E9D6CA00E7CF + C200E6CEC000E6CCBE00E6CCBD006349350000000000C4B2A500D8C5B300D9C5 + B500EDDED700EDDDD400ECDCD200ECDBD100EBD9CF00D9C5B500EAD5CA00EAD5 + C900E8D4C800E8D2C600E8D2C500573E2B000000000000000000000000000000 + 000000000000000000000000000000000000DDD3CB00B1A49A006349350063B6 + D50082E9F70054D5FB003296CF001479B40000000000BBA69700FEFEFC00D2BD + A800FDF8F600FCF6F300FBF3EF00FAF0EA00F9ECE600D2BDA800F7E6DE00F6E3 + D900F5E0D500F4DDD200E6CCBE006349350000000000BBA69700FEFEFC00D2BD + A800FDF8F600FCF6F300FBF3EF00FAF0EA00F9ECE600D2BDA800F7E6DE00F6E3 + D900F5E0D500F4DDD200E6CCBE006349350000000000B39D8D00FEFEFC00CDB5 + 9F00FDF7F500FCF5F100FAF1ED00F9EEE700F8EAE300CDB59F00F6E3DA00F5DF + D400F4DCD000F3D9CD00E3C6B700573E2B000000000000000000000000000000 + 000000000000000000000000000000000000BBA69700D5C7BD00F6EFEA00C6E7 + ED009ED7E1009ED7E1009ED7E100699BB70000000000BBA69700D2BDA800D2BD + A800FDFBFA00D2BDA800D2BDA800D2BDA800FAEFEA00D2BDA800F8E9E100D2BD + A800D2BDA800D2BDA800E6CEC0006349350000000000BBA69700D2BDA800D2BD + A800FDFBFA00D2BDA800D2BDA800D2BDA800FAEFEA00D2BDA800F8E9E100AC8F + 7100AC8F7100AC8F7100E6CEC0006349350000000000B39D8D00CDB59F00CDB5 + 9F00FDFAF900CDB59F00CDB59F00CDB59F00F9EDE700CDB59F00F7E6DD00CDB5 + 9F00CDB59F00CDB59F00E3C8B900573E2B000000000000000000000000000000 + 00000000000000000000BBA69700634935006349350063493500634935006349 + 35006349350063493500EFE0D8006349350000000000BBA69700FFFFFF00D2BD + A800FEFDFD00FEFBFB00FDF9F700FCF6F300FBF3EF00D2BDA800F9ECE600F8EA + E200F7E6DD00F6E3D900E7CFC1006349350000000000BBA69700FFFFFF00D2BD + A800FEFDFD00FEFBFB00FDF9F700FCF6F300FBF3EF00D2BDA800F9ECE600F8EA + E200F7E6DD00F6E3D900E7CFC1006349350000000000B39D8D00FFFFFF00CDB5 + 9F00FEFDFD00FEFAFA00FDF8F600FCF5F100FAF1ED00CDB59F00F8EAE300F7E7 + DE00F6E3D900F5DFD400E4C9BA00573E2B000000000000000000E2DEDE00D9DA + D4000000000000000000BBA69700D5C7BD00F6EFEA00F3EAE400F1E5DE00EFE1 + D800D0BEB10063493500F0E4DC006349350000000000BBA69700D2BDA800D2BD + A800FFFFFF00D2BDA800D2BDA800D2BDA800FCF6F300D2BDA800FAEFEA00D2BD + A800D2BDA800D2BDA800E7D0C3006349350000000000BBA69700D2BDA800D2BD + A800FFFFFF00D2BDA800D2BDA800D2BDA800FCF6F300D2BDA800FAEFEA00F9ED + E600AC8F7100F7E6DE00E7D0C3006349350000000000B39D8D00CDB59F00CDB5 + 9F00FFFFFF00CDB59F00CDB59F00CDB59F00FCF5F100CDB59F00F9EDE700CDB5 + 9F00CDB59F00CDB59F00E4CABC00573E2B000000000000000000E0DDDD003A87 + 1A00DDD3CB00B1A49A0063493500634935006349350063493500634935006349 + 3500EFE0D80063493500BBA697006349350000000000BBA69700FFFFFF00D2BD + A800FFFFFF00FFFFFF00FFFEFC00FEFBFA00FDF9F700D2BDA800FBF3EF00FAF0 + EB00F9ECE600F7E9E100E8D2C6006349350000000000BBA69700FFFFFF00D2BD + A800FFFFFF00FFFFFF00FFFEFC00FEFBFA00FDF9F700D2BDA800FBF3EF00AC8F + 7100AC8F7100AC8F7100E8D2C6006349350000000000B39D8D00FFFFFF00CDB5 + 9F00FFFFFF00FFFFFF00FFFEFC00FEFAF900FDF8F600CDB59F00FAF1ED00F9EE + E800F8EAE300F6E6DD00E5CDBF00573E2B00000000007CAA680036851600277D + 0400277D0400EAE3DE00F6EFEA00F1E9E200F1E5DE00EFE1D800D0BEB1006349 + 3500F0E4DC0063493500BBA69700BBA6970000000000BBA69700D2BDA800D2BD + A800FFFFFF00D2BDA800D2BDA800D2BDA800FEFBFA00D2BDA800FCF6F300D2BD + A800D2BDA800D2BDA800E8D3C8006349350000000000BBA69700D2BDA800D2BD + A800FFFFFF00D2BDA800D2BDA800D2BDA800FEFBFA00D2BDA800FCF6F300FCF3 + EF00AC8F7100F9EDE600E8D3C8006349350000000000B39D8D00CDB59F00CDB5 + 9F00FFFFFF00CDB59F00CDB59F00CDB59F00FEFAF900CDB59F00FCF5F100CDB5 + 9F00CDB59F00CDB59F00E5CEC100573E2B007FAB6B0030820E00000000002F81 + 0D00DDD3CB00FCFAF900D4C6BC00BAA69600BBA69700D2C1B500EFE0D8006349 + 3500BBA6970063493500000000000000000000000000BBA69700FFFFFF00D2BD + A800FFFFFF00FFFFFF00FFFFFF00FFFFFF00FEFDFD00D2BDA800FDF9F700FCF6 + F300FBF3EF00FAF0EA00E9D5CA006349350000000000BBA69700FFFFFF00D2BD + A800FFFFFF00FFFFFF00FFFFFF00FFFFFF00FEFDFD00D2BDA800FDF9F700FCF6 + F300FBF3EF00FAF0EA00E9D5CA006349350000000000B39D8D00FFFFFF00CDB5 + 9F00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FEFDFD00CDB59F00FDF8F600FCF5 + F100FAF1ED00F9EEE700E6D0C400573E2B000000000000000000000000000000 + 0000BBA69700FAF6F300BBA69700F7F1ED00F5EDE700BBA69700F0E4DC006349 + 3500BBA69700BBA69700000000000000000000000000EFAD8C00EFAD9400EFAD + 8C00EFAD8C00EFA58400EFA57B00E7946B00EF946300E7845200EF844A00E773 + 4200E7733900E7733900E7733900CE6A370000000000EFAD8C00EFAD9400EFAD + 8C00EFAD8C00EFA58400EFA57B00E7946B00EF946300E7845200EF844A00E773 + 4200E7733900E7733900E7733900CE6A370000000000E7A18000E69E7D00E49A + 7800E3957200DF916C00DD8C6500DB865E00D9805700D57B5000D2764800D16F + 4200CE693C00CD653600CA613100C85E2D000000000000000000000000000000 + 0000BBA69700BBA69700FAF6F300F8F4F000F7F0EC00F5ECE600BBA697006349 + 35000000000000000000000000000000000000000000F7B59400FFC6A500FFCE + AD00FFC6A500FFC6A500FFBD9C00FFBD9400FFB58C00FFB58C00FFAD7B00FFAD + 7B00FFA57300FF9C7300F7946300CE69380000000000F7B59400FFC6A500FFCE + AD00FFC6A500FFC6A500FFBD9C00FFBD9400FFB58C00FFB58C00FFAD7B00FFAD + 7B00FFA57300FF9C7300F7946300CE69380000000000E7A18000E69F7D00E49A + 7800E3957100E1916C00DD8C6500DB865E00D9805800D57A5000D3764900D16F + 4200CF6A3C00CD653600CA613100C85D2E00000000002F810D00000000003082 + 0E006C904900BBA69700BBA69700BBA69700BBA69700BBA69700BBA69700BBA6 + 97000000000000000000000000000000000000000000EFAD8C00EFAD8C00EFAD + 8C00EFAD9400EFAD8C00EFAD8C00EFA58400EFA57B00E7946B00EF946300E78C + 5A00EF845200E77B4200E77B4200CE69380000000000EFAD8C00EFAD8C00EFAD + 8C00EFAD9400EFAD8C00EFAD8C00EFA58400EFA57B00E7946B00EF946300E78C + 5A00EF845200E77B4200E77B4200CE69380000000000E7A18000E69F7D00E49A + 7800E3957100E1916C00DD8C6500DB865E00D9805800D57A5000D3764900D16F + 4200CF6A3C00CD653600CA613100C85D2E00277D0400277D0400368516007CAA + 6800000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000003A871A00E0DDDD000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000800000000000000000 + 0000000000000080000000000000008000000080000000800000000000000000 + 0000000000000000000000000000000000000000000000800000000000000000 + 0000000000000080000000000000008000000080000000800000000000000000 + 0000000000000000000000000000000000000000000000800000000000000000 + 0000000000000080000000000000008000000080000000800000000000000000 + 0000000000000000000000000000000000000000000000800000000000000000 + 0000000000000080000000000000008000000080000000800000000000000000 + 0000000000000000000000000000000000000000000000800000000000000080 + 0000000000000080000000000000000000000000000000800000A7BED7006195 + A800688F9C0031738D00206C910092ADC4000000000000800000000000000080 + 0000000000000080000000000000000000000000000000800000000000000000 + 0000000000000000000000000000000000000000000000800000000000000080 + 0000000000000080000000000000000000000000000000800000000000000000 + 0000000000000000000000000000000000000000000000800000000000000080 + 0000000000000080000000000000000000000000000000800000447DA500447D + A500447DA500447DA500447DA500000000000000000000800000000000000080 + 00000000000000800000000000000080000000800000000000004692B9005FDA + FF00A1ECF80057D1F60002A8E7003B8EB4000000000000800000000000000080 + 0000000000000080000000000000008000000080000000000000000000000000 + 0000000000000000000000000000000000000000000000800000000000000080 + 0000000000000080000000000000008000000080000000000000000000000000 + 0000000000000000000000000000000000000000000000800000000000000080 + 0000000000000080000000000000008000000080000000000000447DA5008ADE + F00055C2E6003AB4E100447DA500000000000000000000800000008000000000 + 00000080000000800000000000000000000000800000008000004DA0C9005FD8 + FC00A0EAF60056CEF40003AAEB003286AD00000000000080000000800000B1A4 + 9A000080000000800000B1A49A00B1A49A000080000000800000634935006349 + 3500634935006349350063493500634935000000000000800000008000000000 + 0000008000000080000000000000000000000080000000800000000000000000 + 0000000000000000000000000000000000000000000000800000008000000000 + 0000008000000080000000000000000000000080000000800000447DA500A1EB + F60081D9EE0050C0E500447DA500000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000050A5C8005ED8 + FC00A0EAF60056CFF40005ACED0027789C0000000000BBA69700D2BDA800D4BD + AA00E9D6CA00E9D6CA00E9D7CC00E9D6CA00E9D6CA00E9D6CA00E9D6CA00E7CF + C200E6CEC000E6CCBE00E6CCBD00634935000000000000000000000000000000 + 0000000000000000000000000000529CED00BECEE30000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000447DA5008DE7 + FA009EE9F50077D4EC00447DA500000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000051A7CB005DD6 + FC00A0EAF60056CFF40001A6E7003A8DB60000000000BBA69700FEFEFC00D2BD + A800FDF8F600FCF6F300FBF3EF00FAF0EA00FAEFEB00E6DBCF00247C0000659F + 4700F9EDE600F5E1D700E6CCBE00634935000000000000000000000000000000 + 000000000000000000000000000082B2E9002D8BF100BECEE300000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000447DA500447D + A5004278A000447DA500447DA500000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000004EA9CD0060DA + FC009EE8F5004DCBF40000A5EB00348BB30000000000BBA69700D2BDA800D2BD + A800FDFBFA00D2BDA800D2BDA800D2BDA800FBF2ED00E6DBCF00FBF3EF00FBF1 + EC00FAEEE800F6E3D900E6CEC0006349350000000000A7BED7006191A900698A + 9D00316F8D002068910092ADC400000000004597F1003E85F400BECEE3000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000996952000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000067B6D0008BEF + FF00ADF8FF008AEFFF0059DDFF005DA8C20000000000BBA69700FFFFFF00D2BD + A800FEFDFD00FEFBFB00FDF9F700FCF6F300FCF5F100E6DBCF005E9C40007AAC + 6000FBF1EC00F8E9E100E8D1C30063493500000000004692B9005FDAFF00A1EC + F80057D1F60002A8E7003B8EB400000000009ABDE7004498F400377FF300BECE + E300000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000996952000000000000000000000000006448370062483700624A34006249 + 35006449350064483700624A3400634833006248370000000000AAD2DE0099D3 + E00095CED7009ED0D500A3D7DD00A8C8D10000000000BBA69700D2BDA800D2BD + A800FFFFFF00D2BDA800D2BDA800D3BFAB00FCF7F500E6DBCF0097BD8200247C + 0000A5C38F00FBF1ED00EBD8CD00664D3900000000004DA0C9005FD8FC00A0EA + F60056CEF40003AAEB003286AD000000000000000000589EED00408DF4003279 + F300BECEE3000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000099695200000000000000000000000000B7A89500FFFAF700D2BDA700FCF6 + F100F7F2EF00FAE9E000F6E6DF00F7E6DD006149330000000000000000000000 + 00000000000000000000000000000000000000000000BBA69700FFFFFF00D2BD + A800FFFFFF00FFFFFF00FFFEFC00FEFCFB00FEFBFA00E6DBCF00FDF8F6007AAD + 6200247C0000B3CB9F00F0E2DB006F5745000000000050A0C8005ED8FC00A0EA + F60056CFF40005ACED0027789C000000000000000000B2C8E5002F84F3002872 + F2002F74F300BECEE30000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000E6CA + BE0070311700E6CABE000000000000000000BDA59900D0BDA800D3BBA700FEF7 + F400D4BCA800D0BCAA00D3BBA700F8E8E1006448370000000000000000000000 + 00000000000000000000000000000000000000000000BBA69700D2BDA800D2BD + A800FFFFFF00D2BDA800D6C3B000E3D6C80098C18600B2C29800FDFAF800FDF8 + F6004F9531005E9C4000F2E7E10077604E000000000051A2CB005DD6FC00A0EA + F60056CFF40001A6E7003A8DB6000000000000000000000000004694EF00256F + F2002272F2003079F300BECEE3000000000000000000447DA500447DA500447D + A500447DA500447DA50000000000000000000000000000000000E6CABE009C59 + 3900BD69400095492700E6CABE0000000000BBA79500FFFDFD00CFBCA700FAF8 + F800FDF6F300FAF0E900F9EEEA00F9ECE400654A360000000000000000005D8A + 4400337F130036751600000000000000000000000000BBA69700FFFFFF00D2BD + A800FFFFFF00FFFFFF00FFFFFF00FFFFFF007BB0660031820E00B5D1A700A6C8 + 95003284100097BE8200F2E5DF00725B4900000000004EA4CE0060DAFC009EE8 + F5004DCBF40000A5EB00348BB30000000000000000002B87F2003382F300226E + F2002275F2002281F2002D8BF100A6C3E60000000000447DA5008ADEF00055C2 + E6003AB4E100447DA500000000000000000000000000E6CABE00A56C5100D58E + 6B00DD8B6400CC764D00974D2B00E6CABE00BBA69700D4BDA700D1BEA900FEF9 + FB00D4BDA700D2BDA800D2BDA700FBF0EC005F49370000000000000000000000 + 00003485130035861300000000000000000000000000EFAD8C00EFAD9400EFAD + 8C00EFAD8C00EFA58400EFA57B00E7946B00E7AB8D00ECBFA9008E9F5900598D + 2B00588C2A00999D5C00E6B19700CE6A37000000000068B1D1008BEFFF00ADF8 + FF008AEFFF0059DDFF005DA8C200000000000000000082B2E9002F7EF300226D + F2002276F2002281F200000000000000000000000000447DA500A1EBF60081D9 + EE0050C0E5004278A0009969520099695200996952007F503900CF937600E8A7 + 8700E59E7B00E0926C00C2744E0074391F00BFAD9C00FEFAF900D8C5B000FCF7 + F600FCF3EF00F6EAE800FCF1ED00F8EFEE006950350000000000000000003485 + 1300000000006CA15400000000000000000000000000F7B59400FFC6A500FFCE + AD00FFC6A500FFC6A500FFBD9C00FFBD9400E1977300E4A28300E9B59D00EABA + A200E8B79E00E4A98B00D9886000D272430000000000AAD2DE0099D3E00095CE + D7009ED0D500A3D7DD00A8C8D1000000000000000000000000003176F300226E + F2002276F2002380F2002E8AF1000000000000000000447DA5008DE7FA009EE9 + F50077D4EC00447DA500000000000000000000000000E6CABE00A7725800DD9F + 8100EAAA8B00DA977800A2664900E6CABE00E9A98A00E3A08100E49D7C00DD99 + 7600D9957000D8896000D47F5200B37334009A7935003485130034851300A7C0 + 9A000000000000000000000000000000000000000000EFAD8C00EFAD8C00EFAD + 8C00EFAD9400EFAD8C00EFAD8C00EFA58400EFA57B00E7946B00EF946300E78C + 5A00EF845200E77B4200E77B4200CE6938000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000009ABDE700217C + F200227EF2002283F2002287F2004696EF0000000000447DA500447DA500447D + A500447DA500447DA50000000000000000000000000000000000E6CABE00A772 + 5800CF937600A7725800E6CABE0000000000EAAC8E00E7A38000E39B7900DF94 + 6E00DC8A6100D7805400D5784B00CE6E3E00C66B370000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000E6CA + BE007F503900E6CABE0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000C2A6A400C2A6 + A400C2A6A400C2A6A400C2A6A400C2A6A400C2A6A400C2A6A400C2A6A400C2A6 + A400C2A6A400C2A6A40000000000000000000000000000800000000000000000 + 0000000000000080000000000000008000000080000000800000000000000000 + 00000000000000000000000000000000000000000000DB322E00DB322E00DB32 + 2E0000000000DB322E0000000000DB322E000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000C2A6A400FEFC + FB00FEFCFB00FEFCFB00FEFCFB00FEFCFB00FEFCFB00FEFCFB00FEFCFB00FEFC + FB00FEFCFB00C2A6A40000000000000000000000000000800000000000000080 + 0000000000000080000000000000000000000000000000800000A5C7D5005F95 + A800678E9C002F728C001E6B900091B1C40000000000DB322E00000000000000 + 000000000000DB322E00DB322E00DF8785000000000000000000A6C7D5006195 + A800688F9C0031738D00206C910092B1C4000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000C2A6A400FEFC + FB00FEFCFB00FEFCFB00FEFCFB00FEFCFB00FEFCFB00FEFCFB00FEFCFB00FEFC + FB00FEFCFB00C2A6A40000000000000000000000000000800000000000000080 + 00000000000000800000000000000080000000800000000000004497B8005FDA + FF00A1ECF80057D1F60002A8E7003B8EB40000000000DB322E00000000000000 + 000000000000DB322E0000000000DB322E0000000000000000004698B8005FDA + FF00A1ECF80057D1F60002A8E7003B8EB40077848F006E7C8500626F7900535F + 6800444E5600333C4300252C3200191F240010151A0010151A0010151A001015 + 1A0010151A0010151A0010151A00000000000000000000000000C2A6A400FEFA + F500FEFCFB00FEFAF500FEFAF500FEFCFB00FEFAF500FEFAF500FEFCFB00FEFA + F500FEFAF500C2A6A40000000000000000000000000000800000008000000000 + 00000080000000800000000000000000000000800000008000004AA4C8005FD8 + FC00A0EAF60056CEF40003AAEB003286AD0000000000DB322E00DB322E00DB32 + 2E0000000000DB322E00DB322E00DB322E0000000000000000004DA5C9005FD8 + FC00A0EAF60056CEF40003AAEB003286AD0079879200A2DFF00072CDEA004BB8 + E20039AEDB002FA9D90028A1D2002398C700228EBC002083AE001B81AB00177E + A9001D799F0021749600191F2400000000000000000000000000C2A6A400FEFA + F500FEFAF500FEFAF500FEFAF500FEFAF500FEFAF500FEFAF500FEFAF500FEFA + F500FEFAF500C2A6A400000000000000000000000000BBA79600BBA69700BBA6 + 9700BBA69700BBA69700BBA69700BBA69700BBA69700BBA697004CA3C6005ED8 + FC00A0EAF60056CFF40005ACED0027789C000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000050A5C8005ED8 + FC00A0EAF60056CFF40005ACED0027789C007C8A9500A9ECF60095E5FC0082DE + FB0075D5FA006CD0F7005DC5F40052BEF00044B4EC0038ABE9002EA4E300229A + DF001890D7001D799F0022292F00000000000000000000000000C2A6A400FEF7 + F000FEF7F000FEF7F000FEF7F000FEF7F000FEF7F000FEF7F000FEF7F000FEF7 + F000FEF7F000C2A6A400000000000000000000000000BBA69700F3E2D900EEE1 + D900EEDED800EBDFD300EEDDD400EBDBD400EADAD400E9DAD1004EA6CA005DD6 + FC00A0EAF60056CFF40001A6E7003A8DB6000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000051A7CB005DD6 + FC00A0EAF60056CFF40001A6E7003A8DB6007F8E9800B6EEF8009BE8FB0095E5 + FC0082DEFB0075D5FA006ACAF4005DC5F4004FBCF00044B4EC0038ABE9002EA4 + E3001F96DC00177EA9002F363D00000000000000000000000000C2A6A400FEF7 + F000FEF7F000FEF7F000FEF7F000FEF3E900FEF7F000FEF7F000FEF3E900FEF7 + F000FEF7F000C2A6A400000000000000000000000000BBA79600F1E1DA00F0E0 + D900CDBAB200CCBCAF00CABBB200CFBBB000EBDBD400CCBAAF004BA8CD0060DA + FC009EE8F5004DCBF40000A5EB00348BB30000000000BBA69700634935006349 + 35006349350063493500634935006349350063493500634935004BA6C90060DA + FC009EE8F5004DCBF40000A5EB00348BB30083959F00B6EEF800ABEDFB009BE8 + FB008BE2FC0082DEFB0075D5FA006ACAF4005DC5F4004FBCF00040B3ED0038AB + E900269EE2001282B4003D454D00000000000000000000000000C2A6A400FEF3 + E900FEF3E900FEF3E900FEF3E900FEF3E900FEF3E900FEF3E900FEF3E900FEF3 + E900FEF3E900C2A6A400000000000000000000000000B8A59600F4E2DB00F1E1 + DA00FFF3ED00FFF3EF00FCF4ED00CCB9B100E9DDD300FFF3ED0065B5D0008BEF + FF00ADF8FF008AEFFF0059DDFF005DA8C20000000000BBA69700EBE6E200EBE4 + E000EAE1DC00D2BDA800E8DCD400E5D3C900E4CFC500D2BDA80067B6D0008BEF + FF00ADF8FF008AEFFF0059DDFF005DA8C20083959F00BEF0F900ABF0F700A5EC + FB009BE8FB008BE2FC007EDCFC0075D5FA0065CCF7005DC5F4004FBCF00040B3 + ED002EA4E3000E8ABF004B555E00000000000000000000000000C2A6A400FFF0 + E200FFF0E200FEF3E900FFEEDE00FEF3E900FFEEDE00FEF3E900FFEEDE00FEF3 + E900FFEEDE00C2A6A400000000000000000000000000BBA79500F1E4DC00EEE3 + DB00F1E2D900F0E0D900EEDED700EDDED500EFDFD300E9DCD400AAD2DE0099D3 + E00095CED7009ED0D500A3D7DD00A8C8D10000000000BBA69700FFFFFE00FEFD + FC00FDFAF900D2BDA800FCF5F100F9EBE400F8E8E000D2BDA800AAD2DE0099D3 + E00095CED7009ED0D500A3D7DD00A8C8D100869AA300BEF0F900B6EEF800B6EE + F800A5ECFB0095E5FC008BE2FC007EDCFC0075D5FA0065CCF7005DC5F4004FBC + F00037A9E7000E8FC70059656D00000000000000000000000000C2A6A400FEF3 + E900FFEEDE00FFF0E200FEF3E900FFEEDE00FFF0E200DDCFC200DDCFC200DDCF + C200DDCFC200C2A6A400000000000000000000000000B9A69700F3E3DC00F5E3 + DC00FFFFFF00FFFFFF00FFFFFF00FBFFFF00FDFFFF00FFFFFE00FFFFFF00FDFF + FF00E4D7CF00E9D7D000624837000000000000000000BBA69700D2BDA800D2BD + A800D2BDA800D2BDA800D2BDA800D2BDA800D2BDA800D2BDA800D2BDA800D2BD + A800D2BDA8006349350000000000000000008A9DA700BEF0F900B6EEF800B6EE + F800ABF0F700A5ECFB0095E5FC008BE2FC007EDCFC0071D3FA0065CCF70057C3 + F3004FBCF0001B99CF0065727C00000000000000000000000000C2A6A400FFEE + DE00FFEEDE00FFEEDE00FFEEDE00FFEEDE00FFEEDE00C3B4A800C3B4A800C3B4 + A800C3B4A800C2A6A400000000000000000000000000BBA69700F1E4DC00EEE4 + DA00F0E2DC00F3E2D900F3E2D900F0E0D900ECDED800EADDD500E9DDD300E9DD + D300EBD9D200E9D9D200644934000000000000000000BBA69700FFFFFF00FFFF + FF00FFFEFE00D2BDA800FDFAF900FAF1ED00F9EDE800D2BDA800F7E7DF00F7E4 + DC00F5E1D7006349350000000000000000008FA4AC00BEF0F900BEF0F900BEF0 + F900BEF0F900B4F2F800ABEDFB00A5ECFB0095E5FC008ADFFC007EDCFC0075D5 + FA006ACAF4005DC5F40065727C00000000000000000000000000C2A6A400FFEE + DE00FFEAD700FFEEDE00FFEAD700FFEAD700FFEEDE00B0A29600B0A29600B0A2 + 9600B0A29600C2A6A400000000000000000000000000BBA59A00F3E3DD00F4E5 + DC00FDFFFF00FFFFFF00FFFFFE00FFFFFE00FFFFFE00FFFFFE00FFFFFF00FFFE + FF00E8DCD200E9D9D200624A34000000000000000000BBA69700FFFFFF00FFFF + FF00FFFFFF00D2BDA800FEFCFB00FBF4F100FAF1EC00D2BDA800F8EAE300F7E7 + DF00F6E4DB006349350000000000000000008FA4AC008FA4AC008FA4AC008FA4 + AC008FA4AC008CA0A9008A9DA7008A9DA700869AA300869AA3008395A0008395 + A0008395A0008395A00000000000000000000000000000000000C2A6A400FFEA + D700FFEAD700FFEAD700FFEAD700FFEAD700C9B9AC00FEFAF500FEF7F000E6DA + D900C2A6A40000000000000000000000000000000000BBA59900F4E4DD00F5E2 + DD00F5E3DC00F2E2DB00F0E3DB00EFE1DB00EDE0D800EEDFD600EDDED500EDDD + D600EBDBD400ECDAD300634834000000000000000000BBA69700D2BDA800D2BD + A800D2BDA800D2BDA800D2BDA800D2BDA800D2BDA800D2BDA800D2BDA800D2BD + A800D2BDA8006349350000000000000000008FA4AC00B2E4EC00B6EEF800B6EE + F800A9ECF60092E1F3008FA4AC00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000C2A6A400FFEA + D700FFE6D000FFEAD700FFE6D000FFEAD700C5B5A900FEFAF500DDCFC200C2A6 + A4000000000000000000000000000000000000000000E1997100E1966F00E092 + 6E00E1926900DD8E6300DD895F00DC865C00DB815800D97D5200D6794C00D374 + 4800CF724100D06E3E00D26C3C000000000000000000BBA69700FFFFFF00FFFF + FF00FFFFFF00D2BDA800FFFFFF00FDFAF800FCF7F400D2BDA800FAF1EB00F9EE + E700F8EAE300634935000000000000000000000000008FA4AC008FA4AC008FA4 + AC008FA4AC008FA4AC0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000C2A6A400FFE6 + D000FFE6D000FFE6D000FFE6D000FFE6D000C9B9AC00DDCFC200C2A6A4000000 + 00000000000000000000000000000000000000000000E3977300E2977100DF93 + 6F00E0906B00DD8C6600DB896000D9855B00D7825500D47E5000D47A4B00D375 + 4700D2714500D56F3F00D06C3C000000000000000000BBA69700FFFFFF00FFFF + FF00FFFFFF00D2BDA800FFFFFF00FEFBFA00FDF9F700D2BDA800FBF3EF00FAF0 + EA00F9ECE6006349350000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000C2A6A400C2A6 + A400C2A6A400C2A6A400C2A6A400C2A6A400C2A6A400C2A6A400000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000BBA69700BBA69700BBA6 + 9700BBA69700BBA69700BBA69700BBA69700BBA69700BBA69700BBA69700BBA6 + 9700BBA69700BBA697000000000000000000424D3E000000000000003E000000 + 2800000040000000440000000100010000000000200200000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFF + BA3FBA3FAABBBA20ABBFABBF98ABABA0AA7FAA7FAAABAA608000800080009320 + 800080008000FF00800080008000FF00800080008000FC00800080008000CC00 + 800080008000C00080008000800080008000800080002003800080008000F003 + 800080008000F00F800080008000A00F8000800080000FFFFFFFFFFFFFFF9FFF + FFFFFFFFFFFFFFFFBA3FBA3FBA3FBA3FAB80ABBFABBFAB81AA40AA7FAA7FAA41 + 93008000933F9301FFC08000FE7FFFC1FFC08000FE3FFFC1FFC08000811FFFF7 + FFC08000810FFFF7004080008187FFF7007F80008183FFE3007F800081C183C1 + 00638000818083800073800081838000006B800081C18380000F8000FFC083C1 + 007FFFFFFFFFFFE3FFFFFFFFFFFFFFFFFFFFC003BA3F8AFFFFFFC003AB80B8C0 + FFFFC003AA40BAC00001C003930088C00001C0038000FFC00001C0038000FFC0 + 0001C003800080000001C003800080000001C003800080000001C00380018003 + 0001C003800180030001C003800180030003C0078001800301FFC00F80018003 + 83FFC01F80018003FFFFC03FFFFF8003} + end + object MSConnection: TMSConnection + Database = 'master' + ConnectDialog = MSConnectDialog1 + Left = 465 + Top = 10 + end + object MSConnectDialog1: TMSConnectDialog + Caption = 'Connect' + UsernameLabel = 'User Name' + PasswordLabel = 'Password' + ServerLabel = 'Server' + DatabaseLabel = 'Database' + ConnectButton = 'Connect' + CancelButton = 'Cancel' + LabelSet = lsCustom + Left = 500 + Top = 10 + end + object scCreate: TMSScript + SQL.Strings = ( + 'CREATE TABLE SDAC_Long_char (' + ' Code INT IDENTITY (1, 1) PRIMARY KEY,' + ' Title VARCHAR(30),' + ' Value VARCHAR(5000)' + ');' + '' + 'CREATE TABLE SDAC_Pictures (' + ' UID int IDENTITY (1, 1) PRIMARY KEY NOT NULL,' + ' Name VARCHAR(50),' + ' Picture IMAGE' + ');' + '' + 'CREATE TABLE Loaded1 (' + ' uid INT IDENTITY (1, 1) NOT NULL PRIMARY KEY,' + ' Field1 VARCHAR(20),' + ' Field2 VARCHAR(20),' + ' Field3 VARCHAR(20)' + ');' + '' + 'CREATE TABLE Loaded2 (' + ' uid INT IDENTITY (1, 1) NOT NULL PRIMARY KEY,' + ' Field1 VARCHAR(20),' + ' Field2 VARCHAR(20),' + ' Field3 VARCHAR(20)' + ');' + '' + 'CREATE TABLE ThreadTable (' + ' ID INT,' + ' NAME VARCHAR(30)' + ');' + '' + 'CREATE TABLE SDAC_Text (' + ' UID INT IDENTITY PRIMARY KEY,' + ' [Name] NVARCHAR(50),' + ' TextField TEXT' + ');' + '' + 'CREATE TABLE Sdac_Loaded (' + ' Code INT,' + ' Num INT,' + ' Num1 FLOAT,' + ' Str VARCHAR(50),' + ' Dat DATETIME' + ');' + '' + 'CREATE TABLE CRGRID_TEST(' + ' Id int PRIMARY KEY,' + ' Name VARCHAR(10),' + ' Country VARCHAR(30),' + ' City VARCHAR(30),' + ' Street VARCHAR(30),' + ' BirthDate DATETIME,' + ' Job VARCHAR(9),' + ' Hiredate DATETIME,' + ' Sal NUMERIC(7, 2),' + ' Remarks TEXT' + ');' + '' + 'INSERT INTO CRGRID_TEST ' + + ' (Id, Name, Country, City, Street, BirthDate, Job, HireDate, Sa' + + 'l)' + 'VALUES ' + + ' (5001, '#39'SMITH'#39', '#39'ENGLAND'#39', '#39'LONDON'#39', '#39'BOND st.'#39', '#39'12-OCT-63'#39', ' + + #39'CLERK'#39','#39'17-DEC-80'#39', 800);' + 'INSERT INTO CRGRID_TEST' + + ' (Id, Name, Country, City, Street, BirthDate, Job, HireDate, Sa' + + 'l)' + 'VALUES ' + + ' (5002, '#39'ALLEN'#39', '#39'ENGLAND'#39', '#39'LONDON'#39', '#39'BAKER st.'#39', '#39'04-MAR-61'#39',' + + ' '#39'SALESMAN'#39','#39'20-FEB-81'#39', 1600);' + 'INSERT INTO CRGRID_TEST ' + + ' (Id, Name, Country, City, Street, BirthDate, Job, HireDate, Sa' + + 'l)' + 'VALUES ' + + ' (5003, '#39'MARTIN'#39', '#39'FRANCE'#39', '#39'LION'#39', '#39'WEAVER st.'#39', '#39'23-JAN-57'#39', ' + + #39'MANAGER'#39','#39'02-APR-81'#39', 2900);' + ' ' + ' CREATE TABLE DEPT (' + ' DEPTNO INT PRIMARY KEY,' + ' DNAME VARCHAR(14),' + ' LOC VARCHAR(13)' + ');' + 'INSERT INTO DEPT VALUES (10,'#39'ACCOUNTING'#39','#39'NEW YORK'#39');' + 'INSERT INTO DEPT VALUES (20,'#39'RESEARCH'#39','#39'DALLAS'#39');' + 'INSERT INTO DEPT VALUES (30,'#39'SALES'#39','#39'CHICAGO'#39');' + 'INSERT INTO DEPT VALUES (40,'#39'OPERATIONS'#39','#39'BOSTON'#39');' + '' + 'CREATE TABLE emp (' + ' EMPNO int IDENTITY(1,1) NOT NULL PRIMARY KEY,' + ' ENAME varchar(10) default NULL,' + ' JOB varchar(9) default NULL,' + ' MGR int default NULL,' + ' HIREDATE datetime default NULL,' + ' SAL float default NULL,' + ' COMM float default NULL,' + ' DEPTNO int default NULL' + ' );' + + 'INSERT INTO emp VALUES ('#39'SMITH'#39', '#39'CLERK'#39', 7902, '#39'1980-12-17 00:0' + + '0:00'#39', 800, NULL, 20);' + + 'INSERT INTO emp VALUES ('#39'ALLEN'#39', '#39'SALESMAN'#39', 7698, '#39'1981-02-20 0' + + '0:00:00'#39', 1600, 300, 30);' + + 'INSERT INTO emp VALUES ('#39'WARD'#39', '#39'SALESMAN'#39', 7698, '#39'1981-02-22 00' + + ':00:00'#39', 1250, 500, 30);' + + 'INSERT INTO emp VALUES ('#39'JONES'#39', '#39'MANAGER'#39', 7839, '#39'1981-04-02 00' + + ':00:00'#39', 2975, NULL, 20);' + + 'INSERT INTO emp VALUES ('#39'MARTIN'#39', '#39'SALESMAN'#39', 7698, '#39'1981-09-28 ' + + '00:00:00'#39', 1250, 1400, 30);' + + 'INSERT INTO emp VALUES ('#39'BLAKE'#39', '#39'MANAGER'#39', 7839, '#39'1981-05-01 00' + + ':00:00'#39', 2850, NULL, 30);' + + 'INSERT INTO emp VALUES ('#39'CLARK'#39', '#39'MANAGER'#39', 7839, '#39'1981-06-09 00' + + ':00:00'#39', 2450, NULL, 10);' + + 'INSERT INTO emp VALUES ('#39'SCOTT'#39', '#39'ANALYST'#39', 7566, '#39'1987-07-13 00' + + ':00:00'#39', 3000, NULL, 20);' + + 'INSERT INTO emp VALUES ('#39'KING'#39', '#39'PRESIDENT'#39', NULL, '#39'1981-11-17 0' + + '0:00:00'#39', 5000, NULL, 10);' + + 'INSERT INTO emp VALUES ('#39'TURNER'#39', '#39'SALESMAN'#39', 7698, '#39'1981-09-08 ' + + '00:00:00'#39', 1500, 0, 30);' + + 'INSERT INTO emp VALUES ('#39'ADAMS'#39', '#39'CLERK'#39', 7788, '#39'1987-07-13 00:0' + + '0:00'#39', 1100, NULL, 20);' + + 'INSERT INTO emp VALUES ('#39'JAMES'#39', '#39'CLERK'#39', 7698, '#39'1981-12-03 00:0' + + '0:00'#39', 950, NULL, 30);' + + 'INSERT INTO emp VALUES ('#39'FORD'#39', '#39'ANALYST'#39', 7566, '#39'1981-12-03 00:' + + '00:00'#39', 3000, NULL, 20);' + + 'INSERT INTO emp VALUES ('#39'MILLER'#39', '#39'CLERK'#39', 7782, '#39'1982-01-23 00:' + + '00:00'#39', 1300, NULL, 10);' + '' + 'GO' + '' + 'CREATE PROCEDURE SDAC_InsertEmp ' + #9'@ENAME'#9'nvarchar(20),' + #9'@JOB'#9'nvarchar(10)' + 'AS' + #9'INSERT INTO ' + #9#9'EMP (ENAME, JOB) ' + #9'VALUES' + #9#9'(@ENAME, @JOB) ' + #9'RETURN @@Identity;' + '' + 'GO' + '' + 'CREATE PROCEDURE SDAC_UpdateEmp ' + #9'@EMPNO'#9'int,' + #9'@ENAME'#9'nvarchar(20),' + #9'@JOB'#9'nvarchar(10),' + ' @EMPINFO nvarchar(30) OUTPUT' + 'AS' + #9'UPDATE EMP' + #9'SET ' + #9#9'ENAME = @ENAME, JOB = @JOB ' + #9'WHERE' + #9#9'EMPNO = @EMPNO' + ' SET @EMPINFO = CAST(@EMPNO AS nvarchar) + '#39' '#39' + @JOB' + ' RETURN @EMPNO;' + '' + 'GO' + '' + 'CREATE PROCEDURE SDAC_DeleteEmp ' + #9'@EMPNO'#9'int,' + #9'@Result'#9'int OUTPUT' + 'AS' + #9'DELETE Emp' + #9'WHERE' + #9#9'EmpNO = @EmpNO' + #9'SET @Result = @EmpNO + 2;' + '' + 'GO' + '' + 'CREATE PROCEDURE "Ten Most High-Paid Employees" AS' + 'BEGIN' + ' SET ROWCOUNT 10' + ' SELECT Emp.EName AS TenMostHighPaidEmployees, Emp.SAL' + ' FROM Emp' + ' ORDER BY Emp.SAL DESC' + ' SET ROWCOUNT 0' + 'END;'#9) + OnError = OnScriptError + Connection = MSConnection + Left = 465 + Top = 45 + end + object scDrop: TMSScript + SQL.Strings = ( + + 'IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'#39'[' + + 'Loaded1]'#39') AND OBJECTPROPERTY(id, N'#39'IsUserTable'#39') = 1)' + ' DROP TABLE [Loaded1];' + + 'IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'#39'[' + + 'Loaded2]'#39') AND OBJECTPROPERTY(id, N'#39'IsUserTable'#39') = 1)' + ' DROP TABLE [Loaded2];' + + 'IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'#39'[' + + 'SDAC_Long_char]'#39') AND OBJECTPROPERTY(id, N'#39'IsUserTable'#39') = 1)' + ' DROP TABLE [SDAC_Long_char];' + + 'IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'#39'[' + + 'SDAC_Pictures]'#39') AND OBJECTPROPERTY(id, N'#39'IsUserTable'#39') = 1)' + ' DROP TABLE [SDAC_Pictures];' + + 'IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'#39'[' + + 'dbo].[SDAC_DeleteEmp]'#39') AND OBJECTPROPERTY(id, N'#39'IsProcedure'#39') =' + + ' 1)' + ' DROP PROCEDURE [dbo].[SDAC_DeleteEmp];' + + 'IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'#39'[' + + 'dbo].[SDAC_InsertEmp]'#39') AND OBJECTPROPERTY(id, N'#39'IsProcedure'#39') =' + + ' 1)' + ' DROP PROCEDURE [dbo].[SDAC_InsertEmp];' + + 'IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'#39'[' + + 'dbo].[SDAC_UpdateEmp]'#39') AND OBJECTPROPERTY(id, N'#39'IsProcedure'#39') =' + + ' 1)' + ' DROP PROCEDURE [dbo].[SDAC_UpdateEmp];' + + 'IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'#39'[' + + 'ThreadTable]'#39') AND OBJECTPROPERTY(id, N'#39'IsUserTable'#39') = 1)' + ' DROP TABLE [ThreadTable];' + + 'IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'#39'[' + + 'SDAC_Text]'#39') AND OBJECTPROPERTY(id, N'#39'IsUserTable'#39') = 1)' + ' DROP TABLE [SDAC_Text];' + + 'IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'#39'[' + + 'SDAC_Loaded]'#39') AND OBJECTPROPERTY(id, N'#39'IsUserTable'#39') = 1)' + ' DROP TABLE [SDAC_Loaded];' + + 'IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'#39'[' + + 'dbo].[Ten Most High-Paid Employees]'#39') AND OBJECTPROPERTY(id, N'#39'I' + + 'sProcedure'#39') = 1)' + ' DROP PROCEDURE [dbo].[Ten Most High-Paid Employees];' + + 'IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'#39'[' + + 'CRGRID_TEST]'#39') AND OBJECTPROPERTY(id, N'#39'IsUserTable'#39') = 1)' + ' DROP TABLE [CRGRID_TEST];' + + 'IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'#39'[' + + 'SDAC_Loaded]'#39') AND OBJECTPROPERTY(id, N'#39'IsUserTable'#39') = 1)' + ' DROP TABLE [SDAC_Loaded];' + + 'IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'#39'[' + + 'emp]'#39') AND OBJECTPROPERTY(id, N'#39'IsUserTable'#39') = 1)' + ' DROP TABLE [emp];' + + 'IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'#39'[' + + 'dept]'#39') AND OBJECTPROPERTY(id, N'#39'IsUserTable'#39') = 1)' + ' DROP TABLE [dept];') + OnError = OnScriptError + Connection = MSConnection + Left = 500 + Top = 46 + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Base/SdacDemoForm.pas b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Base/SdacDemoForm.pas new file mode 100644 index 0000000..db2a022 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Base/SdacDemoForm.pas @@ -0,0 +1,184 @@ +{$I DacDemo.inc} +unit SdacDemoForm; + +interface + +uses + SysUtils, Classes, DB, + {$IFDEF VER6P} + Variants, + {$ENDIF} + Windows, Messages, Graphics, Controls, Forms, SdacVcl, + Dialogs, Menus, ImgList, StdCtrls, ComCtrls, Buttons, ExtCtrls, ToolWin, + DBAccess, MSAccess, SdacAbout, DemoFrame, DemoForm, DemoBase, DAScript, + MSScript; + +type + TSdacForm = class(TDemoForm) + MSConnection: TMSConnection; + MSConnectDialog1: TMSConnectDialog; + scCreate: TMSScript; + scDrop: TMSScript; + procedure lbAboutClick(Sender: TObject); override; + procedure cbDebugClick(Sender: TObject); + private + { Private declarations } + protected + //Product customization + function GetConnection: TCustomDAConnection; override; + function ApplicationTitle: string; override; + function ProductName: string; override; + procedure RegisterDemos; override; + public + function ProductColor: TColor; override; + procedure ExecCreateScript; override; + procedure ExecDropScript; override; + end; + +var + SdacForm: TSdacForm; + +implementation + +uses + CachedUpdates, +{$IFDEF CRDBGRID} + CRDBGrid, +{$ENDIF} + ConnectDialog, FetchAll, LongStrings, MasterDetail, + Pictures, Query, ServerCursors, Sql, StoredProc, StoredProcUpdates, +{$IFNDEF STD} + ServiceBroker, +{$ENDIF} +{$IFDEF WIN32} + Threads, +{$ENDIF} + FilterAndIndex, Table, Text, UpdateSQL, VTable{$IFNDEF STD}, Loader{$ENDIF}; + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} + +function TSdacForm.GetConnection: TCustomDAConnection; +begin + Result := MSConnection; +end; + +function TSdacForm.ProductColor: TColor; +begin + Result := clGreen; +end; + +procedure TSdacForm.ExecCreateScript; +begin + scCreate.Execute; +end; + +procedure TSdacForm.ExecDropScript; +begin + scDrop.Execute; +end; + +function TSdacForm.ApplicationTitle: string; +begin + Result := 'SQL Server Data Access Components demos'; +end; + +function TSdacForm.ProductName: string; +begin + Result := 'SDAC'; +end; + +procedure TSdacForm.RegisterDemos; +begin + Demos.RegisterCategory('SDAC Demo', 'SDAC Demo'); + Demos.RegisterCategory('Working with components', 'Working with components'); + Demos.RegisterCategory('General demos', 'General demos'); + Demos.RegisterCategory('SQL Server specific', 'SQL Server specific'); + + Demos.RegisterDemo('ConnectDialog', 'Customizing login dialog', 'Demonstrates how to customize the SDAC connect dialog. Changes the standard SDAC connect dialog to two custom connect dialogs. The first customized sample dialog is inherited from the TForm class, ' + 'and the second one is inherited from the default SDAC connect dialog class.', 'Working with components', TConnectDialogFrame, 2); +{$IFDEF CRDBGRID} + Demos.RegisterDemo('CRDBGrid', 'Using TCRDBGrid component', 'Demonstrates how to work with the TCRDBGrid component. Shows off the main TCRDBGrid features, like filtering, searching, stretching, using compound headers, and more.', 'Working with components', TCRDBGridFrame, 3); +{$ENDIF} +{$IFNDEF STD} + Demos.RegisterDemo('Loader', 'Using TMSLoader component', 'Uses the TMSLoader component to quickly load data into a server table. This demo also compares the two TMSLoader data loading handlers: GetColumnData and PutData.', 'Working with components', TLoaderFrame, 4); +{$ENDIF} + Demos.RegisterDemo('Query', 'Using TMSQuery component', 'Demonstrates working with TMSQuery, which is one of the most useful SDAC components. Includes many TMSQuery usage scenarios. Demonstrates how to execute queries in both standard and NonBlocking mode' + ' and how to edit data and export it to XML files. Note: This is a very good introductory demo. We recommend starting here when first becoming familiar with SDAC.', 'Working with components', TQueryFrame, 5); + Demos.RegisterDemo('Sql', 'Using TMSSQL component', 'Uses the TMSSQL component to execute SQL statements. Demonstrates how to work in a separate thread, in standard mode, in NonBlocking mode, and how to break long-duration query execution.', 'Working with components', TSqlFrame, 6); + Demos.RegisterDemo('StoredProc', 'Using TMSStoredProc component', 'Uses the TMSStoredProc component to access an editable recordset from an MS SQL stored procedure in the client application.', 'Working with components', TStoredProcFrame, 7); + Demos.RegisterDemo('Table', 'Using TMSTable component', 'Demonstrates how to use TMSTable to work with data from a single table on the server without manually writing any SQL queries. Performs server-side data sorting and filtering and retrieves results for browsing and editing.', 'Working with components', TTableFrame, 8); + Demos.RegisterDemo('UpdateSQL', 'Using TMSUpdateSQL component', 'Demonstrates using the TMSUpdateSQL component to customize update commands. Lets you optionally use TMSSQL and TMSQuery objects for carrying out insert, delete, query, and update commands.', 'Working with components', TUpdateSQLFrame, 9); + Demos.RegisterDemo('VirtualTable', 'Using TVirtualTable component', 'Demonstrates working with the TVirtualTable component. This sample shows how to fill virtual dataset with data from other datasets, filter data by a given criteria, locate specified records, perform file operations, and change data and table structure.', 'Working with components', TVirtualTableFrame, 10, 'VTable'); +{$IFNDEF STD} + Demos.RegisterDemo('ServiceBroker', 'Using TMSServiceBroker component', 'Demonstrates working with the TMSServiceBroker component. This sample shows how to organize simple messaging.', 'Working with components', TServiceBrokerFrame, 11); +{$ENDIF} + + Demos.RegisterDemo('CachedUpdates', 'Cached updates, transaction control', 'Demonstrates how to perform the most important tasks of working with data in CachedUpdates mode, including highlighting uncommitted changes, managing transactions, and committing changes in a batch.', 'General demos', TCachedUpdatesFrame, 1); + Demos.RegisterDemo('FetchAll', 'Illustrates how to open TMSQuery with or without fetching all data to client', 'Demonstrates how to open a query that returns a large recordset using different values of the FetchAll option. This demo lets the user to fill in the table used in the query.', 'General demos', TFetchAllFrame, 1); + Demos.RegisterDemo('FilterAndIndex', 'Using Filter and IndexFieldNames', 'Demonstrates SDAC''s local storage functionality. This sample shows how to perform local filtering, sorting and locating by multiple fields, including by calculated and lookup fields.', 'General demos', TFilterAndIndexFrame, 1); Demos.RegisterDemo('MasterDetail', 'Master/detail relationship', 'Master/detail relationship', 'General demos', TMasterDetailFrame, 1); + Demos.RegisterDemo('Pictures', 'Working with BLOB field', 'Uses SDAC functionality to work with graphics. The sample demonstrates how to retrieve binary data from MS SQL database and display it on visual components. Sample also shows how to load and save pictures to files and to the database.', 'General demos', TPicturesFrame, 1); + Demos.RegisterDemo('StoredProcUpdates', 'Using StoredProcs to Insert, Update and Delete with TMSQuery component', 'Demonstrates updating a recordset using stored procedures. Update events are tied to stored procedure calls in design time, and every recordset change causes the corresponding stored procedure call to be performed. ' + 'The commands to call stored procedures are stored in the SQLInsert, SQLDelete, SQLUpdate properties of TMSQuery.', 'General demos', TStoredProcUpdatesFrame, 1); +{$IFNDEF CLR} + Demos.RegisterDemo('Threads', 'Using Sdac in multi-threaded environment', 'Demonstrates how SDAC can be used in multithreaded applications. This sample allows you to set up several threads and test SDAC''s performance with multithreading.', 'General demos', TThreadsFrame, 1); +{$ENDIF} + Demos.RegisterDemo('LongStrings', 'Working with string fields', 'Demonstrates SDAC functionality for working with long string fields (fields that have more than 256 characters). Shows the different ways they can be displayed as memo fields and string fields.', 'SQL Server specific', TLongStringsFrame, 1); + Demos.RegisterDemo('ServerCursors', 'Open and navigate using client and server cursor types', 'Compares performance of opening a large recordset with different cursor types: client cursor in FetchAll=True mode, client cursor in FetchAll=False mode, and server cursor.', 'SQL Server specific', TServerCursorsFrame, 1); + Demos.RegisterDemo('Text', 'Working with long string fields', 'Uses SDAC functionality to work with text. The sample demonstrates how to retrieve text data from MS SQL database and display it on visual components. Sample also shows how to load and save text to files and to the database.', 'SQL Server specific', TTextFrame, 1); + + Demos.RegisterCategory('Miscellaneous', '', -1, True); +{$IFDEF CLR} + Demos.RegisterDemo('AspNet', 'AspNet', 'Uses MSDataAdapter to create a simple ASP .NET application. This demo shows how to create an ASP.NET application that lets you connect to a database and execute queries. ' + 'Application displays query results in a DataGrid and sends user changes back to the database.', 'Miscellaneous', nil, 1, '', True); +{$ENDIF} +{$IFNDEF CLR} + Demos.RegisterDemo('Dll', 'Dll', 'Demonstrates creating and loading DLLs for SDAC-based projects. This demo project consists of two parts - an MS_Dll project that creates a DLL of a form that sends a query to the server and displays its results, ' + 'and an MS_Exe project that can be executed to display a form for loading and running this DLL. Allows you to build a dll for one SDAC-based project and load and test it from a separate application.', 'Miscellaneous', nil, 1, '', True); +{$ENDIF} + Demos.RegisterDemo('FailOver', 'FailOver', 'Demonstrates the recommended approach to working with unstable networks. This sample lets you perform transactions and updates in several different modes, ' + 'simulate a sudden session termination, and view what happens to your data state when connections to the server are unexpectedly lost. Shows off CachedUpdates, LocalMasterDetail, FetchAll, Pooling, and different Failover modes.', 'Miscellaneous', nil, 1, '', True); +{$IFNDEF CLR} + Demos.RegisterDemo('Midas', 'Midas', 'Demonstrates using MIDAS technology with SDAC. This project consists of two parts: a MIDAS server that processes requests to the database and a thin MIDAS client that displays an interactive grid. ' + 'This demo shows how to build thin clients that display interactive components and delegate all database interaction to a server application for processing.', 'Miscellaneous', nil, 1, '', True); + Demos.RegisterDemo('Performance', 'Performance', 'Measures SDAC performance on several types of queries. This project lets you compare SDAC performance to BDE, ADO, and dbExpress. Tests the following functionality: Fetch, Master/Detail, ' + 'Stored Procedure Call, Multi Executing, and Insert/Post.', 'Miscellaneous', nil, 1, '', True); +{$ENDIF} +{$IFDEF CLR} + Demos.RegisterDemo('WinForms', 'AspNet', 'Shows how to use SDAC to create a WinForm application. This demo project creates a simple WinForms application and fills a data grid from an MSDataAdapter data source.', 'Miscellaneous', nil, 1, '', True); +{$ENDIF} + +{$IFNDEF CLR} + Demos.RegisterCategory('', '', -1, True); +{$ENDIF} + Demos.RegisterCategory('TechnologySpecific', '', -1, True); + Demos.RegisterDemo('MSSQLCompact', 'MSSQLCompact', 'Demonstrates how to create applications that work with MS SQL Server Compact Edition. Demo connects to a database and opens a table. If the specified database does not exists, it will be created automatically.', 'TechnologySpecific', nil, 1, '', True); +{$IFNDEF CLR} + Demos.RegisterCategory('', '', -1, True); +{$ENDIF} + +{$IFNDEF CLR} + Demos.RegisterCategory('ThirdParty', '', -1, True); + Demos.RegisterDemo('FastReport', 'FastReport hint', 'Demonstrates how SDAC can be used with FastReport components. This project consists of two parts. The first part is several packages that integrate SDAC components into the FastReport editor. ' + 'The second part is a demo application that lets you design and preview reports with SDAC technology in the FastReport editor.', 'ThirdParty', nil, 1, '', True); + Demos.RegisterDemo('InfoPower', 'InfoPower hint', 'Uses InfoPower components to display recordsets retrieved with SDAC. This demo project displays an InfoPower grid component and fills it with the result of an SDAC query. Shows how to link SDAC data sources to InfoPower components.', 'ThirdParty', nil, 1, '', True); + Demos.RegisterDemo('IntraWeb', 'IntraWeb hint', 'A collection of sample projects that show how to use SDAC components as data sources for IntraWeb applications. Contains IntraWeb samples for setting up a connection, querying ' + 'a database and modifying data and working with CachedUpdates and MasterDetail relationships.', 'ThirdParty', nil, 1, '', True); + Demos.RegisterDemo('QuickReport', 'QuickReport hint', 'Lets you launch and view a QuickReport application based on SDAC. This demo project lets you modify the application in design-time.', 'ThirdParty', nil, 1, '', True); + Demos.RegisterDemo('ReportBuilder', 'ReportBuilder hint', 'Uses SDAC data sources to create a ReportBuilder report that takes data from an MS SQL database. This demo project shows how to set up a ReportBuilder document in design-time and how to integrate SDAC components into the ' + 'Report Builder editor to perform document design in run-time.', 'ThirdParty', nil, 1, '', True); +{$ENDIF} +{$IFNDEF CLR} + Demos.RegisterCategory('', '', -1, True); +{$ENDIF} + +end; + +procedure TSdacForm.lbAboutClick(Sender: TObject); +begin + inherited; + SdacAboutForm.ShowModal; +end; + +procedure TSdacForm.cbDebugClick(Sender: TObject); +begin + inherited; + scCreate.Debug := (Sender as TCheckBox).Checked; + scDrop.Debug := (Sender as TCheckBox).Checked; +end; + +end. + diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Base/WindowsXP.res b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Base/WindowsXP.res new file mode 100644 index 0000000..acb40f5 Binary files /dev/null and b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Base/WindowsXP.res differ diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/CRDBGrid/CRDBGrid.dfm b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/CRDBGrid/CRDBGrid.dfm new file mode 100644 index 0000000..717f548 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/CRDBGrid/CRDBGrid.dfm @@ -0,0 +1,264 @@ +inherited CRDBGridFrame: TCRDBGridFrame + Width = 441 + Height = 275 + Align = alClient + object CRDBGrid: TCRDBGrid + Left = 0 + Top = 51 + Width = 441 + Height = 224 + OptionsEx = [dgeLocalFilter, dgeLocalSorting] + Align = alClient + DataSource = DataSource + TabOrder = 0 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + Columns = < + item + Expanded = False + FieldName = 'ID' + Width = 63 + Visible = True + end + item + Expanded = False + FieldName = 'NAME' + Title.Caption = 'PERSON|NAME' + Width = 63 + Visible = True + end + item + Expanded = False + FieldName = 'COUNTRY' + Title.Caption = 'PERSON|ADDRESS|COUNTRY' + Width = 63 + Visible = True + end + item + Expanded = False + FieldName = 'CITY' + Title.Caption = 'PERSON|ADDRESS|CITY' + Width = 63 + Visible = True + end + item + Expanded = False + FieldName = 'STREET' + Title.Caption = 'PERSON|ADDRESS|STREET' + Width = 63 + Visible = True + end + item + Expanded = False + FieldName = 'BIRTHDATE' + Title.Caption = 'PERSON|BIRTHDATE' + Width = 63 + Visible = True + end + item + Expanded = False + FieldName = 'JOB' + Title.Caption = 'JOB|JOB NAME' + Width = 63 + Visible = True + end + item + Expanded = False + FieldName = 'HIREDATE' + Title.Caption = 'JOB|HIREDATE' + Width = 63 + Visible = True + end + item + Expanded = False + FieldName = 'SAL' + Title.Caption = 'JOB|SAL' + Width = 63 + Visible = True + end + item + Expanded = False + FieldName = 'REMARKS' + Width = 63 + Visible = True + end> + end + object Panel2: TPanel + Left = 0 + Top = 0 + Width = 441 + Height = 51 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object Panel1: TPanel + Left = 1 + Top = 1 + Width = 438 + Height = 49 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btOpen: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Open' + Flat = True + Transparent = False + OnClick = btOpenClick + end + object btClose: TSpeedButton + Left = 84 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Close' + Flat = True + Transparent = False + OnClick = btCloseClick + end + object Panel3: TPanel + Left = 1 + Top = 24 + Width = 436 + Height = 24 + BevelOuter = bvNone + TabOrder = 0 + object chkFiltered: TCheckBox + Left = 5 + Top = 4 + Width = 65 + Height = 17 + Caption = 'Filtered' + TabOrder = 0 + OnClick = chkFilteredClick + end + object chkFilterBar: TCheckBox + Left = 91 + Top = 4 + Width = 65 + Height = 17 + Action = actFilterBar + TabOrder = 1 + end + object chkSearchBar: TCheckBox + Left = 178 + Top = 4 + Width = 81 + Height = 17 + Action = actSearchBar + TabOrder = 2 + end + object chkRecCount: TCheckBox + Left = 265 + Top = 4 + Width = 89 + Height = 17 + Caption = 'Record Count' + TabOrder = 3 + OnClick = chkRecCountClick + end + object chkStretch: TCheckBox + Left = 368 + Top = 4 + Width = 57 + Height = 17 + Caption = 'Stretch' + TabOrder = 4 + OnClick = chkStretchClick + end + end + object DBNavigator1: TDBNavigator + Left = 167 + Top = 1 + Width = 270 + Height = 22 + Flat = True + TabOrder = 1 + end + end + end + object MSQuery: TMSQuery + Connection = SDACForm.MSConnection + SQL.Strings = ( + 'SELECT * FROM crgrid_test') + Left = 8 + Top = 88 + end + object DataSource: TDataSource + DataSet = MSQuery + Left = 40 + Top = 88 + end + object ActionList1: TActionList + Left = 72 + Top = 96 + object actSearchBar: TAction + Caption = 'Search Bar' + OnExecute = actSearchBarExecute + OnUpdate = actSearchBarUpdate + end + object actFilterBar: TAction + Caption = 'Filter Bar' + OnExecute = actFilterBarExecute + OnUpdate = actFilterBarUpdate + end + end + object scCreate: TMSSQL + SQL.Strings = ( + 'CREATE TABLE CRGRID_TEST(' + ' Id int PRIMARY KEY,' + ' Name VARCHAR(10),' + ' Country VARCHAR(30),' + ' City VARCHAR(30),' + ' Street VARCHAR(30),' + ' BirthDate DATETIME,' + ' Job VARCHAR(9),' + ' Hiredate DATETIME,' + ' Sal NUMERIC(7, 2),' + ' Remarks TEXT' + ');' + '' + 'INSERT INTO CRGRID_TEST ' + + ' (Id, Name, Country, City, Street, BirthDate, Job, HireDate, Sa' + + 'l)' + 'VALUES ' + + ' (5001, '#39'SMITH'#39', '#39'ENGLAND'#39', '#39'LONDON'#39', '#39'BOND st.'#39', '#39'12-OCT-63'#39', ' + + #39'CLERK'#39','#39'17-DEC-80'#39', 800);' + '' + 'INSERT INTO CRGRID_TEST' + + ' (Id, Name, Country, City, Street, BirthDate, Job, HireDate, Sa' + + 'l)' + 'VALUES ' + + ' (5002, '#39'ALLEN'#39', '#39'ENGLAND'#39', '#39'LONDON'#39', '#39'BAKER st.'#39', '#39'04-MAR-61'#39',' + + ' '#39'SALESMAN'#39','#39'20-FEB-81'#39', 1600);' + '' + 'INSERT INTO CRGRID_TEST ' + + ' (Id, Name, Country, City, Street, BirthDate, Job, HireDate, Sa' + + 'l)' + 'VALUES ' + + ' (5003, '#39'MARTIN'#39', '#39'FRANCE'#39', '#39'LION'#39', '#39'WEAVER st.'#39', '#39'23-JAN-57'#39', ' + + #39'MANAGER'#39','#39'02-APR-81'#39', 2900);') + CommandTimeout = 0 + Left = 448 + Top = 8 + end + object scDrop: TMSSQL + SQL.Strings = ( + 'DROP TABLE CRGRID_TEST') + CommandTimeout = 0 + Left = 488 + Top = 8 + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/CRDBGrid/CRDBGrid.pas b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/CRDBGrid/CRDBGrid.pas new file mode 100644 index 0000000..d0eb5bf --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/CRDBGrid/CRDBGrid.pas @@ -0,0 +1,129 @@ +unit CRDBGrid; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + Db, MemDS, DBAccess, Grids, DBGrids, CRGrid, StdCtrls, + ActnList, ExtCtrls, DBCtrls, MSAccess, SdacVcl, + Buttons, DemoFrame, SdacDemoForm; + +type + TCRDBGridFrame = class(TDemoFrame) + MSQuery: TMSQuery; + DataSource: TDataSource; + ActionList1: TActionList; + actSearchBar: TAction; + actFilterBar: TAction; + scCreate: TMSSQL; + scDrop: TMSSQL; + CRDBGrid: TCRDBGrid; + Panel2: TPanel; + Panel1: TPanel; + btOpen: TSpeedButton; + btClose: TSpeedButton; + Panel3: TPanel; + chkFiltered: TCheckBox; + chkFilterBar: TCheckBox; + chkSearchBar: TCheckBox; + chkRecCount: TCheckBox; + chkStretch: TCheckBox; + DBNavigator1: TDBNavigator; + procedure btOpenClick(Sender: TObject); + procedure btCloseClick(Sender: TObject); + procedure actSearchBarExecute(Sender: TObject); + procedure actSearchBarUpdate(Sender: TObject); + procedure actFilterBarExecute(Sender: TObject); + procedure actFilterBarUpdate(Sender: TObject); + procedure chkFilteredClick(Sender: TObject); + procedure chkRecCountClick(Sender: TObject); + procedure chkStretchClick(Sender: TObject); + private + { Private declarations } + public + // Demo management + procedure Initialize; override; + procedure SetDebug(Value: boolean); override; + end; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} + +procedure TCRDBGridFrame.btOpenClick(Sender: TObject); +begin + MSQuery.Open; +end; + +procedure TCRDBGridFrame.btCloseClick(Sender: TObject); +begin + MSQuery.Close; +end; + +procedure TCRDBGridFrame.actSearchBarExecute(Sender: TObject); +begin + actSearchBar.Checked := not actSearchBar.Checked; + if actSearchBar.Checked then + CRDBGrid.OptionsEx := CRDBGrid.OptionsEx + [dgeSearchBar] + else + CRDBGrid.OptionsEx := CRDBGrid.OptionsEx - [dgeSearchBar]; +end; + +procedure TCRDBGridFrame.actSearchBarUpdate(Sender: TObject); +begin + actSearchBar.Checked := dgeSearchBar in CRDBGrid.OptionsEx; +end; + +procedure TCRDBGridFrame.actFilterBarExecute(Sender: TObject); +begin + actFilterBar.Checked := not actFilterBar.Checked; + if actFilterBar.Checked then + CRDBGrid.OptionsEx := CRDBGrid.OptionsEx + [dgeFilterBar] + else + CRDBGrid.OptionsEx := CRDBGrid.OptionsEx - [dgeFilterBar]; +end; + +procedure TCRDBGridFrame.actFilterBarUpdate(Sender: TObject); +begin + actFilterBar.Checked := dgeFilterBar in CRDBGrid.OptionsEx; +end; + +procedure TCRDBGridFrame.chkFilteredClick(Sender: TObject); +begin + CRDBGrid.Filtered := chkFiltered.Checked; +end; + +procedure TCRDBGridFrame.chkRecCountClick(Sender: TObject); +begin + if chkRecCount.Checked then + CRDBGrid.OptionsEx := CRDBGrid.OptionsEx + [dgeRecordCount] + else + CRDBGrid.OptionsEx := CRDBGrid.OptionsEx - [dgeRecordCount]; +end; + +procedure TCRDBGridFrame.chkStretchClick(Sender: TObject); +begin + if chkStretch.Checked then + CRDBGrid.OptionsEx := CRDBGrid.OptionsEx + [dgeStretch] + else + CRDBGrid.OptionsEx := CRDBGrid.OptionsEx - [dgeStretch]; +end; + +// Demo management +procedure TCRDBGridFrame.Initialize; +begin + inherited; + MSQuery.Connection := Connection as TMSConnection; +end; + +procedure TCRDBGridFrame.SetDebug(Value: boolean); +begin + MSQuery.Debug := Value; +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/CachedUpdates/CachedUpdates.dfm b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/CachedUpdates/CachedUpdates.dfm new file mode 100644 index 0000000..5eb14e3 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/CachedUpdates/CachedUpdates.dfm @@ -0,0 +1,372 @@ +inherited CachedUpdatesFrame: TCachedUpdatesFrame + Width = 443 + Height = 277 + Align = alClient + object DBGrid: TDBGrid + Left = 0 + Top = 102 + Width = 443 + Height = 175 + Align = alClient + DataSource = DataSource + Options = [dgEditing, dgTitles, dgIndicator, dgColumnResize, dgColLines, dgRowLines, dgTabs, dgCancelOnExit] + TabOrder = 0 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + OnDrawDataCell = DBGridDrawDataCell + end + object Panel8: TPanel + Left = 0 + Top = 0 + Width = 443 + Height = 102 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object ToolBar: TPanel + Left = 1 + Top = 1 + Width = 667 + Height = 100 + BevelOuter = bvNone + Color = clGreen + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + ParentFont = False + TabOrder = 0 + object btOpen: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Open' + Flat = True + Transparent = False + OnClick = btOpenClick + end + object btClose: TSpeedButton + Left = 84 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Close' + Flat = True + Transparent = False + OnClick = btCloseClick + end + object RefreshRecord: TSpeedButton + Left = 408 + Top = 1 + Width = 82 + Height = 22 + Caption = 'RefreshRecord' + Flat = True + Transparent = False + OnClick = RefreshRecordClick + end + object DBNavigator: TDBNavigator + Left = 167 + Top = 1 + Width = 240 + Height = 22 + DataSource = DataSource + Flat = True + TabOrder = 0 + end + object Panel1: TPanel + Left = 1 + Top = 47 + Width = 368 + Height = 52 + BevelOuter = bvNone + TabOrder = 1 + object Label2: TLabel + Left = 5 + Top = 5 + Width = 48 + Height = 13 + Caption = 'Updates' + Font.Charset = DEFAULT_CHARSET + Font.Color = clMaroon + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + end + object Panel3: TPanel + Left = 20 + Top = 23 + Width = 333 + Height = 24 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btApply: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Apply' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clMaroon + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + Transparent = False + OnClick = btApplyClick + end + object btCommit: TSpeedButton + Left = 84 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Commit' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clMaroon + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + Transparent = False + OnClick = btCommitClick + end + object btCancel: TSpeedButton + Left = 167 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Cancel' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clMaroon + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + Transparent = False + OnClick = btCancelClick + end + object btRevertRecord: TSpeedButton + Left = 250 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Revert' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clMaroon + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + Transparent = False + OnClick = btRevertRecordClick + end + end + end + object Panel2: TPanel + Left = 1 + Top = 24 + Width = 317 + Height = 22 + BevelOuter = bvNone + TabOrder = 2 + object Label4: TLabel + Left = 220 + Top = 5 + Width = 51 + Height = 13 + Caption = 'Batch Size' + end + object cbCachedUpdates: TCheckBox + Left = 8 + Top = 4 + Width = 97 + Height = 12 + Caption = 'CachedUpdates' + TabOrder = 0 + OnClick = cbCachedUpdatesClick + end + object cbCustomUpdate: TCheckBox + Left = 113 + Top = 4 + Width = 97 + Height = 14 + Caption = 'Custom Update' + TabOrder = 1 + OnClick = cbCustomUpdateClick + end + object edUpdateBatchSize: TEdit + Left = 276 + Top = 1 + Width = 37 + Height = 21 + TabOrder = 2 + Text = '1' + end + end + object Panel4: TPanel + Left = 370 + Top = 47 + Width = 296 + Height = 52 + BevelOuter = bvNone + TabOrder = 3 + object Label3: TLabel + Left = 5 + Top = 5 + Width = 74 + Height = 13 + Caption = 'Transactions' + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + end + object Panel5: TPanel + Left = 24 + Top = 23 + Width = 250 + Height = 24 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btStartTrans: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Start' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + Transparent = False + OnClick = btStartTransClick + end + object btCommitTrans: TSpeedButton + Left = 84 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Commit' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + Transparent = False + OnClick = btCommitTransClick + end + object btRollBackTrans: TSpeedButton + Left = 167 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Rollback' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + Transparent = False + OnClick = btRollbackTransClick + end + end + end + object Panel6: TPanel + Left = 319 + Top = 24 + Width = 347 + Height = 22 + BevelOuter = bvNone + TabOrder = 4 + object Label1: TLabel + Left = 6 + Top = 4 + Width = 64 + Height = 13 + Caption = 'RecordTypes' + end + object cbDeleted: TCheckBox + Left = 284 + Top = 4 + Width = 59 + Height = 17 + Caption = 'Deleted' + TabOrder = 0 + OnClick = cbDeletedClick + end + object cbInserted: TCheckBox + Left = 221 + Top = 4 + Width = 61 + Height = 17 + Caption = 'Inserted' + TabOrder = 1 + OnClick = cbInsertedClick + end + object cbModified: TCheckBox + Left = 155 + Top = 4 + Width = 67 + Height = 17 + Caption = 'Modified' + TabOrder = 2 + OnClick = cbModifiedClick + end + object cbUnmodified: TCheckBox + Left = 77 + Top = 4 + Width = 76 + Height = 17 + Caption = 'Unmodified' + TabOrder = 3 + OnClick = cbUnmodifiedClick + end + end + object Panel7: TPanel + Left = 491 + Top = 1 + Width = 175 + Height = 22 + BevelOuter = bvNone + TabOrder = 5 + end + end + end + object DataSource: TDataSource + DataSet = MSQuery + OnStateChange = DataSourceStateChange + OnDataChange = DataSourceDataChange + Left = 233 + Top = 50 + end + object MSQuery: TMSQuery + SQL.Strings = ( + 'SELECT * FROM Emp') + CachedUpdates = True + OnUpdateError = MSQueryUpdateError + OnCalcFields = MSQueryCalcFields + Left = 205 + Top = 48 + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/CachedUpdates/CachedUpdates.pas b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/CachedUpdates/CachedUpdates.pas new file mode 100644 index 0000000..7d6313f --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/CachedUpdates/CachedUpdates.pas @@ -0,0 +1,319 @@ +unit CachedUpdates; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + DBCtrls, ExtCtrls, Db, Grids, DBGrids, MemDS, StdCtrls, ToolWin, + ComCtrls, Buttons, DBAccess, MSAccess, SdacVcl, + DemoFrame, SdacDemoForm; + +type + TCachedUpdatesFrame = class(TDemoFrame) + DBGrid: TDBGrid; + DataSource: TDataSource; + MSQuery: TMSQuery; + Panel8: TPanel; + ToolBar: TPanel; + btOpen: TSpeedButton; + btClose: TSpeedButton; + RefreshRecord: TSpeedButton; + DBNavigator: TDBNavigator; + Panel1: TPanel; + Label2: TLabel; + Panel3: TPanel; + btApply: TSpeedButton; + btCommit: TSpeedButton; + btCancel: TSpeedButton; + btRevertRecord: TSpeedButton; + Panel2: TPanel; + cbCachedUpdates: TCheckBox; + cbCustomUpdate: TCheckBox; + Panel4: TPanel; + Label3: TLabel; + Panel5: TPanel; + btStartTrans: TSpeedButton; + btCommitTrans: TSpeedButton; + btRollBackTrans: TSpeedButton; + Panel6: TPanel; + Label1: TLabel; + cbDeleted: TCheckBox; + cbInserted: TCheckBox; + cbModified: TCheckBox; + cbUnmodified: TCheckBox; + Panel7: TPanel; + Label4: TLabel; + edUpdateBatchSize: TEdit; + procedure btOpenClick(Sender: TObject); + procedure btCloseClick(Sender: TObject); + procedure btApplyClick(Sender: TObject); + procedure btCancelClick(Sender: TObject); + procedure btStartTransClick(Sender: TObject); + procedure btCommitTransClick(Sender: TObject); + procedure btRollbackTransClick(Sender: TObject); + procedure cbCachedUpdatesClick(Sender: TObject); + procedure MSQueryUpdateError(DataSet: TDataSet; E: EDatabaseError; + UpdateKind: TUpdateKind; var UpdateAction: TUpdateAction); + procedure MSQueryUpdateRecord(DataSet: TDataSet; + UpdateKind: TUpdateKind; var UpdateAction: TUpdateAction); + procedure cbCustomUpdateClick(Sender: TObject); + procedure MSQueryCalcFields(DataSet: TDataSet); + procedure btCommitClick(Sender: TObject); + procedure cbUnmodifiedClick(Sender: TObject); + procedure cbModifiedClick(Sender: TObject); + procedure cbInsertedClick(Sender: TObject); + procedure cbDeletedClick(Sender: TObject); + procedure DataSourceDataChange(Sender: TObject; Field: TField); + procedure DataSourceStateChange(Sender: TObject); + procedure DBGridDrawDataCell(Sender: TObject; const Rect: TRect; + Field: TField; State: TGridDrawState); + procedure btRevertRecordClick(Sender: TObject); + procedure RefreshRecordClick(Sender: TObject); + private + { Private declarations } + procedure ShowTrans; + procedure ShowPending; + procedure ShowUpdateRecordTypes; + public + destructor Destroy; override; + + // Demo management + procedure Initialize; override; + procedure SetDebug(Value: boolean); override; + end; + +implementation + +uses + UpdateAction; + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} + +procedure TCachedUpdatesFrame.ShowTrans; +begin + if MSQuery.Connection .InTransaction then + SdacForm.StatusBar.Panels[2].Text := 'In Transaction' + else + SdacForm.StatusBar.Panels[2].Text := ''; +end; + +procedure TCachedUpdatesFrame.ShowPending; +begin + if MSQuery.UpdatesPending then + SdacForm.StatusBar.Panels[1].Text := 'Updates Pending' + else + SdacForm.StatusBar.Panels[1].Text := ''; +end; + +procedure TCachedUpdatesFrame.ShowUpdateRecordTypes; +begin + if MSQuery.CachedUpdates then begin + cbUnmodified.Checked := rtUnmodified in MSQuery.UpdateRecordTypes; + cbModified.Checked := rtModified in MSQuery.UpdateRecordTypes; + cbInserted.Checked := rtInserted in MSQuery.UpdateRecordTypes; + cbDeleted.Checked := rtDeleted in MSQuery.UpdateRecordTypes; + end; +end; + +procedure TCachedUpdatesFrame.btOpenClick(Sender: TObject); +begin + MSQuery.Open; +end; + +procedure TCachedUpdatesFrame.btCloseClick(Sender: TObject); +begin + MSQuery.Close; +end; + +procedure TCachedUpdatesFrame.btApplyClick(Sender: TObject); +begin + MSQuery.Options.UpdateBatchSize := StrToInt(edUpdateBatchSize.Text); + MSQuery.ApplyUpdates; + ShowPending; +end; + +procedure TCachedUpdatesFrame.btCommitClick(Sender: TObject); +begin + MSQuery.CommitUpdates; + ShowPending; +end; + +procedure TCachedUpdatesFrame.btCancelClick(Sender: TObject); +begin + MSQuery.CancelUpdates; + ShowPending; +end; + +procedure TCachedUpdatesFrame.btStartTransClick(Sender: TObject); +begin + MSQuery.Connection.StartTransaction; + ShowTrans; +end; + +procedure TCachedUpdatesFrame.btCommitTransClick(Sender: TObject); +begin + MSQuery.Connection.Commit; + ShowTrans; +end; + +procedure TCachedUpdatesFrame.btRollbackTransClick(Sender: TObject); +begin + MSQuery.Connection.Rollback; + ShowTrans; +end; + +destructor TCachedUpdatesFrame.Destroy; +begin + FreeAndNil(UpdateActionForm); + inherited; +end; + +procedure TCachedUpdatesFrame.cbCachedUpdatesClick(Sender: TObject); +begin + try + MSQuery.CachedUpdates := cbCachedUpdates.Checked; + except + cbCachedUpdates.Checked := MSQuery.CachedUpdates; + raise; + end; + ShowUpdateRecordTypes; +end; + +procedure TCachedUpdatesFrame.MSQueryUpdateError(DataSet: TDataSet; E: EDatabaseError; + UpdateKind: TUpdateKind; var UpdateAction: TUpdateAction); +begin + UpdateActionForm.rgAction.ItemIndex := Ord(UpdateAction); + UpdateActionForm.rgKind.ItemIndex := Ord(UpdateKind); + UpdateActionForm.lbField.Caption := String(DataSet.Fields[0].Value); + UpdateActionForm.lbMessage.Caption := E.Message; + UpdateActionForm.ShowModal; + UpdateAction := TUpdateAction(UpdateActionForm.rgAction.ItemIndex); +end; + +procedure TCachedUpdatesFrame.MSQueryUpdateRecord(DataSet: TDataSet; + UpdateKind: TUpdateKind; var UpdateAction: TUpdateAction); +begin + UpdateActionForm.rgAction.ItemIndex := Ord(UpdateAction); + UpdateActionForm.rgKind.ItemIndex := Ord(UpdateKind); + UpdateActionForm.lbField.Caption := String(DataSet.Fields[0].NewValue); + UpdateActionForm.lbMessage.Caption := ''; + UpdateActionForm.ShowModal; + UpdateAction := TUpdateAction(UpdateActionForm.rgAction.ItemIndex); +end; + +procedure TCachedUpdatesFrame.cbCustomUpdateClick(Sender: TObject); +begin + if cbCustomUpdate.Checked then + MSQuery.OnUpdateRecord := MSQueryUpdateRecord + else + MSQuery.OnUpdateRecord := nil; +end; + +procedure TCachedUpdatesFrame.MSQueryCalcFields(DataSet: TDataSet); +var + St:string; +begin + case Ord(TCustomMSDataSet(DataSet).UpdateStatus) of + 0: St := 'Unmodified'; + 1: St := 'Modified'; + 2: St := 'Inserted'; + 3: St := 'Deleted'; + end; + DataSet.FieldByName('Status').AsString := St; + +{ case Ord(TMSDataSet(DataSet).UpdateResult) of + 0: St := 'Fail'; + 1: St := 'Abort'; + 2: St := 'Skip'; + 3: St := 'Applied'; + end; + DataSet.FieldByName('Result').AsString := St;} +end; + +procedure TCachedUpdatesFrame.cbUnmodifiedClick(Sender: TObject); +begin + if cbUnmodified.Checked then + MSQuery.UpdateRecordTypes := MSQuery.UpdateRecordTypes + [rtUnmodified] + else + MSQuery.UpdateRecordTypes := MSQuery.UpdateRecordTypes - [rtUnmodified]; +end; + +procedure TCachedUpdatesFrame.cbModifiedClick(Sender: TObject); +begin + if cbModified.Checked then + MSQuery.UpdateRecordTypes := MSQuery.UpdateRecordTypes + [rtModified] + else + MSQuery.UpdateRecordTypes := MSQuery.UpdateRecordTypes - [rtModified]; +end; + +procedure TCachedUpdatesFrame.cbInsertedClick(Sender: TObject); +begin + if cbInserted.Checked then + MSQuery.UpdateRecordTypes := MSQuery.UpdateRecordTypes + [rtInserted] + else + MSQuery.UpdateRecordTypes := MSQuery.UpdateRecordTypes - [rtInserted]; +end; + +procedure TCachedUpdatesFrame.cbDeletedClick(Sender: TObject); +begin + if cbDeleted.Checked then + MSQuery.UpdateRecordTypes := MSQuery.UpdateRecordTypes + [rtDeleted] + else + MSQuery.UpdateRecordTypes := MSQuery.UpdateRecordTypes - [rtDeleted]; +end; + +procedure TCachedUpdatesFrame.DataSourceStateChange(Sender: TObject); +begin + ShowPending; + SdacForm.StatusBar.Panels[3].Text := 'Record ' + IntToStr(MSQuery.RecNo) + ' of ' + IntToStr(MSQuery.RecordCount) ; +end; + +procedure TCachedUpdatesFrame.DataSourceDataChange(Sender: TObject; Field: TField); +begin + DataSourceStateChange(nil); +end; + +procedure TCachedUpdatesFrame.DBGridDrawDataCell(Sender: TObject; const Rect: TRect; + Field: TField; State: TGridDrawState); +begin + if MSQuery.UpdateResult in [uaFail,uaSkip] then + TDBGrid(Sender).Canvas.Brush.Color := clRed + else + if MSQuery.UpdateStatus <> usUnmodified then + TDBGrid(Sender).Canvas.Brush.Color := clYellow; + + TDBGrid(Sender).DefaultDrawDataCell(Rect, Field, State); +end; + +procedure TCachedUpdatesFrame.btRevertRecordClick(Sender: TObject); +begin + MSQuery.RevertRecord; + ShowPending; +end; + +procedure TCachedUpdatesFrame.RefreshRecordClick(Sender: TObject); +begin + MSQuery.RefreshRecord; +end; + +// Demo management +procedure TCachedUpdatesFrame.Initialize; +begin + inherited; + MSQuery.Connection := Connection as TMSConnection; + UpdateActionForm := TUpdateActionForm.Create(nil); + cbCachedUpdates.Checked := MSQuery.CachedUpdates; + ShowUpdateRecordTypes; +end; + +procedure TCachedUpdatesFrame.SetDebug(Value: boolean); +begin + MSQuery.Debug := Value; +end; + +end. \ No newline at end of file diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/CachedUpdates/UpdateAction.dfm b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/CachedUpdates/UpdateAction.dfm new file mode 100644 index 0000000..22e0817 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/CachedUpdates/UpdateAction.dfm @@ -0,0 +1,139 @@ +object UpdateActionForm: TUpdateActionForm + Left = 586 + Top = 306 + Width = 235 + Height = 300 + HorzScrollBar.Range = 199 + VertScrollBar.Range = 131 + AutoScroll = False + Caption = 'UpdateAction' + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = 11 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [] + OldCreateOrder = True + PixelsPerInch = 96 + TextHeight = 13 + object Panel1: TPanel + Left = 5 + Top = 4 + Width = 217 + Height = 262 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object Panel5: TPanel + Left = 1 + Top = 1 + Width = 215 + Height = 128 + BevelOuter = bvNone + TabOrder = 0 + object Label1: TLabel + Left = 6 + Top = 15 + Width = 46 + Height = 13 + Caption = 'Message:' + end + object Label2: TLabel + Left = 6 + Top = 1 + Width = 35 + Height = 13 + Caption = 'Record' + end + object lbField: TLabel + Left = 64 + Top = 2 + Width = 141 + Height = 13 + AutoSize = False + Caption = 'lbFileld' + end + object lbMessage: TLabel + Left = 7 + Top = 29 + Width = 201 + Height = 95 + AutoSize = False + Caption = 'lbMessage' + WordWrap = True + end + end + object Panel7: TPanel + Left = 1 + Top = 130 + Width = 98 + Height = 131 + BevelOuter = bvNone + TabOrder = 1 + object rgAction: TRadioGroup + Left = 6 + Top = 1 + Width = 87 + Height = 126 + Caption = 'UpdateAction' + Items.Strings = ( + 'Fail' + 'Abort' + 'Skip' + 'Retry' + 'Applied' + 'Default') + TabOrder = 0 + end + end + object Panel4: TPanel + Left = 100 + Top = 130 + Width = 116 + Height = 89 + BevelOuter = bvNone + TabOrder = 2 + object rgKind: TRadioGroup + Left = 7 + Top = 2 + Width = 103 + Height = 83 + Caption = 'UpdateKind' + Enabled = False + Items.Strings = ( + 'Modify' + 'Insert' + 'Delete') + TabOrder = 0 + end + end + object Panel9: TPanel + Left = 100 + Top = 220 + Width = 116 + Height = 41 + BevelOuter = bvNone + TabOrder = 3 + object Panel2: TPanel + Left = 16 + Top = 9 + Width = 84 + Height = 24 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btOk: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Ok' + Flat = True + Transparent = False + OnClick = btOkClick + end + end + end + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/CachedUpdates/UpdateAction.pas b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/CachedUpdates/UpdateAction.pas new file mode 100644 index 0000000..3322b25 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/CachedUpdates/UpdateAction.pas @@ -0,0 +1,48 @@ +unit UpdateAction; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + StdCtrls, ExtCtrls, Buttons; + +type + TUpdateActionForm = class(TForm) + Panel1: TPanel; + Panel5: TPanel; + Label1: TLabel; + Label2: TLabel; + lbField: TLabel; + lbMessage: TLabel; + Panel7: TPanel; + rgAction: TRadioGroup; + Panel4: TPanel; + rgKind: TRadioGroup; + Panel9: TPanel; + Panel2: TPanel; + btOk: TSpeedButton; + procedure btOkClick(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + end; + +var + UpdateActionForm: TUpdateActionForm; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} + +procedure TUpdateActionForm.btOkClick(Sender: TObject); +begin + ModalResult := mrOk; +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/ConnectDialog/ConnectDialog.dfm b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/ConnectDialog/ConnectDialog.dfm new file mode 100644 index 0000000..78c07d3 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/ConnectDialog/ConnectDialog.dfm @@ -0,0 +1,115 @@ +inherited ConnectDialogFrame: TConnectDialogFrame + Width = 441 + Height = 275 + Align = alClient + object DBGrid: TDBGrid + Left = 0 + Top = 54 + Width = 441 + Height = 221 + Align = alClient + DataSource = DataSource + TabOrder = 0 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object ToolBar: TPanel + Left = 0 + Top = 0 + Width = 441 + Height = 54 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object Panel1: TPanel + Left = 1 + Top = 1 + Width = 398 + Height = 52 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btOpen: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Open' + Flat = True + Transparent = False + OnClick = btOpenClick + end + object btClose: TSpeedButton + Left = 84 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Close' + Flat = True + Transparent = False + OnClick = btCloseClick + end + object DBNavigator: TDBNavigator + Left = 167 + Top = 1 + Width = 230 + Height = 22 + DataSource = DataSource + Flat = True + TabOrder = 0 + end + object Panel3: TPanel + Left = 1 + Top = 24 + Width = 396 + Height = 27 + BevelOuter = bvNone + TabOrder = 1 + object rbInherited: TRadioButton + Left = 216 + Top = 5 + Width = 113 + Height = 17 + Caption = 'Inherited connect' + TabOrder = 0 + OnClick = rbInheritedClick + end + object rbMy: TRadioButton + Left = 112 + Top = 5 + Width = 81 + Height = 17 + Caption = 'My connect' + TabOrder = 1 + OnClick = rbMyClick + end + object rbDefault: TRadioButton + Left = 8 + Top = 5 + Width = 65 + Height = 17 + Caption = 'Default' + Checked = True + TabOrder = 2 + TabStop = True + OnClick = rbDefaultClick + end + end + end + end + object DataSource: TDataSource + DataSet = MSQuery + Left = 464 + Top = 32 + end + object MSQuery: TMSQuery + Connection = SDACForm.MSConnection + SQL.Strings = ( + 'SELECT * FROM Emp') + Left = 432 + Top = 32 + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/ConnectDialog/ConnectDialog.pas b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/ConnectDialog/ConnectDialog.pas new file mode 100644 index 0000000..219c3f7 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/ConnectDialog/ConnectDialog.pas @@ -0,0 +1,93 @@ +unit ConnectDialog; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + Db, MemDS, Grids, DBGrids, DBCtrls, StdCtrls, ExtCtrls, DBAccess, + MSAccess, SdacVcl, Buttons, DemoFrame, + InheritedConnectForm, MyConnectForm; + +type + TConnectDialogFrame = class(TDemoFrame) + DataSource: TDataSource; + MSQuery: TMSQuery; + DBGrid: TDBGrid; + ToolBar: TPanel; + Panel1: TPanel; + btOpen: TSpeedButton; + btClose: TSpeedButton; + DBNavigator: TDBNavigator; + Panel3: TPanel; + rbInherited: TRadioButton; + rbMy: TRadioButton; + rbDefault: TRadioButton; + procedure btOpenClick(Sender: TObject); + procedure btCloseClick(Sender: TObject); + procedure rbDefaultClick(Sender: TObject); + procedure rbMyClick(Sender: TObject); + procedure rbInheritedClick(Sender: TObject); + private + { Private declarations } + public + destructor Destroy; override; + // Demo management + procedure Initialize; override; + procedure SetDebug(Value: boolean); override; + end; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} + +destructor TConnectDialogFrame.Destroy; +begin + MSQuery.Connection.ConnectDialog.DialogClass := ''; + inherited; +end; + + +procedure TConnectDialogFrame.btOpenClick(Sender: TObject); +begin + MSQuery.Open; +end; + +procedure TConnectDialogFrame.btCloseClick(Sender: TObject); +begin + MSQuery.Close; +end; + +procedure TConnectDialogFrame.rbDefaultClick(Sender: TObject); +begin + MSQuery.Connection.ConnectDialog.DialogClass := ''; +end; + +procedure TConnectDialogFrame.rbMyClick(Sender: TObject); +begin + MSQuery.Connection.ConnectDialog.DialogClass := 'TfmMyConnect'; +end; + +procedure TConnectDialogFrame.rbInheritedClick(Sender: TObject); +begin + MSQuery.Connection.ConnectDialog.DialogClass := 'TfmInheritedConnect'; +end; + +// Demo management +procedure TConnectDialogFrame.Initialize; +begin + inherited; + MSQuery.Connection := Connection as TMSConnection; +end; + +procedure TConnectDialogFrame.SetDebug(Value: boolean); +begin + MSQuery.Debug:= Value; +end; + +end. + diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/ConnectDialog/ConnectForm.dfm b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/ConnectDialog/ConnectForm.dfm new file mode 100644 index 0000000..722acee --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/ConnectDialog/ConnectForm.dfm @@ -0,0 +1,112 @@ +object ConnectForm: TConnectForm + Left = 368 + Top = 255 + ActiveControl = edUsername + BorderIcons = [] + BorderStyle = bsDialog + Caption = 'Connect' + ClientHeight = 175 + ClientWidth = 291 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + Scaled = False + PixelsPerInch = 96 + TextHeight = 13 + object Panel: TPanel + Left = 8 + Top = 8 + Width = 273 + Height = 121 + BevelInner = bvRaised + BevelOuter = bvLowered + FullRepaint = False + TabOrder = 0 + object lbUsername: TLabel + Left = 16 + Top = 20 + Width = 73 + Height = 13 + AutoSize = False + Caption = 'Username' + Layout = tlCenter + end + object lbPassword: TLabel + Left = 16 + Top = 54 + Width = 73 + Height = 13 + AutoSize = False + Caption = 'Password' + Layout = tlCenter + end + object lbServer: TLabel + Left = 16 + Top = 88 + Width = 73 + Height = 13 + AutoSize = False + Caption = 'Server' + Layout = tlCenter + end + object edUsername: TEdit + Left = 104 + Top = 16 + Width = 153 + Height = 21 + AutoSelect = False + MaxLength = 32767 + TabOrder = 0 + end + object edPassword: TEdit + Left = 104 + Top = 50 + Width = 153 + Height = 21 + AutoSelect = False + MaxLength = 32767 + PasswordChar = '*' + TabOrder = 1 + end + object edServer: TComboBox + Left = 104 + Top = 84 + Width = 153 + Height = 21 + DropDownCount = 10 + ItemHeight = 13 + TabOrder = 2 + end + end + object btConnect: TButton + Left = 52 + Top = 141 + Width = 89 + Height = 25 + Caption = 'Connect' + Default = True + TabOrder = 1 + OnClick = btConnectClick + end + object btCancel: TButton + Left = 148 + Top = 141 + Width = 89 + Height = 25 + Cancel = True + Caption = 'Cancel' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + ModalResult = 2 + ParentFont = False + TabOrder = 2 + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/ConnectDialog/ConnectForm.pas b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/ConnectDialog/ConnectForm.pas new file mode 100644 index 0000000..09cd94c --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/ConnectDialog/ConnectForm.pas @@ -0,0 +1,123 @@ + +////////////////////////////////////////////////// +// MS SQL Server Data Access Components +// Copyright © 1998-2001 Core Lab. All right reserved. +// Connect Form +////////////////////////////////////////////////// + +unit ConnectForm; +interface +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + StdCtrls, ExtCtrls, DBAccess, OLEDBAccess, OLEDBIntf, OLEDBC; + +type + TConnectForm = class(TForm) + Panel: TPanel; + lbUsername: TLabel; + lbPassword: TLabel; + lbServer: TLabel; + edUsername: TEdit; + btConnect: TButton; + btCancel: TButton; + edPassword: TEdit; + edServer: TComboBox; + procedure btConnectClick(Sender: TObject); + + private + FConnectDialog: TCustomConnectDialog; + FRetries: integer; + FOldCreateOrder: boolean; + FRetry: boolean; + + procedure SetConnectDialog(Value: TCustomConnectDialog); + + protected + procedure DoInit; virtual; + procedure DoConnect; virtual; + + public + + published + property ConnectDialog: TCustomConnectDialog read FConnectDialog write SetConnectDialog; + + property OldCreateOrder: boolean read FOldCreateOrder write FOldCreateOrder; + end; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} + +procedure TConnectForm.DoInit; +begin + FRetry := False; + FRetries := FConnectDialog.Retries; + Caption := FConnectDialog.Caption; + + with FConnectDialog do begin + lbUsername.Caption := UsernameLabel; + lbPassword.Caption := PasswordLabel; + lbServer.Caption := ServerLabel; + btConnect.Caption := ConnectButton; + btCancel.Caption := CancelButton; + + FConnectDialog.GetServerList(edServer.Items); + edUsername.Text := Connection.Username; + edPassword.Text := Connection.Password; + edServer.Text := Connection.Server; + + if (edUsername.Text <> '') and (edPassword.Text = '') then + ActiveControl := edPassword; + end; +end; + +procedure TConnectForm.DoConnect; +begin + FConnectDialog.Connection.Password := edPassword.Text; + FConnectDialog.Connection.Server := edServer.Text; + FConnectDialog.Connection.UserName := edUsername.Text; + try + FConnectDialog.Connection.PerformConnect(FRetry); + ModalResult := mrOk; + except + on E: EMSError do begin + Dec(FRetries); + FRetry := True; + if FRetries = 0 then + ModalResult := mrCancel; + + if E.MSSQLErrorCode <= NE_MAX_NETERROR then + ActiveControl := edServer + else + if E.OLEDBErrorCode = DB_SEC_E_AUTH_FAILED then + if ActiveControl <> edUsername then + ActiveControl := edPassword; + raise; + end + else + raise; + end; +end; + +procedure TConnectForm.SetConnectDialog(Value: TCustomConnectDialog); +begin + FConnectDialog := Value; + DoInit; +end; + +procedure TConnectForm.btConnectClick(Sender: TObject); +begin + DoConnect; +end; + +initialization + if GetClass('TConnectForm') = nil then + Classes.RegisterClass(TConnectForm); +// Classes.GroupDescendentsWith(TConnectForm, TForm); +end. + diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/ConnectDialog/InheritedConnectForm.dfm b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/ConnectDialog/InheritedConnectForm.dfm new file mode 100644 index 0000000..3eba499 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/ConnectDialog/InheritedConnectForm.dfm @@ -0,0 +1,43 @@ +inherited fmInheritedConnect: TfmInheritedConnect + Left = 359 + Top = 212 + Caption = 'Inherited Connect' + PixelsPerInch = 96 + TextHeight = 13 + inherited Panel: TPanel + BevelOuter = bvNone + inherited lbUsername: TLabel + Width = 80 + Font.Color = clNavy + Font.Style = [fsBold] + ParentFont = False + end + inherited lbPassword: TLabel + Width = 55 + Font.Color = clNavy + Font.Style = [fsBold] + ParentFont = False + end + inherited lbServer: TLabel + Width = 38 + Font.Color = clNavy + Font.Style = [fsBold] + ParentFont = False + end + inherited lbDatabase: TLabel + Font.Color = clNavy + Font.Style = [fsBold] + ParentFont = False + end + end + inherited btConnect: TButton + Left = 98 + Width = 82 + Height = 22 + end + inherited btCancel: TButton + Left = 193 + Width = 82 + Height = 22 + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/ConnectDialog/InheritedConnectForm.pas b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/ConnectDialog/InheritedConnectForm.pas new file mode 100644 index 0000000..a937a48 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/ConnectDialog/InheritedConnectForm.pas @@ -0,0 +1,32 @@ +unit InheritedConnectForm; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + StdCtrls, Mask, ExtCtrls, MSConnectForm; + +type + TfmInheritedConnect = class(TMSConnectForm) + private + { Private declarations } + public + { Public declarations } + end; + +var + fmInheritedConnect: TfmInheritedConnect; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} + +initialization + if GetClass('TfmInheritedConnect') = nil then + Classes.RegisterClass(TfmInheritedConnect); +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/ConnectDialog/MyConnectForm.dfm b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/ConnectDialog/MyConnectForm.dfm new file mode 100644 index 0000000..d9a93b0 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/ConnectDialog/MyConnectForm.dfm @@ -0,0 +1,151 @@ +object fmMyConnect: TfmMyConnect + Left = 305 + Top = 192 + BorderStyle = bsDialog + Caption = 'My Connect' + ClientHeight = 216 + ClientWidth = 288 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + PixelsPerInch = 96 + TextHeight = 13 + object Panel: TPanel + Left = 8 + Top = 8 + Width = 273 + Height = 201 + BevelInner = bvRaised + BevelOuter = bvLowered + TabOrder = 0 + object lbUsername: TLabel + Left = 16 + Top = 20 + Width = 54 + Height = 13 + Caption = 'Username' + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsItalic] + ParentFont = False + end + object lbPassword: TLabel + Left = 16 + Top = 54 + Width = 52 + Height = 13 + Caption = 'Password' + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsItalic] + ParentFont = False + end + object lbServer: TLabel + Left = 16 + Top = 88 + Width = 37 + Height = 13 + Caption = 'Server' + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsItalic] + ParentFont = False + end + object Bevel1: TBevel + Left = 1 + Top = 150 + Width = 270 + Height = 6 + Shape = bsBottomLine + end + object lbDatabase: TLabel + Left = 16 + Top = 122 + Width = 52 + Height = 13 + Caption = 'Database' + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsItalic] + ParentFont = False + end + object edUsername: TEdit + Left = 104 + Top = 16 + Width = 153 + Height = 21 + TabOrder = 0 + end + object edPassword: TMaskEdit + Left = 104 + Top = 50 + Width = 153 + Height = 21 + PasswordChar = '*' + TabOrder = 1 + end + object edServer: TComboBox + Left = 104 + Top = 84 + Width = 153 + Height = 21 + ItemHeight = 13 + TabOrder = 2 + end + object edDatabase: TEdit + Left = 104 + Top = 118 + Width = 153 + Height = 21 + TabOrder = 3 + end + end + object btConnect: TBitBtn + Left = 81 + Top = 174 + Width = 82 + Height = 24 + Caption = 'OK' + Default = True + TabOrder = 1 + OnClick = btConnectClick + Glyph.Data = { + DE010000424DDE01000000000000760000002800000024000000120000000100 + 0400000000006801000000000000000000001000000000000000000000000000 + 80000080000000808000800000008000800080800000C0C0C000808080000000 + FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00333333333333 + 3333333333333333333333330000333333333333333333333333F33333333333 + 00003333344333333333333333388F3333333333000033334224333333333333 + 338338F3333333330000333422224333333333333833338F3333333300003342 + 222224333333333383333338F3333333000034222A22224333333338F338F333 + 8F33333300003222A3A2224333333338F3838F338F33333300003A2A333A2224 + 33333338F83338F338F33333000033A33333A222433333338333338F338F3333 + 0000333333333A222433333333333338F338F33300003333333333A222433333 + 333333338F338F33000033333333333A222433333333333338F338F300003333 + 33333333A222433333333333338F338F00003333333333333A22433333333333 + 3338F38F000033333333333333A223333333333333338F830000333333333333 + 333A333333333333333338330000333333333333333333333333333333333333 + 0000} + NumGlyphs = 2 + end + object btCancel: TBitBtn + Left = 177 + Top = 174 + Width = 82 + Height = 24 + TabOrder = 2 + Kind = bkCancel + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/ConnectDialog/MyConnectForm.pas b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/ConnectDialog/MyConnectForm.pas new file mode 100644 index 0000000..6ed1db5 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/ConnectDialog/MyConnectForm.pas @@ -0,0 +1,128 @@ +unit MyConnectForm; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, OLEDBIntf, + OLEDBC, StdCtrls, Mask, ExtCtrls, Buttons, MSAccess, OLEDBAccess, DBAccess, SdacVcl; + +type + TfmMyConnect = class(TForm) + Panel: TPanel; + lbUsername: TLabel; + lbPassword: TLabel; + lbServer: TLabel; + edUsername: TEdit; + edPassword: TMaskEdit; + edServer: TComboBox; + btConnect: TBitBtn; + btCancel: TBitBtn; + Bevel1: TBevel; + edDatabase: TEdit; + lbDatabase: TLabel; + procedure btConnectClick(Sender: TObject); + private + FConnectDialog: TMSConnectDialog; + FRetries:integer; + FRetry: boolean; + + procedure SetConnectDialog(Value: TMSConnectDialog); + + protected + procedure DoInit; virtual; + procedure DoConnect; virtual; + + public + + published + property ConnectDialog: TMSConnectDialog read FConnectDialog write SetConnectDialog; + + end; + +var + fmMyConnect: TfmMyConnect; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} + +procedure TfmMyConnect.DoInit; +begin + FRetry := False; + FRetries := FConnectDialog.Retries; + Caption := FConnectDialog.Caption; + + lbUsername.Caption := FConnectDialog.UsernameLabel; + lbPassword.Caption := FConnectDialog.PasswordLabel; + lbServer.Caption := FConnectDialog.ServerLabel; + btConnect.Caption := FConnectDialog.ConnectButton; + btCancel.Caption := FConnectDialog.CancelButton; + + FConnectDialog.GetServerList(edServer.Items); + edUsername.Text := FConnectDialog.Connection.Username; + edPassword.Text := FConnectDialog.Connection.Password; + edServer.Text := FConnectDialog.Connection.Server; + edDatabase.Text := FConnectDialog.Connection.Database; + + if (edUsername.Text <> '') and (edPassword.Text = '') then + ActiveControl := edPassword; +end; + +procedure TfmMyConnect.DoConnect; +begin + FConnectDialog.Connection.Password := edPassword.Text; + FConnectDialog.Connection.Server := edServer.Text; + FConnectDialog.Connection.UserName := edUsername.Text; + FConnectDialog.Connection.Database := edDatabase.Text; + try + FConnectDialog.Connection.PerformConnect(FRetry); + ModalResult := mrOk; + except + on E: EMSError do begin + Dec(FRetries); + FRetry := True; + if FRetries = 0 then + ModalResult := mrCancel; + + if E.MSSQLErrorCode <= NE_MAX_NETERROR then + ActiveControl := edServer + else + if E.OLEDBErrorCode = DB_SEC_E_AUTH_FAILED then + if ActiveControl <> edUsername then + ActiveControl := edPassword; + raise; + end + else + raise; + end; +end; + +procedure TfmMyConnect.SetConnectDialog(Value: TMSConnectDialog); +begin + FConnectDialog:= Value; + DoInit; +end; + +procedure TfmMyConnect.btConnectClick(Sender: TObject); +begin + DoConnect; +end; + +initialization + if GetClass('TfmMyConnect') = nil then begin + {$IFDEF VER6P} + Classes.StartClassGroup(TfmMyConnect); + {$ENDIF} + Classes.RegisterClass(TfmMyConnect); + {$IFDEF VER6P} + ActivateClassGroup(TfmMyConnect); + {$ENDIF} + end; + +end. + diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/FetchAll/FetchAll.dfm b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/FetchAll/FetchAll.dfm new file mode 100644 index 0000000..216a2cf --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/FetchAll/FetchAll.dfm @@ -0,0 +1,188 @@ +inherited FetchAllFrame: TFetchAllFrame + Width = 691 + Height = 277 + Align = alClient + object Splitter1: TSplitter + Left = 0 + Top = 105 + Width = 691 + Height = 2 + Cursor = crVSplit + Align = alTop + Color = clGreen + ParentColor = False + end + object DBGrid: TDBGrid + Left = 0 + Top = 107 + Width = 691 + Height = 170 + Align = alClient + DataSource = DataSource + TabOrder = 0 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object ToolBar: TPanel + Left = 0 + Top = 0 + Width = 691 + Height = 25 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object Panel1: TPanel + Left = 1 + Top = 0 + Width = 727 + Height = 24 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btClose: TSpeedButton + Left = 84 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Close' + Flat = True + Transparent = False + OnClick = btCloseClick + end + object btOpen: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Open' + Flat = True + Transparent = False + OnClick = btOpenClick + end + object btFillTables: TSpeedButton + Left = 480 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Fill tables' + Flat = True + Transparent = False + OnClick = btFillTablesClick + end + object DBNavigator: TDBNavigator + Left = 167 + Top = 1 + Width = 230 + Height = 22 + DataSource = DataSource + Flat = True + TabOrder = 0 + end + object Panel2: TPanel + Left = 398 + Top = 1 + Width = 81 + Height = 22 + BevelOuter = bvNone + TabOrder = 1 + object FetchAllCB: TCheckBox + Left = 9 + Top = 4 + Width = 70 + Height = 17 + Caption = 'FetchAll' + TabOrder = 0 + OnClick = FetchAllCBClick + end + end + object Panel3: TPanel + Left = 563 + Top = 1 + Width = 163 + Height = 22 + BevelOuter = bvNone + TabOrder = 2 + object Label1: TLabel + Left = 6 + Top = 5 + Width = 52 + Height = 13 + Caption = 'Row count' + end + object edRowCount: TEdit + Left = 68 + Top = 2 + Width = 91 + Height = 21 + TabOrder = 0 + Text = '3000' + end + end + end + end + object Memo: TMemo + Left = 0 + Top = 25 + Width = 691 + Height = 80 + Align = alTop + ScrollBars = ssVertical + TabOrder = 2 + end + object DataSource: TDataSource + DataSet = MSQuery + Left = 528 + Top = 120 + end + object MSQuery: TMSQuery + Connection = SDACForm.MSConnection + SQL.Strings = ( + 'select TOP 100000 * from Loaded1, Loaded2') + ReadOnly = True + FetchAll = False + Left = 496 + Top = 120 + end + object MSSQLFillTables: TMSSQL + Connection = SDACForm.MSConnection + SQL.Strings = ( + 'declare' + ' @i INTEGER;' + 'begin' + ' SET @i = 0' + ' WHILE @i <= :Cnt' + ' BEGIN' + ' SET @i = @i + 1' + ' INSERT INTO Loaded1 (' + ' Field1,' + ' Field2,' + ' Field3)' + ' VALUES (' + ' '#39'01234567890123456789'#39',' + ' '#39'12345678901234567890'#39',' + ' '#39'23456789012345678901'#39');' + ' INSERT INTO Loaded2 (' + ' Field1,' + ' Field2,' + ' Field3)' + ' VALUES (' + ' '#39'01234567890123456789'#39',' + ' '#39'12345678901234567890'#39',' + ' '#39'23456789012345678901'#39');' + ' END;' + 'end;') + CommandTimeout = 0 + Left = 525 + Top = 60 + ParamData = < + item + DataType = ftInteger + Name = 'Cnt' + ParamType = ptInput + Value = 1000 + end> + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/FetchAll/FetchAll.pas b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/FetchAll/FetchAll.pas new file mode 100644 index 0000000..15d7b36 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/FetchAll/FetchAll.pas @@ -0,0 +1,100 @@ +unit FetchAll; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + DBCtrls, ExtCtrls, Db, Grids, DBGrids, StdCtrls, ToolWin, SdacVcl, + ComCtrls, Buttons, MemDS, DBAccess, MSAccess, OLEDBAccess, DemoFrame, + SdacDemoForm; + +type + TFetchAllFrame = class(TDemoFrame) + DBGrid: TDBGrid; + DataSource: TDataSource; + ToolBar: TPanel; + Memo: TMemo; + MSQuery: TMSQuery; + Panel1: TPanel; + btClose: TSpeedButton; + DBNavigator: TDBNavigator; + btOpen: TSpeedButton; + Splitter1: TSplitter; + Panel2: TPanel; + FetchAllCB: TCheckBox; + btFillTables: TSpeedButton; + Panel3: TPanel; + Label1: TLabel; + edRowCount: TEdit; + MSSQLFillTables: TMSSQL; + procedure btOpenClick(Sender: TObject); + procedure btCloseClick(Sender: TObject); + procedure FetchAllCBClick(Sender: TObject); + procedure btFillTablesClick(Sender: TObject); + private + { Private declarations } + public + // Demo management + procedure Initialize; override; + procedure SetDebug(Value: boolean); override; + end; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} + +procedure TFetchAllFrame.btOpenClick(Sender: TObject); +var + dt: TDateTime; +begin + MSQuery.Connection.Open; + + MSQuery.SQL.Assign(Memo.Lines); + + if MSQuery.FetchAll then + SdacForm.StatusBar.Panels[1].Text := 'FetchAll is True' + else + SdacForm.StatusBar.Panels[1].Text := 'FetchAll is False'; + + dt := Now; + MSQuery.Open; + SdacForm.StatusBar.Panels[2].Text := 'Opened in ' + TimeToStr(Now - dt); + SdacForm.StatusBar.Update; +end; + +procedure TFetchAllFrame.btCloseClick(Sender: TObject); +begin + MSQuery.Close; +end; + +procedure TFetchAllFrame.FetchAllCBClick(Sender: TObject); +begin + MSQuery.FetchAll := FetchAllCB.Checked; +end; + +// Demo management +procedure TFetchAllFrame.Initialize; +begin + inherited; + MSQuery.Connection := Connection as TMSConnection; + Memo.Lines.Text := MSQuery.SQL.Text; + FetchAllCB.Checked := MSQuery.FetchAll; +end; + +procedure TFetchAllFrame.SetDebug(Value: boolean); +begin + MSQuery.Debug := Value; +end; + +procedure TFetchAllFrame.btFillTablesClick(Sender: TObject); +begin + MSSQLFillTables.ParamByName('cnt').AsString := edRowCount.Text; + MSSQLFillTables.Execute; +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/FilterAndIndex/FilterAndIndex.dfm b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/FilterAndIndex/FilterAndIndex.dfm new file mode 100644 index 0000000..6bff59c --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/FilterAndIndex/FilterAndIndex.dfm @@ -0,0 +1,311 @@ +inherited FilterAndIndexFrame: TFilterAndIndexFrame + Width = 443 + Height = 277 + Align = alClient + object DBGrid: TDBGrid + Left = 166 + Top = 47 + Width = 277 + Height = 230 + Align = alClient + DataSource = DataSource + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + ParentFont = False + TabOrder = 0 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object Panel4: TPanel + Left = 0 + Top = 0 + Width = 443 + Height = 47 + Align = alTop + BevelOuter = bvNone + Locked = True + TabOrder = 1 + object ToolBar: TPanel + Left = 0 + Top = 0 + Width = 651 + Height = 47 + Align = alLeft + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btClose: TSpeedButton + Left = 84 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Close' + Flat = True + Transparent = False + OnClick = btCloseClick + end + object btOpen: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Open' + Flat = True + Transparent = False + OnClick = btOpenClick + end + object Panel5: TPanel + Left = 388 + Top = 1 + Width = 149 + Height = 22 + BevelOuter = bvNone + TabOrder = 0 + object cbCalcFields: TCheckBox + Left = 8 + Top = 0 + Width = 142 + Height = 23 + Caption = 'Calculated/Lookup fields' + Color = clBtnFace + ParentColor = False + TabOrder = 0 + OnClick = cbCalcFieldsClick + end + end + object Panel2: TPanel + Left = 167 + Top = 24 + Width = 483 + Height = 22 + BevelOuter = bvNone + TabOrder = 1 + object cbFilter: TCheckBox + Left = 380 + Top = 0 + Width = 54 + Height = 21 + Caption = 'Filter' + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + ParentColor = False + ParentFont = False + TabOrder = 0 + OnClick = cbFilterClick + end + object edFilter: TEdit + Left = 6 + Top = 2 + Width = 365 + Height = 21 + Anchors = [akLeft, akTop, akRight] + TabOrder = 1 + Text = 'DEPTNO = 10' + OnExit = edFilterExit + end + end + object DBNavigator1: TDBNavigator + Left = 167 + Top = 1 + Width = 220 + Height = 23 + DataSource = DataSource + Flat = True + TabOrder = 2 + end + object Panel1: TPanel + Left = 538 + Top = 1 + Width = 112 + Height = 22 + BevelOuter = bvNone + TabOrder = 3 + object cbCacheCalcFields: TCheckBox + Left = 9 + Top = 0 + Width = 100 + Height = 23 + Caption = 'CacheCalcFields' + Color = clBtnFace + ParentColor = False + TabOrder = 0 + OnClick = cbCacheCalcFieldsClick + end + end + object Panel6: TPanel + Left = 0 + Top = 24 + Width = 166 + Height = 22 + BevelOuter = bvNone + TabOrder = 4 + object cbIndex: TCheckBox + Left = 9 + Top = 3 + Width = 64 + Height = 15 + Caption = 'Index' + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + ParentColor = False + ParentFont = False + TabOrder = 0 + OnClick = cbIndexClick + end + end + end + end + object Panel3: TPanel + Left = 0 + Top = 47 + Width = 166 + Height = 230 + Align = alLeft + BevelOuter = bvNone + ParentColor = True + TabOrder = 2 + object Panel8: TPanel + Left = 0 + Top = 146 + Width = 166 + Height = 84 + Align = alBottom + BevelOuter = bvNone + Caption = 'Panel8' + Color = clGreen + TabOrder = 0 + object Panel7: TPanel + Left = 1 + Top = 1 + Width = 164 + Height = 82 + BevelOuter = bvNone + TabOrder = 0 + object Label1: TLabel + Left = 6 + Top = 3 + Width = 90 + Height = 13 + Caption = 'IndexFieldNames =' + end + object lbIndexFieldNames: TLabel + Left = 6 + Top = 22 + Width = 126 + Height = 54 + AutoSize = False + Transparent = False + WordWrap = True + end + end + end + object lbFields: TListBox + Left = 0 + Top = 0 + Width = 166 + Height = 146 + Align = alClient + ItemHeight = 13 + MultiSelect = True + TabOrder = 1 + OnClick = lbFieldsClick + end + end + object Query: TMSQuery + Connection = SDACForm.MSConnection + SQL.Strings = ( + 'SELECT * FROM Emp') + Debug = True + RefreshOptions = [roAfterInsert, roAfterUpdate] + Left = 272 + Top = 55 + end + object DataSource: TDataSource + DataSet = Query + Left = 304 + Top = 55 + end + object Query2: TMSQuery + Connection = SDACForm.MSConnection + SQL.Strings = ( + 'SELECT * FROM Emp') + Debug = True + OnCalcFields = Query2CalcFields + Left = 272 + Top = 88 + object Query2CALCULATED: TIntegerField + FieldKind = fkCalculated + FieldName = 'CALCULATED' + Calculated = True + end + object Query2LOOKUP: TStringField + FieldKind = fkLookup + FieldName = 'LOOKUP' + LookupDataSet = LookupQuery + LookupKeyFields = 'DEPTNO' + LookupResultField = 'DNAME' + KeyFields = 'DEPTNO' + Lookup = True + end + object Query2EMPNO: TIntegerField + FieldName = 'EMPNO' + Required = True + end + object Query2ENAME: TStringField + FieldName = 'ENAME' + Size = 10 + end + object Query2JOB: TStringField + FieldName = 'JOB' + Size = 9 + end + object Query2MGR: TIntegerField + FieldName = 'MGR' + end + object Query2HIREDATE: TDateTimeField + FieldName = 'HIREDATE' + end + object Query2SAL: TFloatField + FieldName = 'SAL' + end + object Query2COMM: TFloatField + FieldName = 'COMM' + end + object Query2DEPTNO: TIntegerField + FieldName = 'DEPTNO' + end + end + object LookupQuery: TMSQuery + Connection = SDACForm.MSConnection + SQL.Strings = ( + 'SELECT * FROM Dept') + Left = 304 + Top = 88 + object LookupQueryDEPTNO: TIntegerField + FieldName = 'DEPTNO' + Required = True + end + object LookupQueryDNAME: TStringField + FieldName = 'DNAME' + Size = 14 + end + object LookupQueryLOC: TStringField + FieldName = 'LOC' + Size = 13 + end + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/FilterAndIndex/FilterAndIndex.pas b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/FilterAndIndex/FilterAndIndex.pas new file mode 100644 index 0000000..7891adf --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/FilterAndIndex/FilterAndIndex.pas @@ -0,0 +1,206 @@ +unit FilterAndIndex; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + DBCtrls, ExtCtrls, Grids, DBGrids, StdCtrls, ToolWin, ComCtrls, SdacVcl, + MemDS, DBAccess, MSAccess, DB, Buttons, DemoFrame, SdacDemoForm; + +type + TFilterAndIndexFrame = class(TDemoFrame) + Query: TMSQuery; + DBGrid: TDBGrid; + DataSource: TDataSource; + Panel4: TPanel; + ToolBar: TPanel; + btClose: TSpeedButton; + btOpen: TSpeedButton; + DBNavigator1: TDBNavigator; + Panel3: TPanel; + Query2: TMSQuery; + LookupQuery: TMSQuery; + Query2EMPNO: TIntegerField; + Query2ENAME: TStringField; + Query2JOB: TStringField; + Query2MGR: TIntegerField; + Query2HIREDATE: TDateTimeField; + Query2SAL: TFloatField; + Query2COMM: TFloatField; + Query2DEPTNO: TIntegerField; + LookupQueryDEPTNO: TIntegerField; + LookupQueryDNAME: TStringField; + LookupQueryLOC: TStringField; + Query2CALCULATED: TIntegerField; + Query2LOOKUP: TStringField; + Label1: TLabel; + lbIndexFieldNames: TLabel; + Panel5: TPanel; + Panel2: TPanel; + Panel7: TPanel; + Panel8: TPanel; + lbFields: TListBox; + cbFilter: TCheckBox; + cbCalcFields: TCheckBox; + Panel1: TPanel; + cbCacheCalcFields: TCheckBox; + edFilter: TEdit; + Panel6: TPanel; + cbIndex: TCheckBox; + procedure btOpenClick(Sender: TObject); + procedure btCloseClick(Sender: TObject); + procedure Query2CalcFields(DataSet: TDataSet); + procedure cbFilterClick(Sender: TObject); + procedure cbCalcFieldsClick(Sender: TObject); + procedure cbIndexClick(Sender: TObject); + procedure lbFieldsClick(Sender: TObject); + procedure cbCacheCalcFieldsClick(Sender: TObject); + procedure edFilterExit(Sender: TObject); + private + FOldActive: boolean; + FFilterFilterNames: TStringList; + procedure BeginChange; + procedure EndChange; + public + destructor Destroy; override; + // Demo management + procedure Initialize; override; + procedure SetDebug(Value: boolean); override; + end; + +var + FilterAndIndexFrame: TFilterAndIndexFrame; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} + +procedure TFilterAndIndexFrame.btOpenClick(Sender: TObject); +var + i: integer; +begin + if DataSource.DataSet.Active then + Exit; + lbFields.Items.Clear; + lbFieldsClick(nil); + cbFilterClick(nil); + DataSource.DataSet.Open; + for i := 0 to DataSource.DataSet.FieldCount - 1 do + lbFields.Items.Add(DataSource.DataSet.Fields[i].FieldName); +end; + +procedure TFilterAndIndexFrame.btCloseClick(Sender: TObject); +begin + DataSource.DataSet.Close; +end; + +procedure TFilterAndIndexFrame.Query2CalcFields(DataSet: TDataSet); +begin + Query2CALCULATED.AsInteger := Query2EMPNO.AsInteger * 2; +end; + +procedure TFilterAndIndexFrame.BeginChange; +begin + FOldActive := DataSource.DataSet.Active; + if FOldActive then + btCloseClick(nil); +end; + +procedure TFilterAndIndexFrame.EndChange; +begin + if FOldActive then + btOpenClick(nil); +end; + +procedure TFilterAndIndexFrame.cbFilterClick(Sender: TObject); +begin + DataSource.DataSet.Filtered := cbFilter.Checked; + DataSource.DataSet.Filter := edFilter.Text; +end; + +procedure TFilterAndIndexFrame.cbCalcFieldsClick(Sender: TObject); +begin + BeginChange; + if cbCalcFields.Checked then + DataSource.DataSet := Query2 + else + DataSource.DataSet := Query; + EndChange; +end; + +procedure TFilterAndIndexFrame.cbIndexClick(Sender: TObject); +begin + if cbIndex.Checked then + TMSQuery(DataSource.DataSet).IndexFieldNames := lbIndexFieldNames.Caption + else + TMSQuery(DataSource.DataSet).IndexFieldNames := '' +end; + +procedure TFilterAndIndexFrame.lbFieldsClick(Sender: TObject); +var + i, k: integer; + s: string; +begin + i := 0; + while i < FFilterFilterNames.Count do begin + k := lbFields.Items.IndexOf(FFilterFilterNames[i]); + if (k < 0) or not lbFields.Selected[k] then + FFilterFilterNames.Delete(i) + else + Inc(i); + end; + for i := 0 to lbFields.Items.Count - 1 do + if lbFields.Selected[i] and + (FFilterFilterNames.IndexOf(lbFields.Items[i]) < 0) then + FFilterFilterNames.Add(lbFields.Items[i]); + + s := ''; + for i := 0 to FFilterFilterNames.Count - 1 do begin + if s <> '' then + s := s + ', '; + s := s + FFilterFilterNames[i]; + end; + lbIndexFieldNames.Caption := s; + + cbIndexClick(nil); +end; + +procedure TFilterAndIndexFrame.cbCacheCalcFieldsClick(Sender: TObject); +begin + BeginChange; + TMSQuery(DataSource.DataSet).Options.CacheCalcFields := cbCacheCalcFields.Checked; + EndChange; +end; + +procedure TFilterAndIndexFrame.edFilterExit(Sender: TObject); +begin + cbFilterClick(nil); +end; + +destructor TFilterAndIndexFrame.Destroy; +begin + FFilterFilterNames.Free; + inherited; +end; + +// Demo management +procedure TFilterAndIndexFrame.Initialize; +begin + inherited; + Query.Connection := Connection as TMSConnection; + Query2.Connection := Connection as TMSConnection; + FFilterFilterNames := TStringList.Create; +end; + +procedure TFilterAndIndexFrame.SetDebug(Value: boolean); +begin + Query.Debug := Value; + Query2.Debug := Value; +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Loader/Fetch.dfm b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Loader/Fetch.dfm new file mode 100644 index 0000000..9030202 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Loader/Fetch.dfm @@ -0,0 +1,62 @@ +object FetchForm: TFetchForm + Left = 396 + Top = 205 + BorderIcons = [biSystemMenu] + BorderStyle = bsDialog + Caption = 'Loading' + ClientHeight = 134 + ClientWidth = 299 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + FormStyle = fsStayOnTop + KeyPreview = True + OldCreateOrder = False + Position = poMainFormCenter + OnKeyDown = FormKeyDown + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 13 + object Label1: TLabel + Left = 8 + Top = 61 + Width = 287 + Height = 13 + Caption = 'Press Cancel button to interrupt loading operation.' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + end + object Panel1: TPanel + Left = 102 + Top = 93 + Width = 84 + Height = 24 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btCancel: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Cancel' + Flat = True + Transparent = False + OnClick = btCancelClick + end + end + object ProgressBar: TProgressBar + Left = 8 + Top = 25 + Width = 287 + Height = 16 + TabOrder = 1 + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Loader/Fetch.pas b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Loader/Fetch.pas new file mode 100644 index 0000000..6019ccf --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Loader/Fetch.pas @@ -0,0 +1,72 @@ +unit Fetch; + +interface + +uses +{$IFDEF LINUX} + QGraphics, QControls, QForms, QDialogs, QStdCtrls, + QDBCtrls, QComCtrls, QExtCtrls, QGrids, QButtons, +{$ELSE} + Windows, Messages,Graphics, Controls, Forms, Dialogs, Buttons, + DBCtrls, ExtCtrls, Grids, DBGrids, StdCtrls, ToolWin, ComCtrls, +{$ENDIF} +{$IFDEF CLR} + System.ComponentModel, +{$ENDIF} + SysUtils, Classes; + +type + TFetchForm = class(TForm) + Label1: TLabel; + Panel1: TPanel; + btCancel: TSpeedButton; + ProgressBar: TProgressBar; + procedure btCancelClick(Sender: TObject); + procedure FormKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); + procedure FormShow(Sender: TObject); + private + { Private declarations } + public + CancelLoad: boolean; + end; + +var + FetchForm: TFetchForm; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} +{$IFDEF LINUX} +{$R *.xfm} +{$ENDIF} + +procedure TFetchForm.btCancelClick(Sender: TObject); +begin + CancelLoad := True; + Hide; +end; + +procedure TFetchForm.FormKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); + +{$IFDEF LINUX} +const + VK_ESCAPE = 27; +{$ENDIF} +begin + if Key = VK_ESCAPE then + Close; +end; + +procedure TFetchForm.FormShow(Sender: TObject); +begin + ProgressBar.Position := 0; +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Loader/Loader.dfm b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Loader/Loader.dfm new file mode 100644 index 0000000..d159881 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Loader/Loader.dfm @@ -0,0 +1,185 @@ +inherited LoaderFrame: TLoaderFrame + Width = 443 + Height = 277 + Align = alClient + object Panel2: TPanel + Left = 0 + Top = 0 + Width = 443 + Height = 64 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object ToolBar: TPanel + Left = 1 + Top = 1 + Width = 586 + Height = 62 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btOpen: TSpeedButton + Left = 1 + Top = 1 + Width = 85 + Height = 24 + Caption = 'Open' + Flat = True + Transparent = False + OnClick = btOpenClick + end + object btClose: TSpeedButton + Left = 87 + Top = 1 + Width = 85 + Height = 24 + Caption = 'Close' + Flat = True + Transparent = False + OnClick = btCloseClick + end + object btLoad: TSpeedButton + Left = 173 + Top = 1 + Width = 85 + Height = 24 + Caption = 'Load' + Flat = True + Transparent = False + OnClick = btLoadClick + end + object btDeleteAll: TSpeedButton + Left = 259 + Top = 1 + Width = 85 + Height = 24 + Caption = 'Delete All' + Flat = True + Transparent = False + OnClick = btDeleteAllClick + end + object DBNavigator: TDBNavigator + Left = 345 + Top = 1 + Width = 240 + Height = 24 + DataSource = DataSource + Flat = True + TabOrder = 0 + end + object Panel1: TPanel + Left = 1 + Top = 26 + Width = 171 + Height = 35 + BevelOuter = bvNone + TabOrder = 1 + object Label1: TLabel + Left = 6 + Top = 14 + Width = 49 + Height = 13 + Caption = 'Load rows' + end + object edRows: TEdit + Left = 66 + Top = 10 + Width = 87 + Height = 21 + TabOrder = 0 + Text = '1000' + end + end + object Panel3: TPanel + Left = 173 + Top = 26 + Width = 412 + Height = 35 + BevelOuter = bvNone + TabOrder = 2 + object rgEvent: TRadioGroup + Left = 9 + Top = -1 + Width = 225 + Height = 32 + Columns = 2 + Items.Strings = ( + 'GetColumnData' + 'PutData') + TabOrder = 0 + OnClick = rgEventClick + end + end + end + end + object DBGrid: TDBGrid + Left = 0 + Top = 64 + Width = 443 + Height = 213 + Align = alClient + DataSource = DataSource + TabOrder = 1 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object DataSource: TDataSource + DataSet = Query + Left = 440 + Top = 64 + end + object Query: TMSQuery + Connection = SDACForm.MSConnection + SQL.Strings = ( + 'SELECT * FROM Sdac_Loaded ORDER BY CODE') + AfterOpen = QueryAfterOpen + BeforeClose = QueryBeforeClose + AfterRefresh = QueryAfterOpen + Left = 408 + Top = 64 + end + object MSLoader: TMSLoader + Connection = SDACForm.MSConnection + TableName = 'Sdac_Loaded' + Columns = < + item + Name = 'Code' + FieldType = ftInteger + Size = 0 + end + item + Name = 'Num' + FieldType = ftInteger + Size = 0 + end + item + Name = 'Num1' + FieldType = ftFloat + Size = 0 + Precision = 15 + end + item + Name = 'Str' + Size = 50 + end + item + Name = 'Dat' + FieldType = ftDateTime + Size = 0 + end> + OnGetColumnData = MSLoaderGetColumnData + Left = 408 + Top = 96 + end + object TruncCommand: TMSSQL + Connection = SDACForm.MSConnection + SQL.Strings = ( + 'TRUNCATE TABLE SDAC_Loaded') + CommandTimeout = 0 + Left = 408 + Top = 128 + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Loader/Loader.pas b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Loader/Loader.pas new file mode 100644 index 0000000..945d828 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Loader/Loader.pas @@ -0,0 +1,245 @@ +unit Loader; + +interface + +uses +{$IFNDEF VER130} + Variants, +{$ENDIF} + SysUtils, +{$IFDEF LINUX} + Types, Classes, QGraphics, QControls, QForms, QDialogs, QStdCtrls, + QDBCtrls, QComCtrls, QExtCtrls, QGrids, QDBGrids, QButtons, SdacClx, +{$ELSE} + Windows, Messages, Classes, Graphics, Controls, Forms, Dialogs, Buttons, + Grids, DBGrids, StdCtrls, ExtCtrls, DBCtrls, SdacVcl, +{$ENDIF} +{$IFDEF CLR} + System.ComponentModel, +{$ENDIF} + Db, MemDS, DBAccess, Fetch, + DALoader, MSLoader, MSScript, MSAccess, DemoFrame, DAScript, SDacDemoForm + ; + +type + TLoaderFrame = class(TDemoFrame) + DataSource: TDataSource; + Query: TMSQuery; + MSLoader: TMSLoader; + TruncCommand: TMSSQL; + Panel2: TPanel; + ToolBar: TPanel; + btOpen: TSpeedButton; + btClose: TSpeedButton; + btLoad: TSpeedButton; + btDeleteAll: TSpeedButton; + DBNavigator: TDBNavigator; + Panel1: TPanel; + Label1: TLabel; + edRows: TEdit; + DBGrid: TDBGrid; + Panel3: TPanel; + rgEvent: TRadioGroup; + procedure btOpenClick(Sender: TObject); + procedure btCloseClick(Sender: TObject); + procedure btLoadClick(Sender: TObject); + procedure btDeleteAllClick(Sender: TObject); + procedure QueryAfterOpen(DataSet: TDataSet); + procedure QueryBeforeClose(DataSet: TDataSet); + procedure PutData(Sender: TMSLoader); + procedure rgEventClick(Sender: TObject); + procedure QueryBeforeFetch(DataSet: TCustomDADataSet; + var Cancel: Boolean); + procedure QueryAfterFetch(DataSet: TCustomDADataSet); + procedure MSLoaderGetColumnData(Sender: TObject; Column: TMSColumn; + Row: Integer; var Value: Variant; var IsEOF: Boolean); + private + { Private declarations } + public + PMInterval: integer; + Count: integer; + destructor Destroy; override; + + // Demo management + procedure Initialize; override; + procedure SetDebug(Value: boolean); override; + end; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} +{$IFDEF LINUX} +{$R *.xfm} +{$ENDIF} + +destructor TLoaderFrame.Destroy; +begin + FreeAndNil(FetchForm); + inherited; +end; + +procedure TLoaderFrame.btOpenClick(Sender: TObject); +begin + Query.Open; +end; + +procedure TLoaderFrame.btCloseClick(Sender: TObject); +begin + Query.Close; +end; + +procedure TLoaderFrame.btLoadClick(Sender: TObject); +var + Start, Finish, Freq: Integer; +begin + Start := GetTickCount; + ShortDateFormat := 'yyyy-mm-dd'; + MSLoader.Connection.Connect; + FetchForm.Show; + Count := StrToInt(edRows.Text); + FetchForm.ProgressBar.Max := Count; + FetchForm.CancelLoad := False; + try + MSLoader.Load; // loading rows + finally + FetchForm.Hide; + Finish := GetTickCount; + Freq := 1000; + SDacForm.StatusBar.Panels[2].Text := 'Time: ' + FloatToStr(Round((Finish - Start) / Freq * 100) / 100) + ' sec.'; + if Query.Active then + Query.Refresh; + end; +end; + +procedure TLoaderFrame.MSLoaderGetColumnData(Sender: TObject; + Column: TMSColumn; Row: Integer; var Value: Variant; var IsEOF: Boolean); +begin + IsEOF := Row > Count; + case Column.Index of + 0: Value := Row; + 1: Value := Random(100); + 2: Value := Random*100; + 3: Value := 'abc01234567890123456789'; + 4: Value := Date; + else + Value := Null; + end; + + FetchForm.ProgressBar.Position := Row; + + if PMInterval = 100 then begin // 100 fields per time + Application.ProcessMessages; + if FetchForm.CancelLoad then begin + MessageDlg('Loading was cancelled by user.' + #13#10 + + 'Sucessfully loaded '+ IntToStr(Row - 1) + ' rows.', mtInformation, [mbOK], 0); + IsEof := True; + end; + end + else + inc(PMInterval); +end; + +procedure TLoaderFrame.PutData(Sender: TMSLoader); +var + i: integer; +begin + PMInterval := 0; + + for i := 1 to Count do begin + Sender.PutColumnData(0, i, i); + Sender.PutColumnData('NUM', i, Random(100)); + Sender.PutColumnData(2, i, Random*100); + Sender.PutColumnData(3, i, 'abc01234567890123456789'); + Sender.PutColumnData(4, i, Date); + FetchForm.ProgressBar.Position := i; + if PMInterval = 100 then begin // 100 records per time + PMInterval := 0; + Application.ProcessMessages; + if FetchForm.CancelLoad then begin + MessageDlg('Loading was cancelled by user.' + #13#10 + + 'Sucessfully loaded '+ IntToStr(i) + ' rows.', mtInformation, [mbOK], 0); + Abort; + end; + end + else + inc(PMInterval); + end; +end; + +procedure TLoaderFrame.btDeleteAllClick(Sender: TObject); +begin + TruncCommand.Execute; + if Query.Active then + Query.Refresh; +end; + +procedure TLoaderFrame.QueryAfterOpen(DataSet: TDataSet); +begin + SDACForm.StatusBar.Panels[1].Text := 'Count: ' + IntToStr(DataSet.RecordCount); +end; + +procedure TLoaderFrame.QueryBeforeClose(DataSet: TDataSet); +begin + SDACForm.StatusBar.Panels[1].Text := ''; +end; + +procedure TLoaderFrame.rgEventClick(Sender: TObject); +begin + if rgEvent.ItemIndex = 0 then begin + MSLoader.OnGetColumnData := MSLoaderGetColumnData; + MSLoader.OnPutData := nil; + end + else begin + MSLoader.OnGetColumnData := nil; + MSLoader.OnPutData := PutData; + end +end; + +procedure TLoaderFrame.QueryBeforeFetch(DataSet: TCustomDADataSet; + var Cancel: Boolean); +begin + if DataSet.FetchingAll then begin + FetchForm.Show; + Application.ProcessMessages; + Cancel := not FetchForm.Visible; + + if Cancel then + SdacForm.StatusBar.Panels[1].Text := 'RecordCount: ' + IntToStr(DataSet.RecordCount); + end; +end; + +procedure TLoaderFrame.QueryAfterFetch(DataSet: TCustomDADataSet); +begin + if not DataSet.FetchingAll then begin + FetchForm.Close; + Application.ProcessMessages; + + SdacForm.StatusBar.Panels[1].Text := 'RecordCount: ' + IntToStr(DataSet.RecordCount); + end; +end; + +// Demo management +procedure TLoaderFrame.Initialize; +begin + inherited; + Query.Connection := Connection as TMSConnection; + MSLoader.Connection := Connection as TMSConnection; + TruncCommand.Connection := Connection as TMSConnection; + + if FetchForm = nil then + FetchForm := TFetchForm.Create(SDACForm); + rgEvent.ItemIndex := 1; +end; + +procedure TLoaderFrame.SetDebug(Value: boolean); +begin + Query.Debug := Value; + TruncCommand.Debug := Value; +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/LongStrings/LongStrings.dfm b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/LongStrings/LongStrings.dfm new file mode 100644 index 0000000..1966184 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/LongStrings/LongStrings.dfm @@ -0,0 +1,186 @@ +inherited LongStringsFrame: TLongStringsFrame + Width = 443 + Height = 277 + Align = alClient + object Splitter1: TSplitter + Left = 0 + Top = 193 + Width = 443 + Height = 2 + Cursor = crVSplit + Align = alTop + end + object DBGrid: TDBGrid + Left = 0 + Top = 25 + Width = 443 + Height = 168 + Align = alTop + DataSource = DataSource + TabOrder = 2 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object ToolBar: TPanel + Left = 0 + Top = 0 + Width = 443 + Height = 25 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object ToolButton1: TToolButton + Left = 390 + Top = 2 + Width = 17 + Caption = 'ToolButton1' + Style = tbsSeparator + end + object Panel1: TPanel + Left = 1 + Top = 0 + Width = 498 + Height = 24 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btClose: TSpeedButton + Left = 84 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Close' + Flat = True + Transparent = False + OnClick = btCloseClick + end + object btOpen: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Open' + Flat = True + Transparent = False + OnClick = btOpenClick + end + object Panel2: TPanel + Left = 398 + Top = 1 + Width = 99 + Height = 22 + BevelOuter = bvNone + TabOrder = 0 + object cbLongStrings: TCheckBox + Left = 7 + Top = 4 + Width = 97 + Height = 17 + Caption = 'LongStrings' + TabOrder = 0 + OnClick = cbLongStringsClick + end + end + object DBNavigator: TDBNavigator + Left = 167 + Top = 1 + Width = 230 + Height = 22 + DataSource = DataSource + Flat = True + TabOrder = 1 + end + end + end + object meComments: TDBMemo + Left = 0 + Top = 221 + Width = 443 + Height = 56 + Align = alClient + DataField = 'VALUE' + DataSource = DataSource + ScrollBars = ssVertical + TabOrder = 3 + end + object ToolBar1: TPanel + Left = 0 + Top = 195 + Width = 443 + Height = 26 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object ToolButton2: TToolButton + Left = 150 + Top = 2 + Width = 25 + Caption = 'ToolButton2' + Style = tbsSeparator + end + object Panel3: TPanel + Left = 1 + Top = 1 + Width = 250 + Height = 24 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btClear: TSpeedButton + Left = 167 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Clear' + Flat = True + Transparent = False + OnClick = btClearClick + end + object btSave: TSpeedButton + Left = 84 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Save to file' + Flat = True + Transparent = False + OnClick = btSaveClick + end + object btLoad: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Load from file' + Flat = True + Transparent = False + OnClick = btLoadClick + end + end + end + object DataSource: TDataSource + DataSet = MSQuery + Left = 440 + Top = 88 + end + object OpenDialog: TOpenDialog + Left = 264 + Top = 219 + end + object SaveDialog: TSaveDialog + Left = 296 + Top = 219 + end + object MSQuery: TMSQuery + Connection = SDACForm.MSConnection + SQL.Strings = ( + 'SELECT * FROM SDAC_Long_char') + Debug = True + FetchRows = 1 + Left = 408 + Top = 88 + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/LongStrings/LongStrings.pas b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/LongStrings/LongStrings.pas new file mode 100644 index 0000000..998881a --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/LongStrings/LongStrings.pas @@ -0,0 +1,138 @@ +unit LongStrings; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + DBCtrls, ExtCtrls, Db, Grids, DBGrids, StdCtrls, ToolWin, SdacVcl, + ComCtrls, MemDS, DBAccess, MSAccess, Buttons, DemoFrame, SdacDemoForm; + +type + TLongStringsFrame = class(TDemoFrame) + DBGrid: TDBGrid; + DataSource: TDataSource; + ToolBar: TPanel; + meComments: TDBMemo; + Splitter1: TSplitter; + ToolBar1: TPanel; + OpenDialog: TOpenDialog; + SaveDialog: TSaveDialog; + ToolButton1: TToolButton; + ToolButton2: TToolButton; + Panel1: TPanel; + Panel2: TPanel; + DBNavigator: TDBNavigator; + btClose: TSpeedButton; + btOpen: TSpeedButton; + cbLongStrings: TCheckBox; + Panel3: TPanel; + btClear: TSpeedButton; + btSave: TSpeedButton; + btLoad: TSpeedButton; + MSQuery: TMSQuery; + procedure btOpenClick(Sender: TObject); + procedure btCloseClick(Sender: TObject); + procedure btLoadClick(Sender: TObject); + procedure btSaveClick(Sender: TObject); + procedure cbLongStringsClick(Sender: TObject); + procedure btClearClick(Sender: TObject); + private + { Private declarations } + public + // Demo management + procedure Initialize; override; + procedure SetDebug(Value: boolean); override; + end; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} + +procedure TLongStringsFrame.btOpenClick(Sender: TObject); +begin + MSQuery.Open; +end; + +procedure TLongStringsFrame.btCloseClick(Sender: TObject); +begin + MSQuery.Close; +end; + +procedure TLongStringsFrame.btLoadClick(Sender: TObject); +var + List: TStringList; +begin + if MSQuery.Active and OpenDialog.Execute then begin + if MSQuery.State = dsBrowse then + MSQuery.Edit; + + if MSQuery.FieldByName('Value') is TBlobField then + TBlobField(MSQuery.FieldByName('Value')).LoadFromFile(OpenDialog.FileName) + else begin + List := TStringList.Create; + try + List.LoadFromFile(OpenDialog.FileName); + MSQuery.FieldByName('Value').AsString := List.Text; + finally + List.Free; + end; + end; + end; +end; + +procedure TLongStringsFrame.btSaveClick(Sender: TObject); +var + List: TStringList; +begin + if not MSQuery.EOF and SaveDialog.Execute then + if MSQuery.FieldByName('Value') is TBlobField then + TBlobField(MSQuery.FieldByName('Value')).SaveToFile(SaveDialog.FileName) + else begin + List := TStringList.Create; + try + List.Text := MSQuery.FieldByName('Value').AsString; + List.SaveToFile(SaveDialog.FileName); + finally + List.Free; + end; + end; +end; + +procedure TLongStringsFrame.cbLongStringsClick(Sender: TObject); +var + OldActive: boolean; +begin + OldActive := MSQuery.Active; + MSQuery.Active := False; + MSQuery.Options.LongStrings := cbLongStrings.Checked; + MSQuery.Active := OldActive; +end; + +procedure TLongStringsFrame.btClearClick(Sender: TObject); +begin + if MSQuery.Active then begin + if MSQuery.State = dsBrowse then + MSQuery.Edit; + MSQuery.FieldByName('Value').AsString := ''; + end; +end; + +// Demo management +procedure TLongStringsFrame.Initialize; +begin + inherited; + MSQuery.Connection := Connection as TMSConnection; + cbLongStrings.Checked := MSQuery.Options.LongStrings; +end; + +procedure TLongStringsFrame.SetDebug(Value: boolean); +begin + MSQuery.Debug := Value; +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/MasterDetail/MasterDetail.dfm b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/MasterDetail/MasterDetail.dfm new file mode 100644 index 0000000..d826427 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/MasterDetail/MasterDetail.dfm @@ -0,0 +1,277 @@ +inherited MasterDetailFrame: TMasterDetailFrame + Width = 443 + Height = 277 + Align = alClient + object Splitter1: TSplitter + Left = 0 + Top = 0 + Width = 443 + Height = 1 + Cursor = crVSplit + Align = alTop + end + object Splitter3: TSplitter + Left = 0 + Top = 143 + Width = 443 + Height = 1 + Cursor = crVSplit + Align = alTop + Color = clGreen + ParentColor = False + end + object DBGrid: TDBGrid + Left = 0 + Top = 27 + Width = 443 + Height = 116 + Align = alTop + DataSource = dsMaster + TabOrder = 0 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object ToolBar: TPanel + Left = 0 + Top = 1 + Width = 443 + Height = 26 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object Panel2: TPanel + Left = 0 + Top = 0 + Width = 554 + Height = 24 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btOpen: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Open' + Flat = True + Transparent = False + OnClick = btOpenClick + end + object btClose: TSpeedButton + Left = 84 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Close' + Flat = True + Transparent = False + OnClick = btCloseClick + end + object DBNavigator: TDBNavigator + Left = 167 + Top = 1 + Width = 240 + Height = 22 + DataSource = dsMaster + Flat = True + TabOrder = 0 + end + object Panel4: TPanel + Left = 408 + Top = 1 + Width = 145 + Height = 22 + BevelOuter = bvNone + TabOrder = 1 + object cbLocalMasterDetail: TCheckBox + Left = 10 + Top = 3 + Width = 135 + Height = 17 + Caption = 'Use LocaMasterDetail' + TabOrder = 0 + OnClick = cbLocalMasterDetailClick + end + end + end + end + object ToolBar1: TPanel + Left = 0 + Top = 145 + Width = 443 + Height = 26 + Align = alTop + BevelOuter = bvNone + TabOrder = 2 + object Panel1: TPanel + Left = 1 + Top = 1 + Width = 650 + Height = 24 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object DBNavigator1: TDBNavigator + Left = 1 + Top = 1 + Width = 240 + Height = 22 + DataSource = dsDetail + Flat = True + TabOrder = 0 + end + object Panel6: TPanel + Left = 532 + Top = 1 + Width = 117 + Height = 22 + BevelOuter = bvNone + TabOrder = 1 + object cbCacheCalcFields: TCheckBox + Left = 5 + Top = 3 + Width = 108 + Height = 17 + Caption = 'CacheCalcFields' + Enabled = False + TabOrder = 0 + OnClick = cbCacheCalcFieldsClick + end + end + object Panel3: TPanel + Left = 242 + Top = 1 + Width = 289 + Height = 22 + BevelOuter = bvNone + TabOrder = 2 + object rbSQL: TRadioButton + Left = 5 + Top = 4 + Width = 63 + Height = 17 + Caption = 'SQL link' + Checked = True + TabOrder = 0 + TabStop = True + OnClick = rbClick + end + object rbSimpleFields: TRadioButton + Left = 75 + Top = 4 + Width = 97 + Height = 17 + Caption = 'Simple field link' + TabOrder = 1 + OnClick = rbClick + end + object rbCalcFields: TRadioButton + Left = 175 + Top = 4 + Width = 113 + Height = 17 + Caption = 'Calculated field link' + TabOrder = 2 + OnClick = rbClick + end + end + end + end + object DBGrid1: TDBGrid + Left = 0 + Top = 171 + Width = 443 + Height = 106 + Align = alClient + DataSource = dsDetail + TabOrder = 3 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object quMaster: TMSQuery + Connection = SDACForm.MSConnection + SQL.Strings = ( + 'SELECT * FROM dept') + OnCalcFields = quCalcFields + Left = 376 + Top = 32 + object quMasterDEPTNO: TIntegerField + FieldName = 'DEPTNO' + end + object quMasterDNAME: TStringField + FieldName = 'DNAME' + Size = 14 + end + object quMasterLOC: TStringField + FieldName = 'LOC' + Size = 13 + end + object quMasterDEPTNO_CALCULATED: TIntegerField + FieldKind = fkCalculated + FieldName = 'DEPTNO_CALCULATED' + Calculated = True + end + end + object quDetail: TMSQuery + Connection = SDACForm.MSConnection + SQL.Strings = ( + 'SELECT * FROM emp' + 'WHERE DeptNo = :DeptNo') + OnCalcFields = quCalcFields + MasterSource = dsMaster + Left = 376 + Top = 216 + ParamData = < + item + DataType = ftUnknown + Name = 'DeptNo' + end> + object quDetailEMPNO: TIntegerField + FieldName = 'EMPNO' + end + object quDetailENAME: TStringField + FieldName = 'ENAME' + Size = 10 + end + object quDetailJOB: TStringField + FieldName = 'JOB' + Size = 9 + end + object quDetailMGR: TIntegerField + FieldName = 'MGR' + end + object quDetailHIREDATE: TDateTimeField + FieldName = 'HIREDATE' + end + object quDetailSAL: TFloatField + FieldName = 'SAL' + end + object quDetailCOMM: TFloatField + FieldName = 'COMM' + end + object quDetailDEPTNO: TIntegerField + FieldName = 'DEPTNO' + end + object quDetailDEPTNO_CALCULATED: TIntegerField + FieldKind = fkCalculated + FieldName = 'DEPTNO_CALCULATED' + Calculated = True + end + end + object dsDetail: TDataSource + DataSet = quDetail + Left = 408 + Top = 216 + end + object dsMaster: TDataSource + DataSet = quMaster + Left = 408 + Top = 32 + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/MasterDetail/MasterDetail.pas b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/MasterDetail/MasterDetail.pas new file mode 100644 index 0000000..4e368da --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/MasterDetail/MasterDetail.pas @@ -0,0 +1,189 @@ +unit MasterDetail; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + DBCtrls, ExtCtrls, Db, Grids, DBGrids, StdCtrls, ToolWin, +{$IFNDEF VER130} { Delphi 6 or higher } + Variants, +{$ENDIF} + ComCtrls, Buttons, MemDS, DBAccess, MSAccess, SdacVcl, DemoFrame, SdacDemoForm; + +type + TMasterDetailFrame = class(TDemoFrame) + quMaster: TMSQuery; + Splitter1: TSplitter; + quDetail: TMSQuery; + dsDetail: TDataSource; + dsMaster: TDataSource; + DBGrid: TDBGrid; + ToolBar: TPanel; + Panel2: TPanel; + btOpen: TSpeedButton; + btClose: TSpeedButton; + DBNavigator: TDBNavigator; + ToolBar1: TPanel; + Panel1: TPanel; + DBNavigator1: TDBNavigator; + DBGrid1: TDBGrid; + Splitter3: TSplitter; + Panel4: TPanel; + cbLocalMasterDetail: TCheckBox; + Panel6: TPanel; + cbCacheCalcFields: TCheckBox; + Panel3: TPanel; + rbSQL: TRadioButton; + rbSimpleFields: TRadioButton; + rbCalcFields: TRadioButton; + quMasterDEPTNO: TIntegerField; + quMasterDNAME: TStringField; + quMasterLOC: TStringField; + quMasterDEPTNO_CALCULATED: TIntegerField; + quDetailEMPNO: TIntegerField; + quDetailENAME: TStringField; + quDetailJOB: TStringField; + quDetailMGR: TIntegerField; + quDetailHIREDATE: TDateTimeField; + quDetailSAL: TFloatField; + quDetailCOMM: TFloatField; + quDetailDEPTNO: TIntegerField; + quDetailDEPTNO_CALCULATED: TIntegerField; + procedure btOpenClick(Sender: TObject); + procedure btCloseClick(Sender: TObject); + procedure cbLocalMasterDetailClick(Sender: TObject); + procedure rbClick(Sender: TObject); + procedure cbCacheCalcFieldsClick(Sender: TObject); + procedure quCalcFields(DataSet: TDataSet); + private + { Private declarations } + public + // Demo management + procedure Initialize; override; + procedure SetDebug(Value: boolean); override; + end; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} + +procedure TMasterDetailFrame.btOpenClick(Sender: TObject); +begin + quMaster.Open; + quDetail.Open; +end; + +procedure TMasterDetailFrame.btCloseClick(Sender: TObject); +begin + quDetail.Close; + quMaster.Close; +end; + +procedure TMasterDetailFrame.cbLocalMasterDetailClick(Sender: TObject); +var + OldActive: boolean; +begin + OldActive := quDetail.Active; + quDetail.Close; + try + quDetail.Options.LocalMasterDetail := cbLocalMasterDetail.Checked; + if OldActive then + quDetail.Open; + except + cbLocalMasterDetail.Checked := quDetail.Options.LocalMasterDetail; + raise; + end; +end; + +procedure TMasterDetailFrame.rbClick(Sender: TObject); +var + OldActive: boolean; +begin + OldActive := dsMaster.DataSet.Active; + if OldActive then + btCloseClick(nil); + cbCacheCalcFields.Enabled := Sender = rbCalcFields; + + if rbSQL.Checked then begin + quDetail.SQL.Text := 'SELECT * FROM Emp WHERE DeptNo = :DeptNo'; + quDetail.DetailFields := ''; + quDetail.MasterFields := ''; + quMaster.FieldByName('DEPTNO_CALCULATED').Visible := False; + quDetail.FieldByName('DEPTNO_CALCULATED').Visible := False; + cbLocalMasterDetail.Checked := False; + cbLocalMasterDetail.Enabled := False; + cbCacheCalcFields.Enabled := False; + end + else begin + if rbSimpleFields.Checked then begin + quDetail.SQL.Text := 'SELECT * FROM Emp'; + quDetail.DetailFields := 'DEPTNO'; + quDetail.MasterFields := 'DEPTNO'; + quMaster.FieldByName('DEPTNO_CALCULATED').Visible := False; + quDetail.FieldByName('DEPTNO_CALCULATED').Visible := False; + cbLocalMasterDetail.Enabled := True; + cbCacheCalcFields.Enabled := False; + end + else begin + quDetail.SQL.Text := 'SELECT * FROM Emp'; + quDetail.DetailFields := 'DEPTNO_CALCULATED'; + quDetail.MasterFields := 'DEPTNO_CALCULATED'; + quMaster.FieldByName('DEPTNO_CALCULATED').Visible := True; + quDetail.FieldByName('DEPTNO_CALCULATED').Visible := True; + cbLocalMasterDetail.Enabled := True; + cbLocalMasterDetail.Checked := True; + cbCacheCalcFields.Enabled := True; + end; + end; + cbCacheCalcFieldsClick(nil); + if OldActive then + btOpenClick(nil); +end; + +procedure TMasterDetailFrame.cbCacheCalcFieldsClick(Sender: TObject); +var + OldActive: boolean; +begin + OldActive := dsMaster.DataSet.Active; + if OldActive then + btCloseClick(nil); + quMaster.Options.CacheCalcFields := cbCacheCalcFields.Checked and cbCacheCalcFields.Enabled; + quDetail.Options.CacheCalcFields := quMaster.Options.CacheCalcFields; + if OldActive then + btOpenClick(nil); +end; + +procedure TMasterDetailFrame.quCalcFields(DataSet: TDataSet); +var + Dst, Src: TField; +begin + Src := DataSet.FieldByName('DEPTNO'); + Dst := DataSet.FieldByName('DEPTNO_CALCULATED'); + if Src.IsNull then + Dst.Value := Null + else + Dst.AsInteger := Src.AsInteger * 2; +end; + +// Demo management +procedure TMasterDetailFrame.Initialize; +begin + inherited; + quMaster.Connection := Connection as TMSConnection; + quDetail.Connection := Connection as TMSConnection; + rbClick(nil); +end; + +procedure TMasterDetailFrame.SetDebug(Value: boolean); +begin + quMaster.Debug := Value; + quDetail.Debug := Value; +end; + +end. + diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Pictures/Pictures.dfm b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Pictures/Pictures.dfm new file mode 100644 index 0000000..7e9e9b5 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Pictures/Pictures.dfm @@ -0,0 +1,170 @@ +inherited PicturesFrame: TPicturesFrame + Width = 443 + Height = 277 + Align = alClient + object Splitter1: TSplitter + Left = 0 + Top = 119 + Width = 443 + Height = 2 + Cursor = crVSplit + Align = alTop + Color = clBtnFace + ParentColor = False + end + object ScrollBox1: TScrollBox + Left = 0 + Top = 146 + Width = 443 + Height = 131 + Align = alClient + TabOrder = 0 + object DBImage: TDBImage + Left = 0 + Top = 0 + Width = 439 + Height = 127 + Align = alClient + Center = False + Constraints.MinHeight = 50 + DataField = 'PICTURE' + DataSource = dsPictures + TabOrder = 0 + end + end + object ToolBar: TPanel + Left = 0 + Top = 0 + Width = 443 + Height = 26 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object Panel2: TPanel + Left = 0 + Top = 1 + Width = 408 + Height = 24 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btOpen: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Open' + Flat = True + Transparent = False + OnClick = btOpenClick + end + object btClose: TSpeedButton + Left = 84 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Close' + Flat = True + Transparent = False + OnClick = btCloseClick + end + object DBNavigator: TDBNavigator + Left = 167 + Top = 1 + Width = 240 + Height = 22 + DataSource = dsPictures + Flat = True + TabOrder = 0 + end + end + end + object DBGrid: TDBGrid + Left = 0 + Top = 26 + Width = 443 + Height = 93 + Align = alTop + Constraints.MinHeight = 50 + DataSource = dsPictures + Options = [dgEditing, dgTitles, dgIndicator, dgColumnResize, dgColLines, dgRowLines, dgConfirmDelete] + TabOrder = 2 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object ToolBar1: TPanel + Left = 0 + Top = 121 + Width = 443 + Height = 25 + Align = alTop + BevelOuter = bvNone + TabOrder = 3 + object Panel1: TPanel + Left = 2 + Top = 0 + Width = 259 + Height = 24 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btLoad: TSpeedButton + Left = 1 + Top = 1 + Width = 85 + Height = 22 + Caption = 'Load from file ...' + Flat = True + Transparent = False + OnClick = btLoadClick + end + object btSave: TSpeedButton + Left = 87 + Top = 1 + Width = 85 + Height = 22 + Caption = 'Save to file ...' + Flat = True + Transparent = False + OnClick = btSaveClick + end + object btClear: TSpeedButton + Left = 173 + Top = 1 + Width = 85 + Height = 22 + Caption = 'Clear' + Flat = True + Transparent = False + OnClick = btClearClick + end + end + end + object OpenPictureDialog: TOpenPictureDialog + Filter = 'Bitmaps (*.bmp)|*.bmp' + Left = 288 + Top = 115 + end + object SavePictureDialog: TSavePictureDialog + Filter = 'Bitmaps (*.bmp)|*.bmp' + Left = 320 + Top = 116 + end + object dsPictures: TDataSource + DataSet = quPictures + Left = 376 + Top = 16 + end + object quPictures: TMSQuery + Connection = SDACForm.MSConnection + SQL.Strings = ( + 'SELECT * FROM SDAC_Pictures') + Debug = True + FetchRows = 1 + Left = 344 + Top = 16 + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Pictures/Pictures.pas b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Pictures/Pictures.pas new file mode 100644 index 0000000..935e884 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Pictures/Pictures.pas @@ -0,0 +1,107 @@ +unit Pictures; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + DBCtrls, ExtCtrls, Db, Grids, DBGrids, StdCtrls, ToolWin, + ComCtrls, ExtDlgs, Buttons, MemDS, DBAccess, MSAccess, + DemoFrame, SdacDemoForm; + +type + TPicturesFrame = class(TDemoFrame) + OpenPictureDialog: TOpenPictureDialog; + ScrollBox1: TScrollBox; + SavePictureDialog: TSavePictureDialog; + ToolBar: TPanel; + Panel2: TPanel; + btOpen: TSpeedButton; + btClose: TSpeedButton; + DBNavigator: TDBNavigator; + DBGrid: TDBGrid; + ToolBar1: TPanel; + Panel1: TPanel; + btLoad: TSpeedButton; + btSave: TSpeedButton; + btClear: TSpeedButton; + Splitter1: TSplitter; + dsPictures: TDataSource; + quPictures: TMSQuery; + DBImage: TDBImage; + procedure btOpenClick(Sender: TObject); + procedure btCloseClick(Sender: TObject); + procedure btLoadClick(Sender: TObject); + procedure btSaveClick(Sender: TObject); + procedure btClearClick(Sender: TObject); + private + { Private declarations } + public + // Demo management + procedure Initialize; override; + procedure SetDebug(Value: boolean); override; + end; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} + +procedure TPicturesFrame.btOpenClick(Sender: TObject); +begin + quPictures.Open; +end; + +procedure TPicturesFrame.btCloseClick(Sender: TObject); +begin + quPictures.Close; +end; + +procedure TPicturesFrame.btLoadClick(Sender: TObject); +var + BlobField: TBlobField; + FileName: string; +begin + if OpenPictureDialog.Execute then begin + if quPictures.State in [dsBrowse] then + quPictures.Edit; + BlobField := quPictures.FieldByName('Picture') as TBlobField; + FileName := OpenPictureDialog.FileName; + BlobField.LoadFromFile(FileName); + end; +end; + +procedure TPicturesFrame.btSaveClick(Sender: TObject); +begin + if SavePictureDialog.Execute then begin + TBlobField(quPictures.FieldByName('Picture')). + SaveToFile(SavePictureDialog.FileName); + end; +end; + +procedure TPicturesFrame.btClearClick(Sender: TObject); +begin + if quPictures.State in [dsBrowse] then + quPictures.Edit; + TBlobField(quPictures.FieldByName('Picture')).Clear; +end; + +// Demo management +procedure TPicturesFrame.Initialize; +begin + inherited; + quPictures.Connection := Connection as TMSConnection; +end; + +procedure TPicturesFrame.SetDebug(Value: boolean); +begin + quPictures.Debug := Value; +end; + +end. + + + diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Pictures/Sandstone.bmp b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Pictures/Sandstone.bmp new file mode 100644 index 0000000..5a114e5 Binary files /dev/null and b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Pictures/Sandstone.bmp differ diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Pictures/World.bmp b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Pictures/World.bmp new file mode 100644 index 0000000..3171d54 Binary files /dev/null and b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Pictures/World.bmp differ diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Query/Query.dfm b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Query/Query.dfm new file mode 100644 index 0000000..48f1bde --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Query/Query.dfm @@ -0,0 +1,310 @@ +inherited QueryFrame: TQueryFrame + Width = 443 + Height = 277 + Align = alClient + object Splitter1: TSplitter + Left = 0 + Top = 160 + Width = 443 + Height = 1 + Cursor = crVSplit + Align = alTop + Color = clGreen + ParentColor = False + end + object DBGrid: TDBGrid + Left = 0 + Top = 187 + Width = 443 + Height = 90 + Align = alClient + Constraints.MinWidth = 50 + DataSource = DataSource + TabOrder = 0 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object TPanel + Left = 0 + Top = 161 + Width = 443 + Height = 26 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object Panel9: TPanel + Left = 1 + Top = 1 + Width = 398 + Height = 24 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btRefreshRecord: TSpeedButton + Left = 232 + Top = 1 + Width = 82 + Height = 22 + Caption = 'RefreshRecord' + Flat = True + Transparent = False + OnClick = btRefreshRecordClick + end + object btSaveToXML: TSpeedButton + Left = 315 + Top = 1 + Width = 82 + Height = 22 + Caption = 'SaveToXML' + Flat = True + Transparent = False + OnClick = btSaveToXMLClick + end + object DBNavigator: TDBNavigator + Left = 1 + Top = 1 + Width = 230 + Height = 22 + DataSource = DataSource + Flat = True + TabOrder = 0 + end + end + end + object ToolBar: TPanel + Left = 0 + Top = 0 + Width = 443 + Height = 80 + Align = alTop + BevelOuter = bvNone + TabOrder = 2 + object Panel1: TPanel + Left = -8 + Top = 0 + Width = 563 + Height = 78 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btClose: TSpeedButton + Left = 92 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Close' + Flat = True + Transparent = False + OnClick = btCloseClick + end + object btOpen: TSpeedButton + Left = 9 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Open' + Flat = True + Transparent = False + OnClick = btOpenClick + end + object btPrepare: TSpeedButton + Left = 175 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Prepare' + Flat = True + Transparent = False + OnClick = btPrepareClick + end + object btUnPrepare: TSpeedButton + Left = 258 + Top = 1 + Width = 82 + Height = 22 + Caption = 'UnPrepare' + Flat = True + Transparent = False + OnClick = btUnPrepareClick + end + object btExecute: TSpeedButton + Left = 341 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Execute' + Flat = True + Transparent = False + OnClick = btExecuteClick + end + object Panel2: TPanel + Left = 424 + Top = 25 + Width = 138 + Height = 52 + BevelOuter = bvNone + TabOrder = 0 + object cbRefreshBeforeEdit: TCheckBox + Left = 11 + Top = 1 + Width = 121 + Height = 17 + Caption = 'Refresh BeforeEdit' + TabOrder = 0 + OnClick = cbRefreshBeforeEditClick + end + object cbRefreshAfterInsert: TCheckBox + Left = 11 + Top = 18 + Width = 121 + Height = 17 + Caption = 'Refresh AfterInsert' + TabOrder = 1 + OnClick = cbRefreshAfterInsertClick + end + object cbRefreshAfterUpdate: TCheckBox + Left = 11 + Top = 35 + Width = 121 + Height = 17 + Caption = 'Refresh AfterUpdate' + TabOrder = 2 + OnClick = cbRefreshAfterUpdateClick + end + end + object Panel5: TPanel + Left = 258 + Top = 24 + Width = 165 + Height = 26 + BevelOuter = bvNone + TabOrder = 1 + object StaticText1: TLabel + Left = 6 + Top = 7 + Width = 54 + Height = 13 + Caption = 'FetchRows' + end + object edFetchRows: TEdit + Left = 67 + Top = 2 + Width = 91 + Height = 21 + TabOrder = 0 + OnExit = edFetchRowsExit + end + end + object Panel6: TPanel + Left = 9 + Top = 51 + Width = 414 + Height = 26 + BevelOuter = bvNone + TabOrder = 2 + object Label5: TLabel + Left = 7 + Top = 8 + Width = 22 + Height = 13 + Caption = 'Filter' + end + object edFilter: TEdit + Left = 37 + Top = 3 + Width = 260 + Height = 21 + TabOrder = 0 + OnExit = edFetchRowsExit + end + object cbFiltered: TCheckBox + Left = 328 + Top = 5 + Width = 58 + Height = 17 + Caption = 'Filtered' + TabOrder = 1 + OnClick = cbFilteredClick + end + end + object Panel7: TPanel + Left = 9 + Top = 24 + Width = 248 + Height = 26 + BevelOuter = bvNone + TabOrder = 3 + object Label2: TLabel + Left = 5 + Top = 7 + Width = 73 + Height = 13 + Caption = 'Updating Table' + end + object edUpdatingTable: TEdit + Left = 93 + Top = 3 + Width = 148 + Height = 21 + TabOrder = 0 + OnExit = edFetchRowsExit + end + end + object Panel3: TPanel + Left = 424 + Top = 1 + Width = 138 + Height = 23 + BevelOuter = bvNone + TabOrder = 4 + object cbNonBlocking: TCheckBox + Left = 11 + Top = 4 + Width = 90 + Height = 16 + Caption = 'NonBlocking' + TabOrder = 0 + OnClick = cbNonBlockingClick + end + end + end + end + object Memo: TMemo + Left = 0 + Top = 80 + Width = 443 + Height = 80 + Align = alTop + ScrollBars = ssVertical + TabOrder = 3 + OnExit = edFetchRowsExit + end + object DataSource: TDataSource + DataSet = MSQuery + OnStateChange = DataSourceStateChange + OnDataChange = DataSourceDataChange + Left = 108 + Top = 105 + end + object MSQuery: TMSQuery + Connection = SDACForm.MSConnection + SQL.Strings = ( + 'SELECT dept.DeptNo, dept.DNAME, emp.EmpNo, emp.ENAME, emp.JOB ' + 'FROM dept, emp' + 'WHERE dept.DEPTNO = emp.DEPTNO') + Debug = True + AfterOpen = MSQueryAfterOpen + Left = 76 + Top = 105 + end + object SaveDialog: TSaveDialog + DefaultExt = 'xml' + Filter = 'XML (*.xml)|*.xml' + Options = [ofOverwritePrompt, ofHideReadOnly, ofEnableSizing] + Left = 138 + Top = 103 + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Query/Query.pas b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Query/Query.pas new file mode 100644 index 0000000..9d5e10e --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Query/Query.pas @@ -0,0 +1,276 @@ +unit Query; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + DBCtrls, ExtCtrls, Db, Grids, DBGrids, StdCtrls, ToolWin, + ComCtrls, Buttons, MemDS, DBAccess, MSAccess, + SdacVcl, DemoFrame, SdacDemoForm; + +type + TQueryFrame = class(TDemoFrame) + DataSource: TDataSource; + MSQuery: TMSQuery; + DBGrid: TDBGrid; + Panel9: TPanel; + btRefreshRecord: TSpeedButton; + DBNavigator: TDBNavigator; + Splitter1: TSplitter; + ToolBar: TPanel; + Panel1: TPanel; + btClose: TSpeedButton; + btOpen: TSpeedButton; + Panel2: TPanel; + cbRefreshBeforeEdit: TCheckBox; + cbRefreshAfterInsert: TCheckBox; + cbRefreshAfterUpdate: TCheckBox; + Panel5: TPanel; + StaticText1: TLabel; + edFetchRows: TEdit; + Panel6: TPanel; + Label5: TLabel; + edFilter: TEdit; + cbFiltered: TCheckBox; + Panel7: TPanel; + edUpdatingTable: TEdit; + Label2: TLabel; + Memo: TMemo; + btPrepare: TSpeedButton; + btUnPrepare: TSpeedButton; + btExecute: TSpeedButton; + Panel3: TPanel; + cbNonBlocking: TCheckBox; + btSaveToXML: TSpeedButton; + SaveDialog: TSaveDialog; + procedure btOpenClick(Sender: TObject); + procedure btCloseClick(Sender: TObject); + procedure btRefreshRecordClick(Sender: TObject); + procedure DataSourceDataChange(Sender: TObject; Field: TField); + procedure DataSourceStateChange(Sender: TObject); + procedure cbFilteredClick(Sender: TObject); + procedure cbRefreshBeforeEditClick(Sender: TObject); + procedure cbRefreshAfterInsertClick(Sender: TObject); + procedure cbRefreshAfterUpdateClick(Sender: TObject); + procedure MSQueryAfterOpen(DataSet: TDataSet); + procedure edFetchRowsExit(Sender: TObject); + procedure btPrepareClick(Sender: TObject); + procedure btUnPrepareClick(Sender: TObject); + procedure btExecuteClick(Sender: TObject); + procedure cbNonBlockingClick(Sender: TObject); + procedure btSaveToXMLClick(Sender: TObject); + private + { Private declarations } + procedure AssignProperties; + procedure ShowState; + public + // Demo management + procedure Initialize; override; + procedure SetDebug(Value: boolean); override; + end; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} + +procedure TQueryFrame.ShowState; +var + St: string; + + procedure AddSt(S:string); + begin + if St <> '' then + St := St + ', '; + St := St + S; + end; + +begin + St := ''; + + if MSQuery.Prepared then begin + AddSt('Prepared'); + + if MSQuery.IsQuery then + AddSt('IsQuery'); + end; + + if MSQuery.Active then + AddSt('Active') + else + AddSt('Inactive'); + + if MSQuery.Executing then + AddSt('Executing'); + + if MSQuery.Fetching then + AddSt('Fetching'); + + edUpdatingTable.Text := MSQuery.UpdatingTable; + + SdacForm.StatusBar.Panels[2].Text := St; +end; + +procedure TQueryFrame.AssignProperties; +begin + try + MSQuery.FetchRows := StrToInt(edFetchRows.Text); + except + edFetchRows.SetFocus; + raise; + end; + try + MSQuery.UpdatingTable := edUpdatingTable.Text; + except + edUpdatingTable.SetFocus; + raise; + end; + + MSQuery.Filter := edFilter.Text; + if MSQuery.SQL.Text <> Memo.Lines.Text then + MSQuery.SQL.Assign(Memo.Lines); +end; + +procedure TQueryFrame.btOpenClick(Sender: TObject); +begin + try + AssignProperties; + MSQuery.Open; + finally + ShowState; + end; +end; + +procedure TQueryFrame.btCloseClick(Sender: TObject); +begin + MSQuery.Close; + ShowState; +end; + +procedure TQueryFrame.btRefreshRecordClick(Sender: TObject); +begin + MSQuery.RefreshRecord; +end; + +procedure TQueryFrame.DataSourceStateChange(Sender: TObject); +begin + SdacForm.StatusBar.Panels[1].Text := 'Record ' + IntToStr(MSQuery.RecNo) + ' of ' + IntToStr(MSQuery.RecordCount); +end; + +procedure TQueryFrame.DataSourceDataChange(Sender: TObject; Field: TField); +begin + DataSourceStateChange(nil); +end; + +procedure TQueryFrame.cbFilteredClick(Sender: TObject); +begin + try + MSQuery.Filtered := cbFiltered.Checked; + finally + cbFiltered.Checked := MSQuery.Filtered; + end; +end; + +procedure TQueryFrame.cbRefreshBeforeEditClick(Sender: TObject); +begin + if cbRefreshBeforeEdit.Checked then + MSQuery.RefreshOptions := MSQuery.RefreshOptions + [roBeforeEdit] + else + MSQuery.RefreshOptions := MSQuery.RefreshOptions - [roBeforeEdit]; +end; + +procedure TQueryFrame.cbRefreshAfterInsertClick(Sender: TObject); +begin + if cbRefreshAfterInsert.Checked then + MSQuery.RefreshOptions := MSQuery.RefreshOptions + [roAfterInsert] + else + MSQuery.RefreshOptions := MSQuery.RefreshOptions - [roAfterInsert]; +end; + +procedure TQueryFrame.cbRefreshAfterUpdateClick(Sender: TObject); +begin + if cbRefreshAfterUpdate.Checked then + MSQuery.RefreshOptions := MSQuery.RefreshOptions + [roAfterUpdate] + else + MSQuery.RefreshOptions := MSQuery.RefreshOptions - [roAfterUpdate]; +end; + +procedure TQueryFrame.MSQueryAfterOpen(DataSet: TDataSet); +begin + edUpdatingTable.Text := MSQuery.UpdatingTable; +end; + +procedure TQueryFrame.edFetchRowsExit(Sender: TObject); +begin + AssignProperties; +end; + +procedure TQueryFrame.btPrepareClick(Sender: TObject); +begin + try + AssignProperties; + MSQuery.Prepare; + finally + ShowState; + end; +end; + +procedure TQueryFrame.btUnPrepareClick(Sender: TObject); +begin + MSQuery.UnPrepare; + ShowState; +end; + +procedure TQueryFrame.btExecuteClick(Sender: TObject); +begin + try + AssignProperties; + MSQuery.Execute; + finally + ShowState; + end; +end; + +procedure TQueryFrame.cbNonBlockingClick(Sender: TObject); +begin + try + MSQuery.Options.NonBlocking := cbNonBlocking.Checked; + finally + cbNonBlocking.Checked := MSQuery.Options.NonBlocking; + end; +end; + +procedure TQueryFrame.btSaveToXMLClick(Sender: TObject); +begin + if SaveDialog.Execute then + MSQuery.SaveToXML(SaveDialog.FileName); +end; + +// Demo management +procedure TQueryFrame.Initialize; +begin + inherited; + MSQuery.Connection := Connection as TMSConnection; + edFetchRows.Text := IntToStr(MSQuery.FetchRows); + + cbRefreshBeforeEdit.Checked := roBeforeEdit in MSQuery.RefreshOptions; + cbRefreshAfterInsert.Checked := roAfterInsert in MSQuery.RefreshOptions; + cbRefreshAfterUpdate.Checked := roAfterUpdate in MSQuery.RefreshOptions; + + edFilter.Text := MSQuery.Filter; + cbFiltered.Checked := MSQuery.Filtered; + + Memo.Lines.Text := MSQuery.SQL.Text; +end; + +procedure TQueryFrame.SetDebug(Value: boolean); +begin + MSQuery.Debug := Value; +end; + +end. + diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/SdacDemo.bdsproj b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/SdacDemo.bdsproj new file mode 100644 index 0000000..9d9f7b0 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/SdacDemo.bdsproj @@ -0,0 +1,164 @@ + + + + + + + + + + + + SDACDemo.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + + + 0 + 0 + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + ..\SdacDemo\ConnectDialog + + + False + + + + + + False + + + + + + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1049 + 1251 + + + 1.0.0.0 + 1.0.0.0 + + + diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/SdacDemo.cfg b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/SdacDemo.cfg new file mode 100644 index 0000000..9a20476 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/SdacDemo.cfg @@ -0,0 +1,41 @@ +-$A8 +-$B- +-$C+ +-$D+ +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J- +-$K- +-$L+ +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$YD +-$Z1 +-cg +-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-H+ +-W+ +-M +-$M16384,1048576 +-K$00400000 +-E"." +-N"." +-LE"." +-LN"." +-U"..\ConnectDialog\" +-O"..\ConnectDialog\" +-I"..\ConnectDialog\" +-R"..\ConnectDialog\" \ No newline at end of file diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/SdacDemo.dof b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/SdacDemo.dof new file mode 100644 index 0000000..fd37af0 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/SdacDemo.dof @@ -0,0 +1,2 @@ +[Directories] +SearchPath=..\SdacDemo\ConnectDialog \ No newline at end of file diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/SdacDemo.dpr b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/SdacDemo.dpr new file mode 100644 index 0000000..32f6749 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/SdacDemo.dpr @@ -0,0 +1,51 @@ +program SdacDemo; + +{$I Base\DacDemo.inc} + +uses + Forms, + CategoryFrame in 'Base\CategoryFrame.pas' {CategoryFrame}, + DemoBase in 'Base\DemoBase.pas', + DemoForm in 'Base\DemoForm.pas' {DemoForm}, + DemoFrame in 'Base\DemoFrame.pas' {DemoFrame}, + HtmlConsts in 'Base\HtmlConsts.pas', + VTable in 'VirtualTable\VTable.pas', + SdacAbout in 'Base\SdacAbout.pas' {SdacAboutForm}, + CachedUpdates in 'CachedUpdates\CachedUpdates.pas' {CachedUpdates}, + UpdateAction in 'CachedUpdates\UpdateAction.pas' {UpdateAction}, + ConnectDialog in 'ConnectDialog\ConnectDialog.pas' {ConnectDialog}, +{$IFDEF CRDBGRID} + CRDBGrid in 'CRDBGrid\CRDBGrid.pas' {CRDBGrid}, +{$ENDIF} + FetchAll in 'FetchAll\FetchAll.pas' {FetchAll}, + LongStrings in 'LongStrings\LongStrings.pas' {LongStringsFrame}, + MasterDetail in 'MasterDetail\MasterDetail.pas' {MasterDetail}, + Pictures in 'Pictures\Pictures.pas' {Pictures}, + ServerCursors in 'ServerCursors\ServerCursors.pas' {ServerCursors}, + Sql in 'Sql\Sql.pas' {SqlFrame}, + StoredProc in 'StoredProc\StoredProc.pas' {StoredProcFrame}, + StoredProcUpdates in 'StoredProcUpdates\StoredProcUpdates.pas' {StoredProcUpdatesFrame}, + Table in 'Table\Table.pas' {TableFrame}, + Text in 'Text\Text.pas' {TextFrame}, + Threads in 'Threads\Threads.pas' {ThreadsFrame}, + ThreadsData in 'Threads\ThreadsData.pas' {ThreadsData: TDataModule}, + UpdateSQL in 'UpdateSQL\UpdateSQL.pas' {UpdateSQLFrame}, + SdacDemoForm in 'Base\SdacDemoForm.pas' {SdacForm}, + Query in 'Query\Query.pas' {QueryFrame: TFrame}, + FilterAndIndex in 'FilterAndIndex\FilterAndIndex.pas', +{$IFNDEF STD} + Loader in 'Loader\Loader.pas', + Fetch in 'Loader\Fetch.pas' {FetchForm}, + ServiceBroker in 'ServiceBroker\ServiceBroker.pas' {ServiceBrokerFrame: TFrame}, +{$ENDIF} + InheritedConnectForm in 'ConnectDialog\InheritedConnectForm.pas' {fmInheritedConnect}, + MyConnectForm in 'ConnectDialog\MyConnectForm.pas' {fmMyConnect}; + +{$R *.res} + +begin + Application.Initialize; + Application.CreateForm(TSdacForm, SdacForm); + Application.CreateForm(TSdacAboutForm, SdacAboutForm); + Application.Run; +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/SdacDemo.res b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/SdacDemo.res new file mode 100644 index 0000000..3adc036 Binary files /dev/null and b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/SdacDemo.res differ diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/ServerCursors/ServerCursors.dfm b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/ServerCursors/ServerCursors.dfm new file mode 100644 index 0000000..62dc117 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/ServerCursors/ServerCursors.dfm @@ -0,0 +1,230 @@ +inherited ServerCursorsFrame: TServerCursorsFrame + Width = 441 + Height = 275 + Align = alClient + object Splitter1: TSplitter + Left = 0 + Top = 170 + Width = 441 + Height = 2 + Cursor = crVSplit + Align = alTop + Color = clGreen + ParentColor = False + end + object DBGrid: TDBGrid + Left = 0 + Top = 172 + Width = 441 + Height = 103 + Align = alClient + DataSource = DataSource + TabOrder = 0 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object ToolBar: TPanel + Left = 0 + Top = 0 + Width = 441 + Height = 90 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object Panel1: TPanel + Left = 1 + Top = 1 + Width = 570 + Height = 24 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btOpen: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Open and Last' + Flat = True + Transparent = False + OnClick = btOpenClick + end + object btClose: TSpeedButton + Left = 84 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Close' + Flat = True + Transparent = False + OnClick = btCloseClick + end + object btFillTables: TSpeedButton + Left = 398 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Fill Tables' + Flat = True + Transparent = False + OnClick = btFillTablesClick + end + object DBNavigator: TDBNavigator + Left = 167 + Top = 1 + Width = 230 + Height = 22 + DataSource = DataSource + Flat = True + TabOrder = 0 + end + object Panel3: TPanel + Left = 481 + Top = 1 + Width = 88 + Height = 22 + BevelOuter = bvNone + TabOrder = 1 + object edVal: TEdit + Left = 8 + Top = 2 + Width = 73 + Height = 21 + TabOrder = 0 + Text = '1000' + end + end + end + object Panel2: TPanel + Left = 1 + Top = 24 + Width = 570 + Height = 65 + BevelOuter = bvNone + Color = clGreen + TabOrder = 1 + object Panel4: TPanel + Left = 1 + Top = 1 + Width = 568 + Height = 63 + BevelOuter = bvNone + TabOrder = 0 + object Label1: TLabel + Left = 355 + Top = 5 + Width = 91 + Height = 13 + Caption = 'Open = 0; Last = 0;' + end + object Label2: TLabel + Left = 355 + Top = 23 + Width = 91 + Height = 13 + Caption = 'Open = 0; Last = 0;' + end + object Label3: TLabel + Left = 355 + Top = 41 + Width = 91 + Height = 13 + Caption = 'Open = 0; Last = 0;' + end + object rbCientCursor1: TRadioButton + Left = 10 + Top = 5 + Width = 330 + Height = 16 + Caption = 'Client cursor (CursorType = ctDefaultResultSet, FetchAll = True)' + TabOrder = 0 + OnClick = rbCientCursor2Click + end + object rbCientCursor2: TRadioButton + Left = 10 + Top = 23 + Width = 330 + Height = 17 + Caption = + 'Client cursor (CursorType = ctDefaultResultSet, FetchAll = False' + + ')' + TabOrder = 1 + OnClick = rbCientCursor2Click + end + object rbServerCursor: TRadioButton + Left = 10 + Top = 41 + Width = 330 + Height = 17 + Caption = 'Server cursor (CursorType = ctKeySet)' + TabOrder = 2 + OnClick = rbCientCursor2Click + end + end + end + end + object Memo: TMemo + Left = 0 + Top = 90 + Width = 441 + Height = 80 + Align = alTop + ScrollBars = ssVertical + TabOrder = 2 + end + object DataSource: TDataSource + DataSet = MSQuery + Left = 278 + Top = 60 + end + object MSQuery: TMSQuery + Connection = SDACForm.MSConnection + SQL.Strings = ( + 'select TOP 100000 * from loaded1, loaded2') + ReadOnly = True + Left = 246 + Top = 60 + end + object MSSQLFillTables: TMSSQL + Connection = SDACForm.MSConnection + SQL.Strings = ( + 'declare' + ' @i INTEGER;' + 'begin' + ' SET @i = 0' + ' WHILE @i <= :Cnt' + ' BEGIN' + ' SET @i = @i + 1' + ' INSERT INTO Loaded1 (' + ' Field1,' + ' Field2,' + ' Field3)' + ' VALUES (' + ' '#39'01234567890123456789'#39',' + ' '#39'12345678901234567890'#39',' + ' '#39'23456789012345678901'#39');' + ' INSERT INTO Loaded2 (' + ' Field1,' + ' Field2,' + ' Field3)' + ' VALUES (' + ' '#39'01234567890123456789'#39',' + ' '#39'12345678901234567890'#39',' + ' '#39'23456789012345678901'#39');' + ' END;' + 'end;') + CommandTimeout = 0 + Left = 453 + Top = 28 + ParamData = < + item + DataType = ftInteger + Name = 'Cnt' + ParamType = ptInput + Value = 1000 + end> + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/ServerCursors/ServerCursors.pas b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/ServerCursors/ServerCursors.pas new file mode 100644 index 0000000..befd86d --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/ServerCursors/ServerCursors.pas @@ -0,0 +1,136 @@ +unit ServerCursors; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + DBCtrls, ExtCtrls, Db, Grids, DBGrids, StdCtrls, ToolWin, + ComCtrls, Buttons, MemDS, DBAccess, MSAccess, + OLEDBAccess, SdacVcl, DemoFrame, SdacDemoForm; + +type + TServerCursorsFrame = class(TDemoFrame) + DBGrid: TDBGrid; + DataSource: TDataSource; + ToolBar: TPanel; + Memo: TMemo; + MSQuery: TMSQuery; + Splitter1: TSplitter; + Panel1: TPanel; + btOpen: TSpeedButton; + btClose: TSpeedButton; + DBNavigator: TDBNavigator; + btFillTables: TSpeedButton; + Panel3: TPanel; + edVal: TEdit; + Panel2: TPanel; + Panel4: TPanel; + rbCientCursor1: TRadioButton; + rbCientCursor2: TRadioButton; + rbServerCursor: TRadioButton; + Label1: TLabel; + Label2: TLabel; + Label3: TLabel; + MSSQLFillTables: TMSSQL; + procedure btOpenClick(Sender: TObject); + procedure btCloseClick(Sender: TObject); + procedure btFillTablesClick(Sender: TObject); + procedure rbCientCursor2Click(Sender: TObject); + private + + public + // Demo management + procedure Initialize; override; + procedure SetDebug(Value: boolean); override; + end; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} + +{$IFDEF CLR} +uses + Variants; +{$ENDIF} + +procedure TServerCursorsFrame.btOpenClick(Sender: TObject); +var + dt: TDateTime; + s: string; +begin + MSQuery.Connection.Open; + MSQuery.SQL.Assign(Memo.Lines); + + dt := Now; + MSQuery.Open; + s := 'Open = ' + TimeToStr(Now - dt) + '; '; + + dt := Now; + MSQuery.Last; + s := s + 'Last = ' + TimeToStr(Now - dt) + ';'; + if rbCientCursor1.Checked then + Label1.Caption := s + else + if rbCientCursor2.Checked then + Label2.Caption := s + else + if rbServerCursor.Checked then + Label3.Caption := s; + SdacForm.StatusBar.Update; +end; + +procedure TServerCursorsFrame.btCloseClick(Sender: TObject); +begin + MSQuery.Close; +end; + +procedure TServerCursorsFrame.btFillTablesClick(Sender: TObject); +begin + MSSQLFillTables.ParamValues['cnt'] := edVal.Text; + MSSQLFillTables.Execute; +end; + +procedure TServerCursorsFrame.rbCientCursor2Click(Sender: TObject); +begin + inherited; + MSQuery.Close; + if rbCientCursor1.Checked then begin + MSQuery.CursorType := ctDefaultResultSet; + MSQuery.FetchAll := True; + end + else + if rbCientCursor2.Checked then begin + MSQuery.CursorType := ctDefaultResultSet; + MSQuery.FetchAll := False; + end + else + MSQuery.CursorType := ctKeySet; +end; + +// Demo management +procedure TServerCursorsFrame.Initialize; +begin + inherited; + MSQuery.Connection := Connection as TMSConnection; + MSSQLFillTables.Connection := Connection as TMSConnection; + Memo.Lines.Text := MSQuery.SQL.Text; + + if MSQuery.CursorType = ctDefaultResultSet then + rbCientCursor1.Checked := True + else + rbServerCursor.Checked := True; +end; + +procedure TServerCursorsFrame.SetDebug(Value: boolean); +begin + MSQuery.Debug := Value; + MSSQLFillTables.Debug := Value; +end; + +end. + diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/ServiceBroker/ServiceBroker.dfm b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/ServiceBroker/ServiceBroker.dfm new file mode 100644 index 0000000..edd7e50 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/ServiceBroker/ServiceBroker.dfm @@ -0,0 +1,312 @@ +inherited ServiceBrokerFrame: TServiceBrokerFrame + Width = 889 + Height = 471 + Align = alClient + object Splitter1: TSplitter + Left = 380 + Top = 0 + Height = 471 + Color = clBtnFace + ParentColor = False + end + object Panel1: TPanel + Left = 0 + Top = 0 + Width = 380 + Height = 471 + Align = alLeft + Anchors = [akTop] + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object Panel3: TPanel + Left = 0 + Top = 0 + Width = 380 + Height = 136 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object Label1: TLabel + Left = 3 + Top = 6 + Width = 111 + Height = 13 + Caption = 'Initiator connection' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + end + object Panel5: TPanel + Left = 1 + Top = 23 + Width = 378 + Height = 112 + Anchors = [akLeft, akTop, akRight, akBottom] + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btInitiatorBeginDialog: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Begin dialog' + Flat = True + Transparent = False + OnClick = btInitiatorBeginDialogClick + end + object btInitiatorEndDialog: TSpeedButton + Left = 84 + Top = 1 + Width = 82 + Height = 22 + Caption = 'End dialog' + Flat = True + Transparent = False + OnClick = btInitiatorEndDialogClick + end + object btInitiatorSend: TSpeedButton + Left = 167 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Send' + Flat = True + Transparent = False + OnClick = btInitiatorSendClick + end + object btInitiatorReceive: TSpeedButton + Left = 250 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Receive' + Flat = True + Transparent = False + OnClick = btInitiatorReceiveClick + end + object Panel7: TPanel + Left = 1 + Top = 24 + Width = 376 + Height = 87 + Anchors = [akLeft, akTop, akRight, akBottom] + BevelOuter = bvNone + TabOrder = 0 + object lbInitiatorMessage: TLabel + Left = 3 + Top = 37 + Width = 43 + Height = 13 + Caption = 'Message' + end + object lbInitiatorWaitTimeout: TLabel + Left = 3 + Top = 66 + Width = 60 + Height = 13 + Caption = 'WaitTimeout' + end + object cbInitiatorAsynchNotification: TCheckBox + Left = 3 + Top = 8 + Width = 166 + Height = 17 + Caption = 'AsynchNotification' + TabOrder = 0 + OnClick = cbInitiatorAsynchNotificationClick + end + object edInitiatorMessage: TEdit + Left = 66 + Top = 33 + Width = 308 + Height = 21 + Anchors = [akLeft, akTop, akRight] + TabOrder = 1 + Text = 'Hello target connection!' + end + object edInitiatorWaitTimeout: TEdit + Left = 66 + Top = 63 + Width = 81 + Height = 21 + TabOrder = 2 + OnChange = edInitiatorWaitTimeoutChange + end + end + object Panel10: TPanel + Left = 333 + Top = 1 + Width = 44 + Height = 22 + Anchors = [akLeft, akTop, akRight] + BevelOuter = bvNone + TabOrder = 1 + end + end + end + object meInitiatorLog: TMemo + Left = 0 + Top = 136 + Width = 380 + Height = 335 + Align = alClient + ReadOnly = True + ScrollBars = ssVertical + TabOrder = 1 + end + end + object Panel2: TPanel + Left = 383 + Top = 0 + Width = 506 + Height = 471 + Align = alClient + BevelOuter = bvNone + Color = clGreen + TabOrder = 1 + object Panel4: TPanel + Left = 0 + Top = 0 + Width = 506 + Height = 136 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object Label2: TLabel + Left = 3 + Top = 6 + Width = 105 + Height = 13 + Caption = 'Target connection' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + end + object Panel6: TPanel + Left = 1 + Top = 23 + Width = 333 + Height = 112 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btTargetReceive: TSpeedButton + Left = 84 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Receive' + Flat = True + Transparent = False + OnClick = btTargetReceiveClick + end + object btTargetSend: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Send' + Flat = True + Transparent = False + OnClick = btTargetSendClick + end + object Panel8: TPanel + Left = 1 + Top = 24 + Width = 331 + Height = 87 + BevelOuter = bvNone + TabOrder = 0 + object lbTargetMessage: TLabel + Left = 3 + Top = 37 + Width = 43 + Height = 13 + Caption = 'Message' + end + object lbTargetWaitTimeout: TLabel + Left = 3 + Top = 66 + Width = 60 + Height = 13 + Caption = 'WaitTimeout' + end + object cbTargetAsynchNotification: TCheckBox + Left = 8 + Top = 7 + Width = 166 + Height = 17 + Caption = 'AsynchNotification' + TabOrder = 0 + OnClick = cbTargetAsynchNotificationClick + end + object edTargetMessage: TEdit + Left = 66 + Top = 33 + Width = 263 + Height = 21 + TabOrder = 1 + Text = 'Hello initiator connection!' + end + object edTargetWaitTimeout: TEdit + Left = 66 + Top = 63 + Width = 81 + Height = 21 + TabOrder = 2 + OnChange = edTargetWaitTimeoutChange + end + end + object Panel9: TPanel + Left = 167 + Top = 1 + Width = 165 + Height = 22 + Anchors = [akLeft, akTop, akRight, akBottom] + BevelOuter = bvNone + TabOrder = 1 + end + end + end + object meTargetLog: TMemo + Left = 0 + Top = 136 + Width = 506 + Height = 335 + Align = alClient + ReadOnly = True + ScrollBars = ssVertical + TabOrder = 1 + end + end + object InitiatorServiceBroker: TMSServiceBroker + WaitTimeout = 5000 + OnMessage = InitiatorServiceBrokerMessage + OnBeginConversation = InitiatorServiceBrokerBeginConversation + OnEndConversation = InitiatorServiceBrokerEndConversation + Left = 240 + Top = 128 + end + object MSConnection2: TMSConnection + Database = 'master' + Left = 384 + Top = 232 + end + object TargetServiceBroker: TMSServiceBroker + Connection = MSConnection2 + WaitTimeout = 5000 + OnMessage = TargetServiceBrokerMessage + OnBeginConversation = TargetServiceBrokerBeginConversation + OnEndConversation = TargetServiceBrokerEndConversation + Left = 416 + Top = 232 + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/ServiceBroker/ServiceBroker.pas b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/ServiceBroker/ServiceBroker.pas new file mode 100644 index 0000000..d682c66 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/ServiceBroker/ServiceBroker.pas @@ -0,0 +1,279 @@ +unit ServiceBroker; + +interface + +uses +{$IFDEF VER6P} + Variants, +{$ENDIF} + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, + Dialogs, DemoFrame, ExtCtrls, StdCtrls, DB, DBAccess, MSAccess, + MSServiceBroker, Buttons; + +type + TServiceBrokerFrame = class(TDemoFrame) + Panel1: TPanel; + Splitter1: TSplitter; + Panel2: TPanel; + InitiatorServiceBroker: TMSServiceBroker; + MSConnection2: TMSConnection; + TargetServiceBroker: TMSServiceBroker; + Panel3: TPanel; + Panel4: TPanel; + meInitiatorLog: TMemo; + meTargetLog: TMemo; + Label1: TLabel; + Label2: TLabel; + Panel5: TPanel; + Panel6: TPanel; + btInitiatorBeginDialog: TSpeedButton; + btInitiatorEndDialog: TSpeedButton; + btInitiatorSend: TSpeedButton; + btInitiatorReceive: TSpeedButton; + Panel7: TPanel; + cbInitiatorAsynchNotification: TCheckBox; + lbInitiatorMessage: TLabel; + edInitiatorMessage: TEdit; + edInitiatorWaitTimeout: TEdit; + lbInitiatorWaitTimeout: TLabel; + btTargetReceive: TSpeedButton; + btTargetSend: TSpeedButton; + Panel8: TPanel; + cbTargetAsynchNotification: TCheckBox; + lbTargetMessage: TLabel; + edTargetMessage: TEdit; + lbTargetWaitTimeout: TLabel; + edTargetWaitTimeout: TEdit; + Panel9: TPanel; + Panel10: TPanel; + procedure btInitiatorBeginDialogClick(Sender: TObject); + procedure btInitiatorEndDialogClick(Sender: TObject); + procedure btInitiatorSendClick(Sender: TObject); + procedure btInitiatorReceiveClick(Sender: TObject); + procedure cbInitiatorAsynchNotificationClick(Sender: TObject); + procedure edInitiatorWaitTimeoutChange(Sender: TObject); + procedure btTargetSendClick(Sender: TObject); + procedure btTargetReceiveClick(Sender: TObject); + procedure cbTargetAsynchNotificationClick(Sender: TObject); + procedure edTargetWaitTimeoutChange(Sender: TObject); + procedure InitiatorServiceBrokerBeginConversation(Sender: TObject; + Conversation: TMSConversation); + procedure InitiatorServiceBrokerEndConversation(Sender: TObject; + Conversation: TMSConversation; ErrorMessage: String; + ErrorCode: Integer); + procedure InitiatorServiceBrokerMessage(Sender: TObject); + procedure TargetServiceBrokerBeginConversation(Sender: TObject; + Conversation: TMSConversation); + procedure TargetServiceBrokerEndConversation(Sender: TObject; + Conversation: TMSConversation; ErrorMessage: String; + ErrorCode: Integer); + procedure TargetServiceBrokerMessage(Sender: TObject); + private + FMSConversation: TMSConversation; + public + // Demo management + procedure AssignTargetConnection; + procedure Initialize; override; + end; + +var + ServiceBrokerFrame: TServiceBrokerFrame; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} + +const + InitiatorServiceName = 'InitiatorService'; + TargetServiceName = 'TargetService'; + +{ TServiceBrokerFrame } + +procedure TServiceBrokerFrame.AssignTargetConnection; +begin + if Connection.Connected and MSConnection2.Connected then + Exit; + + if not Connection.Connected then + Connection.Connect; + + MSConnection2.Disconnect; + MSConnection2.Assign(Connection); + MSConnection2.LoginPrompt := False; + MSConnection2.Connect; + + InitiatorServiceBroker.CreateServerObjects; + + TargetServiceBroker.CreateServerObjects; +end; + +procedure TServiceBrokerFrame.Initialize; +begin + inherited; + + InitiatorServiceBroker.Connection := Connection as TMSConnection; + + InitiatorServiceBroker.Service := InitiatorServiceName; + TargetServiceBroker.Service := TargetServiceName; + + cbInitiatorAsynchNotification.Checked := InitiatorServiceBroker.AsyncNotification; + cbTargetAsynchNotification.Checked := TargetServiceBroker.AsyncNotification; + + edInitiatorWaitTimeout.Text := IntToStr(InitiatorServiceBroker.WaitTimeout); + edTargetWaitTimeout.Text := IntToStr(TargetServiceBroker.WaitTimeout); + + btInitiatorEndDialog.Enabled := False; +end; + +procedure TServiceBrokerFrame.btInitiatorBeginDialogClick(Sender: TObject); +begin + AssignTargetConnection; + + FMSConversation := InitiatorServiceBroker.BeginDialog(TargetServiceName, '', False); + + // Demo managment + btInitiatorEndDialog.Enabled := True; + btInitiatorBeginDialog.Enabled := False; +end; + +procedure TServiceBrokerFrame.btInitiatorEndDialogClick(Sender: TObject); +begin + FMSConversation.EndConversation; + FMSConversation := nil; + + // Demo managment + btInitiatorEndDialog.Enabled := False; + btInitiatorBeginDialog.Enabled := True; +end; + +procedure TServiceBrokerFrame.btInitiatorSendClick(Sender: TObject); +var + TransmitionStatus: string; +begin + AssignTargetConnection; + if FMSConversation <> nil then begin + FMSConversation.Send(edInitiatorMessage.Text); + TransmitionStatus := FMSConversation.GetTransmissionStatus; + if TransmitionStatus <> '' then + meInitiatorLog.Lines.Add(TransmitionStatus) + else + meInitiatorLog.Lines.Add('Message was send successfully'); + end + else + raise Exception.Create('No active dialog'); +end; + +procedure TServiceBrokerFrame.btInitiatorReceiveClick(Sender: TObject); +begin + AssignTargetConnection; + if InitiatorServiceBroker.Receive then + meInitiatorLog.Lines.Add(InitiatorServiceBroker.CurrentMessage.AsString); +end; + +procedure TServiceBrokerFrame.cbInitiatorAsynchNotificationClick(Sender: TObject); +begin + AssignTargetConnection; + InitiatorServiceBroker.AsyncNotification := cbInitiatorAsynchNotification.Checked; +end; + +procedure TServiceBrokerFrame.edInitiatorWaitTimeoutChange(Sender: TObject); +var + WaitTimeout: integer; +begin + try + WaitTimeout := StrToInt(edInitiatorWaitTimeout.Text); + except + Exit; + end; + InitiatorServiceBroker.WaitTimeout := WaitTimeout; +end; + +procedure TServiceBrokerFrame.InitiatorServiceBrokerBeginConversation( + Sender: TObject; Conversation: TMSConversation); +begin + meInitiatorLog.Lines.Add('Conversation started'); +end; + +procedure TServiceBrokerFrame.InitiatorServiceBrokerEndConversation( + Sender: TObject; Conversation: TMSConversation; ErrorMessage: String; + ErrorCode: Integer); +begin + meInitiatorLog.Lines.Add('Conversation finished'); +end; + +procedure TServiceBrokerFrame.InitiatorServiceBrokerMessage(Sender: TObject); +begin + if InitiatorServiceBroker.Receive then + meInitiatorLog.Lines.Add(InitiatorServiceBroker.CurrentMessage.AsString); +end; + +procedure TServiceBrokerFrame.btTargetSendClick(Sender: TObject); +var + TransmitionStatus: string; + Conversation: TMSConversation; +begin + AssignTargetConnection; + if TargetServiceBroker.ConversationCount > 0 then begin + Conversation := TargetServiceBroker.Conversations[0]; + Conversation.Send(edTargetMessage.Text); + TransmitionStatus := Conversation.GetTransmissionStatus; + if TransmitionStatus <> '' then + meTargetLog.Lines.Add(TransmitionStatus) + else + meTargetLog.Lines.Add('Message was send successfully'); + end + else + raise Exception.Create('No active dialog'); +end; + +procedure TServiceBrokerFrame.btTargetReceiveClick(Sender: TObject); +begin + AssignTargetConnection; + if TargetServiceBroker.Receive then + meTargetLog.Lines.Add(TargetServiceBroker.CurrentMessage.AsString); +end; + +procedure TServiceBrokerFrame.cbTargetAsynchNotificationClick(Sender: TObject); +begin + AssignTargetConnection; + TargetServiceBroker.AsyncNotification := cbTargetAsynchNotification.Checked; +end; + +procedure TServiceBrokerFrame.edTargetWaitTimeoutChange(Sender: TObject); +var + WaitTimeout: integer; +begin + try + WaitTimeout := StrToInt(edTargetWaitTimeout.Text); + except + Exit; + end; + TargetServiceBroker.WaitTimeout := WaitTimeout; +end; + +procedure TServiceBrokerFrame.TargetServiceBrokerBeginConversation( + Sender: TObject; Conversation: TMSConversation); +begin + meTargetLog.Lines.Add('Conversation started'); +end; + +procedure TServiceBrokerFrame.TargetServiceBrokerEndConversation( + Sender: TObject; Conversation: TMSConversation; ErrorMessage: String; + ErrorCode: Integer); +begin + meTargetLog.Lines.Add('Conversation finished'); +end; + +procedure TServiceBrokerFrame.TargetServiceBrokerMessage(Sender: TObject); +begin + if TargetServiceBroker.Receive then + if TargetServiceBroker.CurrentMessage.MessageType <> SEndDialogType then + meTargetLog.Lines.Add(TargetServiceBroker.CurrentMessage.AsString); +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Sql/Sql.dfm b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Sql/Sql.dfm new file mode 100644 index 0000000..7a22794 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Sql/Sql.dfm @@ -0,0 +1,139 @@ +inherited SqlFrame: TSqlFrame + Width = 443 + Height = 277 + Align = alClient + object Label1: TLabel + Left = 456 + Top = 48 + Width = 32 + Height = 13 + Caption = 'Label1' + end + object Splitter1: TSplitter + Left = 0 + Top = 188 + Width = 488 + Height = 3 + Cursor = crVSplit + Align = alTop + end + object ToolBar: TPanel + Left = 0 + Top = 0 + Width = 488 + Height = 26 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object TPanel + Left = 1 + Top = 1 + Width = 350 + Height = 24 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btExecute: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Execute' + Flat = True + Transparent = False + OnClick = btExecuteClick + end + object btBreakExec: TSpeedButton + Left = 167 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Break' + Enabled = False + Flat = True + Transparent = False + OnClick = btBreakExecClick + end + object btExecInThread: TSpeedButton + Left = 84 + Top = 1 + Width = 82 + Height = 22 + Hint = + 'Assing a long-drawn command to memo (e.g. `SELECT SLEEP(10);`) a' + + 'nd push this button.' + Caption = 'Exec in thread' + Flat = True + ParentShowHint = False + ShowHint = True + Transparent = False + OnClick = btExecInThreadClick + end + object Panel1: TPanel + Left = 250 + Top = 1 + Width = 99 + Height = 22 + BevelOuter = bvNone + TabOrder = 0 + object cbNonBlocking: TCheckBox + Left = 7 + Top = 3 + Width = 86 + Height = 17 + Caption = 'NonBlocking' + TabOrder = 0 + OnClick = cbNonBlockingClick + end + end + end + end + object meSQL: TMemo + Left = 0 + Top = 26 + Width = 488 + Height = 162 + Align = alTop + Font.Charset = ANSI_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Courier New' + Font.Style = [] + ParentFont = False + TabOrder = 1 + OnExit = meSQLExit + end + object meResult: TMemo + Left = 0 + Top = 191 + Width = 488 + Height = 70 + TabStop = False + Align = alClient + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Courier New' + Font.Pitch = fpVariable + Font.Style = [] + ParentFont = False + ReadOnly = True + TabOrder = 2 + end + object MSSQL: TMSSQL + Connection = SDACForm.MSConnection + SQL.Strings = ( + 'SET :Cnt = (SELECT COUNT(*) FROM Emp)') + AfterExecute = MSSQLAfterExecute + CommandTimeout = 0 + Left = 224 + Top = 40 + ParamData = < + item + DataType = ftInteger + Name = 'Cnt' + ParamType = ptInputOutput + Value = 830 + end> + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Sql/Sql.pas b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Sql/Sql.pas new file mode 100644 index 0000000..0727b29 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Sql/Sql.pas @@ -0,0 +1,216 @@ +unit Sql; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + DBCtrls, ExtCtrls, Db, Grids, DBGrids, StdCtrls, ToolWin, + ComCtrls, MSAccess, DBAccess, SdacVcl, Buttons, + DemoFrame, SdacDemoForm, OLEDBAccess, ActiveX; + +type + TSqlFrame = class(TDemoFrame) + ToolBar: TPanel; + meSQL: TMemo; + MSSQL: TMSSQL; + Label1: TLabel; + Splitter1: TSplitter; + meResult: TMemo; + btExecute: TSpeedButton; + btBreakExec: TSpeedButton; + Panel1: TPanel; + cbNonBlocking: TCheckBox; + btExecInThread: TSpeedButton; + procedure btExecuteClick(Sender: TObject); + procedure meSQLExit(Sender: TObject); + procedure MSSQLAfterExecute(Sender: TObject; Result: Boolean); + procedure cbNonBlockingClick(Sender: TObject); + procedure btBreakExecClick(Sender: TObject); + procedure btExecInThreadClick(Sender: TObject); + private + { Private declarations } + OldProvider: TOLEDBProvider; + DoNotRemind: boolean; + FExecThread: TThread; + procedure AssignProperties; + procedure TerminateThread; + public + destructor Destroy; override; + // Demo management + procedure Initialize; override; + procedure SetDebug(Value: boolean); override; + end; + + { TExecThread } + + TExecThread = class(TThread) + protected + procedure Execute; override; + procedure Terminate; + end; + +var + SqlFrame: TSqlFrame; + +implementation + +uses ComObj; + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} + +procedure LogError(EMessage: string); +begin + SqlFrame.meResult.Lines.Add('An error with the following message has beein raised during query execution:' + #13#10 + EMessage); +end; + +{ TExecThread } + +procedure TExecThread.Execute; +begin + CoInitialize(nil); + if SqlFrame.MSSQL <> nil then + try + SqlFrame.btBreakExec.Enabled := True; + SqlFrame.MSSQL.Execute; + except + on e: Exception do begin + LogError(e.Message); + end; + end; + Terminate; +end; + +procedure TExecThread.Terminate; +begin + inherited; + SqlFrame.btBreakExec.Enabled := False; + CoUninitialize; +end; + +{ TSqlFrame } + +procedure TSqlFrame.AssignProperties; +begin + if Trim(MSSQL.SQL.Text) <> Trim(meSQL.Lines.Text) then + MSSQL.SQL.Assign(meSQL.Lines); + MSSQL.NonBlocking := cbNonBlocking.Checked; + if MSSQL.NonBlocking then + btBreakExec.Enabled := False; +end; + +procedure TSqlFrame.TerminateThread; +begin + if FExecThread <> nil then begin + FExecThread.Terminate; + MSSQL.BreakExec; + FExecThread.WaitFor; + FExecThread.Free; + FExecThread := nil; + end; +end; + +procedure TSqlFrame.btExecuteClick(Sender: TObject); +begin + AssignProperties; + meResult.Lines.Clear; + SdacForm.StatusBar.Panels[2].Text := 'Executing...'; + if MSSQL.NonBlocking then + btBreakExec.Enabled := True; + MSSQL.Execute; +end; + +procedure TSqlFrame.meSQLExit(Sender: TObject); +begin + AssignProperties; +end; + +procedure TSqlFrame.MSSQLAfterExecute(Sender: TObject; Result: Boolean); +var + s: string; + i: integer; +begin + btBreakExec.Enabled := False; + if btBreakExec.Enabled then + btBreakExec.Enabled := False; + if Result then + s := 'Success' + ' (' + IntToStr(MSSQL.RowsAffected) + ' rows processed)' + else + s := 'Execution failed'; + SdacForm.StatusBar.Panels[2].Text := s; + + for i := 0 to MSSQL.Params.Count-1 do + meResult.Lines.Add(MSSQL.Params[i].Name + ' = ' + MSSQL.Params[i].AsString); + + meResult.Lines.Add(s); +end; + +procedure TSqlFrame.cbNonBlockingClick(Sender: TObject); +var + oldConnect: boolean; +begin + oldConnect := MSSQL.Connection.Connected; + try + if cbNonBlocking.Checked then begin + if not DoNotRemind then begin + MessageDlg('Note, NonBlocking mode is available only with SQL Native Client installed', mtInformation, [mbOK], 0); + DoNotRemind := True; + end; + MSSQL.Connection.Disconnect; + OldProvider := MSSQL.Connection.Options.Provider; + MSSQL.Connection.Options.Provider := prNativeClient; + end + else + MSSQL.Connection.Options.Provider := OldProvider; + MSSQL.NonBlocking := cbNonBlocking.Checked; + finally + cbNonBlocking.Checked := MSSQL.NonBlocking; + end; + MSSQL.Connection.Connected := oldConnect; +end; + +procedure TSqlFrame.btBreakExecClick(Sender: TObject); +begin + MSSQL.BreakExec; +end; + +destructor TSqlFrame.Destroy; +begin + TerminateThread; + if (self <> nil) and MSSQL.Executing then + MSSQL.BreakExec; + + inherited; +end; + +procedure TSqlFrame.btExecInThreadClick(Sender: TObject); +begin + MSSQL.SQL := meSQL.Lines; + SDACForm.StatusBar.Panels[2].Text := 'Executing...'; + meResult.Lines.Clear; + TerminateThread; + FExecThread := TExecThread.Create(False) +end; + +// Demo management +procedure TSqlFrame.Initialize; +begin + inherited; + + FExecThread := nil; + SqlFrame := Self; + DoNotRemind := False; + MSSQL.Connection := Connection as TMSConnection; + meSQL.Lines := MSSQL.SQL; +end; + +procedure TSqlFrame.SetDebug(Value: boolean); +begin + MSSQL.Debug := Value; +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/StoredProc/StoredProc.dfm b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/StoredProc/StoredProc.dfm new file mode 100644 index 0000000..2b47bd1 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/StoredProc/StoredProc.dfm @@ -0,0 +1,157 @@ +inherited StoredProcFrame: TStoredProcFrame + Width = 441 + Height = 275 + Align = alClient + object DBGrid: TDBGrid + Left = 0 + Top = 49 + Width = 441 + Height = 226 + Align = alClient + DataSource = DataSource + TabOrder = 0 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object ToolBar: TPanel + Left = 0 + Top = 0 + Width = 441 + Height = 49 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object Panel1: TPanel + Left = 1 + Top = 1 + Width = 499 + Height = 24 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btOpen: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Open' + Flat = True + Transparent = False + OnClick = btOpenClick + end + object btClose: TSpeedButton + Left = 84 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Close' + Flat = True + Transparent = False + OnClick = btCloseClick + end + object btPrepare: TSpeedButton + Left = 167 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Prepare' + Flat = True + Transparent = False + OnClick = btPrepareClick + end + object btUnPrepare: TSpeedButton + Left = 250 + Top = 1 + Width = 82 + Height = 22 + Caption = 'UnPrepare' + Flat = True + Transparent = False + OnClick = btUnPrepareClick + end + object btExecute: TSpeedButton + Left = 333 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Execute' + Flat = True + Transparent = False + OnClick = btExecuteClick + end + object btPrepareSQL: TSpeedButton + Left = 416 + Top = 1 + Width = 82 + Height = 22 + Caption = 'PrepareSQL' + Flat = True + Transparent = False + OnClick = btPrepareSQLClick + end + end + object Panel2: TPanel + Left = 1 + Top = 24 + Width = 499 + Height = 24 + BevelOuter = bvNone + Color = clGreen + TabOrder = 1 + object DBNavigator: TDBNavigator + Left = 278 + Top = 1 + Width = 220 + Height = 22 + DataSource = DataSource + Flat = True + TabOrder = 0 + end + object Panel3: TPanel + Left = 1 + Top = 1 + Width = 276 + Height = 22 + BevelOuter = bvNone + TabOrder = 1 + object Label1: TLabel + Left = 4 + Top = 6 + Width = 82 + Height = 13 + Caption = 'StoredProc name' + end + object edStoredProcName: TComboBox + Left = 95 + Top = 1 + Width = 173 + Height = 21 + ItemHeight = 13 + TabOrder = 0 + OnDropDown = edStoredProcNameDropDown + OnExit = edStoredProcNameExit + end + end + end + end + object DataSource: TDataSource + DataSet = MSStoredProc + Left = 432 + Top = 72 + end + object MSStoredProc: TMSStoredProc + StoredProcName = 'Ten Most High-Paid Employees;1' + SQLRefresh.Strings = ( + 'WHERE' + ' DEPTNO = :DEPTNO') + Connection = SDACForm.MSConnection + SQL.Strings = ( + '{CALL "Ten Most High-Paid Employees";1}') + Debug = True + Left = 400 + Top = 72 + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/StoredProc/StoredProc.pas b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/StoredProc/StoredProc.pas new file mode 100644 index 0000000..6c9b973 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/StoredProc/StoredProc.pas @@ -0,0 +1,170 @@ +unit StoredProc; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + DBCtrls, ExtCtrls, Db, Grids, DBGrids, StdCtrls, ToolWin, + ComCtrls, MemDS, DBAccess, MSAccess, SdacVcl, + Buttons, DemoFrame, SdacDemoForm, DAScript, MSScript; + +type + TStoredProcFrame = class(TDemoFrame) + DataSource: TDataSource; + MSStoredProc: TMSStoredProc; + DBGrid: TDBGrid; + ToolBar: TPanel; + Panel1: TPanel; + btOpen: TSpeedButton; + btClose: TSpeedButton; + btPrepare: TSpeedButton; + btUnPrepare: TSpeedButton; + btExecute: TSpeedButton; + btPrepareSQL: TSpeedButton; + Panel2: TPanel; + DBNavigator: TDBNavigator; + Panel3: TPanel; + Label1: TLabel; + edStoredProcName: TComboBox; + procedure btOpenClick(Sender: TObject); + procedure btCloseClick(Sender: TObject); + procedure btPrepareClick(Sender: TObject); + procedure btUnPrepareClick(Sender: TObject); + procedure btExecuteClick(Sender: TObject); + procedure btPrepareSQLClick(Sender: TObject); + procedure edStoredProcNameExit(Sender: TObject); + procedure edStoredProcNameDropDown(Sender: TObject); + private + { Private declarations } + procedure ShowState; + procedure AssignProperties; + public + // Demo management + procedure Initialize; override; + procedure SetDebug(Value: boolean); override; + end; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} + +procedure TStoredProcFrame.AssignProperties; +begin + if Trim(MSStoredProc.StoredProcName) <> Trim(edStoredProcName.Text) then + MSStoredProc.StoredProcName := edStoredProcName.Text; + ShowState; +end; + +procedure TStoredProcFrame.ShowState; +var + St: string; + + procedure AddSt(S:string); + begin + if St <> '' then + St := St + ', '; + St := St + S; + end; + +begin + St := ''; + + if MSStoredProc.Prepared then begin + AddSt('Prepared'); + + if MSStoredProc.IsQuery then + AddSt('IsQuery'); + + end; + + if MSStoredProc.Active then + AddSt('Active') + else + AddSt('Inactive'); + + SdacForm.StatusBar.Panels[2].Text := St; +end; + +procedure TStoredProcFrame.btOpenClick(Sender: TObject); +begin + try + AssignProperties; + MSStoredProc.Open; + finally + ShowState; + end; +end; + +procedure TStoredProcFrame.btCloseClick(Sender: TObject); +begin + MSStoredProc.Close; + ShowState; +end; + +procedure TStoredProcFrame.btPrepareClick(Sender: TObject); +begin + try + AssignProperties; + MSStoredProc.Prepare; + finally + ShowState; + end; +end; + +procedure TStoredProcFrame.btUnPrepareClick(Sender: TObject); +begin + MSStoredProc.UnPrepare; + ShowState; +end; + +procedure TStoredProcFrame.btExecuteClick(Sender: TObject); +begin + try + AssignProperties; + MSStoredProc.Execute; + finally + ShowState; + end; +end; + +procedure TStoredProcFrame.btPrepareSQLClick(Sender: TObject); +begin + try + AssignProperties; + MSStoredProc.PrepareSQL; + finally + ShowState; + end; +end; + +procedure TStoredProcFrame.edStoredProcNameExit(Sender: TObject); +begin + AssignProperties; +end; + +procedure TStoredProcFrame.edStoredProcNameDropDown(Sender: TObject); +begin + MSStoredProc.Connection.GetStoredProcNames(edStoredProcName.Items); +end; + +// Demo management +procedure TStoredProcFrame.Initialize; +begin + inherited; + MSStoredProc.Connection := Connection as TMSConnection; + edStoredProcName.Text := MSStoredProc.StoredProcName; + ShowState; +end; + +procedure TStoredProcFrame.SetDebug(Value: boolean); +begin + MSStoredProc.Debug := Value; +end; + +end. + diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/StoredProcUpdates/StoredProcUpdates.dfm b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/StoredProcUpdates/StoredProcUpdates.dfm new file mode 100644 index 0000000..050ebbd --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/StoredProcUpdates/StoredProcUpdates.dfm @@ -0,0 +1,101 @@ +inherited StoredProcUpdatesFrame: TStoredProcUpdatesFrame + Width = 441 + Height = 275 + Align = alClient + object Panel1: TPanel + Left = 0 + Top = 0 + Width = 441 + Height = 26 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object Panel2: TPanel + Left = 1 + Top = 1 + Width = 408 + Height = 24 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btClose: TSpeedButton + Left = 84 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Close' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + ParentFont = False + Transparent = False + OnClick = btCloseClick + end + object btOpen: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Open' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + ParentFont = False + Transparent = False + OnClick = btOpenClick + end + object DBNavigator1: TDBNavigator + Left = 167 + Top = 1 + Width = 240 + Height = 22 + DataSource = DataSource + Flat = True + TabOrder = 0 + end + end + end + object DBGrid1: TDBGrid + Left = 0 + Top = 26 + Width = 441 + Height = 249 + Align = alClient + DataSource = DataSource + TabOrder = 1 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object MSQuery: TMSQuery + SQLInsert.Strings = ( + '{:EmpNO = CALL SDAC_InsertEmp;1(:ENAME, :JOB)}') + SQLDelete.Strings = ( + '{CALL SDAC_DeleteEmp;1(:EmpNO, :Result)}') + SQLUpdate.Strings = ( + + '{:RETURN_VALUE = CALL SDAC_UpdateEmp;1(:EMPNO, :ENAME, :JOB, :EM' + + 'PINFO)}') + Connection = SDACForm.MSConnection + SQL.Strings = ( + 'SELECT EMPNO, ENAME, JOB FROM EMP') + Debug = True + BeforeUpdateExecute = MSQueryBeforeUpdateExecute + AfterUpdateExecute = MSQueryAfterUpdateExecute + Left = 48 + Top = 208 + end + object DataSource: TDataSource + DataSet = MSQuery + Left = 80 + Top = 208 + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/StoredProcUpdates/StoredProcUpdates.pas b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/StoredProcUpdates/StoredProcUpdates.pas new file mode 100644 index 0000000..04781f7 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/StoredProcUpdates/StoredProcUpdates.pas @@ -0,0 +1,133 @@ +{ +Insert - example of using SP with return Identity value as result of executing +Update - example of using SP with return arbitrary value as result of executing +Delete - example of using SP with return arbitrary value as parameter +} + +unit StoredProcUpdates; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + Db, MemDS, DBAccess, Grids, DBGrids, StdCtrls, + ActnList, ExtCtrls, DBCtrls, MSAccess, SdacVcl, + Buttons, DemoFrame, SdacDemoForm; + +type + TStoredProcUpdatesFrame = class(TDemoFrame) + MSQuery: TMSQuery; + DataSource: TDataSource; + Panel1: TPanel; + DBGrid1: TDBGrid; + Panel2: TPanel; + DBNavigator1: TDBNavigator; + btClose: TSpeedButton; + btOpen: TSpeedButton; + procedure btOpenClick(Sender: TObject); + procedure btCloseClick(Sender: TObject); + procedure MSQueryBeforeUpdateExecute(Sender: TCustomMSDataSet; + StatementTypes: TStatementTypes; Params: TMSParams); + procedure MSQueryAfterUpdateExecute(Sender: TCustomMSDataSet; + StatementTypes: TStatementTypes; Params: TMSParams); + private + { Private declarations } + public + // Demo management + procedure Initialize; override; + procedure SetDebug(Value: boolean); override; + end; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} + +{$IFDEF CLR} +uses + Variants; +{$ENDIF} + +procedure TStoredProcUpdatesFrame.btOpenClick(Sender: TObject); +begin + MSQuery.Open; +end; + +procedure TStoredProcUpdatesFrame.btCloseClick(Sender: TObject); +begin + MSQuery.Close; +end; + +procedure TStoredProcUpdatesFrame.MSQueryBeforeUpdateExecute(Sender: TCustomMSDataSet; + StatementTypes: TStatementTypes; Params: TMSParams); +begin + if stInsert in StatementTypes then begin + Params.ParamByName('EMPNO').ParamType := ptResult; + // Params.ParamByName('RETURN_VALUE').DataType was setted equal to Sender.FieldByName('EMPNO').FieldType + end; + + if stUpdate in StatementTypes then begin + Params.ParamByName('RETURN_VALUE').ParamType := ptResult; + Params.ParamByName('RETURN_VALUE').DataType := ftInteger; // Field 'RETURN_VALUE' does not present in Sender, so we need to set DataType manually + + Params.ParamByName('EMPINFO').ParamType := ptOutput; + Params.ParamByName('EMPINFO').DataType := ftWideString; // Field 'EMPINFO' does not present in Sender, so we need to set DataType manually + end; + + if stDelete in StatementTypes then begin + Params.ParamByName('Result').ParamType := ptOutput; + Params.ParamByName('Result').DataType := ftInteger; // Field 'Result' does not present in Sender, so we need to set DataType manually + end; +end; + +procedure TStoredProcUpdatesFrame.MSQueryAfterUpdateExecute(Sender: TCustomMSDataSet; + StatementTypes: TStatementTypes; Params: TMSParams); +var + EMPNO, ReturnedEMPNO: integer; +begin + if stInsert in StatementTypes then begin + EMPNO := Integer(Params.ParamByName('EMPNO').Value); + Sender.FieldByName('EMPNO').ReadOnly := False; + try + Sender.FieldByName('EMPNO').NewValue := EMPNO; + finally + Sender.FieldByName('EMPNO').ReadOnly := True; + end; + end; + + if stUpdate in StatementTypes then begin + EMPNO := Sender.FieldByName('EMPNO').AsInteger; + ReturnedEMPNO := Integer(Params.ParamByName('RETURN_VALUE').Value); + + if EMPNO <> ReturnedEMPNO then + raise Exception.Create('Error on Update occured!'); + + Caption := String(Params.ParamByName('EMPINFO').Value); + end; + + if stDelete in StatementTypes then begin + EMPNO := Params.ParamByName('EMPNO').AsInteger; + ReturnedEMPNO := Integer(Params.ParamByName('Result').Value); + + if EMPNO + 2 {see StoredProc SDAC_DeleteEmployees} <> ReturnedEMPNO then + raise Exception.Create('Error on Delete occured!'); + end; +end; + +// Demo management +procedure TStoredProcUpdatesFrame.Initialize; +begin + inherited; + MSQuery.Connection := Connection as TMSConnection; +end; + +procedure TStoredProcUpdatesFrame.SetDebug(Value: boolean); +begin + MSQuery.Debug := Value; +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Table/Table.dfm b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Table/Table.dfm new file mode 100644 index 0000000..3375e6f --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Table/Table.dfm @@ -0,0 +1,180 @@ +inherited TableFrame: TTableFrame + Width = 441 + Height = 275 + Align = alClient + object DBGrid: TDBGrid + Left = 0 + Top = 76 + Width = 441 + Height = 199 + Align = alClient + DataSource = DataSource + TabOrder = 0 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object ToolBar: TPanel + Left = 0 + Top = 0 + Width = 441 + Height = 76 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object Panel3: TPanel + Left = 1 + Top = 0 + Width = 657 + Height = 75 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btOpen: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Open' + Flat = True + Transparent = False + OnClick = btOpenClick + end + object btClose: TSpeedButton + Left = 84 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Close' + Flat = True + Transparent = False + OnClick = btCloseClick + end + object btPrepare: TSpeedButton + Left = 167 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Prepare' + Flat = True + Transparent = False + OnClick = btPrepareClick + end + object btUnPrepare: TSpeedButton + Left = 250 + Top = 1 + Width = 82 + Height = 22 + Caption = 'UnPrepare' + Flat = True + Transparent = False + OnClick = btUnPrepareClick + end + object btExecute: TSpeedButton + Left = 333 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Execute' + Flat = True + Transparent = False + OnClick = btExecuteClick + end + object DBNavigator: TDBNavigator + Left = 416 + Top = 1 + Width = 240 + Height = 22 + DataSource = DataSource + Flat = True + TabOrder = 0 + end + object Panel7: TPanel + Left = 416 + Top = 24 + Width = 240 + Height = 50 + BevelOuter = bvNone + TabOrder = 1 + object Label3: TLabel + Left = 6 + Top = 4 + Width = 53 + Height = 13 + Caption = 'OrderFields' + end + object edOrderFields: TEdit + Left = 6 + Top = 20 + Width = 219 + Height = 21 + TabOrder = 0 + OnExit = edTableNameExit + end + end + object Panel5: TPanel + Left = 1 + Top = 24 + Width = 165 + Height = 50 + BevelOuter = bvNone + TabOrder = 2 + object Label1: TLabel + Left = 6 + Top = 4 + Width = 56 + Height = 13 + Caption = 'Table name' + end + object edTableName: TComboBox + Left = 6 + Top = 20 + Width = 140 + Height = 21 + ItemHeight = 13 + TabOrder = 0 + OnDropDown = edTableNameDropDown + OnExit = edTableNameExit + end + end + object Panel8: TPanel + Left = 167 + Top = 24 + Width = 248 + Height = 50 + BevelOuter = bvNone + TabOrder = 3 + object Label4: TLabel + Left = 6 + Top = 4 + Width = 43 + Height = 13 + Caption = 'FilterSQL' + end + object edFilterSQL: TEdit + Left = 6 + Top = 20 + Width = 226 + Height = 21 + TabOrder = 0 + OnExit = edTableNameExit + end + end + end + end + object DataSource: TDataSource + DataSet = MSTable + Left = 128 + Top = 32 + end + object MSTable: TMSTable + TableName = 'Emp' + OrderFields = 'EName' + Connection = SDACForm.MSConnection + Debug = True + Left = 96 + Top = 32 + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Table/Table.pas b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Table/Table.pas new file mode 100644 index 0000000..0911d54 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Table/Table.pas @@ -0,0 +1,176 @@ +unit Table; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + DBCtrls, ExtCtrls, Db, Grids, DBGrids, StdCtrls, ToolWin, + ComCtrls, MemDS, DBAccess, MSAccess, SdacVcl, + Buttons, DemoFrame, SdacDemoForm; + +type + TTableFrame = class(TDemoFrame) + DataSource: TDataSource; + MSTable: TMSTable; + DBGrid: TDBGrid; + ToolBar: TPanel; + Panel3: TPanel; + btOpen: TSpeedButton; + btClose: TSpeedButton; + btPrepare: TSpeedButton; + btUnPrepare: TSpeedButton; + btExecute: TSpeedButton; + DBNavigator: TDBNavigator; + Panel7: TPanel; + Label3: TLabel; + edOrderFields: TEdit; + Panel5: TPanel; + Label1: TLabel; + edTableName: TComboBox; + Panel8: TPanel; + Label4: TLabel; + edFilterSQL: TEdit; + procedure btOpenClick(Sender: TObject); + procedure btCloseClick(Sender: TObject); + procedure btPrepareClick(Sender: TObject); + procedure btUnPrepareClick(Sender: TObject); + procedure btExecuteClick(Sender: TObject); + procedure edTableNameExit(Sender: TObject); + procedure edTableNameDropDown(Sender: TObject); + private + { Private declarations } + procedure ShowState; + procedure AssignProperties; + public + // Demo management + procedure Initialize; override; + procedure SetDebug(Value: boolean); override; + end; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} + +procedure TTableFrame.AssignProperties; +begin + try + if Trim(MSTable.TableName) <> Trim(edTableName.Text) then + MSTable.TableName := edTableName.Text; + + MSTable.FilterSQL := edFilterSQL.Text; + + try + MSTable.OrderFields:= edOrderFields.Text; + except + edOrderFields.SetFocus; + raise; + end; + finally + ShowState; + end; + +end; + +procedure TTableFrame.ShowState; +var + St: string; + + procedure AddSt(S: string); + begin + if St <> '' then + St:= St + ', '; + St:= St + S; + end; + +begin + St:= ''; + + if MSTable.Prepared then begin + AddSt('Prepared'); + + if MSTable.IsQuery then + AddSt('IsQuery'); + end; + + if MSTable.Active then + AddSt('Active') + else + AddSt('Inactive'); + + SdacForm.StatusBar.Panels[2].Text:= St; +end; + +procedure TTableFrame.btOpenClick(Sender: TObject); +begin + try + AssignProperties; + MSTable.Open; + finally + ShowState; + end; +end; + +procedure TTableFrame.btCloseClick(Sender: TObject); +begin + MSTable.Close; + ShowState; +end; + +procedure TTableFrame.btPrepareClick(Sender: TObject); +begin + try + AssignProperties; + MSTable.Prepare; + finally + ShowState; + end; +end; + +procedure TTableFrame.btUnPrepareClick(Sender: TObject); +begin + MSTable.UnPrepare; + ShowState; +end; + +procedure TTableFrame.btExecuteClick(Sender: TObject); +begin + try + AssignProperties; + MSTable.Execute; + finally + ShowState; + end; +end; + +procedure TTableFrame.edTableNameExit(Sender: TObject); +begin + AssignProperties; +end; + +procedure TTableFrame.edTableNameDropDown(Sender: TObject); +begin + MSTable.Connection.GetTableNames(edTableName.Items); +end; + +// Demo management +procedure TTableFrame.Initialize; +begin + inherited; + MSTable.Connection := Connection as TMSConnection; + edTableName.Text:= MSTable.TableName; + edOrderFields.Text:= MSTable.OrderFields; + ShowState; +end; + +procedure TTableFrame.SetDebug(Value: boolean); +begin + MSTable.Debug:= Value; +end; + +end. + diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Text/Text.dfm b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Text/Text.dfm new file mode 100644 index 0000000..4540520 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Text/Text.dfm @@ -0,0 +1,162 @@ +inherited TextFrame: TTextFrame + Width = 441 + Height = 275 + Align = alClient + object Splitter1: TSplitter + Left = 0 + Top = 208 + Width = 441 + Height = 2 + Cursor = crVSplit + Align = alTop + end + object DBGrid: TDBGrid + Left = 0 + Top = 26 + Width = 441 + Height = 182 + Align = alTop + DataSource = DataSource + Options = [dgEditing, dgTitles, dgIndicator, dgColumnResize, dgColLines, dgRowLines, dgTabs, dgConfirmDelete] + TabOrder = 0 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object ToolBar: TPanel + Left = 0 + Top = 0 + Width = 441 + Height = 26 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object ToolButton1: TToolButton + Left = 362 + Top = 2 + Width = 16 + Caption = 'ToolButton1' + Style = tbsSeparator + end + object Panel1: TPanel + Left = 1 + Top = 1 + Width = 398 + Height = 24 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btClose: TSpeedButton + Left = 84 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Close' + Flat = True + Transparent = False + OnClick = btCloseClick + end + object btOpen: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Open' + Flat = True + Transparent = False + OnClick = btOpenClick + end + object DBNavigator: TDBNavigator + Left = 167 + Top = 1 + Width = 230 + Height = 22 + DataSource = DataSource + Flat = True + TabOrder = 0 + end + end + end + object meText: TDBMemo + Left = 0 + Top = 236 + Width = 441 + Height = 39 + Align = alClient + DataField = 'TextField' + DataSource = DataSource + ScrollBars = ssBoth + TabOrder = 2 + end + object ToolBar1: TPanel + Left = 0 + Top = 210 + Width = 441 + Height = 26 + Align = alTop + BevelOuter = bvNone + TabOrder = 3 + object Panel2: TPanel + Left = 1 + Top = 1 + Width = 250 + Height = 24 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btClear: TSpeedButton + Left = 167 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Clear' + Flat = True + Transparent = False + OnClick = btClearClick + end + object btSave: TSpeedButton + Left = 84 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Save to file' + Flat = True + Transparent = False + OnClick = btSaveClick + end + object btLoad: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Load from file' + Flat = True + Transparent = False + OnClick = btLoadClick + end + end + end + object DataSource: TDataSource + DataSet = MSQuery + Left = 440 + Top = 32 + end + object MSQuery: TMSQuery + Connection = SDACForm.MSConnection + SQL.Strings = ( + 'SELECT * FROM SDAC_Text') + Debug = True + Left = 408 + Top = 32 + end + object OpenDialog: TOpenDialog + Left = 240 + Top = 259 + end + object SaveDialog: TSaveDialog + Left = 272 + Top = 259 + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Text/Text.pas b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Text/Text.pas new file mode 100644 index 0000000..294ccb0 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Text/Text.pas @@ -0,0 +1,100 @@ +unit Text; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + DBCtrls, ExtCtrls, Db, Grids, DBGrids, StdCtrls, ToolWin, + ComCtrls, MemDS, DBAccess, MSAccess, SdacVcl, + Buttons, DemoFrame, DAScript, MSScript; + +type + TTextFrame = class(TDemoFrame) + DBGrid: TDBGrid; + DataSource: TDataSource; + ToolBar: TPanel; + meText: TDBMemo; + MSQuery: TMSQuery; + Splitter1: TSplitter; + ToolBar1: TPanel; + OpenDialog: TOpenDialog; + SaveDialog: TSaveDialog; + ToolButton1: TToolButton; + Panel1: TPanel; + DBNavigator: TDBNavigator; + btClose: TSpeedButton; + btOpen: TSpeedButton; + Panel2: TPanel; + btClear: TSpeedButton; + btSave: TSpeedButton; + btLoad: TSpeedButton; + procedure btOpenClick(Sender: TObject); + procedure btCloseClick(Sender: TObject); + procedure btLoadClick(Sender: TObject); + procedure btSaveClick(Sender: TObject); + procedure btClearClick(Sender: TObject); + private + { Private declarations } + public + // Demo management + procedure Initialize; override; + procedure SetDebug(Value: boolean); override; + end; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} + +procedure TTextFrame.btOpenClick(Sender: TObject); +begin + MSQuery.Open; +end; + +procedure TTextFrame.btCloseClick(Sender: TObject); +begin + MSQuery.Close; +end; + +procedure TTextFrame.btLoadClick(Sender: TObject); +begin + if MSQuery.Active and OpenDialog.Execute then begin + if MSQuery.State = dsBrowse then + MSQuery.Edit; + + TBlobField(MSQuery.FieldByName('TextField')).LoadFromFile(OpenDialog.FileName); + end; +end; + +procedure TTextFrame.btSaveClick(Sender: TObject); +begin + if not MSQuery.EOF and SaveDialog.Execute then + TBlobField(MSQuery.FieldByName('TextField')).SaveToFile(SaveDialog.FileName); +end; + +procedure TTextFrame.btClearClick(Sender: TObject); +begin + if MSQuery.Active then begin + if MSQuery.State = dsBrowse then + MSQuery.Edit; + MSQuery.FieldByName('TextField').Clear; + end; +end; + +// Demo management +procedure TTextFrame.Initialize; +begin + inherited; + MSQuery.Connection := Connection as TMSConnection; +end; + +procedure TTextFrame.SetDebug(Value: boolean); +begin + MSQuery.Debug := Value; +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Threads/Threads.dfm b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Threads/Threads.dfm new file mode 100644 index 0000000..547862f --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Threads/Threads.dfm @@ -0,0 +1,391 @@ +inherited ThreadsFrame: TThreadsFrame + Width = 441 + Height = 275 + Align = alClient + object Panel3: TPanel + Left = 0 + Top = 80 + Width = 441 + Height = 143 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object Splitter2: TSplitter + Left = 261 + Top = 0 + Height = 143 + end + object Panel4: TPanel + Left = 0 + Top = 0 + Width = 261 + Height = 143 + Align = alLeft + BevelOuter = bvNone + TabOrder = 0 + object meSQL: TMemo + Left = 0 + Top = 0 + Width = 261 + Height = 73 + Align = alTop + Font.Charset = RUSSIAN_CHARSET + Font.Color = clBlack + Font.Height = -12 + Font.Name = 'Courier New' + Font.Style = [] + ParentFont = False + ReadOnly = True + ScrollBars = ssVertical + TabOrder = 0 + end + object meLog: TMemo + Left = 0 + Top = 73 + Width = 261 + Height = 70 + Align = alClient + Font.Charset = RUSSIAN_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Courier New' + Font.Style = [] + ParentFont = False + ScrollBars = ssVertical + TabOrder = 1 + end + end + object DBGrid1: TDBGrid + Left = 264 + Top = 0 + Width = 177 + Height = 143 + Align = alClient + DataSource = MSDataSource + TabOrder = 1 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + end + object Panel2: TPanel + Left = 0 + Top = 0 + Width = 441 + Height = 80 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object Panel5: TPanel + Left = 0 + Top = 23 + Width = 418 + Height = 24 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btStart: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Start' + Flat = True + Transparent = False + OnClick = btStartClick + end + object btStop: TSpeedButton + Left = 84 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Stop' + Flat = True + Transparent = False + OnClick = btStopClick + end + object btRun: TSpeedButton + Left = 167 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Run' + Flat = True + Transparent = False + OnClick = btRunClick + end + object btRunMax: TSpeedButton + Left = 250 + Top = 1 + Width = 83 + Height = 22 + Caption = 'RunMax' + Flat = True + Transparent = False + OnClick = btRunMaxClick + end + object btClearLog: TSpeedButton + Left = 334 + Top = 1 + Width = 83 + Height = 22 + Caption = 'ClearLog' + Flat = True + Transparent = False + OnClick = btClearLogClick + end + end + object Panel6: TPanel + Left = 0 + Top = 0 + Width = 418 + Height = 24 + BevelOuter = bvNone + Color = clGreen + TabOrder = 1 + object btOpen: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Open' + Flat = True + Transparent = False + OnClick = btOpenClick + end + object btDeleteAll: TSpeedButton + Left = 84 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Delete All' + Flat = True + Transparent = False + OnClick = btDeleteAllClick + end + object DBNavigator1: TDBNavigator + Left = 167 + Top = 1 + Width = 250 + Height = 22 + Flat = True + TabOrder = 0 + end + end + object Panel11: TPanel + Left = 417 + Top = 0 + Width = 244 + Height = 47 + BevelOuter = bvNone + Color = clGreen + TabOrder = 2 + object Panel10: TPanel + Left = 1 + Top = 1 + Width = 120 + Height = 45 + BevelOuter = bvNone + TabOrder = 0 + object Label1: TLabel + Left = 5 + Top = 23 + Width = 92 + Height = 16 + Caption = 'Thread count' + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Height = -13 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + end + object Label2: TLabel + Left = 5 + Top = 2 + Width = 89 + Height = 16 + Caption = 'Except count' + Font.Charset = DEFAULT_CHARSET + Font.Color = clRed + Font.Height = -13 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + end + object lbThreadCount: TLabel + Left = 104 + Top = 23 + Width = 9 + Height = 16 + Caption = '0' + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Height = -13 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + end + object lbExceptCount: TLabel + Left = 104 + Top = 2 + Width = 9 + Height = 16 + Caption = '0' + Font.Charset = DEFAULT_CHARSET + Font.Color = clRed + Font.Height = -13 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + end + end + object Panel12: TPanel + Left = 122 + Top = 1 + Width = 121 + Height = 45 + BevelOuter = bvNone + TabOrder = 1 + object lbInterval: TLabel + Left = 57 + Top = 23 + Width = 6 + Height = 13 + Caption = '0' + end + object lbTime: TLabel + Left = 57 + Top = 2 + Width = 6 + Height = 13 + Caption = '0' + end + object Label5: TLabel + Left = 6 + Top = 2 + Width = 23 + Height = 13 + Caption = 'Time' + end + object Label6: TLabel + Left = 6 + Top = 23 + Width = 35 + Height = 13 + Caption = 'Interval' + end + end + end + object Panel13: TPanel + Left = 0 + Top = 46 + Width = 342 + Height = 30 + BevelOuter = bvNone + Color = clGreen + TabOrder = 3 + object Panel14: TPanel + Left = 1 + Top = 1 + Width = 164 + Height = 28 + BevelOuter = bvNone + TabOrder = 0 + object Label3: TLabel + Left = 6 + Top = 6 + Width = 54 + Height = 13 + Caption = 'MaxThread' + end + object edCount: TEdit + Left = 68 + Top = 3 + Width = 89 + Height = 21 + TabOrder = 0 + Text = 'edCount' + OnChange = edCountChange + end + end + object Panel9: TPanel + Left = 166 + Top = 1 + Width = 175 + Height = 28 + BevelOuter = bvNone + TabOrder = 1 + object Label4: TLabel + Left = 7 + Top = 7 + Width = 27 + Height = 13 + Caption = 'Mode' + end + object rbInsert: TRadioButton + Left = 41 + Top = 6 + Width = 63 + Height = 17 + Caption = 'INSERT' + TabOrder = 0 + OnClick = rgModeClick + end + object rbSelect: TRadioButton + Left = 105 + Top = 6 + Width = 81 + Height = 17 + Caption = 'SELECT' + TabOrder = 1 + OnClick = rgModeClick + end + end + end + end + object meErrorLog: TMemo + Left = 0 + Top = 223 + Width = 441 + Height = 52 + Align = alClient + Font.Charset = DEFAULT_CHARSET + Font.Color = clRed + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + ParentFont = False + ScrollBars = ssVertical + TabOrder = 2 + end + object Timer: TTimer + Enabled = False + OnTimer = TimerTimer + Left = 48 + Top = 80 + end + object MSDataSource: TDataSource + DataSet = MSQuery + Left = 48 + Top = 112 + end + object scDeleteAll: TMSSQL + Connection = SDACForm.MSConnection + SQL.Strings = ( + 'DELETE FROM ThreadTable') + Debug = True + CommandTimeout = 0 + Left = 116 + Top = 113 + end + object MSQuery: TMSQuery + Connection = SDACForm.MSConnection + SQL.Strings = ( + 'SELECT * FROM ThreadTable') + Left = 16 + Top = 112 + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Threads/Threads.pas b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Threads/Threads.pas new file mode 100644 index 0000000..a2be42f --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Threads/Threads.pas @@ -0,0 +1,382 @@ +unit Threads; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + StdCtrls, ExtCtrls, Db, MemDS, DBCtrls, ActiveX, + Grids, DBGrids, DBAccess, MSAccess, SdacVcl, + Buttons, ThreadsData, DemoFrame; + +const + WM_ENDTHREAD = $500; + WM_EXCEPTTHREAD = $501; + WM_ENDEXECUTE = $502; + +type + TThreadsFrame = class(TDemoFrame) + Timer: TTimer; + MSDataSource: TDataSource; + scDeleteAll: TMSSQL; + Panel3: TPanel; + Splitter2: TSplitter; + Panel4: TPanel; + meSQL: TMemo; + meLog: TMemo; + DBGrid1: TDBGrid; + Panel2: TPanel; + Panel5: TPanel; + btStart: TSpeedButton; + btStop: TSpeedButton; + btRun: TSpeedButton; + btRunMax: TSpeedButton; + btClearLog: TSpeedButton; + Panel6: TPanel; + btOpen: TSpeedButton; + btDeleteAll: TSpeedButton; + DBNavigator1: TDBNavigator; + Panel11: TPanel; + Panel10: TPanel; + Label1: TLabel; + Label2: TLabel; + lbThreadCount: TLabel; + lbExceptCount: TLabel; + Panel12: TPanel; + lbInterval: TLabel; + lbTime: TLabel; + Label5: TLabel; + Label6: TLabel; + Panel13: TPanel; + Panel14: TPanel; + Label3: TLabel; + edCount: TEdit; + Panel9: TPanel; + Label4: TLabel; + rbInsert: TRadioButton; + rbSelect: TRadioButton; + meErrorLog: TMemo; + MSQuery: TMSQuery; + procedure btRunClick(Sender: TObject); + procedure TimerTimer(Sender: TObject); + procedure btStartClick(Sender: TObject); + procedure btStopClick(Sender: TObject); + procedure edCountChange(Sender: TObject); + procedure btRunMaxClick(Sender: TObject); + procedure btClearLogClick(Sender: TObject); + procedure btOpenClick(Sender: TObject); + procedure rgModeClick(Sender: TObject); + procedure btDeleteAllClick(Sender: TObject); + procedure Button1Click(Sender: TObject); + + private + procedure WMEndExecute(var Msg: TMessage); message WM_ENDTHREAD; + procedure WMException(var Msg: TMessage); message WM_EXCEPTTHREAD; + + function RunThread(ObjectPtr: pointer; Method:pointer; EndMethod: pointer): THandle; + + procedure Execute; + procedure EndExecute(Result: boolean); + + procedure Log(St: string); + procedure ErrorLog(St: string); + + procedure TestConnected; + + public + // Demo management + procedure Initialize; override; + procedure SetDebug(Value: boolean); override; + end; + +implementation + +uses +{$IFNDEF VER130}Variants,{$ENDIF} + SdacDemoForm; + +{$WRITEABLECONST ON} + +{$R *.dfm} + +const + MaxThread: integer = 40; + Interval: integer = 2000; + ExceptCount: integer = 0; + +var + ThreadCount: integer; + ThreadNum: integer; + hCountSec: TRTLCriticalSection; + hLogSec: TRTLCriticalSection; + BegTime: TDateTime; + +type + TMethod = procedure (Self: pointer); + TEndMethod = procedure (Self: pointer; Result: boolean); + + PMethodDesc = ^TMethodDesc; + TMethodDesc = record + ObjectPtr :pointer; + Method :pointer; + EndMethod :pointer; + hWindow :HWND; + end; + +procedure ThreadProc(MethodDesc: PMethodDesc); stdcall; +begin + try + TMethod(MethodDesc^.Method)(MethodDesc.ObjectPtr); + PostMessage(MethodDesc.hWindow, WM_ENDTHREAD, DWORD(MethodDesc), 0); + except + on E:Exception do begin + PostMessage(MethodDesc.hWindow, WM_EXCEPTTHREAD, DWORD(MethodDesc), + DWORD(E)); + ExitThread(0); + end; + end; +end; + +procedure TThreadsFrame.WMEndExecute(var Msg: TMessage); +begin + if PMethodDesc(Msg.wParam).EndMethod <> nil then + TEndMethod(PMethodDesc(Msg.wParam).EndMethod)(PMethodDesc(Msg.wParam).ObjectPtr, True); + Dispose(PMethodDesc(Msg.wParam)); +end; + +procedure TThreadsFrame.WMException(var Msg: TMessage); +begin + if PMethodDesc(Msg.wParam).EndMethod <> nil then + TEndMethod(PMethodDesc(Msg.wParam).EndMethod)(PMethodDesc(Msg.wParam).ObjectPtr, False); + Dispose(PMethodDesc(Msg.wParam)); + raise Exception(Msg.lParam); +end; + +function TThreadsFrame.RunThread(ObjectPtr: pointer; Method: pointer; EndMethod: pointer): THandle; +var + ThreadId: DWORD; + MethodDesc: PMethodDesc; +begin + New(MethodDesc); + + MethodDesc.ObjectPtr := ObjectPtr; + MethodDesc.Method := Method; + MethodDesc.EndMethod := EndMethod; + MethodDesc.hWindow := Handle; + + InterlockedIncrement(ThreadCount); + Result:= CreateThread(nil, 1000, @ThreadProc, MethodDesc, 0, ThreadId); +end; + +procedure TThreadsFrame.Log(St: string); +begin + EnterCriticalSection(hLogSec); + if meLog.Lines.Count > 1000 then + meLog.Lines.Clear; + meLog.Lines.Add(St); + LeaveCriticalSection(hLogSec); +end; + +procedure TThreadsFrame.ErrorLog(St:string); +begin + EnterCriticalSection(hLogSec); + meErrorLog.Lines.Add(St); + LeaveCriticalSection(hLogSec); +end; + +const + Delay = 1000; + +procedure TThreadsFrame.Execute; +var + Data: TdmThreadsData; + ThreadNum: integer; + i: integer; +begin + i := CoInitializeEx(nil, COINIT_APARTMENTTHREADED); + if i <> S_OK then + raise Exception.Create('err - ' + IntToStr(i)); + + EnterCriticalSection(hCountSec); + Inc(Threads.ThreadNum); + ThreadNum := Threads.ThreadNum; + lbThreadCount.Caption := IntToStr(ThreadCount); + LeaveCriticalSection(hCountSec); + + Data := TdmThreadsData.Create(nil); + try + try + with Data do begin + Log(IntToStr(ThreadNum) + ' Connecting...'); + MSConnection.Assign(SdacForm.MSConnection); + MSConnection.LoginPrompt := False; + MSConnection.Connect; + Log(IntToStr(ThreadNum) + ' Connected'); + + if rbInsert.Checked then begin + // INSERT + MSSQL.ParamByName('ID').AsInteger := Random(10000); + MSSQL.Execute; +// MSConnection.Commit; + Log(IntToStr(ThreadNum) + ' Executed'); + end + else begin + // SELECT + MSQuery.Open; + i := 0; + while not MSQuery.Eof do begin + MSQuery.Next; + Inc(i); + end; + Log(IntToStr(ThreadNum) + ' Fetched ' + IntToStr(i) + ' rows'); + MSQuery.Close; + end; + + MSConnection.Disconnect; + Log(IntToStr(ThreadNum) + ' Disconnected'); + end; + except + on E:Exception do begin + MessageBeep(1000); + Log(IntToStr(ThreadNum) + ' ' + IntToStr(ThreadCount) + ' Exception ' + E.Message); + ErrorLog(IntToStr(ThreadNum) + ' ' + IntToStr(ThreadCount) + ' Exception ' + E.Message); + Inc(ExceptCount); + lbExceptCount.Caption := IntToStr(ExceptCount); + end; + end; + finally + Data.Free; + CoUninitialize; + end; +end; + +procedure TThreadsFrame.EndExecute(Result: boolean); +begin + InterlockedDecrement(ThreadCount); + EnterCriticalSection(hCountSec); + lbThreadCount.Caption := IntToStr(ThreadCount); + MessageBeep(1000); + LeaveCriticalSection(hCountSec); +end; + +procedure TThreadsFrame.btRunClick(Sender: TObject); +begin + TestConnected; + RunThread(Self, @TThreadsFrame.Execute, @TThreadsFrame.EndExecute); +end; + +procedure TThreadsFrame.btRunMaxClick(Sender: TObject); +var + i: integer; +begin + TestConnected; + for i := 1 to MaxThread do + RunThread(Self, @TThreadsFrame.Execute, @TThreadsFrame.EndExecute); +end; + +procedure TThreadsFrame.btStartClick(Sender: TObject); +begin + TestConnected; + edCount.Text := IntToStr(MaxThread); + BegTime := Time; + TimerTimer(nil); +end; + +procedure TThreadsFrame.btStopClick(Sender: TObject); +begin + Timer.Enabled := False; +end; + +procedure TThreadsFrame.TimerTimer(Sender: TObject); +begin + if ThreadCount < MaxThread then begin + btRunClick(nil); + if ThreadCount < (MaxThread div 10) * 9 then + Dec(Interval, Interval div 10); + end + else + Inc(Interval, Interval div 10); + + lbInterval.Caption := IntToStr(Interval); + lbExceptCount.Caption := IntToStr(ExceptCount); + Timer.Interval := Random(Interval - 1) + 1; + lbTime.Caption := TimeToStr(Time - BegTime); + + lbInterval.Caption := lbInterval.Caption + ' / ' + IntToStr(Timer.Interval); + + Timer.Enabled := True; +end; + +procedure TThreadsFrame.edCountChange(Sender: TObject); +begin + MaxThread := StrToInt(edCount.Text); +end; + +procedure TThreadsFrame.btClearLogClick(Sender: TObject); +begin + meLog.Lines.Clear; + meErrorLog.Lines.Clear; + ThreadNum := 0; + ExceptCount := 0; + lbExceptCount.Caption := IntToStr(ExceptCount); +end; + +procedure TThreadsFrame.btOpenClick(Sender: TObject); +begin + MSQuery.Close; + MSQuery.Open; +end; + +procedure TThreadsFrame.rgModeClick(Sender: TObject); +begin + if rbInsert.Checked then + meSQL.Lines.Assign(dmThreadsData.MSSQL.SQL) + else + meSQL.Lines.Assign(dmThreadsData.MSQuery.SQL) +end; + +procedure TThreadsFrame.btDeleteAllClick(Sender: TObject); +begin + scDeleteAll.Execute; +// MSConnection.Commit; +end; + +procedure TThreadsFrame.Button1Click(Sender: TObject); +begin + Execute; +end; + +procedure TThreadsFrame.TestConnected; +begin + SdacForm.MSConnection.Connect; + if not SdacForm.MSConnection.Connected then + Abort; +end; + +// Demo management +procedure TThreadsFrame.Initialize; +begin + inherited; + MSQuery.Connection := Connection as TMSConnection; + dmThreadsData := TdmThreadsData.Create(Self); + edCount.Text := IntToStr(MaxThread); + rbInsert.Checked := True; +end; + +procedure TThreadsFrame.SetDebug(Value: boolean); +begin + MSQuery.Debug := Value; +end; + +initialization + + // We are using Windows threading (vs Delphi TThread), so we need to enable IsMultiThread + IsMultiThread := True; + + InitializeCriticalSection(hCountSec); + InitializeCriticalSection(hLogSec); + Randomize; +finalization + DeleteCriticalSection(hCountSec); + DeleteCriticalSection(hLogSec); +end. + diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Threads/ThreadsData.dfm b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Threads/ThreadsData.dfm new file mode 100644 index 0000000..4ba49f4 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Threads/ThreadsData.dfm @@ -0,0 +1,36 @@ +object dmThreadsData: TdmThreadsData + OldCreateOrder = False + Left = 202 + Top = 164 + Height = 477 + Width = 739 + object MSConnection: TMSConnection + Database = 'SDACDemos' + Username = 'Sa' + LoginPrompt = False + Left = 24 + Top = 8 + end + object MSQuery: TMSQuery + Connection = MSConnection + SQL.Strings = ( + 'SELECT * FROM ThreadTable') + FetchRows = 1 + Left = 88 + Top = 8 + end + object MSSQL: TMSSQL + Connection = MSConnection + SQL.Strings = ( + 'INSERT INTO ThreadTable(ID, NAME)' + 'VALUES (:ID, '#39'Some name'#39')') + CommandTimeout = 0 + Left = 144 + Top = 8 + ParamData = < + item + DataType = ftUnknown + Name = 'ID' + end> + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Threads/ThreadsData.pas b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Threads/ThreadsData.pas new file mode 100644 index 0000000..ced5b17 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/Threads/ThreadsData.pas @@ -0,0 +1,33 @@ +unit ThreadsData; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + Db, MemDS, MSAccess, DBAccess; + +type + TdmThreadsData = class(TDataModule) + MSConnection: TMSConnection; + MSQuery: TMSQuery; + MSSQL: TMSSQL; + private + { Private declarations } + public + { Public declarations } + end; + +var + dmThreadsData: TdmThreadsData; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} + +end. + diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/UpdateSQL/UpdateSQL.dfm b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/UpdateSQL/UpdateSQL.dfm new file mode 100644 index 0000000..ab3c1a3 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/UpdateSQL/UpdateSQL.dfm @@ -0,0 +1,362 @@ +inherited UpdateSQLFrame: TUpdateSQLFrame + Width = 443 + Height = 277 + Align = alClient + object Splitter1: TSplitter + Left = 0 + Top = 121 + Width = 443 + Height = 3 + Cursor = crVSplit + Align = alTop + Beveled = True + Color = clGreen + ParentColor = False + end + object Panel5: TPanel + Left = 0 + Top = 0 + Width = 443 + Height = 49 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object Panel2: TPanel + Left = 1 + Top = 1 + Width = 416 + Height = 47 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btOpen: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Open' + Flat = True + Transparent = False + OnClick = btOpenClick + end + object btClose: TSpeedButton + Left = 84 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Close' + Flat = True + Transparent = False + OnClick = btCloseClick + end + object btPrepare: TSpeedButton + Left = 167 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Prepare' + Flat = True + Transparent = False + OnClick = btPrepareClick + end + object btUnPrepare: TSpeedButton + Left = 250 + Top = 1 + Width = 82 + Height = 22 + Caption = 'UnPrepare' + Flat = True + Transparent = False + OnClick = btUnPrepareClick + end + object btExecute: TSpeedButton + Left = 333 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Execute' + Flat = True + Transparent = False + OnClick = btExecuteClick + end + object Panel4: TPanel + Left = 1 + Top = 24 + Width = 414 + Height = 22 + BevelOuter = bvNone + TabOrder = 0 + object cbDeleteObject: TCheckBox + Left = 13 + Top = 3 + Width = 91 + Height = 17 + Caption = 'DeleteObject' + Color = clBtnFace + ParentColor = False + TabOrder = 0 + OnClick = cbDeleteObjectClick + end + object cbInsertObject: TCheckBox + Left = 116 + Top = 3 + Width = 81 + Height = 17 + Caption = 'InsertObject' + Color = clBtnFace + ParentColor = False + TabOrder = 1 + OnClick = cbDeleteObjectClick + end + object cbModifyObject: TCheckBox + Left = 212 + Top = 3 + Width = 91 + Height = 17 + Caption = 'ModifyObject' + Color = clBtnFace + ParentColor = False + TabOrder = 2 + OnClick = cbDeleteObjectClick + end + object cbRefreshObject: TCheckBox + Left = 311 + Top = 3 + Width = 93 + Height = 17 + Caption = 'RefreshObject' + Color = clBtnFace + ParentColor = False + TabOrder = 3 + OnClick = cbDeleteObjectClick + end + end + end + end + object meSQL: TMemo + Left = 0 + Top = 49 + Width = 443 + Height = 72 + Align = alTop + Anchors = [] + Constraints.MinHeight = 50 + ReadOnly = True + ScrollBars = ssVertical + TabOrder = 1 + OnExit = meSQLExit + end + object Panel3: TPanel + Left = 0 + Top = 124 + Width = 443 + Height = 24 + Align = alTop + BevelOuter = bvNone + TabOrder = 2 + object Panel1: TPanel + Left = 1 + Top = 0 + Width = 315 + Height = 24 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btRefreshRecord: TSpeedButton + Left = 232 + Top = 1 + Width = 82 + Height = 22 + Caption = 'RefreshRecord' + Flat = True + Transparent = False + OnClick = btRefreshRecordClick + end + object DBNavigator1: TDBNavigator + Left = 1 + Top = 1 + Width = 230 + Height = 22 + DataSource = DataSource + Flat = True + TabOrder = 0 + end + end + end + object DBGrid: TDBGrid + Left = 0 + Top = 148 + Width = 443 + Height = 129 + Align = alClient + DataSource = DataSource + TabOrder = 3 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object MSQuery: TMSQuery + Connection = SDACForm.MSConnection + SQL.Strings = ( + 'SELECT * FROM Emp') + Debug = True + UpdateObject = MSUpdateSQL + Left = 18 + Top = 42 + end + object DataSource: TDataSource + DataSet = MSQuery + Left = 82 + Top = 42 + end + object MSUpdateSQL: TMSUpdateSQL + InsertSQL.Strings = ( + 'INSERT INTO Emp' + ' (ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO)' + 'VALUES' + ' (:ENAME, :JOB, :MGR, :HIREDATE, :SAL, :COMM, :DEPTNO)' + 'SET :EMPNO = SCOPE_IDENTITY()') + DeleteSQL.Strings = ( + 'DELETE FROM Emp' + 'WHERE' + ' EMPNO = :Old_EMPNO') + ModifySQL.Strings = ( + 'UPDATE Emp' + 'SET' + + ' ENAME = :ENAME, JOB = :JOB, MGR = :MGR, HIREDATE = :HIREDATE, ' + + 'SAL = :SAL, COMM = :COMM, DEPTNO = :DEPTNO' + 'WHERE' + ' EMPNO = :Old_EMPNO') + RefreshSQL.Strings = ( + + 'SELECT Emp.ENAME, Emp.JOB, Emp.MGR, Emp.HIREDATE, Emp.SAL, Emp.C' + + 'OMM, Emp.DEPTNO FROM Emp' + 'WHERE Emp.EMPNO = :EMPNO ') + Left = 50 + Top = 42 + end + object DeleteSQL: TMSSQL + Connection = SDACForm.MSConnection + SQL.Strings = ( + 'DELETE FROM Emp' + 'WHERE' + ' EMPNO = :Old_EMPNO') + CommandTimeout = 0 + Left = 120 + Top = 15 + ParamData = < + item + DataType = ftUnknown + Name = 'Old_EMPNO' + end> + end + object InsertSQL: TMSSQL + Connection = SDACForm.MSConnection + SQL.Strings = ( + 'INSERT INTO Emp' + ' (ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO)' + 'VALUES' + ' (:ENAME, :JOB, :MGR, :HIREDATE, :SAL, :COMM, :DEPTNO)' + 'SET :EMPNO = SCOPE_IDENTITY()') + CommandTimeout = 0 + Left = 120 + Top = 45 + ParamData = < + item + DataType = ftUnknown + Name = 'ENAME' + end + item + DataType = ftUnknown + Name = 'JOB' + end + item + DataType = ftUnknown + Name = 'MGR' + end + item + DataType = ftUnknown + Name = 'HIREDATE' + end + item + DataType = ftUnknown + Name = 'SAL' + end + item + DataType = ftUnknown + Name = 'COMM' + end + item + DataType = ftUnknown + Name = 'DEPTNO' + end + item + DataType = ftUnknown + Name = 'EMPNO' + end> + end + object ModifyQuery: TMSQuery + Connection = SDACForm.MSConnection + SQL.Strings = ( + 'UPDATE Emp' + 'SET' + + ' ENAME = :ENAME, JOB = :JOB, MGR = :MGR, HIREDATE = :HIREDATE, ' + + 'SAL = :SAL, COMM = :COMM, DEPTNO = :DEPTNO' + 'WHERE' + ' EMPNO = :Old_EMPNO') + Left = 120 + Top = 75 + ParamData = < + item + DataType = ftUnknown + Name = 'ENAME' + end + item + DataType = ftUnknown + Name = 'JOB' + end + item + DataType = ftUnknown + Name = 'MGR' + end + item + DataType = ftUnknown + Name = 'HIREDATE' + end + item + DataType = ftUnknown + Name = 'SAL' + end + item + DataType = ftUnknown + Name = 'COMM' + end + item + DataType = ftUnknown + Name = 'DEPTNO' + end + item + DataType = ftUnknown + Name = 'Old_EMPNO' + end> + end + object RefreshQuery: TMSQuery + Connection = SDACForm.MSConnection + SQL.Strings = ( + + 'SELECT Emp.ENAME, Emp.JOB, Emp.MGR, Emp.HIREDATE, Emp.SAL, Emp.C' + + 'OMM, Emp.DEPTNO FROM Emp' + 'WHERE Emp.EMPNO = :EMPNO ') + Left = 120 + Top = 110 + ParamData = < + item + DataType = ftUnknown + Name = 'EMPNO' + end> + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/UpdateSQL/UpdateSQL.pas b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/UpdateSQL/UpdateSQL.pas new file mode 100644 index 0000000..6c90805 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/UpdateSQL/UpdateSQL.pas @@ -0,0 +1,191 @@ +unit UpdateSQL; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + DBCtrls, ExtCtrls, Db, Grids, DBGrids, StdCtrls, ToolWin, + ComCtrls, MemDS, DBAccess, MSAccess, SdacVcl, + Buttons, DemoFrame, SdacDemoForm; + +type + TUpdateSQLFrame = class(TDemoFrame) + MSQuery: TMSQuery; + DataSource: TDataSource; + MSUpdateSQL: TMSUpdateSQL; + Panel5: TPanel; + Panel2: TPanel; + btOpen: TSpeedButton; + btClose: TSpeedButton; + btPrepare: TSpeedButton; + btUnPrepare: TSpeedButton; + btExecute: TSpeedButton; + meSQL: TMemo; + Splitter1: TSplitter; + Panel3: TPanel; + Panel1: TPanel; + btRefreshRecord: TSpeedButton; + DBNavigator1: TDBNavigator; + DBGrid: TDBGrid; + DeleteSQL: TMSSQL; + InsertSQL: TMSSQL; + ModifyQuery: TMSQuery; + RefreshQuery: TMSQuery; + Panel4: TPanel; + cbDeleteObject: TCheckBox; + cbInsertObject: TCheckBox; + cbModifyObject: TCheckBox; + cbRefreshObject: TCheckBox; + procedure btOpenClick(Sender: TObject); + procedure btCloseClick(Sender: TObject); + procedure btPrepareClick(Sender: TObject); + procedure btUnPrepareClick(Sender: TObject); + procedure btExecuteClick(Sender: TObject); + procedure meSQLExit(Sender: TObject); + procedure btRefreshRecordClick(Sender: TObject); + procedure cbDeleteObjectClick(Sender: TObject); + private + { Private declarations } + procedure ShowState; + procedure AssignProperties; + public + // Demo management + procedure Initialize; override; + procedure SetDebug(Value: boolean); override; + end; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} + +procedure TUpdateSQLFrame.ShowState; +var + St:string; + + procedure AddSt(S:string); + begin + if St <> '' then + St:= St + ', '; + St:= St + S; + end; + +begin + St:= ''; + + if MSQuery.Prepared then begin + AddSt('Prepared'); + + if MSQuery.IsQuery then + AddSt('IsQuery'); + end; + + if MSQuery.Active then + AddSt('Active') + else + AddSt('Inactive'); + + if MSQuery.Executing then + AddSt('Executing'); + + if MSQuery.Fetching then + AddSt('Fetching'); + + SdacForm.StatusBar.Panels[0].Text:= St; +end; + +procedure TUpdateSQLFrame.AssignProperties; +begin + if MSQuery.SQL.Text <> meSQL.Lines.Text then + MSQuery.SQL.Assign(meSQL.Lines); +end; + +procedure TUpdateSQLFrame.meSQLExit(Sender: TObject); +begin + if Trim(MSQuery.SQL.Text) <> Trim(meSQL.Lines.Text) then + MSQuery.SQL.Text:= meSQL.Lines.Text; + ShowState; +end; + +procedure TUpdateSQLFrame.btOpenClick(Sender: TObject); +begin + try + AssignProperties; + MSQuery.Open; + finally + ShowState; + end; +end; + +procedure TUpdateSQLFrame.btCloseClick(Sender: TObject); +begin + MSQuery.Close; + ShowState; +end; + +procedure TUpdateSQLFrame.btPrepareClick(Sender: TObject); +begin + try + AssignProperties; + MSQuery.Prepare; + finally + ShowState; + end; +end; + +procedure TUpdateSQLFrame.btUnPrepareClick(Sender: TObject); +begin + MSQuery.UnPrepare; + ShowState; +end; + +procedure TUpdateSQLFrame.btExecuteClick(Sender: TObject); +begin + try + AssignProperties; + MSQuery.Execute; + finally + ShowState; + end; +end; + +procedure TUpdateSQLFrame.btRefreshRecordClick(Sender: TObject); +begin + MSQuery.RefreshRecord; +end; + +// Demo management +procedure TUpdateSQLFrame.Initialize; +begin + inherited; + MSQuery.Connection := Connection as TMSConnection; + meSQL.Lines.Assign(MSQuery.SQL); + ShowState; +end; + +procedure TUpdateSQLFrame.SetDebug(Value: boolean); +begin + MSQuery.Debug:= Value; +end; + +procedure TUpdateSQLFrame.cbDeleteObjectClick(Sender: TObject); + function GetComponent(cbObject: TCheckBox; Component: TComponent): TComponent; + begin + if cbObject.Checked then + Result := Component + else + Result := nil; + end; +begin + MSUpdateSQL.DeleteObject := GetComponent(cbDeleteObject, DeleteSQL); + MSUpdateSQL.InsertObject := GetComponent(cbInsertObject, InsertSQL); + MSUpdateSQL.ModifyObject := GetComponent(cbModifyObject, ModifyQuery); + MSUpdateSQL.RefreshObject := GetComponent(cbRefreshObject, RefreshQuery); +end; + +end. + diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/VirtualTable/Data1.xml b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/VirtualTable/Data1.xml new file mode 100644 index 0000000..0da1a06 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/VirtualTable/Data1.xml @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/VirtualTable/VTable.dfm b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/VirtualTable/VTable.dfm new file mode 100644 index 0000000..2447d79 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/VirtualTable/VTable.dfm @@ -0,0 +1,565 @@ +inherited VirtualTableFrame: TVirtualTableFrame + Width = 443 + Height = 267 + Align = alClient + object Splitter: TSplitter + Left = 0 + Top = 148 + Width = 443 + Height = 3 + Cursor = crVSplit + Align = alBottom + end + object DBGrid: TDBGrid + Left = 0 + Top = 117 + Width = 443 + Height = 31 + Align = alClient + DataSource = DataSource + TabOrder = 0 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object DBMemo: TDBMemo + Left = 0 + Top = 151 + Width = 443 + Height = 116 + Align = alBottom + DataField = 'MEMO' + DataSource = DataSource + TabOrder = 1 + end + object Panel1: TPanel + Left = 0 + Top = 0 + Width = 443 + Height = 117 + Align = alTop + BevelOuter = bvNone + TabOrder = 2 + object Panel2: TPanel + Left = 1 + Top = 1 + Width = 405 + Height = 115 + BevelOuter = bvNone + Color = 9790720 + TabOrder = 0 + object btOpen: TSpeedButton + Left = 1 + Top = 1 + Width = 100 + Height = 22 + Caption = 'Open' + Flat = True + Transparent = False + OnClick = btOpenClick + end + object btClose: TSpeedButton + Left = 102 + Top = 1 + Width = 100 + Height = 22 + Caption = 'Close' + Flat = True + Transparent = False + OnClick = btCloseClick + end + object btAutoFill: TSpeedButton + Left = 203 + Top = 24 + Width = 100 + Height = 22 + Caption = 'Append 100' + Flat = True + Transparent = False + OnClick = btAutoFillClick + end + object btAddField: TSpeedButton + Left = 203 + Top = 1 + Width = 100 + Height = 22 + Caption = 'Add field' + Flat = True + Transparent = False + OnClick = btAddFieldClick + end + object btDelField: TSpeedButton + Left = 304 + Top = 1 + Width = 100 + Height = 22 + Caption = 'Delete field' + Flat = True + Transparent = False + OnClick = btDelFieldClick + end + object btClear: TSpeedButton + Left = 304 + Top = 24 + Width = 100 + Height = 22 + Caption = 'Clear' + Flat = True + Transparent = False + OnClick = btClearClick + end + object btSave: TSpeedButton + Left = 102 + Top = 24 + Width = 100 + Height = 22 + Caption = 'Save...' + Flat = True + Transparent = False + OnClick = btSaveClick + end + object btLoad: TSpeedButton + Left = 1 + Top = 24 + Width = 100 + Height = 22 + Caption = 'Load...' + Flat = True + Transparent = False + OnClick = btLoadClick + end + object Panel4: TPanel + Left = 1 + Top = 47 + Width = 152 + Height = 33 + BevelOuter = bvNone + TabOrder = 0 + object Label1: TLabel + Left = 5 + Top = 10 + Width = 22 + Height = 13 + Caption = 'Field' + end + object edField: TEdit + Left = 35 + Top = 5 + Width = 111 + Height = 21 + TabOrder = 0 + Text = 'Number' + end + end + object Panel5: TPanel + Left = 1 + Top = 81 + Width = 403 + Height = 33 + BevelOuter = bvNone + TabOrder = 2 + object Label5: TLabel + Left = 5 + Top = 10 + Width = 22 + Height = 13 + Caption = 'Filter' + end + object cbFiltered: TCheckBox + Left = 325 + Top = 7 + Width = 64 + Height = 17 + Caption = 'Filtered' + TabOrder = 1 + OnClick = cbFilteredClick + end + object edFilter: TEdit + Left = 35 + Top = 5 + Width = 267 + Height = 21 + TabOrder = 0 + OnExit = edFilterExit + end + end + object Panel6: TPanel + Left = 154 + Top = 47 + Width = 250 + Height = 33 + BevelOuter = bvNone + TabOrder = 1 + object Label2: TLabel + Left = 5 + Top = 10 + Width = 27 + Height = 13 + Caption = 'Value' + end + object edValue: TEdit + Left = 37 + Top = 5 + Width = 111 + Height = 21 + TabOrder = 0 + Text = '7' + end + object Panel7: TPanel + Left = 158 + Top = 4 + Width = 87 + Height = 24 + BevelOuter = bvNone + Color = 9790720 + TabOrder = 1 + object btLocate: TSpeedButton + Left = 1 + Top = 1 + Width = 85 + Height = 22 + Caption = 'Locate' + Flat = True + Transparent = False + OnClick = btLocateClick + end + end + end + end + end + object OpenDialog: TOpenDialog + DefaultExt = 'xml' + FileName = 'Data1' + Filter = 'Virtual Table Data (*.xml;*.vtd)|*.xml;*.vtd|All Files (*.*)|*.*' + Left = 416 + Top = 34 + end + object SaveDialog: TSaveDialog + DefaultExt = 'xml' + FileName = 'Data1' + Filter = 'XML Virtual Table Data (*.xml)|*.xml|Binary Virtual Table Data (*.vtd)|*.vtd|All Files (*.*)|*.*' + Left = 448 + Top = 34 + end + object VirtualTable: TVirtualTable + Active = True + Filter = 'String LIKE '#39'%1%'#39 + FieldDefs = < + item + Name = 'NUMBER' + DataType = ftFloat + end + item + Name = 'STRING' + DataType = ftString + Size = 50 + end + item + Name = 'DATE' + DataType = ftDateTime + end + item + Name = 'MEMO' + DataType = ftMemo + end> + Left = 416 + Top = 2 + Data = { + 0300040006004E554D42455206000000000000000600535452494E4701003200 + 000000000400444154450B0000000000000004004D454D4F1000000000000000 + 00006400000008000000000000000000F03F2B00000055736520436F7265204C + 616220446174612041636365737320436F6D706F6E656E747320212121202831 + 29080000000000C6BF58C8CC420E0000004D656D6F2076616C75652028312908 + 00000000000000000000402B00000055736520436F7265204C61622044617461 + 2041636365737320436F6D706F6E656E74732021212120283229080000000000 + C6BF58C8CC420E0000004D656D6F2076616C7565202832290800000000000000 + 000008402B00000055736520436F7265204C6162204461746120416363657373 + 20436F6D706F6E656E74732021212120283329080000000000C6BF58C8CC420E + 0000004D656D6F2076616C7565202833290800000000000000000010402B0000 + 0055736520436F7265204C616220446174612041636365737320436F6D706F6E + 656E74732021212120283429080000000000C6BF58C8CC420E0000004D656D6F + 2076616C7565202834290800000000000000000014402B00000055736520436F + 7265204C616220446174612041636365737320436F6D706F6E656E7473202121 + 2120283529080000000000C6BF58C8CC420E0000004D656D6F2076616C756520 + 2835290800000000000000000018402B00000055736520436F7265204C616220 + 446174612041636365737320436F6D706F6E656E747320212121202836290800 + 00000000C6BF58C8CC420E0000004D656D6F2076616C75652028362908000000 + 0000000000001C402B00000055736520436F7265204C61622044617461204163 + 6365737320436F6D706F6E656E74732021212120283729080000000000C6BF58 + C8CC420E0000004D656D6F2076616C7565202837290800000000000000000020 + 402B00000055736520436F7265204C616220446174612041636365737320436F + 6D706F6E656E74732021212120283829080000000000C6BF58C8CC420E000000 + 4D656D6F2076616C7565202838290800000000000000000022402B0000005573 + 6520436F7265204C616220446174612041636365737320436F6D706F6E656E74 + 732021212120283929080000000000C6BF58C8CC420E0000004D656D6F207661 + 6C7565202839290800000000000000000024402C00000055736520436F726520 + 4C616220446174612041636365737320436F6D706F6E656E7473202121212028 + 313029080000000000C6BF58C8CC420F0000004D656D6F2076616C7565202831 + 30290800000000000000000026402C00000055736520436F7265204C61622044 + 6174612041636365737320436F6D706F6E656E74732021212120283131290800 + 00000000C6BF58C8CC420F0000004D656D6F2076616C75652028313129080000 + 0000000000000028402C00000055736520436F7265204C616220446174612041 + 636365737320436F6D706F6E656E7473202121212028313229080000000000C6 + BF58C8CC420F0000004D656D6F2076616C756520283132290800000000000000 + 00002A402C00000055736520436F7265204C6162204461746120416363657373 + 20436F6D706F6E656E7473202121212028313329080000000000C6BF58C8CC42 + 0F0000004D656D6F2076616C75652028313329080000000000000000002C402C + 00000055736520436F7265204C616220446174612041636365737320436F6D70 + 6F6E656E7473202121212028313429080000000000C6BF58C8CC420F0000004D + 656D6F2076616C75652028313429080000000000000000002E402C0000005573 + 6520436F7265204C616220446174612041636365737320436F6D706F6E656E74 + 73202121212028313529080000000000C6BF58C8CC420F0000004D656D6F2076 + 616C756520283135290800000000000000000030402C00000055736520436F72 + 65204C616220446174612041636365737320436F6D706F6E656E747320212121 + 2028313629080000000000C6BF58C8CC420F0000004D656D6F2076616C756520 + 283136290800000000000000000031402C00000055736520436F7265204C6162 + 20446174612041636365737320436F6D706F6E656E7473202121212028313729 + 080000000000C6BF58C8CC420F0000004D656D6F2076616C7565202831372908 + 00000000000000000032402C00000055736520436F7265204C61622044617461 + 2041636365737320436F6D706F6E656E74732021212120283138290800000000 + 00C6BF58C8CC420F0000004D656D6F2076616C75652028313829080000000000 + 0000000033402C00000055736520436F7265204C616220446174612041636365 + 737320436F6D706F6E656E7473202121212028313929080000000000C6BF58C8 + CC420F0000004D656D6F2076616C756520283139290800000000000000000034 + 402C00000055736520436F7265204C616220446174612041636365737320436F + 6D706F6E656E7473202121212028323029080000000000C6BF58C8CC420F0000 + 004D656D6F2076616C756520283230290800000000000000000035402C000000 + 55736520436F7265204C616220446174612041636365737320436F6D706F6E65 + 6E7473202121212028323129080000000000C6BF58C8CC420F0000004D656D6F + 2076616C756520283231290800000000000000000036402C0000005573652043 + 6F7265204C616220446174612041636365737320436F6D706F6E656E74732021 + 21212028323229080000000000C6BF58C8CC420F0000004D656D6F2076616C75 + 6520283232290800000000000000000037402C00000055736520436F7265204C + 616220446174612041636365737320436F6D706F6E656E747320212121202832 + 3329080000000000C6BF58C8CC420F0000004D656D6F2076616C756520283233 + 290800000000000000000038402C00000055736520436F7265204C6162204461 + 74612041636365737320436F6D706F6E656E7473202121212028323429080000 + 000000C6BF58C8CC420F0000004D656D6F2076616C7565202832342908000000 + 00000000000039402C00000055736520436F7265204C61622044617461204163 + 6365737320436F6D706F6E656E7473202121212028323529080000000000C6BF + 58C8CC420F0000004D656D6F2076616C75652028323529080000000000000000 + 003A402C00000055736520436F7265204C616220446174612041636365737320 + 436F6D706F6E656E7473202121212028323629080000000000C6BF58C8CC420F + 0000004D656D6F2076616C75652028323629080000000000000000003B402C00 + 000055736520436F7265204C616220446174612041636365737320436F6D706F + 6E656E7473202121212028323729080000000000C6BF58C8CC420F0000004D65 + 6D6F2076616C75652028323729080000000000000000003C402C000000557365 + 20436F7265204C616220446174612041636365737320436F6D706F6E656E7473 + 202121212028323829080000000000C6BF58C8CC420F0000004D656D6F207661 + 6C75652028323829080000000000000000003D402C00000055736520436F7265 + 204C616220446174612041636365737320436F6D706F6E656E74732021212120 + 28323929080000000000C6BF58C8CC420F0000004D656D6F2076616C75652028 + 323929080000000000000000003E402C00000055736520436F7265204C616220 + 446174612041636365737320436F6D706F6E656E747320212121202833302908 + 0000000000C6BF58C8CC420F0000004D656D6F2076616C756520283330290800 + 00000000000000003F402C00000055736520436F7265204C6162204461746120 + 41636365737320436F6D706F6E656E7473202121212028333129080000000000 + C6BF58C8CC420F0000004D656D6F2076616C7565202833312908000000000000 + 00000040402C00000055736520436F7265204C61622044617461204163636573 + 7320436F6D706F6E656E7473202121212028333229080000000000C6BF58C8CC + 420F0000004D656D6F2076616C75652028333229080000000000000000804040 + 2C00000055736520436F7265204C616220446174612041636365737320436F6D + 706F6E656E7473202121212028333329080000000000C6BF58C8CC420F000000 + 4D656D6F2076616C756520283333290800000000000000000041402C00000055 + 736520436F7265204C616220446174612041636365737320436F6D706F6E656E + 7473202121212028333429080000000000C6BF58C8CC420F0000004D656D6F20 + 76616C756520283334290800000000000000008041402C00000055736520436F + 7265204C616220446174612041636365737320436F6D706F6E656E7473202121 + 212028333529080000000000C6BF58C8CC420F0000004D656D6F2076616C7565 + 20283335290800000000000000000042402C00000055736520436F7265204C61 + 6220446174612041636365737320436F6D706F6E656E74732021212120283336 + 29080000000000C6BF58C8CC420F0000004D656D6F2076616C75652028333629 + 0800000000000000008042402C00000055736520436F7265204C616220446174 + 612041636365737320436F6D706F6E656E747320212121202833372908000000 + 0000C6BF58C8CC420F0000004D656D6F2076616C756520283337290800000000 + 000000000043402C00000055736520436F7265204C6162204461746120416363 + 65737320436F6D706F6E656E7473202121212028333829080000000000C6BF58 + C8CC420F0000004D656D6F2076616C7565202833382908000000000000000080 + 43402C00000055736520436F7265204C61622044617461204163636573732043 + 6F6D706F6E656E7473202121212028333929080000000000C6BF58C8CC420F00 + 00004D656D6F2076616C756520283339290800000000000000000044402C0000 + 0055736520436F7265204C616220446174612041636365737320436F6D706F6E + 656E7473202121212028343029080000000000C6BF58C8CC420F0000004D656D + 6F2076616C756520283430290800000000000000008044402C00000055736520 + 436F7265204C616220446174612041636365737320436F6D706F6E656E747320 + 2121212028343129080000000000C6BF58C8CC420F0000004D656D6F2076616C + 756520283431290800000000000000000045402C00000055736520436F726520 + 4C616220446174612041636365737320436F6D706F6E656E7473202121212028 + 343229080000000000C6BF58C8CC420F0000004D656D6F2076616C7565202834 + 32290800000000000000008045402C00000055736520436F7265204C61622044 + 6174612041636365737320436F6D706F6E656E74732021212120283433290800 + 00000000C6BF58C8CC420F0000004D656D6F2076616C75652028343329080000 + 0000000000000046402C00000055736520436F7265204C616220446174612041 + 636365737320436F6D706F6E656E7473202121212028343429080000000000C6 + BF58C8CC420F0000004D656D6F2076616C756520283434290800000000000000 + 008046402C00000055736520436F7265204C6162204461746120416363657373 + 20436F6D706F6E656E7473202121212028343529080000000000C6BF58C8CC42 + 0F0000004D656D6F2076616C756520283435290800000000000000000047402C + 00000055736520436F7265204C616220446174612041636365737320436F6D70 + 6F6E656E7473202121212028343629080000000000C6BF58C8CC420F0000004D + 656D6F2076616C756520283436290800000000000000008047402C0000005573 + 6520436F7265204C616220446174612041636365737320436F6D706F6E656E74 + 73202121212028343729080000000000C6BF58C8CC420F0000004D656D6F2076 + 616C756520283437290800000000000000000048402C00000055736520436F72 + 65204C616220446174612041636365737320436F6D706F6E656E747320212121 + 2028343829080000000000C6BF58C8CC420F0000004D656D6F2076616C756520 + 283438290800000000000000008048402C00000055736520436F7265204C6162 + 20446174612041636365737320436F6D706F6E656E7473202121212028343929 + 080000000000C6BF58C8CC420F0000004D656D6F2076616C7565202834392908 + 00000000000000000049402C00000055736520436F7265204C61622044617461 + 2041636365737320436F6D706F6E656E74732021212120283530290800000000 + 00C6BF58C8CC420F0000004D656D6F2076616C75652028353029080000000000 + 0000008049402C00000055736520436F7265204C616220446174612041636365 + 737320436F6D706F6E656E7473202121212028353129080000000000C6BF58C8 + CC420F0000004D656D6F2076616C75652028353129080000000000000000004A + 402C00000055736520436F7265204C616220446174612041636365737320436F + 6D706F6E656E7473202121212028353229080000000000C6BF58C8CC420F0000 + 004D656D6F2076616C75652028353229080000000000000000804A402C000000 + 55736520436F7265204C616220446174612041636365737320436F6D706F6E65 + 6E7473202121212028353329080000000000C6BF58C8CC420F0000004D656D6F + 2076616C75652028353329080000000000000000004B402C0000005573652043 + 6F7265204C616220446174612041636365737320436F6D706F6E656E74732021 + 21212028353429080000000000C6BF58C8CC420F0000004D656D6F2076616C75 + 652028353429080000000000000000804B402C00000055736520436F7265204C + 616220446174612041636365737320436F6D706F6E656E747320212121202835 + 3529080000000000C6BF58C8CC420F0000004D656D6F2076616C756520283535 + 29080000000000000000004C402C00000055736520436F7265204C6162204461 + 74612041636365737320436F6D706F6E656E7473202121212028353629080000 + 000000C6BF58C8CC420F0000004D656D6F2076616C7565202835362908000000 + 0000000000804C402C00000055736520436F7265204C61622044617461204163 + 6365737320436F6D706F6E656E7473202121212028353729080000000000C6BF + 58C8CC420F0000004D656D6F2076616C75652028353729080000000000000000 + 004D402C00000055736520436F7265204C616220446174612041636365737320 + 436F6D706F6E656E7473202121212028353829080000000000C6BF58C8CC420F + 0000004D656D6F2076616C75652028353829080000000000000000804D402C00 + 000055736520436F7265204C616220446174612041636365737320436F6D706F + 6E656E7473202121212028353929080000000000C6BF58C8CC420F0000004D65 + 6D6F2076616C75652028353929080000000000000000004E402C000000557365 + 20436F7265204C616220446174612041636365737320436F6D706F6E656E7473 + 202121212028363029080000000000C6BF58C8CC420F0000004D656D6F207661 + 6C75652028363029080000000000000000804E402C00000055736520436F7265 + 204C616220446174612041636365737320436F6D706F6E656E74732021212120 + 28363129080000000000C6BF58C8CC420F0000004D656D6F2076616C75652028 + 363129080000000000000000004F402C00000055736520436F7265204C616220 + 446174612041636365737320436F6D706F6E656E747320212121202836322908 + 0000000000C6BF58C8CC420F0000004D656D6F2076616C756520283632290800 + 00000000000000804F402C00000055736520436F7265204C6162204461746120 + 41636365737320436F6D706F6E656E7473202121212028363329080000000000 + C6BF58C8CC420F0000004D656D6F2076616C7565202836332908000000000000 + 00000050402C00000055736520436F7265204C61622044617461204163636573 + 7320436F6D706F6E656E7473202121212028363429080000000000C6BF58C8CC + 420F0000004D656D6F2076616C75652028363429080000000000000000405040 + 2C00000055736520436F7265204C616220446174612041636365737320436F6D + 706F6E656E7473202121212028363529080000000000C6BF58C8CC420F000000 + 4D656D6F2076616C756520283635290800000000000000008050402C00000055 + 736520436F7265204C616220446174612041636365737320436F6D706F6E656E + 7473202121212028363629080000000000C6BF58C8CC420F0000004D656D6F20 + 76616C75652028363629080000000000000000C050402C00000055736520436F + 7265204C616220446174612041636365737320436F6D706F6E656E7473202121 + 212028363729080000000000C6BF58C8CC420F0000004D656D6F2076616C7565 + 20283637290800000000000000000051402C00000055736520436F7265204C61 + 6220446174612041636365737320436F6D706F6E656E74732021212120283638 + 29080000000000C6BF58C8CC420F0000004D656D6F2076616C75652028363829 + 0800000000000000004051402C00000055736520436F7265204C616220446174 + 612041636365737320436F6D706F6E656E747320212121202836392908000000 + 0000C6BF58C8CC420F0000004D656D6F2076616C756520283639290800000000 + 000000008051402C00000055736520436F7265204C6162204461746120416363 + 65737320436F6D706F6E656E7473202121212028373029080000000000C6BF58 + C8CC420F0000004D656D6F2076616C75652028373029080000000000000000C0 + 51402C00000055736520436F7265204C61622044617461204163636573732043 + 6F6D706F6E656E7473202121212028373129080000000000C6BF58C8CC420F00 + 00004D656D6F2076616C756520283731290800000000000000000052402C0000 + 0055736520436F7265204C616220446174612041636365737320436F6D706F6E + 656E7473202121212028373229080000000000C6BF58C8CC420F0000004D656D + 6F2076616C756520283732290800000000000000004052402C00000055736520 + 436F7265204C616220446174612041636365737320436F6D706F6E656E747320 + 2121212028373329080000000000C6BF58C8CC420F0000004D656D6F2076616C + 756520283733290800000000000000008052402C00000055736520436F726520 + 4C616220446174612041636365737320436F6D706F6E656E7473202121212028 + 373429080000000000C6BF58C8CC420F0000004D656D6F2076616C7565202837 + 3429080000000000000000C052402C00000055736520436F7265204C61622044 + 6174612041636365737320436F6D706F6E656E74732021212120283735290800 + 00000000C6BF58C8CC420F0000004D656D6F2076616C75652028373529080000 + 0000000000000053402C00000055736520436F7265204C616220446174612041 + 636365737320436F6D706F6E656E7473202121212028373629080000000000C6 + BF58C8CC420F0000004D656D6F2076616C756520283736290800000000000000 + 004053402C00000055736520436F7265204C6162204461746120416363657373 + 20436F6D706F6E656E7473202121212028373729080000000000C6BF58C8CC42 + 0F0000004D656D6F2076616C756520283737290800000000000000008053402C + 00000055736520436F7265204C616220446174612041636365737320436F6D70 + 6F6E656E7473202121212028373829080000000000C6BF58C8CC420F0000004D + 656D6F2076616C75652028373829080000000000000000C053402C0000005573 + 6520436F7265204C616220446174612041636365737320436F6D706F6E656E74 + 73202121212028373929080000000000C6BF58C8CC420F0000004D656D6F2076 + 616C756520283739290800000000000000000054402C00000055736520436F72 + 65204C616220446174612041636365737320436F6D706F6E656E747320212121 + 2028383029080000000000C6BF58C8CC420F0000004D656D6F2076616C756520 + 283830290800000000000000004054402C00000055736520436F7265204C6162 + 20446174612041636365737320436F6D706F6E656E7473202121212028383129 + 080000000000C6BF58C8CC420F0000004D656D6F2076616C7565202838312908 + 00000000000000008054402C00000055736520436F7265204C61622044617461 + 2041636365737320436F6D706F6E656E74732021212120283832290800000000 + 00C6BF58C8CC420F0000004D656D6F2076616C75652028383229080000000000 + 000000C054402C00000055736520436F7265204C616220446174612041636365 + 737320436F6D706F6E656E7473202121212028383329080000000000C6BF58C8 + CC420F0000004D656D6F2076616C756520283833290800000000000000000055 + 402C00000055736520436F7265204C616220446174612041636365737320436F + 6D706F6E656E7473202121212028383429080000000000C6BF58C8CC420F0000 + 004D656D6F2076616C756520283834290800000000000000004055402C000000 + 55736520436F7265204C616220446174612041636365737320436F6D706F6E65 + 6E7473202121212028383529080000000000C6BF58C8CC420F0000004D656D6F + 2076616C756520283835290800000000000000008055402C0000005573652043 + 6F7265204C616220446174612041636365737320436F6D706F6E656E74732021 + 21212028383629080000000000C6BF58C8CC420F0000004D656D6F2076616C75 + 652028383629080000000000000000C055402C00000055736520436F7265204C + 616220446174612041636365737320436F6D706F6E656E747320212121202838 + 3729080000000000C6BF58C8CC420F0000004D656D6F2076616C756520283837 + 290800000000000000000056402C00000055736520436F7265204C6162204461 + 74612041636365737320436F6D706F6E656E7473202121212028383829080000 + 000000C6BF58C8CC420F0000004D656D6F2076616C7565202838382908000000 + 00000000004056402C00000055736520436F7265204C61622044617461204163 + 6365737320436F6D706F6E656E7473202121212028383929080000000000C6BF + 58C8CC420F0000004D656D6F2076616C75652028383929080000000000000000 + 8056402C00000055736520436F7265204C616220446174612041636365737320 + 436F6D706F6E656E7473202121212028393029080000000000C6BF58C8CC420F + 0000004D656D6F2076616C75652028393029080000000000000000C056402C00 + 000055736520436F7265204C616220446174612041636365737320436F6D706F + 6E656E7473202121212028393129080000000000C6BF58C8CC420F0000004D65 + 6D6F2076616C756520283931290800000000000000000057402C000000557365 + 20436F7265204C616220446174612041636365737320436F6D706F6E656E7473 + 202121212028393229080000000000C6BF58C8CC420F0000004D656D6F207661 + 6C756520283932290800000000000000004057402C00000055736520436F7265 + 204C616220446174612041636365737320436F6D706F6E656E74732021212120 + 28393329080000000000C6BF58C8CC420F0000004D656D6F2076616C75652028 + 3933290800000000000000008057402C00000055736520436F7265204C616220 + 446174612041636365737320436F6D706F6E656E747320212121202839342908 + 0000000000C6BF58C8CC420F0000004D656D6F2076616C756520283934290800 + 00000000000000C057402C00000055736520436F7265204C6162204461746120 + 41636365737320436F6D706F6E656E7473202121212028393529080000000000 + C6BF58C8CC420F0000004D656D6F2076616C7565202839352908000000000000 + 00000058402C00000055736520436F7265204C61622044617461204163636573 + 7320436F6D706F6E656E7473202121212028393629080000000000C6BF58C8CC + 420F0000004D656D6F2076616C75652028393629080000000000000000405840 + 2C00000055736520436F7265204C616220446174612041636365737320436F6D + 706F6E656E7473202121212028393729080000000000C6BF58C8CC420F000000 + 4D656D6F2076616C756520283937290800000000000000008058402C00000055 + 736520436F7265204C616220446174612041636365737320436F6D706F6E656E + 7473202121212028393829080000000000C6BF58C8CC420F0000004D656D6F20 + 76616C75652028393829080000000000000000C058402C00000055736520436F + 7265204C616220446174612041636365737320436F6D706F6E656E7473202121 + 212028393929080000000000C6BF58C8CC420F0000004D656D6F2076616C7565 + 20283939290800000000000000000059402D00000055736520436F7265204C61 + 6220446174612041636365737320436F6D706F6E656E74732021212120283130 + 3029080000000000C6BF58C8CC42100000004D656D6F2076616C756520283130 + 3029} + end + object DataSource: TDataSource + DataSet = VirtualTable + OnStateChange = DataSourceStateChange + OnDataChange = DataSourceDataChange + Left = 448 + Top = 2 + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/VirtualTable/VTable.pas b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/VirtualTable/VTable.pas new file mode 100644 index 0000000..3ebbefa --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/VirtualTable/VTable.pas @@ -0,0 +1,201 @@ +unit VTable; + +interface + +uses + Classes, SysUtils, +{$IFNDEF LINUX} + Windows, Messages, Graphics, Controls, Forms, Dialogs, + DBCtrls, ExtCtrls, Grids, DBGrids, StdCtrls, ToolWin, ComCtrls, Buttons, + {$IFNDEF VER130}Variants,{$ENDIF} +{$ELSE} + QGraphics, QControls, QForms, QDialogs, QStdCtrls, + QDBCtrls, QComCtrls, QExtCtrls, QGrids, QDBGrids, QButtons, +{$ENDIF} + DB, MemDS, VirtualTable, DemoFrame, DemoForm; + +type + TVirtualTableFrame = class(TDemoFrame) + DBGrid: TDBGrid; + DBMemo: TDBMemo; + Panel1: TPanel; + Splitter: TSplitter; + OpenDialog: TOpenDialog; + SaveDialog: TSaveDialog; + VirtualTable: TVirtualTable; + DataSource: TDataSource; + Panel2: TPanel; + btOpen: TSpeedButton; + btClose: TSpeedButton; + btAutoFill: TSpeedButton; + btAddField: TSpeedButton; + btDelField: TSpeedButton; + btClear: TSpeedButton; + btSave: TSpeedButton; + btLoad: TSpeedButton; + Panel4: TPanel; + edField: TEdit; + Label1: TLabel; + Panel5: TPanel; + cbFiltered: TCheckBox; + edFilter: TEdit; + Label5: TLabel; + Panel6: TPanel; + edValue: TEdit; + Label2: TLabel; + Panel7: TPanel; + btLocate: TSpeedButton; + procedure btOpenClick(Sender: TObject); + procedure btCloseClick(Sender: TObject); + procedure btAutoFillClick(Sender: TObject); + procedure DataSourceDataChange(Sender: TObject; Field: TField); + procedure DataSourceStateChange(Sender: TObject); + procedure btAddFieldClick(Sender: TObject); + procedure btDelFieldClick(Sender: TObject); + procedure btLocateClick(Sender: TObject); + procedure edFilterExit(Sender: TObject); + procedure cbFilteredClick(Sender: TObject); + procedure btLoadClick(Sender: TObject); + procedure btSaveClick(Sender: TObject); + procedure btClearClick(Sender: TObject); + private + { Private declarations } + FFieldNo: integer; + public + procedure Initialize; override; + end; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} +{$IFDEF LINUX} +{$R *.xfm} +{$ENDIF} + +procedure TVirtualTableFrame.btOpenClick(Sender: TObject); +begin + VirtualTable.Open; + if VirtualTable.Fields.Count > 0 then + edField.Text := VirtualTable.Fields[0].FieldName + else + edField.Text := ''; +end; + +procedure TVirtualTableFrame.btCloseClick(Sender: TObject); +begin + VirtualTable.Close; +end; + +procedure TVirtualTableFrame.btAutoFillClick(Sender: TObject); +var + i:integer; + Field:TField; +begin + Field:= VirtualTable.FindField('STRING1'); + for i:= 1 to 100 do + with VirtualTable do begin + Append; + FieldByName('NUMBER').AsInteger:= i; + FieldByName('STRING').AsString:= 'Use Core Lab Data Access Components !!! (' + IntToStr(i) + ')'; + FieldByName('DATE').AsDateTime:= Date; + FieldByName('MEMO').AsString:= 'Memo value (' + IntToStr(i) + ')'; + + if Field <> nil then + FieldByName('STRING1').AsString:= 'TVirtualTable'; + + Post; + end; +end; + +procedure TVirtualTableFrame.DataSourceStateChange(Sender: TObject); +begin + (Application.MainForm as TDemoForm).StatusBar.Panels[1].Text:= 'RecordCount:' + IntToStr(VirtualTable.RecordCount); + (Application.MainForm as TDemoForm).StatusBar.Panels[2].Text:= 'RecordNo:' + IntToStr(VirtualTable.RecNo); +end; + +procedure TVirtualTableFrame.DataSourceDataChange(Sender: TObject; Field: TField); +begin + DataSourceStateChange(nil); +end; + +procedure TVirtualTableFrame.btAddFieldClick(Sender: TObject); +begin + Inc(FFieldNo); + VirtualTable.AddField('STRING' + IntToStr(FFieldNo), ftString, 30); + btDelField.Enabled := True; +end; + +procedure TVirtualTableFrame.btDelFieldClick(Sender: TObject); +begin + if FFieldNo > 0 then begin + VirtualTable.DeleteField('STRING' + IntToStr(FFieldNo)); + Dec(FFieldNo); + end; + if FFieldNo = 0 then + btDelField.Enabled := False; +end; + +procedure TVirtualTableFrame.btLocateClick(Sender: TObject); +begin + VirtualTable.Locate(edField.Text, Variant(edValue.Text), []); +end; + +procedure TVirtualTableFrame.Initialize; +begin + inherited; + edFilter.Text:= VirtualTable.Filter; + cbFiltered.Checked:= VirtualTable.Filtered; + btDelField.Enabled := False; + FFieldNo := 0; + if (Application.MainForm as TDemoForm).GetIsXPMan then begin + Panel2.Color := clBtnFace; + Panel7.Color := clBtnFace; + end + else begin + Panel2.Color := (Application.MainForm as TDemoForm).ProductColor; + Panel7.Color := Panel2.Color; + end +end; + +procedure TVirtualTableFrame.edFilterExit(Sender: TObject); +begin + VirtualTable.Filter:= edFilter.Text; +end; + +procedure TVirtualTableFrame.cbFilteredClick(Sender: TObject); +begin + try + VirtualTable.Filtered := cbFiltered.Checked; + finally + cbFiltered.Checked := VirtualTable.Filtered; + end; +end; + +procedure TVirtualTableFrame.btLoadClick(Sender: TObject); +begin + OpenDialog.InitialDir := ExtractFilePath(Application.ExeName) + 'VirtualTable'; + if OpenDialog.Execute then + VirtualTable.LoadFromFile(OpenDialog.FileName); +end; + +procedure TVirtualTableFrame.btSaveClick(Sender: TObject); +begin + SaveDialog.InitialDir := ExtractFilePath(Application.ExeName) + 'VirtualTable'; + if SaveDialog.Execute then + if LowerCase(ExtractFileExt(SaveDialog.FileName)) = '.xml' then + VirtualTable.SaveToXML(SaveDialog.FileName) + else + VirtualTable.SaveToFile(SaveDialog.FileName) +end; + +procedure TVirtualTableFrame.btClearClick(Sender: TObject); +begin + VirtualTable.Clear; +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/SdacDemo/VirtualTable/VTable.xfm b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/VirtualTable/VTable.xfm new file mode 100644 index 0000000..bd8b18b --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/SdacDemo/VirtualTable/VTable.xfm @@ -0,0 +1,581 @@ +inherited VirtualTableFrame: TVirtualTableFrame + Width = 451 + Height = 304 + VertScrollBar.Range = 236 + Align = alClient + AutoScroll = False + object Splitter: TSplitter + Left = 0 + Top = 185 + Width = 451 + Height = 3 + Cursor = crVSplit + Align = alBottom + end + object DBGrid: TDBGrid + Left = 0 + Top = 117 + Width = 451 + Height = 68 + Align = alClient + DataSource = DataSource + TabOrder = 0 + TitleFont.Color = clBlack + TitleFont.Height = 11 + TitleFont.Name = 'helvetica' + TitleFont.Pitch = fpVariable + TitleFont.Style = [] + end + object DBMemo: TDBMemo + Left = 0 + Top = 188 + Width = 451 + Height = 116 + Align = alBottom + DataField = 'MEMO' + DataSource = DataSource + TabOrder = 1 + end + object Panel1: TPanel + Left = 0 + Top = 0 + Width = 451 + Height = 117 + Align = alTop + BevelOuter = bvNone + TabOrder = 2 + object Panel2: TPanel + Left = 1 + Top = 1 + Width = 405 + Height = 115 + BevelOuter = bvNone + Color = 9790720 + ParentColor = False + TabOrder = 0 + object btOpen: TSpeedButton + Left = 1 + Top = 1 + Width = 100 + Height = 22 + Caption = 'Open' + Flat = True + Transparent = False + OnClick = btOpenClick + end + object btClose: TSpeedButton + Left = 102 + Top = 1 + Width = 100 + Height = 22 + Caption = 'Close' + Flat = True + Transparent = False + OnClick = btCloseClick + end + object btAutoFill: TSpeedButton + Left = 203 + Top = 24 + Width = 100 + Height = 22 + Caption = 'Append 100' + Flat = True + Transparent = False + OnClick = btAutoFillClick + end + object btAddField: TSpeedButton + Left = 203 + Top = 1 + Width = 100 + Height = 22 + Caption = 'Add field' + Flat = True + Transparent = False + OnClick = btAddFieldClick + end + object btDelField: TSpeedButton + Left = 304 + Top = 1 + Width = 100 + Height = 22 + Caption = 'Delete field' + Flat = True + Transparent = False + OnClick = btDelFieldClick + end + object btClear: TSpeedButton + Left = 304 + Top = 24 + Width = 100 + Height = 22 + Caption = 'Clear' + Flat = True + Transparent = False + OnClick = btClearClick + end + object btSave: TSpeedButton + Left = 102 + Top = 24 + Width = 100 + Height = 22 + Caption = 'Save...' + Flat = True + Transparent = False + OnClick = btSaveClick + end + object btLoad: TSpeedButton + Left = 1 + Top = 24 + Width = 100 + Height = 22 + Caption = 'Load...' + Flat = True + Transparent = False + OnClick = btLoadClick + end + object Panel4: TPanel + Left = 1 + Top = 47 + Width = 152 + Height = 33 + BevelOuter = bvNone + Color = clButton + ParentColor = False + TabOrder = 0 + object Label1: TLabel + Left = 5 + Top = 10 + Width = 21 + Height = 13 + Caption = 'Field' + end + object edField: TEdit + Left = 35 + Top = 5 + Width = 111 + Height = 21 + TabOrder = 0 + Text = 'Number' + end + end + object Panel5: TPanel + Left = 1 + Top = 81 + Width = 403 + Height = 33 + BevelOuter = bvNone + Color = clButton + ParentColor = False + TabOrder = 1 + object Label5: TLabel + Left = 5 + Top = 10 + Width = 23 + Height = 13 + Caption = 'Filter' + end + object cbFiltered: TCheckBox + Left = 325 + Top = 7 + Width = 64 + Height = 17 + Caption = 'Filtered' + TabOrder = 0 + OnClick = cbFilteredClick + end + object edFilter: TEdit + Left = 35 + Top = 5 + Width = 267 + Height = 21 + TabOrder = 1 + OnExit = edFilterExit + end + end + object Panel6: TPanel + Left = 154 + Top = 47 + Width = 250 + Height = 33 + BevelOuter = bvNone + Color = clButton + ParentColor = False + TabOrder = 2 + object Label2: TLabel + Left = 5 + Top = 10 + Width = 24 + Height = 13 + Caption = 'Value' + end + object edValue: TEdit + Left = 37 + Top = 5 + Width = 111 + Height = 21 + TabOrder = 0 + Text = '7' + end + object Panel7: TPanel + Left = 158 + Top = 4 + Width = 87 + Height = 24 + BevelOuter = bvNone + TabOrder = 1 + object btLocate: TSpeedButton + Left = 1 + Top = 1 + Width = 85 + Height = 22 + Caption = 'Locate' + Flat = True + Transparent = False + OnClick = btLocateClick + end + end + end + end + end + object OpenDialog: TOpenDialog + Height = 0 + Width = 0 + DefaultExt = 'xml' + FileName = 'Data1' + Filter = 'Virtual Table Data (*.xml;*.vtd)|*.xml;*.vtd|All Files (*.*)|*.*' + FilterIndex = 0 + Title = 'Open' + Left = 416 + Top = 34 + end + object SaveDialog: TSaveDialog + Height = 0 + Width = 0 + DefaultExt = 'xml' + FileName = 'Data1' + Filter = 'XML Virtual Table Data (*.xml)|*.xml|Binary Virtual Table Data (*.vtd)|*.vtd|All Files (*.*)|*.*' + FilterIndex = 0 + Title = 'Save' + Left = 448 + Top = 34 + end + object VirtualTable: TVirtualTable + Active = True + Filter = 'String LIKE '#39'%1%'#39 + FieldDefs = < + item + Name = 'NUMBER' + DataType = ftFloat + end + item + Name = 'STRING' + DataType = ftString + Size = 50 + end + item + Name = 'DATE' + DataType = ftDateTime + end + item + Name = 'MEMO' + DataType = ftMemo + end> + Left = 416 + Top = 2 + Data = { + 0300040006004E554D42455206000000000000000600535452494E4701003200 + 000000000400444154450B0000000000000004004D454D4F1000000000000000 + 00006400000008000000000000000000F03F2B00000055736520436F7265204C + 616220446174612041636365737320436F6D706F6E656E747320212121202831 + 29080000000000C6BF58C8CC420E0000004D656D6F2076616C75652028312908 + 00000000000000000000402B00000055736520436F7265204C61622044617461 + 2041636365737320436F6D706F6E656E74732021212120283229080000000000 + C6BF58C8CC420E0000004D656D6F2076616C7565202832290800000000000000 + 000008402B00000055736520436F7265204C6162204461746120416363657373 + 20436F6D706F6E656E74732021212120283329080000000000C6BF58C8CC420E + 0000004D656D6F2076616C7565202833290800000000000000000010402B0000 + 0055736520436F7265204C616220446174612041636365737320436F6D706F6E + 656E74732021212120283429080000000000C6BF58C8CC420E0000004D656D6F + 2076616C7565202834290800000000000000000014402B00000055736520436F + 7265204C616220446174612041636365737320436F6D706F6E656E7473202121 + 2120283529080000000000C6BF58C8CC420E0000004D656D6F2076616C756520 + 2835290800000000000000000018402B00000055736520436F7265204C616220 + 446174612041636365737320436F6D706F6E656E747320212121202836290800 + 00000000C6BF58C8CC420E0000004D656D6F2076616C75652028362908000000 + 0000000000001C402B00000055736520436F7265204C61622044617461204163 + 6365737320436F6D706F6E656E74732021212120283729080000000000C6BF58 + C8CC420E0000004D656D6F2076616C7565202837290800000000000000000020 + 402B00000055736520436F7265204C616220446174612041636365737320436F + 6D706F6E656E74732021212120283829080000000000C6BF58C8CC420E000000 + 4D656D6F2076616C7565202838290800000000000000000022402B0000005573 + 6520436F7265204C616220446174612041636365737320436F6D706F6E656E74 + 732021212120283929080000000000C6BF58C8CC420E0000004D656D6F207661 + 6C7565202839290800000000000000000024402C00000055736520436F726520 + 4C616220446174612041636365737320436F6D706F6E656E7473202121212028 + 313029080000000000C6BF58C8CC420F0000004D656D6F2076616C7565202831 + 30290800000000000000000026402C00000055736520436F7265204C61622044 + 6174612041636365737320436F6D706F6E656E74732021212120283131290800 + 00000000C6BF58C8CC420F0000004D656D6F2076616C75652028313129080000 + 0000000000000028402C00000055736520436F7265204C616220446174612041 + 636365737320436F6D706F6E656E7473202121212028313229080000000000C6 + BF58C8CC420F0000004D656D6F2076616C756520283132290800000000000000 + 00002A402C00000055736520436F7265204C6162204461746120416363657373 + 20436F6D706F6E656E7473202121212028313329080000000000C6BF58C8CC42 + 0F0000004D656D6F2076616C75652028313329080000000000000000002C402C + 00000055736520436F7265204C616220446174612041636365737320436F6D70 + 6F6E656E7473202121212028313429080000000000C6BF58C8CC420F0000004D + 656D6F2076616C75652028313429080000000000000000002E402C0000005573 + 6520436F7265204C616220446174612041636365737320436F6D706F6E656E74 + 73202121212028313529080000000000C6BF58C8CC420F0000004D656D6F2076 + 616C756520283135290800000000000000000030402C00000055736520436F72 + 65204C616220446174612041636365737320436F6D706F6E656E747320212121 + 2028313629080000000000C6BF58C8CC420F0000004D656D6F2076616C756520 + 283136290800000000000000000031402C00000055736520436F7265204C6162 + 20446174612041636365737320436F6D706F6E656E7473202121212028313729 + 080000000000C6BF58C8CC420F0000004D656D6F2076616C7565202831372908 + 00000000000000000032402C00000055736520436F7265204C61622044617461 + 2041636365737320436F6D706F6E656E74732021212120283138290800000000 + 00C6BF58C8CC420F0000004D656D6F2076616C75652028313829080000000000 + 0000000033402C00000055736520436F7265204C616220446174612041636365 + 737320436F6D706F6E656E7473202121212028313929080000000000C6BF58C8 + CC420F0000004D656D6F2076616C756520283139290800000000000000000034 + 402C00000055736520436F7265204C616220446174612041636365737320436F + 6D706F6E656E7473202121212028323029080000000000C6BF58C8CC420F0000 + 004D656D6F2076616C756520283230290800000000000000000035402C000000 + 55736520436F7265204C616220446174612041636365737320436F6D706F6E65 + 6E7473202121212028323129080000000000C6BF58C8CC420F0000004D656D6F + 2076616C756520283231290800000000000000000036402C0000005573652043 + 6F7265204C616220446174612041636365737320436F6D706F6E656E74732021 + 21212028323229080000000000C6BF58C8CC420F0000004D656D6F2076616C75 + 6520283232290800000000000000000037402C00000055736520436F7265204C + 616220446174612041636365737320436F6D706F6E656E747320212121202832 + 3329080000000000C6BF58C8CC420F0000004D656D6F2076616C756520283233 + 290800000000000000000038402C00000055736520436F7265204C6162204461 + 74612041636365737320436F6D706F6E656E7473202121212028323429080000 + 000000C6BF58C8CC420F0000004D656D6F2076616C7565202832342908000000 + 00000000000039402C00000055736520436F7265204C61622044617461204163 + 6365737320436F6D706F6E656E7473202121212028323529080000000000C6BF + 58C8CC420F0000004D656D6F2076616C75652028323529080000000000000000 + 003A402C00000055736520436F7265204C616220446174612041636365737320 + 436F6D706F6E656E7473202121212028323629080000000000C6BF58C8CC420F + 0000004D656D6F2076616C75652028323629080000000000000000003B402C00 + 000055736520436F7265204C616220446174612041636365737320436F6D706F + 6E656E7473202121212028323729080000000000C6BF58C8CC420F0000004D65 + 6D6F2076616C75652028323729080000000000000000003C402C000000557365 + 20436F7265204C616220446174612041636365737320436F6D706F6E656E7473 + 202121212028323829080000000000C6BF58C8CC420F0000004D656D6F207661 + 6C75652028323829080000000000000000003D402C00000055736520436F7265 + 204C616220446174612041636365737320436F6D706F6E656E74732021212120 + 28323929080000000000C6BF58C8CC420F0000004D656D6F2076616C75652028 + 323929080000000000000000003E402C00000055736520436F7265204C616220 + 446174612041636365737320436F6D706F6E656E747320212121202833302908 + 0000000000C6BF58C8CC420F0000004D656D6F2076616C756520283330290800 + 00000000000000003F402C00000055736520436F7265204C6162204461746120 + 41636365737320436F6D706F6E656E7473202121212028333129080000000000 + C6BF58C8CC420F0000004D656D6F2076616C7565202833312908000000000000 + 00000040402C00000055736520436F7265204C61622044617461204163636573 + 7320436F6D706F6E656E7473202121212028333229080000000000C6BF58C8CC + 420F0000004D656D6F2076616C75652028333229080000000000000000804040 + 2C00000055736520436F7265204C616220446174612041636365737320436F6D + 706F6E656E7473202121212028333329080000000000C6BF58C8CC420F000000 + 4D656D6F2076616C756520283333290800000000000000000041402C00000055 + 736520436F7265204C616220446174612041636365737320436F6D706F6E656E + 7473202121212028333429080000000000C6BF58C8CC420F0000004D656D6F20 + 76616C756520283334290800000000000000008041402C00000055736520436F + 7265204C616220446174612041636365737320436F6D706F6E656E7473202121 + 212028333529080000000000C6BF58C8CC420F0000004D656D6F2076616C7565 + 20283335290800000000000000000042402C00000055736520436F7265204C61 + 6220446174612041636365737320436F6D706F6E656E74732021212120283336 + 29080000000000C6BF58C8CC420F0000004D656D6F2076616C75652028333629 + 0800000000000000008042402C00000055736520436F7265204C616220446174 + 612041636365737320436F6D706F6E656E747320212121202833372908000000 + 0000C6BF58C8CC420F0000004D656D6F2076616C756520283337290800000000 + 000000000043402C00000055736520436F7265204C6162204461746120416363 + 65737320436F6D706F6E656E7473202121212028333829080000000000C6BF58 + C8CC420F0000004D656D6F2076616C7565202833382908000000000000000080 + 43402C00000055736520436F7265204C61622044617461204163636573732043 + 6F6D706F6E656E7473202121212028333929080000000000C6BF58C8CC420F00 + 00004D656D6F2076616C756520283339290800000000000000000044402C0000 + 0055736520436F7265204C616220446174612041636365737320436F6D706F6E + 656E7473202121212028343029080000000000C6BF58C8CC420F0000004D656D + 6F2076616C756520283430290800000000000000008044402C00000055736520 + 436F7265204C616220446174612041636365737320436F6D706F6E656E747320 + 2121212028343129080000000000C6BF58C8CC420F0000004D656D6F2076616C + 756520283431290800000000000000000045402C00000055736520436F726520 + 4C616220446174612041636365737320436F6D706F6E656E7473202121212028 + 343229080000000000C6BF58C8CC420F0000004D656D6F2076616C7565202834 + 32290800000000000000008045402C00000055736520436F7265204C61622044 + 6174612041636365737320436F6D706F6E656E74732021212120283433290800 + 00000000C6BF58C8CC420F0000004D656D6F2076616C75652028343329080000 + 0000000000000046402C00000055736520436F7265204C616220446174612041 + 636365737320436F6D706F6E656E7473202121212028343429080000000000C6 + BF58C8CC420F0000004D656D6F2076616C756520283434290800000000000000 + 008046402C00000055736520436F7265204C6162204461746120416363657373 + 20436F6D706F6E656E7473202121212028343529080000000000C6BF58C8CC42 + 0F0000004D656D6F2076616C756520283435290800000000000000000047402C + 00000055736520436F7265204C616220446174612041636365737320436F6D70 + 6F6E656E7473202121212028343629080000000000C6BF58C8CC420F0000004D + 656D6F2076616C756520283436290800000000000000008047402C0000005573 + 6520436F7265204C616220446174612041636365737320436F6D706F6E656E74 + 73202121212028343729080000000000C6BF58C8CC420F0000004D656D6F2076 + 616C756520283437290800000000000000000048402C00000055736520436F72 + 65204C616220446174612041636365737320436F6D706F6E656E747320212121 + 2028343829080000000000C6BF58C8CC420F0000004D656D6F2076616C756520 + 283438290800000000000000008048402C00000055736520436F7265204C6162 + 20446174612041636365737320436F6D706F6E656E7473202121212028343929 + 080000000000C6BF58C8CC420F0000004D656D6F2076616C7565202834392908 + 00000000000000000049402C00000055736520436F7265204C61622044617461 + 2041636365737320436F6D706F6E656E74732021212120283530290800000000 + 00C6BF58C8CC420F0000004D656D6F2076616C75652028353029080000000000 + 0000008049402C00000055736520436F7265204C616220446174612041636365 + 737320436F6D706F6E656E7473202121212028353129080000000000C6BF58C8 + CC420F0000004D656D6F2076616C75652028353129080000000000000000004A + 402C00000055736520436F7265204C616220446174612041636365737320436F + 6D706F6E656E7473202121212028353229080000000000C6BF58C8CC420F0000 + 004D656D6F2076616C75652028353229080000000000000000804A402C000000 + 55736520436F7265204C616220446174612041636365737320436F6D706F6E65 + 6E7473202121212028353329080000000000C6BF58C8CC420F0000004D656D6F + 2076616C75652028353329080000000000000000004B402C0000005573652043 + 6F7265204C616220446174612041636365737320436F6D706F6E656E74732021 + 21212028353429080000000000C6BF58C8CC420F0000004D656D6F2076616C75 + 652028353429080000000000000000804B402C00000055736520436F7265204C + 616220446174612041636365737320436F6D706F6E656E747320212121202835 + 3529080000000000C6BF58C8CC420F0000004D656D6F2076616C756520283535 + 29080000000000000000004C402C00000055736520436F7265204C6162204461 + 74612041636365737320436F6D706F6E656E7473202121212028353629080000 + 000000C6BF58C8CC420F0000004D656D6F2076616C7565202835362908000000 + 0000000000804C402C00000055736520436F7265204C61622044617461204163 + 6365737320436F6D706F6E656E7473202121212028353729080000000000C6BF + 58C8CC420F0000004D656D6F2076616C75652028353729080000000000000000 + 004D402C00000055736520436F7265204C616220446174612041636365737320 + 436F6D706F6E656E7473202121212028353829080000000000C6BF58C8CC420F + 0000004D656D6F2076616C75652028353829080000000000000000804D402C00 + 000055736520436F7265204C616220446174612041636365737320436F6D706F + 6E656E7473202121212028353929080000000000C6BF58C8CC420F0000004D65 + 6D6F2076616C75652028353929080000000000000000004E402C000000557365 + 20436F7265204C616220446174612041636365737320436F6D706F6E656E7473 + 202121212028363029080000000000C6BF58C8CC420F0000004D656D6F207661 + 6C75652028363029080000000000000000804E402C00000055736520436F7265 + 204C616220446174612041636365737320436F6D706F6E656E74732021212120 + 28363129080000000000C6BF58C8CC420F0000004D656D6F2076616C75652028 + 363129080000000000000000004F402C00000055736520436F7265204C616220 + 446174612041636365737320436F6D706F6E656E747320212121202836322908 + 0000000000C6BF58C8CC420F0000004D656D6F2076616C756520283632290800 + 00000000000000804F402C00000055736520436F7265204C6162204461746120 + 41636365737320436F6D706F6E656E7473202121212028363329080000000000 + C6BF58C8CC420F0000004D656D6F2076616C7565202836332908000000000000 + 00000050402C00000055736520436F7265204C61622044617461204163636573 + 7320436F6D706F6E656E7473202121212028363429080000000000C6BF58C8CC + 420F0000004D656D6F2076616C75652028363429080000000000000000405040 + 2C00000055736520436F7265204C616220446174612041636365737320436F6D + 706F6E656E7473202121212028363529080000000000C6BF58C8CC420F000000 + 4D656D6F2076616C756520283635290800000000000000008050402C00000055 + 736520436F7265204C616220446174612041636365737320436F6D706F6E656E + 7473202121212028363629080000000000C6BF58C8CC420F0000004D656D6F20 + 76616C75652028363629080000000000000000C050402C00000055736520436F + 7265204C616220446174612041636365737320436F6D706F6E656E7473202121 + 212028363729080000000000C6BF58C8CC420F0000004D656D6F2076616C7565 + 20283637290800000000000000000051402C00000055736520436F7265204C61 + 6220446174612041636365737320436F6D706F6E656E74732021212120283638 + 29080000000000C6BF58C8CC420F0000004D656D6F2076616C75652028363829 + 0800000000000000004051402C00000055736520436F7265204C616220446174 + 612041636365737320436F6D706F6E656E747320212121202836392908000000 + 0000C6BF58C8CC420F0000004D656D6F2076616C756520283639290800000000 + 000000008051402C00000055736520436F7265204C6162204461746120416363 + 65737320436F6D706F6E656E7473202121212028373029080000000000C6BF58 + C8CC420F0000004D656D6F2076616C75652028373029080000000000000000C0 + 51402C00000055736520436F7265204C61622044617461204163636573732043 + 6F6D706F6E656E7473202121212028373129080000000000C6BF58C8CC420F00 + 00004D656D6F2076616C756520283731290800000000000000000052402C0000 + 0055736520436F7265204C616220446174612041636365737320436F6D706F6E + 656E7473202121212028373229080000000000C6BF58C8CC420F0000004D656D + 6F2076616C756520283732290800000000000000004052402C00000055736520 + 436F7265204C616220446174612041636365737320436F6D706F6E656E747320 + 2121212028373329080000000000C6BF58C8CC420F0000004D656D6F2076616C + 756520283733290800000000000000008052402C00000055736520436F726520 + 4C616220446174612041636365737320436F6D706F6E656E7473202121212028 + 373429080000000000C6BF58C8CC420F0000004D656D6F2076616C7565202837 + 3429080000000000000000C052402C00000055736520436F7265204C61622044 + 6174612041636365737320436F6D706F6E656E74732021212120283735290800 + 00000000C6BF58C8CC420F0000004D656D6F2076616C75652028373529080000 + 0000000000000053402C00000055736520436F7265204C616220446174612041 + 636365737320436F6D706F6E656E7473202121212028373629080000000000C6 + BF58C8CC420F0000004D656D6F2076616C756520283736290800000000000000 + 004053402C00000055736520436F7265204C6162204461746120416363657373 + 20436F6D706F6E656E7473202121212028373729080000000000C6BF58C8CC42 + 0F0000004D656D6F2076616C756520283737290800000000000000008053402C + 00000055736520436F7265204C616220446174612041636365737320436F6D70 + 6F6E656E7473202121212028373829080000000000C6BF58C8CC420F0000004D + 656D6F2076616C75652028373829080000000000000000C053402C0000005573 + 6520436F7265204C616220446174612041636365737320436F6D706F6E656E74 + 73202121212028373929080000000000C6BF58C8CC420F0000004D656D6F2076 + 616C756520283739290800000000000000000054402C00000055736520436F72 + 65204C616220446174612041636365737320436F6D706F6E656E747320212121 + 2028383029080000000000C6BF58C8CC420F0000004D656D6F2076616C756520 + 283830290800000000000000004054402C00000055736520436F7265204C6162 + 20446174612041636365737320436F6D706F6E656E7473202121212028383129 + 080000000000C6BF58C8CC420F0000004D656D6F2076616C7565202838312908 + 00000000000000008054402C00000055736520436F7265204C61622044617461 + 2041636365737320436F6D706F6E656E74732021212120283832290800000000 + 00C6BF58C8CC420F0000004D656D6F2076616C75652028383229080000000000 + 000000C054402C00000055736520436F7265204C616220446174612041636365 + 737320436F6D706F6E656E7473202121212028383329080000000000C6BF58C8 + CC420F0000004D656D6F2076616C756520283833290800000000000000000055 + 402C00000055736520436F7265204C616220446174612041636365737320436F + 6D706F6E656E7473202121212028383429080000000000C6BF58C8CC420F0000 + 004D656D6F2076616C756520283834290800000000000000004055402C000000 + 55736520436F7265204C616220446174612041636365737320436F6D706F6E65 + 6E7473202121212028383529080000000000C6BF58C8CC420F0000004D656D6F + 2076616C756520283835290800000000000000008055402C0000005573652043 + 6F7265204C616220446174612041636365737320436F6D706F6E656E74732021 + 21212028383629080000000000C6BF58C8CC420F0000004D656D6F2076616C75 + 652028383629080000000000000000C055402C00000055736520436F7265204C + 616220446174612041636365737320436F6D706F6E656E747320212121202838 + 3729080000000000C6BF58C8CC420F0000004D656D6F2076616C756520283837 + 290800000000000000000056402C00000055736520436F7265204C6162204461 + 74612041636365737320436F6D706F6E656E7473202121212028383829080000 + 000000C6BF58C8CC420F0000004D656D6F2076616C7565202838382908000000 + 00000000004056402C00000055736520436F7265204C61622044617461204163 + 6365737320436F6D706F6E656E7473202121212028383929080000000000C6BF + 58C8CC420F0000004D656D6F2076616C75652028383929080000000000000000 + 8056402C00000055736520436F7265204C616220446174612041636365737320 + 436F6D706F6E656E7473202121212028393029080000000000C6BF58C8CC420F + 0000004D656D6F2076616C75652028393029080000000000000000C056402C00 + 000055736520436F7265204C616220446174612041636365737320436F6D706F + 6E656E7473202121212028393129080000000000C6BF58C8CC420F0000004D65 + 6D6F2076616C756520283931290800000000000000000057402C000000557365 + 20436F7265204C616220446174612041636365737320436F6D706F6E656E7473 + 202121212028393229080000000000C6BF58C8CC420F0000004D656D6F207661 + 6C756520283932290800000000000000004057402C00000055736520436F7265 + 204C616220446174612041636365737320436F6D706F6E656E74732021212120 + 28393329080000000000C6BF58C8CC420F0000004D656D6F2076616C75652028 + 3933290800000000000000008057402C00000055736520436F7265204C616220 + 446174612041636365737320436F6D706F6E656E747320212121202839342908 + 0000000000C6BF58C8CC420F0000004D656D6F2076616C756520283934290800 + 00000000000000C057402C00000055736520436F7265204C6162204461746120 + 41636365737320436F6D706F6E656E7473202121212028393529080000000000 + C6BF58C8CC420F0000004D656D6F2076616C7565202839352908000000000000 + 00000058402C00000055736520436F7265204C61622044617461204163636573 + 7320436F6D706F6E656E7473202121212028393629080000000000C6BF58C8CC + 420F0000004D656D6F2076616C75652028393629080000000000000000405840 + 2C00000055736520436F7265204C616220446174612041636365737320436F6D + 706F6E656E7473202121212028393729080000000000C6BF58C8CC420F000000 + 4D656D6F2076616C756520283937290800000000000000008058402C00000055 + 736520436F7265204C616220446174612041636365737320436F6D706F6E656E + 7473202121212028393829080000000000C6BF58C8CC420F0000004D656D6F20 + 76616C75652028393829080000000000000000C058402C00000055736520436F + 7265204C616220446174612041636365737320436F6D706F6E656E7473202121 + 212028393929080000000000C6BF58C8CC420F0000004D656D6F2076616C7565 + 20283939290800000000000000000059402D00000055736520436F7265204C61 + 6220446174612041636365737320436F6D706F6E656E74732021212120283130 + 3029080000000000C6BF58C8CC42100000004D656D6F2076616C756520283130 + 3029} + end + object DataSource: TDataSource + DataSet = VirtualTable + OnStateChange = DataSourceStateChange + OnDataChange = DataSourceDataChange + Left = 448 + Top = 2 + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/TechnologySpecific/MSSQLCompact/MSSQLCompact.bdsproj b/internal/4.10.0.10/1/Demos/Win32/TechnologySpecific/MSSQLCompact/MSSQLCompact.bdsproj new file mode 100644 index 0000000..fd9682c --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/TechnologySpecific/MSSQLCompact/MSSQLCompact.bdsproj @@ -0,0 +1,173 @@ + + + + + + + + + + + + MSSQLCompact.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 2 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + + + 0 + 0 + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + . + . + . + . + $(DELPHI)\Lib\Debug + vcl;rtl;vclx;indy;inet;xmlrtl;vclie;inetdbbde;inetdbxpress;dbrtl;dsnap;dsnapcon;vcldb;soaprtl;VclSmp;dbexpress;dbxcds;webdsnap;websnap;adortl;ibxpress;teeui;teedb;tee;vcldbx;dss;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOfficeXP;CRControls70;dac70;dacvcl70;sdacvcl70;sdac70 + + . + False + + + + + + False + + + + + + False + + + + $00000000 + D:\Program Files\Borland\Delphi7\Bin\ + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1033 + 1252 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/4.10.0.10/1/Demos/Win32/TechnologySpecific/MSSQLCompact/MSSQLCompact.cfg b/internal/4.10.0.10/1/Demos/Win32/TechnologySpecific/MSSQLCompact/MSSQLCompact.cfg new file mode 100644 index 0000000..7b4f4e1 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/TechnologySpecific/MSSQLCompact/MSSQLCompact.cfg @@ -0,0 +1,44 @@ +-$A8 +-$B- +-$C+ +-$D+ +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J- +-$K- +-$L+ +-$M- +-$N+ +-$O- +-$P+ +-$Q+ +-$R+ +-$S- +-$T- +-$U- +-$V+ +-$W+ +-$X+ +-$Y+ +-$Z1 +-cg +-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-H+ +-W+ +-M +-$M16384,1048576 +-K$00400000 +-E"." +-N"." +-LE"." +-LN"." +-U"d:\program files\borland\delphi7\Lib\Debug" +-O"d:\program files\borland\delphi7\Lib\Debug" +-I"d:\program files\borland\delphi7\Lib\Debug" +-R"d:\program files\borland\delphi7\Lib\Debug" +-w-UNSAFE_TYPE +-w-UNSAFE_CODE +-w-UNSAFE_CAST diff --git a/internal/4.10.0.10/1/Demos/Win32/TechnologySpecific/MSSQLCompact/MSSQLCompact.dpr b/internal/4.10.0.10/1/Demos/Win32/TechnologySpecific/MSSQLCompact/MSSQLCompact.dpr new file mode 100644 index 0000000..cb5ff0a --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/TechnologySpecific/MSSQLCompact/MSSQLCompact.dpr @@ -0,0 +1,13 @@ +program MSSQLCompact; + +uses + Forms, + Main in 'Main.pas' {fmMain}; + +{$R *.res} + +begin + Application.Initialize; + Application.CreateForm(TfmMain, fmMain); + Application.Run; +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/TechnologySpecific/MSSQLCompact/MSSQLCompact.res b/internal/4.10.0.10/1/Demos/Win32/TechnologySpecific/MSSQLCompact/MSSQLCompact.res new file mode 100644 index 0000000..3adc036 Binary files /dev/null and b/internal/4.10.0.10/1/Demos/Win32/TechnologySpecific/MSSQLCompact/MSSQLCompact.res differ diff --git a/internal/4.10.0.10/1/Demos/Win32/TechnologySpecific/MSSQLCompact/MSSQLCompact_VclNet.bdsproj b/internal/4.10.0.10/1/Demos/Win32/TechnologySpecific/MSSQLCompact/MSSQLCompact_VclNet.bdsproj new file mode 100644 index 0000000..91f1b01 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/TechnologySpecific/MSSQLCompact/MSSQLCompact_VclNet.bdsproj @@ -0,0 +1,183 @@ + + + + + + + + + + + + MSSQLCompact_VclNet.dpr + + + + + + + + 7.0 + + + 0 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + Borland.Vcl + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + + + 0 + 0 + 1 + True + False + False + 4096 + 1048576 + 4194304 + + + + + + + + d:\windows\microsoft.net\framework\v1.1.4322 + d:\windows\microsoft.net\framework\v1.1.4322\System.Drawing.dll + + + True + + + + + + False + + + + + + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1033 + 1252 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + + + + + + diff --git a/internal/4.10.0.10/1/Demos/Win32/TechnologySpecific/MSSQLCompact/MSSQLCompact_VclNet.dpr b/internal/4.10.0.10/1/Demos/Win32/TechnologySpecific/MSSQLCompact/MSSQLCompact_VclNet.dpr new file mode 100644 index 0000000..a602fe9 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/TechnologySpecific/MSSQLCompact/MSSQLCompact_VclNet.dpr @@ -0,0 +1,15 @@ +program MSSQLCompact_VclNet; + +{%DelphiDotNetAssemblyCompiler '$(SystemRoot)\microsoft.net\framework\v1.1.4322\system.drawing.dll'} + +uses + Forms, + Main in 'Main.pas' {fmMain}; + +{$R *.res} + +begin + Application.Initialize; + Application.CreateForm(TfmMain, fmMain); + Application.Run; +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/TechnologySpecific/MSSQLCompact/MSSQLCompact_VclNet.res b/internal/4.10.0.10/1/Demos/Win32/TechnologySpecific/MSSQLCompact/MSSQLCompact_VclNet.res new file mode 100644 index 0000000..3adc036 Binary files /dev/null and b/internal/4.10.0.10/1/Demos/Win32/TechnologySpecific/MSSQLCompact/MSSQLCompact_VclNet.res differ diff --git a/internal/4.10.0.10/1/Demos/Win32/TechnologySpecific/MSSQLCompact/Main.dfm b/internal/4.10.0.10/1/Demos/Win32/TechnologySpecific/MSSQLCompact/Main.dfm new file mode 100644 index 0000000..0dca79a --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/TechnologySpecific/MSSQLCompact/Main.dfm @@ -0,0 +1,353 @@ +object fmMain: TfmMain + Left = 213 + Top = 374 + Width = 975 + Height = 417 + Caption = + 'MSSQL Data Access Demo - using Compact Edition of the MS SQL Ser' + + 'ver' + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + OnClose = FormClose + OnCreate = FormCreate + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 13 + object DBGrid: TDBGrid + Left = 0 + Top = 49 + Width = 967 + Height = 315 + Align = alClient + DataSource = DataSource + TabOrder = 1 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object ToolBar: TPanel + Left = 0 + Top = 0 + Width = 967 + Height = 49 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object Panel1: TPanel + Left = 1 + Top = 1 + Width = 700 + Height = 47 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btOpen: TSpeedButton + Left = 1 + Top = 24 + Width = 82 + Height = 22 + Caption = 'Open' + Enabled = False + Flat = True + Transparent = False + OnClick = btOpenClick + end + object btClose: TSpeedButton + Left = 84 + Top = 24 + Width = 82 + Height = 22 + Caption = 'Close' + Enabled = False + Flat = True + Transparent = False + OnClick = btCloseClick + end + object btDisconnect: TSpeedButton + Left = 84 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Disconnect' + Enabled = False + Flat = True + Transparent = False + OnClick = btDisconnectClick + end + object btConnect: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Connect' + Flat = True + Transparent = False + OnClick = btConnectClick + end + object DBNavigator: TDBNavigator + Left = 469 + Top = 24 + Width = 230 + Height = 22 + DataSource = DataSource + Flat = True + TabOrder = 0 + end + object Panel2: TPanel + Left = 167 + Top = 1 + Width = 532 + Height = 22 + BevelOuter = bvNone + TabOrder = 1 + object Label1: TLabel + Left = 6 + Top = 4 + Width = 78 + Height = 13 + Caption = 'Database name:' + end + object SpeedButton2: TSpeedButton + Left = 511 + Top = 0 + Width = 22 + Height = 22 + Caption = '...' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + Transparent = False + OnClick = SpeedButton2Click + end + object edDBName: TEdit + Left = 88 + Top = 1 + Width = 423 + Height = 21 + TabOrder = 0 + Text = '.\test.sdf' + end + end + object pnTableName: TPanel + Left = 167 + Top = 24 + Width = 301 + Height = 22 + BevelOuter = bvNone + TabOrder = 2 + object lbTableName: TLabel + Left = 6 + Top = 4 + Width = 59 + Height = 13 + Caption = 'Table name:' + Enabled = False + end + object cbTableName: TComboBox + Left = 88 + Top = 1 + Width = 211 + Height = 21 + Enabled = False + ItemHeight = 13 + TabOrder = 0 + OnDropDown = cbTableNameDropDown + end + end + end + object Panel3: TPanel + Left = 705 + Top = 0 + Width = 257 + Height = 24 + BevelOuter = bvNone + Color = clGreen + TabOrder = 1 + object btDrop: TSpeedButton + Left = 84 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Drop' + Flat = True + Transparent = False + OnClick = btDropClick + end + object btCreate: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Create' + Flat = True + Transparent = False + OnClick = btCreateClick + end + object Panel4: TPanel + Left = 167 + Top = 1 + Width = 89 + Height = 22 + BevelOuter = bvNone + TabOrder = 0 + object cbDebug: TCheckBox + Left = 13 + Top = 3 + Width = 67 + Height = 17 + Caption = 'Debug' + Checked = True + State = cbChecked + TabOrder = 0 + OnClick = cbDebugClick + end + end + end + end + object StatusBar: TStatusBar + Left = 0 + Top = 364 + Width = 967 + Height = 19 + Panels = < + item + Text = 'State' + Width = 50 + end> + SimplePanel = False + end + object DataSource: TDataSource + DataSet = MSTable + Left = 320 + Top = 144 + end + object MSTable: TMSTable + TableName = 'EMP' + Connection = MSConnection + Debug = True + Left = 288 + Top = 144 + end + object scCreate: TMSScript + SQL.Strings = ( + 'CREATE TABLE EMP (' + ' EMPNO INT PRIMARY KEY,' + ' ENAME NVARCHAR(10),' + ' JOB NVARCHAR(9),' + ' MGR INT,' + ' HIREDATE DATETIME,' + ' SAL FLOAT,' + ' COMM FLOAT' + ');' + '' + '' + 'INSERT INTO EMP' + ' (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM)' + 'VALUES ' + ' (7492, '#39'SMITH'#39','#39'CLERK'#39',7902,'#39'1980-12-17'#39',800,600);' + '' + 'INSERT INTO EMP' + ' (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM)' + 'VALUES ' + ' (7499,'#39'ALLEN'#39','#39'SALESMAN'#39',7698,'#39'1981-2-20'#39',1600,300);' + '' + 'INSERT INTO EMP' + ' (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM)' + 'VALUES ' + ' (7521,'#39'WARD'#39','#39'SALESMAN'#39',7698,'#39'1981-2-22'#39',1250,500);' + '' + 'INSERT INTO EMP' + ' (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM)' + 'VALUES ' + ' (7566,'#39'JONES'#39','#39'MANAGER'#39',7839,'#39'1981-4-2'#39',2975,NULL);' + '' + 'INSERT INTO EMP' + ' (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM)' + 'VALUES ' + ' (7654,'#39'MARTIN'#39','#39'SALESMAN'#39',7698,'#39'1981-9-28'#39',1250,1400);' + '' + 'INSERT INTO EMP' + ' (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM)' + 'VALUES ' + ' (7698,'#39'BLAKE'#39','#39'MANAGER'#39',7839,'#39'1981-5-1'#39',2850,NULL);' + '' + 'INSERT INTO EMP' + ' (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM)' + 'VALUES ' + ' (7782,'#39'CLARK'#39','#39'MANAGER'#39',7839,'#39'1981-6-9'#39',2450,NULL);' + '' + 'INSERT INTO EMP' + ' (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM)' + 'VALUES ' + ' (7788,'#39'SCOTT'#39','#39'ANALYST'#39',7566,'#39'1987-7-13'#39',3000,NULL);' + '' + 'INSERT INTO EMP' + ' (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM)' + 'VALUES ' + ' (7839,'#39'KING'#39','#39'PRESIDENT'#39',NULL,'#39'1981-11-17'#39',5000,NULL);' + '' + 'INSERT INTO EMP' + ' (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM)' + 'VALUES ' + ' (7844,'#39'TURNER'#39','#39'SALESMAN'#39',7698,'#39'1981-9-8'#39',1500,0);' + '' + 'INSERT INTO EMP' + ' (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM)' + 'VALUES ' + ' (7876,'#39'ADAMS'#39','#39'CLERK'#39',7788,'#39'1987-7-13'#39',1100,NULL);' + '' + 'INSERT INTO EMP' + ' (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM)' + 'VALUES ' + ' (7900,'#39'JAMES'#39','#39'CLERK'#39',7698,'#39'1981-12-3'#39',950,NULL);' + '' + 'INSERT INTO EMP' + ' (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM)' + 'VALUES ' + ' (7902,'#39'FORD'#39','#39'ANALYST'#39',7566,'#39'1981-12-3'#39',3000,NULL);' + '' + 'INSERT INTO EMP' + ' (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM)' + 'VALUES ' + ' (7934,'#39'MILLER'#39','#39'CLERK'#39',7782,'#39'1982-1-23'#39',1300,NULL);') + Debug = True + OnError = scError + Connection = MSConnection + Left = 735 + Top = 59 + end + object OpenDialog: TOpenDialog + Filter = 'MS SQL Database Files (*.sdf)|*.sdf|All Files|*.*' + Options = [ofHideReadOnly, ofPathMustExist, ofEnableSizing] + Left = 130 + Top = 145 + end + object MSConnection: TMSConnection + Options.Provider = prCompact + AfterConnect = MSConnectionAfterConnect + AfterDisconnect = MSConnectionAfterDisconnect + Left = 210 + Top = 145 + end + object scDrop: TMSScript + SQL.Strings = ( + 'DROP TABLE EMP;') + Debug = True + OnError = scError + Connection = MSConnection + Left = 805 + Top = 59 + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/TechnologySpecific/MSSQLCompact/Main.pas b/internal/4.10.0.10/1/Demos/Win32/TechnologySpecific/MSSQLCompact/Main.pas new file mode 100644 index 0000000..bb239af --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/TechnologySpecific/MSSQLCompact/Main.pas @@ -0,0 +1,268 @@ +unit Main; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + DBCtrls, ExtCtrls, Grids, DBGrids, StdCtrls, ToolWin, ComCtrls, + DBAccess, DAScript, Buttons, MSAccess, MSScript, OLEDBAccess, DB, MemDS, SDACVcl; + +type + TfmMain = class(TForm) + DBGrid: TDBGrid; + DataSource: TDataSource; + ToolBar: TPanel; + StatusBar: TStatusBar; + MSTable: TMSTable; + scCreate: TMSScript; + Panel1: TPanel; + btOpen: TSpeedButton; + btClose: TSpeedButton; + DBNavigator: TDBNavigator; + OpenDialog: TOpenDialog; + MSConnection: TMSConnection; + btDisconnect: TSpeedButton; + btConnect: TSpeedButton; + Panel2: TPanel; + edDBName: TEdit; + Label1: TLabel; + pnTableName: TPanel; + lbTableName: TLabel; + cbTableName: TComboBox; + SpeedButton2: TSpeedButton; + Panel3: TPanel; + Panel4: TPanel; + btDrop: TSpeedButton; + btCreate: TSpeedButton; + cbDebug: TCheckBox; + scDrop: TMSScript; + procedure btOpenClick(Sender: TObject); + procedure btCloseClick(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure MSConnectionAfterConnect(Sender: TObject); + procedure MSConnectionAfterDisconnect(Sender: TObject); + procedure btConnectClick(Sender: TObject); + procedure SpeedButton2Click(Sender: TObject); + procedure btDisconnectClick(Sender: TObject); + procedure btCreateClick(Sender: TObject); + procedure btDropClick(Sender: TObject); + procedure cbDebugClick(Sender: TObject); + procedure FormCreate(Sender: TObject); + procedure cbTableNameDropDown(Sender: TObject); + procedure scError(Sender: TObject; E: Exception; SQL: String; + var Action: TErrorAction); + procedure FormClose(Sender: TObject; var Action: TCloseAction); + private + Closing: boolean; + procedure ShowState; + procedure CheckConnected; + public + { Public declarations } + end; + +var + fmMain: TfmMain; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} +{$IFDEF LINUX} +{$R *.xfm} +{$ENDIF} + +{$IFNDEF VER130} +{$IFNDEF VER140} +{$IFNDEF CLR} + {$DEFINE XPMAN} + {$R WindowsXP.res} +{$ENDIF} +{$ENDIF} +{$ENDIF} + +{$IFDEF XPMAN} +uses + UxTheme; +{$ENDIF} + +procedure TfmMain.ShowState; +var + St:string; + + procedure AddSt(S:string); + begin + if St <> '' then + St:= St + ', '; + St:= St + S; + end; + +begin + St:= ''; + + if MSTable.Active then + AddSt('Active') + else + AddSt('Inactive'); + + StatusBar.Panels[0].Text:= St; +end; + +procedure TfmMain.CheckConnected; +begin + try + MSConnection.Database := edDBName.Text; + + if not FileExists(MSConnection.Database) then + if MessageDlg('Database file ' + MSConnection.Database + ' does not exists.' + + #13#10+'Create database with this name?', mtConfirmation, [mbYes,mbNo,mbCancel], 0) <> mrYes then + Exit; + + MSConnection.Open; // database file will be created automatically if it does not exist + finally + ShowState; + end; +end; + +procedure TfmMain.btOpenClick(Sender: TObject); +begin + try + MSTable.TableName := cbTableName.Text; + MSTable.Open; + finally + ShowState; + end; +end; + +procedure TfmMain.btCloseClick(Sender: TObject); +begin + MSTable.Close; + ShowState; +end; + +procedure TfmMain.FormShow(Sender: TObject); +begin + ShowState; +end; + +procedure TfmMain.MSConnectionAfterConnect(Sender: TObject); +begin + btConnect.Enabled := False; + btDisconnect.Enabled := True; + cbTableName.Enabled := True; + lbTableName.Enabled := True; + btOpen.Enabled := True; + btClose.Enabled := True; + MSConnection.GetTableNames(cbTableName.Items); + + if cbTableName.Items.Count > 0 then + cbTableName.ItemIndex := 0; +end; + +procedure TfmMain.MSConnectionAfterDisconnect(Sender: TObject); +begin + if Closing then // to prevent AV on form close + Exit; + + btConnect.Enabled := True; + btDisconnect.Enabled := False; + cbTableName.Enabled := False; + lbTableName.Enabled := False; + btOpen.Enabled := False; + btClose.Enabled := False; +end; + +procedure TfmMain.btConnectClick(Sender: TObject); +begin + CheckConnected; +end; + +procedure TfmMain.SpeedButton2Click(Sender: TObject); +begin + if OpenDialog.Execute then + edDBName.Text := OpenDialog.FileName; +end; + +procedure TfmMain.btDisconnectClick(Sender: TObject); +begin + MSConnection.Close; +end; + +procedure TfmMain.btCreateClick(Sender: TObject); +begin + CheckConnected; + scCreate.Execute; +end; + +procedure TfmMain.btDropClick(Sender: TObject); +begin + CheckConnected; + scDrop.Execute; +end; + +procedure TfmMain.cbDebugClick(Sender: TObject); +begin + MSTable.Debug := cbDebug.Checked; + scCreate.Debug := cbDebug.Checked; + scDrop.Debug := cbDebug.Checked; +end; + +procedure TfmMain.FormCreate(Sender: TObject); +{$IFDEF XPMAN} + procedure UpdateStyle(Control: TWinControl); + var + Panel: TPanel; + i: integer; + begin + for i := 0 to Control.ControlCount - 1 do begin + if Control.Controls[i] is TSpeedButton then + TSpeedButton(Control.Controls[i]).Flat := False + else + if Control.Controls[i] is TDBNavigator then + TDBNavigator(Control.Controls[i]).Flat := False; + if Control.Controls[i] is TWinControl then begin + if (Control.Controls[i] is TPanel) then begin + Panel := TPanel(Control.Controls[i]); + Panel.ParentBackground := False; + Panel.Color := clBtnFace; + end; + UpdateStyle(TWinControl(Control.Controls[i])); + end; + end; + end; +{$ENDIF} +begin + cbDebugClick(self); + Closing := False; +{$IFDEF XPMAN} + if UseThemes then + UpdateStyle(Self); +{$ENDIF} +end; + +procedure TfmMain.cbTableNameDropDown(Sender: TObject); +begin + MSConnection.GetTableNames(cbTableName.Items); +end; + +procedure TfmMain.scError(Sender: TObject; E: Exception; SQL: String; + var Action: TErrorAction); +begin + if MessageDlg('An error with the following message ocurred:' + #13#10 + + E.Message , mtError, [mbAbort,mbIgnore], 0) = mrAbort then + Action := eaAbort + else + Action := eaContinue; + +end; + +procedure TfmMain.FormClose(Sender: TObject; var Action: TCloseAction); +begin + Closing := True; +end; + +end. + diff --git a/internal/4.10.0.10/1/Demos/Win32/TechnologySpecific/MSSQLCompact/ReadMe.txt b/internal/4.10.0.10/1/Demos/Win32/TechnologySpecific/MSSQLCompact/ReadMe.txt new file mode 100644 index 0000000..d060c63 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/TechnologySpecific/MSSQLCompact/ReadMe.txt @@ -0,0 +1,7 @@ +SQL Server Data Access Components +Copyright 1997-2007, Core Lab. All Rights Reserved +-------------------------------------------------- + +Demonstrates how to create applications that work with MS SQL Server +Compact Edition. Demo connects to a database and opens a table. If the +specified database does not exists, it will be created automatically. \ No newline at end of file diff --git a/internal/4.10.0.10/1/Demos/Win32/TechnologySpecific/MSSQLCompact/test.sdf b/internal/4.10.0.10/1/Demos/Win32/TechnologySpecific/MSSQLCompact/test.sdf new file mode 100644 index 0000000..bc4229a Binary files /dev/null and b/internal/4.10.0.10/1/Demos/Win32/TechnologySpecific/MSSQLCompact/test.sdf differ diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/Demo/FRDemo.dpr b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/Demo/FRDemo.dpr new file mode 100644 index 0000000..86680b9 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/Demo/FRDemo.dpr @@ -0,0 +1,15 @@ +program FRDemo; + +uses + Forms, + Unit1 in 'Unit1.pas' {Form1}, + Unit2 in 'Unit2.pas' {ReportData: TDataModule}; + +{$R *.RES} + +begin + Application.Initialize; + Application.CreateForm(TForm1, Form1); + Application.CreateForm(TReportData, ReportData); + Application.Run; +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/Demo/FRDemo.res b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/Demo/FRDemo.res new file mode 100644 index 0000000..06b79d7 Binary files /dev/null and b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/Demo/FRDemo.res differ diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/Demo/Unit1.dfm b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/Demo/Unit1.dfm new file mode 100644 index 0000000..bf2ccf0 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/Demo/Unit1.dfm @@ -0,0 +1,832 @@ +object Form1: TForm1 + Left = 191 + Top = 107 + BorderStyle = bsDialog + Caption = 'FastReport 3.0 Demo' + ClientHeight = 339 + ClientWidth = 431 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 13 + object Image1: TImage + Left = 180 + Top = 12 + Width = 62 + Height = 62 + AutoSize = True + Picture.Data = { + 07544269746D6170B6130000424DB61300000000000036040000280000003E00 + 00003E0000000100080000000000800F00000000000000000000000100000001 + 000000000000000080000080000000808000800000008000800080800000C0C0 + C000C0DCC000F0CAA6000020400000206000002080000020A0000020C0000020 + E00000400000004020000040400000406000004080000040A0000040C0000040 + E00000600000006020000060400000606000006080000060A0000060C0000060 + E00000800000008020000080400000806000008080000080A0000080C0000080 + E00000A0000000A0200000A0400000A0600000A0800000A0A00000A0C00000A0 + E00000C0000000C0200000C0400000C0600000C0800000C0A00000C0C00000C0 + E00000E0000000E0200000E0400000E0600000E0800000E0A00000E0C00000E0 + E00040000000400020004000400040006000400080004000A0004000C0004000 + E00040200000402020004020400040206000402080004020A0004020C0004020 + E00040400000404020004040400040406000404080004040A0004040C0004040 + E00040600000406020004060400040606000406080004060A0004060C0004060 + E00040800000408020004080400040806000408080004080A0004080C0004080 + E00040A0000040A0200040A0400040A0600040A0800040A0A00040A0C00040A0 + E00040C0000040C0200040C0400040C0600040C0800040C0A00040C0C00040C0 + E00040E0000040E0200040E0400040E0600040E0800040E0A00040E0C00040E0 + E00080000000800020008000400080006000800080008000A0008000C0008000 + E00080200000802020008020400080206000802080008020A0008020C0008020 + E00080400000804020008040400080406000804080008040A0008040C0008040 + E00080600000806020008060400080606000806080008060A0008060C0008060 + E00080800000808020008080400080806000808080008080A0008080C0008080 + E00080A0000080A0200080A0400080A0600080A0800080A0A00080A0C00080A0 + E00080C0000080C0200080C0400080C0600080C0800080C0A00080C0C00080C0 + E00080E0000080E0200080E0400080E0600080E0800080E0A00080E0C00080E0 + E000C0000000C0002000C0004000C0006000C0008000C000A000C000C000C000 + E000C0200000C0202000C0204000C0206000C0208000C020A000C020C000C020 + E000C0400000C0402000C0404000C0406000C0408000C040A000C040C000C040 + E000C0600000C0602000C0604000C0606000C0608000C060A000C060C000C060 + E000C0800000C0802000C0804000C0806000C0808000C080A000C080C000C080 + E000C0A00000C0A02000C0A04000C0A06000C0A08000C0A0A000C0A0C000C0A0 + E000C0C00000C0C02000C0C04000C0C06000C0C08000C0C0A000F0FBFF00A4A0 + A000808080000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00FF0707070707070707070707070707070707070707070707070707070707 + 07070707070707070707070707070707070707070707070707070707070707FF + 000007E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0 + E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E007 + 000007E0A4070707070707070707070707070707070707070707070707070707 + 0707070707070707070707070707070707070707070707070707070707A4E007 + 000007E007FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFF07A4A4A4A40707FFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFF07E0E0E0E0E0E0E0E0A407FFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFF07E0E0E0E0E0E0E0E0E0E0E0FFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFF07E0E0E0E0E0E0E0E0E0E0E0E0A4FFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFF07E0E0E0E0E0E0E0E0E0E0E0E0E0E0FFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFFFFFFFFFA4A4A4A4A4A407FFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFA4E0E0E0E0E0E0E0E0E0E0E0E0E0E0A4FFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFFFFF00000000000000000000A4FFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFE0E0E0E0E0E0E0E0E0E0E0E0E0E0E0A4FFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFFFA40000000000000000000000FFFFFFFFFFFFFFFF + FFFFFFFFFFFFE0E0E0E0E0E0E0E0E0E0E0E0E0E0E0A4FFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFF0700000000000000000000000000FFFFFFFFFFFFFF + FFFFFFFFFFE0E0E0E0E0E0E0E0E0E0E0E0E0E0E0A4FFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA400000000000000000000000000FFFFFFFFFFFFFF + FFFFFFFFE0E0E0E0E0E0E0E0E0E0E0E0E0E0E0A4FFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA400000000000000000000000000FFFFFFFFFFFFFF + FFFFFFE0E0E0E0E0E0E0E0E0E0E0E0E0E0E0A4FFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA400000000000000000000000000FFFFFFFFFFFFFF + FFFFE0E0E0E0E0E0E0E0E0E0E0E0E0E0E0A4FFFFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA400000000000000000000000000FFFFFFFFFFFFFF + FFE0E0E0E0E0E0E0E0E0E0E0E0E0E0E0A4FFFFFFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA400000000000000000000000000FFFFFF07070707 + E0E0E0E0E0E0E0E0E0E0E0E0E0E0E007FFFFFFFFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA400000000000000000000000000FFFF07E0E0E0E0 + E0E0E0E0E0E0E0E0E0E0E0E0E0E007FFFFFFFFFFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA400000000000000000000000000FF07E0E0E0E0E0 + E0E0E0E0E0E0E0E0E0E0E0E0E007FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA400000000000000000000000000FF07E0E0E0E0E0 + E0E0E0E0E0E0E0E0E0E0E0E0E0A407FFFFFFFFFFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA400000000000000000000000000FF07E0E0E0E0E0 + E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0A407FFFFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA400000000000000000000000000FF07E0E0E0E0E0 + E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0A4FFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA400000000000000000000000000FFFF07E0E0E0E0 + E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0FFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA400000000000000000000000000A4FFFF07070707 + 0707070707E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0A4FFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA40000000000000000000000000000A4A4A4A4A4A4 + A4A4A4A407FFFFE0E0E0E0E0E0E0E0E0E0E0E0E0E0A4FFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA40000000000000000000000000000000000000000 + 000000000000FFFFE0E0E0E0E0E0E0E0E0E0E0E0E0E007FFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA40000000000000000000000000000000000000000 + 00000000000000FFFFE0E0E0E0E0E0E0E0E0E0E0E0E0A4FFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA40000000000000000000000000000000000000000 + 0000000000000000FF07E0E0E0E0E0E0E0E0E0E0E0E0E007FFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA40000000000000000000000000000000000000000 + 0000000000000000FF07E0E0E0E0E0E0E0E0E0E0E0E0E007FFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA40000000000000000000000000000000000000000 + 0000000000000000FF07E0E0E0E0E0E0E0E0E0E0E0E0E0A4FFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA40000000000000000000000000000000000000000 + 0000000000000000FF07E0E0E0E0E0E0E0E0E0E0E0E0E0A4FFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA40000000000000000000000000000000000000000 + 000000000000A4FFFFE0E0E0E0E0E0E0E0E0E0E0E0E0E007FFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA40000000000000000000000000000000000000000 + 00000000A407FFFFA4E0E0E0E0E0E0E0E0E0E0E0E0E0E007FFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA400000000000000000000000000A407FFFFFFFFFF + FFFFFFFFFFA4A4E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0A4FFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA40000000000000000000000000007FFFFE0E0E0E0 + E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E007FFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA400000000000000000000000000FFFFE0E0E0E0E0 + E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0A4FFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA400000000000000000000000000FF07E0E0E0E0E0 + E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0A4FFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA400000000000000000000000000FF07E0E0E0E0E0 + E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E007FFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA400000000000000000000000000FF07E0E0E0E0E0 + E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0A4FFFFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA400000000000000000000000000FF07E0E0E0E0E0 + E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0A407FFFFFFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA400000000000000000000000000A4FFFFA4E0E0E0 + E0E0E0E0E0E0E0A4A4A4A4070707FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA400000000000000000000000000000007FFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFFF0000000000000000000000000000000000A4A4A4 + A4A4A4A4A4A4A4A4A4A4A4FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFFF0000000000000000000000000000000000000000 + 0000000000000000000000A4FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFFFA400000000000000000000000000000000000000 + 00000000000000000000000007FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFFFFF00000000000000000000000000000000000000 + 000000000000000000000000A4FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFFFFF07000000000000000000000000000000000000 + 000000000000000000000000A4FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFFFFFFF070000000000000000000000000000000000 + 00000000000000000000000007FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFFFFFFFFF0700000000000000000000000000000000 + 000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFFFFFFFFFFFFFFFA4A4A4A4A4A4A4A4A4A4A4A4A4A4 + A4A4A4A4A4A4A4A4A407FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF07E007 + 000007E0A4070707070707070707070707070707070707070707070707070707 + 0707070707070707070707070707070707070707070707070707070707A4E007 + 000007E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0 + E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E007 + 0000FF0707070707070707070707070707070707070707070707070707070707 + 07070707070707070707070707070707070707070707070707070707070707FF + 0000} + end + object Label1: TLabel + Left = 248 + Top = 8 + Width = 173 + Height = 29 + Alignment = taRightJustify + Caption = 'FastReport 3' + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -24 + Font.Name = 'Verdana' + Font.Style = [fsBold] + ParentFont = False + Transparent = True + end + object Label2: TLabel + Left = 315 + Top = 40 + Width = 107 + Height = 13 + Alignment = taRightJustify + Caption = 'SDAC engine Demo' + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + ParentFont = False + Transparent = True + end + object Label3: TLabel + Left = 308 + Top = 60 + Width = 104 + Height = 13 + Caption = 'http://crlab.com/sdac' + end + object DesignB: TButton + Left = 270 + Top = 308 + Width = 75 + Height = 25 + Caption = 'Design' + TabOrder = 0 + OnClick = DesignBClick + end + object PreviewB: TButton + Left = 350 + Top = 308 + Width = 75 + Height = 25 + Caption = 'Preview' + TabOrder = 1 + OnClick = PreviewBClick + end + object frxReport1: TfrxReport + Version = '3.20' + DotMatrixReport = False + EngineOptions.MaxMemSize = 10000000 + IniFile = '\Software\Fast Reports' + PreviewOptions.Buttons = [pbPrint, pbLoad, pbSave, pbExport, pbZoom, pbFind, pbOutline, pbPageSetup, pbTools, pbEdit, pbNavigator] + PreviewOptions.Zoom = 1 + PrintOptions.Printer = 'Default' + ReportOptions.CreateDate = 37871.9961568403 + ReportOptions.Description.Strings = ( + 'Demonstrates how to create Master/Detail SDAC report.') + ReportOptions.LastChange = 38243.7412834491 + ScriptLanguage = 'PascalScript' + ScriptText.Strings = ( + 'begin' + '' + 'end.') + Left = 136 + Top = 176 + Datasets = < + item + DataSet = ReportData.DeptDS + DataSetName = 'Dept' + end + item + DataSet = ReportData.EmpDS + DataSetName = 'Emp' + end> + Variables = <> + Style = <> + object Page1: TfrxReportPage + PaperWidth = 210 + PaperHeight = 297 + PaperSize = 9 + LeftMargin = 5 + RightMargin = 5 + TopMargin = 5 + BottomMargin = 5 + Columns = 1 + ColumnWidth = 210 + ColumnPositions.Strings = ( + '0') + PrintOnPreviousPage = True + object Band1: TfrxPageFooter + Height = 22.67718 + Top = 298.58287 + Width = 755.906 + object Memo5: TfrxMemoView + Left = 3.77953 + Top = 3.77953000000002 + Width = 706.77211 + Height = 15.11812 + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -11 + Font.Name = 'Arial' + Font.Style = [] + Frame.Typ = [ftTop] + Frame.Width = 2 + HAlign = haRight + Memo.UTF8 = ( + '[Page#]') + ParentFont = False + end + end + object Band2: TfrxReportTitle + Height = 26.45671 + Top = 18.89765 + Width = 755.906 + object Memo6: TfrxMemoView + Left = 3.77953 + Top = 3.77953 + Width = 706.77211 + Height = 18.89765 + Color = clTeal + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -16 + Font.Name = 'Arial' + Font.Style = [fsBold] + HAlign = haCenter + Memo.UTF8 = ( + 'Dept') + ParentFont = False + VAlign = vaBottom + end + end + object Band3: TfrxPageHeader + Height = 22.67718 + Top = 68.03154 + Width = 755.906 + object Memo22: TfrxMemoView + Left = 3.77953 + Top = 3.77952999999999 + Width = 706.77211 + Height = 15.11812 + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -13 + Font.Name = 'Arial' + Font.Style = [fsBold] + Frame.Typ = [ftTop] + Frame.Width = 2 + ParentFont = False + end + end + object Band4: TfrxMasterData + Height = 45.35436 + Top = 151.1812 + Width = 755.906 + Columns = 1 + ColumnWidth = 200 + ColumnGap = 20 + DataSet = ReportData.DeptDS + DataSetName = 'Dept' + RowCount = 0 + object Memo23: TfrxMemoView + Left = 11.33859 + Width = 113.385826771654 + Height = 18.89765 + Color = clNavy + DataSet = ReportData.DeptDS + DataSetName = 'Dept' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -13 + Font.Name = 'Arial' + Font.Style = [] + Frame.Typ = [ftTop] + Memo.UTF8 = ( + 'No') + ParentFont = False + VAlign = vaCenter + end + object Memo24: TfrxMemoView + Left = 11.33859 + Top = 18.89765 + Width = 113.385826771654 + Height = 26.45671 + Color = clNavy + DataField = 'DEPTNO' + DataSet = ReportData.DeptDS + DataSetName = 'Dept' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -19 + Font.Name = 'Arial' + Font.Style = [fsItalic] + Memo.UTF8 = ( + 'Dept.DeptNo') + ParentFont = False + VAlign = vaCenter + end + object Memo25: TfrxMemoView + Left = 124.72440945 + Width = 302.36220472 + Height = 18.89765 + Color = clNavy + DataSet = ReportData.DeptDS + DataSetName = 'Dept' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -13 + Font.Name = 'Arial' + Font.Style = [] + Frame.Typ = [ftTop] + Memo.UTF8 = ( + 'Name') + ParentFont = False + VAlign = vaCenter + end + object Memo26: TfrxMemoView + Left = 427.086614173228 + Width = 162.51979 + Height = 18.89765 + Color = clNavy + DataSet = ReportData.DeptDS + DataSetName = 'Dept' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -13 + Font.Name = 'Arial' + Font.Style = [] + Frame.Typ = [ftTop] + Memo.UTF8 = ( + 'Location') + ParentFont = False + VAlign = vaCenter + end + object Memo27: TfrxMemoView + Left = 124.72440945 + Top = 18.89765 + Width = 302.362204724409 + Height = 26.45671 + Color = clNavy + DataField = 'DNAME' + DataSet = ReportData.DeptDS + DataSetName = 'Dept' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -19 + Font.Name = 'Arial' + Font.Style = [fsItalic] + Memo.UTF8 = ( + 'Dept.DName') + ParentFont = False + VAlign = vaCenter + end + object Memo28: TfrxMemoView + Left = 427.08661417 + Top = 18.89765 + Width = 162.51979 + Height = 26.45671 + Color = clNavy + DataField = 'LOC' + DataSet = ReportData.DeptDS + DataSetName = 'Dept' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -19 + Font.Name = 'Arial' + Font.Style = [fsItalic] + Memo.UTF8 = ( + 'Dept.Loc') + ParentFont = False + VAlign = vaCenter + end + object Memo29: TfrxMemoView + Left = 589.606299212598 + Width = 120.944881889764 + Height = 45.35436 + Color = clNavy + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -19 + Font.Name = 'Arial' + Font.Style = [fsBold, fsItalic] + Frame.Typ = [ftRight, ftTop] + ParentFont = False + VAlign = vaCenter + end + object Memo7: TfrxMemoView + Left = 3.77953 + Width = 7.55906 + Height = 45.35436 + Color = clNavy + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -19 + Font.Name = 'Arial' + Font.Style = [fsBold, fsItalic] + Frame.Typ = [ftLeft, ftTop] + ParentFont = False + VAlign = vaCenter + end + end + object Band5: TfrxDetailData + Height = 18.89765 + Top = 219.21274 + Width = 755.906 + Columns = 1 + ColumnWidth = 200 + ColumnGap = 20 + DataSet = ReportData.EmpDS + DataSetName = 'Emp' + RowCount = 0 + object Memo4: TfrxMemoView + Left = 3.77953 + Width = 3.77953 + Height = 18.89765 + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -13 + Font.Name = 'Arial' + Font.Style = [fsBold] + Frame.Typ = [ftLeft] + ParentFont = False + end + object Memo8: TfrxMemoView + Left = 7.55906 + Width = 117.16543 + Height = 18.89765 + Color = clSilver + DataField = 'ENAME' + DataSet = ReportData.EmpDS + DataSetName = 'Emp' + Memo.UTF8 = ( + 'ENAME') + end + object Memo9: TfrxMemoView + Left = 124.72449 + Width = 362.83488 + Height = 18.89765 + Color = clSilver + DataField = 'JOB' + DataSet = ReportData.EmpDS + DataSetName = 'Emp' + Frame.Typ = [ftRight] + Memo.UTF8 = ( + 'JOB') + end + object Memo1: TfrxMemoView + Left = 487.55937 + Width = 222.99214795 + Height = 18.89765 + Color = clSilver + DataField = 'SAL' + DataSet = ReportData.EmpDS + DataSetName = 'Emp' + Frame.Typ = [ftRight] + Memo.UTF8 = ( + 'SAL') + end + end + end + end + object frxDesigner1: TfrxDesigner + DefaultScriptLanguage = 'PascalScript' + DefaultFont.Charset = DEFAULT_CHARSET + DefaultFont.Color = clWindowText + DefaultFont.Height = -13 + DefaultFont.Name = 'Arial' + DefaultFont.Style = [] + DefaultLeftMargin = 10 + DefaultRightMargin = 10 + DefaultTopMargin = 10 + DefaultBottomMargin = 10 + DefaultPaperSize = 9 + DefaultOrientation = poPortrait + Restrictions = [] + RTLLanguage = False + Left = 260 + Top = 144 + end + object frxBarCodeObject1: TfrxBarCodeObject + Left = 228 + Top = 208 + end + object frxRichObject1: TfrxRichObject + Left = 228 + Top = 176 + end + object frxChartObject1: TfrxChartObject + Left = 260 + Top = 176 + end + object frxDialogControls1: TfrxDialogControls + Left = 292 + Top = 176 + end + object ImageList1: TImageList + Left = 324 + Top = 144 + Bitmap = { + 494C010102000400040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000001000000001002000000000000010 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000008400000084000000840000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000008400000000000000000000008400000084000000840000008400000084 + 0000008400000084000000840000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000840000FFFFFF0000000000000000000000000084848400C6C6C600C6C6 + C600FFFFFF00FFFFFF0000840000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000084 + 000000840000FFFFFF0000000000C6C6C600FFFFFF0084848400000000000000 + 000000000000FFFFFF0000840000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008400000084 + 0000FFFFFF00FFFFFF0000000000C6C6C600FFFFFF00FFFFFF00FFFFFF00FFFF + FF0084848400FFFFFF0000840000000000000000000000000000000000000000 + 0000000000000000000000840000008400000084000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000840000FFFF + FF00FFFFFF00FFFFFF0000000000C6C6C600FFFFFF00FFFFFF00FFFFFF00FFFF + FF0084848400FFFFFF0000840000000000000000000000000000000000000000 + 0000000000000084000000840000008400000084000000840000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000840000FFFF + FF00FFFFFF00FFFFFF0000000000C6C6C600FFFFFF00FFFFFF00FFFFFF00FFFF + FF0084848400FFFFFF0000840000000000000000000000000000000000000000 + 0000000000000084000000FF0000008400000084000000840000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000840000FFFF + FF00FFFFFF00FFFFFF0000000000C6C6C600FFFFFF00FFFFFF00FFFFFF00FFFF + FF0084848400FFFFFF0000840000000000000000000000000000000000000000 + 0000000000000084000000FF000000FF00000084000000840000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000840000FFFF + FF00FFFFFF00FFFFFF0000000000C6C6C600FFFFFF00FFFFFF00FFFFFF00FFFF + FF0084848400FFFFFF0000840000000000000000000000000000000000000000 + 0000000000000000000000840000008400000084000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000840000FFFF + FF00FFFFFF00FFFFFF0000000000C6C6C600FFFFFF00FFFFFF00FFFFFF00FFFF + FF0084848400FFFFFF0000840000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000840000FFFF + FF00FFFFFF00C6C6C6008484840084848400FFFFFF00FFFFFF00FFFFFF00FFFF + FF00848484000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000840000FFFF + FF00FFFFFF008484840000000000000000008484840084848400FFFFFF00FFFF + FF00848484000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000840000FFFF + FF00C6C6C6008484840000000000000000000000000000000000848484008484 + 8400848484000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000084848400C6C6 + C600848484000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008484 + 8400000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000100000000100010000000000800000000000000000000000 + 000000000000000000000000FFFFFF00F1FFFFFF00000000E000FFFF00000000 + E000FFFF00000000E000FFFF00000000C000FFFF000000008000FC7F00000000 + 8000F83F000000008000F83F000000008000F83F000000008000FC7F00000000 + 8000FFFF000000008001FFFF000000008307FFFF0000000083C7FFFF00000000 + C7FFFFFF00000000EFFFFFFF0000000000000000000000000000000000000000 + 000000000000} + end + object frxOLEObject1: TfrxOLEObject + Left = 324 + Top = 176 + end + object frxCrossObject1: TfrxCrossObject + Left = 292 + Top = 208 + end + object frxDotMatrixExport1: TfrxDotMatrixExport + UseFileCache = True + ShowProgress = True + EscModel = 0 + GraphicFrames = False + SaveToFile = False + UseIniSettings = True + Left = 324 + Top = 208 + end + object frxBMPExport1: TfrxBMPExport + UseFileCache = True + ShowProgress = True + Left = 112 + Top = 248 + end + object frxJPEGExport1: TfrxJPEGExport + UseFileCache = True + ShowProgress = True + Left = 144 + Top = 248 + end + object frxTIFFExport1: TfrxTIFFExport + UseFileCache = True + ShowProgress = True + Left = 176 + Top = 248 + end + object frxTXTExport1: TfrxTXTExport + UseFileCache = True + ShowProgress = True + ScaleWidth = 1 + ScaleHeight = 1 + Borders = True + Pseudogrpahic = False + PageBreaks = True + OEMCodepage = False + EmptyLines = True + LeadSpaces = True + PrintAfter = False + PrinterDialog = True + UseSavedProps = True + Left = 240 + Top = 248 + end + object frxHTMLExport1: TfrxHTMLExport + UseFileCache = True + ShowProgress = True + FixedWidth = True + Background = False + Left = 272 + Top = 248 + end + object frxXLSExport1: TfrxXLSExport + UseFileCache = True + ShowProgress = True + AsText = False + Background = True + FastExport = True + PageBreaks = True + EmptyLines = True + Left = 304 + Top = 248 + end + object frxXMLExport1: TfrxXMLExport + UseFileCache = True + ShowProgress = True + Background = True + Creator = 'FastReport' + EmptyLines = True + Left = 336 + Top = 248 + end + object frxRTFExport1: TfrxRTFExport + UseFileCache = True + ShowProgress = True + Wysiwyg = True + Creator = 'FastReport http://www.fast-report.com' + Left = 208 + Top = 248 + end + object frxGZipCompressor1: TfrxGZipCompressor + Left = 260 + Top = 80 + end + object frxSDACComponents1: TfrxSDACComponents + Left = 256 + Top = 208 + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/Demo/Unit1.pas b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/Demo/Unit1.pas new file mode 100644 index 0000000..8c14407 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/Demo/Unit1.pas @@ -0,0 +1,74 @@ +unit Unit1; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + StdCtrls, Db, DBTables, frxDesgn, frxClass, frxDCtrl, frxBDEComponents, + frxChart, frxRich, frxBarcode, ImgList, ComCtrls, ExtCtrls, frxOLE, + frxCross, frxDMPExport, frxExportImage, frxExportRTF, frxExportTXT, + frxExportXML, frxExportXLS, frxExportHTML, frxGZip, frxExportPDF, + frxSDACComponents, frxDACComponents; + +type + TForm1 = class(TForm) + DesignB: TButton; + frxDesigner1: TfrxDesigner; + frxBarCodeObject1: TfrxBarCodeObject; + frxRichObject1: TfrxRichObject; + frxChartObject1: TfrxChartObject; + frxDialogControls1: TfrxDialogControls; + ImageList1: TImageList; + PreviewB: TButton; + Image1: TImage; + Label1: TLabel; + Label2: TLabel; + Label3: TLabel; + frxOLEObject1: TfrxOLEObject; + frxCrossObject1: TfrxCrossObject; + frxDotMatrixExport1: TfrxDotMatrixExport; + frxBMPExport1: TfrxBMPExport; + frxJPEGExport1: TfrxJPEGExport; + frxTIFFExport1: TfrxTIFFExport; + frxTXTExport1: TfrxTXTExport; + frxHTMLExport1: TfrxHTMLExport; + frxXLSExport1: TfrxXLSExport; + frxXMLExport1: TfrxXMLExport; + frxRTFExport1: TfrxRTFExport; + frxGZipCompressor1: TfrxGZipCompressor; + frxSDACComponents1: TfrxSDACComponents; + frxReport1: TfrxReport; + procedure DesignBClick(Sender: TObject); + procedure PreviewBClick(Sender: TObject); + procedure FormShow(Sender: TObject); + private + { Private declarations } + WPath: String; + public + { Public declarations } + end; + +var + Form1: TForm1; + +implementation + +{$R *.DFM} + +procedure TForm1.FormShow(Sender: TObject); +begin + WPath := ExtractFilePath(Application.ExeName); + TfrxPDFExport.Create(nil); +end; + +procedure TForm1.DesignBClick(Sender: TObject); +begin + frxReport1.DesignReport; +end; + +procedure TForm1.PreviewBClick(Sender: TObject); +begin + frxReport1.ShowReport; +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/Demo/Unit2.dfm b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/Demo/Unit2.dfm new file mode 100644 index 0000000..7dd8aec --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/Demo/Unit2.dfm @@ -0,0 +1,60 @@ +object ReportData: TReportData + OldCreateOrder = False + Left = 422 + Top = 104 + Height = 220 + Width = 254 + object MSConnection: TMSConnection + Database = 'test' + Username = 'root' + Server = 'Server' + Left = 24 + Top = 16 + end + object Dept: TMSTable + TableName = 'dept' + Connection = MSConnection + FetchAll = True + Left = 96 + Top = 16 + end + object Emp: TMSTable + TableName = 'emp' + MasterFields = 'DEPTNO' + DetailFields = 'DEPTNO' + MasterSource = DeptSource + Connection = MSConnection + FetchAll = True + Left = 168 + Top = 16 + ParamData = < + item + DataType = ftInteger + Name = 'DEPTNO' + ParamType = ptInput + Value = 60 + end> + end + object DeptSource: TDataSource + DataSet = Dept + Left = 96 + Top = 64 + end + object EmpSource: TDataSource + DataSet = Emp + Left = 168 + Top = 64 + end + object DeptDS: TfrxDBDataset + UserName = 'Dept' + DataSource = DeptSource + Left = 96 + Top = 112 + end + object EmpDS: TfrxDBDataset + UserName = 'Emp' + DataSource = EmpSource + Left = 168 + Top = 112 + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/Demo/Unit2.pas b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/Demo/Unit2.pas new file mode 100644 index 0000000..2f34471 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/Demo/Unit2.pas @@ -0,0 +1,31 @@ +unit Unit2; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + frxDBSet, DBTables, Db, frxClass, MemDS, DBAccess, MSAccess; + +type + TReportData = class(TDataModule) + MSConnection: TMSConnection; + Dept: TMSTable; + Emp: TMSTable; + DeptSource: TDataSource; + EmpSource: TDataSource; + DeptDS: TfrxDBDataset; + EmpDS: TfrxDBDataset; + private + { Private declarations } + public + { Public declarations } + end; + +var + ReportData: TReportData; + +implementation + +{$R *.DFM} + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/ReadMe.txt b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/ReadMe.txt new file mode 100644 index 0000000..d895288 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/ReadMe.txt @@ -0,0 +1,10 @@ +MSSQL Data Access Components +Copyright 1997-2007, Core Lab. All Rights Reserved +-------------------------------------------------- + +Demo for FastReport included in SDAC was built and tested using +Fast Report 3.20 + +IMPORTANT NOTE: + Demo provided as is and there are no warranty that it is fully + compatible with other versions of Fast Report. \ No newline at end of file diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/dclfrxSDAC5.cfg b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/dclfrxSDAC5.cfg new file mode 100644 index 0000000..3530192 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/dclfrxSDAC5.cfg @@ -0,0 +1,42 @@ +-$A+ +-$B- +-$C+ +-$D+ +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L+ +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$YD +-$Z1 +-cg +-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-H+ +-W+ +-M +-$M16384,1048576 +-K$00400000 +-E"d:\program files\borland\delphi5\Projects" +-N"." +-LE"." +-LN"." +-U"d:\program files\borland\delphi5\Projects;d:\program files\borland\delphi5\Sdac\Demos\FastReport;d:\program files\borland\delphi5\Lib\Debug;d:\program files\borland\delphi5\Vcl;d:\program files\borland\delphi5\lib" +-O"d:\program files\borland\delphi5\Projects;d:\program files\borland\delphi5\Sdac\Demos\FastReport;d:\program files\borland\delphi5\Lib\Debug;d:\program files\borland\delphi5\Vcl;d:\program files\borland\delphi5\lib" +-I"d:\program files\borland\delphi5\Projects;d:\program files\borland\delphi5\Sdac\Demos\FastReport;d:\program files\borland\delphi5\Lib\Debug;d:\program files\borland\delphi5\Vcl;d:\program files\borland\delphi5\lib" +-R"d:\program files\borland\delphi5\Projects;d:\program files\borland\delphi5\Sdac\Demos\FastReport;d:\program files\borland\delphi5\Lib\Debug;d:\program files\borland\delphi5\Vcl;d:\program files\borland\delphi5\lib" +-Z diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/dclfrxSDAC5.dpk b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/dclfrxSDAC5.dpk new file mode 100644 index 0000000..12019a6 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/dclfrxSDAC5.dpk @@ -0,0 +1,39 @@ +// Package file for Delphi 5 + +package dclfrxSDAC5; + +{$R *.RES} +{$R 'frxSDACReg.dcr'} +{$ALIGN ON} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'FastReport 3.20 SDAC Components'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + VCL50, + frxSDAC5; + +contains + frxSDACReg in 'frxSDACReg.pas'; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/dclfrxSDAC5.res b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/dclfrxSDAC5.res new file mode 100644 index 0000000..4aa33a2 Binary files /dev/null and b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/dclfrxSDAC5.res differ diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/dclfrxSDAC6.dpk b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/dclfrxSDAC6.dpk new file mode 100644 index 0000000..2c20d33 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/dclfrxSDAC6.dpk @@ -0,0 +1,39 @@ +// Package file for Delphi 6 + +package dclfrxSDAC6; + +{$R 'frxSDACReg.dcr'} +{$DESCRIPTION 'FastReport 3.20 SDAC Components'} +{$ALIGN ON} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + VCL, + DESIGNIDE, + frxSDAC6; + +contains + frxSDACReg in 'frxSDACReg.pas'; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/dclfrxSDAC7.dpk b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/dclfrxSDAC7.dpk new file mode 100644 index 0000000..3e82515 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/dclfrxSDAC7.dpk @@ -0,0 +1,39 @@ +// Package file for Delphi 7 + +package dclfrxSDAC7; + +{$R 'frxSDACReg.dcr'} +{$DESCRIPTION 'FastReport 3.20 SDAC Components'} +{$ALIGN ON} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + VCL, + DESIGNIDE, + frxSDAC7; + +contains + frxSDACReg in 'frxSDACReg.pas'; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/file_id.diz b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/file_id.diz new file mode 100644 index 0000000..b86b77d --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/file_id.diz @@ -0,0 +1,5 @@ +SDAC components for FastReport 3.20 + + +Created by: CoreLab +E-mail: sdac@crlab.com diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxDACComponents.pas b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxDACComponents.pas new file mode 100644 index 0000000..d8d30d6 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxDACComponents.pas @@ -0,0 +1,527 @@ + +{******************************************} +{ } +{ FastReport v3.20 } +{ DAC enduser components } +{ } + +// Created by: CoreLab +// E-mail: support@crlab.com + + +{ } +{******************************************} + +unit frxDACComponents; + +interface + +{$I frx.inc} + +uses + Windows, SysUtils, Classes, frxClass, frxCustomDB, DB, DBAccess, Graphics +{$IFDEF Delphi6} +, Variants +{$ENDIF} + {$IFDEF QBUILDER} +, fqbClass + {$ENDIF} +; + + +type + + TfrxDACComponentsClass = class of TfrxDACComponents; + TfrxDACDatabaseClass = class of TfrxDACDatabase; + TfrxDACTableClass = class of TfrxDACTable; + TfrxDACQueryClass = class of TfrxDACQuery; + + TfrxDACComponents = class(TfrxDBComponents) + private + FDefaultDatabase: TCustomDAConnection; + FOldComponents: TfrxDACComponents; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + function GetDescription: string; override; + + class function GetComponentsName: string; virtual; + class function ResourceName: string; virtual; abstract; + class function GetDatabaseClass: TfrxDACDatabaseClass; virtual; abstract; + class function GetTableClass: TfrxDACTableClass; virtual; abstract; + class function GetQueryClass: TfrxDACQueryClass; virtual; abstract; + published + property DefaultDatabase: TCustomDAConnection read FDefaultDatabase write FDefaultDatabase; + end; + + TfrxDACDatabase = class(TfrxCustomDatabase) + protected + FDatabase: TCustomDAConnection; + FParams: Tstrings; + function GetLoginPrompt: Boolean; override; + procedure SetLoginPrompt(Value: Boolean); override; + function GetUsername: string; + procedure SetUsername(const Value: string); + function GetPassword: string; + procedure SetPassword(const Value: string); + function GetServer: string; + procedure SetServer(const Value: string); + function GetConnected: Boolean; override; + procedure SetConnected(Value: Boolean); override; + function GetParams: Tstrings; override; + procedure SetParams(Value: Tstrings); override; + protected + + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + class function GetDescription: string; override; + procedure SetLogin(const Login, Password: string); override; + property Database: TCustomDAConnection read FDatabase write FDatabase; + property Username: string read GetUsername write SetUsername; + property Password: string read GetPassword write SetPassword; + property Server: string read GetServer write SetServer; + Property Params: Tstrings read GetParams write SetParams; + end; + + TfrxDACTable = class(TfrxCustomTable) + private + FDatabase: TfrxDACDatabase; + protected + procedure SetDatabase(const Value: TfrxDACDatabase); virtual; + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + + public + constructor Create(AOwner: TComponent); override; + constructor DesignCreate(AOwner: TComponent; Flags: Word); override; + class function GetDescription: string; override; + property Database: TfrxDACDatabase read FDatabase write SetDatabase; + end; + + TfrxDACQuery = class(TfrxCustomQuery) + private + FDatabase: TfrxDACDatabase; + protected + FQuery: TCustomDADataSet; + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + procedure SetMaster(const Value: TDataSource); override; + procedure SetSQL(Value: Tstrings); override; + function GetSQL: Tstrings; override; + procedure SetDatabase(const Value: TfrxDACDatabase); + procedure SetIndexName(const Value: string); + function GetIndexName: string; + procedure SetMasterFields(const Value: string); override; + public + constructor Create(AOwner: TComponent); override; + constructor DesignCreate(AOwner: TComponent; Flags: Word); override; + class function GetDescription: string; override; + procedure UpdateParams; override; + property Query: TCustomDADataSet read FQuery; + property Database: TfrxDACDatabase read FDatabase write SetDatabase; + property IndexName: string read GetIndexName write SetIndexName; + end; + + {$IFDEF QBUILDER} + TfrxEngineDAC = class(TfqbEngine) + protected + FQuery: TCustomDADataSet; + public + procedure ReadTableList(ATableList: Tstrings); override; + function ResultDataSet: TDataSet; override; + procedure SetSQL(const Value: string); override; + end; + {$ENDIF} + + procedure SetDelimitedText(strings: Tstrings; Delimiter:Char; const Value: string); + procedure GetMasterDetailNames(const Value: string; var MasterNames: string; var DetailNames: string); + procedure RegisterDacComponents(Components: TfrxDACComponentsClass); + procedure UnRegisterDacComponents(Components: TfrxDACComponentsClass); + +var + CatBmp: TBitmap; + DACComponents: TfrxDACComponents; + +implementation + +uses +{$IFNDEF NO_EDITORS} + frxDACEditor, +{$ENDIF} + frxDsgnIntf, frxRes; + +procedure RegisterDacComponents(Components: TfrxDACComponentsClass); +begin + CatBmp := TBitmap.Create; + CatBmp.LoadFromResourceName(hInstance, Components.ResourceName); + + frxObjects.RegisterCategory(Components.GetComponentsName, CatBmp, Components.GetComponentsName + ' Components'); + frxObjects.RegisterObject1(Components.GetDatabaseClass, nil, '', Components.GetComponentsName, 0, 37); + frxObjects.RegisterObject1(Components.GetTableClass, nil, '', Components.GetComponentsName, 0, 38); + frxObjects.RegisterObject1(Components.GetQueryClass, nil, '', Components.GetComponentsName, 0, 39); +end; + +procedure UnRegisterDacComponents(Components: TfrxDACComponentsClass); +begin + CatBmp.Free; + + frxObjects.UnRegister(Components.GetDatabaseClass); + frxObjects.UnRegister(Components.GetTableClass); + frxObjects.UnRegister(Components.GetQueryClass); +end; + +{$IFNDEF VER6P} +procedure SetDelimitedText(strings: Tstrings; Delimiter:Char; const Value: string); +var + P, P1: PChar; + S: string; +begin + with strings do begin + BeginUpdate; + try + Clear; + P := PChar(Value); + while P^ in [#1..' '] do + {$IFDEF MSWINDOWS} + P := CharNext(P); + {$ELSE} + Inc(P); + {$ENDIF} + while P^ <> #0 do begin + if P^ = '"' then + S := AnsiExtractQuotedStr(P, '"') + else begin + P1 := P; + while (P^ > ' ') and (P^ <> Delimiter) do + {$IFDEF MSWINDOWS} + P := CharNext(P); + {$ELSE} + Inc(P); + {$ENDIF} + Setstring(S, P1, P - P1); + end; + Add(S); + while P^ in [#1..' '] do + {$IFDEF MSWINDOWS} + P := CharNext(P); + {$ELSE} + Inc(P); + {$ENDIF} + if P^ = Delimiter then begin + P1 := P; + {$IFDEF MSWINDOWS} + if CharNext(P1)^ = #0 then + {$ELSE} + Inc(P1); + if P1^ = #0 then + {$ENDIF} + Add(''); + repeat + {$IFDEF MSWINDOWS} + P := CharNext(P); + {$ELSE} + Inc(P); + {$ENDIF} + until not (P^ in [#1..' ']); + end; + end; + finally + EndUpdate; + end; + end; +end; +{$ENDIF} + +procedure GetMasterDetailNames(const Value: string; var MasterNames: string; var DetailNames: string); +var + List: TstringList; + i: integer; +begin + List := TstringList.Create; + try +{$IFNDEF VER6P} + SetDelimitedText(List, ';', Value); +{$ELSE} + List.Delimiter := ';'; + List.DelimitedText := Value; +{$ENDIF} + MasterNames := ''; + DetailNames := ''; + for i := 0 to List.Count - 1 do begin + if MasterNames <> '' then + MasterNames := MasterNames + ';'; + if DetailNames <> '' then + DetailNames := DetailNames + ';'; + MasterNames := MasterNames + List.Values[List.Names[i]]; + DetailNames := DetailNames + List.Names[i]; + end; + finally + List.Free; + end; +end; + +{ TfrxDACComponents } + +class function TfrxDACComponents.GetComponentsName: string; +begin + result := 'DAC'; +end; + +constructor TfrxDACComponents.Create(AOwner: TComponent); +begin + inherited; + FOldComponents := DACComponents; + DACComponents := Self; +end; + +destructor TfrxDACComponents.Destroy; +begin + if DACComponents = Self then + DACComponents := FOldComponents; + inherited; +end; + +function TfrxDACComponents.GetDescription: string; +begin + Result := 'DAC'; +end; + +{ TfrxDACDatabase } + +function TfrxDACDatabase.GetParams: Tstrings; +begin + Result := FParams; +end; + +procedure TfrxDACDatabase.SetParams(Value: Tstrings); +begin + FParams := Value; +end; + +constructor TfrxDACDatabase.Create(AOwner: TComponent); +begin + inherited; + FParams := TstringList.Create; +end; + +destructor TfrxDACDatabase.Destroy; +begin + inherited; +end; + +class function TfrxDACDatabase.GetDescription: string; +begin + Result := 'DAC Database'; +end; + +function TfrxDACDatabase.GetConnected: Boolean; +begin + Result := FDatabase.Connected; +end; + +function TfrxDACDatabase.GetUsername: string; +begin + Result := FDatabase.Username; +end; + +function TfrxDACDatabase.GetPassword: string; +begin + Result := FDatabase.Password +end; + +function TfrxDACDatabase.GetServer: string; +begin + Result := FDatabase.Server; +end; + +function TfrxDACDatabase.GetLoginPrompt: Boolean; +begin + Result := FDatabase.LoginPrompt; +end; + +procedure TfrxDACDatabase.SetConnected(Value: Boolean); +begin + FDatabase.Connected := Value; +end; + +procedure TfrxDACDatabase.SetUsername(const Value: string); +begin + FDatabase.Username := Value; +end; + +procedure TfrxDACDatabase.SetPassword(const Value: string); +begin + FDatabase.Password := Value; +end; + +procedure TfrxDACDatabase.SetServer(const Value: string); +begin + FDatabase.Server := Value; +end; + +procedure TfrxDACDatabase.SetLoginPrompt(Value: Boolean); +begin + FDatabase.LoginPrompt := Value; +end; + +procedure TfrxDACDatabase.SetLogin(const Login, Password: string); +begin + Self.UserName := Login; + Self.Password := Password; +end; + +{ TfrxDACTable } + +constructor TfrxDACTable.Create(AOwner: TComponent); +begin + SetDatabase(nil); + inherited; +end; + +constructor TfrxDACTable.DesignCreate(AOwner: TComponent; Flags: Word); +var + i: Integer; + l: TList; +begin + inherited; + l := Report.AllObjects; + for i := 0 to l.Count - 1 do + if TObject(l[i]) is TfrxDACDatabase then + begin + Database := TfrxDACDatabase(l[i]); + break; + end; +end; + +class function TfrxDACTable.GetDescription: string; +begin + Result := 'DAC Table'; +end; + +procedure TfrxDACTable.Notification(AComponent: TComponent; Operation: TOperation); +begin + inherited; + if (Operation = opRemove) and (AComponent = FDatabase) then + SetDatabase(nil); +end; + +procedure TfrxDACTable.SetDatabase(const Value: TfrxDACDatabase); +begin + FDatabase := Value; +end; + +{ TfrxDACQuery } + +constructor TfrxDACQuery.Create(AOwner: TComponent); +begin + Dataset := FQuery; + Database := nil; + inherited Create(AOwner); +end; + +constructor TfrxDACQuery.DesignCreate(AOwner: TComponent; Flags: Word); +var + i: Integer; + l: TList; +begin + inherited; + l := Report.AllObjects; + for i := 0 to l.Count - 1 do + if TObject(l[i]) is TfrxDACDatabase then + begin + SetDatabase(TfrxDACDatabase(l[i])); + break; + end; +end; + +class function TfrxDACQuery.GetDescription: string; +begin + Result := 'DAC Query'; +end; + +procedure TfrxDACQuery.Notification(AComponent: TComponent; Operation: TOperation); +begin + inherited; + if (Operation = opRemove) and (AComponent = FDatabase) then + SetDatabase(nil); +end; + +procedure TfrxDACQuery.SetDatabase(const Value: TfrxDACDatabase); +begin + FDatabase := Value; + if Value <> nil then + FQuery.Connection := Value.Database + else if DACComponents <> nil then + FQuery.Connection := DACComponents.DefaultDatabase + else + FQuery.Connection := nil; +end; + +procedure TfrxDACQuery.SetIndexName(const Value: string); +begin + FQuery.IndexFieldNames := Value; +end; + +function TfrxDACQuery.GetIndexName: string; +begin + Result := FQuery.IndexFieldNames; +end; + +function TfrxDACQuery.GetSQL: Tstrings; +begin + Result := FQuery.SQL; +end; + +procedure TfrxDACQuery.SetSQL(Value: Tstrings); +begin + FQuery.SQL := Value; +end; + +procedure TfrxDACQuery.SetMaster(const Value: TDataSource); +begin + FQuery.MasterSource := Value; +end; + +procedure TfrxDACQuery.UpdateParams; +var + i: integer; +begin // Bug with ftCursor datatype + for i := 0 to Params.Count - 1 do // Problem with calling static method + if FQuery.Params.FindParam(Params[i].Name) <> nil then // TParam.SetDataType instead TOraParam.SetDataType + FQuery.ParamByName(Params[i].Name).DataType := Params[i].DataType; + + frxParamsToTParams(Self, FQuery.Params); +end; + +procedure TfrxDACQuery.SetMasterFields(const Value: string); +var + MasterNames: string; + DetailNames: string; +begin + GetMasterDetailNames(MasterFields, MasterNames, DetailNames); + FQuery.MasterFields := MasterNames; + FQuery.DetailFields := DetailNames; +end; + + {$IFDEF QBUILDER} + +{ TfrxEngineDAC } + +procedure TfrxEngineDAC.ReadTableList(ATableList: Tstrings); +begin + ATableList.Clear; + FQuery.Connection.GetTableNames(ATableList); +end; + +function TfrxEngineDAC.ResultDataSet: TDataSet; +begin + Result := FQuery; +end; + +procedure TfrxEngineDAC.SetSQL(const Value: string); +begin + FQuery.SQL.Text := Value; +end; + {$ENDIF} + +end. + diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxDACEditor.pas b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxDACEditor.pas new file mode 100644 index 0000000..e593593 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxDACEditor.pas @@ -0,0 +1,73 @@ + +{******************************************} +{ } +{ FastReport v3.20 } +{ DAC components design editors } +{ } + +// Created by: CoreLab +// E-mail: support@crlab.com + +{ } +{******************************************} + +unit frxDACEditor; + +interface + +{$I frx.inc} + +uses + Windows, Classes, SysUtils, Forms, Dialogs, frxDACComponents, frxCustomDB, + frxDsgnIntf, frxRes +{$IFDEF Delphi6} +, Variants +{$ENDIF}; + + +type + TfrxDatabaseProperty = class(TfrxComponentProperty) + public + function GetValue: String; override; + end; + + TfrxTableNameProperty = class(TfrxStringProperty) + public + function GetAttributes: TfrxPropertyAttributes; override; + procedure SetValue(const Value: String); override; + end; + +implementation + +{ TfrxDatabaseProperty } + +function TfrxDatabaseProperty.GetValue: String; +var + db: TfrxDACDatabase; +begin + db := TfrxDACDatabase(GetOrdValue); + if db = nil then + begin + if (DACComponents <> nil) and (DACComponents.DefaultDatabase <> nil) then + Result := DACComponents.DefaultDatabase.Name + else + Result := frxResources.Get('prNotAssigned'); + end + else + Result := inherited GetValue; +end; + +{ TfrxTableNameProperty } + +function TfrxTableNameProperty.GetAttributes: TfrxPropertyAttributes; +begin + Result := [paMultiSelect, paValueList, paSortList]; +end; + +procedure TfrxTableNameProperty.SetValue(const Value: String); +begin + inherited; + Designer.UpdateDataTree; +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxSDAC5.bpk b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxSDAC5.bpk new file mode 100644 index 0000000..c9531aa --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxSDAC5.bpk @@ -0,0 +1,44 @@ +package frxSDAC5; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + sdac50, + dac50, + fs5, + frxDB5, + frx5, + VCLDB50, + VCL50; + +contains + frxSDACRTTI, + frxSDACComponents, + frxSDACEditor, + frxDACEditor in 'frxDACEditor.pas', + frxDACComponents in 'frxDACComponents.pas'; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxSDAC5.cfg b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxSDAC5.cfg new file mode 100644 index 0000000..36c9b46 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxSDAC5.cfg @@ -0,0 +1,41 @@ +-$A+ +-$B- +-$C+ +-$D+ +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L+ +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$YD +-$Z1 +-cg +-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-H+ +-W+ +-M +-$M16384,1048576 +-K$00400000 +-N"." +-LE"." +-LN"." +-U"d:\program files\borland\delphi5\Projects;d:\program files\borland\delphi5\Sdac\Demos\FastReport;d:\program files\borland\delphi5\Lib\Debug;d:\program files\borland\delphi5\Vcl;d:\program files\borland\delphi5\lib" +-O"d:\program files\borland\delphi5\Projects;d:\program files\borland\delphi5\Sdac\Demos\FastReport;d:\program files\borland\delphi5\Lib\Debug;d:\program files\borland\delphi5\Vcl;d:\program files\borland\delphi5\lib" +-I"d:\program files\borland\delphi5\Projects;d:\program files\borland\delphi5\Sdac\Demos\FastReport;d:\program files\borland\delphi5\Lib\Debug;d:\program files\borland\delphi5\Vcl;d:\program files\borland\delphi5\lib" +-R"d:\program files\borland\delphi5\Projects;d:\program files\borland\delphi5\Sdac\Demos\FastReport;d:\program files\borland\delphi5\Lib\Debug;d:\program files\borland\delphi5\Vcl;d:\program files\borland\delphi5\lib" +-Z diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxSDAC5.cpp b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxSDAC5.cpp new file mode 100644 index 0000000..9fb3a19 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxSDAC5.cpp @@ -0,0 +1,26 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("frxBDE5.res"); +USEPACKAGE("vcl50.bpi"); +USEUNIT("frxSDACReg.pas"); +USERES("frxSDACReg.dcr"); +USEPACKAGE("vcldb50.bpi"); +USEPACKAGE("sdac50.bpi"); +USEPACKAGE("frx5.bpi"); +USEPACKAGE("frxDB5.bpi"); +USEPACKAGE("fs5.bpi"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxSDAC5.dpk b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxSDAC5.dpk new file mode 100644 index 0000000..b4fea8b --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxSDAC5.dpk @@ -0,0 +1,46 @@ +// Package file for Delphi 5 + +package frxSDAC5; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + VCL50, + VCLDB50, + dac50, + sdac50, + frx5, + frxDB5, + fs5; + +contains + frxSDACComponents in 'frxSDACComponents.pas', + frxSDACEditor in 'frxSDACEditor.pas', + frxSDACRTTI in 'frxSDACRTTI.pas', + frxDACEditor in 'frxDACEditor.pas', + frxDACComponents in 'frxDACComponents.pas'; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxSDAC5.res b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxSDAC5.res new file mode 100644 index 0000000..4aa33a2 Binary files /dev/null and b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxSDAC5.res differ diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxSDAC6.bpk b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxSDAC6.bpk new file mode 100644 index 0000000..9834a40 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxSDAC6.bpk @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[Version Info] +IncludeVerInfo=1 +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= + +[HistoryLists\hlIncludePath] +Count=2 +Item0=$(BCB)\Projects;$(BCB)\include;$(BCB)\include\vcl;..\ +Item1=$(BCB)\Projects;..\..\FR\SOURCE\ADO;$(BCB)\include;$(BCB)\include\vcl + +[HistoryLists\hlLibraryPath] +Count=2 +Item0=$(BCB)\Projects;$(BCB)\lib\obj;$(BCB)\lib;..\ +Item1=$(BCB)\Projects;..\..\FR\SOURCE\ADO;$(BCB)\lib\obj;$(BCB)\lib + +[HistoryLists\hlDebugSourcePath] +Count=1 +Item0=$(BCB)\source\vcl + +[HistoryLists\hlConditionals] +Count=1 +Item0=_DEBUG + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +Launcher= +UseLauncher=0 +DebugCWD= +HostApplication= +RemoteHost= +RemotePath= +RemoteLauncher= +RemoteCWD= +RemoteDebug=0 + +[Compiler] +ShowInfoMsgs=0 +LinkDebugVcl=0 +LinkCGLIB=0 + +[CORBA] +AddServerUnit=1 +AddClientUnit=1 +PrecompiledHeaders=1 + +[Language] +ActiveLang= +ProjectLang= +RootDir= + +[Linker] +LibPrefix= +LibSuffix= +LibVersion= + + \ No newline at end of file diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxSDAC6.cfg b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxSDAC6.cfg new file mode 100644 index 0000000..075366f --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxSDAC6.cfg @@ -0,0 +1,42 @@ +-$A+ +-$B- +-$C+ +-$D+ +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L+ +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$YD +-$Z1 +-cg +-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-H+ +-W+ +-M +-$M16384,1048576 +-K$00400000 +-E"d:\program files\borland\delphi5\Projects" +-N"." +-LE"." +-LN"." +-U"d:\program files\borland\delphi5\Projects;d:\program files\borland\delphi5\Sdac\Demos\FastReport;d:\program files\borland\delphi5\Projects;d:\program files\borland\delphi5\Projects;d:\program files\borland\delphi5\Lib\Debug;d:\program files\borland\delphi5\Vcl;d:\program files\borland\delphi5\lib;d:\program files\borland\delphi5\Projects" +-O"d:\program files\borland\delphi5\Projects;d:\program files\borland\delphi5\Sdac\Demos\FastReport;d:\program files\borland\delphi5\Projects;d:\program files\borland\delphi5\Projects;d:\program files\borland\delphi5\Lib\Debug;d:\program files\borland\delphi5\Vcl;d:\program files\borland\delphi5\lib;d:\program files\borland\delphi5\Projects" +-I"d:\program files\borland\delphi5\Projects;d:\program files\borland\delphi5\Sdac\Demos\FastReport;d:\program files\borland\delphi5\Projects;d:\program files\borland\delphi5\Projects;d:\program files\borland\delphi5\Lib\Debug;d:\program files\borland\delphi5\Vcl;d:\program files\borland\delphi5\lib;d:\program files\borland\delphi5\Projects" +-R"d:\program files\borland\delphi5\Projects;d:\program files\borland\delphi5\Sdac\Demos\FastReport;d:\program files\borland\delphi5\Projects;d:\program files\borland\delphi5\Projects;d:\program files\borland\delphi5\Lib\Debug;d:\program files\borland\delphi5\Vcl;d:\program files\borland\delphi5\lib;d:\program files\borland\delphi5\Projects" +-Z diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxSDAC6.cpp b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxSDAC6.cpp new file mode 100644 index 0000000..0b7615d --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxSDAC6.cpp @@ -0,0 +1,17 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- + \ No newline at end of file diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxSDAC6.dpk b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxSDAC6.dpk new file mode 100644 index 0000000..fd5dc54 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxSDAC6.dpk @@ -0,0 +1,47 @@ +// Package file for Delphi 6 + +package frxSDAC6; + +{$ALIGN 8} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + VCL, + VCLDB, + dac60, + Sdac60, + dacvcl60, + sdacvcl60, + frx6, + frxDB6, + fs6; + +contains + frxSDACComponents in 'frxSDACComponents.pas', + frxSDACEditor in 'frxSDACEditor.pas', + frxSDACRTTI in 'frxSDACRTTI.pas', + frxDACEditor in 'frxDACEditor.pas', + frxDACComponents in 'frxDACComponents.pas'; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxSDAC6.res b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxSDAC6.res new file mode 100644 index 0000000..2bbdbc1 Binary files /dev/null and b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxSDAC6.res differ diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxSDAC7.cfg b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxSDAC7.cfg new file mode 100644 index 0000000..ff1629e --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxSDAC7.cfg @@ -0,0 +1,41 @@ +-$A8 +-$B- +-$C+ +-$D+ +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L+ +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$YD +-$Z1 +-cg +-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-H+ +-W+ +-M +-$M16384,1048576 +-K$00400000 +-E"." +-N"." +-LE"." +-LN"." +-U"d:\program files\borland\delphi7\Lib\Debug;d:\program files\borland\delphi7\Vcl;d:\program files\borland\delphi7\lib" +-O"d:\program files\borland\delphi7\Lib\Debug;d:\program files\borland\delphi7\Vcl;d:\program files\borland\delphi7\lib" +-I"d:\program files\borland\delphi7\Lib\Debug;d:\program files\borland\delphi7\Vcl;d:\program files\borland\delphi7\lib" +-R"d:\program files\borland\delphi7\Lib\Debug;d:\program files\borland\delphi7\Vcl;d:\program files\borland\delphi7\lib" diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxSDAC7.dpk b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxSDAC7.dpk new file mode 100644 index 0000000..b68cf15 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxSDAC7.dpk @@ -0,0 +1,48 @@ +// Package file for Delphi 7 + +package frxSDAC7; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + VCL, + VCLDB, + dac70, + sdac70, + dacvcl70, + sdacvcl70, + frx7, + frxDB7, + fs7; + +contains + frxSDACComponents in 'frxSDACComponents.pas', + frxSDACEditor in 'frxSDACEditor.pas', + frxSDACRTTI in 'frxSDACRTTI.pas', + frxDACEditor in 'frxDACEditor.pas', + frxDACComponents in 'frxDACComponents.pas'; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxSDAC7.res b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxSDAC7.res new file mode 100644 index 0000000..fa40de9 Binary files /dev/null and b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxSDAC7.res differ diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxSDACComponents.pas b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxSDACComponents.pas new file mode 100644 index 0000000..5648b9c --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxSDACComponents.pas @@ -0,0 +1,340 @@ +{******************************************} +{ } +{ FastReport v3.20 } +{ SDAC enduser components } +{ } + +// Created by: CoreLab +// E-mail: sdac@crlab.com + +{ } +{******************************************} + +unit frxSDACComponents; + +interface + +{$I frx.inc} + +uses + Windows, SysUtils, Classes, frxClass, frxCustomDB, DB, MSAccess, OLEDBAccess, + OLEDBC, SdacVcl, frxDACComponents + {$IFDEF Delphi6} +, Variants + {$ENDIF} + {$IFDEF QBUILDER} +, fqbClass + {$ENDIF} +; + +type + TSDACTable = class(TMSTable) + protected + procedure InitFieldDefs; override; + end; + + TSDACQuery = class(TMSQuery) + protected + procedure InitFieldDefs; override; + end; + + TfrxSDACComponents = class(TfrxDACComponents) + public + function GetDescription: string; override; + + class function GetComponentsName: string; override; + class function ResourceName: string; override; + class function GetDatabaseClass: TfrxDACDatabaseClass; override; + class function GetTableClass: TfrxDACTableClass; override; + class function GetQueryClass: TfrxDACQueryClass; override; + end; + + TfrxSDACDatabase = class(TfrxDACDatabase) + private + protected + function GetDatabaseName: string; override; + procedure SetDatabaseName(const Value: string); override; + + public + constructor Create(AOwner: TComponent); override; + class function GetDescription: string; override; + + published + property LoginPrompt; + property DatabaseName; + property Username; + property Password; + property Server; + property Connected; + Property Params; + end; + + TfrxSDACTable = class(TfrxDACTable) + private + FTable: TSDACTable; + protected + procedure SetDatabase(const Value: TfrxDACDatabase); override; + procedure SetMaster(const Value: TDataSource); override; + procedure SetMasterFields(const Value: string); override; + procedure SetIndexFieldNames(const Value: string); override; + function GetIndexFieldNames: string; override; + function GetTableName: string; override; + procedure SetTableName(const Value: string); override; + public + constructor Create(AOwner: TComponent); override; + class function GetDescription: string; override; + + property Table: TSDACTable read FTable; + published + property Database; + Property TableName: string read GetTableName write setTableName; + end; + +TfrxSDACQuery = class(TfrxDACQuery) + public + constructor Create(AOwner: TComponent); override; + class function GetDescription: string; override; +{$IFDEF QBUILDER} + function QBEngine: TfqbEngine; override; +{$ENDIF} + published + property Database; + property IndexName; + property MasterFields; + end; + + {$IFDEF QBUILDER} + TfrxEngineSDAC = class(TfrxEngineDAC) + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure ReadFieldList(const ATableName: string; var AFieldList: TfqbFieldList); override; + end; + {$ENDIF} + +implementation + +{$R *.res} + +uses + Graphics, frxSDACRTTI, +{$IFNDEF NO_EDITORS} + frxSDACEditor, +{$ENDIF} + frxDsgnIntf, frxRes; + +{ TSDACTable } + +procedure TSDACTable.InitFieldDefs; +begin + if (TableName <> '') and (Assigned(Connection)) then + inherited; +end; + +{ TSDACQuery } + +procedure TSDACQuery.InitFieldDefs; +begin + if (SQL.Text <> '') and Assigned(Connection) then + inherited; +end; + +{ TfrxSDACComponents } + +class function TfrxSDACComponents.GetComponentsName: string; +begin + Result := 'SDAC'; +end; + +class function TfrxSDACComponents.GetDatabaseClass: TfrxDACDatabaseClass; +begin + Result := TfrxSDACDatabase; +end; + +class function TfrxSDACComponents.GetTableClass: TfrxDACTableClass; +begin + Result := TfrxSDACTable; +end; + +class function TfrxSDACComponents.GetQueryClass: TfrxDACQueryClass; +begin + Result := TfrxSDACQuery; +end; + +class function TfrxSDACComponents.ResourceName: string; +begin + Result := 'FRXSDACOBJECTS'; +end; + +function TfrxSDACComponents.GetDescription: string; +begin + Result := 'SDAC'; +end; + +{ TfrxSDACDatabase } + +constructor TfrxSDACDatabase.Create(AOwner: TComponent); +begin + inherited; + FDatabase := TMSConnection.Create(nil); + Component := FDatabase; +end; + +class function TfrxSDACDatabase.GetDescription: string; +begin + Result := 'SDAC Database'; +end; + +function TfrxSDACDatabase.GetDatabaseName: string; +begin + Result := TMSConnection(FDatabase).Database; +end; + +procedure TfrxSDACDatabase.SetDatabaseName(const Value: string); +begin + TMSConnection(FDatabase).Database := Value; +end; + +{ TfrxSDACTable } + +constructor TfrxSDACTable.Create(AOwner: TComponent); +begin + FTable := TSDACTable.Create(nil); + DataSet := FTable; + SetDatabase(nil); + inherited; +end; + +class function TfrxSDACTable.GetDescription: string; +begin + Result := 'SDAC Table'; +end; + +procedure TfrxSDACTable.SetDatabase(const Value: TfrxDACDatabase); +begin + inherited; + if Value <> nil then + FTable.Connection := TMSConnection(Value.Database) + else + if DACComponents <> nil then + FTable.Connection := TMSConnection(DACComponents.DefaultDatabase) + else + FTable.Connection := nil; +end; + +function TfrxSDACTable.GetIndexFieldNames: string; +begin + Result := FTable.IndexFieldNames; +end; + +function TfrxSDACTable.GetTableName: string; +begin + Result := FTable.TableName; +end; + +procedure TfrxSDACTable.SetIndexFieldNames(const Value: string); +begin + FTable.IndexFieldNames := Value; +end; + +procedure TfrxSDACTable.SetTableName(const Value: string); +begin + FTable.TableName := Value; + if Assigned(FTable.Connection) then + FTable.InitFieldDefs; +end; + +procedure TfrxSDACTable.SetMaster(const Value: TDataSource); +begin + FTable.MasterSource := Value; +end; + +procedure TfrxSDACTable.SetMasterFields(const Value: string); +var + MasterNames: string; + DetailNames: string; +begin + GetMasterDetailNames(MasterFields, MasterNames, DetailNames); + FTable.MasterFields := MasterNames; + FTable.DetailFields := DetailNames; +end; + +{ TfrxSDACQuery } + +constructor TfrxSDACQuery.Create(AOwner: TComponent); +begin + FQuery := TSDACQuery.Create(nil); + inherited Create(AOwner); +end; + +class function TfrxSDACQuery.GetDescription: string; +begin + Result := 'SDAC Query'; +end; + + {$IFDEF QBUILDER} +function TfrxSDACQuery.QBEngine: TfqbEngine; +begin + Result := TfrxEngineSDAC.Create(nil); + TfrxEngineSDAC(Result).FQuery.Connection := TCustomMSConnection(FQuery.Connection); +end; + {$ENDIF} + + {$IFDEF QBUILDER} + +{ TfrxEngineSDAC } + +constructor TfrxEngineSDAC.Create(AOwner: TComponent); +begin + inherited; + FQuery := TSDACQuery.Create(Self); +end; + +destructor TfrxEngineSDAC.Destroy; +begin + FQuery.Free; + inherited; +end; + +procedure TfrxEngineSDAC.ReadFieldList(const ATableName: string; + var AFieldList: TfqbFieldList); +var + TempTable: TSDACTable; + Fields: TFieldDefs; + i: Integer; + tmpField: TfqbField; +begin + AFieldList.Clear; + TempTable := TSDACTable.Create(Self); + try + TempTable.Connection := TCustomMSConnection(FQuery.Connection); + TempTable.TableName := ATableName; + Fields := TempTable.FieldDefs; + try + TempTable.Active := True; + tmpField:= TfqbField(AFieldList.Add); + tmpField.FieldName := '*'; + for i := 0 to Fields.Count - 1 do begin + tmpField := TfqbField(AFieldList.Add); + tmpField.FieldName := Fields.Items[i].Name; + tmpField.FieldType := Ord(Fields.Items[i].DataType) + end; + except + end; + finally + TempTable.Free; + end; +end; + + {$ENDIF} + +initialization + RegisterDacComponents(TfrxSDACComponents); + +finalization + UnRegisterDacComponents(TfrxSDACComponents); + +end. + + + diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxSDACEditor.pas b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxSDACEditor.pas new file mode 100644 index 0000000..6ef4c1f --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxSDACEditor.pas @@ -0,0 +1,54 @@ + +{******************************************} +{ } +{ FastReport v3.20 } +{ SDAC components design editors } +{ } + +// Created by: CoreLab +// E-mail: sdac@crlab.com + +{ } +{******************************************} + +unit frxSDACEditor; + +interface + +{$I frx.inc} + +implementation + +uses + Windows, SysUtils, Classes, frxClass, frxDsgnIntf, frxCustomDB, DB, + MSAccess, OLEDBAccess, OLEDBC, SdacVcl, frxSDACComponents, frxDACEditor +{$IFDEF Delphi6} +, Variants +{$ENDIF}; + + +type + TfrxMSTableNameProperty = class(TfrxTableNameProperty) + public + procedure GetValues; override; + end; + +{ TfrxMSTableNameProperty } + +procedure TfrxMSTableNameProperty.GetValues; +begin + inherited; + with TfrxSDACTable(Component).Table do + if Connection <> nil then + Connection.GetTableNames(Values); +end; + +initialization + frxPropertyEditors.Register(TypeInfo(TfrxSDACDatabase), TfrxSDACTable, 'Database', + TfrxDatabaseProperty); + frxPropertyEditors.Register(TypeInfo(TfrxSDACDatabase), TfrxSDACQuery, 'Database', + TfrxDatabaseProperty); + frxPropertyEditors.Register(TypeInfo(String), TfrxSDACTable, 'TableName', + TfrxMSTableNameProperty); + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxSDACRTTI.pas b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxSDACRTTI.pas new file mode 100644 index 0000000..b70df30 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxSDACRTTI.pas @@ -0,0 +1,65 @@ +{******************************************} +{ } +{ FastReport v3.20 } +{ SDAC components RTTI } +{ } + +// Created by: CoreLab +// E-mail: sdac@crlab.com + +{ } +{******************************************} + +unit frxSDACRTTI; + +interface + +{$I frx.inc} + +implementation + +uses + Windows, Classes, fs_iinterpreter, frxSDACComponents +{$IFDEF Delphi6} +, Variants +{$ENDIF}; + + +type + TFunctions = class(TfsRTTIModule) + private + function CallMethod(Instance: TObject; ClassType: TClass; + const MethodName: String; Caller: TfsMethodHelper): Variant; + public + constructor Create(AScript: TfsScript); override; + end; + +{ TFunctions } + +constructor TFunctions.Create(AScript: TfsScript); +begin + inherited Create(AScript); + with AScript do + begin + AddClass(TfrxSDACDatabase, 'TfrxCustomDatabase'); + AddClass(TfrxSDACTable, 'TfrxCustomTable'); + with AddClass(TfrxSDACQuery, 'TfrxCustomQuery') do + AddMethod('procedure ExecSQL', CallMethod); + end; +end; + +function TFunctions.CallMethod(Instance: TObject; ClassType: TClass; + const MethodName: String; Caller: TfsMethodHelper): Variant; +begin + Result := 0; + if ClassType = TfrxSDACQuery then + begin + if MethodName = 'EXECSQL' then + TfrxSDACQuery(Instance).Query.Execute; + end +end; + +initialization + fsRTTIModules.Add(TFunctions); + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxSDACReg.dcr b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxSDACReg.dcr new file mode 100644 index 0000000..a4924ac Binary files /dev/null and b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxSDACReg.dcr differ diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxSDACReg.pas b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxSDACReg.pas new file mode 100644 index 0000000..24a75d1 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxSDACReg.pas @@ -0,0 +1,38 @@ + +{******************************************} +{ } +{ FastReport v3.20 } +{ SDAC components registration } +{ } + +// Created by: CoreLab +// E-mail: sdac@crlab.com + +{ } +{******************************************} + +unit frxSDACReg; + +interface + +{$I frx.inc} + +procedure Register; + +implementation + +uses + Windows, Messages, SysUtils, Classes +{$IFNDEF Delphi6} +, DsgnIntf +{$ELSE} +, DesignIntf, DesignEditors +{$ENDIF} +, frxSDACComponents; + +procedure Register; +begin + RegisterComponents('FastReport 3.0', [TfrxSDACComponents]); +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxsDACComponents.res b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxsDACComponents.res new file mode 100644 index 0000000..b049bf3 Binary files /dev/null and b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR3/frxsDACComponents.res differ diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/CBuilder5/frxSDAC5.bpk b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/CBuilder5/frxSDAC5.bpk new file mode 100644 index 0000000..f2eb76f --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/CBuilder5/frxSDAC5.bpk @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[Version Info] +IncludeVerInfo=1 +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= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +ShowInfoMsgs=0 +LinkDebugVcl=0 + +[CORBA] +AddServerUnit=1 +AddClientUnit=1 +PrecompiledHeaders=1 + + \ No newline at end of file diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/CBuilder5/frxSDAC5.cpp b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/CBuilder5/frxSDAC5.cpp new file mode 100644 index 0000000..f45107e --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/CBuilder5/frxSDAC5.cpp @@ -0,0 +1,27 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("frxBDE5.res"); +USEPACKAGE("vcl50.bpi"); +USEUNIT("..\frxSDACReg.pas"); +USERES("..\frxSDACReg.dcr"); +USEPACKAGE("vcldb50.bpi"); +USEPACKAGE("sdac50.bpi"); +USEPACKAGE("frx5.bpi"); +USEPACKAGE("frxDB5.bpi"); +USEPACKAGE("fs5.bpi"); +USEPACKAGE("fqb50.bpi"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/CBuilder5/fsDAC5.bpk b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/CBuilder5/fsDAC5.bpk new file mode 100644 index 0000000..c11dfa4 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/CBuilder5/fsDAC5.bpk @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[Version Info] +IncludeVerInfo=1 +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= + +[HistoryLists\hlIncludePath] +Count=1 +Item0=$(BCB)\include;$(BCB)\include\vcl + +[HistoryLists\hlLibraryPath] +Count=1 +Item0=$(BCB)\lib\obj;$(BCB)\lib + +[HistoryLists\hlDebugSourcePath] +Count=1 +Item0=$(BCB)\source\vcl + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +ShowInfoMsgs=0 +LinkDebugVcl=0 + +[CORBA] +AddServerUnit=1 +AddClientUnit=1 +PrecompiledHeaders=1 + +[Language] +ActiveLang= +ProjectLang= +RootDir= + + \ No newline at end of file diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/CBuilder5/fsDAC5.cpp b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/CBuilder5/fsDAC5.cpp new file mode 100644 index 0000000..6b3f215 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/CBuilder5/fsDAC5.cpp @@ -0,0 +1,24 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("FS5.res"); +USEPACKAGE("vcl50.bpi"); +USEPACKAGE("vcldb50.bpi"); +USEPACKAGE("dac50.bpi"); +USEPACKAGE("fs5.bpi"); +USEPACKAGE("fsDB5.bpi"); +USEUNIT("..\fs_idacrtti.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/CBuilder5/fsSDAC5.bpk b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/CBuilder5/fsSDAC5.bpk new file mode 100644 index 0000000..90389af --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/CBuilder5/fsSDAC5.bpk @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[Version Info] +IncludeVerInfo=1 +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= + +[HistoryLists\hlIncludePath] +Count=1 +Item0=$(BCB)\include;$(BCB)\include\vcl + +[HistoryLists\hlLibraryPath] +Count=1 +Item0=$(BCB)\lib\obj;$(BCB)\lib + +[HistoryLists\hlDebugSourcePath] +Count=1 +Item0=$(BCB)\source\vcl + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +ShowInfoMsgs=0 +LinkDebugVcl=0 + +[CORBA] +AddServerUnit=1 +AddClientUnit=1 +PrecompiledHeaders=1 + +[Language] +ActiveLang= +ProjectLang= +RootDir= + + \ No newline at end of file diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/CBuilder5/fsSDAC5.cpp b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/CBuilder5/fsSDAC5.cpp new file mode 100644 index 0000000..c520e2b --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/CBuilder5/fsSDAC5.cpp @@ -0,0 +1,26 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("FS5.res"); +USEPACKAGE("vcl50.bpi"); +USEPACKAGE("vcldb50.bpi"); +USEPACKAGE("dac50.bpi"); +USEPACKAGE("sdac50.bpi"); +USEPACKAGE("fs5.bpi"); +USEPACKAGE("fsDB5.bpi"); +USEUNIT("..\fs_isdacreg.pas"); +USERES("..\fs_isdacreg.dcr"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/CBuilder6/frxSDAC6.bpk b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/CBuilder6/frxSDAC6.bpk new file mode 100644 index 0000000..8a2a126 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/CBuilder6/frxSDAC6.bpk @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[Version Info] +IncludeVerInfo=1 +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= + +[HistoryLists\hlIncludePath] +Count=2 +Item0=$(BCB)\Projects;$(BCB)\include;$(BCB)\include\vcl;..\ +Item1=$(BCB)\Projects;..\..\FR\SOURCE\ADO;$(BCB)\include;$(BCB)\include\vcl + +[HistoryLists\hlLibraryPath] +Count=2 +Item0=$(BCB)\Projects;$(BCB)\lib\obj;$(BCB)\lib;..\ +Item1=$(BCB)\Projects;..\..\FR\SOURCE\ADO;$(BCB)\lib\obj;$(BCB)\lib + +[HistoryLists\hlDebugSourcePath] +Count=1 +Item0=$(BCB)\source\vcl + +[HistoryLists\hlConditionals] +Count=1 +Item0=_DEBUG + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +Launcher= +UseLauncher=0 +DebugCWD= +HostApplication= +RemoteHost= +RemotePath= +RemoteLauncher= +RemoteCWD= +RemoteDebug=0 + +[Compiler] +ShowInfoMsgs=0 +LinkDebugVcl=0 +LinkCGLIB=0 + +[CORBA] +AddServerUnit=1 +AddClientUnit=1 +PrecompiledHeaders=1 + +[Language] +ActiveLang= +ProjectLang= +RootDir= + +[Linker] +LibPrefix= +LibSuffix= +LibVersion= + + \ No newline at end of file diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/CBuilder6/frxSDAC6.cpp b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/CBuilder6/frxSDAC6.cpp new file mode 100644 index 0000000..58e173f --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/CBuilder6/frxSDAC6.cpp @@ -0,0 +1,17 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- + \ No newline at end of file diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/CBuilder6/fsDAC6.bpk b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/CBuilder6/fsDAC6.bpk new file mode 100644 index 0000000..ac84b22 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/CBuilder6/fsDAC6.bpk @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[Version Info] +IncludeVerInfo=1 +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] + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +Launcher= +UseLauncher=0 +DebugCWD= +HostApplication= +RemoteHost= +RemotePath= +RemoteLauncher= +RemoteCWD= +RemoteDebug=0 + +[Compiler] +ShowInfoMsgs=0 +LinkDebugVcl=0 +LinkCGLIB=0 + +[CORBA] +AddServerUnit=1 +AddClientUnit=1 +PrecompiledHeaders=1 + +[Linker] +LibPrefix= +LibSuffix= +LibVersion= + + \ No newline at end of file diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/CBuilder6/fsDAC6.cpp b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/CBuilder6/fsDAC6.cpp new file mode 100644 index 0000000..12bf8b0 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/CBuilder6/fsDAC6.cpp @@ -0,0 +1,18 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- + + \ No newline at end of file diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/CBuilder6/fsSDAC6.bpk b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/CBuilder6/fsSDAC6.bpk new file mode 100644 index 0000000..27522e8 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/CBuilder6/fsSDAC6.bpk @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[Version Info] +IncludeVerInfo=1 +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] + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +Launcher= +UseLauncher=0 +DebugCWD= +HostApplication= +RemoteHost= +RemotePath= +RemoteLauncher= +RemoteCWD= +RemoteDebug=0 + +[Compiler] +ShowInfoMsgs=0 +LinkDebugVcl=0 +LinkCGLIB=0 + +[CORBA] +AddServerUnit=1 +AddClientUnit=1 +PrecompiledHeaders=1 + +[Linker] +LibPrefix= +LibSuffix= +LibVersion= + + \ No newline at end of file diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/CBuilder6/fsSDAC6.cpp b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/CBuilder6/fsSDAC6.cpp new file mode 100644 index 0000000..12bf8b0 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/CBuilder6/fsSDAC6.cpp @@ -0,0 +1,18 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- + + \ No newline at end of file diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi10/dclfrxSDAC10.bdsproj b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi10/dclfrxSDAC10.bdsproj new file mode 100644 index 0000000..b164a51 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi10/dclfrxSDAC10.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + dclfrxSDAC10.dpk + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + FastReport 4.0 SDAC Components + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1049 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi10/dclfrxSDAC10.dpk b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi10/dclfrxSDAC10.dpk new file mode 100644 index 0000000..719ed11 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi10/dclfrxSDAC10.dpk @@ -0,0 +1,40 @@ +// Package file for Delphi 2006 + +package dclfrxSDAC10; + +{$R '..\frxSDACReg.dcr'} +{$DESCRIPTION 'FastReport 4.0 SDAC Components'} +{$ALIGN ON} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + VCL, + DESIGNIDE, + frxDAC10, + frxSDAC10; + +contains + frxSDACReg in '..\frxSDACReg.pas'; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi10/dclfsSDAC10.bdsproj b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi10/dclfsSDAC10.bdsproj new file mode 100644 index 0000000..e624c97 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi10/dclfsSDAC10.bdsproj @@ -0,0 +1,19 @@ + + + + + + + + + + + + dclfsSDAC10.dpk + + + 7.0 + + + diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi10/dclfsSDAC10.dpk b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi10/dclfsSDAC10.dpk new file mode 100644 index 0000000..05d7a83 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi10/dclfsSDAC10.dpk @@ -0,0 +1,42 @@ +// Package file for Delphi 2006 + +package dclfsSDAC10; + +{$R '..\fs_isdacreg.dcr'} + +{$DESCRIPTION 'FastScript 1.9 SDAC Components'} +{$ALIGN ON} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} + +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + VCL, + DESIGNIDE, + fs10, + fsDAC10, + fsSDAC10; + +contains + fs_isdacreg in '..\fs_isdacreg.pas'; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi10/frxDAC10.bdsproj b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi10/frxDAC10.bdsproj new file mode 100644 index 0000000..3952dbf --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi10/frxDAC10.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + frxDAC10.dpk + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1049 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi10/frxDAC10.dpk b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi10/frxDAC10.dpk new file mode 100644 index 0000000..4772eaf --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi10/frxDAC10.dpk @@ -0,0 +1,46 @@ +// Package file for Delphi 2006 + +package frxDAC10; + +{$I frx.inc} + +{$ALIGN ON} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl, + vcldb, + dac100, + frx10, + frxDB10, +{$IFDEF QBUILDER} + fqb10, +{$ENDIF} + fs10; + +contains + frxDACEditor in '..\frxDACEditor.pas', + frxDACComponents in '..\frxDACComponents.pas'; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi10/frxSDAC10.bdsproj b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi10/frxSDAC10.bdsproj new file mode 100644 index 0000000..92be2e7 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi10/frxSDAC10.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + frxSDAC10.dpk + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1049 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi10/frxSDAC10.dpk b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi10/frxSDAC10.dpk new file mode 100644 index 0000000..81b3688 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi10/frxSDAC10.dpk @@ -0,0 +1,51 @@ +// Package file for Delphi 2006 + +package frxSDAC10; + +{$I frx.inc} + +{$ALIGN ON} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + VCL, + VCLDB, + dac100, + sdac100, + dacvcl100, + sdacvcl100, + frxDAC10, + frx10, + frxDB10, +{$IFDEF QBUILDER} + fqb100, +{$ENDIF} + fs10; + +contains + frxSDACComponents in '..\frxSDACComponents.pas', + frxSDACEditor in '..\frxSDACEditor.pas', + frxSDACRTTI in '..\frxSDACRTTI.pas'; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi10/fsDAC10.bdsproj b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi10/fsDAC10.bdsproj new file mode 100644 index 0000000..24d8513 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi10/fsDAC10.bdsproj @@ -0,0 +1,19 @@ + + + + + + + + + + + + fsDAC10.dpk + + + 7.0 + + + diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi10/fsDAC10.dpk b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi10/fsDAC10.dpk new file mode 100644 index 0000000..787b2e6 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi10/fsDAC10.dpk @@ -0,0 +1,41 @@ +// Package file for Delphi 2006 + +package fsDAC10; + +{$I fs.inc} + +{$ALIGN ON} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} + +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + VCL, + VCLDB, + dac100, + fs10, + fsDB10; + +contains + fs_idacrtti in '..\fs_idacrtti.pas'; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi10/fsSDAC10.bdsproj b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi10/fsSDAC10.bdsproj new file mode 100644 index 0000000..860cdb6 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi10/fsSDAC10.bdsproj @@ -0,0 +1,19 @@ + + + + + + + + + + + + fsSDAC10.dpk + + + 7.0 + + + diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi10/fsSDAC10.dpk b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi10/fsSDAC10.dpk new file mode 100644 index 0000000..17ddddd --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi10/fsSDAC10.dpk @@ -0,0 +1,43 @@ +// Package file for Delphi 2006 + +package fsSDAC10; + +{$I fs.inc} + +{$ALIGN ON} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} + +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + VCL, + VCLDB, + sdac100, + sdacvcl100, + fsDAC10, + fs10, + fsDB10; + +contains + fs_isdacrtti in '..\fs_isdacrtti.pas'; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi11/dclfrxSDAC11.dpk b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi11/dclfrxSDAC11.dpk new file mode 100644 index 0000000..ad83d52 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi11/dclfrxSDAC11.dpk @@ -0,0 +1,40 @@ +// Package file for Delphi 2007 + +package dclfrxSDAC11; + +{$R '..\frxSDACReg.dcr'} +{$DESCRIPTION 'FastReport 4.0 SDAC Components'} +{$ALIGN ON} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + VCL, + DESIGNIDE, + frxDAC11, + frxSDAC11; + +contains + frxSDACReg in '..\frxSDACReg.pas'; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi11/dclfrxSDAC11.dproj b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi11/dclfrxSDAC11.dproj new file mode 100644 index 0000000..15787e1 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi11/dclfrxSDAC11.dproj @@ -0,0 +1,82 @@ + + + {0e0b2531-ae7a-4787-9790-56bdf8f59fc3} + dclfrxSDAC11.dpk + Debug + AnyCPU + DCC32 + + + 7.0 + False + True + False + 0 + RELEASE + + + 7.0 + True + DEBUG + + + Delphi.Personality + Package + + + False + True + False + + + FastReport 4.0 SDAC Components + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1049 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + dclfrxSDAC11.dpk + + + + + + + MainSource + + + + + + + + + + \ No newline at end of file diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi11/dclfsSDAC11.dpk b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi11/dclfsSDAC11.dpk new file mode 100644 index 0000000..955db9f --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi11/dclfsSDAC11.dpk @@ -0,0 +1,42 @@ +// Package file for Delphi 2007 + +package dclfsSDAC11; + +{$R '..\fs_isdacreg.dcr'} + +{$DESCRIPTION 'FastScript 1.9 SDAC Components'} +{$ALIGN ON} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} + +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + VCL, + DESIGNIDE, + fs11, + fsDAC11, + fsSDAC11; + +contains + fs_isdacreg in '..\fs_isdacreg.pas'; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi11/dclfsSDAC11.dproj b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi11/dclfsSDAC11.dproj new file mode 100644 index 0000000..31814f9 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi11/dclfsSDAC11.dproj @@ -0,0 +1,83 @@ + + + {f9393bbf-e02f-4301-bc54-c6b9271fc9c6} + dclfsSDAC11.dpk + Debug + AnyCPU + DCC32 + + + 7.0 + False + True + False + 0 + RELEASE + + + 7.0 + True + DEBUG + + + Delphi.Personality + Package + + + False + True + False + + + FastScript 1.9 SDAC Components + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1049 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + dclfsSDAC11.dpk + + + + + + + MainSource + + + + + + + + + + + \ No newline at end of file diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi11/frxDAC11.dpk b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi11/frxDAC11.dpk new file mode 100644 index 0000000..2f55637 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi11/frxDAC11.dpk @@ -0,0 +1,46 @@ +// Package file for Delphi 2007 + +package frxDAC11; + +{$I frx.inc} + +{$ALIGN ON} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl, + vcldb, + dac105, + frx11, + frxDB11, +{$IFDEF QBUILDER} + fqb110, +{$ENDIF} + fs11; + +contains + frxDACEditor in '..\frxDACEditor.pas', + frxDACComponents in '..\frxDACComponents.pas'; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi11/frxDAC11.dproj b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi11/frxDAC11.dproj new file mode 100644 index 0000000..1b85cf7 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi11/frxDAC11.dproj @@ -0,0 +1,83 @@ + + + {79ea9b0f-23fb-4f90-b6f5-06dd24439029} + frxDAC11.dpk + Debug + AnyCPU + DCC32 + + + 7.0 + False + True + False + 0 + RELEASE + + + 7.0 + True + DEBUG + + + Delphi.Personality + Package + + + False + True + False + + + False + False + True + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1049 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + frxDAC11.dpk + + + + + + + MainSource + + + + + + + + + + + + \ No newline at end of file diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi11/frxSDAC11.dpk b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi11/frxSDAC11.dpk new file mode 100644 index 0000000..163fbc5 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi11/frxSDAC11.dpk @@ -0,0 +1,51 @@ +// Package file for Delphi 2007 + +package frxSDAC11; + +{$I frx.inc} + +{$ALIGN ON} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + VCL, + VCLDB, + dac105, + sdac105, + dacvcl105, + sdacvcl105, + frxDAC11, + frx11, + frxDB11, +{$IFDEF QBUILDER} + fqb110, +{$ENDIF} + fs11; + +contains + frxSDACComponents in '..\frxSDACComponents.pas', + frxSDACEditor in '..\frxSDACEditor.pas', + frxSDACRTTI in '..\frxSDACRTTI.pas'; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi11/frxSDAC11.dproj b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi11/frxSDAC11.dproj new file mode 100644 index 0000000..3eaddaf --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi11/frxSDAC11.dproj @@ -0,0 +1,88 @@ + + + {9088d9fa-279b-4c30-a6b7-839a07845547} + frxSDAC11.dpk + Debug + AnyCPU + DCC32 + + + 7.0 + False + True + False + 0 + RELEASE + + + 7.0 + True + DEBUG + + + Delphi.Personality + Package + + + False + True + False + + + False + False + True + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1049 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + frxSDAC11.dpk + + + + + + + MainSource + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi11/fsDAC11.dpk b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi11/fsDAC11.dpk new file mode 100644 index 0000000..0a944af --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi11/fsDAC11.dpk @@ -0,0 +1,41 @@ +// Package file for Delphi 2007 + +package fsDAC11; + +{$I fs.inc} + +{$ALIGN ON} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} + +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + VCL, + VCLDB, + dac105, + fs11, + fsDB11; + +contains + fs_idacrtti in '..\fs_idacrtti.pas'; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi11/fsDAC11.dproj b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi11/fsDAC11.dproj new file mode 100644 index 0000000..6942a06 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi11/fsDAC11.dproj @@ -0,0 +1,81 @@ + + + {ab40f425-8a8e-4190-8aef-70f3f93a0017} + fsDAC11.dpk + Debug + AnyCPU + DCC32 + + + 7.0 + False + True + False + 0 + RELEASE + + + 7.0 + True + DEBUG + + + Delphi.Personality + Package + + + False + True + False + + + False + False + True + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1049 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + fsDAC11.dpk + + + + + + + MainSource + + + + + + + + + + \ No newline at end of file diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi11/fsSDAC11.dpk b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi11/fsSDAC11.dpk new file mode 100644 index 0000000..a7feff7 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi11/fsSDAC11.dpk @@ -0,0 +1,43 @@ +// Package file for Delphi 2007 + +package fsSDAC11; + +{$I fs.inc} + +{$ALIGN ON} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} + +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + VCL, + VCLDB, + sdac105, + sdacvcl105, + fsDAC11, + fs11, + fsDB11; + +contains + fs_isdacrtti in '..\fs_isdacrtti.pas'; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi11/fsSDAC11.dproj b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi11/fsSDAC11.dproj new file mode 100644 index 0000000..9f6e120 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi11/fsSDAC11.dproj @@ -0,0 +1,83 @@ + + + {7f25acf6-46de-4475-bff0-8bb0e6c634d0} + fsSDAC11.dpk + Debug + AnyCPU + DCC32 + + + 7.0 + False + True + False + 0 + RELEASE + + + 7.0 + True + DEBUG + + + Delphi.Personality + Package + + + False + True + False + + + False + False + True + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1049 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + fsSDAC11.dpk + + + + + + + MainSource + + + + + + + + + + + + \ No newline at end of file diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi5/dclfrxSDAC5.dpk b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi5/dclfrxSDAC5.dpk new file mode 100644 index 0000000..7ac9562 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi5/dclfrxSDAC5.dpk @@ -0,0 +1,39 @@ +// Package file for Delphi 5 + +package dclfrxSDAC5; + +{$R '..\frxSDACReg.dcr'} +{$DESCRIPTION 'FastReport 4.0 SDAC Components'} +{$ALIGN ON} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + VCL50, + frxDAC5, + frxSDAC5; + +contains + frxSDACReg in '..\frxSDACReg.pas'; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi5/dclfsSDAC5.dpk b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi5/dclfsSDAC5.dpk new file mode 100644 index 0000000..a16df9c --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi5/dclfsSDAC5.dpk @@ -0,0 +1,41 @@ +// Package file for Delphi 5 + +package dclfsSDAC5; + +{$R '..\fs_isdacreg.dcr'} + +{$DESCRIPTION 'FastScript 1.9 SDAC Components'} +{$ALIGN ON} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} + +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + VCL50, + fs5, + fsDAC5, + fsSDAC5; + +contains + fs_isdacreg in '..\fs_isdacreg.pas'; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi5/frxDAC5.dpk b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi5/frxDAC5.dpk new file mode 100644 index 0000000..bf8b147 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi5/frxDAC5.dpk @@ -0,0 +1,46 @@ +// Package file for Delphi 5 + +package frxDAC5; + +{$I frx.inc} + +{$ALIGN ON} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl50, + vcldb50, + dac50, + frx5, + frxDB5, +{$IFDEF QBUILDER} + fqb50, +{$ENDIF} + fs5; + +contains + frxDACEditor in '..\frxDACEditor.pas', + frxDACComponents in '..\frxDACComponents.pas'; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi5/frxSDAC5.dpk b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi5/frxSDAC5.dpk new file mode 100644 index 0000000..7140587 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi5/frxSDAC5.dpk @@ -0,0 +1,49 @@ +// Package file for Delphi 5 + +package frxSDAC5; + +{$I frx.inc} + +{$ALIGN ON} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + VCL50, + VCLDB50, + dac50, + sdac50, + frxDAC5, + frx5, + frxDB5, +{$IFDEF QBUILDER} + fqb50, +{$ENDIF} + fs5; + +contains + frxSDACComponents in '..\frxSDACComponents.pas', + frxSDACEditor in '..\frxSDACEditor.pas', + frxSDACRTTI in '..\frxSDACRTTI.pas'; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi5/fsDAC5.dpk b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi5/fsDAC5.dpk new file mode 100644 index 0000000..66f6275 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi5/fsDAC5.dpk @@ -0,0 +1,41 @@ +// Package file for Delphi 5 + +package fsDAC5; + +{$I fs.inc} + +{$ALIGN ON} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} + +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + VCL50, + VCLDB50, + dac50, + fs5, + fsDB5; + +contains + fs_idacrtti in '..\fs_idacrtti.pas'; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi5/fsSDAC5.dpk b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi5/fsSDAC5.dpk new file mode 100644 index 0000000..822eeaa --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi5/fsSDAC5.dpk @@ -0,0 +1,43 @@ +// Package file for Delphi 5 + +package fsSDAC5; + +{$I fs.inc} + +{$ALIGN ON} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} + +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + VCL50, + VCLDB50, + sdac50, + sdacvcl50, + fsDAC5, + fs5, + fsDB5; + +contains + fs_isdacrtti in '..\fs_isdacrtti.pas'; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi6/dclfrxSDAC6.dpk b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi6/dclfrxSDAC6.dpk new file mode 100644 index 0000000..b527f29 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi6/dclfrxSDAC6.dpk @@ -0,0 +1,40 @@ +// Package file for Delphi 6 + +package dclfrxSDAC6; + +{$R '..\frxSDACReg.dcr'} +{$DESCRIPTION 'FastReport 4.0 SDAC Components'} +{$ALIGN ON} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + VCL, + DESIGNIDE, + frxDAC6, + frxSDAC6; + +contains + frxSDACReg in '..\frxSDACReg.pas'; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi6/dclfsSDAC6.dpk b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi6/dclfsSDAC6.dpk new file mode 100644 index 0000000..22a07f4 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi6/dclfsSDAC6.dpk @@ -0,0 +1,42 @@ +// Package file for Delphi 6 + +package dclfsSDAC6; + +{$R '..\fs_isdacreg.dcr'} + +{$DESCRIPTION 'FastScript 1.9 SDAC Components'} +{$ALIGN ON} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} + +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + VCL, + DESIGNIDE, + fs6, + fsDAC6, + fsSDAC6; + +contains + fs_isdacreg in '..\fs_isdacreg.pas'; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi6/frxDAC6.dpk b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi6/frxDAC6.dpk new file mode 100644 index 0000000..97b9440 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi6/frxDAC6.dpk @@ -0,0 +1,46 @@ +// Package file for Delphi 6 + +package frxDAC6; + +{$I frx.inc} + +{$ALIGN 8} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl, + vcldb, + dac60, + frx6, + frxDB6, +{$IFDEF QBUILDER} + fqb60, +{$ENDIF} + fs6; + +contains + frxDACEditor in '..\frxDACEditor.pas', + frxDACComponents in '..\frxDACComponents.pas'; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi6/frxSDAC6.dpk b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi6/frxSDAC6.dpk new file mode 100644 index 0000000..49e71ea --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi6/frxSDAC6.dpk @@ -0,0 +1,51 @@ +// Package file for Delphi 6 + +package frxSDAC6; + +{$I frx.inc} + +{$ALIGN 8} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + VCL, + VCLDB, + dac60, + Sdac60, + dacvcl60, + sdacvcl60, + frxDAC6, + frx6, + frxDB6, +{$IFDEF QBUILDER} + fqb60, +{$ENDIF} + fs6; + +contains + frxSDACComponents in '..\frxSDACComponents.pas', + frxSDACEditor in '..\frxSDACEditor.pas', + frxSDACRTTI in '..\frxSDACRTTI.pas'; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi6/fsDAC6.dpk b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi6/fsDAC6.dpk new file mode 100644 index 0000000..787669f --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi6/fsDAC6.dpk @@ -0,0 +1,41 @@ +// Package file for Delphi 6 + +package fsDAC6; + +{$I fs.inc} + +{$ALIGN ON} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} + +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + VCL, + VCLDB, + dac60, + fs6, + fsDB6; + +contains + fs_idacrtti in '..\fs_idacrtti.pas'; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi6/fsSDAC6.dpk b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi6/fsSDAC6.dpk new file mode 100644 index 0000000..5a7534b --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi6/fsSDAC6.dpk @@ -0,0 +1,43 @@ +// Package file for Delphi 6 + +package fsSDAC6; + +{$I fs.inc} + +{$ALIGN ON} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} + +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + VCL, + VCLDB, + sdac60, + sdacvcl60, + fsDAC6, + fs6, + fsDB6; + +contains + fs_isdacrtti in '..\fs_isdacrtti.pas'; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi7/dclfrxSDAC7.dpk b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi7/dclfrxSDAC7.dpk new file mode 100644 index 0000000..cc81dc9 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi7/dclfrxSDAC7.dpk @@ -0,0 +1,40 @@ +// Package file for Delphi 7 + +package dclfrxSDAC7; + +{$R '..\frxSDACReg.dcr'} +{$DESCRIPTION 'FastReport 4.0 SDAC Components'} +{$ALIGN ON} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + VCL, + DESIGNIDE, + frxDAC7, + frxSDAC7; + +contains + frxSDACReg in '..\frxSDACReg.pas'; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi7/dclfsSDAC7.dpk b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi7/dclfsSDAC7.dpk new file mode 100644 index 0000000..64c91da --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi7/dclfsSDAC7.dpk @@ -0,0 +1,42 @@ +// Package file for Delphi 7 + +package dclfsSDAC7; + +{$R '..\fs_isdacreg.dcr'} + +{$DESCRIPTION 'FastScript 1.9 SDAC Components'} +{$ALIGN ON} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} + +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + VCL, + DESIGNIDE, + fs7, + fsDAC7, + fsSDAC7; + +contains + fs_isdacreg in '..\fs_isdacreg.pas'; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi7/frxDAC7.dpk b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi7/frxDAC7.dpk new file mode 100644 index 0000000..8769375 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi7/frxDAC7.dpk @@ -0,0 +1,46 @@ +// Package file for Delphi 7 + +package frxDAC7; + +{$I frx.inc} + +{$ALIGN ON} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl, + vcldb, + dac70, + frx7, + frxDB7, +{$IFDEF QBUILDER} + fqb70, +{$ENDIF} + fs7; + +contains + frxDACEditor in '..\frxDACEditor.pas', + frxDACComponents in '..\frxDACComponents.pas'; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi7/frxSDAC7.dpk b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi7/frxSDAC7.dpk new file mode 100644 index 0000000..4356694 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi7/frxSDAC7.dpk @@ -0,0 +1,49 @@ +// Package file for Delphi 7 + +package frxSDAC7; + +{$I frx.inc} + +{$ALIGN ON} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + VCL, + VCLDB, + sdac70, + sdacvcl70, + frxDAC7, + frx7, + frxDB7, +{$IFDEF QBUILDER} + fqb70, +{$ENDIF} + fs7; + +contains + frxSDACComponents in '..\frxSDACComponents.pas', + frxSDACEditor in '..\frxSDACEditor.pas', + frxSDACRTTI in '..\frxSDACRTTI.pas'; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi7/fsDAC7.dpk b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi7/fsDAC7.dpk new file mode 100644 index 0000000..0014ab7 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi7/fsDAC7.dpk @@ -0,0 +1,41 @@ +// Package file for Delphi 7 + +package fsDAC7; + +{$I fs.inc} + +{$ALIGN ON} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} + +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + VCL, + VCLDB, + dac70, + fs7, + fsDB7; + +contains + fs_idacrtti in '..\fs_idacrtti.pas'; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi7/fsSDAC7.dpk b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi7/fsSDAC7.dpk new file mode 100644 index 0000000..44198f2 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi7/fsSDAC7.dpk @@ -0,0 +1,43 @@ +// Package file for Delphi 7 + +package fsSDAC7; + +{$I fs.inc} + +{$ALIGN ON} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} + +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + VCL, + VCLDB, + sdac70, + sdacvcl70, + fsDAC7, + fs7, + fsDB7; + +contains + fs_isdacrtti in '..\fs_isdacrtti.pas'; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi9/dclfrxSDAC9.bdsproj b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi9/dclfrxSDAC9.bdsproj new file mode 100644 index 0000000..f59bec2 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi9/dclfrxSDAC9.bdsproj @@ -0,0 +1,173 @@ + + + + + + + + + + + + dclfrxSDAC9.dpk + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + + + 0 + 0 + 1 + False + False + False + 16384 + 1048576 + 4194304 + FastReport 4.0 SDAC Components + + + + + + + + + + + False + + + + + + False + + + + + + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1049 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi9/dclfrxSDAC9.dpk b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi9/dclfrxSDAC9.dpk new file mode 100644 index 0000000..ea29739 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi9/dclfrxSDAC9.dpk @@ -0,0 +1,40 @@ +// Package file for Delphi 2005 + +package dclfrxSDAC9; + +{$R '..\frxSDACReg.dcr'} +{$DESCRIPTION 'FastReport 4.0 SDAC Components'} +{$ALIGN ON} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + VCL, + DESIGNIDE, + frxDAC9, + frxSDAC9; + +contains + frxSDACReg in '..\frxSDACReg.pas'; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi9/dclfsSDAC9.bdsproj b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi9/dclfsSDAC9.bdsproj new file mode 100644 index 0000000..0bed81e --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi9/dclfsSDAC9.bdsproj @@ -0,0 +1,19 @@ + + + + + + + + + + + + dclfsSDAC9.dpk + + + 7.0 + + + diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi9/dclfsSDAC9.dpk b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi9/dclfsSDAC9.dpk new file mode 100644 index 0000000..d1f6401 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi9/dclfsSDAC9.dpk @@ -0,0 +1,42 @@ +// Package file for Delphi 2005 + +package dclfsSDAC9; + +{$R '..\fs_isdacreg.dcr'} + +{$DESCRIPTION 'FastScript 1.9 SDAC Components'} +{$ALIGN ON} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} + +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + VCL, + DESIGNIDE, + fs9, + fsDAC9, + fsSDAC9; + +contains + fs_isdacreg in '..\fs_isdacreg.pas'; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi9/frxDAC9.bdsproj b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi9/frxDAC9.bdsproj new file mode 100644 index 0000000..7694d45 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi9/frxDAC9.bdsproj @@ -0,0 +1,173 @@ + + + + + + + + + + + + frxDAC9.dpk + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + + + 0 + 0 + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + + + + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1049 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi9/frxDAC9.dpk b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi9/frxDAC9.dpk new file mode 100644 index 0000000..560858c --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi9/frxDAC9.dpk @@ -0,0 +1,46 @@ +// Package file for Delphi 2005 + +package frxDAC9; + +{$I frx.inc} + +{$ALIGN ON} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl, + vcldb, + dac90, + frx9, + frxDB9, +{$IFDEF QBUILDER} + fqb90, +{$ENDIF} + fs9; + +contains + frxDACEditor in '..\frxDACEditor.pas', + frxDACComponents in '..\frxDACComponents.pas'; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi9/frxSDAC9.bdsproj b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi9/frxSDAC9.bdsproj new file mode 100644 index 0000000..cd44f81 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi9/frxSDAC9.bdsproj @@ -0,0 +1,173 @@ + + + + + + + + + + + + frxSDAC9.dpk + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + + + 0 + 0 + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + + + + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1049 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi9/frxSDAC9.dpk b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi9/frxSDAC9.dpk new file mode 100644 index 0000000..20fdfd4 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi9/frxSDAC9.dpk @@ -0,0 +1,51 @@ +// Package file for Delphi 2005 + +package frxSDAC9; + +{$I frx.inc} + +{$ALIGN ON} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + VCL, + VCLDB, + dac90, + sdac90, + dacvcl90, + sdacvcl90, + frxDAC9, + frx9, + frxDB9, +{$IFDEF QBUILDER} + fqb90, +{$ENDIF} + fs9; + +contains + frxSDACComponents in '..\frxSDACComponents.pas', + frxSDACEditor in '..\frxSDACEditor.pas', + frxSDACRTTI in '..\frxSDACRTTI.pas'; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi9/fsDAC9.bdsproj b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi9/fsDAC9.bdsproj new file mode 100644 index 0000000..a447a42 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi9/fsDAC9.bdsproj @@ -0,0 +1,168 @@ + + + + + + + + + + + + fsDAC9.dpk + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + + + 0 + 0 + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + + + + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1049 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi9/fsDAC9.dpk b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi9/fsDAC9.dpk new file mode 100644 index 0000000..6ef7946 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi9/fsDAC9.dpk @@ -0,0 +1,41 @@ +// Package file for Delphi 2005 + +package fsDAC9; + +{$I fs.inc} + +{$ALIGN ON} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} + +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + VCL, + VCLDB, + dac90, + fs9, + fsDB9; + +contains + fs_idacrtti in '..\fs_idacrtti.pas'; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi9/fsSDAC9.bdsproj b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi9/fsSDAC9.bdsproj new file mode 100644 index 0000000..4e63c40 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi9/fsSDAC9.bdsproj @@ -0,0 +1,168 @@ + + + + + + + + + + + + fsSDAC9.dpk + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + + + 0 + 0 + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + + + + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1049 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi9/fsSDAC9.dpk b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi9/fsSDAC9.dpk new file mode 100644 index 0000000..75008d1 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Delphi9/fsSDAC9.dpk @@ -0,0 +1,43 @@ +// Package file for Delphi 2005 + +package fsSDAC9; + +{$I fs.inc} + +{$ALIGN ON} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} + +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $00400000} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + VCL, + VCLDB, + sdac90, + sdacvcl90, + fsDAC9, + fs9, + fsDB9; + +contains + fs_isdacrtti in '..\fs_isdacrtti.pas'; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Demo/FRDemo.dpr b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Demo/FRDemo.dpr new file mode 100644 index 0000000..86680b9 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Demo/FRDemo.dpr @@ -0,0 +1,15 @@ +program FRDemo; + +uses + Forms, + Unit1 in 'Unit1.pas' {Form1}, + Unit2 in 'Unit2.pas' {ReportData: TDataModule}; + +{$R *.RES} + +begin + Application.Initialize; + Application.CreateForm(TForm1, Form1); + Application.CreateForm(TReportData, ReportData); + Application.Run; +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Demo/FRDemo.res b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Demo/FRDemo.res new file mode 100644 index 0000000..06b79d7 Binary files /dev/null and b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Demo/FRDemo.res differ diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Demo/Unit1.dfm b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Demo/Unit1.dfm new file mode 100644 index 0000000..ea090ec --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Demo/Unit1.dfm @@ -0,0 +1,794 @@ +object Form1: TForm1 + Left = 191 + Top = 107 + BorderStyle = bsDialog + Caption = 'FastReport 4.0 Demo' + ClientHeight = 339 + ClientWidth = 431 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 13 + object Image1: TImage + Left = 180 + Top = 12 + Width = 62 + Height = 62 + AutoSize = True + Picture.Data = { + 07544269746D6170B6130000424DB61300000000000036040000280000003E00 + 00003E0000000100080000000000800F00000000000000000000000100000001 + 000000000000000080000080000000808000800000008000800080800000C0C0 + C000C0DCC000F0CAA6000020400000206000002080000020A0000020C0000020 + E00000400000004020000040400000406000004080000040A0000040C0000040 + E00000600000006020000060400000606000006080000060A0000060C0000060 + E00000800000008020000080400000806000008080000080A0000080C0000080 + E00000A0000000A0200000A0400000A0600000A0800000A0A00000A0C00000A0 + E00000C0000000C0200000C0400000C0600000C0800000C0A00000C0C00000C0 + E00000E0000000E0200000E0400000E0600000E0800000E0A00000E0C00000E0 + E00040000000400020004000400040006000400080004000A0004000C0004000 + E00040200000402020004020400040206000402080004020A0004020C0004020 + E00040400000404020004040400040406000404080004040A0004040C0004040 + E00040600000406020004060400040606000406080004060A0004060C0004060 + E00040800000408020004080400040806000408080004080A0004080C0004080 + E00040A0000040A0200040A0400040A0600040A0800040A0A00040A0C00040A0 + E00040C0000040C0200040C0400040C0600040C0800040C0A00040C0C00040C0 + E00040E0000040E0200040E0400040E0600040E0800040E0A00040E0C00040E0 + E00080000000800020008000400080006000800080008000A0008000C0008000 + E00080200000802020008020400080206000802080008020A0008020C0008020 + E00080400000804020008040400080406000804080008040A0008040C0008040 + E00080600000806020008060400080606000806080008060A0008060C0008060 + E00080800000808020008080400080806000808080008080A0008080C0008080 + E00080A0000080A0200080A0400080A0600080A0800080A0A00080A0C00080A0 + E00080C0000080C0200080C0400080C0600080C0800080C0A00080C0C00080C0 + E00080E0000080E0200080E0400080E0600080E0800080E0A00080E0C00080E0 + E000C0000000C0002000C0004000C0006000C0008000C000A000C000C000C000 + E000C0200000C0202000C0204000C0206000C0208000C020A000C020C000C020 + E000C0400000C0402000C0404000C0406000C0408000C040A000C040C000C040 + E000C0600000C0602000C0604000C0606000C0608000C060A000C060C000C060 + E000C0800000C0802000C0804000C0806000C0808000C080A000C080C000C080 + E000C0A00000C0A02000C0A04000C0A06000C0A08000C0A0A000C0A0C000C0A0 + E000C0C00000C0C02000C0C04000C0C06000C0C08000C0C0A000F0FBFF00A4A0 + A000808080000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00FF0707070707070707070707070707070707070707070707070707070707 + 07070707070707070707070707070707070707070707070707070707070707FF + 000007E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0 + E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E007 + 000007E0A4070707070707070707070707070707070707070707070707070707 + 0707070707070707070707070707070707070707070707070707070707A4E007 + 000007E007FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFF07A4A4A4A40707FFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFF07E0E0E0E0E0E0E0E0A407FFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFF07E0E0E0E0E0E0E0E0E0E0E0FFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFF07E0E0E0E0E0E0E0E0E0E0E0E0A4FFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFF07E0E0E0E0E0E0E0E0E0E0E0E0E0E0FFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFFFFFFFFFA4A4A4A4A4A407FFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFA4E0E0E0E0E0E0E0E0E0E0E0E0E0E0A4FFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFFFFF00000000000000000000A4FFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFE0E0E0E0E0E0E0E0E0E0E0E0E0E0E0A4FFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFFFA40000000000000000000000FFFFFFFFFFFFFFFF + FFFFFFFFFFFFE0E0E0E0E0E0E0E0E0E0E0E0E0E0E0A4FFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFF0700000000000000000000000000FFFFFFFFFFFFFF + FFFFFFFFFFE0E0E0E0E0E0E0E0E0E0E0E0E0E0E0A4FFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA400000000000000000000000000FFFFFFFFFFFFFF + FFFFFFFFE0E0E0E0E0E0E0E0E0E0E0E0E0E0E0A4FFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA400000000000000000000000000FFFFFFFFFFFFFF + FFFFFFE0E0E0E0E0E0E0E0E0E0E0E0E0E0E0A4FFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA400000000000000000000000000FFFFFFFFFFFFFF + FFFFE0E0E0E0E0E0E0E0E0E0E0E0E0E0E0A4FFFFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA400000000000000000000000000FFFFFFFFFFFFFF + FFE0E0E0E0E0E0E0E0E0E0E0E0E0E0E0A4FFFFFFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA400000000000000000000000000FFFFFF07070707 + E0E0E0E0E0E0E0E0E0E0E0E0E0E0E007FFFFFFFFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA400000000000000000000000000FFFF07E0E0E0E0 + E0E0E0E0E0E0E0E0E0E0E0E0E0E007FFFFFFFFFFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA400000000000000000000000000FF07E0E0E0E0E0 + E0E0E0E0E0E0E0E0E0E0E0E0E007FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA400000000000000000000000000FF07E0E0E0E0E0 + E0E0E0E0E0E0E0E0E0E0E0E0E0A407FFFFFFFFFFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA400000000000000000000000000FF07E0E0E0E0E0 + E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0A407FFFFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA400000000000000000000000000FF07E0E0E0E0E0 + E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0A4FFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA400000000000000000000000000FFFF07E0E0E0E0 + E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0FFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA400000000000000000000000000A4FFFF07070707 + 0707070707E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0A4FFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA40000000000000000000000000000A4A4A4A4A4A4 + A4A4A4A407FFFFE0E0E0E0E0E0E0E0E0E0E0E0E0E0A4FFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA40000000000000000000000000000000000000000 + 000000000000FFFFE0E0E0E0E0E0E0E0E0E0E0E0E0E007FFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA40000000000000000000000000000000000000000 + 00000000000000FFFFE0E0E0E0E0E0E0E0E0E0E0E0E0A4FFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA40000000000000000000000000000000000000000 + 0000000000000000FF07E0E0E0E0E0E0E0E0E0E0E0E0E007FFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA40000000000000000000000000000000000000000 + 0000000000000000FF07E0E0E0E0E0E0E0E0E0E0E0E0E007FFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA40000000000000000000000000000000000000000 + 0000000000000000FF07E0E0E0E0E0E0E0E0E0E0E0E0E0A4FFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA40000000000000000000000000000000000000000 + 0000000000000000FF07E0E0E0E0E0E0E0E0E0E0E0E0E0A4FFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA40000000000000000000000000000000000000000 + 000000000000A4FFFFE0E0E0E0E0E0E0E0E0E0E0E0E0E007FFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA40000000000000000000000000000000000000000 + 00000000A407FFFFA4E0E0E0E0E0E0E0E0E0E0E0E0E0E007FFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA400000000000000000000000000A407FFFFFFFFFF + FFFFFFFFFFA4A4E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0A4FFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA40000000000000000000000000007FFFFE0E0E0E0 + E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E007FFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA400000000000000000000000000FFFFE0E0E0E0E0 + E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0A4FFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA400000000000000000000000000FF07E0E0E0E0E0 + E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0A4FFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA400000000000000000000000000FF07E0E0E0E0E0 + E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E007FFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA400000000000000000000000000FF07E0E0E0E0E0 + E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0A4FFFFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA400000000000000000000000000FF07E0E0E0E0E0 + E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0A407FFFFFFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA400000000000000000000000000A4FFFFA4E0E0E0 + E0E0E0E0E0E0E0A4A4A4A4070707FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFA400000000000000000000000000000007FFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFFF0000000000000000000000000000000000A4A4A4 + A4A4A4A4A4A4A4A4A4A4A4FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFFF0000000000000000000000000000000000000000 + 0000000000000000000000A4FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFFFA400000000000000000000000000000000000000 + 00000000000000000000000007FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFFFFF00000000000000000000000000000000000000 + 000000000000000000000000A4FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFFFFF07000000000000000000000000000000000000 + 000000000000000000000000A4FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFFFFFFF070000000000000000000000000000000000 + 00000000000000000000000007FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFFFFFFFFF0700000000000000000000000000000000 + 000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFFFFFFFFFFFFFFFA4A4A4A4A4A4A4A4A4A4A4A4A4A4 + A4A4A4A4A4A4A4A4A407FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF07E007 + 000007E007FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF07E007 + 000007E0A4070707070707070707070707070707070707070707070707070707 + 0707070707070707070707070707070707070707070707070707070707A4E007 + 000007E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0 + E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E007 + 0000FF0707070707070707070707070707070707070707070707070707070707 + 07070707070707070707070707070707070707070707070707070707070707FF + 0000} + end + object Label1: TLabel + Left = 248 + Top = 8 + Width = 173 + Height = 29 + Alignment = taRightJustify + Caption = 'FastReport 4' + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -24 + Font.Name = 'Verdana' + Font.Style = [fsBold] + ParentFont = False + Transparent = True + end + object Label2: TLabel + Left = 315 + Top = 40 + Width = 107 + Height = 13 + Alignment = taRightJustify + Caption = 'SDAC engine Demo' + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + ParentFont = False + Transparent = True + end + object Label3: TLabel + Left = 308 + Top = 60 + Width = 104 + Height = 13 + Caption = 'http://crlab.com/sdac' + end + object DesignB: TButton + Left = 270 + Top = 308 + Width = 75 + Height = 25 + Caption = 'Design' + TabOrder = 0 + OnClick = DesignBClick + end + object PreviewB: TButton + Left = 350 + Top = 308 + Width = 75 + Height = 25 + Caption = 'Preview' + TabOrder = 1 + OnClick = PreviewBClick + end + object frxReport1: TfrxReport + DotMatrixReport = False + EngineOptions.MaxMemSize = 10000000 + IniFile = '\Software\Fast Reports' + PreviewOptions.Buttons = [pbPrint, pbLoad, pbSave, pbExport, pbZoom, pbFind, pbOutline, pbPageSetup, pbTools, pbEdit, pbNavigator] + PreviewOptions.Zoom = 1.000000000000000000 + PrintOptions.Printer = 'Default' + + ReportOptions.CreateDate = 37871.996156840300000000 + ReportOptions.Description.Strings = ( + 'Demonstrates how to create Master/Detail SDAC report.') + ReportOptions.LastChange = 38243.741283449090000000 + ScriptLanguage = 'PascalScript' + ScriptText.Strings = ( + 'begin' + '' + 'end.') + Left = 136 + Top = 176 + Datasets = < + item + DataSet = ReportData.DeptDS + DataSetName = 'Dept' + end + item + DataSet = ReportData.EmpDS + DataSetName = 'Emp' + end> + Variables = <> + Style = <> + object Page1: TfrxReportPage + PaperWidth = 210.000000000000000000 + PaperHeight = 297.000000000000000000 + PaperSize = 9 + LeftMargin = 5.000000000000000000 + RightMargin = 5.000000000000000000 + TopMargin = 5.000000000000000000 + BottomMargin = 5.000000000000000000 + Columns = 1 + ColumnWidth = 210.000000000000000000 + ColumnPositions.Strings = ( + '0') + PrintOnPreviousPage = True + object Band1: TfrxPageFooter + Height = 22.677180000000000000 + Top = 298.582870000000000000 + Width = 755.906000000000000000 + object Memo5: TfrxMemoView + Left = 3.779530000000000000 + Top = 3.779530000000020000 + Width = 706.772110000000000000 + Height = 15.118120000000000000 + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -11 + Font.Name = 'Arial' + Font.Style = [] + Frame.Typ = [ftTop] + Frame.Width = 2.000000000000000000 + HAlign = haRight + Memo.Strings = ( + '[Page#]') + ParentFont = False + end + end + object Band2: TfrxReportTitle + Height = 26.456710000000000000 + Top = 18.897650000000000000 + Width = 755.906000000000000000 + object Memo6: TfrxMemoView + Left = 3.779530000000000000 + Top = 3.779530000000000000 + Width = 706.772110000000000000 + Height = 18.897650000000000000 + Color = clTeal + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -16 + Font.Name = 'Arial' + Font.Style = [fsBold] + HAlign = haCenter + Memo.Strings = ( + 'Dept') + ParentFont = False + VAlign = vaBottom + end + end + object Band3: TfrxPageHeader + Height = 22.677180000000000000 + Top = 68.031540000000000000 + Width = 755.906000000000000000 + object Memo22: TfrxMemoView + Left = 3.779530000000000000 + Top = 3.779529999999990000 + Width = 706.772110000000000000 + Height = 15.118120000000000000 + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -13 + Font.Name = 'Arial' + Font.Style = [fsBold] + Frame.Typ = [ftTop] + Frame.Width = 2.000000000000000000 + ParentFont = False + end + end + object Band4: TfrxMasterData + Height = 45.354360000000000000 + Top = 151.181200000000000000 + Width = 755.906000000000000000 + Columns = 1 + ColumnWidth = 200.000000000000000000 + ColumnGap = 20.000000000000000000 + DataSet = ReportData.DeptDS + DataSetName = 'Dept' + RowCount = 0 + object Memo23: TfrxMemoView + Left = 11.338590000000000000 + Width = 113.385826771654000000 + Height = 18.897650000000000000 + Color = clNavy + DataSet = ReportData.DeptDS + DataSetName = 'Dept' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -13 + Font.Name = 'Arial' + Font.Style = [] + Frame.Typ = [ftTop] + Memo.Strings = ( + 'No') + ParentFont = False + VAlign = vaCenter + end + object Memo24: TfrxMemoView + Left = 11.338590000000000000 + Top = 18.897650000000000000 + Width = 113.385826771654000000 + Height = 26.456710000000000000 + Color = clNavy + DataField = 'DEPTNO' + DataSet = ReportData.DeptDS + DataSetName = 'Dept' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -19 + Font.Name = 'Arial' + Font.Style = [fsItalic] + Memo.Strings = ( + 'Dept.DeptNo') + ParentFont = False + VAlign = vaCenter + end + object Memo25: TfrxMemoView + Left = 124.724409450000000000 + Width = 302.362204720000000000 + Height = 18.897650000000000000 + Color = clNavy + DataSet = ReportData.DeptDS + DataSetName = 'Dept' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -13 + Font.Name = 'Arial' + Font.Style = [] + Frame.Typ = [ftTop] + Memo.Strings = ( + 'Name') + ParentFont = False + VAlign = vaCenter + end + object Memo26: TfrxMemoView + Left = 427.086614173228000000 + Width = 162.519790000000000000 + Height = 18.897650000000000000 + Color = clNavy + DataSet = ReportData.DeptDS + DataSetName = 'Dept' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -13 + Font.Name = 'Arial' + Font.Style = [] + Frame.Typ = [ftTop] + Memo.Strings = ( + 'Location') + ParentFont = False + VAlign = vaCenter + end + object Memo27: TfrxMemoView + Left = 124.724409450000000000 + Top = 18.897650000000000000 + Width = 302.362204724409000000 + Height = 26.456710000000000000 + Color = clNavy + DataField = 'DNAME' + DataSet = ReportData.DeptDS + DataSetName = 'Dept' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -19 + Font.Name = 'Arial' + Font.Style = [fsItalic] + Memo.Strings = ( + 'Dept.DName') + ParentFont = False + VAlign = vaCenter + end + object Memo28: TfrxMemoView + Left = 427.086614170000000000 + Top = 18.897650000000000000 + Width = 162.519790000000000000 + Height = 26.456710000000000000 + Color = clNavy + DataField = 'LOC' + DataSet = ReportData.DeptDS + DataSetName = 'Dept' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -19 + Font.Name = 'Arial' + Font.Style = [fsItalic] + Memo.UTF8 = ( + 'Dept.Loc') + ParentFont = False + VAlign = vaCenter + end + object Memo29: TfrxMemoView + Left = 589.606299212598000000 + Width = 120.944881889764000000 + Height = 45.354360000000000000 + Color = clNavy + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -19 + Font.Name = 'Arial' + Font.Style = [fsBold, fsItalic] + Frame.Typ = [ftRight, ftTop] + ParentFont = False + VAlign = vaCenter + end + object Memo7: TfrxMemoView + Left = 3.779530000000000000 + Width = 7.559060000000000000 + Height = 45.354360000000000000 + Color = clNavy + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -19 + Font.Name = 'Arial' + Font.Style = [fsBold, fsItalic] + Frame.Typ = [ftLeft, ftTop] + ParentFont = False + VAlign = vaCenter + end + end + object Band5: TfrxDetailData + Height = 18.897650000000000000 + Top = 219.212740000000000000 + Width = 755.906000000000000000 + Columns = 1 + ColumnWidth = 200.000000000000000000 + ColumnGap = 20.000000000000000000 + DataSet = ReportData.EmpDS + DataSetName = 'Emp' + RowCount = 0 + object Memo4: TfrxMemoView + Left = 3.779530000000000000 + Width = 3.779530000000000000 + Height = 18.897650000000000000 + Color = clSilver + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -13 + Font.Name = 'Arial' + Font.Style = [fsBold] + Frame.Typ = [ftLeft] + ParentFont = False + end + object Memo8: TfrxMemoView + Left = 7.559060000000000000 + Width = 117.165430000000000000 + Height = 18.897650000000000000 + Color = clSilver + DataField = 'ENAME' + DataSet = ReportData.EmpDS + DataSetName = 'Emp' + Memo.Strings = ( + 'ENAME') + end + object Memo9: TfrxMemoView + Left = 124.724490000000000000 + Width = 362.834880000000000000 + Height = 18.897650000000000000 + Color = clSilver + DataField = 'JOB' + DataSet = ReportData.EmpDS + DataSetName = 'Emp' + Frame.Typ = [ftRight] + Memo.Strings = ( + 'JOB') + end + object Memo1: TfrxMemoView + Left = 487.559370000000000000 + Width = 222.992147950000000000 + Height = 18.897650000000000000 + Color = clSilver + DataField = 'SAL' + DataSet = ReportData.EmpDS + DataSetName = 'Emp' + Frame.Typ = [ftRight] + Memo.Strings = ( + 'SAL') + end + end + end + end + object frxDesigner1: TfrxDesigner + Restrictions = [] + Left = 260 + Top = 144 + end + object frxBarCodeObject1: TfrxBarCodeObject + Left = 228 + Top = 208 + end + object frxRichObject1: TfrxRichObject + Left = 228 + Top = 176 + end + object frxChartObject1: TfrxChartObject + Left = 260 + Top = 176 + end + object frxDialogControls1: TfrxDialogControls + Left = 292 + Top = 176 + end + object ImageList1: TImageList + Left = 324 + Top = 144 + Bitmap = { + 494C010102000400040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000001000000001002000000000000010 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000008400000084000000840000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000008400000000000000000000008400000084000000840000008400000084 + 0000008400000084000000840000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000840000FFFFFF0000000000000000000000000084848400C6C6C600C6C6 + C600FFFFFF00FFFFFF0000840000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000084 + 000000840000FFFFFF0000000000C6C6C600FFFFFF0084848400000000000000 + 000000000000FFFFFF0000840000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008400000084 + 0000FFFFFF00FFFFFF0000000000C6C6C600FFFFFF00FFFFFF00FFFFFF00FFFF + FF0084848400FFFFFF0000840000000000000000000000000000000000000000 + 0000000000000000000000840000008400000084000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000840000FFFF + FF00FFFFFF00FFFFFF0000000000C6C6C600FFFFFF00FFFFFF00FFFFFF00FFFF + FF0084848400FFFFFF0000840000000000000000000000000000000000000000 + 0000000000000084000000840000008400000084000000840000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000840000FFFF + FF00FFFFFF00FFFFFF0000000000C6C6C600FFFFFF00FFFFFF00FFFFFF00FFFF + FF0084848400FFFFFF0000840000000000000000000000000000000000000000 + 0000000000000084000000FF0000008400000084000000840000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000840000FFFF + FF00FFFFFF00FFFFFF0000000000C6C6C600FFFFFF00FFFFFF00FFFFFF00FFFF + FF0084848400FFFFFF0000840000000000000000000000000000000000000000 + 0000000000000084000000FF000000FF00000084000000840000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000840000FFFF + FF00FFFFFF00FFFFFF0000000000C6C6C600FFFFFF00FFFFFF00FFFFFF00FFFF + FF0084848400FFFFFF0000840000000000000000000000000000000000000000 + 0000000000000000000000840000008400000084000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000840000FFFF + FF00FFFFFF00FFFFFF0000000000C6C6C600FFFFFF00FFFFFF00FFFFFF00FFFF + FF0084848400FFFFFF0000840000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000840000FFFF + FF00FFFFFF00C6C6C6008484840084848400FFFFFF00FFFFFF00FFFFFF00FFFF + FF00848484000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000840000FFFF + FF00FFFFFF008484840000000000000000008484840084848400FFFFFF00FFFF + FF00848484000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000840000FFFF + FF00C6C6C6008484840000000000000000000000000000000000848484008484 + 8400848484000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000084848400C6C6 + C600848484000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008484 + 8400000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000100000000100010000000000800000000000000000000000 + 000000000000000000000000FFFFFF00F1FFFFFF00000000E000FFFF00000000 + E000FFFF00000000E000FFFF00000000C000FFFF000000008000FC7F00000000 + 8000F83F000000008000F83F000000008000F83F000000008000FC7F00000000 + 8000FFFF000000008001FFFF000000008307FFFF0000000083C7FFFF00000000 + C7FFFFFF00000000EFFFFFFF0000000000000000000000000000000000000000 + 000000000000} + end + object frxOLEObject1: TfrxOLEObject + Left = 324 + Top = 176 + end + object frxCrossObject1: TfrxCrossObject + Left = 292 + Top = 208 + end + object frxDotMatrixExport1: TfrxDotMatrixExport + EscModel = 0 + GraphicFrames = False + SaveToFile = False + UseIniSettings = True + Left = 324 + Top = 208 + end + object frxBMPExport1: TfrxBMPExport + Left = 112 + Top = 248 + end + object frxJPEGExport1: TfrxJPEGExport + Left = 144 + Top = 248 + end + object frxTIFFExport1: TfrxTIFFExport + Left = 176 + Top = 248 + end + object frxTXTExport1: TfrxTXTExport + ScaleWidth = 1.000000000000000000 + ScaleHeight = 1.000000000000000000 + Borders = True + Pseudogrpahic = False + PageBreaks = True + OEMCodepage = False + EmptyLines = True + LeadSpaces = True + PrintAfter = False + PrinterDialog = True + UseSavedProps = True + ShowProgress = True + Left = 240 + Top = 248 + end + object frxHTMLExport1: TfrxHTMLExport + FixedWidth = True + Left = 272 + Top = 248 + end + object frxXLSExport1: TfrxXLSExport + ShowProgress = True + Left = 304 + Top = 248 + end + object frxXMLExport1: TfrxXMLExport + ShowProgress = True + Left = 336 + Top = 248 + end + object frxRTFExport1: TfrxRTFExport + ShowProgress = True + Left = 208 + Top = 248 + end + object frxGZipCompressor1: TfrxGZipCompressor + Left = 260 + Top = 80 + end + object frxSDACComponents1: TfrxSDACComponents + Left = 256 + Top = 208 + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Demo/Unit1.pas b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Demo/Unit1.pas new file mode 100644 index 0000000..8c14407 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Demo/Unit1.pas @@ -0,0 +1,74 @@ +unit Unit1; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + StdCtrls, Db, DBTables, frxDesgn, frxClass, frxDCtrl, frxBDEComponents, + frxChart, frxRich, frxBarcode, ImgList, ComCtrls, ExtCtrls, frxOLE, + frxCross, frxDMPExport, frxExportImage, frxExportRTF, frxExportTXT, + frxExportXML, frxExportXLS, frxExportHTML, frxGZip, frxExportPDF, + frxSDACComponents, frxDACComponents; + +type + TForm1 = class(TForm) + DesignB: TButton; + frxDesigner1: TfrxDesigner; + frxBarCodeObject1: TfrxBarCodeObject; + frxRichObject1: TfrxRichObject; + frxChartObject1: TfrxChartObject; + frxDialogControls1: TfrxDialogControls; + ImageList1: TImageList; + PreviewB: TButton; + Image1: TImage; + Label1: TLabel; + Label2: TLabel; + Label3: TLabel; + frxOLEObject1: TfrxOLEObject; + frxCrossObject1: TfrxCrossObject; + frxDotMatrixExport1: TfrxDotMatrixExport; + frxBMPExport1: TfrxBMPExport; + frxJPEGExport1: TfrxJPEGExport; + frxTIFFExport1: TfrxTIFFExport; + frxTXTExport1: TfrxTXTExport; + frxHTMLExport1: TfrxHTMLExport; + frxXLSExport1: TfrxXLSExport; + frxXMLExport1: TfrxXMLExport; + frxRTFExport1: TfrxRTFExport; + frxGZipCompressor1: TfrxGZipCompressor; + frxSDACComponents1: TfrxSDACComponents; + frxReport1: TfrxReport; + procedure DesignBClick(Sender: TObject); + procedure PreviewBClick(Sender: TObject); + procedure FormShow(Sender: TObject); + private + { Private declarations } + WPath: String; + public + { Public declarations } + end; + +var + Form1: TForm1; + +implementation + +{$R *.DFM} + +procedure TForm1.FormShow(Sender: TObject); +begin + WPath := ExtractFilePath(Application.ExeName); + TfrxPDFExport.Create(nil); +end; + +procedure TForm1.DesignBClick(Sender: TObject); +begin + frxReport1.DesignReport; +end; + +procedure TForm1.PreviewBClick(Sender: TObject); +begin + frxReport1.ShowReport; +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Demo/Unit2.dfm b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Demo/Unit2.dfm new file mode 100644 index 0000000..7dd8aec --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Demo/Unit2.dfm @@ -0,0 +1,60 @@ +object ReportData: TReportData + OldCreateOrder = False + Left = 422 + Top = 104 + Height = 220 + Width = 254 + object MSConnection: TMSConnection + Database = 'test' + Username = 'root' + Server = 'Server' + Left = 24 + Top = 16 + end + object Dept: TMSTable + TableName = 'dept' + Connection = MSConnection + FetchAll = True + Left = 96 + Top = 16 + end + object Emp: TMSTable + TableName = 'emp' + MasterFields = 'DEPTNO' + DetailFields = 'DEPTNO' + MasterSource = DeptSource + Connection = MSConnection + FetchAll = True + Left = 168 + Top = 16 + ParamData = < + item + DataType = ftInteger + Name = 'DEPTNO' + ParamType = ptInput + Value = 60 + end> + end + object DeptSource: TDataSource + DataSet = Dept + Left = 96 + Top = 64 + end + object EmpSource: TDataSource + DataSet = Emp + Left = 168 + Top = 64 + end + object DeptDS: TfrxDBDataset + UserName = 'Dept' + DataSource = DeptSource + Left = 96 + Top = 112 + end + object EmpDS: TfrxDBDataset + UserName = 'Emp' + DataSource = EmpSource + Left = 168 + Top = 112 + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Demo/Unit2.pas b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Demo/Unit2.pas new file mode 100644 index 0000000..2f34471 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/Demo/Unit2.pas @@ -0,0 +1,31 @@ +unit Unit2; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + frxDBSet, DBTables, Db, frxClass, MemDS, DBAccess, MSAccess; + +type + TReportData = class(TDataModule) + MSConnection: TMSConnection; + Dept: TMSTable; + Emp: TMSTable; + DeptSource: TDataSource; + EmpSource: TDataSource; + DeptDS: TfrxDBDataset; + EmpDS: TfrxDBDataset; + private + { Private declarations } + public + { Public declarations } + end; + +var + ReportData: TReportData; + +implementation + +{$R *.DFM} + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/ReadMe.txt b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/ReadMe.txt new file mode 100644 index 0000000..1480865 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/ReadMe.txt @@ -0,0 +1,37 @@ +SQL Server Data Access Components +Copyright 1997-2007, Core Lab. All Rights Reserved +-------------------------------------------------- + +Demo for FastReport included in SDAC was built and tested using +Fast Report 4.0. + +IMPORTANT NOTE: + Demo is provided as is, and there is no warranty that it is fully + compatible with other versions of Fast Report. + +Before using Demo you should install FastReport 4 SDAC Components. +The following instruction will help you to compile and install +FastReport 4 SDAC Components manually using IDE. + +Delphi and C++Builder for Win32 +-------------------------------- + +Run your IDE and walk through the following steps: + 1) Compile DAC run-time package (frxDACXX.dpk) + 2) Compile SDAC run-time package (frxSDACXX.dpk) + 3) Compile and install SDAC design-time package (dclfrxSDACXX.dpk) + +You can find these packages in + Demos\Win32\ThirdParty\FastReport\FR4\Delphi5\*.dpk - for Delphi 5 + Demos\Win32\ThirdParty\FastReport\FR4\Delphi6\*.dpk - for Delphi 6 + Demos\Win32\ThirdParty\FastReport\FR4\Delphi7\*.dpk - for Delphi 7 + Demos\Win32\ThirdParty\FastReport\FR4\Delphi9\*.dpk - for Delphi 2005 + Demos\Win32\ThirdParty\FastReport\FR4\Delphi10\*.dpk - for Delphi 2006 + Demos\Win32\ThirdParty\FastReport\FR4\Delphi11\*.dpk - for Delphi 2007 + Demos\Win32\ThirdParty\FastReport\FR4\CBuilder5\*.bpk - for C++Builder 5 + Demos\Win32\ThirdParty\FastReport\FR4\CBuilder6\*.bpk - for C++Builder 6 + +To compile applications based on FastReport 4 SDAC Components, add the following +path to the "Library Path": +%SDAC%\Demos\Win32\ThirdParty\FastReport\FR4\ +where %SDAC% is the SDAC installation path on your computer. \ No newline at end of file diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/file_id.diz b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/file_id.diz new file mode 100644 index 0000000..17e48ec --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/file_id.diz @@ -0,0 +1,5 @@ +SDAC components for FastReport 4.0 + + +Created by: CoreLab +E-mail: sdac@crlab.com diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/frxDACComponents.pas b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/frxDACComponents.pas new file mode 100644 index 0000000..2640228 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/frxDACComponents.pas @@ -0,0 +1,513 @@ + +{******************************************} +{ } +{ FastReport v4.0 } +{ DAC enduser components } +{ } + +// Created by: CoreLab +// E-mail: support@crlab.com + +{ } +{******************************************} + +unit frxDACComponents; + +interface + +{$I frx.inc} + +uses + Windows, SysUtils, Classes, frxClass, frxCustomDB, DB, DBAccess, Graphics +{$IFDEF Delphi6} +, Variants +{$ENDIF} + {$IFDEF QBUILDER} +, fqbClass + {$ENDIF} +; + +type + + TfrxDACComponentsClass = class of TfrxDACComponents; + TfrxDACDatabaseClass = class of TfrxDACDatabase; + TfrxDACTableClass = class of TfrxDACTable; + TfrxDACQueryClass = class of TfrxDACQuery; + + TfrxDACComponents = class(TfrxDBComponents) + protected + FDefaultDatabase: TCustomDAConnection; + public + function GetDescription: string; override; + + class function GetComponentsBitmap: TBitmap; virtual; + class function GetComponentsName: string; virtual; + class function ResourceName: string; virtual; abstract; + class function GetDatabaseClass: TfrxDACDatabaseClass; virtual; abstract; + class function GetTableClass: TfrxDACTableClass; virtual; abstract; + class function GetQueryClass: TfrxDACQueryClass; virtual; abstract; + + property DefaultDatabase: TCustomDAConnection read FDefaultDatabase write FDefaultDatabase; + end; + + TfrxDACDatabase = class(TfrxCustomDatabase) + protected + FDatabase: TCustomDAConnection; + FParams: Tstrings; + function GetLoginPrompt: Boolean; override; + procedure SetLoginPrompt(Value: Boolean); override; + function GetUsername: string; + procedure SetUsername(const Value: string); + function GetPassword: string; + procedure SetPassword(const Value: string); + function GetServer: string; + procedure SetServer(const Value: string); + function GetConnected: Boolean; override; + procedure SetConnected(Value: Boolean); override; + function GetParams: Tstrings; override; + procedure SetParams(Value: Tstrings); override; + protected + + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + class function GetDescription: string; override; + procedure SetLogin(const Login, Password: string); override; + property Database: TCustomDAConnection read FDatabase write FDatabase; + property Username: string read GetUsername write SetUsername; + property Password: string read GetPassword write SetPassword; + property Server: string read GetServer write SetServer; + Property Params: Tstrings read GetParams write SetParams; + end; + + TfrxDACTable = class(TfrxCustomTable) + private + FDatabase: TfrxDACDatabase; + protected + procedure SetDatabase(const Value: TfrxDACDatabase); virtual; + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + + public + constructor Create(AOwner: TComponent); override; + constructor DesignCreate(AOwner: TComponent; Flags: Word); override; + class function GetDescription: string; override; + procedure BeforeStartReport; override; + property Database: TfrxDACDatabase read FDatabase write SetDatabase; + end; + + TfrxDACQuery = class(TfrxCustomQuery) + private + FDatabase: TfrxDACDatabase; + protected + FQuery: TCustomDADataSet; + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + procedure SetMaster(const Value: TDataSource); override; + procedure SetSQL(Value: Tstrings); override; + function GetSQL: Tstrings; override; + procedure SetDatabase(const Value: TfrxDACDatabase); virtual; + procedure SetIndexName(const Value: string); + function GetIndexName: string; + procedure SetMasterFields(const Value: string); override; + public + constructor Create(AOwner: TComponent); override; + constructor DesignCreate(AOwner: TComponent; Flags: Word); override; + class function GetDescription: string; override; + procedure BeforeStartReport; override; + procedure UpdateParams; override; + property Query: TCustomDADataSet read FQuery; + property Database: TfrxDACDatabase read FDatabase write SetDatabase; + property IndexName: string read GetIndexName write SetIndexName; + end; + + {$IFDEF QBUILDER} + TfrxEngineDAC = class(TfqbEngine) + protected + FQuery: TCustomDADataSet; + public + procedure ReadTableList(ATableList: Tstrings); override; + function ResultDataSet: TDataSet; override; + procedure SetSQL(const Value: string); override; + end; + {$ENDIF} + + procedure SetDelimitedText(strings: Tstrings; Delimiter:Char; const Value: string); + procedure GetMasterDetailNames(const Value: string; var MasterNames: string; var DetailNames: string); + procedure RegisterDacComponents(Components: TfrxDACComponentsClass); + procedure UnRegisterDacComponents(Components: TfrxDACComponentsClass); + +implementation + +uses +{$IFNDEF NO_EDITORS} + frxDACEditor, +{$ENDIF} + frxDsgnIntf, frxRes; + +procedure RegisterDacComponents(Components: TfrxDACComponentsClass); +begin + frxObjects.RegisterCategory(Components.GetComponentsName, Components.GetComponentsBitmap, Components.GetComponentsName + ' Components'); + frxObjects.RegisterObject1(Components.GetDatabaseClass, nil, '', Components.GetComponentsName, 0, 37); + frxObjects.RegisterObject1(Components.GetTableClass, nil, '', Components.GetComponentsName, 0, 38); + frxObjects.RegisterObject1(Components.GetQueryClass, nil, '', Components.GetComponentsName, 0, 39); +end; + +procedure UnRegisterDacComponents(Components: TfrxDACComponentsClass); +begin + frxObjects.UnRegister(Components.GetDatabaseClass); + frxObjects.UnRegister(Components.GetTableClass); + frxObjects.UnRegister(Components.GetQueryClass); +end; + +{$IFNDEF VER6P} +procedure SetDelimitedText(strings: Tstrings; Delimiter:Char; const Value: string); +var + P, P1: PChar; + S: string; +begin + with strings do begin + BeginUpdate; + try + Clear; + P := PChar(Value); + while P^ in [#1..' '] do + {$IFDEF MSWINDOWS} + P := CharNext(P); + {$ELSE} + Inc(P); + {$ENDIF} + while P^ <> #0 do begin + if P^ = '"' then + S := AnsiExtractQuotedStr(P, '"') + else begin + P1 := P; + while (P^ > ' ') and (P^ <> Delimiter) do + {$IFDEF MSWINDOWS} + P := CharNext(P); + {$ELSE} + Inc(P); + {$ENDIF} + Setstring(S, P1, P - P1); + end; + Add(S); + while P^ in [#1..' '] do + {$IFDEF MSWINDOWS} + P := CharNext(P); + {$ELSE} + Inc(P); + {$ENDIF} + if P^ = Delimiter then begin + P1 := P; + {$IFDEF MSWINDOWS} + if CharNext(P1)^ = #0 then + {$ELSE} + Inc(P1); + if P1^ = #0 then + {$ENDIF} + Add(''); + repeat + {$IFDEF MSWINDOWS} + P := CharNext(P); + {$ELSE} + Inc(P); + {$ENDIF} + until not (P^ in [#1..' ']); + end; + end; + finally + EndUpdate; + end; + end; +end; +{$ENDIF} + +procedure GetMasterDetailNames(const Value: string; var MasterNames: string; var DetailNames: string); +var + List: TstringList; + i: integer; +begin + List := TstringList.Create; + try +{$IFNDEF VER6P} + SetDelimitedText(List, ';', Value); +{$ELSE} + List.Delimiter := ';'; + List.DelimitedText := Value; +{$ENDIF} + MasterNames := ''; + DetailNames := ''; + for i := 0 to List.Count - 1 do begin + if MasterNames <> '' then + MasterNames := MasterNames + ';'; + if DetailNames <> '' then + DetailNames := DetailNames + ';'; + MasterNames := MasterNames + List.Values[List.Names[i]]; + DetailNames := DetailNames + List.Names[i]; + end; + finally + List.Free; + end; +end; + +{ TfrxDACComponents } + +class function TfrxDACComponents.GetComponentsBitmap: TBitmap; +begin + Result := nil; +end; + +class function TfrxDACComponents.GetComponentsName: string; +begin + result := 'DAC'; +end; + +function TfrxDACComponents.GetDescription: string; +begin + Result := 'DAC'; +end; + +{ TfrxDACDatabase } + +function TfrxDACDatabase.GetParams: Tstrings; +begin + Result := FParams; +end; + +procedure TfrxDACDatabase.SetParams(Value: Tstrings); +begin + FParams := Value; +end; + +constructor TfrxDACDatabase.Create(AOwner: TComponent); +begin + inherited; + FParams := TstringList.Create; +end; + +destructor TfrxDACDatabase.Destroy; +begin + inherited; +end; + +class function TfrxDACDatabase.GetDescription: string; +begin + Result := 'DAC Database'; +end; + +function TfrxDACDatabase.GetConnected: Boolean; +begin + Result := FDatabase.Connected; +end; + +function TfrxDACDatabase.GetUsername: string; +begin + Result := FDatabase.Username; +end; + +function TfrxDACDatabase.GetPassword: string; +begin + Result := FDatabase.Password +end; + +function TfrxDACDatabase.GetServer: string; +begin + Result := FDatabase.Server; +end; + +function TfrxDACDatabase.GetLoginPrompt: Boolean; +begin + Result := FDatabase.LoginPrompt; +end; + +procedure TfrxDACDatabase.SetConnected(Value: Boolean); +begin + FDatabase.Connected := Value; +end; + +procedure TfrxDACDatabase.SetUsername(const Value: string); +begin + FDatabase.Username := Value; +end; + +procedure TfrxDACDatabase.SetPassword(const Value: string); +begin + FDatabase.Password := Value; +end; + +procedure TfrxDACDatabase.SetServer(const Value: string); +begin + FDatabase.Server := Value; +end; + +procedure TfrxDACDatabase.SetLoginPrompt(Value: Boolean); +begin + FDatabase.LoginPrompt := Value; +end; + +procedure TfrxDACDatabase.SetLogin(const Login, Password: string); +begin + Self.UserName := Login; + Self.Password := Password; +end; + +{ TfrxDACTable } + +constructor TfrxDACTable.Create(AOwner: TComponent); +begin + SetDatabase(nil); + inherited; +end; + +constructor TfrxDACTable.DesignCreate(AOwner: TComponent; Flags: Word); +var + i: Integer; + l: TList; +begin + inherited; + l := Report.AllObjects; + for i := 0 to l.Count - 1 do + if TObject(l[i]) is TfrxDACDatabase then + begin + Database := TfrxDACDatabase(l[i]); + break; + end; +end; + +class function TfrxDACTable.GetDescription: string; +begin + Result := 'DAC Table'; +end; + +procedure TfrxDACTable.BeforeStartReport; +begin + SetDatabase(FDatabase); +end; + +procedure TfrxDACTable.Notification(AComponent: TComponent; Operation: TOperation); +begin + inherited; + if (Operation = opRemove) and (AComponent = FDatabase) then + SetDatabase(nil); +end; + +procedure TfrxDACTable.SetDatabase(const Value: TfrxDACDatabase); +begin + FDatabase := Value; +end; + +{ TfrxDACQuery } + +constructor TfrxDACQuery.Create(AOwner: TComponent); +begin + Dataset := FQuery; + Database := nil; + inherited Create(AOwner); +end; + +constructor TfrxDACQuery.DesignCreate(AOwner: TComponent; Flags: Word); +var + i: Integer; + l: TList; +begin + inherited; + l := Report.AllObjects; + for i := 0 to l.Count - 1 do + if TObject(l[i]) is TfrxDACDatabase then + begin + SetDatabase(TfrxDACDatabase(l[i])); + break; + end; +end; + +class function TfrxDACQuery.GetDescription: string; +begin + Result := 'DAC Query'; +end; + +procedure TfrxDACQuery.Notification(AComponent: TComponent; Operation: TOperation); +begin + inherited; + if (Operation = opRemove) and (AComponent = FDatabase) then + SetDatabase(nil); +end; + +procedure TfrxDACQuery.SetDatabase(const Value: TfrxDACDatabase); +begin + FDatabase := Value; +end; + +procedure TfrxDACQuery.SetIndexName(const Value: string); +begin + FQuery.IndexFieldNames := Value; +end; + +function TfrxDACQuery.GetIndexName: string; +begin + Result := FQuery.IndexFieldNames; +end; + +function TfrxDACQuery.GetSQL: Tstrings; +begin + Result := FQuery.SQL; +end; + +procedure TfrxDACQuery.SetSQL(Value: Tstrings); +begin + FQuery.SQL := Value; +end; + +procedure TfrxDACQuery.SetMaster(const Value: TDataSource); +begin + FQuery.MasterSource := Value; +end; + +procedure TfrxDACQuery.BeforeStartReport; +begin + SetDatabase(FDatabase); + { needed to update parameters } + SQL.Text := SQL.Text; +end; + +procedure TfrxDACQuery.UpdateParams; +var + i: integer; +begin // Bug with ftCursor datatype + for i := 0 to Params.Count - 1 do // Problem with calling static method + if FQuery.Params.FindParam(Params[i].Name) <> nil then // TParam.SetDataType instead TOraParam.SetDataType + FQuery.ParamByName(Params[i].Name).DataType := Params[i].DataType; + + frxParamsToTParams(Self, FQuery.Params); +end; + +procedure TfrxDACQuery.SetMasterFields(const Value: string); +var + MasterNames: string; + DetailNames: string; +begin + GetMasterDetailNames(MasterFields, MasterNames, DetailNames); + FQuery.MasterFields := MasterNames; + FQuery.DetailFields := DetailNames; +end; + + {$IFDEF QBUILDER} + +{ TfrxEngineDAC } + +procedure TfrxEngineDAC.ReadTableList(ATableList: Tstrings); +begin + ATableList.Clear; + FQuery.Connection.GetTableNames(ATableList); +end; + +function TfrxEngineDAC.ResultDataSet: TDataSet; +begin + Result := FQuery; +end; + +procedure TfrxEngineDAC.SetSQL(const Value: string); +begin + FQuery.SQL.Text := Value; +end; + {$ENDIF} + +end. + diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/frxDACEditor.pas b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/frxDACEditor.pas new file mode 100644 index 0000000..6442791 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/frxDACEditor.pas @@ -0,0 +1,50 @@ + +{******************************************} +{ } +{ FastReport v4.0 } +{ DAC components design editors } +{ } + +// Created by: CoreLab +// E-mail: support@crlab.com + +{ } +{******************************************} + +unit frxDACEditor; + +interface + +{$I frx.inc} + +uses + Windows, Classes, SysUtils, Forms, Dialogs, frxDACComponents, frxCustomDB, + frxDsgnIntf, frxRes +{$IFDEF Delphi6} +, Variants +{$ENDIF}; + + +type + TfrxTableNameProperty = class(TfrxStringProperty) + public + function GetAttributes: TfrxPropertyAttributes; override; + procedure SetValue(const Value: String); override; + end; + +implementation + +{ TfrxTableNameProperty } + +function TfrxTableNameProperty.GetAttributes: TfrxPropertyAttributes; +begin + Result := [paMultiSelect, paValueList, paSortList]; +end; + +procedure TfrxTableNameProperty.SetValue(const Value: String); +begin + inherited; + Designer.UpdateDataTree; +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/frxSDACComponents.pas b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/frxSDACComponents.pas new file mode 100644 index 0000000..8731b84 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/frxSDACComponents.pas @@ -0,0 +1,404 @@ +{******************************************} +{ } +{ FastReport v4.0 } +{ SDAC enduser components } +{ } + +// Created by: CoreLab +// E-mail: sdac@crlab.com + +{ } +{******************************************} + +unit frxSDACComponents; + +interface + +{$I frx.inc} + +uses + Windows, SysUtils, Classes, frxClass, frxCustomDB, DB, MSAccess, OLEDBAccess, + Graphics, OLEDBC, SdacVcl, frxDACComponents + {$IFDEF Delphi6} +, Variants + {$ENDIF} + {$IFDEF QBUILDER} +, fqbClass + {$ENDIF} +; + +type + TSDACTable = class(TMSTable) + protected + procedure InitFieldDefs; override; + end; + + TSDACQuery = class(TMSQuery) + protected + procedure InitFieldDefs; override; + end; + + TfrxSDACComponents = class(TfrxDACComponents) + protected + FOldComponents: TfrxDACComponents; + function GetDefaultDatabase: TMSConnection; + procedure SetDefaultDatabase(Value: TMSConnection); + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + function GetDescription: string; override; + + class function GetComponentsBitmap: TBitmap; override; + class function GetComponentsName: string; override; + class function ResourceName: string; override; + class function GetDatabaseClass: TfrxDACDatabaseClass; override; + class function GetTableClass: TfrxDACTableClass; override; + class function GetQueryClass: TfrxDACQueryClass; override; + published + property DefaultDatabase: TMSConnection read GetDefaultDatabase write SetDefaultDatabase; + end; + + TfrxSDACDatabase = class(TfrxDACDatabase) + private + protected + function GetDatabaseName: string; override; + procedure SetDatabaseName(const Value: string); override; + + public + constructor Create(AOwner: TComponent); override; + class function GetDescription: string; override; + + published + property LoginPrompt; + property DatabaseName; + property Username; + property Password; + property Server; + property Connected; + Property Params; + end; + + TfrxSDACTable = class(TfrxDACTable) + private + FTable: TSDACTable; + protected + procedure SetDatabase(const Value: TfrxDACDatabase); override; + procedure SetMaster(const Value: TDataSource); override; + procedure SetMasterFields(const Value: string); override; + procedure SetIndexFieldNames(const Value: string); override; + function GetIndexFieldNames: string; override; + function GetTableName: string; override; + procedure SetTableName(const Value: string); override; + public + constructor Create(AOwner: TComponent); override; + class function GetDescription: string; override; + + property Table: TSDACTable read FTable; + published + property Database; + Property TableName: string read GetTableName write setTableName; + end; + + TfrxSDACQuery = class(TfrxDACQuery) + protected + procedure SetDatabase(const Value: TfrxDACDatabase); override; + public + constructor Create(AOwner: TComponent); override; + class function GetDescription: string; override; +{$IFDEF QBUILDER} + function QBEngine: TfqbEngine; override; +{$ENDIF} + published + property Database; + property IndexName; + property MasterFields; + end; + + {$IFDEF QBUILDER} + TfrxEngineSDAC = class(TfrxEngineDAC) + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure ReadFieldList(const ATableName: string; var AFieldList: TfqbFieldList); override; + end; + {$ENDIF} + +var + CatBmp: TBitmap; + SDACComponents: TfrxDACComponents; + +implementation + +{$R *.res} + +uses + frxSDACRTTI, +{$IFNDEF NO_EDITORS} + frxSDACEditor, +{$ENDIF} + frxDsgnIntf, frxRes; + +{ TSDACTable } + +procedure TSDACTable.InitFieldDefs; +begin + if (TableName <> '') and (Assigned(Connection)) then + inherited; +end; + +{ TSDACQuery } + +procedure TSDACQuery.InitFieldDefs; +begin + if (SQL.Text <> '') and Assigned(Connection) then + inherited; +end; + +{ TfrxSDACComponents } + +constructor TfrxSDACComponents.Create(AOwner: TComponent); +begin + inherited; + + FOldComponents := SDACComponents; + SDACComponents := Self; +end; + +destructor TfrxSDACComponents.Destroy; +begin + if SDACComponents = Self then + SDACComponents := FOldComponents; + + inherited; +end; + +function TfrxSDACComponents.GetDefaultDatabase: TMSConnection; +begin + Result := TMSConnection(FDefaultDatabase); +end; + +procedure TfrxSDACComponents.SetDefaultDatabase(Value: TMSConnection); +begin + FDefaultDatabase := Value; +end; + +class function TfrxSDACComponents.GetComponentsBitmap: TBitmap; +begin + Result := CatBmp; +end; + +class function TfrxSDACComponents.GetComponentsName: string; +begin + Result := 'SDAC'; +end; + +class function TfrxSDACComponents.GetDatabaseClass: TfrxDACDatabaseClass; +begin + Result := TfrxSDACDatabase; +end; + +class function TfrxSDACComponents.GetTableClass: TfrxDACTableClass; +begin + Result := TfrxSDACTable; +end; + +class function TfrxSDACComponents.GetQueryClass: TfrxDACQueryClass; +begin + Result := TfrxSDACQuery; +end; + +class function TfrxSDACComponents.ResourceName: string; +begin + Result := 'FRXSDACOBJECTS'; +end; + +function TfrxSDACComponents.GetDescription: string; +begin + Result := 'SDAC'; +end; + +{ TfrxSDACDatabase } + +constructor TfrxSDACDatabase.Create(AOwner: TComponent); +begin + inherited; + FDatabase := TMSConnection.Create(nil); + Component := FDatabase; +end; + +class function TfrxSDACDatabase.GetDescription: string; +begin + Result := 'SDAC Database'; +end; + +function TfrxSDACDatabase.GetDatabaseName: string; +begin + Result := TMSConnection(FDatabase).Database; +end; + +procedure TfrxSDACDatabase.SetDatabaseName(const Value: string); +begin + TMSConnection(FDatabase).Database := Value; +end; + +{ TfrxSDACTable } + +constructor TfrxSDACTable.Create(AOwner: TComponent); +begin + FTable := TSDACTable.Create(nil); + DataSet := FTable; + SetDatabase(nil); + inherited; +end; + +class function TfrxSDACTable.GetDescription: string; +begin + Result := 'SDAC Table'; +end; + +procedure TfrxSDACTable.SetDatabase(const Value: TfrxDACDatabase); +begin + inherited; + + if Value <> nil then + FTable.Connection := TMSConnection(Value.Database) + else + if SDACComponents <> nil then + FTable.Connection := TMSConnection(SDACComponents.DefaultDatabase) + else + FTable.Connection := nil; +end; + +function TfrxSDACTable.GetIndexFieldNames: string; +begin + Result := FTable.IndexFieldNames; +end; + +function TfrxSDACTable.GetTableName: string; +begin + Result := FTable.TableName; +end; + +procedure TfrxSDACTable.SetIndexFieldNames(const Value: string); +begin + FTable.IndexFieldNames := Value; +end; + +procedure TfrxSDACTable.SetTableName(const Value: string); +begin + FTable.TableName := Value; + if Assigned(FTable.Connection) then + FTable.InitFieldDefs; +end; + +procedure TfrxSDACTable.SetMaster(const Value: TDataSource); +begin + FTable.MasterSource := Value; +end; + +procedure TfrxSDACTable.SetMasterFields(const Value: string); +var + MasterNames: string; + DetailNames: string; +begin + GetMasterDetailNames(MasterFields, MasterNames, DetailNames); + FTable.MasterFields := MasterNames; + FTable.DetailFields := DetailNames; +end; + +{ TfrxSDACQuery } + +constructor TfrxSDACQuery.Create(AOwner: TComponent); +begin + FQuery := TSDACQuery.Create(nil); + + inherited Create(AOwner); +end; + +class function TfrxSDACQuery.GetDescription: string; +begin + Result := 'SDAC Query'; +end; + +procedure TfrxSDACQuery.SetDatabase(const Value: TfrxDACDatabase); +begin + inherited; + + if Value <> nil then + FQuery.Connection := Value.Database + else + if SDACComponents <> nil then + FQuery.Connection := TMSConnection(SDACComponents.DefaultDatabase) + else + FQuery.Connection := nil; +end; + +{$IFDEF QBUILDER} +function TfrxSDACQuery.QBEngine: TfqbEngine; +begin + Result := TfrxEngineSDAC.Create(nil); + TfrxEngineSDAC(Result).FQuery.Connection := TCustomMSConnection(FQuery.Connection); +end; +{$ENDIF} + +{$IFDEF QBUILDER} + +{ TfrxEngineSDAC } + +constructor TfrxEngineSDAC.Create(AOwner: TComponent); +begin + inherited; + FQuery := TSDACQuery.Create(Self); +end; + +destructor TfrxEngineSDAC.Destroy; +begin + FQuery.Free; + inherited; +end; + +procedure TfrxEngineSDAC.ReadFieldList(const ATableName: string; + var AFieldList: TfqbFieldList); +var + TempTable: TSDACTable; + Fields: TFieldDefs; + i: Integer; + tmpField: TfqbField; +begin + AFieldList.Clear; + TempTable := TSDACTable.Create(Self); + try + TempTable.Connection := TCustomMSConnection(FQuery.Connection); + TempTable.TableName := ATableName; + Fields := TempTable.FieldDefs; + try + TempTable.Active := True; + tmpField:= TfqbField(AFieldList.Add); + tmpField.FieldName := '*'; + for i := 0 to Fields.Count - 1 do begin + tmpField := TfqbField(AFieldList.Add); + tmpField.FieldName := Fields.Items[i].Name; + tmpField.FieldType := Ord(Fields.Items[i].DataType) + end; + except + end; + finally + TempTable.Free; + end; +end; + + {$ENDIF} + +initialization + CatBmp := TBitmap.Create; + CatBmp.LoadFromResourceName(hInstance, TfrxSDACComponents.ResourceName); + RegisterDacComponents(TfrxSDACComponents); + +finalization + UnRegisterDacComponents(TfrxSDACComponents); + CatBmp.Free; +end. + + + diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/frxSDACComponents.res b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/frxSDACComponents.res new file mode 100644 index 0000000..ec9bef9 Binary files /dev/null and b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/frxSDACComponents.res differ diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/frxSDACEditor.pas b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/frxSDACEditor.pas new file mode 100644 index 0000000..1e52fb5 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/frxSDACEditor.pas @@ -0,0 +1,77 @@ + +{******************************************} +{ } +{ FastReport v4.0 } +{ SDAC components design editors } +{ } + +// Created by: CoreLab +// E-mail: sdac@crlab.com + +{ } +{******************************************} + +unit frxSDACEditor; + +interface + +{$I frx.inc} + +implementation + +uses + Windows, SysUtils, Classes, frxClass, frxDsgnIntf, frxCustomDB, DB, + MSAccess, OLEDBAccess, OLEDBC, SdacVcl, frxRes, frxSDACComponents, frxDACEditor +{$IFDEF Delphi6} +, Variants +{$ENDIF}; + + +type + TfrxMSDatabaseProperty = class(TfrxComponentProperty) + public + function GetValue: String; override; + end; + + TfrxMSTableNameProperty = class(TfrxTableNameProperty) + public + procedure GetValues; override; + end; + +{ TfrxMSDatabaseProperty } + +function TfrxMSDatabaseProperty.GetValue: String; +var + db: TfrxSDACDatabase; +begin + db := TfrxSDACDatabase(GetOrdValue); + if db = nil then + begin + if (SDACComponents <> nil) and (SDACComponents.DefaultDatabase <> nil) then + Result := SDACComponents.DefaultDatabase.Name + else + Result := frxResources.Get('prNotAssigned'); + end + else + Result := inherited GetValue; +end; + +{ TfrxMSTableNameProperty } + +procedure TfrxMSTableNameProperty.GetValues; +begin + inherited; + with TfrxSDACTable(Component).Table do + if Connection <> nil then + Connection.GetTableNames(Values); +end; + +initialization + frxPropertyEditors.Register(TypeInfo(TfrxSDACDatabase), TfrxSDACTable, 'Database', + TfrxMSDatabaseProperty); + frxPropertyEditors.Register(TypeInfo(TfrxSDACDatabase), TfrxSDACQuery, 'Database', + TfrxMSDatabaseProperty); + frxPropertyEditors.Register(TypeInfo(String), TfrxSDACTable, 'TableName', + TfrxMSTableNameProperty); + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/frxSDACRTTI.pas b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/frxSDACRTTI.pas new file mode 100644 index 0000000..1b7b1da --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/frxSDACRTTI.pas @@ -0,0 +1,69 @@ +{******************************************} +{ } +{ FastReport v4.0 } +{ SDAC components RTTI } +{ } + +// Created by: CoreLab +// E-mail: sdac@crlab.com + +{ } +{******************************************} + +unit frxSDACRTTI; + +interface + +{$I frx.inc} + +implementation + +uses + Windows, Classes, fs_iinterpreter, frxSDACComponents +{$IFDEF Delphi6} +, Variants +{$ENDIF}; + + +type + TFunctions = class(TfsRTTIModule) + private + function CallMethod(Instance: TObject; ClassType: TClass; + const MethodName: String; Caller: TfsMethodHelper): Variant; + public + constructor Create(AScript: TfsScript); override; + end; + +{ TFunctions } + +constructor TFunctions.Create(AScript: TfsScript); +begin + inherited Create(AScript); + with AScript do + begin + AddClass(TfrxSDACDatabase, 'TfrxCustomDatabase'); + AddClass(TfrxSDACTable, 'TfrxCustomTable'); + with AddClass(TfrxSDACQuery, 'TfrxCustomQuery') do + AddMethod('procedure ExecSQL', CallMethod); + end; +end; + +function TFunctions.CallMethod(Instance: TObject; ClassType: TClass; + const MethodName: String; Caller: TfsMethodHelper): Variant; +begin + Result := 0; + if ClassType = TfrxSDACQuery then + begin + if MethodName = 'EXECSQL' then + TfrxSDACQuery(Instance).Query.Execute; + end +end; + +initialization + fsRTTIModules.Add(TFunctions); + +finalization + if fsRTTIModules <> nil then + fsRTTIModules.Remove(TFunctions); + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/frxSDACReg.dcr b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/frxSDACReg.dcr new file mode 100644 index 0000000..14ec6ab Binary files /dev/null and b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/frxSDACReg.dcr differ diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/frxSDACReg.pas b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/frxSDACReg.pas new file mode 100644 index 0000000..4a18df2 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/frxSDACReg.pas @@ -0,0 +1,38 @@ + +{******************************************} +{ } +{ FastReport v4.0 } +{ SDAC components registration } +{ } + +// Created by: CoreLab +// E-mail: sdac@crlab.com + +{ } +{******************************************} + +unit frxSDACReg; + +interface + +{$I frx.inc} + +procedure Register; + +implementation + +uses + Windows, Messages, SysUtils, Classes +{$IFNDEF Delphi6} +, DsgnIntf +{$ELSE} +, DesignIntf, DesignEditors +{$ENDIF} +, frxSDACComponents; + +procedure Register; +begin + RegisterComponents('FastReport 4.0', [TfrxSDACComponents]); +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/fs_idacrtti.pas b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/fs_idacrtti.pas new file mode 100644 index 0000000..3a86b5f --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/fs_idacrtti.pas @@ -0,0 +1,620 @@ +{******************************************} +{ } +{ FastScript v1.9 } +{ DAC classes and functions } +{ } +{ Created by: CoreLab } +{ E-mail: info@crlab.com } +{ } +{******************************************} + +unit fs_idacrtti; + +interface + +{$i fs.inc} + +uses + SysUtils, Classes, fs_iinterpreter, fs_itools, fs_idbrtti, DB, + MemData, MemDS, DBAccess; + +type + TfsNotifyEvent = class(TfsCustomEvent) + public + procedure DoEvent(Sender: TObject); + function GetMethod: Pointer; override; + end; + + TfsLoginEvent = class(TfsCustomEvent) + public + procedure DoEvent(Sender: TObject; Username, Password: string); + function GetMethod: Pointer; override; + end; + + TfsUpdateErrorEvent = class(TfsCustomEvent) + public + procedure DoEvent(DataSet: TDataSet; E: EDatabaseError; UpdateKind: TUpdateKind; var UpdateAction: TUpdateAction); + function GetMethod: Pointer; override; + end; + + TfsUpdateRecordEvent = class(TfsCustomEvent) + public + procedure DoEvent(DataSet: TDataSet; UpdateKind: TUpdateKind; var UpdateAction: TUpdateAction); + function GetMethod: Pointer; override; + end; + + TfsAfterExecuteEvent = class(TfsCustomEvent) + public + procedure DoEvent(Sender: TObject; Result: boolean); + function GetMethod: Pointer; override; + end; + + TfsUpdateExecuteEvent = class(TfsCustomEvent) + public + procedure DoEvent(Sender: TDataSet; StatementTypes: TStatementTypes; Params: TDAParams); + function GetMethod: Pointer; override; + end; + +implementation + +type + TfsDAConnectionErrorEvent = class(TfsCustomEvent) + public + procedure DoEvent(Sender: TObject; E: EDAError; var Fail: boolean); + function GetMethod: Pointer; override; + end; + + TfsConnectionLostEvent = class(TfsCustomEvent) + public + procedure DoEvent(Sender: TObject; Component: TComponent; ConnLostCause: TConnLostCause; var RetryMode: TRetryMode); + function GetMethod: Pointer; override; + end; + + TFunctions = class(TfsRTTIModule) + private + function CallMethod(Instance: TObject; ClassType: TClass; + const MethodName: String; Caller: TfsMethodHelper): Variant; + function GetProp(Instance: TObject; ClassType: TClass; + const PropName: String): Variant; + procedure SetProp(Instance: TObject; ClassType: TClass; + const PropName: String; Value: Variant); + public + constructor Create(AScript: TfsScript); override; + end; + +{ TfsDAConnectionErrorEvent } + +procedure TfsDAConnectionErrorEvent.DoEvent(Sender: TObject; E: EDAError; var Fail: boolean); +begin + CallHandler([Sender, E, Fail]); + Fail := Handler.Params[2].Value; +end; + +function TfsDAConnectionErrorEvent.GetMethod: Pointer; +begin + Result := @TfsFieldGetTextEvent.DoEvent; +end; + +{ TfsNotifyEvent } + +procedure TfsNotifyEvent.DoEvent(Sender: TObject); +begin + CallHandler([Sender]); +end; + +function TfsNotifyEvent.GetMethod: Pointer; +begin + Result := @TfsFieldGetTextEvent.DoEvent; +end; + +{ TfsLoginEvent } + +procedure TfsLoginEvent.DoEvent(Sender: TObject; Username, Password: string); +begin + CallHandler([Sender, Username, Password]); +end; + +function TfsLoginEvent.GetMethod: Pointer; +begin + Result := @TfsFieldGetTextEvent.DoEvent; +end; + +{ TfsConnectionLostEvent } + +procedure TfsConnectionLostEvent.DoEvent(Sender: TObject; Component: TComponent; ConnLostCause: TConnLostCause; var RetryMode: TRetryMode); +begin + CallHandler([Sender, Component, Integer(ConnLostCause), Integer(RetryMode)]); + RetryMode := Handler.Params[3].Value; +end; + +function TfsConnectionLostEvent.GetMethod: Pointer; +begin + Result := @TfsFieldGetTextEvent.DoEvent; +end; + +{ TfsUpdateErrorEvent } + +procedure TfsUpdateErrorEvent.DoEvent(DataSet: TDataSet; E: EDatabaseError; UpdateKind: TUpdateKind; var UpdateAction: TUpdateAction); +begin + CallHandler([DataSet, E, Integer(UpdateKind), Integer(UpdateAction)]); + UpdateAction := Handler.Params[3].Value; +end; + +function TfsUpdateErrorEvent.GetMethod: Pointer; +begin + Result := @TfsFieldGetTextEvent.DoEvent; +end; + +{ TfsUpdateRecordEvent } + +procedure TfsUpdateRecordEvent.DoEvent(DataSet: TDataSet; UpdateKind: TUpdateKind; var UpdateAction: TUpdateAction); +begin + CallHandler([DataSet, Integer(UpdateKind), Integer(UpdateAction)]); + UpdateAction := Handler.Params[3].Value; +end; + +function TfsUpdateRecordEvent.GetMethod: Pointer; +begin + Result := @TfsFieldGetTextEvent.DoEvent; +end; + +{ TfsAfterExecuteEvent } + +procedure TfsAfterExecuteEvent.DoEvent(Sender: TObject; Result: boolean); +begin + CallHandler([Sender, Result]); +end; + +function TfsAfterExecuteEvent.GetMethod: Pointer; +begin + Result := @TfsFieldGetTextEvent.DoEvent; +end; + +{ TfsUpdateExecuteEvent } + +procedure TfsUpdateExecuteEvent.DoEvent(Sender: TDataSet; StatementTypes: TStatementTypes; Params: TDAParams); +begin + CallHandler([Sender, 0{StatementTypes}, Params]); +end; + +function TfsUpdateExecuteEvent.GetMethod: Pointer; +begin + Result := @TfsFieldGetTextEvent.DoEvent; +end; + +{ TFunctions } + +constructor TFunctions.Create(AScript: TfsScript); +begin + inherited Create(AScript); + + with AScript do + begin + with AddClass(TCustomDAConnection, 'TComponent') do begin + AddMethod('procedure Open', CallMethod); + AddMethod('procedure Close', CallMethod); + + AddMethod('procedure Connect', CallMethod); + AddMethod('procedure Disconnect', CallMethod); + + AddMethod('function ExecSQL(Text: string; const Params: array of variant): variant', CallMethod); + + AddMethod('procedure GetTableNames(List: TStrings)', CallMethod); + AddMethod('procedure GetDatabaseNames(List: TStrings)', CallMethod); + AddMethod('procedure GetStoredProcNames(List: TStrings)', CallMethod); + + AddMethod('procedure StartTransaction', CallMethod); + AddMethod('procedure Commit', CallMethod); + AddMethod('procedure Rollback', CallMethod); + + AddMethod('procedure ApplyUpdates', CallMethod); + //AddMethod('procedure ApplyUpdates(DataSets: array of TCustomDADataSet)', CallMethod); + + AddMethod('function CreateDataSet: TCustomDADataSet', CallMethod); + + AddMethod('procedure RemoveFromPool', CallMethod); + AddMethod('procedure MonitorMessage(const Msg: string)', CallMethod); + + AddProperty('InTransaction', 'boolean', GetProp); + + AddIndexProperty('DataSets', 'Integer', 'TDataSet', CallMethod, True); + AddProperty('DataSetCount', 'Integer', GetProp); + + AddEvent('OnError', TfsDAConnectionErrorEvent); + AddEvent('OnConnectionLost', TfsConnectionLostEvent); + AddEvent('AfterConnect', TfsNotifyEvent); + AddEvent('BeforeConnect', TfsNotifyEvent); + AddEvent('AfterDisconnect', TfsNotifyEvent); + AddEvent('BeforeDisconnect', TfsNotifyEvent); + AddEvent('OnLogin', TfsLoginEvent); + end; + AddClass(TDAConnectionOptions, 'TPersistent'); + AddClass(TPoolingOptions, 'TPersistent'); + + AddEnum('TDANumericType', 'ntFloat, ntBCD'{$IFNDEF VER130} + ', ntFmtBCD'{$ENDIF}); + AddEnum('TConnLostCause', 'clUnknown, clExecute, clOpen, clRefresh, clApply, clServiceQuery, clTransStart, clConnectionApply, clConnect'); + AddEnum('TRetryMode', 'rmRaise, rmReconnect, rmReconnectExecute'); + + AddEnum('TLabelSet', 'lsCustom, lsEnglish, lsFrench, lsGerman, lsItalian, lsPolish, lsPortuguese, lsRussian, lsSpanish'); + + with AddClass(TCustomConnectDialog, 'TComponent') do begin + AddMethod('function Execute: boolean', CallMethod); + AddMethod('procedure GetServerList(List: TStrings)', CallMethod); + + AddProperty('Connection', 'TCustomDAConnection', GetProp); + AddProperty('Retries', 'word', GetProp, SetProp); + AddProperty('SavePassword', 'boolean', GetProp, SetProp); + AddProperty('StoreLogInfo', 'boolean', GetProp, SetProp); + AddProperty('DialogClass', 'string', GetProp, SetProp); + AddProperty('Caption', 'string', GetProp, SetProp); + AddProperty('UsernameLabel', 'string', GetProp, SetProp); + AddProperty('PasswordLabel', 'string', GetProp, SetProp); + AddProperty('ServerLabel', 'string', GetProp, SetProp); + AddProperty('ConnectButton', 'string', GetProp, SetProp); + AddProperty('CancelButton', 'string', GetProp, SetProp); + AddProperty('LabelSet', 'TLabelSet', GetProp, SetProp); + end; + + with AddClass(TMemDataSet, 'TDataSet') do begin + AddMethod('procedure Prepare', CallMethod); + AddMethod('procedure UnPrepare', CallMethod); + AddMethod('procedure CheckPrepared', CallMethod); + + AddMethod('function UpdateStatus: TUpdateStatus', CallMethod); + AddMethod('function UpdateResult: TUpdateAction', CallMethod); + AddMethod('procedure ApplyUpdates', CallMethod); + AddMethod('procedure CommitUpdates', CallMethod); + AddMethod('procedure CancelUpdates', CallMethod); + AddMethod('procedure RestoreUpdates', CallMethod); + AddMethod('procedure RevertRecord', CallMethod); + + AddMethod('procedure SaveToXML(const FileName: string)', CallMethod); + + AddProperty('Prepared', 'boolean', GetProp, SetProp); + AddProperty('RecordCount', 'Integer', GetProp); + + AddEvent('OnUpdateError', TfsUpdateErrorEvent); + AddEvent('OnUpdateRecord', TfsUpdateRecordEvent); + end; + AddEnum('TUpdateStatus', 'usUnmodified, usModified, usInserted, usDeleted'); + AddEnum('TUpdateAction', 'uaFail, uaAbort, uaSkip, uaRetry, uaApplied'); + + with AddClass(TCustomDADataSet, 'TMemDataSet') do begin + AddMethod('procedure Execute', CallMethod); + AddMethod('function Executing', CallMethod); + AddMethod('function Fetching', CallMethod); + + AddMethod('procedure RefreshRecord', CallMethod); + + AddMethod('function FindMacro(const Value: string): TMacro', CallMethod); + AddMethod('function MacroByName(const Value: string): TMacro', CallMethod); + + AddMethod('procedure SaveSQL', CallMethod); + AddMethod('procedure RestoreSQL', CallMethod); + AddMethod('function SQLSaved: boolean', CallMethod); + + AddMethod('procedure AddWhere(Condition: string)', CallMethod); + AddMethod('procedure DeleteWhere', CallMethod); + AddMethod('procedure SetOrderBy(Fields: string)', CallMethod); + AddMethod('function GetOrderBy: string', CallMethod); + + AddEvent('AfterExecute', TfsAfterExecuteEvent); + AddEvent('BeforeUpdateExecute', TfsUpdateExecuteEvent); + AddEvent('AfterUpdateExecute', TfsUpdateExecuteEvent); + end; + + AddClass(TDAParams, 'TParams'); + AddEnum('TStatementType', 'stQuery, stInsert, stUpdate, stDelete, stLock, stRefresh, stCheck, stCustom, stRefreshQuick, stRefreshCheckDeleted, stBatchUpdate'); + AddEnumSet('TStatementTypes', 'stQuery, stInsert, stUpdate, stDelete, stLock, stRefresh, stCheck, stCustom, stRefreshQuick, stRefreshCheckDeleted, stBatchUpdate'); + + AddClass(TDADataSetOptions, 'TPersistent'); + AddEnum('TCompressBlobMode', 'cbNone, cbClient, cbServer, cbClientServer'); + + with AddClass(TMacro, 'TCollectionItem') do begin + AddProperty('AsDateTime', 'TDateTime', GetProp, SetProp); + AddProperty('AsFloat', 'double', GetProp, SetProp); + AddProperty('AsInteger', 'integer', GetProp, SetProp); + AddProperty('AsString', 'string', GetProp, SetProp); + end; + end; +end; + +function TFunctions.CallMethod(Instance: TObject; ClassType: TClass; + const MethodName: String; Caller: TfsMethodHelper): Variant; +var + DAConnection: TCustomDAConnection; + CustomConnectDialog: TCustomConnectDialog; + MemDataSet: TMemDataSet; + CustomDADataSet: TCustomDADataSet; +begin + Result := 0; + + if ClassType = TCustomDAConnection then begin + DAConnection := TCustomDAConnection(Instance); + if MethodName = 'OPEN' then + DAConnection.Open + else + if MethodName = 'CLOSE' then + DAConnection.Close + else + if MethodName = 'CONNECT' then + DAConnection.Connect + else + if MethodName = 'DISCONNECT' then + DAConnection.Disconnect + else + if MethodName = 'EXECSQL' then + Result := DAConnection.ExecSQL(Caller.Params[0], [Caller.Params[1]]) + else + if MethodName = 'GETTABLENAMES' then + DAConnection.GetTableNames(TStrings(Integer(Caller.Params[0]))) + else + if MethodName = 'GETDATABASENAMES' then + DAConnection.GetDatabaseNames(TStrings(Integer(Caller.Params[0]))) + else + if MethodName = 'GETSTOREDPROCNAMES' then + DAConnection.GetStoredProcNames(TStrings(Integer(Caller.Params[0]))) + else + if MethodName = 'STARTTRANSACTION' then + DAConnection.StartTransaction + else + if MethodName = 'COMMIT' then + DAConnection.Commit + else + if MethodName = 'ROLLBACK' then + DAConnection.Rollback + else + if MethodName = 'APPLYUPDATES' then + DAConnection.ApplyUpdates + else + if MethodName = 'CREATEDATASET' then + Result := Integer(DAConnection.CreateDataSet) + else + if MethodName = 'REMOVEFROMPOOL' then + DAConnection.RemoveFromPool + else + if MethodName = 'MONITORMESSAGE' then + DAConnection.MonitorMessage(Caller.Params[0]) + else + if MethodName = 'DATASETS.GET' then + Result := Integer(DAConnection.DataSets[Caller.Params[0]]) + end + else + if ClassType = TCustomConnectDialog then begin + CustomConnectDialog := TCustomConnectDialog(Instance); + if MethodName = 'EXECUTE' then + Result := Integer(CustomConnectDialog.Execute) + else + if MethodName = 'GETSERVERLIST' then + CustomConnectDialog.GetServerList(TStrings(Integer(Caller.Params[0]))) + end + else + if ClassType = TMemDataSet then begin + MemDataSet := TMemDataSet(Instance); + if MethodName = 'PREPARE' then + MemDataSet.Prepare + else + if MethodName = 'UNPREPARE' then + MemDataSet.UnPrepare + else + if MethodName = 'CHECKPREPARED' then + MemDataSet.CheckPrepared + else + if MethodName = 'UPDATESTATUS' then + Result := Integer(MemDataSet.UpdateStatus) + else + if MethodName = 'UPDATERESULT' then + Result := Integer(MemDataSet.UpdateResult) + else + if MethodName = 'APPLYUPDATES' then + MemDataSet.ApplyUpdates + else + if MethodName = 'COMMITUPDATES' then + MemDataSet.CommitUpdates + else + if MethodName = 'CANCELUPDATES' then + MemDataSet.CancelUpdates + else + if MethodName = 'RESTOREUPDATES' then + MemDataSet.RestoreUpdates + else + if MethodName = 'REVERTRECORD' then + MemDataSet.RevertRecord + else + if MethodName = 'SAVETOXML' then + MemDataSet.SaveToXML(String(Caller.Params[0])) + end + else + if ClassType = TCustomDADataSet then begin + CustomDADataSet := TCustomDADataSet(Instance); + if MethodName = 'EXECUTE' then + CustomDADataSet.Execute + else + if MethodName = 'EXECUTING' then + Result := CustomDADataSet.Executing + else + if MethodName = 'FETCHING' then + Result := CustomDADataSet.Fetching + else + if MethodName = 'REFRESHRECORD' then + CustomDADataSet.RefreshRecord + else + if MethodName = 'FINDMACRO' then + Result := Integer(CustomDADataSet.FindMacro(String(Caller.Params[0]))) + else + if MethodName = 'MACROBYNAME' then + Result := Integer(CustomDADataSet.MacroByName(String(Caller.Params[0]))) + else + if MethodName = 'SAVESQL' then + CustomDADataSet.SaveSQL + else + if MethodName = 'RESTORESQL' then + CustomDADataSet.RestoreSQL + else + if MethodName = 'SQLSAVED' then + Result := CustomDADataSet.SQLSaved + else + if MethodName = 'ADDWHERE' then + CustomDADataSet.AddWhere(String(Caller.Params[0])) + else + if MethodName = 'DELETEWHERE' then + CustomDADataSet.DeleteWhere + else + if MethodName = 'SETORDERBY' then + CustomDADataSet.SetOrderBy(String(Caller.Params[0])) + else + if MethodName = 'GETORDERBY' then + Result := CustomDADataSet.GetOrderBy; + end; +end; + + +function TFunctions.GetProp(Instance: TObject; ClassType: TClass; + const PropName: String): Variant; +var + CustomDAConnection: TCustomDAConnection; + CustomConnectDialog: TCustomConnectDialog; +begin + Result := 0; + + if ClassType = TCustomDAConnection then begin + CustomDAConnection := TCustomDAConnection(Instance); + if PropName = 'INTRANSACTION' then + Result := CustomDAConnection.InTransaction + else + if PropName = 'DATASETCOUNT' then + Result := CustomDAConnection.DataSetCount; + end + else + if ClassType = TCustomConnectDialog then begin + CustomConnectDialog := TCustomConnectDialog(Instance); + if PropName = 'CONNECTION' then + Result := Integer(CustomConnectDialog.Connection) + else + if PropName = 'RETRIES' then + Result := CustomConnectDialog.Retries + else + if PropName = 'SAVEPASSWORD' then + Result := CustomConnectDialog.SavePassword + else + if PropName = 'STORELOGINFO' then + Result := CustomConnectDialog.StoreLogInfo + else + if PropName = 'DIALOGCLASS' then + Result := CustomConnectDialog.DialogClass + else + if PropName = 'CAPTION' then + Result := CustomConnectDialog.Caption + else + if PropName = 'USERNAMELABEL' then + Result := CustomConnectDialog.UsernameLabel + else + if PropName = 'PASSWORDLABEL' then + Result := CustomConnectDialog.PasswordLabel + else + if PropName = 'SERVERLABEL' then + Result := CustomConnectDialog.ServerLabel + else + if PropName = 'CONNECTBUTTON' then + Result := CustomConnectDialog.ConnectButton + else + if PropName = 'CANCELBUTTON' then + Result := CustomConnectDialog.CancelButton + else + if PropName = 'LABELSET' then + Result := Integer(CustomConnectDialog.LabelSet) + end + else + if ClassType = TMemDataSet then begin + if PropName = 'PREPARED' then + Result := TMemDataSet(Instance).Prepared + else + if PropName = 'RECORDCOUNT' then + Result := TMemDataSet(Instance).RecordCount; + end + else + if ClassType = TMacro then begin + if PropName = 'ASDATETIME' then + Result := TMacro(Instance).AsDateTime + else + if PropName = 'ASFLOAT' then + Result := TMacro(Instance).AsFloat + else + if PropName = 'ASINTEGER' then + Result := TMacro(Instance).AsInteger + else + if PropName = 'ASSTRING' then + Result := TMacro(Instance).AsString; + end; +end; + +procedure TFunctions.SetProp(Instance: TObject; ClassType: TClass; + const PropName: String; Value: Variant); +var + CustomConnectDialog: TCustomConnectDialog; +begin + if ClassType = TCustomConnectDialog then begin + CustomConnectDialog := TCustomConnectDialog(Instance); + if PropName = 'RETRIES' then + CustomConnectDialog.Retries := Value + else + if PropName = 'SAVEPASSWORD' then + CustomConnectDialog.SavePassword := Value + else + if PropName = 'STORELOGINFO' then + CustomConnectDialog.StoreLogInfo := Value + else + if PropName = 'DIALOGCLASS' then + CustomConnectDialog.DialogClass := Value + else + if PropName = 'CAPTION' then + CustomConnectDialog.Caption := Value + else + if PropName = 'USERNAMELABEL' then + CustomConnectDialog.UsernameLabel := Value + else + if PropName = 'PASSWORDLABEL' then + CustomConnectDialog.PasswordLabel := Value + else + if PropName = 'SERVERLABEL' then + CustomConnectDialog.ServerLabel := Value + else + if PropName = 'CONNECTBUTTON' then + CustomConnectDialog.ConnectButton := Value + else + if PropName = 'CANCELBUTTON' then + CustomConnectDialog.CancelButton := Value + else + if PropName = 'LABELSET' then + CustomConnectDialog.LabelSet := TLabelSet(Value); + end + else + if ClassType = TMemDataSet then begin + if PropName = 'PREPARED' then + TMemDataSet(Instance).Prepared := Value; + end + else + if ClassType = TMacro then begin + if PropName = 'ASDATETIME' then + TMacro(Instance).AsDateTime := Value + else + if PropName = 'ASFLOAT' then + TMacro(Instance).AsFloat := Value + else + if PropName = 'ASINTEGER' then + TMacro(Instance).AsInteger := Value + else + if PropName = 'ASSTRING' then + TMacro(Instance).AsString := Value; + end; +end; + +initialization + fsRTTIModules.Add(TFunctions); + +finalization + if fsRTTIModules <> nil then + fsRTTIModules.Remove(TFunctions); + +end. + diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/fs_isdacreg.dcr b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/fs_isdacreg.dcr new file mode 100644 index 0000000..36dd0ad Binary files /dev/null and b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/fs_isdacreg.dcr differ diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/fs_isdacreg.pas b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/fs_isdacreg.pas new file mode 100644 index 0000000..4e1aca8 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/fs_isdacreg.pas @@ -0,0 +1,39 @@ + +{******************************************} +{ } +{ FastScript v1.9 } +{ SDAC Registration unit } +{ } +{ Created by: CoreLab } +{ E-mail: sdac@crlab.com } +{ } +{******************************************} + +unit fs_isdacreg; + +{$i fs.inc} + +interface + + +procedure Register; + +implementation + +uses + Classes +{$IFNDEF Delphi6} +, DsgnIntf +{$ELSE} +, DesignIntf +{$ENDIF} +, fs_isdacrtti; + +{-----------------------------------------------------------------------} + +procedure Register; +begin + RegisterComponents('FastScript', [TfsSDACRTTI]); +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/fs_isdacrtti.pas b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/fs_isdacrtti.pas new file mode 100644 index 0000000..bc18298 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/FR4/fs_isdacrtti.pas @@ -0,0 +1,214 @@ + +{******************************************} +{ } +{ FastScript v1.9 } +{ SDAC classes and functions } +{ } +{ Created by: CoreLab } +{ E-mail: sdac@crlab.com } +{ } +{******************************************} + +unit fs_isdacrtti; + +interface + +{$i fs.inc} + +uses + SysUtils, Classes, fs_iinterpreter, fs_itools, fs_idbrtti, fs_idacrtti, DB, + OLEDBAccess, MSAccess; + +type + TfsSDACRTTI = class(TComponent); // fake component + +implementation + +type + TfsMSConnectionInfoMessageEvent = class(TfsCustomEvent) + public + procedure DoEvent(Sender: TObject; E: EMSError); + function GetMethod: Pointer; override; + end; + + TFunctions = class(TfsRTTIModule) + private + function CallMethod(Instance: TObject; ClassType: TClass; + const MethodName: String; Caller: TfsMethodHelper): Variant; + function GetProp(Instance: TObject; ClassType: TClass; + const PropName: String): Variant; + procedure SetProp(Instance: TObject; ClassType: TClass; + const PropName: String; Value: Variant); + public + constructor Create(AScript: TfsScript); override; + end; + +{ TfsMSConnectionInfoMessageEvent } + +procedure TfsMSConnectionInfoMessageEvent.DoEvent(Sender: TObject; E: EMSError); +begin + CallHandler([Sender, E]); +end; + +function TfsMSConnectionInfoMessageEvent.GetMethod: Pointer; +begin + Result := @TfsFieldGetTextEvent.DoEvent; +end; + +{ TFunctions } + +constructor TFunctions.Create(AScript: TfsScript); +begin + inherited Create(AScript); + + with AScript do begin + with AddClass(TMSConnection, 'TCustomDAConnection') do begin + AddMethod('procedure ChangePassword(NewPassword: string)', CallMethod); + AddProperty('ClientVersion', 'string', GetProp); + AddProperty('ServerVersion', 'string', GetProp); + AddEvent('OnInfoMessage', TfsMSConnectionInfoMessageEvent); + end; + AddEnum('TIsolationLevel', 'ilReadCommitted, ilReadUnCommitted, ilRepeatableRead, ilIsolated, ilSnapshot'); + AddEnum('TMSAuthentication', 'auWindows, auServer'); + + AddClass(TMSConnectionOptions, 'TDAConnectionOptions'); + AddEnum('TOLEDBProvider', 'prAuto, prSQL, prNativeClient, prCompact'); + + with AddClass(TCustomMSDataSet, 'TCustomDADataSet') do begin + AddMethod('function OpenNext: boolean', CallMethod); + AddMethod('procedure BreakExec', CallMethod); + AddMethod('procedure RefreshQuick(const CheckDeleted: boolean)', CallMethod); + + AddProperty('CursorType', 'TMSCursorType', GetProp, SetProp); + AddProperty('CommandTimeout', 'integer', GetProp, SetProp); + end; + AddEnum('TMSCursorType', 'ctDefaultResultSet, ctStatic, ctKeyset, ctDynamic'); + AddClass(TMSDataSetOptions, 'TDADataSetOptions'); + AddClass(TMSParams, 'TDAParams'); + AddClass(TMSQuery, 'TCustomMSDataSet'); + + with AddClass(TMSTable, 'TCustomMSDataSet') do begin + AddMethod('procedure PrepareSQL', CallMethod); + AddProperty('TableName', 'string', GetProp, SetProp); + AddProperty('OrderFields', 'string', GetProp, SetProp); + end; + + with AddClass(TMSStoredProc, 'TCustomMSDataSet') do begin + AddMethod('procedure ExecProc', CallMethod); + AddMethod('procedure PrepareSQL', CallMethod); + AddProperty('UpdatingTable', 'string', GetProp, SetProp); + AddProperty('StoredProcName', 'string', GetProp, SetProp); + end; + end; +end; + +function TFunctions.CallMethod(Instance: TObject; ClassType: TClass; + const MethodName: String; Caller: TfsMethodHelper): Variant; +begin + Result := 0; + + if ClassType = TMSConnection then begin + if MethodName = 'CHANGEPASSWORD' then + TMSConnection(Instance).ChangePassword(Caller.Params[0]); + end + else + if ClassType = TCustomMSDataSet then begin + if MethodName = 'OPENNEXT' then + Result := TCustomMSDataSet(Instance).OpenNext + else + if MethodName = 'BREAKEXEC' then + TCustomMSDataSet(Instance).BreakExec + else + if MethodName = 'REFRESHQUICK' then + TCustomMSDataSet(Instance).RefreshQuick(Caller.Params[0]); + end + else + if ClassType = TMSTable then begin + if MethodName = 'PREPARESQL' then + TMSTable(Instance).PrepareSQL; + end + else + if ClassType = TMSStoredProc then begin + if MethodName = 'EXECPROC' then + TMSStoredProc(Instance).ExecProc + else + if MethodName = 'PREPARESQL' then + TMSStoredProc(Instance).PrepareSQL; + end; +end; + +function TFunctions.GetProp(Instance: TObject; ClassType: TClass; + const PropName: String): Variant; +begin + Result := 0; + + if ClassType = TMSConnection then begin + if PropName = 'CLIENTVERSION' then + Result := TMSConnection(Instance).ClientVersion + else + if PropName = 'SERVERVERSION' then + Result := TMSConnection(Instance).ServerVersion + end + else + if ClassType = TCustomMSDataSet then begin + if PropName = 'CURSORTYPE' then + Result := Integer(TCustomMSDataSet(Instance).CursorType) + else + if PropName = 'COMMANDTIMEOUT' then + Result := TCustomMSDataSet(Instance).CommandTimeout; + end + else + if ClassType = TMSTable then begin + if PropName = 'TABLENAME' then + Result := TMSTable(Instance).TableName + else + if PropName = 'ORDERFIELDS' then + Result := TMSTable(Instance).OrderFields; + end + else + if ClassType = TMSStoredProc then begin + if PropName = 'UPDATINGTABLE' then + Result := TMSStoredProc(Instance).UpdatingTable + else + if PropName = 'STOREDPROCNAME' then + Result := TMSStoredProc(Instance).StoredProcName; + end; +end; + +procedure TFunctions.SetProp(Instance: TObject; ClassType: TClass; + const PropName: String; Value: Variant); +begin + if ClassType = TCustomMSDataSet then begin + if PropName = 'CURSORTYPE' then + TCustomMSDataSet(Instance).CursorType := TMSCursorType(Integer(Value)) + else + if PropName = 'COMMANDTIMEOUT' then + TCustomMSDataSet(Instance).CommandTimeout := Value; + end + else + if ClassType = TMSTable then begin + if PropName = 'TABLENAME' then + TMSTable(Instance).TableName := Value + else + if PropName = 'ORDERFIELDS' then + TMSTable(Instance).OrderFields := Value; + end + else + if ClassType = TMSStoredProc then begin + if PropName = 'UPDATINGTABLE' then + TMSStoredProc(Instance).UpdatingTable := Value + else + if PropName = 'STOREDPROCNAME' then + TMSStoredProc(Instance).StoredProcName := Value; + end; +end; + +initialization + fsRTTIModules.Add(TFunctions); + +finalization + if fsRTTIModules <> nil then + fsRTTIModules.Remove(TFunctions); + +end. + diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/ReadMe.txt b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/ReadMe.txt new file mode 100644 index 0000000..d0a477f --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/FastReport/ReadMe.txt @@ -0,0 +1,10 @@ +SQL Server Data Access Components +Copyright 1997-2007, Core Lab. All Rights Reserved +-------------------------------------------------- + +Demo for FastReport included in SDAC was built and tested using +Fast Report 3.20 + +IMPORTANT NOTE: + Demo provided as is and there are no warranty that it is fully + compatible with other versions of Fast Report. \ No newline at end of file diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/InfoPower/Demo/IPDemo.cfg b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/InfoPower/Demo/IPDemo.cfg new file mode 100644 index 0000000..aa6fefc --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/InfoPower/Demo/IPDemo.cfg @@ -0,0 +1,41 @@ +-$A+ +-$B- +-$C+ +-$D+ +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L+ +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$YD +-$Z1 +-cg +-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-H+ +-W+ +-M +-$M16384,1048576 +-K$00400000 +-E"." +-N"." +-LE"." +-LN"." +-U"..\" +-O"..\" +-I"..\" +-R"..\" diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/InfoPower/Demo/IPDemo.dpr b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/InfoPower/Demo/IPDemo.dpr new file mode 100644 index 0000000..b6ddeeb --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/InfoPower/Demo/IPDemo.dpr @@ -0,0 +1,13 @@ +program IPDemo; + +uses + Forms, + Main in 'Main.pas' {fmMain}; + +{$R *.RES} + +begin + Application.Initialize; + Application.CreateForm(TfmMain, fmMain); + Application.Run; +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/InfoPower/Demo/IPDemo.res b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/InfoPower/Demo/IPDemo.res new file mode 100644 index 0000000..690fbc5 Binary files /dev/null and b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/InfoPower/Demo/IPDemo.res differ diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/InfoPower/Demo/Main.dfm b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/InfoPower/Demo/Main.dfm new file mode 100644 index 0000000..cb66811 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/InfoPower/Demo/Main.dfm @@ -0,0 +1,371 @@ +object fmMain: TfmMain + Left = 268 + Top = 161 + Width = 641 + Height = 371 + Caption = 'MS SQL Server Data Access demo - InfoPower support' + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + PixelsPerInch = 96 + TextHeight = 13 + object wwDBGrid1: TwwDBGrid + Left = 0 + Top = 25 + Width = 633 + Height = 319 + IniAttributes.Delimiter = ';;' + TitleColor = clBtnFace + FixedCols = 0 + ShowHorzScrollBar = True + Align = alClient + DataSource = wwDataSource1 + TabOrder = 0 + TitleAlignment = taLeftJustify + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + TitleLines = 1 + TitleButtons = False + IndicatorColor = icBlack + FooterCellColor = clInfoBk + object wwDBGrid1IButton: TwwIButton + Left = 0 + Top = 0 + Width = 13 + Height = 22 + AllowAllUp = True + Caption = '!' + end + end + object ToolBar: TPanel + Left = 0 + Top = 0 + Width = 633 + Height = 25 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object btOpen: TButton + Left = 0 + Top = 1 + Width = 75 + Height = 25 + Caption = 'Open' + TabOrder = 0 + OnClick = btOpenClick + end + object btClose: TButton + Left = 76 + Top = 1 + Width = 75 + Height = 25 + Caption = 'Close' + TabOrder = 1 + OnClick = btCloseClick + end + object wwDBNavigator1: TwwDBNavigator + Left = 152 + Top = 0 + Width = 350 + Height = 25 + DataSource = wwDataSource1 + RepeatInterval.InitialDelay = 500 + RepeatInterval.Interval = 100 + object wwDBNavigator1First: TwwNavButton + Left = 0 + Top = 0 + Width = 25 + Height = 25 + Hint = 'Move to first record' + ImageIndex = -1 + NumGlyphs = 2 + Spacing = 4 + Transparent = False + Caption = 'wwDBNavigator1First' + Enabled = False + DisabledTextColors.ShadeColor = clGray + DisabledTextColors.HighlightColor = clBtnHighlight + Index = 0 + Style = nbsFirst + end + object wwDBNavigator1PriorPage: TwwNavButton + Left = 25 + Top = 0 + Width = 25 + Height = 25 + Hint = 'Move backward 10 records' + ImageIndex = -1 + NumGlyphs = 2 + Spacing = 4 + Transparent = False + Caption = 'wwDBNavigator1PriorPage' + Enabled = False + DisabledTextColors.ShadeColor = clGray + DisabledTextColors.HighlightColor = clBtnHighlight + Index = 1 + Style = nbsPriorPage + end + object wwDBNavigator1Prior: TwwNavButton + Left = 50 + Top = 0 + Width = 25 + Height = 25 + Hint = 'Move to prior record' + ImageIndex = -1 + NumGlyphs = 2 + Spacing = 4 + Transparent = False + Caption = 'wwDBNavigator1Prior' + Enabled = False + DisabledTextColors.ShadeColor = clGray + DisabledTextColors.HighlightColor = clBtnHighlight + Index = 2 + Style = nbsPrior + end + object wwDBNavigator1Next: TwwNavButton + Left = 75 + Top = 0 + Width = 25 + Height = 25 + Hint = 'Move to next record' + ImageIndex = -1 + NumGlyphs = 2 + Spacing = 4 + Transparent = False + Caption = 'wwDBNavigator1Next' + Enabled = False + DisabledTextColors.ShadeColor = clGray + DisabledTextColors.HighlightColor = clBtnHighlight + Index = 3 + Style = nbsNext + end + object wwDBNavigator1NextPage: TwwNavButton + Left = 100 + Top = 0 + Width = 25 + Height = 25 + Hint = 'Move forward 10 records' + ImageIndex = -1 + NumGlyphs = 2 + Spacing = 4 + Transparent = False + Caption = 'wwDBNavigator1NextPage' + Enabled = False + DisabledTextColors.ShadeColor = clGray + DisabledTextColors.HighlightColor = clBtnHighlight + Index = 4 + Style = nbsNextPage + end + object wwDBNavigator1Last: TwwNavButton + Left = 125 + Top = 0 + Width = 25 + Height = 25 + Hint = 'Move to last record' + ImageIndex = -1 + NumGlyphs = 2 + Spacing = 4 + Transparent = False + Caption = 'wwDBNavigator1Last' + Enabled = False + DisabledTextColors.ShadeColor = clGray + DisabledTextColors.HighlightColor = clBtnHighlight + Index = 5 + Style = nbsLast + end + object wwDBNavigator1Insert: TwwNavButton + Left = 150 + Top = 0 + Width = 25 + Height = 25 + Hint = 'Insert new record' + ImageIndex = -1 + NumGlyphs = 2 + Spacing = 4 + Transparent = False + Caption = 'wwDBNavigator1Insert' + Enabled = False + DisabledTextColors.ShadeColor = clGray + DisabledTextColors.HighlightColor = clBtnHighlight + Index = 6 + Style = nbsInsert + end + object wwDBNavigator1Delete: TwwNavButton + Left = 175 + Top = 0 + Width = 25 + Height = 25 + Hint = 'Delete current record' + ImageIndex = -1 + NumGlyphs = 2 + Spacing = 4 + Transparent = False + Caption = 'wwDBNavigator1Delete' + Enabled = False + DisabledTextColors.ShadeColor = clGray + DisabledTextColors.HighlightColor = clBtnHighlight + Index = 7 + Style = nbsDelete + end + object wwDBNavigator1Edit: TwwNavButton + Left = 200 + Top = 0 + Width = 25 + Height = 25 + Hint = 'Edit current record' + ImageIndex = -1 + NumGlyphs = 2 + Spacing = 4 + Transparent = False + Caption = 'wwDBNavigator1Edit' + Enabled = False + DisabledTextColors.ShadeColor = clGray + DisabledTextColors.HighlightColor = clBtnHighlight + Index = 8 + Style = nbsEdit + end + object wwDBNavigator1Post: TwwNavButton + Left = 225 + Top = 0 + Width = 25 + Height = 25 + Hint = 'Post changes of current record' + ImageIndex = -1 + NumGlyphs = 2 + Spacing = 4 + Transparent = False + Caption = 'wwDBNavigator1Post' + Enabled = False + DisabledTextColors.ShadeColor = clGray + DisabledTextColors.HighlightColor = clBtnHighlight + Index = 9 + Style = nbsPost + end + object wwDBNavigator1Cancel: TwwNavButton + Left = 250 + Top = 0 + Width = 25 + Height = 25 + Hint = 'Cancel changes made to current record' + ImageIndex = -1 + NumGlyphs = 2 + Spacing = 4 + Transparent = False + Caption = 'wwDBNavigator1Cancel' + Enabled = False + DisabledTextColors.ShadeColor = clGray + DisabledTextColors.HighlightColor = clBtnHighlight + Index = 10 + Style = nbsCancel + end + object wwDBNavigator1Refresh: TwwNavButton + Left = 275 + Top = 0 + Width = 25 + Height = 25 + Hint = 'Refresh the contents of the dataset' + ImageIndex = -1 + NumGlyphs = 2 + Spacing = 4 + Transparent = False + Caption = 'wwDBNavigator1Refresh' + Enabled = False + DisabledTextColors.ShadeColor = clGray + DisabledTextColors.HighlightColor = clBtnHighlight + Index = 11 + Style = nbsRefresh + end + object wwDBNavigator1SaveBookmark: TwwNavButton + Left = 300 + Top = 0 + Width = 25 + Height = 25 + Hint = 'Bookmark current record' + ImageIndex = -1 + NumGlyphs = 2 + Spacing = 4 + Transparent = False + Caption = 'wwDBNavigator1SaveBookmark' + Enabled = False + DisabledTextColors.ShadeColor = clGray + DisabledTextColors.HighlightColor = clBtnHighlight + Index = 12 + Style = nbsSaveBookmark + end + object wwDBNavigator1RestoreBookmark: TwwNavButton + Left = 325 + Top = 0 + Width = 25 + Height = 25 + Hint = 'Go back to saved bookmark' + ImageIndex = -1 + NumGlyphs = 2 + Spacing = 4 + Transparent = False + Caption = 'wwDBNavigator1RestoreBookmark' + Enabled = False + DisabledTextColors.ShadeColor = clGray + DisabledTextColors.HighlightColor = clBtnHighlight + Index = 13 + Style = nbsRestoreBookmark + end + end + end + object MSConnection1: TMSConnection + Database = 'SDACDemos' + Authentication = auServer + Left = 280 + Top = 32 + end + object wwDataSource1: TwwDataSource + DataSet = wwMSQuery + Left = 344 + Top = 32 + end + object wwMSQuery: TwwMSQuery + Connection = MSConnection1 + SQL.Strings = ( + 'SELECT * FROM Emp') + ControlType.Strings = ( + 'Discontinued;CheckBox;True;False') + PictureMasks.Strings = ( + 'Discontinued'#9'{True,False}'#9'T'#9'T') + ValidateWithMask = True + Left = 312 + Top = 32 + object wwMSQueryEMPNO: TIntegerField + FieldName = 'EMPNO' + ReadOnly = True + end + object wwMSQueryENAME: TStringField + FieldName = 'ENAME' + Size = 10 + end + object wwMSQueryJOB: TStringField + FieldName = 'JOB' + Size = 9 + end + object wwMSQueryMGR: TIntegerField + FieldName = 'MGR' + end + object wwMSQueryHIREDATE: TDateTimeField + FieldName = 'HIREDATE' + end + object wwMSQuerySAL: TFloatField + FieldName = 'SAL' + end + object wwMSQueryCOMM: TFloatField + FieldName = 'COMM' + end + object wwMSQueryDEPTNO: TIntegerField + FieldName = 'DEPTNO' + end + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/InfoPower/Demo/Main.pas b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/InfoPower/Demo/Main.pas new file mode 100644 index 0000000..0b015cc --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/InfoPower/Demo/Main.pas @@ -0,0 +1,69 @@ +unit Main; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + DBCtrls, ExtCtrls, Grids, DBGrids, StdCtrls, ToolWin, ComCtrls, Db, SdacVcl, + DBTables, Wwquery, Wwdatsrc, DBAccess, MSAccess, wwSpeedButton, + wwDBNavigator, wwclearpanel, Buttons, Wwdbigrd, Wwdbgrid, MemDS, MSIP; + +type + TfmMain = class(TForm) + wwDBGrid1: TwwDBGrid; + MSConnection1: TMSConnection; + wwDataSource1: TwwDataSource; + wwMSQuery: TwwMSQuery; + wwDBGrid1IButton: TwwIButton; + ToolBar: TPanel; + btOpen: TButton; + btClose: TButton; + wwDBNavigator1: TwwDBNavigator; + wwDBNavigator1First: TwwNavButton; + wwDBNavigator1PriorPage: TwwNavButton; + wwDBNavigator1Prior: TwwNavButton; + wwDBNavigator1Next: TwwNavButton; + wwDBNavigator1NextPage: TwwNavButton; + wwDBNavigator1Last: TwwNavButton; + wwDBNavigator1Insert: TwwNavButton; + wwDBNavigator1Delete: TwwNavButton; + wwDBNavigator1Edit: TwwNavButton; + wwDBNavigator1Post: TwwNavButton; + wwDBNavigator1Cancel: TwwNavButton; + wwDBNavigator1Refresh: TwwNavButton; + wwDBNavigator1SaveBookmark: TwwNavButton; + wwDBNavigator1RestoreBookmark: TwwNavButton; + wwMSQueryEMPNO: TIntegerField; + wwMSQueryENAME: TStringField; + wwMSQueryJOB: TStringField; + wwMSQueryMGR: TIntegerField; + wwMSQueryHIREDATE: TDateTimeField; + wwMSQuerySAL: TFloatField; + wwMSQueryCOMM: TFloatField; + wwMSQueryDEPTNO: TIntegerField; + procedure btOpenClick(Sender: TObject); + procedure btCloseClick(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + end; + +var + fmMain: TfmMain; + +implementation + +{$R *.DFM} + +procedure TfmMain.btOpenClick(Sender: TObject); +begin + wwMSQuery.Open; +end; + +procedure TfmMain.btCloseClick(Sender: TObject); +begin + wwMSQuery.Close; +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/InfoPower/MSIP.pas b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/InfoPower/MSIP.pas new file mode 100644 index 0000000..63638ab --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/InfoPower/MSIP.pas @@ -0,0 +1,299 @@ + +////////////////////////////////////////////////// +// MS SQL Server Data Access Components +// Copyright © 1998-2001 Core Lab. All right reserved. +// InfoPower compatible components +// This module contains classes for Woll2Woll InfoPower compatibility +////////////////////////////////////////////////// + +unit MSIP; + +interface + +uses + SysUtils, + WinTypes, + WinProcs, + Messages, + Classes, + Graphics, + Controls, + Forms, + DB, + dialogs, + wwFilter, + wwStr, + wwSystem, + wwTable, + wwTypes, + MSAccess; + +type + +{ TwwMSQuery } + + TwwMSQuery = class (TMSQuery) + private + FControlType: TStrings; + FPictureMasks: TStrings; + FUsePictureMask: boolean; + FOnInvalidValue: TwwInvalidValueEvent; + + function GetControlType: TStrings; + procedure SetControlType(Sel: TStrings); + function GetPictureMasks: TStrings; + procedure SetPictureMasks(Sel: TStrings); + + protected + procedure DoBeforePost; override; { For picture support } + + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + published + property ControlType: TStrings read GetControlType write SetControltype; + property PictureMasks: TStrings read GetPictureMasks write SetPictureMasks; + property ValidateWithMask: boolean read FUsePictureMask write FUsePictureMask; + property OnInvalidValue: TwwInvalidValueEvent read FOnInvalidValue write FOnInvalidValue; + end; + +{ TwwMSTable } + + TwwMSTable = class (TMSTable) + private + FControlType: TStrings; + FPictureMasks: TStrings; + FUsePictureMask: boolean; + FOnInvalidValue: TwwInvalidValueEvent; + + function GetControlType: TStrings; + procedure SetControlType(Sel: TStrings); + function GetPictureMasks: TStrings; + procedure SetPictureMasks(Sel: TStrings); + + protected + procedure DoBeforePost; override; { For picture support } + + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + published + property ControlType: TStrings read GetControlType write SetControltype; + property PictureMasks: TStrings read GetPictureMasks write SetPictureMasks; + property ValidateWithMask: boolean read FUsePictureMask write FUsePictureMask; + property OnInvalidValue: TwwInvalidValueEvent read FOnInvalidValue write FOnInvalidValue; + end; + +{ TwwMSStoredProc } + + TwwMSStoredProc = class (TMSStoredProc) + private + FControlType: TStrings; + FPictureMasks: TStrings; + FUsePictureMask: boolean; + FOnInvalidValue: TwwInvalidValueEvent; + + function GetControlType: TStrings; + procedure SetControlType(Sel: TStrings); + function GetPictureMasks: TStrings; + procedure SetPictureMasks(Sel: TStrings); + + protected + procedure DoBeforePost; override; { For picture support } + + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + published + property ControlType: TStrings read GetControlType write SetControltype; + property PictureMasks: TStrings read GetPictureMasks write SetPictureMasks; + property ValidateWithMask: boolean read FUsePictureMask write FUsePictureMask; + property OnInvalidValue: TwwInvalidValueEvent read FOnInvalidValue write FOnInvalidValue; + end; + +procedure Register; + +implementation +uses + wwCommon, + dbConsts; + +{ TwwMSQuery } + +constructor TwwMSQuery.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + + FControlType := TStringList.Create; + FPictureMasks := TStringList.Create; + FUsePictureMask := True; +end; + +destructor TwwMSQuery.Destroy; +begin + FControlType.Free; + FPictureMasks.Free; + FPictureMasks := nil; + + inherited Destroy; +end; + +function TwwMSQuery.GetControlType: TStrings; +begin + Result := FControlType; +end; + +procedure TwwMSQuery.SetControlType(Sel: TStrings); +begin + FControlType.Assign(Sel); +end; + +function TwwMSQuery.GetPictureMasks: TStrings; +begin + Result := FPictureMasks +end; + +procedure TwwMSQuery.SetPictureMasks(Sel: TStrings); +begin + FPictureMasks.Assign(Sel); +end; + +procedure TwwMSQuery.DoBeforePost; +begin + inherited DoBeforePost; + + if FUsePictureMask then + wwValidatePictureFields(Self, FOnInvalidValue); +end; + +{ TwwMSTable } + +constructor TwwMSTable.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + + FControlType := TStringList.Create; + FPictureMasks := TStringList.Create; + FUsePictureMask := True; +end; + +destructor TwwMSTable.Destroy; +begin + FControlType.Free; + FPictureMasks.Free; + FPictureMasks := nil; + + inherited Destroy; +end; + +function TwwMSTable.GetControlType: TStrings; +begin + Result := FControlType; +end; + +procedure TwwMSTable.SetControlType(Sel: TStrings); +begin + FControlType.Assign(Sel); +end; + +function TwwMSTable.GetPictureMasks: TStrings; +begin + Result := FPictureMasks +end; + +procedure TwwMSTable.SetPictureMasks(Sel: TStrings); +begin + FPictureMasks.Assign(Sel); +end; + +procedure TwwMSTable.DoBeforePost; +begin + inherited DoBeforePost; + + if FUsePictureMask then + wwValidatePictureFields(Self, FOnInvalidValue); +end; + +{ TwwMSStoredProc } + +constructor TwwMSStoredProc.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + + FControlType := TStringList.Create; + FPictureMasks := TStringList.Create; + FUsePictureMask := True; +end; + +destructor TwwMSStoredProc.Destroy; +begin + FControlType.Free; + FPictureMasks.Free; + FPictureMasks := nil; + + inherited Destroy; +end; + +function TwwMSStoredProc.GetControlType: TStrings; +begin + Result := FControlType; +end; + +procedure TwwMSStoredProc.SetControlType(Sel: TStrings); +begin + FControlType.Assign(Sel); +end; + +function TwwMSStoredProc.GetPictureMasks: TStrings; +begin + Result := FPictureMasks +end; + +procedure TwwMSStoredProc.SetPictureMasks(Sel: TStrings); +begin + FPictureMasks.Assign(Sel); +end; + +procedure TwwMSStoredProc.DoBeforePost; +begin + inherited DoBeforePost; + + if FUsePictureMask then + wwValidatePictureFields(Self, FOnInvalidValue); +end; + +procedure Register; +begin + RegisterComponents('SQLServer Access', [TwwMSQuery]); + RegisterComponents('SQLServer Access', [TwwMSTable]); + RegisterComponents('SQLServer Access', [TwwMSStoredProc]); +end; + +{ +For IP3 + +wwCommon.pas + +Function wwDataSet(dataSet : TDataSet): boolean; +begin + if dataset=nil then result:= false + else + result:= + wwIsClass(dataset.classType, 'TwwTable') or + wwIsClass(dataset.classType, 'TwwQuery') or + wwIsClass(dataset.classType, 'TwwQBE') or + wwIsClass(dataset.classType, 'TwwStoredProc') or + wwIsClass(dataset.classType, 'TwwClientDataSet') + // SDAC components + or + wwIsClass(dataset.classType, 'TwwMSQuery') or + wwIsClass(dataset.classType, 'TwwSmartQuery') or + wwIsClass(dataset.classType, 'TwwMSTable') or + wwIsClass(dataset.classType, 'TwwMSStoredProc'); +end; +} + +end. \ No newline at end of file diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/InfoPower/MSIPPack.cfg b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/InfoPower/MSIPPack.cfg new file mode 100644 index 0000000..0c61e23 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/InfoPower/MSIPPack.cfg @@ -0,0 +1,41 @@ +-$A+ +-$B- +-$C+ +-$D+ +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L+ +-$M- +-$N+ +-$O- +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-cg +-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-H+ +-W+ +-M +-$M16384,1048576 +-K$00400000 +-E"d:\program files\borland\delphi5\Sdac\Demos\FastReport" +-N"." +-LE"." +-LN"." +-U"d:\program files\borland\delphi5\Projects;d:\program files\borland\delphi5\Sdac\Demos\FastReport;d:\program files\borland\delphi5\Projects;d:\program files\borland\delphi5\Projects;d:\program files\borland\delphi5\Lib\Debug;d:\program files\borland\delphi5\Vcl;d:\program files\borland\delphi5\lib;d:\program files\borland\delphi5\Projects" +-O"d:\program files\borland\delphi5\Projects;d:\program files\borland\delphi5\Sdac\Demos\FastReport;d:\program files\borland\delphi5\Projects;d:\program files\borland\delphi5\Projects;d:\program files\borland\delphi5\Lib\Debug;d:\program files\borland\delphi5\Vcl;d:\program files\borland\delphi5\lib;d:\program files\borland\delphi5\Projects" +-I"d:\program files\borland\delphi5\Projects;d:\program files\borland\delphi5\Sdac\Demos\FastReport;d:\program files\borland\delphi5\Projects;d:\program files\borland\delphi5\Projects;d:\program files\borland\delphi5\Lib\Debug;d:\program files\borland\delphi5\Vcl;d:\program files\borland\delphi5\lib;d:\program files\borland\delphi5\Projects" +-R"d:\program files\borland\delphi5\Projects;d:\program files\borland\delphi5\Sdac\Demos\FastReport;d:\program files\borland\delphi5\Projects;d:\program files\borland\delphi5\Projects;d:\program files\borland\delphi5\Lib\Debug;d:\program files\borland\delphi5\Vcl;d:\program files\borland\delphi5\lib;d:\program files\borland\delphi5\Projects" diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/InfoPower/MSIPPack.dpk b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/InfoPower/MSIPPack.dpk new file mode 100644 index 0000000..58f286f --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/InfoPower/MSIPPack.dpk @@ -0,0 +1,41 @@ +// This demo was built and tested using InfoPower 2000 Trial for Delphi 5. +// You can recompile it under other versions by changing requires section manually. + +package MSIPPack; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION OFF} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'SDAC InfoPower compatible components'} +{$DESIGNONLY} +{$IMPLICITBUILD ON} + +requires + vcl50, + vcldb50, + sdac50, + ip50d_d5trial; + +contains + MSIP in 'MSIP.pas'; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/InfoPower/MSIPPack.res b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/InfoPower/MSIPPack.res new file mode 100644 index 0000000..a4c7549 Binary files /dev/null and b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/InfoPower/MSIPPack.res differ diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/InfoPower/ReadMe.txt b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/InfoPower/ReadMe.txt new file mode 100644 index 0000000..0bf54b0 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/InfoPower/ReadMe.txt @@ -0,0 +1,6 @@ + +To install TwwMSQuery,TwwMSTable,TwwMSStoredProc +components compile and install MSIPPack package. +MSIPPack package requires InfoPower ip*.dcp. To create it you need +compile InfoPower package ip*.dpk. + diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW5/IntraWeb.dof b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW5/IntraWeb.dof new file mode 100644 index 0000000..1e2db98 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW5/IntraWeb.dof @@ -0,0 +1,3 @@ +[Directories] +OutputDir=..\ +UnitOutputDir=..\ diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW5/IntraWeb.dpr b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW5/IntraWeb.dpr new file mode 100644 index 0000000..d37a934 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW5/IntraWeb.dpr @@ -0,0 +1,35 @@ +program IntraWeb; +{PUBDIST} + +uses + IWInitStandAlone, + ServerController in 'ServerController.pas' {IWServerController: TIWServerControllerBase}, + uBase in 'uBase.pas' {fmBase: TIWAppForm}, + uMain in 'uMain.pas' {fmMain: TIWAppForm}, + uMasterDetail in 'uMasterDetail.pas' {fmMasterDetail: TIWAppForm}, + uCachedUpdates in 'uCachedUpdates.pas' {fmCachedUpdates: TIWAppForm}, + uData in 'uData.pas' {DM: TDataModule}, + uQuery in 'uQuery.pas' {fmQuery: TIWAppForm}; + +{$R *.res} + +begin + IWRun(TfmMain, TIWServerController); +end. +{PUBDIST} + +uses + IWInitStandAlone, + ServerController in 'ServerController.pas' {IWServerController: TIWServerControllerBase}, + uBase in 'uBase.pas' {fmBase: TIWAppForm}, + uMain in 'uMain.pas' {fmMain: TIWAppForm}, + uMasterDetail in 'uMasterDetail.pas' {fmMasterDetail: TIWAppForm}, + uCachedUpdates in 'uCachedUpdates.pas' {fmCachedUpdates: TIWAppForm}, + uData in 'uData.pas' {DM: TDataModule}, + uQuery in 'uQuery.pas' {fmQuery: TIWAppForm}; + +{$R *.res} + +begin + IWRun(TfmMain, TIWServerController); +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW5/IntraWeb.res b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW5/IntraWeb.res new file mode 100644 index 0000000..1228533 Binary files /dev/null and b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW5/IntraWeb.res differ diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW5/IntraWebISAPI.dpr b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW5/IntraWebISAPI.dpr new file mode 100644 index 0000000..aa16af3 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW5/IntraWebISAPI.dpr @@ -0,0 +1,45 @@ +library IntraWebISAPI; +{PUBDIST} + +{ + Assuming the virtual directory that contains this DLL is /IntraWeb/ the URL to start this application is + http://localhost/IntraWeb/IntraWebISAPI +} + +uses + IWInitISAPI, + ServerController in 'ServerController.pas' {IWServerController: TIWServerControllerBase}, + uBase in 'uBase.pas' {fmBase: TIWAppForm}, + uMain in 'uMain.pas' {fmMain: TIWAppForm}, + uMasterDetail in 'uMasterDetail.pas' {fmMasterDetail: TIWAppForm}, + uCachedUpdates in 'uCachedUpdates.pas' {fmCachedUpdates: TIWAppForm}, + uData in 'uData.pas' {DM: TDataModule}, + uQuery in 'uQuery.pas' {fmQuery: TIWAppForm}; + +{$R *.res} + +begin + IWRun(TfmMain, TIWServerController); +end. +{PUBDIST} + +{ + Assuming the virtual directory that contains this DLL is /IntraWeb/ the URL to start this application is + http://localhost/IntraWeb/IntraWebISAPI +} + +uses + IWInitISAPI, + ServerController in 'ServerController.pas' {IWServerController: TIWServerControllerBase}, + uBase in 'uBase.pas' {fmBase: TIWAppForm}, + uMain in 'uMain.pas' {fmMain: TIWAppForm}, + uMasterDetail in 'uMasterDetail.pas' {fmMasterDetail: TIWAppForm}, + uCachedUpdates in 'uCachedUpdates.pas' {fmCachedUpdates: TIWAppForm}, + uData in 'uData.pas' {DM: TDataModule}, + uQuery in 'uQuery.pas' {fmQuery: TIWAppForm}; + +{$R *.res} + +begin + IWRun(TfmMain, TIWServerController); +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW5/ReadMe.txt b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW5/ReadMe.txt new file mode 100644 index 0000000..09f2e88 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW5/ReadMe.txt @@ -0,0 +1,10 @@ +SQL Server Data Access Components +Copyright 1997-2007, Core Lab. All Rights Reserved +-------------------------------------------------- + +Demo for IntraWeb included in SDAC was built and tested using +IntraWeb 5 for Delphi 7. + +IMPORTANT NOTE: + Demo provided as is and there are no warranty that it is fully + compatible with other versions of IntraWeb. \ No newline at end of file diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW5/ServerController.dfm b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW5/ServerController.dfm new file mode 100644 index 0000000..2fa3c5e --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW5/ServerController.dfm @@ -0,0 +1,43 @@ +object IWServerController: TIWServerController + OldCreateOrder = True + AppName = 'MyIWApp' + ComInitialization = ciNormal + SessionTrackingMethod = tmURL + Description = 'SQL Server Data Access Demo - IntraWeb' + DestinationDevice = ddWeb + ExceptionDisplayMode = smAlert + ExecCmd = 'EXEC' + HistoryEnabled = False + Port = 0 + RestrictIPs = False + ShowResyncWarning = True + SessionTimeout = 10 + SSLPort = 0 + SupportedBrowsers = [brIE, brNetscape6, brOpera] + OnNewSession = IWServerControllerBaseNewSession + Left = 171 + Top = 149 + Height = 105 + Width = 206 +end + OldCreateOrder = True + AppName = 'MyIWApp' + ComInitialization = ciNormal + SessionTrackingMethod = tmURL + Description = 'SQL Server Data Access Demo - IntraWeb' + DestinationDevice = ddWeb + ExceptionDisplayMode = smAlert + ExecCmd = 'EXEC' + HistoryEnabled = False + Port = 0 + RestrictIPs = False + ShowResyncWarning = True + SessionTimeout = 10 + SSLPort = 0 + SupportedBrowsers = [brIE, brNetscape6, brOpera] + OnNewSession = IWServerControllerBaseNewSession + Left = 171 + Top = 149 + Height = 105 + Width = 206 +end diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW5/ServerController.pas b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW5/ServerController.pas new file mode 100644 index 0000000..fe859aa --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW5/ServerController.pas @@ -0,0 +1,275 @@ +unit ServerController; +{PUBDIST} + +interface + +uses + SysUtils, Classes, IWServerControllerBase, + // For OnNewSession Event + IWApplication, IWAppForm, + IWInit, IWInitISAPI, + uData, uMain, uQuery, uCachedUpdates, uMasterDetail, + MemDS, DBAccess, ActiveX; + +type + TIWServerController = class(TIWServerControllerBase) + procedure IWServerControllerBaseNewSession(ASession: TIWApplication; + var VMainForm: TIWAppForm); + private + public + end; + + // This is a class which you can add variables to that are specific to the user. Add variables + // to this class instead of creating global variables. This object can references by using: + // UserSession + // So if a variable named UserName of type string is added, it can be referenced by using: + // UserSession.UserName + // Such variables are similar to globals in a normal application, however these variables are + // specific to each user. + // + // See the IntraWeb Manual for more details. + TUserSession = class + public + { Common } + DM: TDM; + fmMain: TfmMain; + fmQuery: TfmQuery; + fmCachedUpdates: TfmCachedUpdates; + fmMasterDetail: TfmMasterDetail; + + { Main } + Username, + Password, + Server, + Database: string; + Pooling, + DisconnectedMode, + FailOver: boolean; + PoolingOptions: TPoolingOptions; + ConnectionResult: string; + IsGoodConnection: boolean; + + { Query } + QuerySQL, + QueryResult: string; + isGoodQuery: boolean; + + { MasterDetail } + MasterSQL, + DetailSQL, + MasterFields, + DetailFields: string; + LocalMasterDetail, + CacheCalcFields: boolean; + MasterDetailResult: string; + isGoodMasterDetail: boolean; + + { CachedUpdates } + CachedSQL: string; + UseCachedUpdates: boolean; + CachedRecordTypes: TUpdateRecordTypes; + CachedResult: string; + isGoodCached: boolean; + + constructor Create; overload; + destructor Destroy; override; + end; + +// Procs + function UserSession: TUserSession; + function DM: TDM; + +implementation + +uses ComObj; + +{$R *.dfm} + +function UserSession: TUserSession; +begin + Result := TUserSession(RWebApplication.Data); +end; + +function DM: TDM; +begin + Result := TUserSession(RWebApplication.Data).DM; +end; + +{ TUserSession } + +constructor TUserSession.Create; +begin + QuerySQL := 'select * from emp'; + MasterSQL := 'select * from dept'; + DetailSQL := QuerySQL; + CachedSQL := QuerySQL; + MasterFields := 'deptno'; + DetailFields := 'deptno'; + LocalMasterDetail := True; + CacheCalcFields := True; + UseCachedUpdates := True; + Pooling := True; + DisconnectedMode := True; + CachedRecordTypes := [rtUnmodified, rtModified, rtInserted]; + + PoolingOptions := TPoolingOptions.Create(nil); +end; + +destructor TUserSession.Destroy; +begin + PoolingOptions.Free; + inherited; +end; + +{ TIWServerController } + +procedure TIWServerController.IWServerControllerBaseNewSession( + ASession: TIWApplication; var VMainForm: TIWAppForm); +begin + ASession.Data := TUserSession.Create; + with TUserSession(ASession.Data) do begin + DM := TDM.Create(ASession); + fmQuery := TfmQuery.Create(ASession); + fmCachedUpdates := TfmCachedUpdates.Create(ASession); + fmMasterDetail := TfmMasterDetail.Create(ASession); + end; +end; + +end. +{PUBDIST} + +interface + +uses + SysUtils, Classes, IWServerControllerBase, + // For OnNewSession Event + IWApplication, IWAppForm, + IWInit, IWInitISAPI, + uData, uMain, uQuery, uCachedUpdates, uMasterDetail, + MemDS, DBAccess, ActiveX; + +type + TIWServerController = class(TIWServerControllerBase) + procedure IWServerControllerBaseNewSession(ASession: TIWApplication; + var VMainForm: TIWAppForm); + private + public + end; + + // This is a class which you can add variables to that are specific to the user. Add variables + // to this class instead of creating global variables. This object can references by using: + // UserSession + // So if a variable named UserName of type string is added, it can be referenced by using: + // UserSession.UserName + // Such variables are similar to globals in a normal application, however these variables are + // specific to each user. + // + // See the IntraWeb Manual for more details. + TUserSession = class + public + { Common } + DM: TDM; + fmMain: TfmMain; + fmQuery: TfmQuery; + fmCachedUpdates: TfmCachedUpdates; + fmMasterDetail: TfmMasterDetail; + + { Main } + Username, + Password, + Server, + Database: string; + Pooling, + DisconnectedMode, + FailOver: boolean; + PoolingOptions: TPoolingOptions; + ConnectionResult: string; + IsGoodConnection: boolean; + + { Query } + QuerySQL, + QueryResult: string; + isGoodQuery: boolean; + + { MasterDetail } + MasterSQL, + DetailSQL, + MasterFields, + DetailFields: string; + LocalMasterDetail, + CacheCalcFields: boolean; + MasterDetailResult: string; + isGoodMasterDetail: boolean; + + { CachedUpdates } + CachedSQL: string; + UseCachedUpdates: boolean; + CachedRecordTypes: TUpdateRecordTypes; + CachedResult: string; + isGoodCached: boolean; + + constructor Create; overload; + destructor Destroy; override; + end; + +// Procs + function UserSession: TUserSession; + function DM: TDM; + +implementation + +uses ComObj; + +{$R *.dfm} + +function UserSession: TUserSession; +begin + Result := TUserSession(RWebApplication.Data); +end; + +function DM: TDM; +begin + Result := TUserSession(RWebApplication.Data).DM; +end; + +{ TUserSession } + +constructor TUserSession.Create; +begin + QuerySQL := 'select * from emp'; + MasterSQL := 'select * from dept'; + DetailSQL := QuerySQL; + CachedSQL := QuerySQL; + MasterFields := 'deptno'; + DetailFields := 'deptno'; + LocalMasterDetail := True; + CacheCalcFields := True; + UseCachedUpdates := True; + Pooling := True; + DisconnectedMode := True; + CachedRecordTypes := [rtUnmodified, rtModified, rtInserted]; + + PoolingOptions := TPoolingOptions.Create(nil); +end; + +destructor TUserSession.Destroy; +begin + PoolingOptions.Free; + inherited; +end; + +{ TIWServerController } + +procedure TIWServerController.IWServerControllerBaseNewSession( + ASession: TIWApplication; var VMainForm: TIWAppForm); +begin + ASession.Data := TUserSession.Create; + with TUserSession(ASession.Data) do begin + DM := TDM.Create(ASession); + fmQuery := TfmQuery.Create(ASession); + fmCachedUpdates := TfmCachedUpdates.Create(ASession); + fmMasterDetail := TfmMasterDetail.Create(ASession); + end; +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW5/uBase.dfm b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW5/uBase.dfm new file mode 100644 index 0000000..b635734 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW5/uBase.dfm @@ -0,0 +1,463 @@ +object fmBase: TfmBase + Left = 0 + Top = 0 + Width = 620 + Height = 430 + Background.Fixed = False + HandleTabs = False + Title = 'SQL Server Data Access Demo - IntraWeb' + SupportedBrowsers = [brIE, brNetscape6] + ShowHint = True + OnRender = IWAppFormRender + DesignSize = ( + 620 + 430) + DesignLeft = 214 + DesignTop = 95 + object IWRectangle: TIWRectangle + Left = 12 + Top = 16 + Width = 599 + Height = 28 + Anchors = [akLeft, akTop, akRight] + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Font.Color = clHighlight + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 12 + Font.Style = [fsBold] + Color = clSkyBlue + Alignment = taLeftJustify + VAlign = vaMiddle + end + object lbDemoCaption: TIWLabel + Left = 20 + Top = 21 + Width = 373 + Height = 18 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Font.Color = 6956042 + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 12 + Font.Style = [fsBold] + AutoSize = False + Caption = 'SQL Server Data Access Demo - IntraWeb' + RawText = False + end + object lbPageName: TIWLabel + Left = 515 + Top = 22 + Width = 88 + Height = 16 + Anchors = [akTop, akRight] + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Font.Color = 6956042 + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsItalic] + Caption = 'lbPageName' + RawText = False + end + object lnkMain: TIWLink + Left = 16 + Top = 56 + Width = 41 + Height = 25 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Color = clNone + Caption = 'Main' + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + ScriptEvents = <> + DoSubmitValidation = False + OnClick = lnkMainClick + end + object lnkQuery: TIWLink + Left = 69 + Top = 56 + Width = 65 + Height = 17 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Color = clNone + Caption = 'Query' + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + ScriptEvents = <> + DoSubmitValidation = False + OnClick = lnkQueryClick + end + object lnkCachedUpdates: TIWLink + Left = 138 + Top = 56 + Width = 121 + Height = 17 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Color = clNone + Caption = 'CachedUpdates' + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + ScriptEvents = <> + DoSubmitValidation = False + OnClick = lnkCachedUpdatesClick + end + object lnkMasterDetail: TIWLink + Left = 264 + Top = 56 + Width = 105 + Height = 17 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Color = clNone + Caption = 'MasterDetail' + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + ScriptEvents = <> + DoSubmitValidation = False + OnClick = lnkMasterDetailClick + end + object rgConnection: TIWRegion + Left = 16 + Top = 78 + Width = 594 + Height = 42 + Anchors = [akLeft, akTop, akRight] + TabOrder = 0 + Color = clBlack + DesignSize = ( + 594 + 42) + object IWRectangle4: TIWRectangle + Left = 1 + Top = 1 + Width = 592 + Height = 40 + Anchors = [akLeft, akTop, akRight, akBottom] + ShowHint = True + ParentShowHint = False + ZIndex = -1 + Font.Color = clNone + Font.Enabled = True + Font.Size = 10 + Font.Style = [] + Color = 14811135 + Alignment = taLeftJustify + VAlign = vaMiddle + end + object btConnect: TIWButton + Left = 8 + Top = 8 + Width = 97 + Height = 25 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + ButtonType = btButton + Caption = 'Connect' + Color = clBtnFace + DoSubmitValidation = True + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + ScriptEvents = <> + TabOrder = 0 + OnClick = btConnectClick + end + object btDisconnect: TIWButton + Left = 112 + Top = 8 + Width = 97 + Height = 25 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + ButtonType = btButton + Caption = 'Disconnect' + Color = clBtnFace + DoSubmitValidation = True + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + ScriptEvents = <> + TabOrder = 1 + OnClick = btDisconnectClick + end + object lbStateConnection: TIWLabel + Left = 216 + Top = 11 + Width = 147 + Height = 16 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + Caption = 'lbStateConnection' + RawText = False + end + end +end + Left = 0 + Top = 0 + Width = 620 + Height = 430 + Background.Fixed = False + HandleTabs = False + Title = 'SQL Server Data Access Demo - IntraWeb' + SupportedBrowsers = [brIE, brNetscape6] + ShowHint = True + OnRender = IWAppFormRender + DesignSize = ( + 620 + 430) + DesignLeft = 214 + DesignTop = 95 + object IWRectangle: TIWRectangle + Left = 12 + Top = 16 + Width = 599 + Height = 28 + Anchors = [akLeft, akTop, akRight] + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Font.Color = clHighlight + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 12 + Font.Style = [fsBold] + Color = clSkyBlue + Alignment = taLeftJustify + VAlign = vaMiddle + end + object lbDemoCaption: TIWLabel + Left = 20 + Top = 21 + Width = 373 + Height = 18 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Font.Color = 6956042 + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 12 + Font.Style = [fsBold] + AutoSize = False + Caption = 'SQL Server Data Access Demo - IntraWeb' + RawText = False + end + object lbPageName: TIWLabel + Left = 515 + Top = 22 + Width = 88 + Height = 16 + Anchors = [akTop, akRight] + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Font.Color = 6956042 + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsItalic] + Caption = 'lbPageName' + RawText = False + end + object lnkMain: TIWLink + Left = 16 + Top = 56 + Width = 41 + Height = 25 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Color = clNone + Caption = 'Main' + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + ScriptEvents = <> + DoSubmitValidation = False + OnClick = lnkMainClick + end + object lnkQuery: TIWLink + Left = 69 + Top = 56 + Width = 65 + Height = 17 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Color = clNone + Caption = 'Query' + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + ScriptEvents = <> + DoSubmitValidation = False + OnClick = lnkQueryClick + end + object lnkCachedUpdates: TIWLink + Left = 138 + Top = 56 + Width = 121 + Height = 17 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Color = clNone + Caption = 'CachedUpdates' + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + ScriptEvents = <> + DoSubmitValidation = False + OnClick = lnkCachedUpdatesClick + end + object lnkMasterDetail: TIWLink + Left = 264 + Top = 56 + Width = 105 + Height = 17 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Color = clNone + Caption = 'MasterDetail' + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + ScriptEvents = <> + DoSubmitValidation = False + OnClick = lnkMasterDetailClick + end + object rgConnection: TIWRegion + Left = 16 + Top = 78 + Width = 594 + Height = 42 + Anchors = [akLeft, akTop, akRight] + TabOrder = 0 + Color = clBlack + DesignSize = ( + 594 + 42) + object IWRectangle4: TIWRectangle + Left = 1 + Top = 1 + Width = 592 + Height = 40 + Anchors = [akLeft, akTop, akRight, akBottom] + ShowHint = True + ParentShowHint = False + ZIndex = -1 + Font.Color = clNone + Font.Enabled = True + Font.Size = 10 + Font.Style = [] + Color = 14811135 + Alignment = taLeftJustify + VAlign = vaMiddle + end + object btConnect: TIWButton + Left = 8 + Top = 8 + Width = 97 + Height = 25 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + ButtonType = btButton + Caption = 'Connect' + Color = clBtnFace + DoSubmitValidation = True + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + ScriptEvents = <> + TabOrder = 0 + OnClick = btConnectClick + end + object btDisconnect: TIWButton + Left = 112 + Top = 8 + Width = 97 + Height = 25 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + ButtonType = btButton + Caption = 'Disconnect' + Color = clBtnFace + DoSubmitValidation = True + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + ScriptEvents = <> + TabOrder = 1 + OnClick = btDisconnectClick + end + object lbStateConnection: TIWLabel + Left = 216 + Top = 11 + Width = 147 + Height = 16 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + Caption = 'lbStateConnection' + RawText = False + end + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW5/uBase.pas b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW5/uBase.pas new file mode 100644 index 0000000..a073dac --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW5/uBase.pas @@ -0,0 +1,243 @@ +unit uBase; +{PUBDIST} + +interface + +uses + IWAppForm, IWApplication, IWTypes, Classes, Controls, IWControl, + IWCompRectangle, IWCompButton, IWGrids, IWDBGrids, IWDBStdCtrls, + IWCompMemo, IWCompEdit, IWCompText, IWCompLabel, IWHTMLControls, + IWContainer, IWRegion, ActiveX, + Forms, Graphics, DB, MemDS, DBAccess, MSAccess; +type + TfmBase = class(TIWAppForm) + IWRectangle: TIWRectangle; + lbDemoCaption: TIWLabel; + lbPageName: TIWLabel; + lnkMain: TIWLink; + lnkQuery: TIWLink; + lnkCachedUpdates: TIWLink; + lnkMasterDetail: TIWLink; + rgConnection: TIWRegion; + IWRectangle4: TIWRectangle; + btConnect: TIWButton; + btDisconnect: TIWButton; + lbStateConnection: TIWLabel; + procedure lnkMainClick(Sender: TObject); + procedure lnkQueryClick(Sender: TObject); + procedure lnkCachedUpdatesClick(Sender: TObject); + procedure IWAppFormRender(Sender: TObject); + procedure lnkMasterDetailClick(Sender: TObject); + procedure btConnectClick(Sender: TObject); + procedure btDisconnectClick(Sender: TObject); + protected + procedure ReadFromControls; virtual; + end; + +const + ResultColors: array[boolean] of TColor = (clRed, $006A240A); + +implementation +{$R *.dfm} + +uses + IWInit, ServerController, SysUtils, IWForm; + + +procedure TfmBase.IWAppFormRender(Sender: TObject); + + procedure SetLinkState(Link: TIWLink; Form: TfmBase); + begin + Link.Enabled := Sender <> Form; + if Link.Enabled then + Link.Font.Style := [] + else + Link.Font.Style := [fsBold]; + end; + +begin + SetLinkState(lnkMain, UserSession.fmMain); + SetLinkState(lnkQuery, UserSession.fmQuery); + SetLinkState(lnkCachedUpdates, UserSession.fmCachedUpdates); + SetLinkState(lnkMasterDetail, UserSession.fmMasterDetail); + + lbStateConnection.Font.Color := ResultColors[UserSession.IsGoodConnection]; + lbStateConnection.Caption := UserSession.ConnectionResult; + btDisconnect.Enabled := DM.Connection.Connected; + btConnect.Enabled := not DM.Connection.Connected; +end; + +procedure TfmBase.lnkMainClick(Sender: TObject); +begin + ReadFromControls; + RWebApplication.SetActiveForm(UserSession.fmMain); +end; + +procedure TfmBase.lnkQueryClick(Sender: TObject); +begin + ReadFromControls; + RWebApplication.SetActiveForm(UserSession.fmQuery); +end; + +procedure TfmBase.lnkCachedUpdatesClick(Sender: TObject); +begin + ReadFromControls; + RWebApplication.SetActiveForm(UserSession.fmCachedUpdates); +end; + +procedure TfmBase.lnkMasterDetailClick(Sender: TObject); +begin + ReadFromControls; + RWebApplication.SetActiveForm(UserSession.fmMasterDetail); +end; + +procedure TfmBase.btConnectClick(Sender: TObject); +begin + ReadFromControls; + try + DM.Connection.Connect; + UserSession.IsGoodConnection := True; + except + UserSession.IsGoodConnection := False; + UserSession.ConnectionResult := 'Failed'; + end; +end; + +procedure TfmBase.btDisconnectClick(Sender: TObject); +begin + ReadFromControls; + try + DM.Connection.Disconnect; + UserSession.ConnectionResult := '' + except + UserSession.IsGoodConnection := False; + UserSession.ConnectionResult := 'Failed'; + end; +end; + +procedure TfmBase.ReadFromControls; +begin +end; + +end. +{PUBDIST} + +interface + +uses + IWAppForm, IWApplication, IWTypes, Classes, Controls, IWControl, + IWCompRectangle, IWCompButton, IWGrids, IWDBGrids, IWDBStdCtrls, + IWCompMemo, IWCompEdit, IWCompText, IWCompLabel, IWHTMLControls, + IWContainer, IWRegion, ActiveX, + Forms, Graphics, DB, MemDS, DBAccess, MSAccess; +type + TfmBase = class(TIWAppForm) + IWRectangle: TIWRectangle; + lbDemoCaption: TIWLabel; + lbPageName: TIWLabel; + lnkMain: TIWLink; + lnkQuery: TIWLink; + lnkCachedUpdates: TIWLink; + lnkMasterDetail: TIWLink; + rgConnection: TIWRegion; + IWRectangle4: TIWRectangle; + btConnect: TIWButton; + btDisconnect: TIWButton; + lbStateConnection: TIWLabel; + procedure lnkMainClick(Sender: TObject); + procedure lnkQueryClick(Sender: TObject); + procedure lnkCachedUpdatesClick(Sender: TObject); + procedure IWAppFormRender(Sender: TObject); + procedure lnkMasterDetailClick(Sender: TObject); + procedure btConnectClick(Sender: TObject); + procedure btDisconnectClick(Sender: TObject); + protected + procedure ReadFromControls; virtual; + end; + +const + ResultColors: array[boolean] of TColor = (clRed, $006A240A); + +implementation +{$R *.dfm} + +uses + IWInit, ServerController, SysUtils, IWForm; + + +procedure TfmBase.IWAppFormRender(Sender: TObject); + + procedure SetLinkState(Link: TIWLink; Form: TfmBase); + begin + Link.Enabled := Sender <> Form; + if Link.Enabled then + Link.Font.Style := [] + else + Link.Font.Style := [fsBold]; + end; + +begin + SetLinkState(lnkMain, UserSession.fmMain); + SetLinkState(lnkQuery, UserSession.fmQuery); + SetLinkState(lnkCachedUpdates, UserSession.fmCachedUpdates); + SetLinkState(lnkMasterDetail, UserSession.fmMasterDetail); + + lbStateConnection.Font.Color := ResultColors[UserSession.IsGoodConnection]; + lbStateConnection.Caption := UserSession.ConnectionResult; + btDisconnect.Enabled := DM.Connection.Connected; + btConnect.Enabled := not DM.Connection.Connected; +end; + +procedure TfmBase.lnkMainClick(Sender: TObject); +begin + ReadFromControls; + RWebApplication.SetActiveForm(UserSession.fmMain); +end; + +procedure TfmBase.lnkQueryClick(Sender: TObject); +begin + ReadFromControls; + RWebApplication.SetActiveForm(UserSession.fmQuery); +end; + +procedure TfmBase.lnkCachedUpdatesClick(Sender: TObject); +begin + ReadFromControls; + RWebApplication.SetActiveForm(UserSession.fmCachedUpdates); +end; + +procedure TfmBase.lnkMasterDetailClick(Sender: TObject); +begin + ReadFromControls; + RWebApplication.SetActiveForm(UserSession.fmMasterDetail); +end; + +procedure TfmBase.btConnectClick(Sender: TObject); +begin + ReadFromControls; + try + DM.Connection.Connect; + UserSession.IsGoodConnection := True; + except + UserSession.IsGoodConnection := False; + UserSession.ConnectionResult := 'Failed'; + end; +end; + +procedure TfmBase.btDisconnectClick(Sender: TObject); +begin + ReadFromControls; + try + DM.Connection.Disconnect; + UserSession.ConnectionResult := '' + except + UserSession.IsGoodConnection := False; + UserSession.ConnectionResult := 'Failed'; + end; +end; + +procedure TfmBase.ReadFromControls; +begin +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW5/uCachedUpdates.dfm b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW5/uCachedUpdates.dfm new file mode 100644 index 0000000..12247ab --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW5/uCachedUpdates.dfm @@ -0,0 +1,1163 @@ +inherited fmCachedUpdates: TfmCachedUpdates + Width = 662 + Height = 570 + OnCreate = IWAppFormCreate + DesignLeft = 255 + DesignTop = 81 + inherited IWRectangle: TIWRectangle + Width = 625 + end + inherited lbPageName: TIWLabel + Left = 522 + Width = 113 + Caption = 'CachedUpdates' + end + object IWDBNavigator1: TIWDBNavigator [7] + Left = 16 + Top = 312 + Width = 230 + Height = 30 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Confirmations.Delete = 'Are you sure you want to delete this record?' + Confirmations.Post = 'Are you sure you want to update this record?' + Confirmations.Cancel = 'Are you sure you want to cancel your changes to this record?' + DataSource = DataSource + ImageHeight = 21 + ImageWidth = 21 + VisibleButtons = [nbFirst, nbPrior, nbNext, nbLast, nbInsert, nbDelete, nbEdit, nbPost, nbCancel, nbRefresh] + Orientation = orHorizontal + end + object IWDBGrid1: TIWDBGrid [8] + Left = 16 + Top = 344 + Width = 621 + Height = 135 + Anchors = [akLeft, akTop, akRight] + ShowHint = True + ParentShowHint = False + ZIndex = 0 + BorderColors.Color = clNone + BorderColors.Light = clNone + BorderColors.Dark = clNone + BGColor = clSkyBlue + BorderSize = 1 + BorderStyle = tfDefault + CellPadding = 0 + CellSpacing = 0 + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + FrameBuffer = 40 + Lines = tlAll + UseFrame = True + UseWidth = True + Columns = <> + DataSource = DataSource + FooterRowCount = 0 + FromStart = True + HighlightColor = clNone + HighlightRows = False + Options = [dgShowTitles] + RefreshMode = rmAutomatic + RowLimit = 0 + RollOver = False + RowClick = False + RollOverColor = clNone + RowHeaderColor = 12876667 + RowAlternateColor = clNone + RowCurrentColor = clMoneyGreen + end + inherited rgConnection: TIWRegion + Width = 620 + inherited IWRectangle4: TIWRectangle + Width = 618 + end + end + object IWRegion4: TIWRegion + Left = 16 + Top = 128 + Width = 620 + Height = 177 + Anchors = [akLeft, akTop, akRight] + TabOrder = 1 + Color = clBlack + DesignSize = ( + 620 + 177) + object IWRectangle3: TIWRectangle + Left = 1 + Top = 1 + Width = 618 + Height = 175 + Anchors = [akLeft, akTop, akRight, akBottom] + ShowHint = True + ParentShowHint = False + ZIndex = -1 + Font.Color = clNone + Font.Enabled = True + Font.Size = 10 + Font.Style = [] + Color = 14811135 + Alignment = taLeftJustify + VAlign = vaMiddle + end + object cbCachedUpdates: TIWCheckBox + Left = 8 + Top = 8 + Width = 137 + Height = 21 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Caption = 'CachedUpdates' + Editable = True + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + ScriptEvents = <> + DoSubmitValidation = True + Style = stNormal + TabOrder = 2 + Checked = False + end + object IWLabel1: TIWLabel + Left = 8 + Top = 111 + Width = 30 + Height = 16 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + Caption = 'SQL' + RawText = False + end + object btOpen: TIWButton + Left = 8 + Top = 30 + Width = 97 + Height = 25 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + ButtonType = btButton + Caption = 'Open' + Color = clBtnFace + DoSubmitValidation = True + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + ScriptEvents = <> + TabOrder = 7 + OnClick = btOpenClick + end + object btClose: TIWButton + Left = 112 + Top = 31 + Width = 97 + Height = 25 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + ButtonType = btButton + Caption = 'Close' + Color = clBtnFace + DoSubmitValidation = True + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + ScriptEvents = <> + TabOrder = 8 + OnClick = btCloseClick + end + object cbUnmodified: TIWCheckBox + Left = 265 + Top = 9 + Width = 98 + Height = 21 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Caption = 'Unmodified' + Editable = True + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + ScriptEvents = <> + DoSubmitValidation = True + OnClick = cbModifiedClick + Style = stNormal + TabOrder = 3 + Checked = False + end + object cbModified: TIWCheckBox + Left = 361 + Top = 9 + Width = 82 + Height = 21 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Caption = 'Modified' + Editable = True + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + ScriptEvents = <> + DoSubmitValidation = True + OnClick = cbModifiedClick + Style = stNormal + TabOrder = 4 + Checked = False + end + object cbInserted: TIWCheckBox + Left = 441 + Top = 9 + Width = 82 + Height = 21 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Caption = 'Inserted' + Editable = True + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + ScriptEvents = <> + DoSubmitValidation = True + OnClick = cbModifiedClick + Style = stNormal + TabOrder = 5 + Checked = False + end + object cbDeleted: TIWCheckBox + Left = 521 + Top = 9 + Width = 74 + Height = 21 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Caption = 'Deleted' + Editable = True + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + ScriptEvents = <> + DoSubmitValidation = True + OnClick = cbModifiedClick + Style = stNormal + TabOrder = 6 + Checked = False + end + object IWLabel2: TIWLabel + Left = 162 + Top = 10 + Width = 107 + Height = 16 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + Caption = 'RecordTypes:' + RawText = False + end + object lbResult: TIWLabel + Left = 226 + Top = 34 + Width = 63 + Height = 16 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + Caption = 'lbResult' + RawText = False + end + object lbUpdates: TIWLabel + Left = 177 + Top = 60 + Width = 80 + Height = 16 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Font.Color = 6956042 + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + Caption = 'lbUpdates' + RawText = False + end + object btApply: TIWButton + Left = 8 + Top = 80 + Width = 75 + Height = 25 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + ButtonType = btButton + Caption = 'Apply' + Color = clBtnFace + DoSubmitValidation = True + Font.Color = clNone + Font.Enabled = True + Font.Size = 10 + Font.Style = [] + ScriptEvents = <> + TabOrder = 9 + OnClick = btApplyClick + end + object btCommit: TIWButton + Left = 88 + Top = 80 + Width = 75 + Height = 25 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + ButtonType = btButton + Caption = 'Commit' + Color = clBtnFace + DoSubmitValidation = True + Font.Color = clNone + Font.Enabled = True + Font.Size = 10 + Font.Style = [] + ScriptEvents = <> + TabOrder = 10 + OnClick = btCommitClick + end + object btCancel: TIWButton + Left = 168 + Top = 80 + Width = 75 + Height = 25 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + ButtonType = btButton + Caption = 'Cancel' + Color = clBtnFace + DoSubmitValidation = True + Font.Color = clNone + Font.Enabled = True + Font.Size = 10 + Font.Style = [] + ScriptEvents = <> + TabOrder = 11 + OnClick = btCancelClick + end + object btRevert: TIWButton + Left = 248 + Top = 80 + Width = 75 + Height = 25 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + ButtonType = btButton + Caption = 'Revert' + Color = clBtnFace + DoSubmitValidation = True + Font.Color = clNone + Font.Enabled = True + Font.Size = 10 + Font.Style = [] + ScriptEvents = <> + TabOrder = 12 + OnClick = btRevertClick + end + object btTransStart: TIWButton + Left = 352 + Top = 80 + Width = 75 + Height = 25 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + ButtonType = btButton + Caption = 'Start' + Color = clBtnFace + DoSubmitValidation = True + Font.Color = clNone + Font.Enabled = True + Font.Size = 10 + Font.Style = [] + ScriptEvents = <> + TabOrder = 13 + OnClick = btTransStartClick + end + object btTransCommit: TIWButton + Left = 432 + Top = 80 + Width = 75 + Height = 25 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + ButtonType = btButton + Caption = 'Commit' + Color = clBtnFace + DoSubmitValidation = True + Font.Color = clNone + Font.Enabled = True + Font.Size = 10 + Font.Style = [] + ScriptEvents = <> + TabOrder = 14 + OnClick = btTransCommitClick + end + object btTransRollback: TIWButton + Left = 512 + Top = 80 + Width = 75 + Height = 25 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + ButtonType = btButton + Caption = 'Rollback' + Color = clBtnFace + DoSubmitValidation = True + Font.Color = clNone + Font.Enabled = True + Font.Size = 10 + Font.Style = [] + ScriptEvents = <> + TabOrder = 15 + OnClick = btTransRollbackClick + end + object IWLabel4: TIWLabel + Left = 16 + Top = 60 + Width = 66 + Height = 16 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + Caption = 'Updates' + RawText = False + end + object IWLabel6: TIWLabel + Left = 368 + Top = 60 + Width = 93 + Height = 16 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + Caption = 'Transaction' + RawText = False + end + object lbTransaction: TIWLabel + Left = 472 + Top = 60 + Width = 107 + Height = 16 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Font.Color = 6956042 + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + Caption = 'lbTransaction' + RawText = False + end + object IWRegion1: TIWRegion + Left = 48 + Top = 112 + Width = 562 + Height = 49 + Anchors = [akLeft, akTop, akRight] + TabOrder = 0 + Color = clNone + object meSQL: TIWMemo + Left = 0 + Top = 0 + Width = 562 + Height = 49 + Align = alClient + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Editable = True + Font.Color = clNone + Font.Enabled = True + Font.Size = 10 + Font.Style = [] + ScriptEvents = <> + RawText = False + ReadOnly = False + Required = False + TabOrder = 16 + WantReturns = False + FriendlyName = 'meSQL' + end + end + end + object rgEdits: TIWRegion + Left = 16 + Top = 485 + Width = 621 + Height = 62 + Visible = False + Anchors = [akLeft, akTop, akRight] + TabOrder = 2 + Color = clBlack + DesignSize = ( + 621 + 62) + object rcEdits: TIWRectangle + Left = 1 + Top = 1 + Width = 619 + Height = 60 + Anchors = [akLeft, akTop, akRight, akBottom] + ShowHint = True + ParentShowHint = False + ZIndex = -1 + Font.Color = clNone + Font.Enabled = True + Font.Size = 10 + Font.Style = [] + Color = 14811135 + Alignment = taLeftJustify + VAlign = vaMiddle + end + end + object Query: TMSQuery + Left = 432 + Top = 264 + end + object DataSource: TDataSource + DataSet = Query + Left = 456 + Top = 264 + end +end + Width = 662 + Height = 570 + OnCreate = IWAppFormCreate + DesignLeft = 255 + DesignTop = 81 + inherited IWRectangle: TIWRectangle + Width = 625 + end + inherited lbPageName: TIWLabel + Left = 522 + Width = 113 + Caption = 'CachedUpdates' + end + object IWDBNavigator1: TIWDBNavigator [7] + Left = 16 + Top = 312 + Width = 230 + Height = 30 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Confirmations.Delete = 'Are you sure you want to delete this record?' + Confirmations.Post = 'Are you sure you want to update this record?' + Confirmations.Cancel = 'Are you sure you want to cancel your changes to this record?' + DataSource = DataSource + ImageHeight = 21 + ImageWidth = 21 + VisibleButtons = [nbFirst, nbPrior, nbNext, nbLast, nbInsert, nbDelete, nbEdit, nbPost, nbCancel, nbRefresh] + Orientation = orHorizontal + end + object IWDBGrid1: TIWDBGrid [8] + Left = 16 + Top = 344 + Width = 621 + Height = 135 + Anchors = [akLeft, akTop, akRight] + ShowHint = True + ParentShowHint = False + ZIndex = 0 + BorderColors.Color = clNone + BorderColors.Light = clNone + BorderColors.Dark = clNone + BGColor = clSkyBlue + BorderSize = 1 + BorderStyle = tfDefault + CellPadding = 0 + CellSpacing = 0 + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + FrameBuffer = 40 + Lines = tlAll + UseFrame = True + UseWidth = True + Columns = <> + DataSource = DataSource + FooterRowCount = 0 + FromStart = True + HighlightColor = clNone + HighlightRows = False + Options = [dgShowTitles] + RefreshMode = rmAutomatic + RowLimit = 0 + RollOver = False + RowClick = False + RollOverColor = clNone + RowHeaderColor = 12876667 + RowAlternateColor = clNone + RowCurrentColor = clMoneyGreen + end + inherited rgConnection: TIWRegion + Width = 620 + inherited IWRectangle4: TIWRectangle + Width = 618 + end + end + object IWRegion4: TIWRegion + Left = 16 + Top = 128 + Width = 620 + Height = 177 + Anchors = [akLeft, akTop, akRight] + TabOrder = 1 + Color = clBlack + DesignSize = ( + 620 + 177) + object IWRectangle3: TIWRectangle + Left = 1 + Top = 1 + Width = 618 + Height = 175 + Anchors = [akLeft, akTop, akRight, akBottom] + ShowHint = True + ParentShowHint = False + ZIndex = -1 + Font.Color = clNone + Font.Enabled = True + Font.Size = 10 + Font.Style = [] + Color = 14811135 + Alignment = taLeftJustify + VAlign = vaMiddle + end + object cbCachedUpdates: TIWCheckBox + Left = 8 + Top = 8 + Width = 137 + Height = 21 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Caption = 'CachedUpdates' + Editable = True + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + ScriptEvents = <> + DoSubmitValidation = True + Style = stNormal + TabOrder = 2 + Checked = False + end + object IWLabel1: TIWLabel + Left = 8 + Top = 111 + Width = 30 + Height = 16 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + Caption = 'SQL' + RawText = False + end + object btOpen: TIWButton + Left = 8 + Top = 30 + Width = 97 + Height = 25 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + ButtonType = btButton + Caption = 'Open' + Color = clBtnFace + DoSubmitValidation = True + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + ScriptEvents = <> + TabOrder = 7 + OnClick = btOpenClick + end + object btClose: TIWButton + Left = 112 + Top = 31 + Width = 97 + Height = 25 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + ButtonType = btButton + Caption = 'Close' + Color = clBtnFace + DoSubmitValidation = True + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + ScriptEvents = <> + TabOrder = 8 + OnClick = btCloseClick + end + object cbUnmodified: TIWCheckBox + Left = 265 + Top = 9 + Width = 98 + Height = 21 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Caption = 'Unmodified' + Editable = True + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + ScriptEvents = <> + DoSubmitValidation = True + OnClick = cbModifiedClick + Style = stNormal + TabOrder = 3 + Checked = False + end + object cbModified: TIWCheckBox + Left = 361 + Top = 9 + Width = 82 + Height = 21 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Caption = 'Modified' + Editable = True + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + ScriptEvents = <> + DoSubmitValidation = True + OnClick = cbModifiedClick + Style = stNormal + TabOrder = 4 + Checked = False + end + object cbInserted: TIWCheckBox + Left = 441 + Top = 9 + Width = 82 + Height = 21 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Caption = 'Inserted' + Editable = True + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + ScriptEvents = <> + DoSubmitValidation = True + OnClick = cbModifiedClick + Style = stNormal + TabOrder = 5 + Checked = False + end + object cbDeleted: TIWCheckBox + Left = 521 + Top = 9 + Width = 74 + Height = 21 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Caption = 'Deleted' + Editable = True + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + ScriptEvents = <> + DoSubmitValidation = True + OnClick = cbModifiedClick + Style = stNormal + TabOrder = 6 + Checked = False + end + object IWLabel2: TIWLabel + Left = 162 + Top = 10 + Width = 107 + Height = 16 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + Caption = 'RecordTypes:' + RawText = False + end + object lbResult: TIWLabel + Left = 226 + Top = 34 + Width = 63 + Height = 16 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + Caption = 'lbResult' + RawText = False + end + object lbUpdates: TIWLabel + Left = 177 + Top = 60 + Width = 80 + Height = 16 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Font.Color = 6956042 + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + Caption = 'lbUpdates' + RawText = False + end + object btApply: TIWButton + Left = 8 + Top = 80 + Width = 75 + Height = 25 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + ButtonType = btButton + Caption = 'Apply' + Color = clBtnFace + DoSubmitValidation = True + Font.Color = clNone + Font.Enabled = True + Font.Size = 10 + Font.Style = [] + ScriptEvents = <> + TabOrder = 9 + OnClick = btApplyClick + end + object btCommit: TIWButton + Left = 88 + Top = 80 + Width = 75 + Height = 25 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + ButtonType = btButton + Caption = 'Commit' + Color = clBtnFace + DoSubmitValidation = True + Font.Color = clNone + Font.Enabled = True + Font.Size = 10 + Font.Style = [] + ScriptEvents = <> + TabOrder = 10 + OnClick = btCommitClick + end + object btCancel: TIWButton + Left = 168 + Top = 80 + Width = 75 + Height = 25 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + ButtonType = btButton + Caption = 'Cancel' + Color = clBtnFace + DoSubmitValidation = True + Font.Color = clNone + Font.Enabled = True + Font.Size = 10 + Font.Style = [] + ScriptEvents = <> + TabOrder = 11 + OnClick = btCancelClick + end + object btRevert: TIWButton + Left = 248 + Top = 80 + Width = 75 + Height = 25 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + ButtonType = btButton + Caption = 'Revert' + Color = clBtnFace + DoSubmitValidation = True + Font.Color = clNone + Font.Enabled = True + Font.Size = 10 + Font.Style = [] + ScriptEvents = <> + TabOrder = 12 + OnClick = btRevertClick + end + object btTransStart: TIWButton + Left = 352 + Top = 80 + Width = 75 + Height = 25 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + ButtonType = btButton + Caption = 'Start' + Color = clBtnFace + DoSubmitValidation = True + Font.Color = clNone + Font.Enabled = True + Font.Size = 10 + Font.Style = [] + ScriptEvents = <> + TabOrder = 13 + OnClick = btTransStartClick + end + object btTransCommit: TIWButton + Left = 432 + Top = 80 + Width = 75 + Height = 25 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + ButtonType = btButton + Caption = 'Commit' + Color = clBtnFace + DoSubmitValidation = True + Font.Color = clNone + Font.Enabled = True + Font.Size = 10 + Font.Style = [] + ScriptEvents = <> + TabOrder = 14 + OnClick = btTransCommitClick + end + object btTransRollback: TIWButton + Left = 512 + Top = 80 + Width = 75 + Height = 25 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + ButtonType = btButton + Caption = 'Rollback' + Color = clBtnFace + DoSubmitValidation = True + Font.Color = clNone + Font.Enabled = True + Font.Size = 10 + Font.Style = [] + ScriptEvents = <> + TabOrder = 15 + OnClick = btTransRollbackClick + end + object IWLabel4: TIWLabel + Left = 16 + Top = 60 + Width = 66 + Height = 16 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + Caption = 'Updates' + RawText = False + end + object IWLabel6: TIWLabel + Left = 368 + Top = 60 + Width = 93 + Height = 16 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + Caption = 'Transaction' + RawText = False + end + object lbTransaction: TIWLabel + Left = 472 + Top = 60 + Width = 107 + Height = 16 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Font.Color = 6956042 + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + Caption = 'lbTransaction' + RawText = False + end + object IWRegion1: TIWRegion + Left = 48 + Top = 112 + Width = 562 + Height = 49 + Anchors = [akLeft, akTop, akRight] + TabOrder = 0 + Color = clNone + object meSQL: TIWMemo + Left = 0 + Top = 0 + Width = 562 + Height = 49 + Align = alClient + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Editable = True + Font.Color = clNone + Font.Enabled = True + Font.Size = 10 + Font.Style = [] + ScriptEvents = <> + RawText = False + ReadOnly = False + Required = False + TabOrder = 16 + WantReturns = False + FriendlyName = 'meSQL' + end + end + end + object rgEdits: TIWRegion + Left = 16 + Top = 485 + Width = 621 + Height = 62 + Visible = False + Anchors = [akLeft, akTop, akRight] + TabOrder = 2 + Color = clBlack + DesignSize = ( + 621 + 62) + object rcEdits: TIWRectangle + Left = 1 + Top = 1 + Width = 619 + Height = 60 + Anchors = [akLeft, akTop, akRight, akBottom] + ShowHint = True + ParentShowHint = False + ZIndex = -1 + Font.Color = clNone + Font.Enabled = True + Font.Size = 10 + Font.Style = [] + Color = 14811135 + Alignment = taLeftJustify + VAlign = vaMiddle + end + end + object Query: TMSQuery + Left = 432 + Top = 264 + end + object DataSource: TDataSource + DataSet = Query + Left = 456 + Top = 264 + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW5/uCachedUpdates.pas b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW5/uCachedUpdates.pas new file mode 100644 index 0000000..63b765e --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW5/uCachedUpdates.pas @@ -0,0 +1,479 @@ +unit uCachedUpdates; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, uBase, IWCompLabel, IWControl, IWCompRectangle, IWHTMLControls, + IWCompButton, IWContainer, IWRegion, IWCompMemo, IWCompCheckbox, DB, + MemDS, DBAccess, MSAccess, IWGrids, IWDBGrids, IWDBStdCtrls, + IWCSStdCtrls, IWClientSideDatasetBase, IWClientSideDatasetDBLink, + IWDynGrid; + +type + TfmCachedUpdates = class(TfmBase) + IWRegion4: TIWRegion; + IWRectangle3: TIWRectangle; + cbCachedUpdates: TIWCheckBox; + IWRegion1: TIWRegion; + meSQL: TIWMemo; + IWLabel1: TIWLabel; + btOpen: TIWButton; + btClose: TIWButton; + Query: TMSQuery; + cbUnmodified: TIWCheckBox; + cbModified: TIWCheckBox; + cbInserted: TIWCheckBox; + cbDeleted: TIWCheckBox; + IWLabel2: TIWLabel; + lbResult: TIWLabel; + lbUpdates: TIWLabel; + btApply: TIWButton; + btCommit: TIWButton; + btCancel: TIWButton; + btRevert: TIWButton; + btTransStart: TIWButton; + btTransCommit: TIWButton; + btTransRollback: TIWButton; + DataSource: TDataSource; + IWLabel4: TIWLabel; + IWLabel6: TIWLabel; + IWDBNavigator1: TIWDBNavigator; + lbTransaction: TIWLabel; + IWDBGrid1: TIWDBGrid; + rgEdits: TIWRegion; + rcEdits: TIWRectangle; + procedure IWAppFormCreate(Sender: TObject); + procedure IWAppFormRender(Sender: TObject); + procedure cbModifiedClick(Sender: TObject); + procedure btOpenClick(Sender: TObject); + procedure btCloseClick(Sender: TObject); + procedure btApplyClick(Sender: TObject); + procedure btCommitClick(Sender: TObject); + procedure btCancelClick(Sender: TObject); + procedure btRevertClick(Sender: TObject); + procedure btTransStartClick(Sender: TObject); + procedure btTransCommitClick(Sender: TObject); + procedure btTransRollbackClick(Sender: TObject); + protected + procedure ReadFromControls; override; + procedure DeleteCreatedControls; + end; + +implementation + +{$R *.dfm} + +uses + ServerController, UData, IWForm; + +procedure TfmCachedUpdates.IWAppFormCreate(Sender: TObject); +begin + inherited; + Query.Connection := DM.Connection; +end; + +procedure TfmCachedUpdates.ReadFromControls; +begin + inherited; + UserSession.UseCachedUpdates := cbCachedUpdates.Checked; + UserSession.CachedSQL := meSQL.Lines.Text; + + UserSession.CachedRecordTypes := []; + if cbUnmodified.Checked then + Include(UserSession.CachedRecordTypes, rtUnmodified); + if cbModified.Checked then + Include(UserSession.CachedRecordTypes, rtModified); + if cbInserted.Checked then + Include(UserSession.CachedRecordTypes, rtInserted); + if cbDeleted.Checked then + Include(UserSession.CachedRecordTypes, rtDeleted); +end; + +procedure TfmCachedUpdates.IWAppFormRender(Sender: TObject); +begin + inherited; + cbCachedUpdates.Checked := UserSession.UseCachedUpdates; + cbUnmodified.Checked := rtUnmodified in UserSession.CachedRecordTypes; + cbModified.Checked := rtModified in UserSession.CachedRecordTypes; + cbInserted.Checked := rtInserted in UserSession.CachedRecordTypes; + cbDeleted.Checked := rtDeleted in UserSession.CachedRecordTypes; + meSQL.Lines.Text := UserSession.CachedSQL; + + if Query.CachedUpdates then + Query.UpdateRecordTypes := UserSession.CachedRecordTypes; + if Query.UpdatesPending then + lbUpdates.Text := 'Updates Pending' + else + lbUpdates.Text := ''; + if Query.Connection.InTransaction then + lbTransaction.Text := 'In Transaction' + else + lbTransaction.Text := ''; + + lbResult.Font.Color := ResultColors[UserSession.IsGoodCached]; + lbResult.Caption := UserSession.CachedResult; + + IWDBGrid1.Visible := Query.Active; + +end; + +procedure TfmCachedUpdates.cbModifiedClick(Sender: TObject); +begin + ReadFromControls; +end; + +procedure TfmCachedUpdates.btOpenClick(Sender: TObject); +var + i, ATop: integer; +begin + ReadFromControls; + UserSession.isGoodCached := False; + DeleteCreatedControls; + try + IWDBGrid1.Columns.Clear; + Query.SQL.Text := UserSession.CachedSQL; + Query.CachedUpdates := UserSession.UseCachedUpdates; + Query.Execute; + UserSession.isGoodCached := True; + UserSession.CachedResult := 'Query is openned'; + ATop := 8; + if Query.FieldCount > 0 then begin + for i := 0 to Query.FieldCount - 1 do begin + with TIWLabel.Create(Self) do begin + Parent := rgEdits; + Caption := Query.Fields[i].FieldName; + Left := 24; + Top := ATop; + end; + with TIWDBEdit.Create(Self) do begin + Parent := rgEdits; + DataSource := Self.DataSource; + DataField := Query.Fields[i].FieldName; + Left := 240; + Top := ATop; + Width := 240; + end; + ATop := ATop + 24; + end; + rgEdits.Height := ATop + 4; + rcEdits.Height := rgEdits.Height - 2; + rgEdits.Visible := True; + end; + except + on E:Exception do + UserSession.CachedResult := 'Error: '+ E.Message; + end; +end; + +procedure TfmCachedUpdates.btCloseClick(Sender: TObject); +begin + ReadFromControls; + UserSession.isGoodCached := False; + DeleteCreatedControls; + try + IWDBGrid1.Columns.Clear; + Query.Close; + UserSession.isGoodCached := True; + UserSession.CachedResult := '' + except + on E:Exception do + UserSession.CachedResult := 'Error: '+ E.Message; + end; +end; + +procedure TfmCachedUpdates.btApplyClick(Sender: TObject); +begin + ReadFromControls; + Query.ApplyUpdates; +end; + +procedure TfmCachedUpdates.btCommitClick(Sender: TObject); +begin + ReadFromControls; + Query.CommitUpdates; +end; + +procedure TfmCachedUpdates.btCancelClick(Sender: TObject); +begin + ReadFromControls; + Query.CancelUpdates; +end; + +procedure TfmCachedUpdates.btRevertClick(Sender: TObject); +begin + ReadFromControls; + Query.RevertRecord; +end; + +procedure TfmCachedUpdates.btTransStartClick(Sender: TObject); +begin + ReadFromControls; + Query.Connection.StartTransaction; +end; + +procedure TfmCachedUpdates.btTransCommitClick(Sender: TObject); +begin + ReadFromControls; + Query.Connection.Commit; +end; + +procedure TfmCachedUpdates.btTransRollbackClick(Sender: TObject); +begin + ReadFromControls; + Query.Connection.Rollback; +end; + +procedure TfmCachedUpdates.DeleteCreatedControls; +var + i: integer; +begin + i := 0; + while i < rgEdits.ControlCount do + if not (rgEdits.Controls[i] is TIWRectangle) then + rgEdits.Controls[i].Free + else + Inc(i); + rgEdits.Visible := False; +end; + +end. + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, uBase, IWCompLabel, IWControl, IWCompRectangle, IWHTMLControls, + IWCompButton, IWContainer, IWRegion, IWCompMemo, IWCompCheckbox, DB, + MemDS, DBAccess, MSAccess, IWGrids, IWDBGrids, IWDBStdCtrls, + IWCSStdCtrls, IWClientSideDatasetBase, IWClientSideDatasetDBLink, + IWDynGrid; + +type + TfmCachedUpdates = class(TfmBase) + IWRegion4: TIWRegion; + IWRectangle3: TIWRectangle; + cbCachedUpdates: TIWCheckBox; + IWRegion1: TIWRegion; + meSQL: TIWMemo; + IWLabel1: TIWLabel; + btOpen: TIWButton; + btClose: TIWButton; + Query: TMSQuery; + cbUnmodified: TIWCheckBox; + cbModified: TIWCheckBox; + cbInserted: TIWCheckBox; + cbDeleted: TIWCheckBox; + IWLabel2: TIWLabel; + lbResult: TIWLabel; + lbUpdates: TIWLabel; + btApply: TIWButton; + btCommit: TIWButton; + btCancel: TIWButton; + btRevert: TIWButton; + btTransStart: TIWButton; + btTransCommit: TIWButton; + btTransRollback: TIWButton; + DataSource: TDataSource; + IWLabel4: TIWLabel; + IWLabel6: TIWLabel; + IWDBNavigator1: TIWDBNavigator; + lbTransaction: TIWLabel; + IWDBGrid1: TIWDBGrid; + rgEdits: TIWRegion; + rcEdits: TIWRectangle; + procedure IWAppFormCreate(Sender: TObject); + procedure IWAppFormRender(Sender: TObject); + procedure cbModifiedClick(Sender: TObject); + procedure btOpenClick(Sender: TObject); + procedure btCloseClick(Sender: TObject); + procedure btApplyClick(Sender: TObject); + procedure btCommitClick(Sender: TObject); + procedure btCancelClick(Sender: TObject); + procedure btRevertClick(Sender: TObject); + procedure btTransStartClick(Sender: TObject); + procedure btTransCommitClick(Sender: TObject); + procedure btTransRollbackClick(Sender: TObject); + protected + procedure ReadFromControls; override; + procedure DeleteCreatedControls; + end; + +implementation + +{$R *.dfm} + +uses + ServerController, UData, IWForm; + +procedure TfmCachedUpdates.IWAppFormCreate(Sender: TObject); +begin + inherited; + Query.Connection := DM.Connection; +end; + +procedure TfmCachedUpdates.ReadFromControls; +begin + inherited; + UserSession.UseCachedUpdates := cbCachedUpdates.Checked; + UserSession.CachedSQL := meSQL.Lines.Text; + + UserSession.CachedRecordTypes := []; + if cbUnmodified.Checked then + Include(UserSession.CachedRecordTypes, rtUnmodified); + if cbModified.Checked then + Include(UserSession.CachedRecordTypes, rtModified); + if cbInserted.Checked then + Include(UserSession.CachedRecordTypes, rtInserted); + if cbDeleted.Checked then + Include(UserSession.CachedRecordTypes, rtDeleted); +end; + +procedure TfmCachedUpdates.IWAppFormRender(Sender: TObject); +begin + inherited; + cbCachedUpdates.Checked := UserSession.UseCachedUpdates; + cbUnmodified.Checked := rtUnmodified in UserSession.CachedRecordTypes; + cbModified.Checked := rtModified in UserSession.CachedRecordTypes; + cbInserted.Checked := rtInserted in UserSession.CachedRecordTypes; + cbDeleted.Checked := rtDeleted in UserSession.CachedRecordTypes; + meSQL.Lines.Text := UserSession.CachedSQL; + + if Query.CachedUpdates then + Query.UpdateRecordTypes := UserSession.CachedRecordTypes; + if Query.UpdatesPending then + lbUpdates.Text := 'Updates Pending' + else + lbUpdates.Text := ''; + if Query.Connection.InTransaction then + lbTransaction.Text := 'In Transaction' + else + lbTransaction.Text := ''; + + lbResult.Font.Color := ResultColors[UserSession.IsGoodCached]; + lbResult.Caption := UserSession.CachedResult; + + IWDBGrid1.Visible := Query.Active; + +end; + +procedure TfmCachedUpdates.cbModifiedClick(Sender: TObject); +begin + ReadFromControls; +end; + +procedure TfmCachedUpdates.btOpenClick(Sender: TObject); +var + i, ATop: integer; +begin + ReadFromControls; + UserSession.isGoodCached := False; + DeleteCreatedControls; + try + IWDBGrid1.Columns.Clear; + Query.SQL.Text := UserSession.CachedSQL; + Query.CachedUpdates := UserSession.UseCachedUpdates; + Query.Execute; + UserSession.isGoodCached := True; + UserSession.CachedResult := 'Query is openned'; + ATop := 8; + if Query.FieldCount > 0 then begin + for i := 0 to Query.FieldCount - 1 do begin + with TIWLabel.Create(Self) do begin + Parent := rgEdits; + Caption := Query.Fields[i].FieldName; + Left := 24; + Top := ATop; + end; + with TIWDBEdit.Create(Self) do begin + Parent := rgEdits; + DataSource := Self.DataSource; + DataField := Query.Fields[i].FieldName; + Left := 240; + Top := ATop; + Width := 240; + end; + ATop := ATop + 24; + end; + rgEdits.Height := ATop + 4; + rcEdits.Height := rgEdits.Height - 2; + rgEdits.Visible := True; + end; + except + on E:Exception do + UserSession.CachedResult := 'Error: '+ E.Message; + end; +end; + +procedure TfmCachedUpdates.btCloseClick(Sender: TObject); +begin + ReadFromControls; + UserSession.isGoodCached := False; + DeleteCreatedControls; + try + IWDBGrid1.Columns.Clear; + Query.Close; + UserSession.isGoodCached := True; + UserSession.CachedResult := '' + except + on E:Exception do + UserSession.CachedResult := 'Error: '+ E.Message; + end; +end; + +procedure TfmCachedUpdates.btApplyClick(Sender: TObject); +begin + ReadFromControls; + Query.ApplyUpdates; +end; + +procedure TfmCachedUpdates.btCommitClick(Sender: TObject); +begin + ReadFromControls; + Query.CommitUpdates; +end; + +procedure TfmCachedUpdates.btCancelClick(Sender: TObject); +begin + ReadFromControls; + Query.CancelUpdates; +end; + +procedure TfmCachedUpdates.btRevertClick(Sender: TObject); +begin + ReadFromControls; + Query.RevertRecord; +end; + +procedure TfmCachedUpdates.btTransStartClick(Sender: TObject); +begin + ReadFromControls; + Query.Connection.StartTransaction; +end; + +procedure TfmCachedUpdates.btTransCommitClick(Sender: TObject); +begin + ReadFromControls; + Query.Connection.Commit; +end; + +procedure TfmCachedUpdates.btTransRollbackClick(Sender: TObject); +begin + ReadFromControls; + Query.Connection.Rollback; +end; + +procedure TfmCachedUpdates.DeleteCreatedControls; +var + i: integer; +begin + i := 0; + while i < rgEdits.ControlCount do + if not (rgEdits.Controls[i] is TIWRectangle) then + rgEdits.Controls[i].Free + else + Inc(i); + rgEdits.Visible := False; +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW5/uData.dfm b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW5/uData.dfm new file mode 100644 index 0000000..81f56c1 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW5/uData.dfm @@ -0,0 +1,33 @@ +object DM: TDM + OldCreateOrder = False + Left = 184 + Top = 103 + Height = 250 + Width = 225 + object Connection: TMSConnection + Database = 'master' + Authentication = auServer + AfterConnect = ConnectionAfterConnect + BeforeConnect = ConnectionBeforeConnect + AfterDisconnect = ConnectionAfterDisconnect + OnConnectionLost = ConnectionConnectionLost + Left = 40 + Top = 24 + end +end + OldCreateOrder = False + Left = 184 + Top = 103 + Height = 250 + Width = 225 + object Connection: TMSConnection + Database = 'master' + Authentication = auServer + AfterConnect = ConnectionAfterConnect + BeforeConnect = ConnectionBeforeConnect + AfterDisconnect = ConnectionAfterDisconnect + OnConnectionLost = ConnectionConnectionLost + Left = 40 + Top = 24 + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW5/uData.pas b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW5/uData.pas new file mode 100644 index 0000000..c9414f6 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW5/uData.pas @@ -0,0 +1,153 @@ +unit uData; + +interface + +uses + SysUtils, Classes, DB, DBAccess, MSAccess, ActiveX, MemData; + +type + TDM = class(TDataModule) + Connection: TMSConnection; + procedure ConnectionBeforeConnect(Sender: TObject); + procedure ConnectionAfterConnect(Sender: TObject); + procedure ConnectionAfterDisconnect(Sender: TObject); + procedure ConnectionConnectionLost(Sender: TObject; + Component: TComponent; ConnLostCause: TConnLostCause; + var RetryMode: TRetryMode); + end; + +implementation + +{$R *.dfm} + +uses IWInit, ServerController; + +{ TDM } + +procedure TDM.ConnectionBeforeConnect(Sender: TObject); +begin + Connection.Username := UserSession.Username; + Connection.Password := UserSession.Password; + Connection.Server := UserSession.Server; + Connection.Database := UserSession.Database; + Connection.Options.DisconnectedMode := UserSession.DisconnectedMode; + Connection.Pooling := UserSession.Pooling; + Connection.PoolingOptions := UserSession.PoolingOptions; + if UserSession.FailOver then + Connection.OnConnectionLost := ConnectionConnectionLost + else + Connection.OnConnectionLost := nil; +end; + +procedure TDM.ConnectionAfterConnect(Sender: TObject); +begin + UserSession.IsGoodConnection := True; + UserSession.ConnectionResult := 'Connected'; +end; + +procedure TDM.ConnectionAfterDisconnect(Sender: TObject); +begin + if not (csDestroying in Connection.ComponentState) then + UserSession.ConnectionResult := ''; +end; + +procedure TDM.ConnectionConnectionLost(Sender: TObject; + Component: TComponent; ConnLostCause: TConnLostCause; + var RetryMode: TRetryMode); +var + Msg: string; +begin + UserSession.IsGoodConnection := False; + case ConnLostCause of + clUnknown: + Msg := 'Unknown'; + clConnect: + Msg := 'Connect'; + clExecute: + Msg := 'Execute'; + clOpen: + Msg := 'Open'; + clApply: + Msg := 'Apply'; + end; + UserSession.ConnectionResult := 'Connection lost: ' + + Component.Name + ' - ' + Msg; +end; + +end. + +interface + +uses + SysUtils, Classes, DB, DBAccess, MSAccess, ActiveX; + +type + TDM = class(TDataModule) + Connection: TMSConnection; + procedure ConnectionBeforeConnect(Sender: TObject); + procedure ConnectionAfterConnect(Sender: TObject); + procedure ConnectionAfterDisconnect(Sender: TObject); + procedure ConnectionConnectionLost(Sender: TObject; + Component: TComponent; ConnLostCause: TConnLostCause; + var RetryMode: TRetryMode); + end; + +implementation + +{$R *.dfm} + +uses IWInit, ServerController; + +{ TDM } + +procedure TDM.ConnectionBeforeConnect(Sender: TObject); +begin + Connection.Username := UserSession.Username; + Connection.Password := UserSession.Password; + Connection.Server := UserSession.Server; + Connection.Database := UserSession.Database; + Connection.Options.DisconnectedMode := UserSession.DisconnectedMode; + Connection.Pooling := UserSession.Pooling; + Connection.PoolingOptions := UserSession.PoolingOptions; + if UserSession.FailOver then + Connection.OnConnectionLost := ConnectionConnectionLost + else + Connection.OnConnectionLost := nil; +end; + +procedure TDM.ConnectionAfterConnect(Sender: TObject); +begin + UserSession.IsGoodConnection := True; + UserSession.ConnectionResult := 'Connected'; +end; + +procedure TDM.ConnectionAfterDisconnect(Sender: TObject); +begin + if not (csDestroying in Connection.ComponentState) then + UserSession.ConnectionResult := ''; +end; + +procedure TDM.ConnectionConnectionLost(Sender: TObject; + Component: TComponent; ConnLostCause: TConnLostCause; + var RetryMode: TRetryMode); +var + Msg: string; +begin + UserSession.IsGoodConnection := False; + case ConnLostCause of + clUnknown: + Msg := 'Unknown'; + clConnect: + Msg := 'Connect'; + clExecute: + Msg := 'Execute'; + clOpen: + Msg := 'Open'; + clApply: + Msg := 'Apply'; + end; + UserSession.ConnectionResult := 'Connection lost: ' + + Component.Name + ' - ' + Msg; +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW5/uMain.dfm b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW5/uMain.dfm new file mode 100644 index 0000000..5a4caa0 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW5/uMain.dfm @@ -0,0 +1,839 @@ +inherited fmMain: TfmMain + Width = 630 + Height = 491 + OnCreate = IWAppFormCreate + DesignLeft = 232 + DesignTop = 119 + inherited IWRectangle: TIWRectangle + Width = 609 + end + inherited lbPageName: TIWLabel + Left = 581 + Width = 33 + Caption = 'Main' + end + inherited rgConnection: TIWRegion + Width = 604 + inherited IWRectangle4: TIWRectangle + Width = 602 + end + end + object IWRegion4: TIWRegion + Left = 16 + Top = 127 + Width = 306 + Height = 173 + Anchors = [akLeft, akTop, akRight] + TabOrder = 1 + Color = clBlack + DesignSize = ( + 306 + 173) + object IWRectangle3: TIWRectangle + Left = 1 + Top = 1 + Width = 304 + Height = 171 + Anchors = [akLeft, akTop, akRight, akBottom] + ShowHint = True + ParentShowHint = False + ZIndex = -1 + Font.Color = clNone + Font.Enabled = True + Font.Size = 10 + Font.Style = [] + Color = 14811135 + Alignment = taLeftJustify + VAlign = vaMiddle + end + object edUsername: TIWEdit + Left = 112 + Top = 23 + Width = 163 + Height = 21 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + BGColor = clNone + DoSubmitValidation = True + Editable = True + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + FriendlyName = 'edUsername' + MaxLength = 0 + ReadOnly = False + Required = False + ScriptEvents = <> + TabOrder = 2 + PasswordPrompt = False + end + object IWLabel1: TIWLabel + Left = 20 + Top = 25 + Width = 81 + Height = 16 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + Caption = 'Username' + RawText = False + end + object IWLabel2: TIWLabel + Left = 20 + Top = 60 + Width = 77 + Height = 16 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + Caption = 'Password' + RawText = False + end + object edPassword: TIWEdit + Left = 112 + Top = 58 + Width = 163 + Height = 21 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + BGColor = clNone + DoSubmitValidation = True + Editable = True + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + FriendlyName = 'edPassword' + MaxLength = 0 + ReadOnly = False + Required = False + ScriptEvents = <> + TabOrder = 3 + PasswordPrompt = True + end + object IWLabel3: TIWLabel + Left = 20 + Top = 95 + Width = 52 + Height = 16 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + Caption = 'Server' + RawText = False + end + object edServer: TIWEdit + Left = 112 + Top = 93 + Width = 163 + Height = 21 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + BGColor = clNone + DoSubmitValidation = True + Editable = True + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + FriendlyName = 'edServer' + MaxLength = 0 + ReadOnly = False + Required = False + ScriptEvents = <> + TabOrder = 4 + PasswordPrompt = False + end + object IWLabel5: TIWLabel + Left = 21 + Top = 130 + Width = 75 + Height = 16 + ZIndex = 0 + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + Caption = 'Database' + end + object edDatabase: TIWEdit + Left = 112 + Top = 128 + Width = 163 + Height = 21 + ZIndex = 0 + BGColor = clNone + DoSubmitValidation = True + Editable = True + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + FriendlyName = 'edDatabase' + MaxLength = 0 + ReadOnly = False + Required = False + ScriptEvents = <> + TabOrder = 5 + PasswordPrompt = False + end + end + object IWRegion1: TIWRegion + Left = 329 + Top = 127 + Width = 291 + Height = 174 + Anchors = [akTop, akRight] + TabOrder = 2 + Color = clBlack + DesignSize = ( + 291 + 174) + object IWRectangle1: TIWRectangle + Left = 1 + Top = 1 + Width = 289 + Height = 172 + Anchors = [akLeft, akTop, akRight, akBottom] + ShowHint = True + ParentShowHint = False + ZIndex = -1 + Font.Color = clNone + Font.Enabled = True + Font.Size = 10 + Font.Style = [] + Color = 14811135 + Alignment = taLeftJustify + VAlign = vaMiddle + end + object cbDisconnectedMode: TIWCheckBox + Left = 8 + Top = 8 + Width = 164 + Height = 21 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Caption = 'DisconnectedMode' + Editable = True + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + ScriptEvents = <> + DoSubmitValidation = True + Style = stNormal + TabOrder = 6 + Checked = False + end + object cbFailover: TIWCheckBox + Left = 8 + Top = 35 + Width = 121 + Height = 21 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Caption = 'Failover' + Editable = True + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + ScriptEvents = <> + DoSubmitValidation = True + Style = stNormal + TabOrder = 7 + Checked = False + end + object cbPooling: TIWCheckBox + Left = 8 + Top = 62 + Width = 121 + Height = 21 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Caption = 'Pooling' + Editable = True + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + ScriptEvents = <> + DoSubmitValidation = True + Style = stNormal + TabOrder = 8 + Checked = False + end + object edConnectionLifeTime: TIWEdit + Left = 157 + Top = 88 + Width = 101 + Height = 21 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + BGColor = clNone + DoSubmitValidation = True + Editable = True + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + FriendlyName = 'edConnectionLifeTime' + MaxLength = 0 + ReadOnly = False + Required = False + ScriptEvents = <> + TabOrder = 9 + PasswordPrompt = False + Text = 'edConnectionLifeTime' + end + object IWLabel4: TIWLabel + Left = 26 + Top = 90 + Width = 140 + Height = 16 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + Caption = 'ConnectionLifeTime' + RawText = False + end + object edMaxPoolSize: TIWEdit + Left = 157 + Top = 115 + Width = 101 + Height = 21 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + BGColor = clNone + DoSubmitValidation = True + Editable = True + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + FriendlyName = 'edMaxPoolSize' + MaxLength = 0 + ReadOnly = False + Required = False + ScriptEvents = <> + TabOrder = 10 + PasswordPrompt = False + Text = 'edMaxPoolSize' + end + object edMinPoolSize: TIWEdit + Left = 157 + Top = 142 + Width = 101 + Height = 21 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + BGColor = clNone + DoSubmitValidation = True + Editable = True + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + FriendlyName = 'edMinPoolSize' + MaxLength = 0 + ReadOnly = False + Required = False + ScriptEvents = <> + TabOrder = 11 + PasswordPrompt = False + Text = 'edMinPoolSize' + end + object IWLabel6: TIWLabel + Left = 26 + Top = 117 + Width = 88 + Height = 16 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + Caption = 'MaxPoolSize' + RawText = False + end + object IWLabel7: TIWLabel + Left = 26 + Top = 144 + Width = 83 + Height = 16 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + Caption = 'MinPoolSize' + RawText = False + end + end +end + Width = 630 + Height = 491 + OnCreate = IWAppFormCreate + DesignLeft = 232 + DesignTop = 119 + inherited IWRectangle: TIWRectangle + Width = 609 + end + inherited lbPageName: TIWLabel + Left = 581 + Width = 33 + Caption = 'Main' + end + inherited rgConnection: TIWRegion + Width = 604 + inherited IWRectangle4: TIWRectangle + Width = 602 + end + end + object IWRegion4: TIWRegion + Left = 16 + Top = 127 + Width = 306 + Height = 173 + Anchors = [akLeft, akTop, akRight] + TabOrder = 1 + Color = clBlack + DesignSize = ( + 306 + 173) + object IWRectangle3: TIWRectangle + Left = 1 + Top = 1 + Width = 304 + Height = 171 + Anchors = [akLeft, akTop, akRight, akBottom] + ShowHint = True + ParentShowHint = False + ZIndex = -1 + Font.Color = clNone + Font.Enabled = True + Font.Size = 10 + Font.Style = [] + Color = 14811135 + Alignment = taLeftJustify + VAlign = vaMiddle + end + object edUsername: TIWEdit + Left = 112 + Top = 23 + Width = 163 + Height = 21 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + BGColor = clNone + DoSubmitValidation = True + Editable = True + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + FriendlyName = 'edUsername' + MaxLength = 0 + ReadOnly = False + Required = False + ScriptEvents = <> + TabOrder = 2 + PasswordPrompt = False + end + object IWLabel1: TIWLabel + Left = 20 + Top = 25 + Width = 81 + Height = 16 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + Caption = 'Username' + RawText = False + end + object IWLabel2: TIWLabel + Left = 20 + Top = 60 + Width = 77 + Height = 16 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + Caption = 'Password' + RawText = False + end + object edPassword: TIWEdit + Left = 112 + Top = 58 + Width = 163 + Height = 21 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + BGColor = clNone + DoSubmitValidation = True + Editable = True + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + FriendlyName = 'edPassword' + MaxLength = 0 + ReadOnly = False + Required = False + ScriptEvents = <> + TabOrder = 3 + PasswordPrompt = True + end + object IWLabel3: TIWLabel + Left = 20 + Top = 95 + Width = 52 + Height = 16 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + Caption = 'Server' + RawText = False + end + object edServer: TIWEdit + Left = 112 + Top = 93 + Width = 163 + Height = 21 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + BGColor = clNone + DoSubmitValidation = True + Editable = True + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + FriendlyName = 'edServer' + MaxLength = 0 + ReadOnly = False + Required = False + ScriptEvents = <> + TabOrder = 4 + PasswordPrompt = False + end + object IWLabel5: TIWLabel + Left = 21 + Top = 130 + Width = 75 + Height = 16 + ZIndex = 0 + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + Caption = 'Database' + end + object edDatabase: TIWEdit + Left = 112 + Top = 128 + Width = 163 + Height = 21 + ZIndex = 0 + BGColor = clNone + DoSubmitValidation = True + Editable = True + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + FriendlyName = 'edDatabase' + MaxLength = 0 + ReadOnly = False + Required = False + ScriptEvents = <> + TabOrder = 5 + PasswordPrompt = False + end + end + object IWRegion1: TIWRegion + Left = 329 + Top = 127 + Width = 291 + Height = 174 + Anchors = [akTop, akRight] + TabOrder = 2 + Color = clBlack + DesignSize = ( + 291 + 174) + object IWRectangle1: TIWRectangle + Left = 1 + Top = 1 + Width = 289 + Height = 172 + Anchors = [akLeft, akTop, akRight, akBottom] + ShowHint = True + ParentShowHint = False + ZIndex = -1 + Font.Color = clNone + Font.Enabled = True + Font.Size = 10 + Font.Style = [] + Color = 14811135 + Alignment = taLeftJustify + VAlign = vaMiddle + end + object cbDisconnectedMode: TIWCheckBox + Left = 8 + Top = 8 + Width = 164 + Height = 21 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Caption = 'DisconnectedMode' + Editable = True + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + ScriptEvents = <> + DoSubmitValidation = True + Style = stNormal + TabOrder = 6 + Checked = False + end + object cbFailover: TIWCheckBox + Left = 8 + Top = 35 + Width = 121 + Height = 21 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Caption = 'Failover' + Editable = True + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + ScriptEvents = <> + DoSubmitValidation = True + Style = stNormal + TabOrder = 7 + Checked = False + end + object cbPooling: TIWCheckBox + Left = 8 + Top = 62 + Width = 121 + Height = 21 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Caption = 'Pooling' + Editable = True + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + ScriptEvents = <> + DoSubmitValidation = True + Style = stNormal + TabOrder = 8 + Checked = False + end + object edConnectionLifeTime: TIWEdit + Left = 157 + Top = 88 + Width = 101 + Height = 21 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + BGColor = clNone + DoSubmitValidation = True + Editable = True + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + FriendlyName = 'edConnectionLifeTime' + MaxLength = 0 + ReadOnly = False + Required = False + ScriptEvents = <> + TabOrder = 9 + PasswordPrompt = False + Text = 'edConnectionLifeTime' + end + object IWLabel4: TIWLabel + Left = 26 + Top = 90 + Width = 140 + Height = 16 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + Caption = 'ConnectionLifeTime' + RawText = False + end + object edMaxPoolSize: TIWEdit + Left = 157 + Top = 115 + Width = 101 + Height = 21 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + BGColor = clNone + DoSubmitValidation = True + Editable = True + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + FriendlyName = 'edMaxPoolSize' + MaxLength = 0 + ReadOnly = False + Required = False + ScriptEvents = <> + TabOrder = 10 + PasswordPrompt = False + Text = 'edMaxPoolSize' + end + object edMinPoolSize: TIWEdit + Left = 157 + Top = 142 + Width = 101 + Height = 21 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + BGColor = clNone + DoSubmitValidation = True + Editable = True + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + FriendlyName = 'edMinPoolSize' + MaxLength = 0 + ReadOnly = False + Required = False + ScriptEvents = <> + TabOrder = 11 + PasswordPrompt = False + Text = 'edMinPoolSize' + end + object IWLabel6: TIWLabel + Left = 26 + Top = 117 + Width = 88 + Height = 16 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + Caption = 'MaxPoolSize' + RawText = False + end + object IWLabel7: TIWLabel + Left = 26 + Top = 144 + Width = 83 + Height = 16 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + Caption = 'MinPoolSize' + RawText = False + end + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW5/uMain.pas b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW5/uMain.pas new file mode 100644 index 0000000..4de027e --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW5/uMain.pas @@ -0,0 +1,177 @@ +unit uMain; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + uData, uBase, uQuery, uCachedUpdates, uMasterDetail, + IWCompLabel, IWControl, IWCompRectangle, + DB, MemDS, DBAccess, MSAccess, MSConnectionPool, IWHTMLControls, IWCompButton, + IWGrids, IWDBGrids, IWDBStdCtrls, IWCompMemo, IWCompEdit, IWContainer, + IWRegion, IWCompCheckbox, IWCompListbox; + +type + TfmMain = class(TfmBase) + edUsername: TIWEdit; + edPassword: TIWEdit; + edServer: TIWEdit; + IWLabel1: TIWLabel; + IWLabel2: TIWLabel; + IWLabel3: TIWLabel; + IWRegion4: TIWRegion; + IWRectangle3: TIWRectangle; + cbFailover: TIWCheckBox; + cbDisconnectedMode: TIWCheckBox; + cbPooling: TIWCheckBox; + IWRegion1: TIWRegion; + IWRectangle1: TIWRectangle; + edConnectionLifeTime: TIWEdit; + IWLabel4: TIWLabel; + edMaxPoolSize: TIWEdit; + edMinPoolSize: TIWEdit; + IWLabel6: TIWLabel; + IWLabel7: TIWLabel; + IWLabel5: TIWLabel; + edDatabase: TIWEdit; + procedure IWAppFormCreate(Sender: TObject); + procedure IWAppFormRender(Sender: TObject); + protected + procedure ReadFromControls; override; + end; + +implementation +{$R *.dfm} + +uses + ServerController, IWForm; + +{ TfmMain } + +procedure TfmMain.IWAppFormCreate(Sender: TObject); +begin + inherited; + UserSession.fmMain := Self; +end; + +procedure TfmMain.IWAppFormRender(Sender: TObject); +begin + inherited; + edUsername.Text := UserSession.Username; + edPassword.Text := UserSession.Password; + edServer.Text := UserSession.Server; + edDatabase.Text := UserSession.Database; + cbPooling.Checked := UserSession.Pooling; + cbDisconnectedMode.Checked := UserSession.DisconnectedMode; + cbFailover.Checked := UserSession.FailOver; + + edConnectionLifeTime.Text := IntToStr(UserSession.PoolingOptions.ConnectionLifetime); + edMaxPoolSize.Text := IntToStr(UserSession.PoolingOptions.MaxPoolSize); + edMinpoolSize.Text := IntToStr(UserSession.PoolingOptions.MinPoolSize); +end; + +procedure TfmMain.ReadFromControls; +begin + inherited; + UserSession.Username := edUsername.Text; + UserSession.Password := edPassword.Text; + UserSession.Server := edServer.Text; + UserSession.Database := edDatabase.Text; + UserSession.Pooling := cbPooling.Checked; + UserSession.DisconnectedMode := cbDisconnectedMode.Checked; + UserSession.FailOver := cbFailover.Checked; + + try UserSession.PoolingOptions.ConnectionLifetime := StrToInt(edConnectionLifeTime.Text); except {Silent} end; + try UserSession.PoolingOptions.ConnectionLifetime := StrToInt(edConnectionLifeTime.Text); except {Silent} end; + try UserSession.PoolingOptions.MaxPoolSize := StrToInt(edMaxPoolSize.Text); except {Silent} end; + try UserSession.PoolingOptions.MinPoolSize := StrToInt(edMinPoolSize.Text); except {Silent} end; +end; + +end. + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + uData, uBase, uQuery, uCachedUpdates, uMasterDetail, + IWCompLabel, IWControl, IWCompRectangle, + DB, MemDS, DBAccess, MSAccess, MSConnectionPool, IWHTMLControls, IWCompButton, + IWGrids, IWDBGrids, IWDBStdCtrls, IWCompMemo, IWCompEdit, IWContainer, + IWRegion, IWCompCheckbox, IWCompListbox; + +type + TfmMain = class(TfmBase) + edUsername: TIWEdit; + edPassword: TIWEdit; + edServer: TIWEdit; + IWLabel1: TIWLabel; + IWLabel2: TIWLabel; + IWLabel3: TIWLabel; + IWRegion4: TIWRegion; + IWRectangle3: TIWRectangle; + cbFailover: TIWCheckBox; + cbDisconnectedMode: TIWCheckBox; + cbPooling: TIWCheckBox; + IWRegion1: TIWRegion; + IWRectangle1: TIWRectangle; + edConnectionLifeTime: TIWEdit; + IWLabel4: TIWLabel; + edMaxPoolSize: TIWEdit; + edMinPoolSize: TIWEdit; + IWLabel6: TIWLabel; + IWLabel7: TIWLabel; + IWLabel5: TIWLabel; + edDatabase: TIWEdit; + procedure IWAppFormCreate(Sender: TObject); + procedure IWAppFormRender(Sender: TObject); + protected + procedure ReadFromControls; override; + end; + +implementation +{$R *.dfm} + +uses + ServerController, IWForm; + +{ TfmMain } + +procedure TfmMain.IWAppFormCreate(Sender: TObject); +begin + inherited; + UserSession.fmMain := Self; +end; + +procedure TfmMain.IWAppFormRender(Sender: TObject); +begin + inherited; + edUsername.Text := UserSession.Username; + edPassword.Text := UserSession.Password; + edServer.Text := UserSession.Server; + edDatabase.Text := UserSession.Database; + cbPooling.Checked := UserSession.Pooling; + cbDisconnectedMode.Checked := UserSession.DisconnectedMode; + cbFailover.Checked := UserSession.FailOver; + + edConnectionLifeTime.Text := IntToStr(UserSession.PoolingOptions.ConnectionLifetime); + edMaxPoolSize.Text := IntToStr(UserSession.PoolingOptions.MaxPoolSize); + edMinpoolSize.Text := IntToStr(UserSession.PoolingOptions.MinPoolSize); +end; + +procedure TfmMain.ReadFromControls; +begin + inherited; + UserSession.Username := edUsername.Text; + UserSession.Password := edPassword.Text; + UserSession.Server := edServer.Text; + UserSession.Database := edDatabase.Text; + UserSession.Pooling := cbPooling.Checked; + UserSession.DisconnectedMode := cbDisconnectedMode.Checked; + UserSession.FailOver := cbFailover.Checked; + + try UserSession.PoolingOptions.ConnectionLifetime := StrToInt(edConnectionLifeTime.Text); except {Silent} end; + try UserSession.PoolingOptions.ConnectionLifetime := StrToInt(edConnectionLifeTime.Text); except {Silent} end; + try UserSession.PoolingOptions.MaxPoolSize := StrToInt(edMaxPoolSize.Text); except {Silent} end; + try UserSession.PoolingOptions.MinPoolSize := StrToInt(edMinPoolSize.Text); except {Silent} end; +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW5/uMasterDetail.dfm b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW5/uMasterDetail.dfm new file mode 100644 index 0000000..be0266a --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW5/uMasterDetail.dfm @@ -0,0 +1,1013 @@ +inherited fmMasterDetail: TfmMasterDetail + Width = 605 + Height = 567 + OnCreate = IWAppFormCreate + DesignLeft = 261 + DesignTop = 79 + inherited IWRectangle: TIWRectangle + Width = 582 + end + inherited lbPageName: TIWLabel + Left = 495 + Width = 97 + Caption = 'Master/Detail' + end + inherited rgConnection: TIWRegion + Width = 577 + inherited IWRectangle4: TIWRectangle + Width = 575 + end + end + object IWRegion1: TIWRegion + Left = 16 + Top = 127 + Width = 577 + Height = 65 + Anchors = [akLeft, akTop, akRight] + TabOrder = 1 + Color = clBlack + DesignSize = ( + 577 + 65) + object IWRectangle1: TIWRectangle + Left = 1 + Top = 1 + Width = 575 + Height = 63 + Anchors = [akLeft, akTop, akRight, akBottom] + ShowHint = True + ParentShowHint = False + ZIndex = -1 + Font.Color = clNone + Font.Enabled = True + Font.Size = 10 + Font.Style = [] + Color = 14811135 + Alignment = taLeftJustify + VAlign = vaMiddle + end + object btOpen: TIWButton + Left = 8 + Top = 32 + Width = 97 + Height = 25 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + ButtonType = btButton + Caption = 'Open' + Color = clBtnFace + DoSubmitValidation = True + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + ScriptEvents = <> + TabOrder = 4 + OnClick = btOpenClick + end + object cbLocalMasterDetail: TIWCheckBox + Left = 7 + Top = 10 + Width = 153 + Height = 21 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Caption = 'LocalMasterDetail' + Editable = True + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + ScriptEvents = <> + DoSubmitValidation = True + Style = stNormal + TabOrder = 2 + Checked = False + end + object btClose: TIWButton + Left = 114 + Top = 32 + Width = 95 + Height = 25 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + ButtonType = btButton + Caption = 'Close' + Color = clBtnFace + DoSubmitValidation = True + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + ScriptEvents = <> + TabOrder = 5 + OnClick = btCloseClick + end + object cbCachedCalcFields: TIWCheckBox + Left = 167 + Top = 10 + Width = 151 + Height = 21 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Caption = 'CachedCalcFields' + Editable = True + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + ScriptEvents = <> + DoSubmitValidation = True + Style = stNormal + TabOrder = 3 + Checked = False + end + object lbResult: TIWLabel + Left = 333 + Top = 12 + Width = 63 + Height = 16 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + Caption = 'lbResult' + RawText = False + end + end + object IWRegion3: TIWRegion + Left = 16 + Top = 382 + Width = 577 + Height = 174 + Anchors = [akLeft, akTop, akRight, akBottom] + TabOrder = 3 + Color = clBlack + DesignSize = ( + 577 + 174) + object IWRectangle3: TIWRectangle + Left = 1 + Top = 1 + Width = 575 + Height = 172 + Anchors = [akLeft, akTop, akRight, akBottom] + ShowHint = True + ParentShowHint = False + ZIndex = -1 + Font.Color = clNone + Font.Enabled = True + Font.Size = 10 + Font.Style = [] + Color = 14811135 + Alignment = taLeftJustify + VAlign = vaMiddle + end + object IWLabel4: TIWLabel + Left = 8 + Top = 7 + Width = 55 + Height = 18 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 12 + Font.Style = [fsBold] + Caption = 'Detail' + RawText = False + end + object IWLabel3: TIWLabel + Left = 8 + Top = 33 + Width = 93 + Height = 16 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + Caption = 'DetailFields' + RawText = False + end + object edDetailFields: TIWEdit + Left = 8 + Top = 52 + Width = 121 + Height = 21 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + BGColor = clNone + DoSubmitValidation = True + Editable = True + Font.Color = clNone + Font.Enabled = True + Font.Size = 10 + Font.Style = [] + FriendlyName = 'edDetailFields' + MaxLength = 0 + ReadOnly = False + Required = False + ScriptEvents = <> + TabOrder = 8 + PasswordPrompt = False + Text = 'edDetailFields' + end + object IWDBGrid2: TIWDBGrid + Left = 144 + Top = 81 + Width = 422 + Height = 85 + Anchors = [akLeft, akTop, akRight, akBottom] + ShowHint = True + ParentShowHint = False + ZIndex = 0 + BorderColors.Color = clNone + BorderColors.Light = clNone + BorderColors.Dark = clNone + BGColor = clSkyBlue + BorderSize = 1 + BorderStyle = tfDefault + CellPadding = 0 + CellSpacing = 0 + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + FrameBuffer = 40 + Lines = tlAll + UseFrame = True + UseWidth = True + Columns = <> + DataSource = dsDetail + FooterRowCount = 0 + FromStart = True + HighlightColor = clNone + HighlightRows = True + Options = [dgIndicator, dgShowTitles] + RefreshMode = rmAutomatic + RowLimit = 0 + RollOver = False + RowClick = False + RollOverColor = clNone + RowHeaderColor = 12876667 + RowAlternateColor = clNone + RowCurrentColor = clMoneyGreen + end + object IWRegion5: TIWRegion + Left = 144 + Top = 8 + Width = 422 + Height = 65 + Anchors = [akLeft, akTop, akRight] + TabOrder = 0 + Color = clNone + object meDetail: TIWMemo + Left = 0 + Top = 0 + Width = 422 + Height = 65 + Align = alClient + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Editable = True + Font.Color = clNone + Font.Enabled = True + Font.Size = 10 + Font.Style = [] + ScriptEvents = <> + RawText = False + ReadOnly = False + Required = False + TabOrder = 9 + WantReturns = False + FriendlyName = 'meDetail' + end + end + end + object IWRegion2: TIWRegion + Left = 16 + Top = 199 + Width = 577 + Height = 178 + Anchors = [akLeft, akTop, akRight] + TabOrder = 2 + Color = clBlack + DesignSize = ( + 577 + 178) + object IWRectangle2: TIWRectangle + Left = 1 + Top = 1 + Width = 575 + Height = 176 + Anchors = [akLeft, akTop, akRight, akBottom] + ShowHint = True + ParentShowHint = False + ZIndex = -1 + Font.Color = clNone + Font.Enabled = True + Font.Size = 10 + Font.Style = [] + Color = 14811135 + Alignment = taLeftJustify + VAlign = vaMiddle + end + object IWDBNavigator1: TIWDBNavigator + Left = 8 + Top = 104 + Width = 115 + Height = 30 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Confirmations.Delete = 'Are you sure you want to delete this record?' + Confirmations.Post = 'Are you sure you want to update this record?' + Confirmations.Cancel = 'Are you sure you want to cancel your changes to this record?' + DataSource = dsMaster + ImageHeight = 21 + ImageWidth = 21 + VisibleButtons = [nbFirst, nbPrior, nbNext, nbLast, nbRefresh] + Orientation = orHorizontal + OnFirst = IWDBNavigator1Refresh + OnPrior = IWDBNavigator1Refresh + OnNext = IWDBNavigator1Refresh + OnLast = IWDBNavigator1Refresh + OnRefresh = IWDBNavigator1Refresh + end + object IWLabel1: TIWLabel + Left = 8 + Top = 6 + Width = 67 + Height = 18 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 12 + Font.Style = [fsBold] + Caption = 'Master' + RawText = False + end + object IWLabel2: TIWLabel + Left = 8 + Top = 33 + Width = 102 + Height = 16 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + Caption = 'MasterFields' + RawText = False + end + object edMasterFields: TIWEdit + Left = 8 + Top = 52 + Width = 121 + Height = 21 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + BGColor = clNone + DoSubmitValidation = True + Editable = True + Font.Color = clNone + Font.Enabled = True + Font.Size = 10 + Font.Style = [] + FriendlyName = 'edMasterFields' + MaxLength = 0 + ReadOnly = False + Required = False + ScriptEvents = <> + TabOrder = 6 + PasswordPrompt = False + Text = 'edMasterFields' + end + object IWDBGrid1: TIWDBGrid + Left = 144 + Top = 80 + Width = 422 + Height = 89 + Anchors = [akLeft, akTop, akRight] + ShowHint = True + ParentShowHint = False + ZIndex = 0 + BorderColors.Color = clNone + BorderColors.Light = clNone + BorderColors.Dark = clNone + BGColor = clSkyBlue + BorderSize = 1 + BorderStyle = tfDefault + CellPadding = 0 + CellSpacing = 0 + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + FrameBuffer = 40 + Lines = tlAll + UseFrame = True + UseWidth = True + Columns = <> + DataSource = dsMaster + FooterRowCount = 0 + FromStart = True + HighlightColor = clNone + HighlightRows = True + Options = [dgIndicator, dgShowTitles] + RefreshMode = rmAutomatic + RowLimit = 0 + RollOver = False + RowClick = False + RollOverColor = clNone + RowHeaderColor = 12876667 + RowAlternateColor = clNone + RowCurrentColor = clMoneyGreen + end + object IWRegion4: TIWRegion + Left = 144 + Top = 8 + Width = 422 + Height = 65 + Anchors = [akLeft, akTop, akRight] + TabOrder = 0 + Color = clNone + object meMaster: TIWMemo + Left = 0 + Top = 0 + Width = 422 + Height = 65 + Align = alClient + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Editable = True + Font.Color = clNone + Font.Enabled = True + Font.Size = 10 + Font.Style = [] + ScriptEvents = <> + RawText = False + ReadOnly = False + Required = False + TabOrder = 7 + WantReturns = False + FriendlyName = 'meMaster' + end + end + end + object quMaster: TMSQuery + Left = 192 + Top = 239 + end + object quDetail: TMSQuery + MasterSource = dsMaster + Left = 128 + Top = 407 + end + object dsMaster: TDataSource + DataSet = quMaster + Left = 224 + Top = 239 + end + object dsDetail: TDataSource + DataSet = quDetail + Left = 160 + Top = 407 + end +end + Width = 605 + Height = 567 + OnCreate = IWAppFormCreate + DesignLeft = 261 + DesignTop = 79 + inherited IWRectangle: TIWRectangle + Width = 582 + end + inherited lbPageName: TIWLabel + Left = 495 + Width = 97 + Caption = 'Master/Detail' + end + inherited rgConnection: TIWRegion + Width = 577 + inherited IWRectangle4: TIWRectangle + Width = 575 + end + end + object IWRegion1: TIWRegion + Left = 16 + Top = 127 + Width = 577 + Height = 65 + Anchors = [akLeft, akTop, akRight] + TabOrder = 1 + Color = clBlack + DesignSize = ( + 577 + 65) + object IWRectangle1: TIWRectangle + Left = 1 + Top = 1 + Width = 575 + Height = 63 + Anchors = [akLeft, akTop, akRight, akBottom] + ShowHint = True + ParentShowHint = False + ZIndex = -1 + Font.Color = clNone + Font.Enabled = True + Font.Size = 10 + Font.Style = [] + Color = 14811135 + Alignment = taLeftJustify + VAlign = vaMiddle + end + object btOpen: TIWButton + Left = 8 + Top = 32 + Width = 97 + Height = 25 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + ButtonType = btButton + Caption = 'Open' + Color = clBtnFace + DoSubmitValidation = True + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + ScriptEvents = <> + TabOrder = 4 + OnClick = btOpenClick + end + object cbLocalMasterDetail: TIWCheckBox + Left = 7 + Top = 10 + Width = 153 + Height = 21 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Caption = 'LocalMasterDetail' + Editable = True + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + ScriptEvents = <> + DoSubmitValidation = True + Style = stNormal + TabOrder = 2 + Checked = False + end + object btClose: TIWButton + Left = 114 + Top = 32 + Width = 95 + Height = 25 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + ButtonType = btButton + Caption = 'Close' + Color = clBtnFace + DoSubmitValidation = True + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + ScriptEvents = <> + TabOrder = 5 + OnClick = btCloseClick + end + object cbCachedCalcFields: TIWCheckBox + Left = 167 + Top = 10 + Width = 151 + Height = 21 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Caption = 'CachedCalcFields' + Editable = True + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + ScriptEvents = <> + DoSubmitValidation = True + Style = stNormal + TabOrder = 3 + Checked = False + end + object lbResult: TIWLabel + Left = 333 + Top = 12 + Width = 63 + Height = 16 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + Caption = 'lbResult' + RawText = False + end + end + object IWRegion3: TIWRegion + Left = 16 + Top = 382 + Width = 577 + Height = 174 + Anchors = [akLeft, akTop, akRight, akBottom] + TabOrder = 3 + Color = clBlack + DesignSize = ( + 577 + 174) + object IWRectangle3: TIWRectangle + Left = 1 + Top = 1 + Width = 575 + Height = 172 + Anchors = [akLeft, akTop, akRight, akBottom] + ShowHint = True + ParentShowHint = False + ZIndex = -1 + Font.Color = clNone + Font.Enabled = True + Font.Size = 10 + Font.Style = [] + Color = 14811135 + Alignment = taLeftJustify + VAlign = vaMiddle + end + object IWLabel4: TIWLabel + Left = 8 + Top = 7 + Width = 55 + Height = 18 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 12 + Font.Style = [fsBold] + Caption = 'Detail' + RawText = False + end + object IWLabel3: TIWLabel + Left = 8 + Top = 33 + Width = 93 + Height = 16 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + Caption = 'DetailFields' + RawText = False + end + object edDetailFields: TIWEdit + Left = 8 + Top = 52 + Width = 121 + Height = 21 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + BGColor = clNone + DoSubmitValidation = True + Editable = True + Font.Color = clNone + Font.Enabled = True + Font.Size = 10 + Font.Style = [] + FriendlyName = 'edDetailFields' + MaxLength = 0 + ReadOnly = False + Required = False + ScriptEvents = <> + TabOrder = 8 + PasswordPrompt = False + Text = 'edDetailFields' + end + object IWDBGrid2: TIWDBGrid + Left = 144 + Top = 81 + Width = 422 + Height = 85 + Anchors = [akLeft, akTop, akRight, akBottom] + ShowHint = True + ParentShowHint = False + ZIndex = 0 + BorderColors.Color = clNone + BorderColors.Light = clNone + BorderColors.Dark = clNone + BGColor = clSkyBlue + BorderSize = 1 + BorderStyle = tfDefault + CellPadding = 0 + CellSpacing = 0 + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + FrameBuffer = 40 + Lines = tlAll + UseFrame = True + UseWidth = True + Columns = <> + DataSource = dsDetail + FooterRowCount = 0 + FromStart = True + HighlightColor = clNone + HighlightRows = True + Options = [dgIndicator, dgShowTitles] + RefreshMode = rmAutomatic + RowLimit = 0 + RollOver = False + RowClick = False + RollOverColor = clNone + RowHeaderColor = 12876667 + RowAlternateColor = clNone + RowCurrentColor = clMoneyGreen + end + object IWRegion5: TIWRegion + Left = 144 + Top = 8 + Width = 422 + Height = 65 + Anchors = [akLeft, akTop, akRight] + TabOrder = 0 + Color = clNone + object meDetail: TIWMemo + Left = 0 + Top = 0 + Width = 422 + Height = 65 + Align = alClient + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Editable = True + Font.Color = clNone + Font.Enabled = True + Font.Size = 10 + Font.Style = [] + ScriptEvents = <> + RawText = False + ReadOnly = False + Required = False + TabOrder = 9 + WantReturns = False + FriendlyName = 'meDetail' + end + end + end + object IWRegion2: TIWRegion + Left = 16 + Top = 199 + Width = 577 + Height = 178 + Anchors = [akLeft, akTop, akRight] + TabOrder = 2 + Color = clBlack + DesignSize = ( + 577 + 178) + object IWRectangle2: TIWRectangle + Left = 1 + Top = 1 + Width = 575 + Height = 176 + Anchors = [akLeft, akTop, akRight, akBottom] + ShowHint = True + ParentShowHint = False + ZIndex = -1 + Font.Color = clNone + Font.Enabled = True + Font.Size = 10 + Font.Style = [] + Color = 14811135 + Alignment = taLeftJustify + VAlign = vaMiddle + end + object IWDBNavigator1: TIWDBNavigator + Left = 8 + Top = 104 + Width = 115 + Height = 30 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Confirmations.Delete = 'Are you sure you want to delete this record?' + Confirmations.Post = 'Are you sure you want to update this record?' + Confirmations.Cancel = 'Are you sure you want to cancel your changes to this record?' + DataSource = dsMaster + ImageHeight = 21 + ImageWidth = 21 + VisibleButtons = [nbFirst, nbPrior, nbNext, nbLast, nbRefresh] + Orientation = orHorizontal + OnFirst = IWDBNavigator1Refresh + OnPrior = IWDBNavigator1Refresh + OnNext = IWDBNavigator1Refresh + OnLast = IWDBNavigator1Refresh + OnRefresh = IWDBNavigator1Refresh + end + object IWLabel1: TIWLabel + Left = 8 + Top = 6 + Width = 67 + Height = 18 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 12 + Font.Style = [fsBold] + Caption = 'Master' + RawText = False + end + object IWLabel2: TIWLabel + Left = 8 + Top = 33 + Width = 102 + Height = 16 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + Caption = 'MasterFields' + RawText = False + end + object edMasterFields: TIWEdit + Left = 8 + Top = 52 + Width = 121 + Height = 21 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + BGColor = clNone + DoSubmitValidation = True + Editable = True + Font.Color = clNone + Font.Enabled = True + Font.Size = 10 + Font.Style = [] + FriendlyName = 'edMasterFields' + MaxLength = 0 + ReadOnly = False + Required = False + ScriptEvents = <> + TabOrder = 6 + PasswordPrompt = False + Text = 'edMasterFields' + end + object IWDBGrid1: TIWDBGrid + Left = 144 + Top = 80 + Width = 422 + Height = 89 + Anchors = [akLeft, akTop, akRight] + ShowHint = True + ParentShowHint = False + ZIndex = 0 + BorderColors.Color = clNone + BorderColors.Light = clNone + BorderColors.Dark = clNone + BGColor = clSkyBlue + BorderSize = 1 + BorderStyle = tfDefault + CellPadding = 0 + CellSpacing = 0 + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + FrameBuffer = 40 + Lines = tlAll + UseFrame = True + UseWidth = True + Columns = <> + DataSource = dsMaster + FooterRowCount = 0 + FromStart = True + HighlightColor = clNone + HighlightRows = True + Options = [dgIndicator, dgShowTitles] + RefreshMode = rmAutomatic + RowLimit = 0 + RollOver = False + RowClick = False + RollOverColor = clNone + RowHeaderColor = 12876667 + RowAlternateColor = clNone + RowCurrentColor = clMoneyGreen + end + object IWRegion4: TIWRegion + Left = 144 + Top = 8 + Width = 422 + Height = 65 + Anchors = [akLeft, akTop, akRight] + TabOrder = 0 + Color = clNone + object meMaster: TIWMemo + Left = 0 + Top = 0 + Width = 422 + Height = 65 + Align = alClient + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Editable = True + Font.Color = clNone + Font.Enabled = True + Font.Size = 10 + Font.Style = [] + ScriptEvents = <> + RawText = False + ReadOnly = False + Required = False + TabOrder = 7 + WantReturns = False + FriendlyName = 'meMaster' + end + end + end + object quMaster: TMSQuery + Left = 192 + Top = 239 + end + object quDetail: TMSQuery + MasterSource = dsMaster + Left = 128 + Top = 407 + end + object dsMaster: TDataSource + DataSet = quMaster + Left = 224 + Top = 239 + end + object dsDetail: TDataSource + DataSet = quDetail + Left = 160 + Top = 407 + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW5/uMasterDetail.pas b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW5/uMasterDetail.pas new file mode 100644 index 0000000..47b3323 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW5/uMasterDetail.pas @@ -0,0 +1,251 @@ +unit uMasterDetail; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, uBase, IWHTMLControls, IWCompLabel, IWControl, IWCompRectangle, + IWCompCheckbox, IWCompEdit, IWCompMemo, IWGrids, IWDBGrids, DB, MemDS, + DBAccess, MSAccess, IWDBStdCtrls, IWCompButton, IWContainer, IWRegion; + +type + TfmMasterDetail = class(TfmBase) + cbLocalMasterDetail: TIWCheckBox; + IWLabel1: TIWLabel; + IWLabel2: TIWLabel; + edMasterFields: TIWEdit; + IWDBGrid1: TIWDBGrid; + IWDBGrid2: TIWDBGrid; + IWLabel3: TIWLabel; + IWLabel4: TIWLabel; + edDetailFields: TIWEdit; + IWDBNavigator1: TIWDBNavigator; + quMaster: TMSQuery; + quDetail: TMSQuery; + dsMaster: TDataSource; + dsDetail: TDataSource; + cbCachedCalcFields: TIWCheckBox; + btOpen: TIWButton; + btClose: TIWButton; + IWRegion1: TIWRegion; + IWRegion2: TIWRegion; + IWRegion3: TIWRegion; + IWRectangle1: TIWRectangle; + IWRectangle2: TIWRectangle; + IWRectangle3: TIWRectangle; + lbResult: TIWLabel; + IWRegion4: TIWRegion; + meMaster: TIWMemo; + IWRegion5: TIWRegion; + meDetail: TIWMemo; + procedure IWAppFormCreate(Sender: TObject); + procedure btOpenClick(Sender: TObject); + procedure IWAppFormRender(Sender: TObject); + procedure btCloseClick(Sender: TObject); + procedure IWDBNavigator1Refresh(Sender: TObject); + protected + procedure ReadFromControls; override; + end; + +implementation + +{$R *.dfm} + +uses + ServerController, StdConvs; + +procedure TfmMasterDetail.IWAppFormCreate(Sender: TObject); +begin + inherited; + quMaster.Connection := DM.Connection; + quDetail.Connection := DM.Connection; +end; + +procedure TfmMasterDetail.btOpenClick(Sender: TObject); +begin + ReadFromControls; + UserSession.IsGoodMasterDetail := False; + try + quMaster.SQL.Text := UserSession.MasterSQL; + quDetail.SQL.Text := UserSession.DetailSQL; + quDetail.MasterFields := UserSession.MasterFields; + quDetail.DetailFields := UserSession.DetailFields; + quMaster.Options.LocalMasterDetail := UserSession.LocalMasterDetail; + quDetail.Options.LocalMasterDetail := UserSession.LocalMasterDetail; + quMaster.Options.CacheCalcFields := UserSession.CacheCalcFields; + quDetail.Options.CacheCalcFields := UserSession.CacheCalcFields; + quMaster.Open; + quDetail.Open; + UserSession.IsGoodMasterDetail := True; + UserSession.MasterDetailResult := 'Tables are opened'; + except + on E:Exception do + UserSession.MasterDetailResult := 'Error: '+ E.Message; + end; +end; + +procedure TfmMasterDetail.btCloseClick(Sender: TObject); +begin + ReadFromControls; + quMaster.Close; + quDetail.Close; +end; + +procedure TfmMasterDetail.IWAppFormRender(Sender: TObject); +begin + inherited; + cbLocalMasterDetail.Checked := UserSession.LocalMasterDetail; + cbCachedCalcFields.Checked := UserSession.CacheCalcFields; + edMasterFields.Text := UserSession.MasterFields; + edDetailFields.Text := UserSession.DetailFields; + meMaster.Lines.Text := UserSession.MasterSQL; + meDetail.Lines.Text := UserSession.DetailSQL; + IWDBGrid1.Visible := quMaster.Active; + IWDBNavigator1.Enabled := quMaster.Active; + IWDBGrid2.Visible := quDetail.Active; + lbResult.Font.Color := ResultColors[UserSession.IsGoodMasterDetail]; + lbResult.Caption := UserSession.MasterDetailResult; +end; + +procedure TfmMasterDetail.ReadFromControls; +begin + inherited; + UserSession.LocalMasterDetail := cbLocalMasterDetail.Checked; + UserSession.CacheCalcFields := cbCachedCalcFields.Checked; + UserSession.MasterFields := edMasterFields.Text; + UserSession.DetailFields := edDetailFields.Text; + UserSession.MasterSQL := meMaster.Lines.Text; + UserSession.DetailSQL := meDetail.Lines.Text; +end; + +procedure TfmMasterDetail.IWDBNavigator1Refresh(Sender: TObject); +begin + ReadFromControls; +end; + +end. + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, uBase, IWHTMLControls, IWCompLabel, IWControl, IWCompRectangle, + IWCompCheckbox, IWCompEdit, IWCompMemo, IWGrids, IWDBGrids, DB, MemDS, + DBAccess, MSAccess, IWDBStdCtrls, IWCompButton, IWContainer, IWRegion; + +type + TfmMasterDetail = class(TfmBase) + cbLocalMasterDetail: TIWCheckBox; + IWLabel1: TIWLabel; + IWLabel2: TIWLabel; + edMasterFields: TIWEdit; + IWDBGrid1: TIWDBGrid; + IWDBGrid2: TIWDBGrid; + IWLabel3: TIWLabel; + IWLabel4: TIWLabel; + edDetailFields: TIWEdit; + IWDBNavigator1: TIWDBNavigator; + quMaster: TMSQuery; + quDetail: TMSQuery; + dsMaster: TDataSource; + dsDetail: TDataSource; + cbCachedCalcFields: TIWCheckBox; + btOpen: TIWButton; + btClose: TIWButton; + IWRegion1: TIWRegion; + IWRegion2: TIWRegion; + IWRegion3: TIWRegion; + IWRectangle1: TIWRectangle; + IWRectangle2: TIWRectangle; + IWRectangle3: TIWRectangle; + lbResult: TIWLabel; + IWRegion4: TIWRegion; + meMaster: TIWMemo; + IWRegion5: TIWRegion; + meDetail: TIWMemo; + procedure IWAppFormCreate(Sender: TObject); + procedure btOpenClick(Sender: TObject); + procedure IWAppFormRender(Sender: TObject); + procedure btCloseClick(Sender: TObject); + procedure IWDBNavigator1Refresh(Sender: TObject); + protected + procedure ReadFromControls; override; + end; + +implementation + +{$R *.dfm} + +uses + ServerController, StdConvs; + +procedure TfmMasterDetail.IWAppFormCreate(Sender: TObject); +begin + inherited; + quMaster.Connection := DM.Connection; + quDetail.Connection := DM.Connection; +end; + +procedure TfmMasterDetail.btOpenClick(Sender: TObject); +begin + ReadFromControls; + UserSession.IsGoodMasterDetail := False; + try + quMaster.SQL.Text := UserSession.MasterSQL; + quDetail.SQL.Text := UserSession.DetailSQL; + quDetail.MasterFields := UserSession.MasterFields; + quDetail.DetailFields := UserSession.DetailFields; + quMaster.Options.LocalMasterDetail := UserSession.LocalMasterDetail; + quDetail.Options.LocalMasterDetail := UserSession.LocalMasterDetail; + quMaster.Options.CacheCalcFields := UserSession.CacheCalcFields; + quDetail.Options.CacheCalcFields := UserSession.CacheCalcFields; + quMaster.Open; + quDetail.Open; + UserSession.IsGoodMasterDetail := True; + UserSession.MasterDetailResult := 'Tables are opened'; + except + on E:Exception do + UserSession.MasterDetailResult := 'Error: '+ E.Message; + end; +end; + +procedure TfmMasterDetail.btCloseClick(Sender: TObject); +begin + ReadFromControls; + quMaster.Close; + quDetail.Close; +end; + +procedure TfmMasterDetail.IWAppFormRender(Sender: TObject); +begin + inherited; + cbLocalMasterDetail.Checked := UserSession.LocalMasterDetail; + cbCachedCalcFields.Checked := UserSession.CacheCalcFields; + edMasterFields.Text := UserSession.MasterFields; + edDetailFields.Text := UserSession.DetailFields; + meMaster.Lines.Text := UserSession.MasterSQL; + meDetail.Lines.Text := UserSession.DetailSQL; + IWDBGrid1.Visible := quMaster.Active; + IWDBNavigator1.Enabled := quMaster.Active; + IWDBGrid2.Visible := quDetail.Active; + lbResult.Font.Color := ResultColors[UserSession.IsGoodMasterDetail]; + lbResult.Caption := UserSession.MasterDetailResult; +end; + +procedure TfmMasterDetail.ReadFromControls; +begin + inherited; + UserSession.LocalMasterDetail := cbLocalMasterDetail.Checked; + UserSession.CacheCalcFields := cbCachedCalcFields.Checked; + UserSession.MasterFields := edMasterFields.Text; + UserSession.DetailFields := edDetailFields.Text; + UserSession.MasterSQL := meMaster.Lines.Text; + UserSession.DetailSQL := meDetail.Lines.Text; +end; + +procedure TfmMasterDetail.IWDBNavigator1Refresh(Sender: TObject); +begin + ReadFromControls; +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW5/uQuery.dfm b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW5/uQuery.dfm new file mode 100644 index 0000000..7f07fb6 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW5/uQuery.dfm @@ -0,0 +1,615 @@ +inherited fmQuery: TfmQuery + Width = 677 + Height = 416 + OnCreate = IWAppFormCreate + DesignSize = ( + 677 + 416) + DesignLeft = 265 + DesignTop = 95 + inherited IWRectangle: TIWRectangle + Width = 656 + end + inherited lbPageName: TIWLabel + Left = 619 + Width = 44 + Caption = 'Query' + end + inherited rgConnection: TIWRegion + Width = 653 + DesignSize = ( + 653 + 42) + inherited IWRectangle4: TIWRectangle + Width = 651 + end + end + object IWRegion1: TIWRegion + Left = 16 + Top = 184 + Width = 654 + Height = 65 + Anchors = [akLeft, akTop, akRight] + TabOrder = 2 + Color = clBlack + DesignSize = ( + 654 + 65) + object IWRectangle1: TIWRectangle + Left = 1 + Top = 1 + Width = 652 + Height = 63 + Anchors = [akLeft, akTop, akRight, akBottom] + ShowHint = True + ParentShowHint = False + ZIndex = -1 + Font.Color = clNone + Font.Enabled = True + Font.Size = 10 + Font.Style = [] + Color = 14811135 + Alignment = taLeftJustify + VAlign = vaMiddle + end + object IWLabel1: TIWLabel + Left = 7 + Top = 7 + Width = 38 + Height = 18 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 12 + Font.Style = [fsBold] + Caption = 'SQL' + RawText = False + end + object IWRegion3: TIWRegion + Left = 56 + Top = 8 + Width = 589 + Height = 49 + Anchors = [akLeft, akTop, akRight] + TabOrder = 0 + Color = clNone + object meSQL: TIWMemo + Left = 0 + Top = 0 + Width = 589 + Height = 49 + Align = alClient + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Editable = True + Font.Color = clNone + Font.Enabled = True + Font.Size = 10 + Font.Style = [] + ScriptEvents = <> + RawText = False + ReadOnly = False + Required = False + TabOrder = 4 + WantReturns = False + FriendlyName = 'meSQL' + end + end + end + object IWRegion2: TIWRegion + Left = 16 + Top = 256 + Width = 654 + Height = 141 + Anchors = [akLeft, akTop, akRight, akBottom] + TabOrder = 3 + Color = clBlack + DesignSize = ( + 654 + 141) + object IWRectangle2: TIWRectangle + Left = 1 + Top = 1 + Width = 652 + Height = 139 + Anchors = [akLeft, akTop, akRight, akBottom] + ShowHint = True + ParentShowHint = False + ZIndex = -1 + Font.Color = clNone + Font.Enabled = True + Font.Size = 10 + Font.Style = [] + Color = 14811135 + Alignment = taLeftJustify + VAlign = vaMiddle + end + object IWDBNavigator: TIWDBNavigator + Left = 6 + Top = 29 + Width = 115 + Height = 30 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Confirmations.Delete = 'Are you sure you want to delete this record?' + Confirmations.Post = 'Are you sure you want to update this record?' + Confirmations.Cancel = 'Are you sure you want to cancel your changes to this record?' + DataSource = DataSource + ImageHeight = 21 + ImageWidth = 21 + VisibleButtons = [nbFirst, nbPrior, nbNext, nbLast, nbRefresh] + Orientation = orHorizontal + OnFirst = IWDBNavigatorRefresh + OnPrior = IWDBNavigatorRefresh + OnNext = IWDBNavigatorRefresh + OnLast = IWDBNavigatorRefresh + OnRefresh = IWDBNavigatorRefresh + end + object IWLabel2: TIWLabel + Left = 7 + Top = 7 + Width = 46 + Height = 18 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 12 + Font.Style = [fsBold] + Caption = 'Data' + RawText = False + end + object IWDBGrid: TIWDBGrid + Left = 144 + Top = 28 + Width = 502 + Height = 105 + Anchors = [akLeft, akTop, akRight, akBottom] + ShowHint = True + ParentShowHint = False + ZIndex = 0 + BorderColors.Color = clNone + BorderColors.Light = clNone + BorderColors.Dark = clNone + BGColor = clSkyBlue + BorderSize = 1 + BorderStyle = tfDefault + CellPadding = 0 + CellSpacing = 0 + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + FrameBuffer = 40 + Lines = tlAll + UseFrame = True + UseWidth = True + Columns = <> + DataSource = DataSource + FooterRowCount = 0 + FromStart = True + HighlightColor = clNone + HighlightRows = False + Options = [dgShowTitles] + RefreshMode = rmAutomatic + RowLimit = 0 + RollOver = False + RowClick = False + RollOverColor = clNone + RowHeaderColor = 12876667 + RowAlternateColor = clNone + RowCurrentColor = clMoneyGreen + end + object lbResult: TIWLabel + Left = 144 + Top = 7 + Width = 63 + Height = 16 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + Caption = 'lbResult' + RawText = False + end + end + object IWRegion4: TIWRegion + Left = 16 + Top = 128 + Width = 653 + Height = 46 + Anchors = [akLeft, akTop, akRight] + TabOrder = 1 + Color = clBlack + DesignSize = ( + 653 + 46) + object IWRectangle3: TIWRectangle + Left = 1 + Top = 1 + Width = 651 + Height = 44 + Anchors = [akLeft, akTop, akRight, akBottom] + ShowHint = True + ParentShowHint = False + ZIndex = -1 + Font.Color = clNone + Font.Enabled = True + Font.Size = 10 + Font.Style = [] + Color = 14811135 + Alignment = taLeftJustify + VAlign = vaMiddle + end + object btOpen: TIWButton + Left = 11 + Top = 11 + Width = 94 + Height = 25 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + ButtonType = btButton + Caption = 'Open' + Color = clBtnFace + DoSubmitValidation = True + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + ScriptEvents = <> + TabOrder = 2 + OnClick = btOpenClick + end + object btClose: TIWButton + Left = 112 + Top = 11 + Width = 97 + Height = 25 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + ButtonType = btButton + Caption = 'Close' + Color = clBtnFace + DoSubmitValidation = True + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + ScriptEvents = <> + TabOrder = 3 + OnClick = btCloseClick + end + end + object Query: TMSQuery + Left = 272 + Top = 48 + end + object DataSource: TDataSource + DataSet = Query + Left = 304 + Top = 48 + end +end + Width = 677 + Height = 416 + OnCreate = IWAppFormCreate + DesignSize = ( + 677 + 416) + DesignLeft = 265 + DesignTop = 95 + inherited IWRectangle: TIWRectangle + Width = 656 + end + inherited lbPageName: TIWLabel + Left = 619 + Width = 44 + Caption = 'Query' + end + inherited rgConnection: TIWRegion + Width = 653 + DesignSize = ( + 653 + 42) + inherited IWRectangle4: TIWRectangle + Width = 651 + end + end + object IWRegion1: TIWRegion + Left = 16 + Top = 184 + Width = 654 + Height = 65 + Anchors = [akLeft, akTop, akRight] + TabOrder = 2 + Color = clBlack + DesignSize = ( + 654 + 65) + object IWRectangle1: TIWRectangle + Left = 1 + Top = 1 + Width = 652 + Height = 63 + Anchors = [akLeft, akTop, akRight, akBottom] + ShowHint = True + ParentShowHint = False + ZIndex = -1 + Font.Color = clNone + Font.Enabled = True + Font.Size = 10 + Font.Style = [] + Color = 14811135 + Alignment = taLeftJustify + VAlign = vaMiddle + end + object IWLabel1: TIWLabel + Left = 7 + Top = 7 + Width = 38 + Height = 18 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 12 + Font.Style = [fsBold] + Caption = 'SQL' + RawText = False + end + object IWRegion3: TIWRegion + Left = 56 + Top = 8 + Width = 589 + Height = 49 + Anchors = [akLeft, akTop, akRight] + TabOrder = 0 + Color = clNone + object meSQL: TIWMemo + Left = 0 + Top = 0 + Width = 589 + Height = 49 + Align = alClient + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Editable = True + Font.Color = clNone + Font.Enabled = True + Font.Size = 10 + Font.Style = [] + ScriptEvents = <> + RawText = False + ReadOnly = False + Required = False + TabOrder = 4 + WantReturns = False + FriendlyName = 'meSQL' + end + end + end + object IWRegion2: TIWRegion + Left = 16 + Top = 256 + Width = 654 + Height = 141 + Anchors = [akLeft, akTop, akRight, akBottom] + TabOrder = 3 + Color = clBlack + DesignSize = ( + 654 + 141) + object IWRectangle2: TIWRectangle + Left = 1 + Top = 1 + Width = 652 + Height = 139 + Anchors = [akLeft, akTop, akRight, akBottom] + ShowHint = True + ParentShowHint = False + ZIndex = -1 + Font.Color = clNone + Font.Enabled = True + Font.Size = 10 + Font.Style = [] + Color = 14811135 + Alignment = taLeftJustify + VAlign = vaMiddle + end + object IWDBNavigator: TIWDBNavigator + Left = 6 + Top = 29 + Width = 115 + Height = 30 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Confirmations.Delete = 'Are you sure you want to delete this record?' + Confirmations.Post = 'Are you sure you want to update this record?' + Confirmations.Cancel = 'Are you sure you want to cancel your changes to this record?' + DataSource = DataSource + ImageHeight = 21 + ImageWidth = 21 + VisibleButtons = [nbFirst, nbPrior, nbNext, nbLast, nbRefresh] + Orientation = orHorizontal + OnFirst = IWDBNavigatorRefresh + OnPrior = IWDBNavigatorRefresh + OnNext = IWDBNavigatorRefresh + OnLast = IWDBNavigatorRefresh + OnRefresh = IWDBNavigatorRefresh + end + object IWLabel2: TIWLabel + Left = 7 + Top = 7 + Width = 46 + Height = 18 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 12 + Font.Style = [fsBold] + Caption = 'Data' + RawText = False + end + object IWDBGrid: TIWDBGrid + Left = 144 + Top = 28 + Width = 502 + Height = 105 + Anchors = [akLeft, akTop, akRight, akBottom] + ShowHint = True + ParentShowHint = False + ZIndex = 0 + BorderColors.Color = clNone + BorderColors.Light = clNone + BorderColors.Dark = clNone + BGColor = clSkyBlue + BorderSize = 1 + BorderStyle = tfDefault + CellPadding = 0 + CellSpacing = 0 + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + FrameBuffer = 40 + Lines = tlAll + UseFrame = True + UseWidth = True + Columns = <> + DataSource = DataSource + FooterRowCount = 0 + FromStart = True + HighlightColor = clNone + HighlightRows = False + Options = [dgShowTitles] + RefreshMode = rmAutomatic + RowLimit = 0 + RollOver = False + RowClick = False + RollOverColor = clNone + RowHeaderColor = 12876667 + RowAlternateColor = clNone + RowCurrentColor = clMoneyGreen + end + object lbResult: TIWLabel + Left = 144 + Top = 7 + Width = 63 + Height = 16 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + Caption = 'lbResult' + RawText = False + end + end + object IWRegion4: TIWRegion + Left = 16 + Top = 128 + Width = 653 + Height = 46 + Anchors = [akLeft, akTop, akRight] + TabOrder = 1 + Color = clBlack + DesignSize = ( + 653 + 46) + object IWRectangle3: TIWRectangle + Left = 1 + Top = 1 + Width = 651 + Height = 44 + Anchors = [akLeft, akTop, akRight, akBottom] + ShowHint = True + ParentShowHint = False + ZIndex = -1 + Font.Color = clNone + Font.Enabled = True + Font.Size = 10 + Font.Style = [] + Color = 14811135 + Alignment = taLeftJustify + VAlign = vaMiddle + end + object btOpen: TIWButton + Left = 11 + Top = 11 + Width = 94 + Height = 25 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + ButtonType = btButton + Caption = 'Open' + Color = clBtnFace + DoSubmitValidation = True + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + ScriptEvents = <> + TabOrder = 2 + OnClick = btOpenClick + end + object btClose: TIWButton + Left = 112 + Top = 11 + Width = 97 + Height = 25 + ShowHint = True + ParentShowHint = False + ZIndex = 0 + ButtonType = btButton + Caption = 'Close' + Color = clBtnFace + DoSubmitValidation = True + Font.Color = clNone + Font.Enabled = True + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + ScriptEvents = <> + TabOrder = 3 + OnClick = btCloseClick + end + end + object Query: TMSQuery + Left = 272 + Top = 48 + end + object DataSource: TDataSource + DataSet = Query + Left = 304 + Top = 48 + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW5/uQuery.pas b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW5/uQuery.pas new file mode 100644 index 0000000..992e767 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW5/uQuery.pas @@ -0,0 +1,229 @@ +unit uQuery; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, uBase, IWCompLabel, IWControl, IWCompRectangle, IWHTMLControls, + IWGrids, IWDBGrids, IWCompMemo, IWDBStdCtrls, IWCompButton, DB, MSAccess, + MemDS, DBAccess, IWTemplateProcessorHTML, + IWContainer, IWRegion, IWLayoutMgrHTML, IWCompCheckbox, ExtCtrls, + IWExtCtrls, IWHTMLTag; + +type + TfmQuery = class(TfmBase) + IWLabel1: TIWLabel; + IWLabel2: TIWLabel; + IWDBNavigator: TIWDBNavigator; + lbResult: TIWLabel; + btOpen: TIWButton; + Query: TMSQuery; + DataSource: TDataSource; + IWRegion1: TIWRegion; + IWRegion2: TIWRegion; + IWDBGrid: TIWDBGrid; + IWRectangle1: TIWRectangle; + IWRectangle2: TIWRectangle; + IWRegion3: TIWRegion; + meSQL: TIWMemo; + IWRegion4: TIWRegion; + IWRectangle3: TIWRectangle; + btClose: TIWButton; + procedure IWAppFormCreate(Sender: TObject); + procedure btOpenClick(Sender: TObject); + procedure IWAppFormRender(Sender: TObject); + procedure IWDBNavigatorRefresh(Sender: TObject); + procedure btCloseClick(Sender: TObject); + protected + procedure ReadFromControls; override; + end; + +var + fmQuery: TfmQuery; + +implementation + +{$R *.dfm} + +uses + ServerController, IWForm, ComObj; + +procedure TfmQuery.IWAppFormCreate(Sender: TObject); +begin + inherited; + Query.Connection := DM.Connection; +end; + +procedure TfmQuery.btOpenClick(Sender: TObject); +begin + ReadFromControls; + Query.SQL.Text := UserSession.QuerySQL; + IWDBGrid.Columns.Clear; + UserSession.isGoodQuery := False; + try + Query.Execute; + UserSession.isGoodQuery := True; + if Query.Active then + UserSession.QueryResult := 'Result' + else + if Query.RowsAffected >= 0 then + UserSession.QueryResult := IntToStr(Query.RowsAffected) + ' rows affected' + else + UserSession.QueryResult := 'Executed'; + except + on E:Exception do + UserSession.QueryResult := 'Error: '+ E.Message; + end; +end; + +procedure TfmQuery.btCloseClick(Sender: TObject); +begin + ReadFromControls; + UserSession.isGoodQuery := False; + try + IWDBGrid.Columns.Clear; + Query.Close; + UserSession.isGoodQuery := True; + UserSession.QueryResult := '' + except + on E:Exception do + UserSession.QueryResult := 'Error: '+ E.Message; + end; +end; + +procedure TfmQuery.IWAppFormRender(Sender: TObject); +begin + inherited; + meSQL.Lines.Text := UserSession.QuerySQL; + IWDBGrid.Visible := UserSession.isGoodQuery and Query.Active; + IWDBNavigator.Enabled := IWDBGrid.Visible; + lbResult.Font.Color := ResultColors[UserSession.IsGoodQuery]; + lbResult.Caption := UserSession.QueryResult; +end; + +procedure TfmQuery.ReadFromControls; +begin + inherited; + UserSession.QuerySQL := meSQL.Lines.Text; +end; + +procedure TfmQuery.IWDBNavigatorRefresh(Sender: TObject); +begin + ReadFromControls; +end; + +end. + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, uBase, IWCompLabel, IWControl, IWCompRectangle, IWHTMLControls, + IWGrids, IWDBGrids, IWCompMemo, IWDBStdCtrls, IWCompButton, DB, MSAccess, + MemDS, DBAccess, IWTemplateProcessorHTML, + IWContainer, IWRegion, IWLayoutMgrHTML, IWCompCheckbox, ExtCtrls, + IWExtCtrls, IWHTMLTag; + +type + TfmQuery = class(TfmBase) + IWLabel1: TIWLabel; + IWLabel2: TIWLabel; + IWDBNavigator: TIWDBNavigator; + lbResult: TIWLabel; + btOpen: TIWButton; + Query: TMSQuery; + DataSource: TDataSource; + IWRegion1: TIWRegion; + IWRegion2: TIWRegion; + IWDBGrid: TIWDBGrid; + IWRectangle1: TIWRectangle; + IWRectangle2: TIWRectangle; + IWRegion3: TIWRegion; + meSQL: TIWMemo; + IWRegion4: TIWRegion; + IWRectangle3: TIWRectangle; + btClose: TIWButton; + procedure IWAppFormCreate(Sender: TObject); + procedure btOpenClick(Sender: TObject); + procedure IWAppFormRender(Sender: TObject); + procedure IWDBNavigatorRefresh(Sender: TObject); + procedure btCloseClick(Sender: TObject); + protected + procedure ReadFromControls; override; + end; + +var + fmQuery: TfmQuery; + +implementation + +{$R *.dfm} + +uses + ServerController, IWForm, ComObj; + +procedure TfmQuery.IWAppFormCreate(Sender: TObject); +begin + inherited; + Query.Connection := DM.Connection; +end; + +procedure TfmQuery.btOpenClick(Sender: TObject); +begin + ReadFromControls; + Query.SQL.Text := UserSession.QuerySQL; + IWDBGrid.Columns.Clear; + UserSession.isGoodQuery := False; + try + Query.Execute; + UserSession.isGoodQuery := True; + if Query.Active then + UserSession.QueryResult := 'Result' + else + if Query.RowsAffected >= 0 then + UserSession.QueryResult := IntToStr(Query.RowsAffected) + ' rows affected' + else + UserSession.QueryResult := 'Executed'; + except + on E:Exception do + UserSession.QueryResult := 'Error: '+ E.Message; + end; +end; + +procedure TfmQuery.btCloseClick(Sender: TObject); +begin + ReadFromControls; + UserSession.isGoodQuery := False; + try + IWDBGrid.Columns.Clear; + Query.Close; + UserSession.isGoodQuery := True; + UserSession.QueryResult := '' + except + on E:Exception do + UserSession.QueryResult := 'Error: '+ E.Message; + end; +end; + +procedure TfmQuery.IWAppFormRender(Sender: TObject); +begin + inherited; + meSQL.Lines.Text := UserSession.QuerySQL; + IWDBGrid.Visible := UserSession.isGoodQuery and Query.Active; + IWDBNavigator.Enabled := IWDBGrid.Visible; + lbResult.Font.Color := ResultColors[UserSession.IsGoodQuery]; + lbResult.Caption := UserSession.QueryResult; +end; + +procedure TfmQuery.ReadFromControls; +begin + inherited; + UserSession.QuerySQL := meSQL.Lines.Text; +end; + +procedure TfmQuery.IWDBNavigatorRefresh(Sender: TObject); +begin + ReadFromControls; +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/IntraWeb.bdsproj b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/IntraWeb.bdsproj new file mode 100644 index 0000000..f7c5589 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/IntraWeb.bdsproj @@ -0,0 +1,332 @@ + + + + + + + + + + + + IntraWeb.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + + + 0 + 0 + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + ..\ + ..\ + + + + + + False + + + + + + False + + + + + + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1049 + 1251 + + + 1.0.0.0 + 1.0.0.0 + + + + + + + + + + + + + + + + IntraWeb.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + + + 0 + 0 + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + ..\ + ..\ + + + + vcl;rtl;dbrtl;vcldb;vclx;adortl;dbxcds;dbexpress;vclib;ibxpress;IntrawebDB_72_90;Intraweb_72_90;xmlrtl;vclie;inet;inetdbbde;inetdbxpress;IndySystem;IndyCore;dclOfficeXP;VclSmp;dsnap;soaprtl;IndyProtocols;inetdb;vcldbx;webdsnap;websnap;vclactnband;vclshlctrls;dsnapcon;teeui;teedb;tee;Rave60VCL;ibdacvcl90;ibdac90;dac90;dacvcl90 + + + False + + + + + + False + + + + + + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1049 + 1251 + + + 1.0.0.0 + 1.0.0.0 + + OraProvider package + + + diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/IntraWeb.dpr b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/IntraWeb.dpr new file mode 100644 index 0000000..1d7a571 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/IntraWeb.dpr @@ -0,0 +1,41 @@ +program IntraWeb; +{PUBDIST} + +uses + Forms, + IWMain, + ServerController in 'ServerController.pas' {IWServerController: TIWServerControllerBase}, + uBase in 'uBase.pas' {fmBase: TIWAppForm}, + uMain in 'uMain.pas' {fmMain: TIWAppForm}, + uMasterDetail in 'uMasterDetail.pas' {fmMasterDetail: TIWAppForm}, + uCachedUpdates in 'uCachedUpdates.pas' {fmCachedUpdates: TIWAppForm}, + uData in 'uData.pas' {DM: TDataModule}, + uQuery in 'uQuery.pas' {fmQuery: TIWAppForm}; + +{$R *.res} + +begin + Application.Initialize; + Application.CreateForm(TformIWMain, formIWMain); + Application.Run; +end. +{PUBDIST} + +uses + Forms, + IWMain, + ServerController in 'ServerController.pas' {IWServerController: TIWServerControllerBase}, + uBase in 'uBase.pas' {fmBase: TIWAppForm}, + uMain in 'uMain.pas' {fmMain: TIWAppForm}, + uMasterDetail in 'uMasterDetail.pas' {fmMasterDetail: TIWAppForm}, + uCachedUpdates in 'uCachedUpdates.pas' {fmCachedUpdates: TIWAppForm}, + uData in 'uData.pas' {DM: TDataModule}, + uQuery in 'uQuery.pas' {fmQuery: TIWAppForm}; + +{$R *.res} + +begin + Application.Initialize; + Application.CreateForm(TformIWMain, formIWMain); + Application.Run; +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/IntraWeb.res b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/IntraWeb.res new file mode 100644 index 0000000..b3ff0b3 Binary files /dev/null and b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/IntraWeb.res differ diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/IntraWebISAPI.bdsproj b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/IntraWebISAPI.bdsproj new file mode 100644 index 0000000..58466ef --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/IntraWebISAPI.bdsproj @@ -0,0 +1,328 @@ + + + + + + + + + + + + IntraWebISAPI.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + + + 0 + 0 + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + ..\ + ..\ + + + + + + False + + + + + + False + + + + + + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1049 + 1251 + + + 1.0.0.0 + 1.0.0.0 + + + + + + + + + + + + + + IntraWebISAPI.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + + + 0 + 0 + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + ..\ + ..\ + + + + vcl;rtl;dbrtl;vcldb;vclx;adortl;dbxcds;dbexpress;vclib;ibxpress;IntrawebDB_72_90;Intraweb_72_90;xmlrtl;vclie;inet;inetdbbde;inetdbxpress;IndySystem;IndyCore;dclOfficeXP;VclSmp;dsnap;soaprtl;IndyProtocols;inetdb;vcldbx;webdsnap;websnap;vclactnband;vclshlctrls;dsnapcon;teeui;teedb;tee;Rave60VCL;ibdacvcl90;ibdac90;dac90;dacvcl90 + + + False + + + + + + False + + + + + + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1049 + 1251 + + + 1.0.0.0 + 1.0.0.0 + + + diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/IntraWebISAPI.dpr b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/IntraWebISAPI.dpr new file mode 100644 index 0000000..21ba2b3 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/IntraWebISAPI.dpr @@ -0,0 +1,55 @@ +library IntraWebISAPI; +{PUBDIST} + +{ + Assuming the virtual directory that contains this DLL is /IntraWeb/ the URL to start this application is + http://localhost/IntraWeb/IntraWebISAPI +} + +uses + ISAPIApp, + IWInitISAPI, + ServerController in 'ServerController.pas' {IWServerController: TIWServerControllerBase}, + uBase in 'uBase.pas' {fmBase: TIWAppForm}, + uMain in 'uMain.pas' {fmMain: TIWAppForm}, + uMasterDetail in 'uMasterDetail.pas' {fmMasterDetail: TIWAppForm}, + uCachedUpdates in 'uCachedUpdates.pas' {fmCachedUpdates: TIWAppForm}, + uData in 'uData.pas' {DM: TDataModule}, + uQuery in 'uQuery.pas' {fmQuery: TIWAppForm}; + +{$R *.res} + +exports + GetExtensionVersion, + HttpExtensionProc, + TerminateExtension; +begin + IWRun; +end. +{PUBDIST} + +{ + Assuming the virtual directory that contains this DLL is /IntraWeb/ the URL to start this application is + http://localhost/IntraWeb/IntraWebISAPI +} + +uses + ISAPIApp, + IWInitISAPI, + ServerController in 'ServerController.pas' {IWServerController: TIWServerControllerBase}, + uBase in 'uBase.pas' {fmBase: TIWAppForm}, + uMain in 'uMain.pas' {fmMain: TIWAppForm}, + uMasterDetail in 'uMasterDetail.pas' {fmMasterDetail: TIWAppForm}, + uCachedUpdates in 'uCachedUpdates.pas' {fmCachedUpdates: TIWAppForm}, + uData in 'uData.pas' {DM: TDataModule}, + uQuery in 'uQuery.pas' {fmQuery: TIWAppForm}; + +{$R *.res} + +exports + GetExtensionVersion, + HttpExtensionProc, + TerminateExtension; +begin + IWRun; +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/IntraWebISAPI.res b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/IntraWebISAPI.res new file mode 100644 index 0000000..b3ff0b3 Binary files /dev/null and b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/IntraWebISAPI.res differ diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/ReadMe.txt b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/ReadMe.txt new file mode 100644 index 0000000..b7891e6 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/ReadMe.txt @@ -0,0 +1,10 @@ +SQL Server Data Access Components +Copyright 1997-2007, Core Lab. All Rights Reserved +-------------------------------------------------- + +Demo for IntraWeb included in SDAC was built and tested using +IntraWeb 7.2.14 for Delphi 2005. + +IMPORTANT NOTE: + Demo provided as is and there are no warranty that it is fully + compatible with other versions of IntraWeb. \ No newline at end of file diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/ServerController.dfm b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/ServerController.dfm new file mode 100644 index 0000000..e2544b8 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/ServerController.dfm @@ -0,0 +1,79 @@ +object IWServerController: TIWServerController + OldCreateOrder = True + AuthBeforeNewSession = False + AllowSubFolders = False + AppName = 'MyIWApp' + CacheExpiry = 2 + ComInitialization = ciNormal + Compression.Enabled = False + Compression.Level = 6 + Description = 'SQL Server Data Access Demo - IntraWeb' + DebugHTML = False + Log = loNone + EnableImageToolbar = False + ExceptionDisplayMode = smAlert + ExecCmd = 'EXEC' + HistoryEnabled = False + InternalFilesURL = '/' + Browser32Behaviour.Netscape4As32 = True + Browser32Behaviour.Netscape6As32 = True + Browser32Behaviour.IExplorer4As32 = True + PageTransitions = False + Port = 0 + ReEntryOptions.AutoCreateSession = False + RestrictIPs = False + RestrictSubnet = False + RedirectMsgDelay = 0 + ServerResizeTimeout = 0 + SessionTrackingMethod = tmURL + ShowResyncWarning = True + SessionTimeout = 10 + SupportedBrowsers = [brIE, brOpera, brNetscape6] + SSLOptions.NonSSLRequest = nsAccept + SSLOptions.Port = 0 + ThreadPoolSize = 32 + UnknownBrowserAction = ubReject + Version = '7.2.14' + OnNewSession = IWServerControllerBaseNewSession + Height = 310 + Width = 342 +end + OldCreateOrder = True + AuthBeforeNewSession = False + AllowSubFolders = False + AppName = 'MyIWApp' + CacheExpiry = 2 + ComInitialization = ciNormal + Compression.Enabled = False + Compression.Level = 6 + Description = 'SQL Server Data Access Demo - IntraWeb' + DebugHTML = False + Log = loNone + EnableImageToolbar = False + ExceptionDisplayMode = smAlert + ExecCmd = 'EXEC' + HistoryEnabled = False + InternalFilesURL = '/' + Browser32Behaviour.Netscape4As32 = True + Browser32Behaviour.Netscape6As32 = True + Browser32Behaviour.IExplorer4As32 = True + PageTransitions = False + Port = 0 + ReEntryOptions.AutoCreateSession = False + RestrictIPs = False + RestrictSubnet = False + RedirectMsgDelay = 0 + ServerResizeTimeout = 0 + SessionTrackingMethod = tmURL + ShowResyncWarning = True + SessionTimeout = 10 + SupportedBrowsers = [brIE, brOpera, brNetscape6] + SSLOptions.NonSSLRequest = nsAccept + SSLOptions.Port = 0 + ThreadPoolSize = 32 + UnknownBrowserAction = ubReject + Version = '7.2.14' + OnNewSession = IWServerControllerBaseNewSession + Height = 310 + Width = 342 +end diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/ServerController.pas b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/ServerController.pas new file mode 100644 index 0000000..3eb159e --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/ServerController.pas @@ -0,0 +1,279 @@ +unit ServerController; +{PUBDIST} + +interface + +uses + SysUtils, Classes, IWServerControllerBase, + // For OnNewSession Event + IWApplication, IWBaseForm, + IWInit, IWInitISAPI, + uData, uMain, uQuery, uCachedUpdates, uMasterDetail, + MemDS, DBAccess; + +type + TIWServerController = class(TIWServerControllerBase) + procedure IWServerControllerBaseNewSession(ASession: TIWApplication; + var VMainForm: TIWBaseForm); + private + public + end; + + // This is a class which you can add variables to that are specific to the user. Add variables + // to this class instead of creating global variables. This object can references by using: + // UserSession + // So if a variable named UserName of type string is added, it can be referenced by using: + // UserSession.UserName + // Such variables are similar to globals in a normal application, however these variables are + // specific to each user. + // + // See the IntraWeb Manual for more details. + TUserSession = class + public + { Common } + DM: TDM; + fmMain: TfmMain; + fmQuery: TfmQuery; + fmCachedUpdates: TfmCachedUpdates; + fmMasterDetail: TfmMasterDetail; + + { Main } + Username, + Password, + Server, + Database: string; + Pooling, + DisconnectedMode, + FailOver: boolean; + PoolingOptions: TPoolingOptions; + ConnectionResult: string; + IsGoodConnection: boolean; + + { Query } + QueryDependency: boolean; + QuerySQL, + QueryResult: string; + isGoodQuery: boolean; + + { MasterDetail } + MasterSQL, + DetailSQL, + MasterFields, + DetailFields: string; + LocalMasterDetail, + CacheCalcFields: boolean; + MasterDetailResult: string; + isGoodMasterDetail: boolean; + + { CachedUpdates } + CachedSQL: string; + UseCachedUpdates: boolean; + CachedRecordTypes: TUpdateRecordTypes; + CachedResult: string; + isGoodCached: boolean; + + constructor Create; overload; + destructor Destroy; override; + end; + +// Procs + function UserSession: TUserSession; + function DM: TDM; + +implementation + +{$R *.dfm} + +function UserSession: TUserSession; +begin + Result := TUserSession(WebApplication.Data); +end; + +function DM: TDM; +begin + Result := TUserSession(WebApplication.Data).DM; +end; + +{ TUserSession } + +constructor TUserSession.Create; +begin + QuerySQL := 'select * from emp'; + MasterSQL := 'select * from dept'; + DetailSQL := QuerySQL; + CachedSQL := QuerySQL; + MasterFields := 'deptno'; + DetailFields := 'deptno'; + LocalMasterDetail := True; + CacheCalcFields := True; + UseCachedUpdates := True; + Pooling := True; + DisconnectedMode := True; + CachedRecordTypes := [rtUnmodified, rtModified, rtInserted]; + + PoolingOptions := TPoolingOptions.Create(nil); +end; + +destructor TUserSession.Destroy; +begin + PoolingOptions.Free; + inherited; +end; + +{ TIWServerController } + +procedure TIWServerController.IWServerControllerBaseNewSession( + ASession: TIWApplication; var VMainForm: TIWBaseForm); +begin + ASession.Data := TUserSession.Create; + with TUserSession(ASession.Data) do begin + DM := TDM.Create(ASession); + fmQuery := TfmQuery.Create(ASession); + fmCachedUpdates := TfmCachedUpdates.Create(ASession); + fmMasterDetail := TfmMasterDetail.Create(ASession); + end; +end; + + +initialization + TIWServerController.SetServerControllerClass; +end. +{PUBDIST} + +interface + +uses + SysUtils, Classes, IWServerControllerBase, + // For OnNewSession Event + IWApplication, IWBaseForm, + IWInit, IWInitISAPI, + uData, uMain, uQuery, uCachedUpdates, uMasterDetail, + MemDS, DBAccess; + +type + TIWServerController = class(TIWServerControllerBase) + procedure IWServerControllerBaseNewSession(ASession: TIWApplication; + var VMainForm: TIWBaseForm); + private + public + end; + + // This is a class which you can add variables to that are specific to the user. Add variables + // to this class instead of creating global variables. This object can references by using: + // UserSession + // So if a variable named UserName of type string is added, it can be referenced by using: + // UserSession.UserName + // Such variables are similar to globals in a normal application, however these variables are + // specific to each user. + // + // See the IntraWeb Manual for more details. + TUserSession = class + public + { Common } + DM: TDM; + fmMain: TfmMain; + fmQuery: TfmQuery; + fmCachedUpdates: TfmCachedUpdates; + fmMasterDetail: TfmMasterDetail; + + { Main } + Username, + Password, + Server, + Database: string; + Pooling, + DisconnectedMode, + FailOver: boolean; + PoolingOptions: TPoolingOptions; + ConnectionResult: string; + IsGoodConnection: boolean; + + { Query } + QueryDependency: boolean; + QuerySQL, + QueryResult: string; + isGoodQuery: boolean; + + { MasterDetail } + MasterSQL, + DetailSQL, + MasterFields, + DetailFields: string; + LocalMasterDetail, + CacheCalcFields: boolean; + MasterDetailResult: string; + isGoodMasterDetail: boolean; + + { CachedUpdates } + CachedSQL: string; + UseCachedUpdates: boolean; + CachedRecordTypes: TUpdateRecordTypes; + CachedResult: string; + isGoodCached: boolean; + + constructor Create; overload; + destructor Destroy; override; + end; + +// Procs + function UserSession: TUserSession; + function DM: TDM; + +implementation + +{$R *.dfm} + +function UserSession: TUserSession; +begin + Result := TUserSession(WebApplication.Data); +end; + +function DM: TDM; +begin + Result := TUserSession(WebApplication.Data).DM; +end; + +{ TUserSession } + +constructor TUserSession.Create; +begin + QuerySQL := 'select * from emp'; + MasterSQL := 'select * from dept'; + DetailSQL := QuerySQL; + CachedSQL := QuerySQL; + MasterFields := 'deptno'; + DetailFields := 'deptno'; + LocalMasterDetail := True; + CacheCalcFields := True; + UseCachedUpdates := True; + Pooling := True; + DisconnectedMode := True; + CachedRecordTypes := [rtUnmodified, rtModified, rtInserted]; + + PoolingOptions := TPoolingOptions.Create(nil); +end; + +destructor TUserSession.Destroy; +begin + PoolingOptions.Free; + inherited; +end; + +{ TIWServerController } + +procedure TIWServerController.IWServerControllerBaseNewSession( + ASession: TIWApplication; var VMainForm: TIWBaseForm); +begin + ASession.Data := TUserSession.Create; + with TUserSession(ASession.Data) do begin + DM := TDM.Create(ASession); + fmQuery := TfmQuery.Create(ASession); + fmCachedUpdates := TfmCachedUpdates.Create(ASession); + fmMasterDetail := TfmMasterDetail.Create(ASession); + end; +end; + + +initialization + TIWServerController.SetServerControllerClass; +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/uBase.dfm b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/uBase.dfm new file mode 100644 index 0000000..cc167dd --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/uBase.dfm @@ -0,0 +1,603 @@ +object fmBase: TfmBase + Left = 0 + Top = 0 + Width = 620 + Height = 430 + OnRender = IWAppFormRender + ConnectionMode = cmAny + Title = 'SQL Server Data Access Demo - IntraWeb' + SupportedBrowsers = [brIE, brNetscape6] + BrowserSecurityCheck = True + Background.Fixed = False + HandleTabs = False + LeftToRight = True + LockUntilLoaded = True + LockOnSubmit = True + ShowHint = True + XPTheme = True + DesignSize = ( + 620 + 430) + DesignLeft = 8 + DesignTop = 8 + object IWRectangle: TIWRectangle + Left = 12 + Top = 16 + Width = 599 + Height = 28 + Cursor = crAuto + Anchors = [akLeft, akTop, akRight] + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Font.Color = clHighlight + Font.FontName = 'Verdana' + Font.Size = 12 + Font.Style = [fsBold] + BorderOptions.Color = clNone + BorderOptions.Width = 0 + FriendlyName = 'IWRectangle' + Color = clSkyBlue + Alignment = taLeftJustify + VAlign = vaMiddle + end + object lbDemoCaption: TIWLabel + Left = 20 + Top = 21 + Width = 381 + Height = 18 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Alignment = taLeftJustify + BGColor = clNone + Font.Color = 6956042 + Font.FontName = 'Verdana' + Font.Size = 12 + Font.Style = [fsBold] + NoWrap = False + AutoSize = False + FriendlyName = 'lbDemoCaption' + Caption = 'SQL Server Data Access Demo - IntraWeb' + RawText = False + end + object lbPageName: TIWLabel + Left = 515 + Top = 22 + Width = 88 + Height = 16 + Cursor = crAuto + Anchors = [akTop, akRight] + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Alignment = taLeftJustify + BGColor = clNone + Font.Color = 6956042 + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsItalic] + NoWrap = False + FriendlyName = 'lbPageName' + Caption = 'lbPageName' + RawText = False + end + object lnkMain: TIWLink + Left = 16 + Top = 56 + Width = 41 + Height = 25 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Alignment = taLeftJustify + Color = clNone + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + ScriptEvents = <> + DoSubmitValidation = False + FriendlyName = 'lnkMain' + OnClick = lnkMainClick + TabOrder = 0 + RawText = False + Caption = 'Main' + end + object lnkQuery: TIWLink + Left = 69 + Top = 56 + Width = 65 + Height = 17 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Alignment = taLeftJustify + Color = clNone + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + ScriptEvents = <> + DoSubmitValidation = False + FriendlyName = 'lnkQuery' + OnClick = lnkQueryClick + TabOrder = 1 + RawText = False + Caption = 'Query' + end + object lnkCachedUpdates: TIWLink + Left = 138 + Top = 56 + Width = 121 + Height = 17 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Alignment = taLeftJustify + Color = clNone + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + ScriptEvents = <> + DoSubmitValidation = False + FriendlyName = 'lnkCachedUpdates' + OnClick = lnkCachedUpdatesClick + TabOrder = 2 + RawText = False + Caption = 'CachedUpdates' + end + object lnkMasterDetail: TIWLink + Left = 264 + Top = 56 + Width = 105 + Height = 17 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Alignment = taLeftJustify + Color = clNone + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + ScriptEvents = <> + DoSubmitValidation = False + FriendlyName = 'lnkMasterDetail' + OnClick = lnkMasterDetailClick + TabOrder = 3 + RawText = False + Caption = 'MasterDetail' + end + object rgConnection: TIWRegion + Left = 16 + Top = 78 + Width = 594 + Height = 42 + Cursor = crAuto + TabOrder = 0 + Anchors = [akLeft, akTop, akRight] + BorderOptions.NumericWidth = 1 + BorderOptions.BorderWidth = cbwNumeric + BorderOptions.Style = cbsSolid + BorderOptions.Color = clNone + Color = clWebBLACK + ParentShowHint = False + ShowHint = True + ZIndex = 1000 + DesignSize = ( + 594 + 42) + object IWRectangle4: TIWRectangle + Left = 1 + Top = 1 + Width = 592 + Height = 40 + Cursor = crAuto + Anchors = [akLeft, akTop, akRight, akBottom] + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = -1 + RenderSize = True + Font.Color = clNone + Font.Size = 10 + Font.Style = [] + BorderOptions.Color = clNone + BorderOptions.Width = 0 + FriendlyName = 'IWRectangle4' + Color = 14811135 + Alignment = taLeftJustify + VAlign = vaMiddle + end + object btConnect: TIWButton + Left = 8 + Top = 8 + Width = 97 + Height = 25 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Caption = 'Connect' + DoSubmitValidation = True + Color = clBtnFace + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + FriendlyName = 'btConnect' + ScriptEvents = <> + TabOrder = 4 + OnClick = btConnectClick + end + object btDisconnect: TIWButton + Left = 112 + Top = 8 + Width = 97 + Height = 25 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Caption = 'Disconnect' + DoSubmitValidation = True + Color = clBtnFace + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + FriendlyName = 'btDisconnect' + ScriptEvents = <> + TabOrder = 5 + OnClick = btDisconnectClick + end + object lbStateConnection: TIWLabel + Left = 216 + Top = 11 + Width = 147 + Height = 16 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Alignment = taLeftJustify + BGColor = clNone + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + NoWrap = False + FriendlyName = 'lbStateConnection' + Caption = 'lbStateConnection' + RawText = False + end + end +end + Left = 0 + Top = 0 + Width = 620 + Height = 430 + OnRender = IWAppFormRender + ConnectionMode = cmAny + Title = 'SQL Server Data Access Demo - IntraWeb' + SupportedBrowsers = [brIE, brNetscape6] + BrowserSecurityCheck = True + Background.Fixed = False + HandleTabs = False + LeftToRight = True + LockUntilLoaded = True + LockOnSubmit = True + ShowHint = True + XPTheme = True + DesignSize = ( + 620 + 430) + DesignLeft = 8 + DesignTop = 8 + object IWRectangle: TIWRectangle + Left = 12 + Top = 16 + Width = 599 + Height = 28 + Cursor = crAuto + Anchors = [akLeft, akTop, akRight] + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Font.Color = clHighlight + Font.FontName = 'Verdana' + Font.Size = 12 + Font.Style = [fsBold] + BorderOptions.Color = clNone + BorderOptions.Width = 0 + FriendlyName = 'IWRectangle' + Color = clSkyBlue + Alignment = taLeftJustify + VAlign = vaMiddle + end + object lbDemoCaption: TIWLabel + Left = 20 + Top = 21 + Width = 381 + Height = 18 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Alignment = taLeftJustify + BGColor = clNone + Font.Color = 6956042 + Font.FontName = 'Verdana' + Font.Size = 12 + Font.Style = [fsBold] + NoWrap = False + AutoSize = False + FriendlyName = 'lbDemoCaption' + Caption = 'SQL Server Data Access Demo - IntraWeb' + RawText = False + end + object lbPageName: TIWLabel + Left = 515 + Top = 22 + Width = 88 + Height = 16 + Cursor = crAuto + Anchors = [akTop, akRight] + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Alignment = taLeftJustify + BGColor = clNone + Font.Color = 6956042 + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsItalic] + NoWrap = False + FriendlyName = 'lbPageName' + Caption = 'lbPageName' + RawText = False + end + object lnkMain: TIWLink + Left = 16 + Top = 56 + Width = 41 + Height = 25 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Alignment = taLeftJustify + Color = clNone + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + ScriptEvents = <> + DoSubmitValidation = False + FriendlyName = 'lnkMain' + OnClick = lnkMainClick + TabOrder = 0 + RawText = False + Caption = 'Main' + end + object lnkQuery: TIWLink + Left = 69 + Top = 56 + Width = 65 + Height = 17 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Alignment = taLeftJustify + Color = clNone + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + ScriptEvents = <> + DoSubmitValidation = False + FriendlyName = 'lnkQuery' + OnClick = lnkQueryClick + TabOrder = 1 + RawText = False + Caption = 'Query' + end + object lnkCachedUpdates: TIWLink + Left = 138 + Top = 56 + Width = 121 + Height = 17 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Alignment = taLeftJustify + Color = clNone + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + ScriptEvents = <> + DoSubmitValidation = False + FriendlyName = 'lnkCachedUpdates' + OnClick = lnkCachedUpdatesClick + TabOrder = 2 + RawText = False + Caption = 'CachedUpdates' + end + object lnkMasterDetail: TIWLink + Left = 264 + Top = 56 + Width = 105 + Height = 17 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Alignment = taLeftJustify + Color = clNone + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + ScriptEvents = <> + DoSubmitValidation = False + FriendlyName = 'lnkMasterDetail' + OnClick = lnkMasterDetailClick + TabOrder = 3 + RawText = False + Caption = 'MasterDetail' + end + object rgConnection: TIWRegion + Left = 16 + Top = 78 + Width = 594 + Height = 42 + Cursor = crAuto + TabOrder = 0 + Anchors = [akLeft, akTop, akRight] + BorderOptions.NumericWidth = 1 + BorderOptions.BorderWidth = cbwNumeric + BorderOptions.Style = cbsSolid + BorderOptions.Color = clNone + Color = clWebBLACK + ParentShowHint = False + ShowHint = True + ZIndex = 1000 + DesignSize = ( + 594 + 42) + object IWRectangle4: TIWRectangle + Left = 1 + Top = 1 + Width = 592 + Height = 40 + Cursor = crAuto + Anchors = [akLeft, akTop, akRight, akBottom] + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = -1 + RenderSize = True + Font.Color = clNone + Font.Size = 10 + Font.Style = [] + BorderOptions.Color = clNone + BorderOptions.Width = 0 + FriendlyName = 'IWRectangle4' + Color = 14811135 + Alignment = taLeftJustify + VAlign = vaMiddle + end + object btConnect: TIWButton + Left = 8 + Top = 8 + Width = 97 + Height = 25 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Caption = 'Connect' + DoSubmitValidation = True + Color = clBtnFace + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + FriendlyName = 'btConnect' + ScriptEvents = <> + TabOrder = 4 + OnClick = btConnectClick + end + object btDisconnect: TIWButton + Left = 112 + Top = 8 + Width = 97 + Height = 25 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Caption = 'Disconnect' + DoSubmitValidation = True + Color = clBtnFace + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + FriendlyName = 'btDisconnect' + ScriptEvents = <> + TabOrder = 5 + OnClick = btDisconnectClick + end + object lbStateConnection: TIWLabel + Left = 216 + Top = 11 + Width = 147 + Height = 16 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Alignment = taLeftJustify + BGColor = clNone + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + NoWrap = False + FriendlyName = 'lbStateConnection' + Caption = 'lbStateConnection' + RawText = False + end + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/uBase.pas b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/uBase.pas new file mode 100644 index 0000000..7e20614 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/uBase.pas @@ -0,0 +1,245 @@ +unit uBase; +{PUBDIST} + +interface + +uses + IWAppForm, IWApplication, IWTypes, Classes, Controls, IWControl, + IWCompRectangle, IWCompButton, IWGrids, IWDBGrids, IWDBStdCtrls, + IWCompMemo, IWCompEdit, IWCompText, IWCompLabel, IWHTMLControls, + IWContainer, IWRegion, + Forms, Graphics, DB, MemDS, DBAccess, MSAccess, IWVCLBaseContainer, + IWHTMLContainer, IWVCLBaseControl, IWBaseControl, IWBaseHTMLControl; +type + TfmBase = class(TIWAppForm) + IWRectangle: TIWRectangle; + lbDemoCaption: TIWLabel; + lbPageName: TIWLabel; + lnkMain: TIWLink; + lnkQuery: TIWLink; + lnkCachedUpdates: TIWLink; + lnkMasterDetail: TIWLink; + rgConnection: TIWRegion; + IWRectangle4: TIWRectangle; + btConnect: TIWButton; + btDisconnect: TIWButton; + lbStateConnection: TIWLabel; + procedure lnkMainClick(Sender: TObject); + procedure lnkQueryClick(Sender: TObject); + procedure lnkCachedUpdatesClick(Sender: TObject); + procedure IWAppFormRender(Sender: TObject); + procedure lnkMasterDetailClick(Sender: TObject); + procedure btConnectClick(Sender: TObject); + procedure btDisconnectClick(Sender: TObject); + protected + procedure ReadFromControls; virtual; + end; + +const + ResultColors: array[boolean] of TColor = (clRed, $006A240A); + +implementation +{$R *.dfm} + +uses + IWInit, ServerController, SysUtils, IWForm; + + +procedure TfmBase.IWAppFormRender(Sender: TObject); + + procedure SetLinkState(Link: TIWLink; Form: TfmBase); + begin + Link.Enabled := Sender <> Form; + if Link.Enabled then + Link.Font.Style := [] + else + Link.Font.Style := [fsBold]; + end; + +begin + SetLinkState(lnkMain, UserSession.fmMain); + SetLinkState(lnkQuery, UserSession.fmQuery); + SetLinkState(lnkCachedUpdates, UserSession.fmCachedUpdates); + SetLinkState(lnkMasterDetail, UserSession.fmMasterDetail); + + lbStateConnection.Font.Color := ResultColors[UserSession.IsGoodConnection]; + lbStateConnection.Caption := UserSession.ConnectionResult; + btDisconnect.Enabled := DM.Connection.Connected; + btConnect.Enabled := not DM.Connection.Connected; +end; + +procedure TfmBase.lnkMainClick(Sender: TObject); +begin + ReadFromControls; + WebApplication.SetActiveForm(UserSession.fmMain); +end; + +procedure TfmBase.lnkQueryClick(Sender: TObject); +begin + ReadFromControls; + WebApplication.SetActiveForm(UserSession.fmQuery); +end; + +procedure TfmBase.lnkCachedUpdatesClick(Sender: TObject); +begin + ReadFromControls; + WebApplication.SetActiveForm(UserSession.fmCachedUpdates); +end; + +procedure TfmBase.lnkMasterDetailClick(Sender: TObject); +begin + ReadFromControls; + WebApplication.SetActiveForm(UserSession.fmMasterDetail); +end; + +procedure TfmBase.btConnectClick(Sender: TObject); +begin + ReadFromControls; + try + DM.Connection.Connect; + UserSession.IsGoodConnection := True; + except + UserSession.IsGoodConnection := False; + UserSession.ConnectionResult := 'Failed'; + end; +end; + +procedure TfmBase.btDisconnectClick(Sender: TObject); +begin + ReadFromControls; + try + DM.Connection.Disconnect; + UserSession.ConnectionResult := '' + except + UserSession.IsGoodConnection := False; + UserSession.ConnectionResult := 'Failed'; + end; +end; + +procedure TfmBase.ReadFromControls; +begin +end; + +end. +{PUBDIST} + +interface + +uses + IWAppForm, IWApplication, IWTypes, Classes, Controls, IWControl, + IWCompRectangle, IWCompButton, IWGrids, IWDBGrids, IWDBStdCtrls, + IWCompMemo, IWCompEdit, IWCompText, IWCompLabel, IWHTMLControls, + IWContainer, IWRegion, + Forms, Graphics, DB, MemDS, DBAccess, MSAccess, IWVCLBaseContainer, + IWHTMLContainer, IWVCLBaseControl, IWBaseControl, IWBaseHTMLControl; +type + TfmBase = class(TIWAppForm) + IWRectangle: TIWRectangle; + lbDemoCaption: TIWLabel; + lbPageName: TIWLabel; + lnkMain: TIWLink; + lnkQuery: TIWLink; + lnkCachedUpdates: TIWLink; + lnkMasterDetail: TIWLink; + rgConnection: TIWRegion; + IWRectangle4: TIWRectangle; + btConnect: TIWButton; + btDisconnect: TIWButton; + lbStateConnection: TIWLabel; + procedure lnkMainClick(Sender: TObject); + procedure lnkQueryClick(Sender: TObject); + procedure lnkCachedUpdatesClick(Sender: TObject); + procedure IWAppFormRender(Sender: TObject); + procedure lnkMasterDetailClick(Sender: TObject); + procedure btConnectClick(Sender: TObject); + procedure btDisconnectClick(Sender: TObject); + protected + procedure ReadFromControls; virtual; + end; + +const + ResultColors: array[boolean] of TColor = (clRed, $006A240A); + +implementation +{$R *.dfm} + +uses + IWInit, ServerController, SysUtils, IWForm; + + +procedure TfmBase.IWAppFormRender(Sender: TObject); + + procedure SetLinkState(Link: TIWLink; Form: TfmBase); + begin + Link.Enabled := Sender <> Form; + if Link.Enabled then + Link.Font.Style := [] + else + Link.Font.Style := [fsBold]; + end; + +begin + SetLinkState(lnkMain, UserSession.fmMain); + SetLinkState(lnkQuery, UserSession.fmQuery); + SetLinkState(lnkCachedUpdates, UserSession.fmCachedUpdates); + SetLinkState(lnkMasterDetail, UserSession.fmMasterDetail); + + lbStateConnection.Font.Color := ResultColors[UserSession.IsGoodConnection]; + lbStateConnection.Caption := UserSession.ConnectionResult; + btDisconnect.Enabled := DM.Connection.Connected; + btConnect.Enabled := not DM.Connection.Connected; +end; + +procedure TfmBase.lnkMainClick(Sender: TObject); +begin + ReadFromControls; + WebApplication.SetActiveForm(UserSession.fmMain); +end; + +procedure TfmBase.lnkQueryClick(Sender: TObject); +begin + ReadFromControls; + WebApplication.SetActiveForm(UserSession.fmQuery); +end; + +procedure TfmBase.lnkCachedUpdatesClick(Sender: TObject); +begin + ReadFromControls; + WebApplication.SetActiveForm(UserSession.fmCachedUpdates); +end; + +procedure TfmBase.lnkMasterDetailClick(Sender: TObject); +begin + ReadFromControls; + WebApplication.SetActiveForm(UserSession.fmMasterDetail); +end; + +procedure TfmBase.btConnectClick(Sender: TObject); +begin + ReadFromControls; + try + DM.Connection.Connect; + UserSession.IsGoodConnection := True; + except + UserSession.IsGoodConnection := False; + UserSession.ConnectionResult := 'Failed'; + end; +end; + +procedure TfmBase.btDisconnectClick(Sender: TObject); +begin + ReadFromControls; + try + DM.Connection.Disconnect; + UserSession.ConnectionResult := '' + except + UserSession.IsGoodConnection := False; + UserSession.ConnectionResult := 'Failed'; + end; +end; + +procedure TfmBase.ReadFromControls; +begin +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/uCachedUpdates.dfm b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/uCachedUpdates.dfm new file mode 100644 index 0000000..c4d014d --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/uCachedUpdates.dfm @@ -0,0 +1,1405 @@ +inherited fmCachedUpdates: TfmCachedUpdates + Width = 662 + Height = 570 + OnCreate = IWAppFormCreate + DesignLeft = 8 + DesignTop = 8 + inherited IWRectangle: TIWRectangle + Width = 625 + end + inherited lbPageName: TIWLabel + Left = 522 + Width = 113 + Caption = 'CachedUpdates' + end + object IWDBNavigator1: TIWDBNavigator [7] + Left = 16 + Top = 312 + Width = 270 + Height = 30 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Confirmations.Delete = 'Are you sure you want to delete this record?' + Confirmations.Post = 'Are you sure you want to update this record?' + Confirmations.Cancel = 'Are you sure you want to cancel your changes to this record?' + DataSource = DataSource + FriendlyName = 'IWDBNavigator1' + ImageHeight = 21 + ImageWidth = 21 + VisibleButtons = [nbFirst, nbPrior, nbNext, nbLast, nbInsert, nbDelete, nbEdit, nbPost, nbCancel, nbRefresh] + Orientation = orHorizontal + end + object IWDBGrid1: TIWDBGrid [8] + Left = 16 + Top = 344 + Width = 621 + Height = 135 + Cursor = crAuto + Anchors = [akLeft, akTop, akRight] + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + BorderColors.Color = clNone + BorderColors.Light = clNone + BorderColors.Dark = clNone + BGColor = clSkyBlue + BorderSize = 1 + BorderStyle = tfDefault + CellPadding = 0 + CellSpacing = 0 + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + FrameBuffer = 40 + Lines = tlAll + UseFrame = True + UseSize = True + ScrollToCurrentRow = False + Columns = <> + DataSource = DataSource + FooterRowCount = 0 + FriendlyName = 'IWDBGrid1' + FromStart = True + HighlightColor = clNone + HighlightRows = False + Options = [dgShowTitles] + RefreshMode = rmAutomatic + RowLimit = 0 + RollOver = False + RowClick = False + RollOverColor = clNone + RowHeaderColor = 12876667 + RowAlternateColor = clNone + RowCurrentColor = clMoneyGreen + TabOrder = 33 + end + inherited rgConnection: TIWRegion + Width = 620 + inherited IWRectangle4: TIWRectangle + Width = 618 + end + end + object IWRegion4: TIWRegion + Left = 16 + Top = 128 + Width = 620 + Height = 177 + Cursor = crAuto + TabOrder = 1 + Anchors = [akLeft, akTop, akRight] + BorderOptions.NumericWidth = 1 + BorderOptions.BorderWidth = cbwNumeric + BorderOptions.Style = cbsSolid + BorderOptions.Color = clNone + Color = clWebBLACK + ParentShowHint = False + ShowHint = True + ZIndex = 1000 + DesignSize = ( + 620 + 177) + object IWRectangle3: TIWRectangle + Left = 1 + Top = 1 + Width = 618 + Height = 175 + Cursor = crAuto + Anchors = [akLeft, akTop, akRight, akBottom] + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = -1 + RenderSize = True + Font.Color = clNone + Font.Size = 10 + Font.Style = [] + BorderOptions.Color = clNone + BorderOptions.Width = 0 + FriendlyName = 'IWRectangle3' + Color = 14811135 + Alignment = taLeftJustify + VAlign = vaMiddle + end + object cbCachedUpdates: TIWCheckBox + Left = 8 + Top = 8 + Width = 137 + Height = 21 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Caption = 'CachedUpdates' + Editable = True + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + ScriptEvents = <> + DoSubmitValidation = True + Style = stNormal + TabOrder = 6 + Checked = False + FriendlyName = 'cbCachedUpdates' + end + object IWLabel1: TIWLabel + Left = 8 + Top = 111 + Width = 30 + Height = 16 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Alignment = taLeftJustify + BGColor = clNone + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + NoWrap = False + FriendlyName = 'IWLabel1' + Caption = 'SQL' + RawText = False + end + object btOpen: TIWButton + Left = 8 + Top = 30 + Width = 97 + Height = 25 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Caption = 'Open' + DoSubmitValidation = True + Color = clBtnFace + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + FriendlyName = 'btOpen' + ScriptEvents = <> + TabOrder = 11 + OnClick = btOpenClick + end + object btClose: TIWButton + Left = 112 + Top = 31 + Width = 97 + Height = 25 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Caption = 'Close' + DoSubmitValidation = True + Color = clBtnFace + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + FriendlyName = 'btClose' + ScriptEvents = <> + TabOrder = 12 + OnClick = btCloseClick + end + object cbUnmodified: TIWCheckBox + Left = 265 + Top = 9 + Width = 98 + Height = 21 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Caption = 'Unmodified' + Editable = True + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + ScriptEvents = <> + DoSubmitValidation = True + Style = stNormal + TabOrder = 7 + OnClick = cbModifiedClick + Checked = False + FriendlyName = 'cbUnmodified' + end + object cbModified: TIWCheckBox + Left = 361 + Top = 9 + Width = 82 + Height = 21 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Caption = 'Modified' + Editable = True + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + ScriptEvents = <> + DoSubmitValidation = True + Style = stNormal + TabOrder = 8 + OnClick = cbModifiedClick + Checked = False + FriendlyName = 'cbModified' + end + object cbInserted: TIWCheckBox + Left = 441 + Top = 9 + Width = 82 + Height = 21 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Caption = 'Inserted' + Editable = True + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + ScriptEvents = <> + DoSubmitValidation = True + Style = stNormal + TabOrder = 9 + OnClick = cbModifiedClick + Checked = False + FriendlyName = 'cbInserted' + end + object cbDeleted: TIWCheckBox + Left = 521 + Top = 9 + Width = 74 + Height = 21 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Caption = 'Deleted' + Editable = True + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + ScriptEvents = <> + DoSubmitValidation = True + Style = stNormal + TabOrder = 10 + OnClick = cbModifiedClick + Checked = False + FriendlyName = 'cbDeleted' + end + object IWLabel2: TIWLabel + Left = 162 + Top = 10 + Width = 107 + Height = 16 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Alignment = taLeftJustify + BGColor = clNone + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + NoWrap = False + FriendlyName = 'IWLabel2' + Caption = 'RecordTypes:' + RawText = False + end + object lbResult: TIWLabel + Left = 226 + Top = 34 + Width = 63 + Height = 16 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Alignment = taLeftJustify + BGColor = clNone + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + NoWrap = False + FriendlyName = 'lbResult' + Caption = 'lbResult' + RawText = False + end + object lbUpdates: TIWLabel + Left = 177 + Top = 60 + Width = 80 + Height = 16 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Alignment = taLeftJustify + BGColor = clNone + Font.Color = 6956042 + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + NoWrap = False + FriendlyName = 'lbUpdates' + Caption = 'lbUpdates' + RawText = False + end + object btApply: TIWButton + Left = 8 + Top = 80 + Width = 75 + Height = 25 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Caption = 'Apply' + DoSubmitValidation = True + Color = clBtnFace + Font.Color = clNone + Font.Size = 10 + Font.Style = [] + FriendlyName = 'btApply' + ScriptEvents = <> + TabOrder = 13 + OnClick = btApplyClick + end + object btCommit: TIWButton + Left = 88 + Top = 80 + Width = 75 + Height = 25 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Caption = 'Commit' + DoSubmitValidation = True + Color = clBtnFace + Font.Color = clNone + Font.Size = 10 + Font.Style = [] + FriendlyName = 'btCommit' + ScriptEvents = <> + TabOrder = 14 + OnClick = btCommitClick + end + object btCancel: TIWButton + Left = 168 + Top = 80 + Width = 75 + Height = 25 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Caption = 'Cancel' + DoSubmitValidation = True + Color = clBtnFace + Font.Color = clNone + Font.Size = 10 + Font.Style = [] + FriendlyName = 'btCancel' + ScriptEvents = <> + TabOrder = 15 + OnClick = btCancelClick + end + object btRevert: TIWButton + Left = 248 + Top = 80 + Width = 75 + Height = 25 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Caption = 'Revert' + DoSubmitValidation = True + Color = clBtnFace + Font.Color = clNone + Font.Size = 10 + Font.Style = [] + FriendlyName = 'btRevert' + ScriptEvents = <> + TabOrder = 16 + OnClick = btRevertClick + end + object btTransStart: TIWButton + Left = 352 + Top = 80 + Width = 75 + Height = 25 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Caption = 'Start' + DoSubmitValidation = True + Color = clBtnFace + Font.Color = clNone + Font.Size = 10 + Font.Style = [] + FriendlyName = 'btTransStart' + ScriptEvents = <> + TabOrder = 17 + OnClick = btTransStartClick + end + object btTransCommit: TIWButton + Left = 432 + Top = 80 + Width = 75 + Height = 25 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Caption = 'Commit' + DoSubmitValidation = True + Color = clBtnFace + Font.Color = clNone + Font.Size = 10 + Font.Style = [] + FriendlyName = 'btTransCommit' + ScriptEvents = <> + TabOrder = 18 + OnClick = btTransCommitClick + end + object btTransRollback: TIWButton + Left = 512 + Top = 80 + Width = 75 + Height = 25 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Caption = 'Rollback' + DoSubmitValidation = True + Color = clBtnFace + Font.Color = clNone + Font.Size = 10 + Font.Style = [] + FriendlyName = 'btTransRollback' + ScriptEvents = <> + TabOrder = 19 + OnClick = btTransRollbackClick + end + object IWLabel4: TIWLabel + Left = 16 + Top = 60 + Width = 66 + Height = 16 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Alignment = taLeftJustify + BGColor = clNone + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + NoWrap = False + FriendlyName = 'IWLabel4' + Caption = 'Updates' + RawText = False + end + object IWLabel6: TIWLabel + Left = 368 + Top = 60 + Width = 93 + Height = 16 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Alignment = taLeftJustify + BGColor = clNone + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + NoWrap = False + FriendlyName = 'IWLabel6' + Caption = 'Transaction' + RawText = False + end + object lbTransaction: TIWLabel + Left = 472 + Top = 60 + Width = 107 + Height = 16 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Alignment = taLeftJustify + BGColor = clNone + Font.Color = 6956042 + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + NoWrap = False + FriendlyName = 'lbTransaction' + Caption = 'lbTransaction' + RawText = False + end + object IWRegion1: TIWRegion + Left = 48 + Top = 112 + Width = 562 + Height = 49 + Cursor = crAuto + TabOrder = 0 + Anchors = [akLeft, akTop, akRight] + BorderOptions.NumericWidth = 1 + BorderOptions.BorderWidth = cbwNumeric + BorderOptions.Style = cbsSolid + BorderOptions.Color = clNone + Color = clNone + ParentShowHint = False + ShowHint = True + ZIndex = 1000 + object meSQL: TIWMemo + Left = 1 + Top = 1 + Width = 560 + Height = 47 + Cursor = crAuto + Align = alClient + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + BGColor = clNone + Editable = True + Font.Color = clNone + Font.Size = 10 + Font.Style = [] + ScriptEvents = <> + InvisibleBorder = False + HorizScrollBar = False + VertScrollBar = True + Required = False + TabOrder = 20 + FriendlyName = 'meSQL' + end + end + end + object rgEdits: TIWRegion + Left = 16 + Top = 485 + Width = 621 + Height = 62 + Cursor = crAuto + Visible = False + TabOrder = 2 + Anchors = [akLeft, akTop, akRight] + BorderOptions.NumericWidth = 1 + BorderOptions.BorderWidth = cbwNumeric + BorderOptions.Style = cbsSolid + BorderOptions.Color = clNone + Color = clWebBLACK + ParentShowHint = False + ShowHint = True + ZIndex = 1000 + DesignSize = ( + 621 + 62) + object rcEdits: TIWRectangle + Left = 1 + Top = 1 + Width = 619 + Height = 60 + Cursor = crAuto + Anchors = [akLeft, akTop, akRight, akBottom] + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = -1 + RenderSize = True + Font.Color = clNone + Font.Size = 10 + Font.Style = [] + BorderOptions.Color = clNone + BorderOptions.Width = 0 + FriendlyName = 'rcEdits' + Color = 14811135 + Alignment = taLeftJustify + VAlign = vaMiddle + end + end + object Query: TMSQuery + Left = 432 + Top = 264 + end + object DataSource: TDataSource + DataSet = Query + Left = 456 + Top = 264 + end +end + Width = 662 + Height = 570 + OnCreate = IWAppFormCreate + DesignLeft = 8 + DesignTop = 8 + inherited IWRectangle: TIWRectangle + Width = 625 + end + inherited lbPageName: TIWLabel + Left = 522 + Width = 113 + Caption = 'CachedUpdates' + end + object IWDBNavigator1: TIWDBNavigator [7] + Left = 16 + Top = 312 + Width = 270 + Height = 30 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Confirmations.Delete = 'Are you sure you want to delete this record?' + Confirmations.Post = 'Are you sure you want to update this record?' + Confirmations.Cancel = 'Are you sure you want to cancel your changes to this record?' + DataSource = DataSource + FriendlyName = 'IWDBNavigator1' + ImageHeight = 21 + ImageWidth = 21 + VisibleButtons = [nbFirst, nbPrior, nbNext, nbLast, nbInsert, nbDelete, nbEdit, nbPost, nbCancel, nbRefresh] + Orientation = orHorizontal + end + object IWDBGrid1: TIWDBGrid [8] + Left = 16 + Top = 344 + Width = 621 + Height = 135 + Cursor = crAuto + Anchors = [akLeft, akTop, akRight] + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + BorderColors.Color = clNone + BorderColors.Light = clNone + BorderColors.Dark = clNone + BGColor = clSkyBlue + BorderSize = 1 + BorderStyle = tfDefault + CellPadding = 0 + CellSpacing = 0 + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + FrameBuffer = 40 + Lines = tlAll + UseFrame = True + UseSize = True + ScrollToCurrentRow = False + Columns = <> + DataSource = DataSource + FooterRowCount = 0 + FriendlyName = 'IWDBGrid1' + FromStart = True + HighlightColor = clNone + HighlightRows = False + Options = [dgShowTitles] + RefreshMode = rmAutomatic + RowLimit = 0 + RollOver = False + RowClick = False + RollOverColor = clNone + RowHeaderColor = 12876667 + RowAlternateColor = clNone + RowCurrentColor = clMoneyGreen + TabOrder = 33 + end + inherited rgConnection: TIWRegion + Width = 620 + inherited IWRectangle4: TIWRectangle + Width = 618 + end + end + object IWRegion4: TIWRegion + Left = 16 + Top = 128 + Width = 620 + Height = 177 + Cursor = crAuto + TabOrder = 1 + Anchors = [akLeft, akTop, akRight] + BorderOptions.NumericWidth = 1 + BorderOptions.BorderWidth = cbwNumeric + BorderOptions.Style = cbsSolid + BorderOptions.Color = clNone + Color = clWebBLACK + ParentShowHint = False + ShowHint = True + ZIndex = 1000 + DesignSize = ( + 620 + 177) + object IWRectangle3: TIWRectangle + Left = 1 + Top = 1 + Width = 618 + Height = 175 + Cursor = crAuto + Anchors = [akLeft, akTop, akRight, akBottom] + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = -1 + RenderSize = True + Font.Color = clNone + Font.Size = 10 + Font.Style = [] + BorderOptions.Color = clNone + BorderOptions.Width = 0 + FriendlyName = 'IWRectangle3' + Color = 14811135 + Alignment = taLeftJustify + VAlign = vaMiddle + end + object cbCachedUpdates: TIWCheckBox + Left = 8 + Top = 8 + Width = 137 + Height = 21 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Caption = 'CachedUpdates' + Editable = True + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + ScriptEvents = <> + DoSubmitValidation = True + Style = stNormal + TabOrder = 6 + Checked = False + FriendlyName = 'cbCachedUpdates' + end + object IWLabel1: TIWLabel + Left = 8 + Top = 111 + Width = 30 + Height = 16 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Alignment = taLeftJustify + BGColor = clNone + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + NoWrap = False + FriendlyName = 'IWLabel1' + Caption = 'SQL' + RawText = False + end + object btOpen: TIWButton + Left = 8 + Top = 30 + Width = 97 + Height = 25 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Caption = 'Open' + DoSubmitValidation = True + Color = clBtnFace + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + FriendlyName = 'btOpen' + ScriptEvents = <> + TabOrder = 11 + OnClick = btOpenClick + end + object btClose: TIWButton + Left = 112 + Top = 31 + Width = 97 + Height = 25 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Caption = 'Close' + DoSubmitValidation = True + Color = clBtnFace + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + FriendlyName = 'btClose' + ScriptEvents = <> + TabOrder = 12 + OnClick = btCloseClick + end + object cbUnmodified: TIWCheckBox + Left = 265 + Top = 9 + Width = 98 + Height = 21 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Caption = 'Unmodified' + Editable = True + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + ScriptEvents = <> + DoSubmitValidation = True + Style = stNormal + TabOrder = 7 + OnClick = cbModifiedClick + Checked = False + FriendlyName = 'cbUnmodified' + end + object cbModified: TIWCheckBox + Left = 361 + Top = 9 + Width = 82 + Height = 21 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Caption = 'Modified' + Editable = True + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + ScriptEvents = <> + DoSubmitValidation = True + Style = stNormal + TabOrder = 8 + OnClick = cbModifiedClick + Checked = False + FriendlyName = 'cbModified' + end + object cbInserted: TIWCheckBox + Left = 441 + Top = 9 + Width = 82 + Height = 21 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Caption = 'Inserted' + Editable = True + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + ScriptEvents = <> + DoSubmitValidation = True + Style = stNormal + TabOrder = 9 + OnClick = cbModifiedClick + Checked = False + FriendlyName = 'cbInserted' + end + object cbDeleted: TIWCheckBox + Left = 521 + Top = 9 + Width = 74 + Height = 21 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Caption = 'Deleted' + Editable = True + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + ScriptEvents = <> + DoSubmitValidation = True + Style = stNormal + TabOrder = 10 + OnClick = cbModifiedClick + Checked = False + FriendlyName = 'cbDeleted' + end + object IWLabel2: TIWLabel + Left = 162 + Top = 10 + Width = 107 + Height = 16 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Alignment = taLeftJustify + BGColor = clNone + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + NoWrap = False + FriendlyName = 'IWLabel2' + Caption = 'RecordTypes:' + RawText = False + end + object lbResult: TIWLabel + Left = 226 + Top = 34 + Width = 63 + Height = 16 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Alignment = taLeftJustify + BGColor = clNone + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + NoWrap = False + FriendlyName = 'lbResult' + Caption = 'lbResult' + RawText = False + end + object lbUpdates: TIWLabel + Left = 177 + Top = 60 + Width = 80 + Height = 16 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Alignment = taLeftJustify + BGColor = clNone + Font.Color = 6956042 + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + NoWrap = False + FriendlyName = 'lbUpdates' + Caption = 'lbUpdates' + RawText = False + end + object btApply: TIWButton + Left = 8 + Top = 80 + Width = 75 + Height = 25 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Caption = 'Apply' + DoSubmitValidation = True + Color = clBtnFace + Font.Color = clNone + Font.Size = 10 + Font.Style = [] + FriendlyName = 'btApply' + ScriptEvents = <> + TabOrder = 13 + OnClick = btApplyClick + end + object btCommit: TIWButton + Left = 88 + Top = 80 + Width = 75 + Height = 25 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Caption = 'Commit' + DoSubmitValidation = True + Color = clBtnFace + Font.Color = clNone + Font.Size = 10 + Font.Style = [] + FriendlyName = 'btCommit' + ScriptEvents = <> + TabOrder = 14 + OnClick = btCommitClick + end + object btCancel: TIWButton + Left = 168 + Top = 80 + Width = 75 + Height = 25 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Caption = 'Cancel' + DoSubmitValidation = True + Color = clBtnFace + Font.Color = clNone + Font.Size = 10 + Font.Style = [] + FriendlyName = 'btCancel' + ScriptEvents = <> + TabOrder = 15 + OnClick = btCancelClick + end + object btRevert: TIWButton + Left = 248 + Top = 80 + Width = 75 + Height = 25 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Caption = 'Revert' + DoSubmitValidation = True + Color = clBtnFace + Font.Color = clNone + Font.Size = 10 + Font.Style = [] + FriendlyName = 'btRevert' + ScriptEvents = <> + TabOrder = 16 + OnClick = btRevertClick + end + object btTransStart: TIWButton + Left = 352 + Top = 80 + Width = 75 + Height = 25 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Caption = 'Start' + DoSubmitValidation = True + Color = clBtnFace + Font.Color = clNone + Font.Size = 10 + Font.Style = [] + FriendlyName = 'btTransStart' + ScriptEvents = <> + TabOrder = 17 + OnClick = btTransStartClick + end + object btTransCommit: TIWButton + Left = 432 + Top = 80 + Width = 75 + Height = 25 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Caption = 'Commit' + DoSubmitValidation = True + Color = clBtnFace + Font.Color = clNone + Font.Size = 10 + Font.Style = [] + FriendlyName = 'btTransCommit' + ScriptEvents = <> + TabOrder = 18 + OnClick = btTransCommitClick + end + object btTransRollback: TIWButton + Left = 512 + Top = 80 + Width = 75 + Height = 25 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Caption = 'Rollback' + DoSubmitValidation = True + Color = clBtnFace + Font.Color = clNone + Font.Size = 10 + Font.Style = [] + FriendlyName = 'btTransRollback' + ScriptEvents = <> + TabOrder = 19 + OnClick = btTransRollbackClick + end + object IWLabel4: TIWLabel + Left = 16 + Top = 60 + Width = 66 + Height = 16 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Alignment = taLeftJustify + BGColor = clNone + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + NoWrap = False + FriendlyName = 'IWLabel4' + Caption = 'Updates' + RawText = False + end + object IWLabel6: TIWLabel + Left = 368 + Top = 60 + Width = 93 + Height = 16 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Alignment = taLeftJustify + BGColor = clNone + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + NoWrap = False + FriendlyName = 'IWLabel6' + Caption = 'Transaction' + RawText = False + end + object lbTransaction: TIWLabel + Left = 472 + Top = 60 + Width = 107 + Height = 16 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Alignment = taLeftJustify + BGColor = clNone + Font.Color = 6956042 + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + NoWrap = False + FriendlyName = 'lbTransaction' + Caption = 'lbTransaction' + RawText = False + end + object IWRegion1: TIWRegion + Left = 48 + Top = 112 + Width = 562 + Height = 49 + Cursor = crAuto + TabOrder = 0 + Anchors = [akLeft, akTop, akRight] + BorderOptions.NumericWidth = 1 + BorderOptions.BorderWidth = cbwNumeric + BorderOptions.Style = cbsSolid + BorderOptions.Color = clNone + Color = clNone + ParentShowHint = False + ShowHint = True + ZIndex = 1000 + object meSQL: TIWMemo + Left = 1 + Top = 1 + Width = 560 + Height = 47 + Cursor = crAuto + Align = alClient + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + BGColor = clNone + Editable = True + Font.Color = clNone + Font.Size = 10 + Font.Style = [] + ScriptEvents = <> + InvisibleBorder = False + HorizScrollBar = False + VertScrollBar = True + Required = False + TabOrder = 20 + FriendlyName = 'meSQL' + end + end + end + object rgEdits: TIWRegion + Left = 16 + Top = 485 + Width = 621 + Height = 62 + Cursor = crAuto + Visible = False + TabOrder = 2 + Anchors = [akLeft, akTop, akRight] + BorderOptions.NumericWidth = 1 + BorderOptions.BorderWidth = cbwNumeric + BorderOptions.Style = cbsSolid + BorderOptions.Color = clNone + Color = clWebBLACK + ParentShowHint = False + ShowHint = True + ZIndex = 1000 + DesignSize = ( + 621 + 62) + object rcEdits: TIWRectangle + Left = 1 + Top = 1 + Width = 619 + Height = 60 + Cursor = crAuto + Anchors = [akLeft, akTop, akRight, akBottom] + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = -1 + RenderSize = True + Font.Color = clNone + Font.Size = 10 + Font.Style = [] + BorderOptions.Color = clNone + BorderOptions.Width = 0 + FriendlyName = 'rcEdits' + Color = 14811135 + Alignment = taLeftJustify + VAlign = vaMiddle + end + end + object Query: TMSQuery + Left = 432 + Top = 264 + end + object DataSource: TDataSource + DataSet = Query + Left = 456 + Top = 264 + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/uCachedUpdates.pas b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/uCachedUpdates.pas new file mode 100644 index 0000000..4fb2219 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/uCachedUpdates.pas @@ -0,0 +1,481 @@ +unit uCachedUpdates; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, uBase, IWCompLabel, IWControl, IWCompRectangle, IWHTMLControls, + IWCompButton, IWContainer, IWRegion, IWCompMemo, IWCompCheckbox, DB, + MemDS, DBAccess, MSAccess, IWGrids, IWDBGrids, IWDBStdCtrls, + IWCSStdCtrls, IWClientSideDatasetBase, IWClientSideDatasetDBLink, + IWDynGrid, IWVCLBaseContainer, IWHTMLContainer, IWVCLBaseControl, + IWBaseControl, IWBaseHTMLControl; + +type + TfmCachedUpdates = class(TfmBase) + IWRegion4: TIWRegion; + IWRectangle3: TIWRectangle; + cbCachedUpdates: TIWCheckBox; + IWRegion1: TIWRegion; + meSQL: TIWMemo; + IWLabel1: TIWLabel; + btOpen: TIWButton; + btClose: TIWButton; + Query: TMSQuery; + cbUnmodified: TIWCheckBox; + cbModified: TIWCheckBox; + cbInserted: TIWCheckBox; + cbDeleted: TIWCheckBox; + IWLabel2: TIWLabel; + lbResult: TIWLabel; + lbUpdates: TIWLabel; + btApply: TIWButton; + btCommit: TIWButton; + btCancel: TIWButton; + btRevert: TIWButton; + btTransStart: TIWButton; + btTransCommit: TIWButton; + btTransRollback: TIWButton; + DataSource: TDataSource; + IWLabel4: TIWLabel; + IWLabel6: TIWLabel; + IWDBNavigator1: TIWDBNavigator; + lbTransaction: TIWLabel; + IWDBGrid1: TIWDBGrid; + rgEdits: TIWRegion; + rcEdits: TIWRectangle; + procedure IWAppFormCreate(Sender: TObject); + procedure IWAppFormRender(Sender: TObject); + procedure cbModifiedClick(Sender: TObject); + procedure btOpenClick(Sender: TObject); + procedure btCloseClick(Sender: TObject); + procedure btApplyClick(Sender: TObject); + procedure btCommitClick(Sender: TObject); + procedure btCancelClick(Sender: TObject); + procedure btRevertClick(Sender: TObject); + procedure btTransStartClick(Sender: TObject); + procedure btTransCommitClick(Sender: TObject); + procedure btTransRollbackClick(Sender: TObject); + protected + procedure ReadFromControls; override; + procedure DeleteCreatedControls; + end; + +implementation + +{$R *.dfm} + +uses + ServerController, UData, IWForm; + +procedure TfmCachedUpdates.IWAppFormCreate(Sender: TObject); +begin + inherited; + Query.Connection := DM.Connection; +end; + +procedure TfmCachedUpdates.ReadFromControls; +begin + inherited; + UserSession.UseCachedUpdates := cbCachedUpdates.Checked; + UserSession.CachedSQL := meSQL.Lines.Text; + + UserSession.CachedRecordTypes := []; + if cbUnmodified.Checked then + Include(UserSession.CachedRecordTypes, rtUnmodified); + if cbModified.Checked then + Include(UserSession.CachedRecordTypes, rtModified); + if cbInserted.Checked then + Include(UserSession.CachedRecordTypes, rtInserted); + if cbDeleted.Checked then + Include(UserSession.CachedRecordTypes, rtDeleted); +end; + +procedure TfmCachedUpdates.IWAppFormRender(Sender: TObject); +begin + inherited; + cbCachedUpdates.Checked := UserSession.UseCachedUpdates; + cbUnmodified.Checked := rtUnmodified in UserSession.CachedRecordTypes; + cbModified.Checked := rtModified in UserSession.CachedRecordTypes; + cbInserted.Checked := rtInserted in UserSession.CachedRecordTypes; + cbDeleted.Checked := rtDeleted in UserSession.CachedRecordTypes; + meSQL.Lines.Text := UserSession.CachedSQL; + + if Query.CachedUpdates then + Query.UpdateRecordTypes := UserSession.CachedRecordTypes; + if Query.UpdatesPending then + lbUpdates.Text := 'Updates Pending' + else + lbUpdates.Text := ''; + if Query.Connection.InTransaction then + lbTransaction.Text := 'In Transaction' + else + lbTransaction.Text := ''; + + lbResult.Font.Color := ResultColors[UserSession.IsGoodCached]; + lbResult.Caption := UserSession.CachedResult; + + IWDBGrid1.Visible := Query.Active; + +end; + +procedure TfmCachedUpdates.cbModifiedClick(Sender: TObject); +begin + ReadFromControls; +end; + +procedure TfmCachedUpdates.btOpenClick(Sender: TObject); +var + i, ATop: integer; +begin + ReadFromControls; + UserSession.isGoodCached := False; + DeleteCreatedControls; + try + IWDBGrid1.Columns.Clear; + Query.SQL.Text := UserSession.CachedSQL; + Query.CachedUpdates := UserSession.UseCachedUpdates; + Query.Execute; + UserSession.isGoodCached := True; + UserSession.CachedResult := 'Query is openned'; + ATop := 8; + if Query.FieldCount > 0 then begin + for i := 0 to Query.FieldCount - 1 do begin + with TIWLabel.Create(Self) do begin + Parent := rgEdits; + Caption := Query.Fields[i].FieldName; + Left := 24; + Top := ATop; + end; + with TIWDBEdit.Create(Self) do begin + Parent := rgEdits; + DataSource := Self.DataSource; + DataField := Query.Fields[i].FieldName; + Left := 240; + Top := ATop; + Width := 240; + end; + ATop := ATop + 24; + end; + rgEdits.Height := ATop + 4; + rcEdits.Height := rgEdits.Height - 2; + rgEdits.Visible := True; + end; + except + on E:Exception do + UserSession.CachedResult := 'Error: '+ E.Message; + end; +end; + +procedure TfmCachedUpdates.btCloseClick(Sender: TObject); +begin + ReadFromControls; + UserSession.isGoodCached := False; + DeleteCreatedControls; + try + IWDBGrid1.Columns.Clear; + Query.Close; + UserSession.isGoodCached := True; + UserSession.CachedResult := '' + except + on E:Exception do + UserSession.CachedResult := 'Error: '+ E.Message; + end; +end; + +procedure TfmCachedUpdates.btApplyClick(Sender: TObject); +begin + ReadFromControls; + Query.ApplyUpdates; +end; + +procedure TfmCachedUpdates.btCommitClick(Sender: TObject); +begin + ReadFromControls; + Query.CommitUpdates; +end; + +procedure TfmCachedUpdates.btCancelClick(Sender: TObject); +begin + ReadFromControls; + Query.CancelUpdates; +end; + +procedure TfmCachedUpdates.btRevertClick(Sender: TObject); +begin + ReadFromControls; + Query.RevertRecord; +end; + +procedure TfmCachedUpdates.btTransStartClick(Sender: TObject); +begin + ReadFromControls; + Query.Connection.StartTransaction; +end; + +procedure TfmCachedUpdates.btTransCommitClick(Sender: TObject); +begin + ReadFromControls; + Query.Connection.Commit; +end; + +procedure TfmCachedUpdates.btTransRollbackClick(Sender: TObject); +begin + ReadFromControls; + Query.Connection.Rollback; +end; + +procedure TfmCachedUpdates.DeleteCreatedControls; +var + i: integer; +begin + i := 0; + while i < rgEdits.ControlCount do + if not (rgEdits.Controls[i] is TIWRectangle) then + rgEdits.Controls[i].Free + else + Inc(i); + rgEdits.Visible := False; +end; + +end. + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, uBase, IWCompLabel, IWControl, IWCompRectangle, IWHTMLControls, + IWCompButton, IWContainer, IWRegion, IWCompMemo, IWCompCheckbox, DB, + MemDS, DBAccess, MSAccess, IWGrids, IWDBGrids, IWDBStdCtrls, + IWCSStdCtrls, IWClientSideDatasetBase, IWClientSideDatasetDBLink, + IWDynGrid, IWVCLBaseContainer, IWHTMLContainer, IWVCLBaseControl, + IWBaseControl, IWBaseHTMLControl; + +type + TfmCachedUpdates = class(TfmBase) + IWRegion4: TIWRegion; + IWRectangle3: TIWRectangle; + cbCachedUpdates: TIWCheckBox; + IWRegion1: TIWRegion; + meSQL: TIWMemo; + IWLabel1: TIWLabel; + btOpen: TIWButton; + btClose: TIWButton; + Query: TMSQuery; + cbUnmodified: TIWCheckBox; + cbModified: TIWCheckBox; + cbInserted: TIWCheckBox; + cbDeleted: TIWCheckBox; + IWLabel2: TIWLabel; + lbResult: TIWLabel; + lbUpdates: TIWLabel; + btApply: TIWButton; + btCommit: TIWButton; + btCancel: TIWButton; + btRevert: TIWButton; + btTransStart: TIWButton; + btTransCommit: TIWButton; + btTransRollback: TIWButton; + DataSource: TDataSource; + IWLabel4: TIWLabel; + IWLabel6: TIWLabel; + IWDBNavigator1: TIWDBNavigator; + lbTransaction: TIWLabel; + IWDBGrid1: TIWDBGrid; + rgEdits: TIWRegion; + rcEdits: TIWRectangle; + procedure IWAppFormCreate(Sender: TObject); + procedure IWAppFormRender(Sender: TObject); + procedure cbModifiedClick(Sender: TObject); + procedure btOpenClick(Sender: TObject); + procedure btCloseClick(Sender: TObject); + procedure btApplyClick(Sender: TObject); + procedure btCommitClick(Sender: TObject); + procedure btCancelClick(Sender: TObject); + procedure btRevertClick(Sender: TObject); + procedure btTransStartClick(Sender: TObject); + procedure btTransCommitClick(Sender: TObject); + procedure btTransRollbackClick(Sender: TObject); + protected + procedure ReadFromControls; override; + procedure DeleteCreatedControls; + end; + +implementation + +{$R *.dfm} + +uses + ServerController, UData, IWForm; + +procedure TfmCachedUpdates.IWAppFormCreate(Sender: TObject); +begin + inherited; + Query.Connection := DM.Connection; +end; + +procedure TfmCachedUpdates.ReadFromControls; +begin + inherited; + UserSession.UseCachedUpdates := cbCachedUpdates.Checked; + UserSession.CachedSQL := meSQL.Lines.Text; + + UserSession.CachedRecordTypes := []; + if cbUnmodified.Checked then + Include(UserSession.CachedRecordTypes, rtUnmodified); + if cbModified.Checked then + Include(UserSession.CachedRecordTypes, rtModified); + if cbInserted.Checked then + Include(UserSession.CachedRecordTypes, rtInserted); + if cbDeleted.Checked then + Include(UserSession.CachedRecordTypes, rtDeleted); +end; + +procedure TfmCachedUpdates.IWAppFormRender(Sender: TObject); +begin + inherited; + cbCachedUpdates.Checked := UserSession.UseCachedUpdates; + cbUnmodified.Checked := rtUnmodified in UserSession.CachedRecordTypes; + cbModified.Checked := rtModified in UserSession.CachedRecordTypes; + cbInserted.Checked := rtInserted in UserSession.CachedRecordTypes; + cbDeleted.Checked := rtDeleted in UserSession.CachedRecordTypes; + meSQL.Lines.Text := UserSession.CachedSQL; + + if Query.CachedUpdates then + Query.UpdateRecordTypes := UserSession.CachedRecordTypes; + if Query.UpdatesPending then + lbUpdates.Text := 'Updates Pending' + else + lbUpdates.Text := ''; + if Query.Connection.InTransaction then + lbTransaction.Text := 'In Transaction' + else + lbTransaction.Text := ''; + + lbResult.Font.Color := ResultColors[UserSession.IsGoodCached]; + lbResult.Caption := UserSession.CachedResult; + + IWDBGrid1.Visible := Query.Active; + +end; + +procedure TfmCachedUpdates.cbModifiedClick(Sender: TObject); +begin + ReadFromControls; +end; + +procedure TfmCachedUpdates.btOpenClick(Sender: TObject); +var + i, ATop: integer; +begin + ReadFromControls; + UserSession.isGoodCached := False; + DeleteCreatedControls; + try + IWDBGrid1.Columns.Clear; + Query.SQL.Text := UserSession.CachedSQL; + Query.CachedUpdates := UserSession.UseCachedUpdates; + Query.Execute; + UserSession.isGoodCached := True; + UserSession.CachedResult := 'Query is openned'; + ATop := 8; + if Query.FieldCount > 0 then begin + for i := 0 to Query.FieldCount - 1 do begin + with TIWLabel.Create(Self) do begin + Parent := rgEdits; + Caption := Query.Fields[i].FieldName; + Left := 24; + Top := ATop; + end; + with TIWDBEdit.Create(Self) do begin + Parent := rgEdits; + DataSource := Self.DataSource; + DataField := Query.Fields[i].FieldName; + Left := 240; + Top := ATop; + Width := 240; + end; + ATop := ATop + 24; + end; + rgEdits.Height := ATop + 4; + rcEdits.Height := rgEdits.Height - 2; + rgEdits.Visible := True; + end; + except + on E:Exception do + UserSession.CachedResult := 'Error: '+ E.Message; + end; +end; + +procedure TfmCachedUpdates.btCloseClick(Sender: TObject); +begin + ReadFromControls; + UserSession.isGoodCached := False; + DeleteCreatedControls; + try + IWDBGrid1.Columns.Clear; + Query.Close; + UserSession.isGoodCached := True; + UserSession.CachedResult := '' + except + on E:Exception do + UserSession.CachedResult := 'Error: '+ E.Message; + end; +end; + +procedure TfmCachedUpdates.btApplyClick(Sender: TObject); +begin + ReadFromControls; + Query.ApplyUpdates; +end; + +procedure TfmCachedUpdates.btCommitClick(Sender: TObject); +begin + ReadFromControls; + Query.CommitUpdates; +end; + +procedure TfmCachedUpdates.btCancelClick(Sender: TObject); +begin + ReadFromControls; + Query.CancelUpdates; +end; + +procedure TfmCachedUpdates.btRevertClick(Sender: TObject); +begin + ReadFromControls; + Query.RevertRecord; +end; + +procedure TfmCachedUpdates.btTransStartClick(Sender: TObject); +begin + ReadFromControls; + Query.Connection.StartTransaction; +end; + +procedure TfmCachedUpdates.btTransCommitClick(Sender: TObject); +begin + ReadFromControls; + Query.Connection.Commit; +end; + +procedure TfmCachedUpdates.btTransRollbackClick(Sender: TObject); +begin + ReadFromControls; + Query.Connection.Rollback; +end; + +procedure TfmCachedUpdates.DeleteCreatedControls; +var + i: integer; +begin + i := 0; + while i < rgEdits.ControlCount do + if not (rgEdits.Controls[i] is TIWRectangle) then + rgEdits.Controls[i].Free + else + Inc(i); + rgEdits.Visible := False; +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/uData.dfm b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/uData.dfm new file mode 100644 index 0000000..30ecdfb --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/uData.dfm @@ -0,0 +1,29 @@ +object DM: TDM + OldCreateOrder = False + Height = 250 + Width = 225 + object Connection: TMSConnection + Database = 'master' + Authentication = auServer + AfterConnect = ConnectionAfterConnect + BeforeConnect = ConnectionBeforeConnect + AfterDisconnect = ConnectionAfterDisconnect + OnConnectionLost = ConnectionConnectionLost + Left = 40 + Top = 24 + end +end + OldCreateOrder = False + Height = 250 + Width = 225 + object Connection: TMSConnection + Database = 'master' + Authentication = auServer + AfterConnect = ConnectionAfterConnect + BeforeConnect = ConnectionBeforeConnect + AfterDisconnect = ConnectionAfterDisconnect + OnConnectionLost = ConnectionConnectionLost + Left = 40 + Top = 24 + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/uData.pas b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/uData.pas new file mode 100644 index 0000000..ecfe754 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/uData.pas @@ -0,0 +1,149 @@ +unit uData; + +interface + +uses + SysUtils, Classes, DB, DBAccess, MSAccess, MemData; + +type + TDM = class(TDataModule) + Connection: TMSConnection; + procedure ConnectionConnectionLost(Sender: TObject; Component: TComponent; + ConnLostCause: TConnLostCause; var RetryMode: TRetryMode); + procedure ConnectionBeforeConnect(Sender: TObject); + procedure ConnectionAfterConnect(Sender: TObject); + procedure ConnectionAfterDisconnect(Sender: TObject); + end; + +implementation + +{$R *.dfm} + +uses IWInit, ServerController; + +{ TDM } + +procedure TDM.ConnectionBeforeConnect(Sender: TObject); +begin + Connection.Username := UserSession.Username; + Connection.Password := UserSession.Password; + Connection.Server := UserSession.Server; + Connection.Database := UserSession.Database; + Connection.Options.DisconnectedMode := UserSession.DisconnectedMode; + Connection.Pooling := UserSession.Pooling; + Connection.PoolingOptions := UserSession.PoolingOptions; + if UserSession.FailOver then + Connection.OnConnectionLost := ConnectionConnectionLost + else + Connection.OnConnectionLost := nil; +end; + +procedure TDM.ConnectionAfterConnect(Sender: TObject); +begin + UserSession.IsGoodConnection := True; + UserSession.ConnectionResult := 'Connected'; +end; + +procedure TDM.ConnectionAfterDisconnect(Sender: TObject); +begin + if not (csDestroying in Connection.ComponentState) then + UserSession.ConnectionResult := ''; +end; + +procedure TDM.ConnectionConnectionLost(Sender: TObject; Component: TComponent; + ConnLostCause: TConnLostCause; var RetryMode: TRetryMode); +var + Msg: string; +begin + UserSession.IsGoodConnection := False; + case ConnLostCause of + clUnknown: + Msg := 'Unknown'; + clConnect: + Msg := 'Connect'; + clExecute: + Msg := 'Execute'; + clOpen: + Msg := 'Open'; + clApply: + Msg := 'Apply'; + end; + UserSession.ConnectionResult := 'Connection lost: ' + + Component.Name + ' - ' + Msg; +end; + +end. + +interface + +uses + SysUtils, Classes, DB, DBAccess, MSAccess; + +type + TDM = class(TDataModule) + Connection: TMSConnection; + procedure ConnectionConnectionLost(Sender: TObject; Component: TComponent; + ConnLostCause: TConnLostCause; var RetryMode: TRetryMode); + procedure ConnectionBeforeConnect(Sender: TObject); + procedure ConnectionAfterConnect(Sender: TObject); + procedure ConnectionAfterDisconnect(Sender: TObject); + end; + +implementation + +{$R *.dfm} + +uses IWInit, ServerController; + +{ TDM } + +procedure TDM.ConnectionBeforeConnect(Sender: TObject); +begin + Connection.Username := UserSession.Username; + Connection.Password := UserSession.Password; + Connection.Server := UserSession.Server; + Connection.Database := UserSession.Database; + Connection.Options.DisconnectedMode := UserSession.DisconnectedMode; + Connection.Pooling := UserSession.Pooling; + Connection.PoolingOptions := UserSession.PoolingOptions; + if UserSession.FailOver then + Connection.OnConnectionLost := ConnectionConnectionLost + else + Connection.OnConnectionLost := nil; +end; + +procedure TDM.ConnectionAfterConnect(Sender: TObject); +begin + UserSession.IsGoodConnection := True; + UserSession.ConnectionResult := 'Connected'; +end; + +procedure TDM.ConnectionAfterDisconnect(Sender: TObject); +begin + if not (csDestroying in Connection.ComponentState) then + UserSession.ConnectionResult := ''; +end; + +procedure TDM.ConnectionConnectionLost(Sender: TObject; Component: TComponent; + ConnLostCause: TConnLostCause; var RetryMode: TRetryMode); +var + Msg: string; +begin + UserSession.IsGoodConnection := False; + case ConnLostCause of + clUnknown: + Msg := 'Unknown'; + clConnect: + Msg := 'Connect'; + clExecute: + Msg := 'Execute'; + clOpen: + Msg := 'Open'; + clApply: + Msg := 'Apply'; + end; + UserSession.ConnectionResult := 'Connection lost: ' + + Component.Name + ' - ' + Msg; +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/uMain.dfm b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/uMain.dfm new file mode 100644 index 0000000..7245312 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/uMain.dfm @@ -0,0 +1,1089 @@ +inherited fmMain: TfmMain + Width = 630 + Height = 491 + OnCreate = IWAppFormCreate + DesignLeft = 8 + DesignTop = 8 + inherited IWRectangle: TIWRectangle + Width = 609 + end + inherited lbPageName: TIWLabel + Left = 581 + Width = 33 + Caption = 'Main' + end + inherited rgConnection: TIWRegion + Width = 604 + inherited IWRectangle4: TIWRectangle + Width = 602 + end + end + object IWRegion4: TIWRegion + Left = 16 + Top = 127 + Width = 306 + Height = 173 + Cursor = crAuto + TabOrder = 1 + Anchors = [akLeft, akTop, akRight] + BorderOptions.NumericWidth = 1 + BorderOptions.BorderWidth = cbwNumeric + BorderOptions.Style = cbsSolid + BorderOptions.Color = clNone + Color = clWebBLACK + ParentShowHint = False + ShowHint = True + ZIndex = 1000 + DesignSize = ( + 306 + 173) + object IWRectangle3: TIWRectangle + Left = 1 + Top = 1 + Width = 304 + Height = 171 + Cursor = crAuto + Anchors = [akLeft, akTop, akRight, akBottom] + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = -1 + RenderSize = True + Font.Color = clNone + Font.Size = 10 + Font.Style = [] + BorderOptions.Color = clNone + BorderOptions.Width = 0 + FriendlyName = 'IWRectangle3' + Color = 14811135 + Alignment = taLeftJustify + VAlign = vaMiddle + end + object edUsername: TIWEdit + Left = 112 + Top = 23 + Width = 163 + Height = 21 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Alignment = taLeftJustify + BGColor = clNone + FocusColor = clNone + DoSubmitValidation = True + Editable = True + NonEditableAsLabel = True + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + FriendlyName = 'edUsername' + MaxLength = 0 + ReadOnly = False + Required = False + ScriptEvents = <> + TabOrder = 6 + PasswordPrompt = False + end + object IWLabel1: TIWLabel + Left = 20 + Top = 25 + Width = 81 + Height = 16 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Alignment = taLeftJustify + BGColor = clNone + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + NoWrap = False + FriendlyName = 'IWLabel1' + Caption = 'Username' + RawText = False + end + object IWLabel2: TIWLabel + Left = 20 + Top = 60 + Width = 77 + Height = 16 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Alignment = taLeftJustify + BGColor = clNone + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + NoWrap = False + FriendlyName = 'IWLabel2' + Caption = 'Password' + RawText = False + end + object edPassword: TIWEdit + Left = 112 + Top = 58 + Width = 163 + Height = 21 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Alignment = taLeftJustify + BGColor = clNone + FocusColor = clNone + DoSubmitValidation = True + Editable = True + NonEditableAsLabel = True + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + FriendlyName = 'edPassword' + MaxLength = 0 + ReadOnly = False + Required = False + ScriptEvents = <> + TabOrder = 7 + PasswordPrompt = True + end + object IWLabel3: TIWLabel + Left = 20 + Top = 95 + Width = 52 + Height = 16 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Alignment = taLeftJustify + BGColor = clNone + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + NoWrap = False + FriendlyName = 'IWLabel3' + Caption = 'Server' + RawText = False + end + object edServer: TIWEdit + Tag = 8 + Left = 112 + Top = 93 + Width = 163 + Height = 21 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Alignment = taLeftJustify + BGColor = clNone + FocusColor = clNone + DoSubmitValidation = True + Editable = True + NonEditableAsLabel = True + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + FriendlyName = 'edServer' + MaxLength = 0 + ReadOnly = False + Required = False + ScriptEvents = <> + TabOrder = 8 + PasswordPrompt = False + end + object IWLabel5: TIWLabel + Left = 21 + Top = 130 + Width = 75 + Height = 16 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Alignment = taLeftJustify + BGColor = clNone + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + NoWrap = False + FriendlyName = 'IWLabel5' + Caption = 'Database' + RawText = False + end + object edDatabase: TIWEdit + Tag = 9 + Left = 112 + Top = 128 + Width = 163 + Height = 21 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Alignment = taLeftJustify + BGColor = clNone + FocusColor = clNone + DoSubmitValidation = True + Editable = True + NonEditableAsLabel = True + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + FriendlyName = 'edDatabase' + MaxLength = 0 + ReadOnly = False + Required = False + ScriptEvents = <> + TabOrder = 9 + PasswordPrompt = False + end + end + object IWRegion1: TIWRegion + Left = 329 + Top = 127 + Width = 291 + Height = 174 + Cursor = crAuto + TabOrder = 2 + Anchors = [akTop, akRight] + BorderOptions.NumericWidth = 1 + BorderOptions.BorderWidth = cbwNumeric + BorderOptions.Style = cbsSolid + BorderOptions.Color = clNone + Color = clWebBLACK + ParentShowHint = False + ShowHint = True + ZIndex = 1000 + DesignSize = ( + 291 + 174) + object IWRectangle1: TIWRectangle + Left = 1 + Top = 1 + Width = 289 + Height = 172 + Cursor = crAuto + Anchors = [akLeft, akTop, akRight, akBottom] + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = -1 + RenderSize = True + Font.Color = clNone + Font.Size = 10 + Font.Style = [] + BorderOptions.Color = clNone + BorderOptions.Width = 0 + FriendlyName = 'IWRectangle1' + Color = 14811135 + Alignment = taLeftJustify + VAlign = vaMiddle + end + object cbDisconnectedMode: TIWCheckBox + Tag = 10 + Left = 8 + Top = 8 + Width = 164 + Height = 21 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Caption = 'DisconnectedMode' + Editable = True + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + ScriptEvents = <> + DoSubmitValidation = True + Style = stNormal + TabOrder = 10 + Checked = False + FriendlyName = 'cbDisconnectedMode' + end + object cbFailover: TIWCheckBox + Tag = 11 + Left = 8 + Top = 35 + Width = 121 + Height = 21 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Caption = 'Failover' + Editable = True + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + ScriptEvents = <> + DoSubmitValidation = True + Style = stNormal + TabOrder = 11 + Checked = False + FriendlyName = 'cbFailover' + end + object cbPooling: TIWCheckBox + Tag = 12 + Left = 8 + Top = 62 + Width = 121 + Height = 21 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Caption = 'Pooling' + Editable = True + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + ScriptEvents = <> + DoSubmitValidation = True + Style = stNormal + TabOrder = 12 + Checked = False + FriendlyName = 'cbPooling' + end + object edConnectionLifeTime: TIWEdit + Tag = 13 + Left = 157 + Top = 88 + Width = 101 + Height = 21 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Alignment = taLeftJustify + BGColor = clNone + FocusColor = clNone + DoSubmitValidation = True + Editable = True + NonEditableAsLabel = True + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + FriendlyName = 'edConnectionLifeTime' + MaxLength = 0 + ReadOnly = False + Required = False + ScriptEvents = <> + TabOrder = 13 + PasswordPrompt = False + Text = 'edConnectionLifeTime' + end + object IWLabel4: TIWLabel + Left = 26 + Top = 90 + Width = 140 + Height = 16 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Alignment = taLeftJustify + BGColor = clNone + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + NoWrap = False + FriendlyName = 'IWLabel4' + Caption = 'ConnectionLifeTime' + RawText = False + end + object edMaxPoolSize: TIWEdit + Tag = 14 + Left = 157 + Top = 115 + Width = 101 + Height = 21 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Alignment = taLeftJustify + BGColor = clNone + FocusColor = clNone + DoSubmitValidation = True + Editable = True + NonEditableAsLabel = True + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + FriendlyName = 'edMaxPoolSize' + MaxLength = 0 + ReadOnly = False + Required = False + ScriptEvents = <> + TabOrder = 14 + PasswordPrompt = False + Text = 'edMaxPoolSize' + end + object edMinPoolSize: TIWEdit + Tag = 15 + Left = 157 + Top = 142 + Width = 101 + Height = 21 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Alignment = taLeftJustify + BGColor = clNone + FocusColor = clNone + DoSubmitValidation = True + Editable = True + NonEditableAsLabel = True + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + FriendlyName = 'edMinPoolSize' + MaxLength = 0 + ReadOnly = False + Required = False + ScriptEvents = <> + TabOrder = 15 + PasswordPrompt = False + Text = 'edMinPoolSize' + end + object IWLabel6: TIWLabel + Left = 26 + Top = 117 + Width = 88 + Height = 16 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Alignment = taLeftJustify + BGColor = clNone + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + NoWrap = False + FriendlyName = 'IWLabel6' + Caption = 'MaxPoolSize' + RawText = False + end + object IWLabel7: TIWLabel + Left = 26 + Top = 144 + Width = 83 + Height = 16 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Alignment = taLeftJustify + BGColor = clNone + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + NoWrap = False + FriendlyName = 'IWLabel7' + Caption = 'MinPoolSize' + RawText = False + end + end +end + Width = 630 + Height = 491 + OnCreate = IWAppFormCreate + DesignLeft = 8 + DesignTop = 8 + inherited IWRectangle: TIWRectangle + Width = 609 + end + inherited lbPageName: TIWLabel + Left = 581 + Width = 33 + Caption = 'Main' + end + inherited rgConnection: TIWRegion + Width = 604 + inherited IWRectangle4: TIWRectangle + Width = 602 + end + end + object IWRegion4: TIWRegion + Left = 16 + Top = 127 + Width = 306 + Height = 173 + Cursor = crAuto + TabOrder = 1 + Anchors = [akLeft, akTop, akRight] + BorderOptions.NumericWidth = 1 + BorderOptions.BorderWidth = cbwNumeric + BorderOptions.Style = cbsSolid + BorderOptions.Color = clNone + Color = clWebBLACK + ParentShowHint = False + ShowHint = True + ZIndex = 1000 + DesignSize = ( + 306 + 173) + object IWRectangle3: TIWRectangle + Left = 1 + Top = 1 + Width = 304 + Height = 171 + Cursor = crAuto + Anchors = [akLeft, akTop, akRight, akBottom] + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = -1 + RenderSize = True + Font.Color = clNone + Font.Size = 10 + Font.Style = [] + BorderOptions.Color = clNone + BorderOptions.Width = 0 + FriendlyName = 'IWRectangle3' + Color = 14811135 + Alignment = taLeftJustify + VAlign = vaMiddle + end + object edUsername: TIWEdit + Left = 112 + Top = 23 + Width = 163 + Height = 21 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Alignment = taLeftJustify + BGColor = clNone + FocusColor = clNone + DoSubmitValidation = True + Editable = True + NonEditableAsLabel = True + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + FriendlyName = 'edUsername' + MaxLength = 0 + ReadOnly = False + Required = False + ScriptEvents = <> + TabOrder = 6 + PasswordPrompt = False + end + object IWLabel1: TIWLabel + Left = 20 + Top = 25 + Width = 81 + Height = 16 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Alignment = taLeftJustify + BGColor = clNone + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + NoWrap = False + FriendlyName = 'IWLabel1' + Caption = 'Username' + RawText = False + end + object IWLabel2: TIWLabel + Left = 20 + Top = 60 + Width = 77 + Height = 16 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Alignment = taLeftJustify + BGColor = clNone + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + NoWrap = False + FriendlyName = 'IWLabel2' + Caption = 'Password' + RawText = False + end + object edPassword: TIWEdit + Left = 112 + Top = 58 + Width = 163 + Height = 21 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Alignment = taLeftJustify + BGColor = clNone + FocusColor = clNone + DoSubmitValidation = True + Editable = True + NonEditableAsLabel = True + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + FriendlyName = 'edPassword' + MaxLength = 0 + ReadOnly = False + Required = False + ScriptEvents = <> + TabOrder = 7 + PasswordPrompt = True + end + object IWLabel3: TIWLabel + Left = 20 + Top = 95 + Width = 52 + Height = 16 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Alignment = taLeftJustify + BGColor = clNone + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + NoWrap = False + FriendlyName = 'IWLabel3' + Caption = 'Server' + RawText = False + end + object edServer: TIWEdit + Tag = 8 + Left = 112 + Top = 93 + Width = 163 + Height = 21 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Alignment = taLeftJustify + BGColor = clNone + FocusColor = clNone + DoSubmitValidation = True + Editable = True + NonEditableAsLabel = True + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + FriendlyName = 'edServer' + MaxLength = 0 + ReadOnly = False + Required = False + ScriptEvents = <> + TabOrder = 8 + PasswordPrompt = False + end + object IWLabel5: TIWLabel + Left = 21 + Top = 130 + Width = 75 + Height = 16 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Alignment = taLeftJustify + BGColor = clNone + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + NoWrap = False + FriendlyName = 'IWLabel5' + Caption = 'Database' + RawText = False + end + object edDatabase: TIWEdit + Tag = 9 + Left = 112 + Top = 128 + Width = 163 + Height = 21 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Alignment = taLeftJustify + BGColor = clNone + FocusColor = clNone + DoSubmitValidation = True + Editable = True + NonEditableAsLabel = True + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + FriendlyName = 'edDatabase' + MaxLength = 0 + ReadOnly = False + Required = False + ScriptEvents = <> + TabOrder = 9 + PasswordPrompt = False + end + end + object IWRegion1: TIWRegion + Left = 329 + Top = 127 + Width = 291 + Height = 174 + Cursor = crAuto + TabOrder = 2 + Anchors = [akTop, akRight] + BorderOptions.NumericWidth = 1 + BorderOptions.BorderWidth = cbwNumeric + BorderOptions.Style = cbsSolid + BorderOptions.Color = clNone + Color = clWebBLACK + ParentShowHint = False + ShowHint = True + ZIndex = 1000 + DesignSize = ( + 291 + 174) + object IWRectangle1: TIWRectangle + Left = 1 + Top = 1 + Width = 289 + Height = 172 + Cursor = crAuto + Anchors = [akLeft, akTop, akRight, akBottom] + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = -1 + RenderSize = True + Font.Color = clNone + Font.Size = 10 + Font.Style = [] + BorderOptions.Color = clNone + BorderOptions.Width = 0 + FriendlyName = 'IWRectangle1' + Color = 14811135 + Alignment = taLeftJustify + VAlign = vaMiddle + end + object cbDisconnectedMode: TIWCheckBox + Tag = 10 + Left = 8 + Top = 8 + Width = 164 + Height = 21 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Caption = 'DisconnectedMode' + Editable = True + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + ScriptEvents = <> + DoSubmitValidation = True + Style = stNormal + TabOrder = 10 + Checked = False + FriendlyName = 'cbDisconnectedMode' + end + object cbFailover: TIWCheckBox + Tag = 11 + Left = 8 + Top = 35 + Width = 121 + Height = 21 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Caption = 'Failover' + Editable = True + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + ScriptEvents = <> + DoSubmitValidation = True + Style = stNormal + TabOrder = 11 + Checked = False + FriendlyName = 'cbFailover' + end + object cbPooling: TIWCheckBox + Tag = 12 + Left = 8 + Top = 62 + Width = 121 + Height = 21 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Caption = 'Pooling' + Editable = True + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + ScriptEvents = <> + DoSubmitValidation = True + Style = stNormal + TabOrder = 12 + Checked = False + FriendlyName = 'cbPooling' + end + object edConnectionLifeTime: TIWEdit + Tag = 13 + Left = 157 + Top = 88 + Width = 101 + Height = 21 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Alignment = taLeftJustify + BGColor = clNone + FocusColor = clNone + DoSubmitValidation = True + Editable = True + NonEditableAsLabel = True + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + FriendlyName = 'edConnectionLifeTime' + MaxLength = 0 + ReadOnly = False + Required = False + ScriptEvents = <> + TabOrder = 13 + PasswordPrompt = False + Text = 'edConnectionLifeTime' + end + object IWLabel4: TIWLabel + Left = 26 + Top = 90 + Width = 140 + Height = 16 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Alignment = taLeftJustify + BGColor = clNone + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + NoWrap = False + FriendlyName = 'IWLabel4' + Caption = 'ConnectionLifeTime' + RawText = False + end + object edMaxPoolSize: TIWEdit + Tag = 14 + Left = 157 + Top = 115 + Width = 101 + Height = 21 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Alignment = taLeftJustify + BGColor = clNone + FocusColor = clNone + DoSubmitValidation = True + Editable = True + NonEditableAsLabel = True + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + FriendlyName = 'edMaxPoolSize' + MaxLength = 0 + ReadOnly = False + Required = False + ScriptEvents = <> + TabOrder = 14 + PasswordPrompt = False + Text = 'edMaxPoolSize' + end + object edMinPoolSize: TIWEdit + Tag = 15 + Left = 157 + Top = 142 + Width = 101 + Height = 21 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Alignment = taLeftJustify + BGColor = clNone + FocusColor = clNone + DoSubmitValidation = True + Editable = True + NonEditableAsLabel = True + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + FriendlyName = 'edMinPoolSize' + MaxLength = 0 + ReadOnly = False + Required = False + ScriptEvents = <> + TabOrder = 15 + PasswordPrompt = False + Text = 'edMinPoolSize' + end + object IWLabel6: TIWLabel + Left = 26 + Top = 117 + Width = 88 + Height = 16 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Alignment = taLeftJustify + BGColor = clNone + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + NoWrap = False + FriendlyName = 'IWLabel6' + Caption = 'MaxPoolSize' + RawText = False + end + object IWLabel7: TIWLabel + Left = 26 + Top = 144 + Width = 83 + Height = 16 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Alignment = taLeftJustify + BGColor = clNone + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + NoWrap = False + FriendlyName = 'IWLabel7' + Caption = 'MinPoolSize' + RawText = False + end + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/uMain.pas b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/uMain.pas new file mode 100644 index 0000000..67513b1 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/uMain.pas @@ -0,0 +1,183 @@ +unit uMain; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + uData, uBase, uQuery, uCachedUpdates, uMasterDetail, + IWCompLabel, IWControl, IWCompRectangle, + DB, MemDS, DBAccess, MSAccess, MsConnectionPool, IWHTMLControls, IWCompButton, + IWGrids, IWDBGrids, IWDBStdCtrls, IWCompMemo, IWCompEdit, IWContainer, + IWRegion, IWCompCheckbox, IWCompListbox, IWVCLBaseContainer, IWHTMLContainer, + IWVCLBaseControl, IWBaseControl, IWBaseHTMLControl; + +type + TfmMain = class(TfmBase) + edUsername: TIWEdit; + edPassword: TIWEdit; + edServer: TIWEdit; + IWLabel1: TIWLabel; + IWLabel2: TIWLabel; + IWLabel3: TIWLabel; + IWRegion4: TIWRegion; + IWRectangle3: TIWRectangle; + cbFailover: TIWCheckBox; + cbDisconnectedMode: TIWCheckBox; + cbPooling: TIWCheckBox; + IWRegion1: TIWRegion; + IWRectangle1: TIWRectangle; + edConnectionLifeTime: TIWEdit; + IWLabel4: TIWLabel; + edMaxPoolSize: TIWEdit; + edMinPoolSize: TIWEdit; + IWLabel6: TIWLabel; + IWLabel7: TIWLabel; + IWLabel5: TIWLabel; + edDatabase: TIWEdit; + procedure IWAppFormCreate(Sender: TObject); + procedure IWAppFormRender(Sender: TObject); + protected + procedure ReadFromControls; override; + end; + +implementation +{$R *.dfm} + +uses + ServerController, IWForm; + +{ TfmMain } + +procedure TfmMain.IWAppFormCreate(Sender: TObject); +begin + inherited; + UserSession.fmMain := Self; +end; + +procedure TfmMain.IWAppFormRender(Sender: TObject); +begin + inherited; + edUsername.Text := UserSession.Username; + edPassword.Text := UserSession.Password; + edServer.Text := UserSession.Server; + edDatabase.Text := UserSession.Database; + cbPooling.Checked := UserSession.Pooling; + cbDisconnectedMode.Checked := UserSession.DisconnectedMode; + cbFailover.Checked := UserSession.FailOver; + + edConnectionLifeTime.Text := IntToStr(UserSession.PoolingOptions.ConnectionLifetime); + edMaxPoolSize.Text := IntToStr(UserSession.PoolingOptions.MaxPoolSize); + edMinpoolSize.Text := IntToStr(UserSession.PoolingOptions.MinPoolSize); +end; + +procedure TfmMain.ReadFromControls; +begin + inherited; + UserSession.Username := edUsername.Text; + UserSession.Password := edPassword.Text; + UserSession.Server := edServer.Text; + UserSession.Database := edDatabase.Text; + UserSession.Pooling := cbPooling.Checked; + UserSession.DisconnectedMode := cbDisconnectedMode.Checked; + UserSession.FailOver := cbFailover.Checked; + + try UserSession.PoolingOptions.ConnectionLifetime := StrToInt(edConnectionLifeTime.Text); except {Silent} end; + try UserSession.PoolingOptions.ConnectionLifetime := StrToInt(edConnectionLifeTime.Text); except {Silent} end; + try UserSession.PoolingOptions.MaxPoolSize := StrToInt(edMaxPoolSize.Text); except {Silent} end; + try UserSession.PoolingOptions.MinPoolSize := StrToInt(edMinPoolSize.Text); except {Silent} end; +end; + +initialization + TfmMain.SetAsMainForm; +end. + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + uData, uBase, uQuery, uCachedUpdates, uMasterDetail, + IWCompLabel, IWControl, IWCompRectangle, + DB, MemDS, DBAccess, MSAccess, MsConnectionPool, IWHTMLControls, IWCompButton, + IWGrids, IWDBGrids, IWDBStdCtrls, IWCompMemo, IWCompEdit, IWContainer, + IWRegion, IWCompCheckbox, IWCompListbox, IWVCLBaseContainer, IWHTMLContainer, + IWVCLBaseControl, IWBaseControl, IWBaseHTMLControl; + +type + TfmMain = class(TfmBase) + edUsername: TIWEdit; + edPassword: TIWEdit; + edServer: TIWEdit; + IWLabel1: TIWLabel; + IWLabel2: TIWLabel; + IWLabel3: TIWLabel; + IWRegion4: TIWRegion; + IWRectangle3: TIWRectangle; + cbFailover: TIWCheckBox; + cbDisconnectedMode: TIWCheckBox; + cbPooling: TIWCheckBox; + IWRegion1: TIWRegion; + IWRectangle1: TIWRectangle; + edConnectionLifeTime: TIWEdit; + IWLabel4: TIWLabel; + edMaxPoolSize: TIWEdit; + edMinPoolSize: TIWEdit; + IWLabel6: TIWLabel; + IWLabel7: TIWLabel; + IWLabel5: TIWLabel; + edDatabase: TIWEdit; + procedure IWAppFormCreate(Sender: TObject); + procedure IWAppFormRender(Sender: TObject); + protected + procedure ReadFromControls; override; + end; + +implementation +{$R *.dfm} + +uses + ServerController, IWForm; + +{ TfmMain } + +procedure TfmMain.IWAppFormCreate(Sender: TObject); +begin + inherited; + UserSession.fmMain := Self; +end; + +procedure TfmMain.IWAppFormRender(Sender: TObject); +begin + inherited; + edUsername.Text := UserSession.Username; + edPassword.Text := UserSession.Password; + edServer.Text := UserSession.Server; + edDatabase.Text := UserSession.Database; + cbPooling.Checked := UserSession.Pooling; + cbDisconnectedMode.Checked := UserSession.DisconnectedMode; + cbFailover.Checked := UserSession.FailOver; + + edConnectionLifeTime.Text := IntToStr(UserSession.PoolingOptions.ConnectionLifetime); + edMaxPoolSize.Text := IntToStr(UserSession.PoolingOptions.MaxPoolSize); + edMinpoolSize.Text := IntToStr(UserSession.PoolingOptions.MinPoolSize); +end; + +procedure TfmMain.ReadFromControls; +begin + inherited; + UserSession.Username := edUsername.Text; + UserSession.Password := edPassword.Text; + UserSession.Server := edServer.Text; + UserSession.Database := edDatabase.Text; + UserSession.Pooling := cbPooling.Checked; + UserSession.DisconnectedMode := cbDisconnectedMode.Checked; + UserSession.FailOver := cbFailover.Checked; + + try UserSession.PoolingOptions.ConnectionLifetime := StrToInt(edConnectionLifeTime.Text); except {Silent} end; + try UserSession.PoolingOptions.ConnectionLifetime := StrToInt(edConnectionLifeTime.Text); except {Silent} end; + try UserSession.PoolingOptions.MaxPoolSize := StrToInt(edMaxPoolSize.Text); except {Silent} end; + try UserSession.PoolingOptions.MinPoolSize := StrToInt(edMinPoolSize.Text); except {Silent} end; +end; + +initialization + TfmMain.SetAsMainForm; +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/uMasterDetail.dfm b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/uMasterDetail.dfm new file mode 100644 index 0000000..dc5ffc8 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/uMasterDetail.dfm @@ -0,0 +1,1263 @@ +inherited fmMasterDetail: TfmMasterDetail + Width = 605 + Height = 567 + OnCreate = IWAppFormCreate + DesignLeft = 8 + DesignTop = 8 + inherited IWRectangle: TIWRectangle + Width = 582 + end + inherited lbPageName: TIWLabel + Left = 495 + Width = 97 + Caption = 'Master/Detail' + end + object IWRegion1: TIWRegion [7] + Left = 16 + Top = 127 + Width = 577 + Height = 65 + Cursor = crAuto + TabOrder = 3 + Anchors = [akLeft, akTop, akRight] + BorderOptions.NumericWidth = 1 + BorderOptions.BorderWidth = cbwNumeric + BorderOptions.Style = cbsSolid + BorderOptions.Color = clNone + Color = clWebBLACK + ParentShowHint = False + ShowHint = True + ZIndex = 1000 + DesignSize = ( + 577 + 65) + object IWRectangle1: TIWRectangle + Left = 1 + Top = 1 + Width = 575 + Height = 63 + Cursor = crAuto + Anchors = [akLeft, akTop, akRight, akBottom] + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = -1 + RenderSize = True + Font.Color = clNone + Font.Size = 10 + Font.Style = [] + BorderOptions.Color = clNone + BorderOptions.Width = 0 + FriendlyName = 'IWRectangle1' + Color = 14811135 + Alignment = taLeftJustify + VAlign = vaMiddle + end + object btOpen: TIWButton + Left = 8 + Top = 33 + Width = 97 + Height = 25 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Caption = 'Open' + DoSubmitValidation = True + Color = clBtnFace + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + FriendlyName = 'btOpen' + ScriptEvents = <> + TabOrder = 8 + OnClick = btOpenClick + end + object cbLocalMasterDetail: TIWCheckBox + Left = 7 + Top = 10 + Width = 153 + Height = 21 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Caption = 'LocalMasterDetail' + Editable = True + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + ScriptEvents = <> + DoSubmitValidation = True + Style = stNormal + TabOrder = 6 + Checked = False + FriendlyName = 'cbLocalMasterDetail' + end + object btClose: TIWButton + Left = 113 + Top = 33 + Width = 95 + Height = 25 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Caption = 'Close' + DoSubmitValidation = True + Color = clBtnFace + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + FriendlyName = 'btClose' + ScriptEvents = <> + TabOrder = 9 + OnClick = btCloseClick + end + object cbCachedCalcFields: TIWCheckBox + Left = 167 + Top = 10 + Width = 151 + Height = 21 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Caption = 'CachedCalcFields' + Editable = True + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + ScriptEvents = <> + DoSubmitValidation = True + Style = stNormal + TabOrder = 7 + Checked = False + FriendlyName = 'cbCachedCalcFields' + end + object lbResult: TIWLabel + Left = 348 + Top = 10 + Width = 63 + Height = 16 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Alignment = taLeftJustify + BGColor = clNone + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + NoWrap = False + FriendlyName = 'lbResult' + Caption = 'lbResult' + RawText = False + end + end + object IWRegion2: TIWRegion [8] + Left = 16 + Top = 199 + Width = 577 + Height = 178 + Cursor = crAuto + TabOrder = 1 + Anchors = [akLeft, akTop, akRight] + BorderOptions.NumericWidth = 1 + BorderOptions.BorderWidth = cbwNumeric + BorderOptions.Style = cbsSolid + BorderOptions.Color = clNone + Color = clWebBLACK + ParentShowHint = False + ShowHint = True + ZIndex = 1000 + DesignSize = ( + 577 + 178) + object IWRectangle2: TIWRectangle + Left = 1 + Top = 1 + Width = 575 + Height = 176 + Cursor = crAuto + Anchors = [akLeft, akTop, akRight, akBottom] + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = -1 + RenderSize = True + Font.Color = clNone + Font.Size = 10 + Font.Style = [] + BorderOptions.Color = clNone + BorderOptions.Width = 0 + FriendlyName = 'IWRectangle2' + Color = 14811135 + Alignment = taLeftJustify + VAlign = vaMiddle + end + object IWDBNavigator1: TIWDBNavigator + Left = 8 + Top = 104 + Width = 135 + Height = 30 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Confirmations.Delete = 'Are you sure you want to delete this record?' + Confirmations.Post = 'Are you sure you want to update this record?' + Confirmations.Cancel = 'Are you sure you want to cancel your changes to this record?' + DataSource = dsMaster + FriendlyName = 'IWDBNavigator1' + ImageHeight = 21 + ImageWidth = 21 + VisibleButtons = [nbFirst, nbPrior, nbNext, nbLast, nbRefresh] + Orientation = orHorizontal + OnFirst = IWDBNavigator1Refresh + OnPrior = IWDBNavigator1Refresh + OnNext = IWDBNavigator1Refresh + OnLast = IWDBNavigator1Refresh + OnRefresh = IWDBNavigator1Refresh + end + object IWLabel1: TIWLabel + Left = 8 + Top = 6 + Width = 67 + Height = 18 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Alignment = taLeftJustify + BGColor = clNone + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 12 + Font.Style = [fsBold] + NoWrap = False + FriendlyName = 'IWLabel1' + Caption = 'Master' + RawText = False + end + object IWLabel2: TIWLabel + Left = 8 + Top = 33 + Width = 102 + Height = 16 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Alignment = taLeftJustify + BGColor = clNone + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + NoWrap = False + FriendlyName = 'IWLabel2' + Caption = 'MasterFields' + RawText = False + end + object edMasterFields: TIWEdit + Left = 8 + Top = 52 + Width = 121 + Height = 21 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Alignment = taLeftJustify + BGColor = clNone + FocusColor = clNone + DoSubmitValidation = True + Editable = True + NonEditableAsLabel = True + Font.Color = clNone + Font.Size = 10 + Font.Style = [] + FriendlyName = 'edMasterFields' + MaxLength = 0 + ReadOnly = False + Required = False + ScriptEvents = <> + TabOrder = 10 + PasswordPrompt = False + Text = 'edMasterFields' + end + object IWDBGrid1: TIWDBGrid + Left = 144 + Top = 80 + Width = 422 + Height = 89 + Cursor = crAuto + Anchors = [akLeft, akTop, akRight] + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + BorderColors.Color = clNone + BorderColors.Light = clNone + BorderColors.Dark = clNone + BGColor = clSkyBlue + BorderSize = 1 + BorderStyle = tfDefault + CellPadding = 0 + CellSpacing = 0 + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + FrameBuffer = 40 + Lines = tlAll + UseFrame = True + UseSize = True + ScrollToCurrentRow = False + Columns = <> + DataSource = dsMaster + FooterRowCount = 0 + FriendlyName = 'IWDBGrid1' + FromStart = True + HighlightColor = clNone + HighlightRows = True + Options = [dgIndicator, dgShowTitles] + RefreshMode = rmAutomatic + RowLimit = 0 + RollOver = False + RowClick = False + RollOverColor = clNone + RowHeaderColor = 12876667 + RowAlternateColor = clNone + RowCurrentColor = clMoneyGreen + TabOrder = 28 + end + object IWRegion4: TIWRegion + Left = 144 + Top = 8 + Width = 422 + Height = 65 + Cursor = crAuto + TabOrder = 0 + Anchors = [akLeft, akTop, akRight] + BorderOptions.NumericWidth = 1 + BorderOptions.BorderWidth = cbwNumeric + BorderOptions.Style = cbsSolid + BorderOptions.Color = clNone + Color = clNone + ParentShowHint = False + ShowHint = True + ZIndex = 1000 + object meMaster: TIWMemo + Left = 1 + Top = 1 + Width = 420 + Height = 63 + Cursor = crAuto + Align = alClient + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + BGColor = clNone + Editable = True + Font.Color = clNone + Font.Size = 10 + Font.Style = [] + ScriptEvents = <> + InvisibleBorder = False + HorizScrollBar = False + VertScrollBar = True + Required = False + TabOrder = 11 + FriendlyName = 'meMaster' + end + end + end + object IWRegion3: TIWRegion [9] + Left = 16 + Top = 382 + Width = 577 + Height = 174 + Cursor = crAuto + TabOrder = 2 + Anchors = [akLeft, akTop, akRight, akBottom] + BorderOptions.NumericWidth = 1 + BorderOptions.BorderWidth = cbwNumeric + BorderOptions.Style = cbsSolid + BorderOptions.Color = clNone + Color = clWebBLACK + ParentShowHint = False + ShowHint = True + ZIndex = 1000 + DesignSize = ( + 577 + 174) + object IWRectangle3: TIWRectangle + Left = 1 + Top = 1 + Width = 575 + Height = 172 + Cursor = crAuto + Anchors = [akLeft, akTop, akRight, akBottom] + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = -1 + RenderSize = True + Font.Color = clNone + Font.Size = 10 + Font.Style = [] + BorderOptions.Color = clNone + BorderOptions.Width = 0 + FriendlyName = 'IWRectangle3' + Color = 14811135 + Alignment = taLeftJustify + VAlign = vaMiddle + end + object IWLabel4: TIWLabel + Left = 8 + Top = 7 + Width = 55 + Height = 18 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Alignment = taLeftJustify + BGColor = clNone + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 12 + Font.Style = [fsBold] + NoWrap = False + FriendlyName = 'IWLabel4' + Caption = 'Detail' + RawText = False + end + object IWLabel3: TIWLabel + Left = 8 + Top = 33 + Width = 93 + Height = 16 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Alignment = taLeftJustify + BGColor = clNone + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + NoWrap = False + FriendlyName = 'IWLabel3' + Caption = 'DetailFields' + RawText = False + end + object edDetailFields: TIWEdit + Left = 8 + Top = 52 + Width = 121 + Height = 21 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Alignment = taLeftJustify + BGColor = clNone + FocusColor = clNone + DoSubmitValidation = True + Editable = True + NonEditableAsLabel = True + Font.Color = clNone + Font.Size = 10 + Font.Style = [] + FriendlyName = 'edDetailFields' + MaxLength = 0 + ReadOnly = False + Required = False + ScriptEvents = <> + TabOrder = 12 + PasswordPrompt = False + Text = 'edDetailFields' + end + object IWDBGrid2: TIWDBGrid + Left = 144 + Top = 81 + Width = 422 + Height = 85 + Cursor = crAuto + Anchors = [akLeft, akTop, akRight, akBottom] + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + BorderColors.Color = clNone + BorderColors.Light = clNone + BorderColors.Dark = clNone + BGColor = clSkyBlue + BorderSize = 1 + BorderStyle = tfDefault + CellPadding = 0 + CellSpacing = 0 + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + FrameBuffer = 40 + Lines = tlAll + UseFrame = True + UseSize = True + ScrollToCurrentRow = False + Columns = <> + DataSource = dsDetail + FooterRowCount = 0 + FriendlyName = 'IWDBGrid2' + FromStart = True + HighlightColor = clNone + HighlightRows = True + Options = [dgIndicator, dgShowTitles] + RefreshMode = rmAutomatic + RowLimit = 0 + RollOver = False + RowClick = False + RollOverColor = clNone + RowHeaderColor = 12876667 + RowAlternateColor = clNone + RowCurrentColor = clMoneyGreen + TabOrder = 29 + end + object IWRegion5: TIWRegion + Left = 144 + Top = 8 + Width = 422 + Height = 65 + Cursor = crAuto + TabOrder = 0 + Anchors = [akLeft, akTop, akRight] + BorderOptions.NumericWidth = 1 + BorderOptions.BorderWidth = cbwNumeric + BorderOptions.Style = cbsSolid + BorderOptions.Color = clNone + Color = clNone + ParentShowHint = False + ShowHint = True + ZIndex = 1000 + object meDetail: TIWMemo + Left = 1 + Top = 1 + Width = 420 + Height = 63 + Cursor = crAuto + Align = alClient + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + BGColor = clNone + Editable = True + Font.Color = clNone + Font.Size = 10 + Font.Style = [] + ScriptEvents = <> + InvisibleBorder = False + HorizScrollBar = False + VertScrollBar = True + Required = False + TabOrder = 13 + FriendlyName = 'meDetail' + end + end + end + inherited rgConnection: TIWRegion + Width = 577 + inherited IWRectangle4: TIWRectangle + Width = 575 + end + end + object quMaster: TMSQuery + Left = 192 + Top = 239 + end + object quDetail: TMSQuery + MasterSource = dsMaster + Left = 128 + Top = 407 + end + object dsMaster: TDataSource + DataSet = quMaster + Left = 224 + Top = 239 + end + object dsDetail: TDataSource + DataSet = quDetail + Left = 160 + Top = 407 + end +end + Width = 605 + Height = 567 + OnCreate = IWAppFormCreate + DesignLeft = 8 + DesignTop = 8 + inherited IWRectangle: TIWRectangle + Width = 582 + end + inherited lbPageName: TIWLabel + Left = 495 + Width = 97 + Caption = 'Master/Detail' + end + object IWRegion1: TIWRegion [7] + Left = 16 + Top = 127 + Width = 577 + Height = 65 + Cursor = crAuto + TabOrder = 3 + Anchors = [akLeft, akTop, akRight] + BorderOptions.NumericWidth = 1 + BorderOptions.BorderWidth = cbwNumeric + BorderOptions.Style = cbsSolid + BorderOptions.Color = clNone + Color = clWebBLACK + ParentShowHint = False + ShowHint = True + ZIndex = 1000 + DesignSize = ( + 577 + 65) + object IWRectangle1: TIWRectangle + Left = 1 + Top = 1 + Width = 575 + Height = 63 + Cursor = crAuto + Anchors = [akLeft, akTop, akRight, akBottom] + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = -1 + RenderSize = True + Font.Color = clNone + Font.Size = 10 + Font.Style = [] + BorderOptions.Color = clNone + BorderOptions.Width = 0 + FriendlyName = 'IWRectangle1' + Color = 14811135 + Alignment = taLeftJustify + VAlign = vaMiddle + end + object btOpen: TIWButton + Left = 8 + Top = 33 + Width = 97 + Height = 25 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Caption = 'Open' + DoSubmitValidation = True + Color = clBtnFace + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + FriendlyName = 'btOpen' + ScriptEvents = <> + TabOrder = 8 + OnClick = btOpenClick + end + object cbLocalMasterDetail: TIWCheckBox + Left = 7 + Top = 10 + Width = 153 + Height = 21 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Caption = 'LocalMasterDetail' + Editable = True + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + ScriptEvents = <> + DoSubmitValidation = True + Style = stNormal + TabOrder = 6 + Checked = False + FriendlyName = 'cbLocalMasterDetail' + end + object btClose: TIWButton + Left = 113 + Top = 33 + Width = 95 + Height = 25 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Caption = 'Close' + DoSubmitValidation = True + Color = clBtnFace + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + FriendlyName = 'btClose' + ScriptEvents = <> + TabOrder = 9 + OnClick = btCloseClick + end + object cbCachedCalcFields: TIWCheckBox + Left = 167 + Top = 10 + Width = 151 + Height = 21 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Caption = 'CachedCalcFields' + Editable = True + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + ScriptEvents = <> + DoSubmitValidation = True + Style = stNormal + TabOrder = 7 + Checked = False + FriendlyName = 'cbCachedCalcFields' + end + object lbResult: TIWLabel + Left = 348 + Top = 10 + Width = 63 + Height = 16 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Alignment = taLeftJustify + BGColor = clNone + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + NoWrap = False + FriendlyName = 'lbResult' + Caption = 'lbResult' + RawText = False + end + end + object IWRegion2: TIWRegion [8] + Left = 16 + Top = 199 + Width = 577 + Height = 178 + Cursor = crAuto + TabOrder = 1 + Anchors = [akLeft, akTop, akRight] + BorderOptions.NumericWidth = 1 + BorderOptions.BorderWidth = cbwNumeric + BorderOptions.Style = cbsSolid + BorderOptions.Color = clNone + Color = clWebBLACK + ParentShowHint = False + ShowHint = True + ZIndex = 1000 + DesignSize = ( + 577 + 178) + object IWRectangle2: TIWRectangle + Left = 1 + Top = 1 + Width = 575 + Height = 176 + Cursor = crAuto + Anchors = [akLeft, akTop, akRight, akBottom] + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = -1 + RenderSize = True + Font.Color = clNone + Font.Size = 10 + Font.Style = [] + BorderOptions.Color = clNone + BorderOptions.Width = 0 + FriendlyName = 'IWRectangle2' + Color = 14811135 + Alignment = taLeftJustify + VAlign = vaMiddle + end + object IWDBNavigator1: TIWDBNavigator + Left = 8 + Top = 104 + Width = 135 + Height = 30 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Confirmations.Delete = 'Are you sure you want to delete this record?' + Confirmations.Post = 'Are you sure you want to update this record?' + Confirmations.Cancel = 'Are you sure you want to cancel your changes to this record?' + DataSource = dsMaster + FriendlyName = 'IWDBNavigator1' + ImageHeight = 21 + ImageWidth = 21 + VisibleButtons = [nbFirst, nbPrior, nbNext, nbLast, nbRefresh] + Orientation = orHorizontal + OnFirst = IWDBNavigator1Refresh + OnPrior = IWDBNavigator1Refresh + OnNext = IWDBNavigator1Refresh + OnLast = IWDBNavigator1Refresh + OnRefresh = IWDBNavigator1Refresh + end + object IWLabel1: TIWLabel + Left = 8 + Top = 6 + Width = 67 + Height = 18 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Alignment = taLeftJustify + BGColor = clNone + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 12 + Font.Style = [fsBold] + NoWrap = False + FriendlyName = 'IWLabel1' + Caption = 'Master' + RawText = False + end + object IWLabel2: TIWLabel + Left = 8 + Top = 33 + Width = 102 + Height = 16 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Alignment = taLeftJustify + BGColor = clNone + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + NoWrap = False + FriendlyName = 'IWLabel2' + Caption = 'MasterFields' + RawText = False + end + object edMasterFields: TIWEdit + Left = 8 + Top = 52 + Width = 121 + Height = 21 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Alignment = taLeftJustify + BGColor = clNone + FocusColor = clNone + DoSubmitValidation = True + Editable = True + NonEditableAsLabel = True + Font.Color = clNone + Font.Size = 10 + Font.Style = [] + FriendlyName = 'edMasterFields' + MaxLength = 0 + ReadOnly = False + Required = False + ScriptEvents = <> + TabOrder = 10 + PasswordPrompt = False + Text = 'edMasterFields' + end + object IWDBGrid1: TIWDBGrid + Left = 144 + Top = 80 + Width = 422 + Height = 89 + Cursor = crAuto + Anchors = [akLeft, akTop, akRight] + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + BorderColors.Color = clNone + BorderColors.Light = clNone + BorderColors.Dark = clNone + BGColor = clSkyBlue + BorderSize = 1 + BorderStyle = tfDefault + CellPadding = 0 + CellSpacing = 0 + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + FrameBuffer = 40 + Lines = tlAll + UseFrame = True + UseSize = True + ScrollToCurrentRow = False + Columns = <> + DataSource = dsMaster + FooterRowCount = 0 + FriendlyName = 'IWDBGrid1' + FromStart = True + HighlightColor = clNone + HighlightRows = True + Options = [dgIndicator, dgShowTitles] + RefreshMode = rmAutomatic + RowLimit = 0 + RollOver = False + RowClick = False + RollOverColor = clNone + RowHeaderColor = 12876667 + RowAlternateColor = clNone + RowCurrentColor = clMoneyGreen + TabOrder = 28 + end + object IWRegion4: TIWRegion + Left = 144 + Top = 8 + Width = 422 + Height = 65 + Cursor = crAuto + TabOrder = 0 + Anchors = [akLeft, akTop, akRight] + BorderOptions.NumericWidth = 1 + BorderOptions.BorderWidth = cbwNumeric + BorderOptions.Style = cbsSolid + BorderOptions.Color = clNone + Color = clNone + ParentShowHint = False + ShowHint = True + ZIndex = 1000 + object meMaster: TIWMemo + Left = 1 + Top = 1 + Width = 420 + Height = 63 + Cursor = crAuto + Align = alClient + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + BGColor = clNone + Editable = True + Font.Color = clNone + Font.Size = 10 + Font.Style = [] + ScriptEvents = <> + InvisibleBorder = False + HorizScrollBar = False + VertScrollBar = True + Required = False + TabOrder = 11 + FriendlyName = 'meMaster' + end + end + end + object IWRegion3: TIWRegion [9] + Left = 16 + Top = 382 + Width = 577 + Height = 174 + Cursor = crAuto + TabOrder = 2 + Anchors = [akLeft, akTop, akRight, akBottom] + BorderOptions.NumericWidth = 1 + BorderOptions.BorderWidth = cbwNumeric + BorderOptions.Style = cbsSolid + BorderOptions.Color = clNone + Color = clWebBLACK + ParentShowHint = False + ShowHint = True + ZIndex = 1000 + DesignSize = ( + 577 + 174) + object IWRectangle3: TIWRectangle + Left = 1 + Top = 1 + Width = 575 + Height = 172 + Cursor = crAuto + Anchors = [akLeft, akTop, akRight, akBottom] + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = -1 + RenderSize = True + Font.Color = clNone + Font.Size = 10 + Font.Style = [] + BorderOptions.Color = clNone + BorderOptions.Width = 0 + FriendlyName = 'IWRectangle3' + Color = 14811135 + Alignment = taLeftJustify + VAlign = vaMiddle + end + object IWLabel4: TIWLabel + Left = 8 + Top = 7 + Width = 55 + Height = 18 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Alignment = taLeftJustify + BGColor = clNone + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 12 + Font.Style = [fsBold] + NoWrap = False + FriendlyName = 'IWLabel4' + Caption = 'Detail' + RawText = False + end + object IWLabel3: TIWLabel + Left = 8 + Top = 33 + Width = 93 + Height = 16 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Alignment = taLeftJustify + BGColor = clNone + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + NoWrap = False + FriendlyName = 'IWLabel3' + Caption = 'DetailFields' + RawText = False + end + object edDetailFields: TIWEdit + Left = 8 + Top = 52 + Width = 121 + Height = 21 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Alignment = taLeftJustify + BGColor = clNone + FocusColor = clNone + DoSubmitValidation = True + Editable = True + NonEditableAsLabel = True + Font.Color = clNone + Font.Size = 10 + Font.Style = [] + FriendlyName = 'edDetailFields' + MaxLength = 0 + ReadOnly = False + Required = False + ScriptEvents = <> + TabOrder = 12 + PasswordPrompt = False + Text = 'edDetailFields' + end + object IWDBGrid2: TIWDBGrid + Left = 144 + Top = 81 + Width = 422 + Height = 85 + Cursor = crAuto + Anchors = [akLeft, akTop, akRight, akBottom] + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + BorderColors.Color = clNone + BorderColors.Light = clNone + BorderColors.Dark = clNone + BGColor = clSkyBlue + BorderSize = 1 + BorderStyle = tfDefault + CellPadding = 0 + CellSpacing = 0 + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + FrameBuffer = 40 + Lines = tlAll + UseFrame = True + UseSize = True + ScrollToCurrentRow = False + Columns = <> + DataSource = dsDetail + FooterRowCount = 0 + FriendlyName = 'IWDBGrid2' + FromStart = True + HighlightColor = clNone + HighlightRows = True + Options = [dgIndicator, dgShowTitles] + RefreshMode = rmAutomatic + RowLimit = 0 + RollOver = False + RowClick = False + RollOverColor = clNone + RowHeaderColor = 12876667 + RowAlternateColor = clNone + RowCurrentColor = clMoneyGreen + TabOrder = 29 + end + object IWRegion5: TIWRegion + Left = 144 + Top = 8 + Width = 422 + Height = 65 + Cursor = crAuto + TabOrder = 0 + Anchors = [akLeft, akTop, akRight] + BorderOptions.NumericWidth = 1 + BorderOptions.BorderWidth = cbwNumeric + BorderOptions.Style = cbsSolid + BorderOptions.Color = clNone + Color = clNone + ParentShowHint = False + ShowHint = True + ZIndex = 1000 + object meDetail: TIWMemo + Left = 1 + Top = 1 + Width = 420 + Height = 63 + Cursor = crAuto + Align = alClient + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + BGColor = clNone + Editable = True + Font.Color = clNone + Font.Size = 10 + Font.Style = [] + ScriptEvents = <> + InvisibleBorder = False + HorizScrollBar = False + VertScrollBar = True + Required = False + TabOrder = 13 + FriendlyName = 'meDetail' + end + end + end + inherited rgConnection: TIWRegion + Width = 577 + inherited IWRectangle4: TIWRectangle + Width = 575 + end + end + object quMaster: TMSQuery + Left = 192 + Top = 239 + end + object quDetail: TMSQuery + MasterSource = dsMaster + Left = 128 + Top = 407 + end + object dsMaster: TDataSource + DataSet = quMaster + Left = 224 + Top = 239 + end + object dsDetail: TDataSource + DataSet = quDetail + Left = 160 + Top = 407 + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/uMasterDetail.pas b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/uMasterDetail.pas new file mode 100644 index 0000000..f8eaecf --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/uMasterDetail.pas @@ -0,0 +1,255 @@ +unit uMasterDetail; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, uBase, IWHTMLControls, IWCompLabel, IWControl, IWCompRectangle, + IWCompCheckbox, IWCompEdit, IWCompMemo, IWGrids, IWDBGrids, DB, MemDS, + DBAccess, MSAccess, IWDBStdCtrls, IWCompButton, IWContainer, IWRegion, + IWVCLBaseContainer, IWHTMLContainer, IWVCLBaseControl, IWBaseControl, + IWBaseHTMLControl; + +type + TfmMasterDetail = class(TfmBase) + cbLocalMasterDetail: TIWCheckBox; + IWLabel1: TIWLabel; + IWLabel2: TIWLabel; + edMasterFields: TIWEdit; + IWDBGrid1: TIWDBGrid; + IWDBGrid2: TIWDBGrid; + IWLabel3: TIWLabel; + IWLabel4: TIWLabel; + edDetailFields: TIWEdit; + IWDBNavigator1: TIWDBNavigator; + quMaster: TMSQuery; + quDetail: TMSQuery; + dsMaster: TDataSource; + dsDetail: TDataSource; + cbCachedCalcFields: TIWCheckBox; + btOpen: TIWButton; + btClose: TIWButton; + IWRegion1: TIWRegion; + IWRegion2: TIWRegion; + IWRegion3: TIWRegion; + IWRectangle1: TIWRectangle; + IWRectangle2: TIWRectangle; + IWRectangle3: TIWRectangle; + lbResult: TIWLabel; + IWRegion4: TIWRegion; + meMaster: TIWMemo; + IWRegion5: TIWRegion; + meDetail: TIWMemo; + procedure IWAppFormCreate(Sender: TObject); + procedure btOpenClick(Sender: TObject); + procedure IWAppFormRender(Sender: TObject); + procedure btCloseClick(Sender: TObject); + procedure IWDBNavigator1Refresh(Sender: TObject); + protected + procedure ReadFromControls; override; + end; + +implementation + +{$R *.dfm} + +uses + ServerController, StdConvs; + +procedure TfmMasterDetail.IWAppFormCreate(Sender: TObject); +begin + inherited; + quMaster.Connection := DM.Connection; + quDetail.Connection := DM.Connection; +end; + +procedure TfmMasterDetail.btOpenClick(Sender: TObject); +begin + ReadFromControls; + UserSession.IsGoodMasterDetail := False; + try + quMaster.SQL.Text := UserSession.MasterSQL; + quDetail.SQL.Text := UserSession.DetailSQL; + quDetail.MasterFields := UserSession.MasterFields; + quDetail.DetailFields := UserSession.DetailFields; + quMaster.Options.LocalMasterDetail := UserSession.LocalMasterDetail; + quDetail.Options.LocalMasterDetail := UserSession.LocalMasterDetail; + quMaster.Options.CacheCalcFields := UserSession.CacheCalcFields; + quDetail.Options.CacheCalcFields := UserSession.CacheCalcFields; + quMaster.Open; + quDetail.Open; + UserSession.IsGoodMasterDetail := True; + UserSession.MasterDetailResult := 'Tables are opened'; + except + on E:Exception do + UserSession.MasterDetailResult := 'Error: '+ E.Message; + end; +end; + +procedure TfmMasterDetail.btCloseClick(Sender: TObject); +begin + ReadFromControls; + quMaster.Close; + quDetail.Close; +end; + +procedure TfmMasterDetail.IWAppFormRender(Sender: TObject); +begin + inherited; + cbLocalMasterDetail.Checked := UserSession.LocalMasterDetail; + cbCachedCalcFields.Checked := UserSession.CacheCalcFields; + edMasterFields.Text := UserSession.MasterFields; + edDetailFields.Text := UserSession.DetailFields; + meMaster.Lines.Text := UserSession.MasterSQL; + meDetail.Lines.Text := UserSession.DetailSQL; + IWDBGrid1.Visible := quMaster.Active; + IWDBNavigator1.Enabled := quMaster.Active; + IWDBGrid2.Visible := quDetail.Active; + lbResult.Font.Color := ResultColors[UserSession.IsGoodMasterDetail]; + lbResult.Caption := UserSession.MasterDetailResult; +end; + +procedure TfmMasterDetail.ReadFromControls; +begin + inherited; + UserSession.LocalMasterDetail := cbLocalMasterDetail.Checked; + UserSession.CacheCalcFields := cbCachedCalcFields.Checked; + UserSession.MasterFields := edMasterFields.Text; + UserSession.DetailFields := edDetailFields.Text; + UserSession.MasterSQL := meMaster.Lines.Text; + UserSession.DetailSQL := meDetail.Lines.Text; +end; + +procedure TfmMasterDetail.IWDBNavigator1Refresh(Sender: TObject); +begin + ReadFromControls; +end; + +end. + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, uBase, IWHTMLControls, IWCompLabel, IWControl, IWCompRectangle, + IWCompCheckbox, IWCompEdit, IWCompMemo, IWGrids, IWDBGrids, DB, MemDS, + DBAccess, MSAccess, IWDBStdCtrls, IWCompButton, IWContainer, IWRegion, + IWVCLBaseContainer, IWHTMLContainer, IWVCLBaseControl, IWBaseControl, + IWBaseHTMLControl; + +type + TfmMasterDetail = class(TfmBase) + cbLocalMasterDetail: TIWCheckBox; + IWLabel1: TIWLabel; + IWLabel2: TIWLabel; + edMasterFields: TIWEdit; + IWDBGrid1: TIWDBGrid; + IWDBGrid2: TIWDBGrid; + IWLabel3: TIWLabel; + IWLabel4: TIWLabel; + edDetailFields: TIWEdit; + IWDBNavigator1: TIWDBNavigator; + quMaster: TMSQuery; + quDetail: TMSQuery; + dsMaster: TDataSource; + dsDetail: TDataSource; + cbCachedCalcFields: TIWCheckBox; + btOpen: TIWButton; + btClose: TIWButton; + IWRegion1: TIWRegion; + IWRegion2: TIWRegion; + IWRegion3: TIWRegion; + IWRectangle1: TIWRectangle; + IWRectangle2: TIWRectangle; + IWRectangle3: TIWRectangle; + lbResult: TIWLabel; + IWRegion4: TIWRegion; + meMaster: TIWMemo; + IWRegion5: TIWRegion; + meDetail: TIWMemo; + procedure IWAppFormCreate(Sender: TObject); + procedure btOpenClick(Sender: TObject); + procedure IWAppFormRender(Sender: TObject); + procedure btCloseClick(Sender: TObject); + procedure IWDBNavigator1Refresh(Sender: TObject); + protected + procedure ReadFromControls; override; + end; + +implementation + +{$R *.dfm} + +uses + ServerController, StdConvs; + +procedure TfmMasterDetail.IWAppFormCreate(Sender: TObject); +begin + inherited; + quMaster.Connection := DM.Connection; + quDetail.Connection := DM.Connection; +end; + +procedure TfmMasterDetail.btOpenClick(Sender: TObject); +begin + ReadFromControls; + UserSession.IsGoodMasterDetail := False; + try + quMaster.SQL.Text := UserSession.MasterSQL; + quDetail.SQL.Text := UserSession.DetailSQL; + quDetail.MasterFields := UserSession.MasterFields; + quDetail.DetailFields := UserSession.DetailFields; + quMaster.Options.LocalMasterDetail := UserSession.LocalMasterDetail; + quDetail.Options.LocalMasterDetail := UserSession.LocalMasterDetail; + quMaster.Options.CacheCalcFields := UserSession.CacheCalcFields; + quDetail.Options.CacheCalcFields := UserSession.CacheCalcFields; + quMaster.Open; + quDetail.Open; + UserSession.IsGoodMasterDetail := True; + UserSession.MasterDetailResult := 'Tables are opened'; + except + on E:Exception do + UserSession.MasterDetailResult := 'Error: '+ E.Message; + end; +end; + +procedure TfmMasterDetail.btCloseClick(Sender: TObject); +begin + ReadFromControls; + quMaster.Close; + quDetail.Close; +end; + +procedure TfmMasterDetail.IWAppFormRender(Sender: TObject); +begin + inherited; + cbLocalMasterDetail.Checked := UserSession.LocalMasterDetail; + cbCachedCalcFields.Checked := UserSession.CacheCalcFields; + edMasterFields.Text := UserSession.MasterFields; + edDetailFields.Text := UserSession.DetailFields; + meMaster.Lines.Text := UserSession.MasterSQL; + meDetail.Lines.Text := UserSession.DetailSQL; + IWDBGrid1.Visible := quMaster.Active; + IWDBNavigator1.Enabled := quMaster.Active; + IWDBGrid2.Visible := quDetail.Active; + lbResult.Font.Color := ResultColors[UserSession.IsGoodMasterDetail]; + lbResult.Caption := UserSession.MasterDetailResult; +end; + +procedure TfmMasterDetail.ReadFromControls; +begin + inherited; + UserSession.LocalMasterDetail := cbLocalMasterDetail.Checked; + UserSession.CacheCalcFields := cbCachedCalcFields.Checked; + UserSession.MasterFields := edMasterFields.Text; + UserSession.DetailFields := edDetailFields.Text; + UserSession.MasterSQL := meMaster.Lines.Text; + UserSession.DetailSQL := meDetail.Lines.Text; +end; + +procedure TfmMasterDetail.IWDBNavigator1Refresh(Sender: TObject); +begin + ReadFromControls; +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/uQuery.dfm b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/uQuery.dfm new file mode 100644 index 0000000..8a52d4c --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/uQuery.dfm @@ -0,0 +1,809 @@ +inherited fmQuery: TfmQuery + Width = 677 + Height = 416 + OnCreate = IWAppFormCreate + DesignSize = ( + 677 + 416) + DesignLeft = 8 + DesignTop = 8 + inherited IWRectangle: TIWRectangle + Width = 656 + end + inherited lbPageName: TIWLabel + Left = 619 + Width = 44 + Caption = 'Query' + end + inherited lnkQuery: TIWLink + TabOrder = 3 + end + inherited lnkCachedUpdates: TIWLink + TabOrder = 5 + end + inherited lnkMasterDetail: TIWLink + TabOrder = 7 + end + object IWRegion1: TIWRegion [7] + Left = 16 + Top = 184 + Width = 654 + Height = 65 + Cursor = crAuto + TabOrder = 0 + Anchors = [akLeft, akTop, akRight] + BorderOptions.NumericWidth = 1 + BorderOptions.BorderWidth = cbwNumeric + BorderOptions.Style = cbsSolid + BorderOptions.Color = clNone + Color = clWebBLACK + ParentShowHint = False + ShowHint = True + ZIndex = 1000 + DesignSize = ( + 654 + 65) + object IWRectangle1: TIWRectangle + Left = 1 + Top = 1 + Width = 652 + Height = 63 + Cursor = crAuto + Anchors = [akLeft, akTop, akRight, akBottom] + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = -1 + RenderSize = True + Font.Color = clNone + Font.Size = 10 + Font.Style = [] + BorderOptions.Color = clNone + BorderOptions.Width = 0 + FriendlyName = 'IWRectangle1' + Color = 14811135 + Alignment = taLeftJustify + VAlign = vaMiddle + end + object IWLabel1: TIWLabel + Left = 7 + Top = 7 + Width = 38 + Height = 18 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Alignment = taLeftJustify + BGColor = clNone + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 12 + Font.Style = [fsBold] + NoWrap = False + FriendlyName = 'IWLabel1' + Caption = 'SQL' + RawText = False + end + object IWRegion3: TIWRegion + Left = 56 + Top = 8 + Width = 589 + Height = 49 + Cursor = crAuto + TabOrder = 0 + Anchors = [akLeft, akTop, akRight] + BorderOptions.NumericWidth = 1 + BorderOptions.BorderWidth = cbwNumeric + BorderOptions.Style = cbsSolid + BorderOptions.Color = clNone + Color = clNone + ParentShowHint = False + ShowHint = True + ZIndex = 1000 + object meSQL: TIWMemo + Left = 1 + Top = 1 + Width = 587 + Height = 47 + Cursor = crAuto + Align = alClient + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + BGColor = clNone + Editable = True + Font.Color = clNone + Font.Size = 10 + Font.Style = [] + ScriptEvents = <> + InvisibleBorder = False + HorizScrollBar = False + VertScrollBar = True + Required = False + TabOrder = 11 + FriendlyName = 'meSQL' + end + end + end + object IWRegion2: TIWRegion [8] + Left = 16 + Top = 256 + Width = 654 + Height = 141 + Cursor = crAuto + TabOrder = 1 + Anchors = [akLeft, akTop, akRight, akBottom] + BorderOptions.NumericWidth = 1 + BorderOptions.BorderWidth = cbwNumeric + BorderOptions.Style = cbsSolid + BorderOptions.Color = clNone + Color = clWebBLACK + ParentShowHint = False + ShowHint = True + ZIndex = 1000 + DesignSize = ( + 654 + 141) + object IWRectangle2: TIWRectangle + Left = 1 + Top = 1 + Width = 652 + Height = 139 + Cursor = crAuto + Anchors = [akLeft, akTop, akRight, akBottom] + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = -1 + RenderSize = True + Font.Color = clNone + Font.Size = 10 + Font.Style = [] + BorderOptions.Color = clNone + BorderOptions.Width = 0 + FriendlyName = 'IWRectangle2' + Color = 14811135 + Alignment = taLeftJustify + VAlign = vaMiddle + end + object IWDBNavigator: TIWDBNavigator + Left = 6 + Top = 29 + Width = 135 + Height = 30 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Confirmations.Delete = 'Are you sure you want to delete this record?' + Confirmations.Post = 'Are you sure you want to update this record?' + Confirmations.Cancel = 'Are you sure you want to cancel your changes to this record?' + DataSource = DataSource + FriendlyName = 'IWDBNavigator' + ImageHeight = 21 + ImageWidth = 21 + VisibleButtons = [nbFirst, nbPrior, nbNext, nbLast, nbRefresh] + Orientation = orHorizontal + OnFirst = IWDBNavigatorRefresh + OnPrior = IWDBNavigatorRefresh + OnNext = IWDBNavigatorRefresh + OnLast = IWDBNavigatorRefresh + OnRefresh = IWDBNavigatorRefresh + end + object IWLabel2: TIWLabel + Left = 7 + Top = 7 + Width = 46 + Height = 18 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Alignment = taLeftJustify + BGColor = clNone + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 12 + Font.Style = [fsBold] + NoWrap = False + FriendlyName = 'IWLabel2' + Caption = 'Data' + RawText = False + end + object IWDBGrid: TIWDBGrid + Left = 144 + Top = 28 + Width = 502 + Height = 105 + Cursor = crAuto + Anchors = [akLeft, akTop, akRight, akBottom] + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + BorderColors.Color = clNone + BorderColors.Light = clNone + BorderColors.Dark = clNone + BGColor = clSkyBlue + BorderSize = 1 + BorderStyle = tfDefault + CellPadding = 0 + CellSpacing = 0 + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + FrameBuffer = 40 + Lines = tlAll + UseFrame = True + UseSize = True + ScrollToCurrentRow = False + Columns = <> + DataSource = DataSource + FooterRowCount = 0 + FriendlyName = 'IWDBGrid' + FromStart = True + HighlightColor = clNone + HighlightRows = False + Options = [dgShowTitles] + RefreshMode = rmAutomatic + RowLimit = 0 + RollOver = False + RowClick = False + RollOverColor = clNone + RowHeaderColor = 12876667 + RowAlternateColor = clNone + RowCurrentColor = clMoneyGreen + TabOrder = 21 + end + object lbResult: TIWLabel + Left = 144 + Top = 7 + Width = 63 + Height = 16 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Alignment = taLeftJustify + BGColor = clNone + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + NoWrap = False + FriendlyName = 'lbResult' + Caption = 'lbResult' + RawText = False + end + end + object IWRegion4: TIWRegion [9] + Left = 16 + Top = 128 + Width = 653 + Height = 46 + Cursor = crAuto + TabOrder = 2 + Anchors = [akLeft, akTop, akRight] + BorderOptions.NumericWidth = 1 + BorderOptions.BorderWidth = cbwNumeric + BorderOptions.Style = cbsSolid + BorderOptions.Color = clNone + Color = clWebBLACK + ParentShowHint = False + ShowHint = True + ZIndex = 1000 + DesignSize = ( + 653 + 46) + object IWRectangle3: TIWRectangle + Left = 1 + Top = 1 + Width = 651 + Height = 44 + Cursor = crAuto + Anchors = [akLeft, akTop, akRight, akBottom] + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = -1 + RenderSize = True + Font.Color = clNone + Font.Size = 10 + Font.Style = [] + BorderOptions.Color = clNone + BorderOptions.Width = 0 + FriendlyName = 'IWRectangle3' + Color = 14811135 + Alignment = taLeftJustify + VAlign = vaMiddle + end + object btOpen: TIWButton + Left = 11 + Top = 11 + Width = 94 + Height = 25 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Caption = 'Open' + DoSubmitValidation = True + Color = clBtnFace + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + FriendlyName = 'btOpen' + ScriptEvents = <> + TabOrder = 6 + OnClick = btOpenClick + end + object btClose: TIWButton + Left = 112 + Top = 11 + Width = 97 + Height = 25 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Caption = 'Close' + DoSubmitValidation = True + Color = clBtnFace + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + FriendlyName = 'btClose' + ScriptEvents = <> + TabOrder = 8 + OnClick = btCloseClick + end + end + inherited rgConnection: TIWRegion + Width = 653 + TabOrder = 3 + DesignSize = ( + 653 + 42) + inherited IWRectangle4: TIWRectangle + Width = 651 + end + inherited btConnect: TIWButton + TabOrder = 10 + end + inherited btDisconnect: TIWButton + TabOrder = 12 + end + end + object Query: TMSQuery + Left = 328 + Top = 48 + end + object DataSource: TDataSource + DataSet = Query + Left = 424 + Top = 48 + end +end + Width = 677 + Height = 416 + OnCreate = IWAppFormCreate + DesignSize = ( + 677 + 416) + DesignLeft = 8 + DesignTop = 8 + inherited IWRectangle: TIWRectangle + Width = 656 + end + inherited lbPageName: TIWLabel + Left = 619 + Width = 44 + Caption = 'Query' + end + inherited lnkQuery: TIWLink + TabOrder = 3 + end + inherited lnkCachedUpdates: TIWLink + TabOrder = 5 + end + inherited lnkMasterDetail: TIWLink + TabOrder = 7 + end + object IWRegion1: TIWRegion [7] + Left = 16 + Top = 184 + Width = 654 + Height = 65 + Cursor = crAuto + TabOrder = 0 + Anchors = [akLeft, akTop, akRight] + BorderOptions.NumericWidth = 1 + BorderOptions.BorderWidth = cbwNumeric + BorderOptions.Style = cbsSolid + BorderOptions.Color = clNone + Color = clWebBLACK + ParentShowHint = False + ShowHint = True + ZIndex = 1000 + DesignSize = ( + 654 + 65) + object IWRectangle1: TIWRectangle + Left = 1 + Top = 1 + Width = 652 + Height = 63 + Cursor = crAuto + Anchors = [akLeft, akTop, akRight, akBottom] + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = -1 + RenderSize = True + Font.Color = clNone + Font.Size = 10 + Font.Style = [] + BorderOptions.Color = clNone + BorderOptions.Width = 0 + FriendlyName = 'IWRectangle1' + Color = 14811135 + Alignment = taLeftJustify + VAlign = vaMiddle + end + object IWLabel1: TIWLabel + Left = 7 + Top = 7 + Width = 38 + Height = 18 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Alignment = taLeftJustify + BGColor = clNone + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 12 + Font.Style = [fsBold] + NoWrap = False + FriendlyName = 'IWLabel1' + Caption = 'SQL' + RawText = False + end + object IWRegion3: TIWRegion + Left = 56 + Top = 8 + Width = 589 + Height = 49 + Cursor = crAuto + TabOrder = 0 + Anchors = [akLeft, akTop, akRight] + BorderOptions.NumericWidth = 1 + BorderOptions.BorderWidth = cbwNumeric + BorderOptions.Style = cbsSolid + BorderOptions.Color = clNone + Color = clNone + ParentShowHint = False + ShowHint = True + ZIndex = 1000 + object meSQL: TIWMemo + Left = 1 + Top = 1 + Width = 587 + Height = 47 + Cursor = crAuto + Align = alClient + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + BGColor = clNone + Editable = True + Font.Color = clNone + Font.Size = 10 + Font.Style = [] + ScriptEvents = <> + InvisibleBorder = False + HorizScrollBar = False + VertScrollBar = True + Required = False + TabOrder = 11 + FriendlyName = 'meSQL' + end + end + end + object IWRegion2: TIWRegion [8] + Left = 16 + Top = 256 + Width = 654 + Height = 141 + Cursor = crAuto + TabOrder = 1 + Anchors = [akLeft, akTop, akRight, akBottom] + BorderOptions.NumericWidth = 1 + BorderOptions.BorderWidth = cbwNumeric + BorderOptions.Style = cbsSolid + BorderOptions.Color = clNone + Color = clWebBLACK + ParentShowHint = False + ShowHint = True + ZIndex = 1000 + DesignSize = ( + 654 + 141) + object IWRectangle2: TIWRectangle + Left = 1 + Top = 1 + Width = 652 + Height = 139 + Cursor = crAuto + Anchors = [akLeft, akTop, akRight, akBottom] + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = -1 + RenderSize = True + Font.Color = clNone + Font.Size = 10 + Font.Style = [] + BorderOptions.Color = clNone + BorderOptions.Width = 0 + FriendlyName = 'IWRectangle2' + Color = 14811135 + Alignment = taLeftJustify + VAlign = vaMiddle + end + object IWDBNavigator: TIWDBNavigator + Left = 6 + Top = 29 + Width = 135 + Height = 30 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Confirmations.Delete = 'Are you sure you want to delete this record?' + Confirmations.Post = 'Are you sure you want to update this record?' + Confirmations.Cancel = 'Are you sure you want to cancel your changes to this record?' + DataSource = DataSource + FriendlyName = 'IWDBNavigator' + ImageHeight = 21 + ImageWidth = 21 + VisibleButtons = [nbFirst, nbPrior, nbNext, nbLast, nbRefresh] + Orientation = orHorizontal + OnFirst = IWDBNavigatorRefresh + OnPrior = IWDBNavigatorRefresh + OnNext = IWDBNavigatorRefresh + OnLast = IWDBNavigatorRefresh + OnRefresh = IWDBNavigatorRefresh + end + object IWLabel2: TIWLabel + Left = 7 + Top = 7 + Width = 46 + Height = 18 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Alignment = taLeftJustify + BGColor = clNone + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 12 + Font.Style = [fsBold] + NoWrap = False + FriendlyName = 'IWLabel2' + Caption = 'Data' + RawText = False + end + object IWDBGrid: TIWDBGrid + Left = 144 + Top = 28 + Width = 502 + Height = 105 + Cursor = crAuto + Anchors = [akLeft, akTop, akRight, akBottom] + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + BorderColors.Color = clNone + BorderColors.Light = clNone + BorderColors.Dark = clNone + BGColor = clSkyBlue + BorderSize = 1 + BorderStyle = tfDefault + CellPadding = 0 + CellSpacing = 0 + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [] + FrameBuffer = 40 + Lines = tlAll + UseFrame = True + UseSize = True + ScrollToCurrentRow = False + Columns = <> + DataSource = DataSource + FooterRowCount = 0 + FriendlyName = 'IWDBGrid' + FromStart = True + HighlightColor = clNone + HighlightRows = False + Options = [dgShowTitles] + RefreshMode = rmAutomatic + RowLimit = 0 + RollOver = False + RowClick = False + RollOverColor = clNone + RowHeaderColor = 12876667 + RowAlternateColor = clNone + RowCurrentColor = clMoneyGreen + TabOrder = 21 + end + object lbResult: TIWLabel + Left = 144 + Top = 7 + Width = 63 + Height = 16 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = False + Alignment = taLeftJustify + BGColor = clNone + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + NoWrap = False + FriendlyName = 'lbResult' + Caption = 'lbResult' + RawText = False + end + end + object IWRegion4: TIWRegion [9] + Left = 16 + Top = 128 + Width = 653 + Height = 46 + Cursor = crAuto + TabOrder = 2 + Anchors = [akLeft, akTop, akRight] + BorderOptions.NumericWidth = 1 + BorderOptions.BorderWidth = cbwNumeric + BorderOptions.Style = cbsSolid + BorderOptions.Color = clNone + Color = clWebBLACK + ParentShowHint = False + ShowHint = True + ZIndex = 1000 + DesignSize = ( + 653 + 46) + object IWRectangle3: TIWRectangle + Left = 1 + Top = 1 + Width = 651 + Height = 44 + Cursor = crAuto + Anchors = [akLeft, akTop, akRight, akBottom] + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = -1 + RenderSize = True + Font.Color = clNone + Font.Size = 10 + Font.Style = [] + BorderOptions.Color = clNone + BorderOptions.Width = 0 + FriendlyName = 'IWRectangle3' + Color = 14811135 + Alignment = taLeftJustify + VAlign = vaMiddle + end + object btOpen: TIWButton + Left = 11 + Top = 11 + Width = 94 + Height = 25 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Caption = 'Open' + DoSubmitValidation = True + Color = clBtnFace + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + FriendlyName = 'btOpen' + ScriptEvents = <> + TabOrder = 6 + OnClick = btOpenClick + end + object btClose: TIWButton + Left = 112 + Top = 11 + Width = 97 + Height = 25 + Cursor = crAuto + IW50Hint = False + ParentShowHint = False + ShowHint = True + ZIndex = 0 + RenderSize = True + Caption = 'Close' + DoSubmitValidation = True + Color = clBtnFace + Font.Color = clNone + Font.FontName = 'Verdana' + Font.Size = 10 + Font.Style = [fsBold] + FriendlyName = 'btClose' + ScriptEvents = <> + TabOrder = 8 + OnClick = btCloseClick + end + end + inherited rgConnection: TIWRegion + Width = 653 + TabOrder = 3 + DesignSize = ( + 653 + 42) + inherited IWRectangle4: TIWRectangle + Width = 651 + end + inherited btConnect: TIWButton + TabOrder = 10 + end + inherited btDisconnect: TIWButton + TabOrder = 12 + end + end + object Query: TMSQuery + Left = 328 + Top = 48 + end + object DataSource: TDataSource + DataSet = Query + Left = 424 + Top = 48 + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/uQuery.pas b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/uQuery.pas new file mode 100644 index 0000000..715ed45 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/IntraWeb/IW7/uQuery.pas @@ -0,0 +1,231 @@ +unit uQuery; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, uBase, IWCompLabel, IWControl, IWCompRectangle, IWHTMLControls, + IWGrids, IWDBGrids, IWCompMemo, IWDBStdCtrls, IWCompButton, DB, MyAccess, + MemDS, DBAccess, IWTemplateProcessorHTML, + IWContainer, IWRegion, IWLayoutMgrHTML, IWCompCheckbox, ExtCtrls, + IWExtCtrls, IWHTMLTag, IWVCLBaseContainer, IWHTMLContainer, IWVCLBaseControl, + IWBaseControl, IWBaseHTMLControl, MSAccess; + +type + TfmQuery = class(TfmBase) + IWLabel1: TIWLabel; + IWLabel2: TIWLabel; + IWDBNavigator: TIWDBNavigator; + lbResult: TIWLabel; + btOpen: TIWButton; + Query: TMSQuery; + DataSource: TDataSource; + IWRegion1: TIWRegion; + IWRegion2: TIWRegion; + IWDBGrid: TIWDBGrid; + IWRectangle1: TIWRectangle; + IWRectangle2: TIWRectangle; + IWRegion3: TIWRegion; + meSQL: TIWMemo; + IWRegion4: TIWRegion; + IWRectangle3: TIWRectangle; + btClose: TIWButton; + procedure IWAppFormCreate(Sender: TObject); + procedure btOpenClick(Sender: TObject); + procedure IWAppFormRender(Sender: TObject); + procedure IWDBNavigatorRefresh(Sender: TObject); + procedure btCloseClick(Sender: TObject); + protected + procedure ReadFromControls; override; + end; + +var + fmQuery: TfmQuery; + +implementation + +{$R *.dfm} + +uses + ServerController, IWForm; + +procedure TfmQuery.IWAppFormCreate(Sender: TObject); +begin + inherited; + Query.Connection := DM.Connection; +end; + +procedure TfmQuery.btOpenClick(Sender: TObject); +begin + ReadFromControls; + Query.SQL.Text := UserSession.QuerySQL; + IWDBGrid.Columns.Clear; + UserSession.isGoodQuery := False; + try + Query.Execute; + UserSession.isGoodQuery := True; + if Query.Active then + UserSession.QueryResult := 'Result' + else + if Query.RowsAffected >= 0 then + UserSession.QueryResult := IntToStr(Query.RowsAffected) + ' rows affected' + else + UserSession.QueryResult := 'Executed'; + except + on E:Exception do + UserSession.QueryResult := 'Error: '+ E.Message; + end; +end; + +procedure TfmQuery.btCloseClick(Sender: TObject); +begin + ReadFromControls; + UserSession.isGoodQuery := False; + try + IWDBGrid.Columns.Clear; + Query.Close; + UserSession.isGoodQuery := True; + UserSession.QueryResult := '' + except + on E:Exception do + UserSession.QueryResult := 'Error: '+ E.Message; + end; +end; + +procedure TfmQuery.IWAppFormRender(Sender: TObject); +begin + inherited; + meSQL.Lines.Text := UserSession.QuerySQL; + IWDBGrid.Visible := UserSession.isGoodQuery and Query.Active; + IWDBNavigator.Enabled := IWDBGrid.Visible; + lbResult.Font.Color := ResultColors[UserSession.IsGoodQuery]; + lbResult.Caption := UserSession.QueryResult; +end; + +procedure TfmQuery.ReadFromControls; +begin + inherited; + UserSession.QuerySQL := meSQL.Lines.Text; +end; + +procedure TfmQuery.IWDBNavigatorRefresh(Sender: TObject); +begin + ReadFromControls; +end; + +end. + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, uBase, IWCompLabel, IWControl, IWCompRectangle, IWHTMLControls, + IWGrids, IWDBGrids, IWCompMemo, IWDBStdCtrls, IWCompButton, DB, MyAccess, + MemDS, DBAccess, IWTemplateProcessorHTML, + IWContainer, IWRegion, IWLayoutMgrHTML, IWCompCheckbox, ExtCtrls, + IWExtCtrls, IWHTMLTag, IWVCLBaseContainer, IWHTMLContainer, IWVCLBaseControl, + IWBaseControl, IWBaseHTMLControl, MSAccess; + +type + TfmQuery = class(TfmBase) + IWLabel1: TIWLabel; + IWLabel2: TIWLabel; + IWDBNavigator: TIWDBNavigator; + lbResult: TIWLabel; + btOpen: TIWButton; + Query: TMSQuery; + DataSource: TDataSource; + IWRegion1: TIWRegion; + IWRegion2: TIWRegion; + IWDBGrid: TIWDBGrid; + IWRectangle1: TIWRectangle; + IWRectangle2: TIWRectangle; + IWRegion3: TIWRegion; + meSQL: TIWMemo; + IWRegion4: TIWRegion; + IWRectangle3: TIWRectangle; + btClose: TIWButton; + procedure IWAppFormCreate(Sender: TObject); + procedure btOpenClick(Sender: TObject); + procedure IWAppFormRender(Sender: TObject); + procedure IWDBNavigatorRefresh(Sender: TObject); + procedure btCloseClick(Sender: TObject); + protected + procedure ReadFromControls; override; + end; + +var + fmQuery: TfmQuery; + +implementation + +{$R *.dfm} + +uses + ServerController, IWForm; + +procedure TfmQuery.IWAppFormCreate(Sender: TObject); +begin + inherited; + Query.Connection := DM.Connection; +end; + +procedure TfmQuery.btOpenClick(Sender: TObject); +begin + ReadFromControls; + Query.SQL.Text := UserSession.QuerySQL; + IWDBGrid.Columns.Clear; + UserSession.isGoodQuery := False; + try + Query.Execute; + UserSession.isGoodQuery := True; + if Query.Active then + UserSession.QueryResult := 'Result' + else + if Query.RowsAffected >= 0 then + UserSession.QueryResult := IntToStr(Query.RowsAffected) + ' rows affected' + else + UserSession.QueryResult := 'Executed'; + except + on E:Exception do + UserSession.QueryResult := 'Error: '+ E.Message; + end; +end; + +procedure TfmQuery.btCloseClick(Sender: TObject); +begin + ReadFromControls; + UserSession.isGoodQuery := False; + try + IWDBGrid.Columns.Clear; + Query.Close; + UserSession.isGoodQuery := True; + UserSession.QueryResult := '' + except + on E:Exception do + UserSession.QueryResult := 'Error: '+ E.Message; + end; +end; + +procedure TfmQuery.IWAppFormRender(Sender: TObject); +begin + inherited; + meSQL.Lines.Text := UserSession.QuerySQL; + IWDBGrid.Visible := UserSession.isGoodQuery and Query.Active; + IWDBNavigator.Enabled := IWDBGrid.Visible; + lbResult.Font.Color := ResultColors[UserSession.IsGoodQuery]; + lbResult.Caption := UserSession.QueryResult; +end; + +procedure TfmQuery.ReadFromControls; +begin + inherited; + UserSession.QuerySQL := meSQL.Lines.Text; +end; + +procedure TfmQuery.IWDBNavigatorRefresh(Sender: TObject); +begin + ReadFromControls; +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/QuickReport/Main.dfm b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/QuickReport/Main.dfm new file mode 100644 index 0000000..a66a75b --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/QuickReport/Main.dfm @@ -0,0 +1,51 @@ +object fmMain: TfmMain + Left = 299 + Top = 138 + BorderStyle = bsSingle + Caption = 'MS SQL Data Access Components demo - using SDAC with Quick Report' + ClientHeight = 57 + ClientWidth = 465 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + Scaled = False + PixelsPerInch = 96 + TextHeight = 13 + object btPreview: TButton + Left = 192 + Top = 16 + Width = 75 + Height = 25 + Caption = 'Preview' + TabOrder = 2 + OnClick = btPreviewClick + end + object Connect: TButton + Left = 8 + Top = 16 + Width = 75 + Height = 25 + Caption = 'Connect' + TabOrder = 0 + OnClick = ConnectClick + end + object Disconnect: TButton + Left = 88 + Top = 16 + Width = 75 + Height = 25 + Caption = 'Disconnect' + TabOrder = 1 + OnClick = DisconnectClick + end + object MSConnection: TMSConnection + Database = 'SDACDemos' + Username = 'Sa' + Left = 8 + Top = 16 + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/QuickReport/Main.pas b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/QuickReport/Main.pas new file mode 100644 index 0000000..96c2f72 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/QuickReport/Main.pas @@ -0,0 +1,49 @@ +unit Main; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, SdacVcl, + ExtCtrls, QuickRpt, Db, MemDS, StdCtrls, QRPrntr, DBAccess, MSAccess; + +type + TfmMain = class(TForm) + MSConnection: TMSConnection; + btPreview: TButton; + Connect: TButton; + Disconnect: TButton; + procedure btPreviewClick(Sender: TObject); + procedure ConnectClick(Sender: TObject); + procedure DisconnectClick(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + end; + +var + fmMain: TfmMain; + +implementation + +uses Report1; + +{$R *.DFM} + +procedure TfmMain.btPreviewClick(Sender: TObject); +begin + qrReport1.Preview; +end; + +procedure TfmMain.ConnectClick(Sender: TObject); +begin + MSConnection.Connect; +end; + +procedure TfmMain.DisconnectClick(Sender: TObject); +begin + MSConnection.Disconnect; +end; + +end. + diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/QuickReport/QReport.cfg b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/QuickReport/QReport.cfg new file mode 100644 index 0000000..fc13625 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/QuickReport/QReport.cfg @@ -0,0 +1,41 @@ +-$A+ +-$B- +-$C+ +-$D+ +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L+ +-$M- +-$N+ +-$O- +-$P+ +-$Q+ +-$R+ +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$YD +-$Z1 +-cg +-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-H+ +-W+ +-M +-$M16384,1048576 +-K$00400000 +-E"." +-N"." +-LE"." +-LN"." +-U"d:\program files\borland\delphi5\Lib\Debug;d:\program files\borland\delphi5\Vcl;d:\program files\borland\delphi5\lib" +-O"d:\program files\borland\delphi5\Lib\Debug;d:\program files\borland\delphi5\Vcl;d:\program files\borland\delphi5\lib" +-I"d:\program files\borland\delphi5\Lib\Debug;d:\program files\borland\delphi5\Vcl;d:\program files\borland\delphi5\lib" +-R"d:\program files\borland\delphi5\Lib\Debug;d:\program files\borland\delphi5\Vcl;d:\program files\borland\delphi5\lib" diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/QuickReport/QReport.dpr b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/QuickReport/QReport.dpr new file mode 100644 index 0000000..a532a10 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/QuickReport/QReport.dpr @@ -0,0 +1,15 @@ +program QReport; + +uses + Forms, + Main in 'Main.pas' {fmMain}, + Report1 in 'Report1.pas' {qrReport1: TQuickRep}; + +{$R *.RES} + +begin + Application.Initialize; + Application.CreateForm(TfmMain, fmMain); + Application.CreateForm(TqrReport1, qrReport1); + Application.Run; +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/QuickReport/QReport.res b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/QuickReport/QReport.res new file mode 100644 index 0000000..4308bae Binary files /dev/null and b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/QuickReport/QReport.res differ diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/QuickReport/ReadMe.txt b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/QuickReport/ReadMe.txt new file mode 100644 index 0000000..b277a0b --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/QuickReport/ReadMe.txt @@ -0,0 +1,13 @@ +SQL Server Data Access Components +Copyright 1997-2007, Core Lab. All Rights Reserved +-------------------------------------------------- + +Demo for QuickReport included in SDAC was built and tested using +Borland QuickReport Components in Delphi 5. + +Lets you launch and view a QuickReport application based on SDAC. +This demo project lets you modify the application in design-time. + +IMPORTANT NOTE: + Demo provided as is and there are no warranty that it is fully + compatible with other versions of QuickReport. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/QuickReport/Report1.dfm b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/QuickReport/Report1.dfm new file mode 100644 index 0000000..3e2fb61 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/QuickReport/Report1.dfm @@ -0,0 +1,985 @@ +object qrReport1: TqrReport1 + Left = 0 + Top = 0 + Width = 794 + Height = 1123 + Frame.Color = clBlack + Frame.DrawTop = False + Frame.DrawBottom = False + Frame.DrawLeft = False + Frame.DrawRight = False + AfterPrint = QuickRepAfterPreview + AfterPreview = QuickRepAfterPreview + BeforePrint = QuickRepBeforePrint + DataSet = quDept + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Arial' + Font.Style = [] + Functions.Strings = ( + 'PAGENUMBER' + 'COLUMNNUMBER' + 'REPORTTITLE' + 'QRSTRINGSBAND1') + Functions.DATA = ( + '0' + '0' + #39#39 + #39#39) + Options = [FirstPageHeader, LastPageFooter] + Page.Columns = 1 + Page.Orientation = poPortrait + Page.PaperSize = A4 + Page.Values = ( + 100 + 2970 + 100 + 2100 + 100 + 100 + 0) + PrinterSettings.Copies = 1 + PrinterSettings.Duplex = False + PrinterSettings.FirstPage = 0 + PrinterSettings.LastPage = 0 + PrinterSettings.OutputBin = Auto + PrintIfEmpty = True + SnapToGrid = True + Units = MM + Zoom = 100 + object QRBand1: TQRBand + Left = 38 + Top = 38 + Width = 718 + Height = 75 + Frame.Color = clBlack + Frame.DrawTop = False + Frame.DrawBottom = False + Frame.DrawLeft = False + Frame.DrawRight = False + AlignToBottom = False + Color = clWhite + ForceNewColumn = False + ForceNewPage = False + Size.Values = ( + 198.4375 + 1899.70833333333) + BandType = rbTitle + object QRLabel1: TQRLabel + Left = 232 + Top = 13 + Width = 237 + Height = 33 + Frame.Color = clBlack + Frame.DrawTop = False + Frame.DrawBottom = False + Frame.DrawLeft = False + Frame.DrawRight = False + Size.Values = ( + 87.3125 + 613.833333333333 + 34.3958333333333 + 627.0625) + Alignment = taLeftJustify + AlignToBand = False + AutoSize = True + AutoStretch = False + Caption = 'Employees Report' + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Height = -27 + Font.Name = 'Arial' + Font.Style = [fsBold, fsItalic] + ParentFont = False + Transparent = False + WordWrap = True + FontSize = 20 + end + object QRSysData1: TQRSysData + Left = 624 + Top = 5 + Width = 100 + Height = 17 + Frame.Color = clBlack + Frame.DrawTop = False + Frame.DrawBottom = False + Frame.DrawLeft = False + Frame.DrawRight = False + Size.Values = ( + 44.9791666666667 + 1651 + 13.2291666666667 + 264.583333333333) + Alignment = taLeftJustify + AlignToBand = False + AutoSize = True + Color = clWhite + Data = qrsDateTime + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Arial' + Font.Style = [] + ParentFont = False + Transparent = False + FontSize = 8 + end + end + object QRBand2: TQRBand + Left = 38 + Top = 113 + Width = 718 + Height = 38 + Frame.Color = clBlack + Frame.DrawTop = False + Frame.DrawBottom = False + Frame.DrawLeft = False + Frame.DrawRight = False + AlignToBottom = False + Color = clWhite + ForceNewColumn = False + ForceNewPage = False + Size.Values = ( + 100.541666666667 + 1899.70833333333) + BandType = rbDetail + object QRDBText1: TQRDBText + Left = 256 + Top = 12 + Width = 55 + Height = 17 + Frame.Color = clBlack + Frame.DrawTop = False + Frame.DrawBottom = False + Frame.DrawLeft = False + Frame.DrawRight = False + Size.Values = ( + 44.9791666666667 + 677.333333333333 + 31.75 + 145.520833333333) + Alignment = taLeftJustify + AlignToBand = False + AutoSize = True + AutoStretch = False + Color = clWhite + DataSet = quDept + DataField = 'DEPTNO' + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlue + Font.Height = -13 + Font.Name = 'Arial' + Font.Style = [fsItalic] + ParentFont = False + Transparent = False + WordWrap = True + FontSize = 10 + end + object QRDBText2: TQRDBText + Left = 96 + Top = 12 + Width = 47 + Height = 17 + Frame.Color = clBlack + Frame.DrawTop = False + Frame.DrawBottom = False + Frame.DrawLeft = False + Frame.DrawRight = False + Size.Values = ( + 44.9791666666667 + 254 + 31.75 + 124.354166666667) + Alignment = taLeftJustify + AlignToBand = False + AutoSize = True + AutoStretch = False + Color = clWhite + DataSet = quDept + DataField = 'DNAME' + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlue + Font.Height = -13 + Font.Name = 'Arial' + Font.Style = [fsItalic] + ParentFont = False + Transparent = False + WordWrap = True + FontSize = 10 + end + object QRDBText3: TQRDBText + Left = 384 + Top = 12 + Width = 27 + Height = 17 + Frame.Color = clBlack + Frame.DrawTop = False + Frame.DrawBottom = False + Frame.DrawLeft = False + Frame.DrawRight = False + Size.Values = ( + 44.9791666666667 + 1016 + 31.75 + 71.4375) + Alignment = taLeftJustify + AlignToBand = False + AutoSize = True + AutoStretch = False + Color = clWhite + DataSet = quDept + DataField = 'LOC' + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlue + Font.Height = -13 + Font.Name = 'Arial' + Font.Style = [fsItalic] + ParentFont = False + Transparent = False + WordWrap = True + FontSize = 10 + end + object QRShape1: TQRShape + Left = 8 + Top = 31 + Width = 703 + Height = 5 + Frame.Color = clBlack + Frame.DrawTop = False + Frame.DrawBottom = False + Frame.DrawLeft = False + Frame.DrawRight = False + Size.Values = ( + 13.2291666666667 + 21.1666666666667 + 82.0208333333333 + 1860.02083333333) + Pen.Width = 2 + Shape = qrsHorLine + end + object QRLabel10: TQRLabel + Left = 13 + Top = 12 + Width = 75 + Height = 17 + Frame.Color = clBlack + Frame.DrawTop = False + Frame.DrawBottom = False + Frame.DrawLeft = False + Frame.DrawRight = False + Size.Values = ( + 44.9791666666667 + 34.3958333333333 + 31.75 + 198.4375) + Alignment = taLeftJustify + AlignToBand = False + AutoSize = True + AutoStretch = False + Caption = 'Departament' + Color = clWhite + Transparent = False + WordWrap = True + FontSize = 10 + end + object QRLabel11: TQRLabel + Left = 229 + Top = 12 + Width = 17 + Height = 17 + Frame.Color = clBlack + Frame.DrawTop = False + Frame.DrawBottom = False + Frame.DrawLeft = False + Frame.DrawRight = False + Size.Values = ( + 44.9791666666667 + 605.895833333333 + 31.75 + 44.9791666666667) + Alignment = taLeftJustify + AlignToBand = False + AutoSize = True + AutoStretch = False + Caption = 'No' + Color = clWhite + Transparent = False + WordWrap = True + FontSize = 10 + end + object QRLabel12: TQRLabel + Left = 325 + Top = 12 + Width = 50 + Height = 17 + Frame.Color = clBlack + Frame.DrawTop = False + Frame.DrawBottom = False + Frame.DrawLeft = False + Frame.DrawRight = False + Size.Values = ( + 44.9791666666667 + 859.895833333333 + 31.75 + 132.291666666667) + Alignment = taLeftJustify + AlignToBand = False + AutoSize = True + AutoStretch = False + Caption = 'Location' + Color = clWhite + Transparent = False + WordWrap = True + FontSize = 10 + end + end + object QRSubDetail1: TQRSubDetail + Left = 38 + Top = 175 + Width = 718 + Height = 28 + Frame.Color = clBlack + Frame.DrawTop = False + Frame.DrawBottom = False + Frame.DrawLeft = False + Frame.DrawRight = False + AlignToBottom = False + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clGreen + Font.Height = -13 + Font.Name = 'Arial' + Font.Style = [] + ForceNewColumn = False + ForceNewPage = False + ParentFont = False + Size.Values = ( + 74.0833333333333 + 1899.70833333333) + Master = Owner + DataSet = quEmp + FooterBand = GroupFooterBand1 + HeaderBand = GroupHeaderBand1 + PrintBefore = False + PrintIfEmpty = True + object QRDBText4: TQRDBText + Left = 16 + Top = 7 + Width = 49 + Height = 17 + Frame.Color = clBlack + Frame.DrawTop = False + Frame.DrawBottom = False + Frame.DrawLeft = False + Frame.DrawRight = False + Size.Values = ( + 44.9791666666667 + 42.3333333333333 + 18.5208333333333 + 129.645833333333) + Alignment = taLeftJustify + AlignToBand = False + AutoSize = True + AutoStretch = False + Color = clWhite + DataSet = quEmp + DataField = 'EMPNO' + Font.Charset = DEFAULT_CHARSET + Font.Color = clGreen + Font.Height = -13 + Font.Name = 'Arial' + Font.Style = [] + ParentFont = False + Transparent = False + WordWrap = True + FontSize = 10 + end + object QRDBText5: TQRDBText + Left = 72 + Top = 7 + Width = 48 + Height = 17 + Frame.Color = clBlack + Frame.DrawTop = False + Frame.DrawBottom = False + Frame.DrawLeft = False + Frame.DrawRight = False + Size.Values = ( + 44.9791666666667 + 190.5 + 18.5208333333333 + 127) + Alignment = taLeftJustify + AlignToBand = False + AutoSize = True + AutoStretch = False + Color = clWhite + DataSet = quEmp + DataField = 'ENAME' + Font.Charset = DEFAULT_CHARSET + Font.Color = clGreen + Font.Height = -13 + Font.Name = 'Arial' + Font.Style = [] + ParentFont = False + Transparent = False + WordWrap = True + FontSize = 10 + end + object QRDBText7: TQRDBText + Left = 200 + Top = 7 + Width = 26 + Height = 17 + Frame.Color = clBlack + Frame.DrawTop = False + Frame.DrawBottom = False + Frame.DrawLeft = False + Frame.DrawRight = False + Size.Values = ( + 44.9791666666667 + 529.166666666667 + 18.5208333333333 + 68.7916666666667) + Alignment = taLeftJustify + AlignToBand = False + AutoSize = True + AutoStretch = False + Color = clWhite + DataSet = quEmp + DataField = 'JOB' + Transparent = False + WordWrap = True + FontSize = 10 + end + object QRDBText8: TQRDBText + Left = 318 + Top = 7 + Width = 31 + Height = 17 + Frame.Color = clBlack + Frame.DrawTop = False + Frame.DrawBottom = False + Frame.DrawLeft = False + Frame.DrawRight = False + Size.Values = ( + 44.9791666666667 + 841.375 + 18.5208333333333 + 82.0208333333333) + Alignment = taLeftJustify + AlignToBand = False + AutoSize = True + AutoStretch = False + Color = clWhite + DataSet = quEmp + DataField = 'MGR' + Transparent = False + WordWrap = True + FontSize = 10 + end + object QRDBText9: TQRDBText + Left = 416 + Top = 7 + Width = 65 + Height = 17 + Frame.Color = clBlack + Frame.DrawTop = False + Frame.DrawBottom = False + Frame.DrawLeft = False + Frame.DrawRight = False + Size.Values = ( + 44.9791666666667 + 1100.66666666667 + 18.5208333333333 + 171.979166666667) + Alignment = taLeftJustify + AlignToBand = False + AutoSize = True + AutoStretch = False + Color = clWhite + DataSet = quEmp + DataField = 'HIREDATE' + Transparent = False + WordWrap = True + FontSize = 10 + end + object QRDBText10: TQRDBText + Left = 530 + Top = 7 + Width = 26 + Height = 17 + Frame.Color = clBlack + Frame.DrawTop = False + Frame.DrawBottom = False + Frame.DrawLeft = False + Frame.DrawRight = False + Size.Values = ( + 44.9791666666667 + 1402.29166666667 + 18.5208333333333 + 68.7916666666667) + Alignment = taLeftJustify + AlignToBand = False + AutoSize = True + AutoStretch = False + Color = clWhite + DataSet = quEmp + DataField = 'SAL' + Transparent = False + WordWrap = True + FontSize = 10 + end + end + object QRBand3: TQRBand + Left = 38 + Top = 234 + Width = 718 + Height = 30 + Frame.Color = clBlack + Frame.DrawTop = False + Frame.DrawBottom = False + Frame.DrawLeft = False + Frame.DrawRight = False + AlignToBottom = False + Color = clWhite + ForceNewColumn = False + ForceNewPage = False + Size.Values = ( + 79.375 + 1899.70833333333) + BandType = rbSummary + object QRLabel2: TQRLabel + Left = 16 + Top = 8 + Width = 33 + Height = 17 + Frame.Color = clBlack + Frame.DrawTop = False + Frame.DrawBottom = False + Frame.DrawLeft = False + Frame.DrawRight = False + Size.Values = ( + 44.9791666666667 + 42.3333333333333 + 21.1666666666667 + 87.3125) + Alignment = taLeftJustify + AlignToBand = False + AutoSize = True + AutoStretch = False + Caption = 'Total' + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Arial' + Font.Style = [fsBold] + ParentFont = False + Transparent = False + WordWrap = True + FontSize = 10 + end + object QRExpr2: TQRExpr + Left = 530 + Top = 7 + Width = 112 + Height = 17 + Frame.Color = clBlack + Frame.DrawTop = False + Frame.DrawBottom = False + Frame.DrawLeft = False + Frame.DrawRight = False + Size.Values = ( + 44.9791666666667 + 1402.29166666667 + 18.5208333333333 + 296.333333333333) + Alignment = taLeftJustify + AlignToBand = False + AutoSize = True + AutoStretch = False + Font.Charset = DEFAULT_CHARSET + Font.Color = clRed + Font.Height = -13 + Font.Name = 'Arial' + Font.Style = [fsBold] + Color = clWhite + Master = QRSubDetail1 + ParentFont = False + ResetAfterPrint = False + Transparent = False + WordWrap = True + Expression = 'SUM(quEmp.SAL)' + FontSize = 10 + end + end + object GroupFooterBand1: TQRBand + Left = 38 + Top = 203 + Width = 718 + Height = 31 + Frame.Color = clBlack + Frame.DrawTop = False + Frame.DrawBottom = False + Frame.DrawLeft = False + Frame.DrawRight = False + AlignToBottom = False + Color = clWhite + ForceNewColumn = False + ForceNewPage = False + Size.Values = ( + 82.0208333333333 + 1899.70833333333) + BandType = rbGroupFooter + object QRLabel9: TQRLabel + Left = 16 + Top = 9 + Width = 62 + Height = 17 + Frame.Color = clBlack + Frame.DrawTop = False + Frame.DrawBottom = False + Frame.DrawLeft = False + Frame.DrawRight = False + Size.Values = ( + 44.9791666666667 + 42.3333333333333 + 23.8125 + 164.041666666667) + Alignment = taLeftJustify + AlignToBand = False + AutoSize = True + AutoStretch = False + Caption = 'Summary' + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Arial' + Font.Style = [fsBold] + ParentFont = False + Transparent = False + WordWrap = True + FontSize = 10 + end + object QRDBText6: TQRDBText + Left = 88 + Top = 9 + Width = 47 + Height = 17 + Frame.Color = clBlack + Frame.DrawTop = False + Frame.DrawBottom = False + Frame.DrawLeft = False + Frame.DrawRight = False + Size.Values = ( + 44.9791666666667 + 232.833333333333 + 23.8125 + 124.354166666667) + Alignment = taLeftJustify + AlignToBand = False + AutoSize = True + AutoStretch = False + Color = clWhite + DataSet = quDept + DataField = 'DNAME' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Arial' + Font.Style = [fsItalic] + ParentFont = False + Transparent = False + WordWrap = True + FontSize = 10 + end + object QRExpr1: TQRExpr + Left = 530 + Top = 9 + Width = 112 + Height = 17 + Frame.Color = clBlack + Frame.DrawTop = False + Frame.DrawBottom = False + Frame.DrawLeft = False + Frame.DrawRight = False + Size.Values = ( + 44.9791666666667 + 1402.29166666667 + 23.8125 + 296.333333333333) + Alignment = taLeftJustify + AlignToBand = False + AutoSize = True + AutoStretch = False + Font.Charset = DEFAULT_CHARSET + Font.Color = clRed + Font.Height = -13 + Font.Name = 'Arial' + Font.Style = [fsBold] + Color = clWhite + Master = QRSubDetail1 + ParentFont = False + ResetAfterPrint = True + Transparent = False + WordWrap = True + Expression = 'SUM(quEmp.SAL)' + FontSize = 10 + end + object QRShape2: TQRShape + Left = 8 + Top = 2 + Width = 703 + Height = 5 + Frame.Color = clBlack + Frame.DrawTop = False + Frame.DrawBottom = False + Frame.DrawLeft = False + Frame.DrawRight = False + Size.Values = ( + 13.2291666666667 + 21.1666666666667 + 5.29166666666667 + 1860.02083333333) + Pen.Width = 2 + Shape = qrsHorLine + end + end + object GroupHeaderBand1: TQRBand + Left = 38 + Top = 151 + Width = 718 + Height = 24 + Frame.Color = clBlack + Frame.DrawTop = False + Frame.DrawBottom = False + Frame.DrawLeft = False + Frame.DrawRight = False + AlignToBottom = False + Color = clWhite + ForceNewColumn = False + ForceNewPage = False + Size.Values = ( + 63.5 + 1899.70833333333) + BandType = rbGroupHeader + object QRLabel3: TQRLabel + Left = 16 + Top = 5 + Width = 18 + Height = 17 + Frame.Color = clBlack + Frame.DrawTop = False + Frame.DrawBottom = False + Frame.DrawLeft = False + Frame.DrawRight = False + Size.Values = ( + 44.9791666666667 + 42.3333333333333 + 13.2291666666667 + 47.625) + Alignment = taLeftJustify + AlignToBand = False + AutoSize = True + AutoStretch = False + Caption = 'No' + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Arial' + Font.Style = [fsBold] + ParentFont = False + Transparent = False + WordWrap = True + FontSize = 10 + end + object QRLabel4: TQRLabel + Left = 72 + Top = 5 + Width = 38 + Height = 17 + Frame.Color = clBlack + Frame.DrawTop = False + Frame.DrawBottom = False + Frame.DrawLeft = False + Frame.DrawRight = False + Size.Values = ( + 44.9791666666667 + 190.5 + 13.2291666666667 + 100.541666666667) + Alignment = taLeftJustify + AlignToBand = False + AutoSize = True + AutoStretch = False + Caption = 'Name' + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Arial' + Font.Style = [fsBold] + ParentFont = False + Transparent = False + WordWrap = True + FontSize = 10 + end + object QRLabel5: TQRLabel + Left = 200 + Top = 5 + Width = 24 + Height = 17 + Frame.Color = clBlack + Frame.DrawTop = False + Frame.DrawBottom = False + Frame.DrawLeft = False + Frame.DrawRight = False + Size.Values = ( + 44.9791666666667 + 529.166666666667 + 13.2291666666667 + 63.5) + Alignment = taLeftJustify + AlignToBand = False + AutoSize = True + AutoStretch = False + Caption = 'Job' + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Arial' + Font.Style = [fsBold] + ParentFont = False + Transparent = False + WordWrap = True + FontSize = 10 + end + object QRLabel6: TQRLabel + Left = 318 + Top = 5 + Width = 57 + Height = 17 + Frame.Color = clBlack + Frame.DrawTop = False + Frame.DrawBottom = False + Frame.DrawLeft = False + Frame.DrawRight = False + Size.Values = ( + 44.9791666666667 + 841.375 + 13.2291666666667 + 150.8125) + Alignment = taLeftJustify + AlignToBand = False + AutoSize = True + AutoStretch = False + Caption = 'Manager' + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Arial' + Font.Style = [fsBold] + ParentFont = False + Transparent = False + WordWrap = True + FontSize = 10 + end + object QRLabel7: TQRLabel + Left = 415 + Top = 5 + Width = 60 + Height = 17 + Frame.Color = clBlack + Frame.DrawTop = False + Frame.DrawBottom = False + Frame.DrawLeft = False + Frame.DrawRight = False + Size.Values = ( + 44.9791666666667 + 1098.02083333333 + 13.2291666666667 + 158.75) + Alignment = taLeftJustify + AlignToBand = False + AutoSize = True + AutoStretch = False + Caption = 'Hire Date' + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Arial' + Font.Style = [fsBold] + ParentFont = False + Transparent = False + WordWrap = True + FontSize = 10 + end + object QRLabel8: TQRLabel + Left = 530 + Top = 5 + Width = 42 + Height = 17 + Frame.Color = clBlack + Frame.DrawTop = False + Frame.DrawBottom = False + Frame.DrawLeft = False + Frame.DrawRight = False + Size.Values = ( + 44.9791666666667 + 1402.29166666667 + 13.2291666666667 + 111.125) + Alignment = taLeftJustify + AlignToBand = False + AutoSize = True + AutoStretch = False + Caption = 'Salary' + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Arial' + Font.Style = [fsBold] + ParentFont = False + Transparent = False + WordWrap = True + FontSize = 10 + end + end + object quEmp: TMSQuery + Connection = fmMain.MSConnection + SQL.Strings = ( + 'SELECT * FROM Emp' + 'WHERE DeptNo = :DeptNo') + MasterSource = DataSource1 + Left = 8 + Top = 48 + ParamData = < + item + DataType = ftInteger + Name = 'DeptNo' + Value = 45 + end> + end + object quDept: TMSQuery + Connection = fmMain.MSConnection + SQL.Strings = ( + 'SELECT * FROM Dept' + '') + Left = 8 + Top = 16 + end + object DataSource1: TDataSource + DataSet = quDept + Left = 40 + Top = 16 + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/QuickReport/Report1.pas b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/QuickReport/Report1.pas new file mode 100644 index 0000000..1b5f11a --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/QuickReport/Report1.pas @@ -0,0 +1,78 @@ +unit Report1; + +interface + +uses Windows, SysUtils, Messages, Classes, Graphics, Controls, + StdCtrls, ExtCtrls, Forms, Quickrpt, QRCtrls, Db, MemDS, DBAccess, + MSAccess; + +type + TqrReport1 = class(TQuickRep) + QRBand1: TQRBand; + QRBand2: TQRBand; + QRDBText1: TQRDBText; + QRDBText2: TQRDBText; + QRDBText3: TQRDBText; + quEmp: TMSQuery; + QRSubDetail1: TQRSubDetail; + QRDBText4: TQRDBText; + quDept: TMSQuery; + DataSource1: TDataSource; + QRLabel1: TQRLabel; + QRDBText5: TQRDBText; + QRDBText7: TQRDBText; + QRDBText8: TQRDBText; + QRDBText9: TQRDBText; + QRDBText10: TQRDBText; + QRShape1: TQRShape; + QRSysData1: TQRSysData; + QRBand3: TQRBand; + QRLabel2: TQRLabel; + GroupFooterBand1: TQRBand; + GroupHeaderBand1: TQRBand; + QRLabel3: TQRLabel; + QRLabel4: TQRLabel; + QRLabel5: TQRLabel; + QRLabel6: TQRLabel; + QRLabel7: TQRLabel; + QRLabel8: TQRLabel; + QRLabel9: TQRLabel; + QRDBText6: TQRDBText; + QRExpr1: TQRExpr; + QRExpr2: TQRExpr; + QRShape2: TQRShape; + QRLabel10: TQRLabel; + QRLabel11: TQRLabel; + QRLabel12: TQRLabel; + procedure QuickRepBeforePrint(Sender: TCustomQuickRep; + var PrintReport: Boolean); + procedure QuickRepAfterPreview(Sender: TObject); + private + + public + + end; + +var + qrReport1: TqrReport1; + +implementation +uses + Main; + +{$R *.DFM} + +procedure TqrReport1.QuickRepBeforePrint(Sender: TCustomQuickRep; + var PrintReport: Boolean); +begin + quDept.Open; + quEmp.Open; +end; + +procedure TqrReport1.QuickRepAfterPreview(Sender: TObject); +begin + quEmp.Close; + quDept.Close; +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/ReportBuilder/EndUser.dpr b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/ReportBuilder/EndUser.dpr new file mode 100644 index 0000000..6de1461 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/ReportBuilder/EndUser.dpr @@ -0,0 +1,13 @@ +program EndUser; + +uses + Forms, + myEURpt in 'myEURpt.pas' {myEndUserSolution}; + +{$R *.RES} + +begin + Application.Initialize; + Application.CreateForm(TmyEndUserSolution, myEndUserSolution); + Application.Run; +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/ReportBuilder/EndUser.res b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/ReportBuilder/EndUser.res new file mode 100644 index 0000000..6d7afb5 Binary files /dev/null and b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/ReportBuilder/EndUser.res differ diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/ReportBuilder/ReadMe.txt b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/ReportBuilder/ReadMe.txt new file mode 100644 index 0000000..3d6f6dc --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/ReportBuilder/ReadMe.txt @@ -0,0 +1,10 @@ +SQL Server Data Access Components +Copyright 1997-2007, Core Lab. All Rights Reserved +-------------------------------------------------- + +Demo for ReportBuilder included in SDAC was built and tested using +Report Builder Pro 9.0 for Delphi 7. + +IMPORTANT NOTE: + Demos are provided as is and there are no warranty that they are fully + compatible with other versions of Report Builder Pro. \ No newline at end of file diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/ReportBuilder/Reports/Orders.rtm b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/ReportBuilder/Reports/Orders.rtm new file mode 100644 index 0000000..41d5014 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/ReportBuilder/Reports/Orders.rtm @@ -0,0 +1,592 @@ +object ppReport: TppReport + AutoStop = False + PassSetting = psTwoPass + PrinterSetup.BinName = 'Default' + PrinterSetup.DocumentName = 'Report' + PrinterSetup.PaperName = 'Letter 8 1/2 x 11 in' + PrinterSetup.PrinterName = 'Default' + PrinterSetup.mmMarginBottom = 6350 + PrinterSetup.mmMarginLeft = 6350 + PrinterSetup.mmMarginRight = 6350 + PrinterSetup.mmMarginTop = 6350 + PrinterSetup.mmPaperHeight = 279401 + PrinterSetup.mmPaperWidth = 215900 + PrinterSetup.PaperSize = 1 + SaveAsTemplate = True + Template.DatabaseSettings.DataPipeline = plItem + Template.DatabaseSettings.Name = 'New Report' + Template.DatabaseSettings.NameField = 'ITEM_NAME' + Template.DatabaseSettings.TemplateField = 'TEMPLATE' + Template.FileName = 'D:\Projects\Delphi\Sdac\Demos\ReportBuilder\Reports\Orders.rtm' + Template.Format = ftASCII + Units = utScreenPixels + DeviceType = 'Screen' + Left = 289 + Top = 326 + Version = '6.01' + mmColumnWidth = 0 + DataPipelineName = 'Orders' + object ppTitleBand1: TppTitleBand + mmBottomOffset = 0 + mmHeight = 9525 + mmPrintPosition = 0 + object ppLine1: TppLine + UserName = 'Line1' + Pen.Color = clNavy + Pen.Width = 2 + Weight = 1.5 + mmHeight = 3969 + mmLeft = 1323 + mmTop = 1323 + mmWidth = 200555 + BandType = 1 + end + object ppLabel1: TppLabel + UserName = 'Label1' + Caption = 'Orders summary' + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Name = 'TIMES NEW ROMAN' + Font.Size = 20 + Font.Style = [fsBold, fsItalic] + Transparent = True + mmHeight = 8202 + mmLeft = 1323 + mmTop = 1323 + mmWidth = 48948 + BandType = 1 + end + end + object ppHeaderBand1: TppHeaderBand + mmBottomOffset = 0 + mmHeight = 7408 + mmPrintPosition = 0 + object ppLabel2: TppLabel + UserName = 'Label2' + AutoSize = False + Caption = 'Product name' + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Name = 'TIMES NEW ROMAN' + Font.Size = 11 + Font.Style = [fsBold, fsItalic] + Transparent = True + mmHeight = 4763 + mmLeft = 1323 + mmTop = 1323 + mmWidth = 23283 + BandType = 0 + end + object ppLabel3: TppLabel + UserName = 'Label3' + AutoSize = False + Caption = 'Unit price' + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Name = 'TIMES NEW ROMAN' + Font.Size = 11 + Font.Style = [fsBold, fsItalic] + Transparent = True + mmHeight = 4763 + mmLeft = 55563 + mmTop = 1323 + mmWidth = 16669 + BandType = 0 + end + object ppLabel4: TppLabel + UserName = 'Label4' + Caption = 'Quantity' + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Name = 'TIMES NEW ROMAN' + Font.Size = 11 + Font.Style = [fsBold, fsItalic] + Transparent = True + mmHeight = 4498 + mmLeft = 73290 + mmTop = 1323 + mmWidth = 14023 + BandType = 0 + end + object ppLine3: TppLine + UserName = 'Line3' + Pen.Color = clNavy + Pen.Width = 2 + ParentWidth = True + Weight = 1.5 + mmHeight = 2646 + mmLeft = 0 + mmTop = 6615 + mmWidth = 203200 + BandType = 0 + end + object ppLabel5: TppLabel + UserName = 'Label5' + Caption = 'Cost' + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Name = 'TIMES NEW ROMAN' + Font.Size = 11 + Font.Style = [fsBold, fsItalic] + Transparent = True + mmHeight = 4498 + mmLeft = 93134 + mmTop = 1323 + mmWidth = 7144 + BandType = 0 + end + end + object ppDetailBand1: TppDetailBand + mmBottomOffset = 0 + mmHeight = 6085 + mmPrintPosition = 0 + object ppDBText2: TppDBText + UserName = 'DBText2' + AutoSize = True + DataField = 'ProductName' + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Name = 'ARIAL' + Font.Size = 8 + Font.Style = [] + Transparent = True + DataPipelineName = 'Orders' + mmHeight = 3175 + mmLeft = 1323 + mmTop = 529 + mmWidth = 47361 + BandType = 4 + end + object ppDBText3: TppDBText + UserName = 'DBText3' + DataField = 'UnitPrice' + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Name = 'ARIAL' + Font.Size = 8 + Font.Style = [] + Transparent = True + DataPipelineName = 'Orders' + mmHeight = 3175 + mmLeft = 55563 + mmTop = 529 + mmWidth = 16933 + BandType = 4 + end + object ppDBText4: TppDBText + UserName = 'DBText4' + DataField = 'Quantity' + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Name = 'ARIAL' + Font.Size = 8 + Font.Style = [] + Transparent = True + DataPipelineName = 'Orders' + mmHeight = 3175 + mmLeft = 73290 + mmTop = 529 + mmWidth = 16933 + BandType = 4 + end + object ppDBText5: TppDBText + UserName = 'DBText5' + DataField = 'Order_Details_UnitPrice_O' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Name = 'Arial' + Font.Size = 8 + Font.Style = [] + Transparent = True + DataPipelineName = 'Orders' + mmHeight = 3175 + mmLeft = 93134 + mmTop = 529 + mmWidth = 91546 + BandType = 4 + end + end + object ppFooterBand1: TppFooterBand + mmBottomOffset = 0 + mmHeight = 7144 + mmPrintPosition = 0 + object ppLine4: TppLine + UserName = 'Line4' + Pen.Color = clGray + Pen.Width = 2 + Weight = 1.5 + mmHeight = 3969 + mmLeft = 1323 + mmTop = 5821 + mmWidth = 200555 + BandType = 8 + end + object ppSystemVariable1: TppSystemVariable + UserName = 'SystemVariable1' + VarType = vtPrintDateTime + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Name = 'TIMES NEW ROMAN' + Font.Size = 9 + Font.Style = [] + Transparent = True + mmHeight = 4498 + mmLeft = 1323 + mmTop = 1323 + mmWidth = 17198 + BandType = 8 + end + object ppSystemVariable2: TppSystemVariable + UserName = 'SystemVariable2' + VarType = vtPageNoDesc + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Name = 'TIMES NEW ROMAN' + Font.Size = 9 + Font.Style = [] + TextAlignment = taRightJustified + Transparent = True + mmHeight = 4498 + mmLeft = 184680 + mmTop = 1323 + mmWidth = 17198 + BandType = 8 + end + end + object ppGroup1: TppGroup + BreakName = 'OrderDate' + DataPipeline = daSDACQueryDataView1.Orders + UserName = 'Group1' + mmNewColumnThreshold = 0 + mmNewPageThreshold = 0 + DataPipelineName = 'Orders' + object ppGroupHeaderBand1: TppGroupHeaderBand + mmBottomOffset = 0 + mmHeight = 6350 + mmPrintPosition = 0 + object ppDBText1: TppDBText + UserName = 'DBText1' + DataField = 'OrderDate' + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Name = 'TIMES NEW ROMAN' + Font.Size = 9 + Font.Style = [] + Transparent = True + DataPipelineName = 'Orders' + mmHeight = 3704 + mmLeft = 1323 + mmTop = 529 + mmWidth = 16933 + BandType = 3 + GroupNo = 0 + end + end + object ppGroupFooterBand1: TppGroupFooterBand + mmBottomOffset = 0 + mmHeight = 6085 + mmPrintPosition = 0 + object ppDBCalc1: TppDBCalc + UserName = 'DBCalc1' + AutoSize = True + DataField = 'Order_Details_UnitPrice_O' + DisplayFormat = '$#,0.00;-$#,0.00' + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Name = 'ARIAL' + Font.Size = 8 + Font.Style = [fsBold] + ResetGroup = ppGroup1 + Transparent = True + DataPipelineName = 'Orders' + mmHeight = 3440 + mmLeft = 93134 + mmTop = 529 + mmWidth = 71702 + BandType = 5 + GroupNo = 0 + end + end + end + object daDataModule1: TdaDataModule + object daSDACQueryDataView1: TdaSDACQueryDataView + Report = ppReport + UserName = 'Query_Orders' + Height = 227 + Left = 10 + NameColumnWidth = 105 + SizeColumnWidth = 35 + SortMode = 0 + Top = 10 + TypeColumnWidth = 52 + Width = 382 + AutoSearchTabOrder = 0 + object Orders: TppChildDBPipeline + AutoCreateFields = False + UserName = 'Orders' + object ppField1: TppField + FieldAlias = 'Orderid' + FieldName = 'OrderID' + FieldLength = 10 + DataType = dtInteger + DisplayWidth = 10 + Position = 0 + TableName = 'Orders' + end + object ppField2: TppField + FieldAlias = 'Orderdate' + FieldName = 'OrderDate' + FieldLength = 10 + DataType = dtDateTime + DisplayWidth = 10 + Position = 1 + TableName = 'Orders' + end + object ppField3: TppField + FieldAlias = 'Productname' + FieldName = 'ProductName' + FieldLength = 10 + IsDetail = True + DisplayWidth = 10 + Position = 2 + TableName = 'Products' + end + object ppField4: TppField + FieldAlias = 'Unitprice' + FieldName = 'UnitPrice' + FieldLength = 10 + IsDetail = True + DataType = dtCurrency + DisplayWidth = 10 + Position = 3 + TableName = 'Order_Details' + end + object ppField5: TppField + FieldAlias = 'Quantity' + FieldName = 'Quantity' + FieldLength = 10 + IsDetail = True + DataType = dtInteger + DisplayWidth = 10 + Position = 4 + TableName = 'Order_Details' + end + object ppField6: TppField + FieldAlias = 'Order_Details.UnitPrice*Order_Details.Quantity' + FieldName = 'Order_Details_UnitPrice_O' + FieldLength = 10 + Linkable = False + DataType = dtCurrency + DisplayWidth = 10 + Position = 5 + TableName = 'Order_Details' + end + end + object daSQL1: TdaSQL + DatabaseName = 'seDatabase' + DatabaseType = dtMSSQLServer + DataPipelineName = 'Orders' + LinkColor = clMaroon + MaxSQLFieldAliasLength = 25 + SQLText.Strings = ( + 'SELECT Orders.OrderID, Orders.OrderDate, ' + ' Products.ProductName, ' + ' Order_Details.UnitPrice, ' + ' Order_Details.Quantity, ' + + ' Order_Details.UnitPrice*Order_Details.Quantity Order_Deta' + + 'ils_UnitPrice_O' + 'FROM Orders Orders, "Order Details" Order_Details' + ' , Products Products' + 'WHERE (Order_Details.OrderID = Orders.OrderID)' + ' AND ' + ' (Products.ProductID = Order_Details.ProductID)' + 'ORDER BY Orders.OrderDate, Products.ProductName') + SQLType = sqSQL1 + object daCalculation1: TdaCalculation + ChildType = 8 + Alias = 'Order_Details.UnitPrice*Order_Details.Quantity' + DataType = dtCurrency + DisplayWidth = 10 + FieldAlias = 'Unitprice' + FieldLength = 10 + FieldName = 'UnitPrice' + Linkable = False + SQLFieldName = 'Order_Details_UnitPrice_O' + TableAlias = 'Order Details' + TableName = 'Order Details' + TableSQLAlias = 'Order_Details' + CalcType = dacaExpression + Expression = 'Order_Details.UnitPrice*Order_Details.Quantity' + end + object daField1: TdaField + Alias = 'Orderid' + DataType = dtInteger + DisplayWidth = 10 + FieldAlias = 'Orderid' + FieldLength = 10 + FieldName = 'OrderID' + SQLFieldName = 'OrderID' + TableAlias = 'Orders' + TableName = 'Orders' + TableSQLAlias = 'Orders' + end + object daField2: TdaField + Alias = 'Orderdate' + DataType = dtDateTime + DisplayWidth = 10 + FieldAlias = 'Orderdate' + FieldLength = 10 + FieldName = 'OrderDate' + SQLFieldName = 'OrderDate' + TableAlias = 'Orders' + TableName = 'Orders' + TableSQLAlias = 'Orders' + end + object daField3: TdaField + Alias = 'Productname' + DisplayWidth = 10 + FieldAlias = 'Productname' + FieldLength = 10 + FieldName = 'ProductName' + IsDetail = True + SQLFieldName = 'ProductName' + TableAlias = 'Products' + TableName = 'Products' + TableSQLAlias = 'Products' + end + object daField4: TdaField + Alias = 'Unitprice' + DataType = dtCurrency + DisplayWidth = 10 + FieldAlias = 'Unitprice' + FieldLength = 10 + FieldName = 'UnitPrice' + IsDetail = True + SQLFieldName = 'UnitPrice' + TableAlias = 'Order Details' + TableName = 'Order Details' + TableSQLAlias = 'Order_Details' + end + object daField5: TdaField + Alias = 'Quantity' + DataType = dtInteger + DisplayWidth = 10 + FieldAlias = 'Quantity' + FieldLength = 10 + FieldName = 'Quantity' + IsDetail = True + SQLFieldName = 'Quantity' + TableAlias = 'Order Details' + TableName = 'Order Details' + TableSQLAlias = 'Order_Details' + end + object daField6: TdaField + ChildType = 2 + Alias = 'Orderdate' + DataType = dtDateTime + DisplayWidth = 10 + FieldAlias = 'Orderdate' + FieldLength = 10 + FieldName = 'OrderDate' + SQLFieldName = 'OrderDate' + TableAlias = 'Orders' + TableName = 'Orders' + TableSQLAlias = 'Orders' + end + object daField7: TdaField + ChildType = 2 + Alias = 'Productname' + DisplayWidth = 10 + FieldAlias = 'Productname' + FieldLength = 10 + FieldName = 'ProductName' + SQLFieldName = 'ProductName' + TableAlias = 'Products' + TableName = 'Products' + TableSQLAlias = 'Products' + end + object daTable1: TdaTable + ChildType = 5 + Alias = 'Orders' + JoinType = dajtNone + SQLAlias = 'Orders' + TableAlias = 'Orders' + TableName = 'Orders' + end + object daTable2: TdaTable + ChildType = 5 + Alias = 'Order Details' + SQLAlias = 'Order_Details' + TableAlias = 'Order Details' + TableName = 'Order Details' + object daTableJoin1: TdaTableJoin + ChildType = 6 + object daField9: TdaField + ChildType = 3 + Alias = 'Orderid' + DataType = dtInteger + DisplayWidth = 10 + FieldAlias = 'Orderid' + FieldLength = 10 + FieldName = 'OrderID' + SQLFieldName = 'OrderID' + TableAlias = 'Order Details' + TableName = 'Order Details' + TableSQLAlias = 'Order_Details' + end + object daField8: TdaField + ChildType = 4 + Alias = 'Orderid' + DataType = dtInteger + DisplayWidth = 10 + FieldAlias = 'Orderid' + FieldLength = 10 + FieldName = 'OrderID' + SQLFieldName = 'OrderID' + TableAlias = 'Orders' + TableName = 'Orders' + TableSQLAlias = 'Orders' + end + end + end + object daTable3: TdaTable + ChildType = 5 + Alias = 'Products' + SQLAlias = 'Products' + TableAlias = 'Products' + TableName = 'Products' + object daTableJoin2: TdaTableJoin + ChildType = 6 + object daField11: TdaField + ChildType = 3 + Alias = 'Productid' + DataType = dtInteger + DisplayWidth = 10 + FieldAlias = 'Productid' + FieldLength = 10 + FieldName = 'ProductID' + SQLFieldName = 'ProductID' + TableAlias = 'Products' + TableName = 'Products' + TableSQLAlias = 'Products' + end + object daField10: TdaField + ChildType = 4 + Alias = 'Productid' + DataType = dtInteger + DisplayWidth = 10 + FieldAlias = 'Productid' + FieldLength = 10 + FieldName = 'ProductID' + SQLFieldName = 'ProductID' + TableAlias = 'Order Details' + TableName = 'Order Details' + TableSQLAlias = 'Order_Details' + end + end + end + end + end + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/ReportBuilder/daSDAC.pas b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/ReportBuilder/daSDAC.pas new file mode 100644 index 0000000..3364f92 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/ReportBuilder/daSDAC.pas @@ -0,0 +1,763 @@ + +////////////////////////////////////////////////// +// MS SQL Server Data Access Components +// Copyright © 1998,2000 Core Lab. All right reserved. +// ReportBuilder support +// Based on Digital Metaphors Corporation's demos +////////////////////////////////////////////////// + +unit daSDAC; + +interface +uses + Classes, SysUtils, Forms, ExtCtrls, DB, + ppClass, ppComm, ppDBPipe, ppDB, ppClasUt, ppTypes, + daDB, daDataView, daQueryDataView, daPreviewDataDlg, + MSAccess; + +type + {MS SQL Server Data Access Components (SDAC) DataView Classes: + 1. SDAC TDataSet descendants + - TDataSets that can be children of a DataView. + - Override the HasParent method of TComponent to return True + - Must be registerd with the Delphi IDE using the RegisterNoIcon procedure + + a. TdaChildSDACQuery - TMSQuery descendant that can be a child of a DataView + b. TdaChildSDACTable - TMSTable descendant that can be a child of a DataView + b. TdaChildSDACStoredProc - TMSStoredProc descendant that can be a child of a DataView + + 3. TdaSDACSession + - descendant of TppSession + - implements GetDatabaseNames, GetTableNames, etc. + + 4. TdaSDACDataSet + - descendant of TppDataSet + - implements GetFieldNames for SQL + + 5. TdaSDACQueryDataView + - descendant of TppQueryDataView + - uses the above classes to create the required + Query -> DataSource -> Pipeline -> Report connection + - uses the TdaSQL object built by the QueryWizard to assign + SQL to the TSDACQuery etc. + } + + { TdaChildSDACQuery } + TdaChildSDACQuery = class(TMSQuery) + public + function HasParent: Boolean; override; + end; {class, TdaChildSDACQuery} + + { TdaChildSDACTable } + TdaChildSDACTable = class(TMSTable) + public + function HasParent: Boolean; override; + end; {class, TdaChildSDACTable} + + { TdaChildSDACStoredProc } + TdaChildSDACStoredProc = class(TMSStoredProc) + public + function HasParent: Boolean; override; + end; {class, TdaChildSDACStoredProc} + + { TdaSDACSession } + TdaSDACSession = class(TdaSession) + private + + procedure AddDatabase(aDatabase: TComponent); + + protected + procedure SetDataOwner(aDataOwner: TComponent); override; + + public + class function ClassDescription: String; override; + class function DataSetClass: TdaDataSetClass; override; + class function DatabaseClass: TComponentClass; override; + + procedure GetDatabaseNames(aList: TStrings); override; + function GetDatabaseType(const aDatabaseName: String): TppDatabaseType; override; + procedure GetTableNames(const aDatabaseName: String; aList: TStrings); override; + function ValidDatabaseTypes: TppDatabaseTypes; override; + end; {class, TdaSDACSession} + + { TdaSDACDataSet } + TdaSDACDataSet = class(TdaDataSet) + private + FQuery: TMSQuery; + FConnection: TMSConnection; + + function GetQuery: TMSQuery; + + protected + procedure BuildFieldList; override; + function GetActive: Boolean; override; + procedure SetActive(Value: Boolean); override; + procedure SetDatabase(aDatabase: TComponent); override; + procedure SetDataName(const aDataName: String); override; + + property Query: TMSQuery read GetQuery; + + public + constructor Create(aOwner: TComponent); override; + destructor Destroy; override; + + class function ClassDescription: String; override; + + procedure GetFieldNamesForSQL(aList: TStrings; aSQL: TStrings); override; + procedure GetFieldsForSQL(aList: TList; aSQL: TStrings); override; + end; {class, TdaSDACDataSet} + + { TdaSDACQueryDataView } + TdaSDACQueryDataView = class(TdaQueryDataView) + private + FDataSource: TppChildDataSource; + FQuery: TdaChildSDACQuery; + + protected + procedure SQLChanged; override; + + public + constructor Create(aOwner: TComponent); override; + destructor Destroy; override; + + class function PreviewFormClass: TFormClass; override; + class function SessionClass: TClass; override; + + procedure Init; override; + procedure ConnectPipelinesToData; override; + + published + property DataSource: TppChildDataSource read FDataSource; + + end; {class, TdaSDACQueryDataView} + + + {global functions to access default SDAC connection} + function daGetDefaultSDACConnection: TMSConnection; + + {utility routines} + procedure daGetSDACConnectionNames(aList: TStrings); + function daGetSDACConnectionForName(aDatabaseName: String): TMSConnection; + function daSDACConnectToDatabase(aDatabaseName: String): Boolean; + + function daGetSDACConnectionList: TppComponentList; + + {Delphi design time registration} + procedure Register; + +implementation + +const + cDefaultConnection = 'DefaultSDACConnection'; + +var + FSDACConnection: TMSConnection; + FSDACConnectionList: TppComponentList; + + +{****************************************************************************** + * + ** R E G I S T E R + * +{******************************************************************************} + +procedure Register; +begin + {SDAC DataAccess Components} + RegisterNoIcon([TdaChildSDACQuery, TdaChildSDACTable, TdaChildSDACStoredProc]); + + {SDAC DataViews} + RegisterNoIcon([TdaSDACQueryDataView]); +end; + + +{****************************************************************************** + * + ** C H I L D S D A C D A T A A C C E S S C O M P O N E N T S + * +{******************************************************************************} + +{------------------------------------------------------------------------------} +{ TdaChildSDACQuery.HasParent } + +function TdaChildSDACQuery.HasParent: Boolean; +begin + Result := True; +end; {function, HasParent} + +{------------------------------------------------------------------------------} +{ TdaChildSDACTable.HasParent } + +function TdaChildSDACTable.HasParent: Boolean; +begin + Result := True; +end; {function, HasParent} + +{------------------------------------------------------------------------------} +{ TdaChildSDACStoredProc.HasParent } + +function TdaChildSDACStoredProc.HasParent: Boolean; +begin + Result := True; +end; {function, HasParent} + +{****************************************************************************** + * + ** S D A C S E S S I O N + * +{******************************************************************************} + +{------------------------------------------------------------------------------} +{ TdaSDACSession.ClassDescription } + +class function TdaSDACSession.ClassDescription: String; +begin + Result := 'SDACSession'; +end; {class function, ClassDescription} + +{------------------------------------------------------------------------------} +{ TdaSDACSession.DataSetClass } + +class function TdaSDACSession.DataSetClass: TdaDataSetClass; +begin + Result := TdaSDACDataSet; +end; {class function, DataSetClass} + +{------------------------------------------------------------------------------} +{ TdaSDACSession.DatabaseClass } + +class function TdaSDACSession.DatabaseClass: TComponentClass; +begin + Result := TMSConnection; +end; + +{------------------------------------------------------------------------------} +{ TdaSDACSession.GetDatabaseType } + +function TdaSDACSession.GetDatabaseType(const aDatabaseName: String): TppDatabaseType; +begin + Result := dtMSSQLServer; +end; {procedure, GetDatabaseType} + +{------------------------------------------------------------------------------} +{ TdaSDACSession.GetTableNames } + +procedure TdaSDACSession.GetTableNames(const aDatabaseName: String; aList: TStrings); + procedure GetTablesList(const Connection: TMSconnection; List: TStrings); + var + MDDS: TMSMetadata; + + procedure AddNamesToList; + var + NameFld: TStringField; + begin + MDDS.Open; + + NameFld := MDDS.FieldByName('TABLE_NAME') as TStringField; + while not MDDS.Eof do begin + List.Add(NameFld.Value); + MDDS.Next + end; + end; + + begin + if Connection = nil then + Exit; + + MDDS := nil; + try + MDDS := TMSMetadata.Create(nil); + MDDS.Connection := Connection; + MDDS.DatabaseName := MDDS.Connection.Database; + + MDDS.ObjectType := otTables; + AddNamesToList; + + MDDS.ObjectType := otViews; + AddNamesToList; + + if List is TStringList then + TStringList(List).Sort; + finally + MDDS.Free; + end; + end; + +begin + aList.Clear; + + {get list of table names from a table object} + if not daSDACConnectToDatabase(aDatabaseName) then Exit; + + GetTablesList(daGetSDACConnectionForName(aDatabaseName), aList); +end; {procedure, GetTableNames} + +{------------------------------------------------------------------------------} +{ TdaSDACSession.AddDatabase } + +procedure TdaSDACSession.AddDatabase(aDatabase: TComponent); +begin + if daGetSDACConnectionList.IndexOf(aDatabase) < 0 then + FSDACConnectionList.Add(aDatabase); +end; {procedure, AddDatabase} + +{------------------------------------------------------------------------------} +{ TdaSDACSession.GetDatabaseNames } + +procedure TdaSDACSession.GetDatabaseNames(aList: TStrings); +var + liIndex: Integer; +begin +// GetDatabasesList(FSDACConnection, aList); + + {call utility routine to get list of database names} + //daGetSDACConnectionNames(aList); + + daGetDatabaseObjectsFromOwner(TdaSessionClass(Self.ClassType), aList, DataOwner); + + for liIndex := 0 to aList.Count-1 do + if aList.Objects[liIndex] <> nil then + AddDatabase(TComponent(aList.Objects[liIndex]));//*) +end; {procedure, GetDatabaseNames} + +{------------------------------------------------------------------------------} +{ TdaSDACSession.SetDataOwner } + +procedure TdaSDACSession.SetDataOwner(aDataOwner: TComponent); +var + lList: TStringList; +begin + inherited SetDataOwner(aDataOwner); + + lList := TStringList.Create; + + GetDatabaseNames(lList); + + lList.Free; +end; {procedure, SetDataOwner} + +{------------------------------------------------------------------------------} +{ TdaSDACSession.ValidDatabaseTypes } + +function TdaSDACSession.ValidDatabaseTypes: TppDatabaseTypes; +begin + Result := [dtMSSQLServer]; +end; {function, ValidDatabaseTypes} + +{****************************************************************************** + * + ** S D A C D A T A S E T + * +{******************************************************************************} + +{------------------------------------------------------------------------------} +{ TdaSDACDataSet.Create } + +constructor TdaSDACDataSet.Create(aOwner: TComponent); +begin + inherited Create(aOwner); + + FQuery := nil; +end; {constructor, Create} + +{------------------------------------------------------------------------------} +{ TdaSDACDataSet.Destroy } + +destructor TdaSDACDataSet.Destroy; +begin + FQuery.Free; + + inherited Destroy; +end; {destructor, Destroy} + +{------------------------------------------------------------------------------} +{ TdaSDACDataSet.ClassDescription } + +class function TdaSDACDataSet.ClassDescription: String; +begin + Result := 'SDACDataSet'; +end; {class function, ClassDescription} + +{------------------------------------------------------------------------------} +{ TdaSDACDataSet.GetActive } + +function TdaSDACDataSet.GetActive: Boolean; +begin + Result := GetQuery.Active +end; {function, GetActive} + +{------------------------------------------------------------------------------} +{ TdaSDACDataSet.SetActive } + +procedure TdaSDACDataSet.SetActive(Value: Boolean); +begin + GetQuery.Active := Value; +end; {procedure, SetActive} + +{------------------------------------------------------------------------------} +{ TdaSDACDataSet.GetQuery } + +function TdaSDACDataSet.GetQuery: TMSQuery; +begin + {create SDACDataSet, if needed} + if (FQuery = nil) then + FQuery := TMSQuery.Create(Self); + + Result := FQuery; +end; {procedure, GetQuery} + +{------------------------------------------------------------------------------} +{ TdaSDACDataSet.SetDatabase } + +procedure TdaSDACDataSet.SetDatabase(aDatabase: TComponent); +begin + inherited SetDatabase(aDatabase); + + {table cannot be active to set database property} + if GetQuery.Active then + FQuery.Active := False; + + FConnection := (aDatabase as TMSConnection); + {get SDAC Connection for name} + FQuery.Connection := FConnection; +end; {procedure, SetDatabaseName} + +{------------------------------------------------------------------------------} +{ TdaSDACDataSet.SetDataName } + +procedure TdaSDACDataSet.SetDataName(const aDataName: String); +begin + inherited SetDataName(aDataName); + + {dataset cannot be active to set data name} + if GetQuery.Active then + FQuery.Active := False; + + {construct an SQL statment that returns an empty result set, + this is used to get the field information } + FQuery.SQL.Text := 'SELECT * FROM ' + aDataName + + ' WHERE ''c'' <> ''c'' '; +end; {procedure, SetDataName} + +{------------------------------------------------------------------------------} +{ TdaSDACDataSet.BuildFieldList } + +procedure TdaSDACDataSet.BuildFieldList; +var + liIndex: Integer; + lQueryField: TField; + lField: TppField; +begin + inherited BuildFieldList; + + + {set table to active} + if not(GetQuery.Active) then + FQuery.Active := True; + + {create TppField objects for each field in the table} + for liIndex := 0 to FQuery.FieldCount - 1 do begin + lQueryField := FQuery.Fields[liIndex]; + + lField := TppField.Create(nil); + + lField.TableName := DataName; + lField.FieldName := lQueryField.FieldName; + lField.DataType := ppConvertFieldType(lQueryField.DataType); + + AddField(lField); + end; +end; {function, BuildFieldList} + +{------------------------------------------------------------------------------} +{ TdaSDACDataSet.GetFieldNamesForSQL } + +procedure TdaSDACDataSet.GetFieldNamesForSQL(aList: TStrings; aSQL: TStrings); +var + lQuery: TMSQuery; +begin + aList.Clear; + + {create a temporary query} + lQuery := TMSQuery.Create(Self); + + {set the database and SQL properties} + lQuery.Connection := FConnection; + lQuery.SQL := aSQL; + + {get the field names} + lQuery.GetFieldNames(aList); + + lQuery.Free; +end; {procedure, GetFieldNamesForSQL} + +{------------------------------------------------------------------------------} +{ TdaSDACDataSet.GetFieldsForSQL } + +procedure TdaSDACDataSet.GetFieldsForSQL(aList: TList; aSQL: TStrings); +var + lQuery: TMSQuery; + lQueryField: TField; + lField: TppField; + liIndex: Integer; +begin + aList.Clear; + + {create a temporary query} + lQuery := TMSQuery.Create(Self); + + {assign databae and SQL properties} + lQuery.Connection := FConnection; + lQuery.SQL := aSQL; + + {set query to active} + lQuery.Active := True; + + {create a TppField object for each field in the query} + for liIndex := 0 to lQuery.FieldCount - 1 do begin + lQueryField := lQuery.Fields[liIndex]; + + lField := TppField.Create(nil); + + lField.FieldName := lQueryField.FieldName; + lField.DataType := ppConvertFieldType(lQueryField.DataType); + + aList.Add(lField); + end; + + lQuery.Free; +end; {procedure, GetFieldsForSQL} + + + +{****************************************************************************** + * + ** S D A C Q U E R Y D A T A V I E W + * +{******************************************************************************} + +{------------------------------------------------------------------------------} +{ TdaSDACQueryDataView.Create } + +constructor TdaSDACQueryDataView.Create(aOwner: TComponent); +begin + + inherited Create(aOwner); + + {notes: 1. must use ChildQuery, ChildDataSource, ChildPipeline etc. + 2. use Self as owner for Query, DataSource etc. + 3. do NOT assign a Name } + + FQuery := TdaChildSDACQuery.Create(Self); + + FDataSource := TppChildDataSource.Create(Self); + FDataSource.DataSet := FQuery; + +end; {constructor, Create} + +{------------------------------------------------------------------------------} +{ TdaSDACQueryDataView.Destroy } + +destructor TdaSDACQueryDataView.Destroy; +begin + FDataSource.Free; + FQuery.Free; + + inherited Destroy; + +end; {destructor, Destroy} + +{------------------------------------------------------------------------------} +{ TdaSDACQueryDataView.PreviewFormClass } + +class function TdaSDACQueryDataView.PreviewFormClass: TFormClass; +begin + Result := TFormClass(GetClass('TdaPreviewDataDialog')); +end; {class function, PreviewFormClass} + +{------------------------------------------------------------------------------} +{ TdaSDACQueryDataView.SessionClass } + +class function TdaSDACQueryDataView.SessionClass: TClass; +begin + Result := TdaSDACSession; +end; {class function, SessionClass} + +{------------------------------------------------------------------------------} +{ TdaSDACQueryDataView.ConnectPipelinesToData } + +procedure TdaSDACQueryDataView.ConnectPipelinesToData; +begin + + if DataPipelineCount = 0 then Exit; + + {need to reconnect here} + TppDBPipeline(DataPipelines[0]).DataSource := FDataSource; + +end; {procedure, ConnectPipelinesToData} + +{------------------------------------------------------------------------------} +{ TdaSDACQueryDataView.Init } + +procedure TdaSDACQueryDataView.Init; +var + lDataPipeline: TppChildDBPipeline; + +begin + + inherited Init; + + if DataPipelineCount > 0 then Exit; + + {note: DataView's owner must own the DataPipeline } + lDataPipeline := TppChildDBPipeline(ppComponentCreate(Self, TppChildDBPipeline)); + lDataPipeline.DataSource := FDataSource; + + lDataPipeline.AutoCreateFields := False; + + {add DataPipeline to the dataview } + lDataPipeline.DataView := Self; + +end; {procedure, Init} + +{------------------------------------------------------------------------------} +{ TdaSDACQueryDataView.SQLChanged } + +procedure TdaSDACQueryDataView.SQLChanged; +begin + + if FQuery.Active then + FQuery.Close; + + FQuery.Connection := daGetSDACConnectionForName(SQL.DatabaseName); + FQuery.SQL := SQL.MagicSQLText; + +end; {procedure, SQLChanged} + + +{****************************************************************************** + * + ** P R O C E D U R E S A N D F U N C T I O N S + * +{******************************************************************************} + +{------------------------------------------------------------------------------} +{ daGetDefaultSDACConnection } + +function daGetDefaultSDACConnection: TMSConnection; +begin + {create the default Connection, if needed} + if (FSDACConnection = nil) then begin + {create default SDAC Connection} + FSDACConnection := TMSConnection.Create(nil); + FSDACConnection.Name := cDefaultConnection; + end; + + Result := FSDACConnection; +end; {function, daGetDefaultSDACConnection} + +{------------------------------------------------------------------------------} +{ daGetSDACConnectionNames } + +procedure daGetSDACConnectionNames(aList: TStrings); +begin +end; {procedure, daGetSDACConnectionNames} + +{------------------------------------------------------------------------------} +{ daGetSDACConnectionForName } + +function daGetSDACConnectionForName(aDatabaseName: String): TMSConnection; +var + liIndex: Integer; +begin + Result := nil; + + liIndex := 0; + + {check for a database object with this name} + while (Result = nil) and (liIndex < daGetSDACConnectionList.Count) do + begin + if (AnsiCompareStr(FSDACConnectionList[liIndex].Name, aDatabaseName) = 0) or + (AnsiCompareStr(TMSConnection(FSDACConnectionList[liIndex]).Server, aDatabaseName) = 0) + then + Result := TMSConnection(FSDACConnectionList[liIndex]); + Inc(liIndex); + end; + + if (Result <> nil) then + Exit; + + {use the default database object} + Result := daGetDefaultSDACConnection; + + {set DatabaseName property, if needed} + if (Result.Server <> aDatabaseName) then begin + if Result.Connected then + Result.Connected := False; + Result.Server := aDatabaseName; + end; +end; {function, daGetSDACConnectionForName} + +{------------------------------------------------------------------------------} +{ daSDACConnectToDatabase } + +function daSDACConnectToDatabase(aDatabaseName: String): Boolean; +var + lConnection: TMSConnection; +begin + Result := False; + + lConnection := daGetSDACConnectionForName(aDatabaseName); + + if (lConnection = nil) then + Exit; + + if not lConnection.Connected then begin + if (lConnection = daGetDefaultSDACConnection) then + lConnection.Connected := True + else + lConnection.Connected := True; + end; + + Result := lConnection.Connected; +end; {function, daSDACConnectToDatabase} + + +{------------------------------------------------------------------------------} +{ daGetSDACConnectionList } + +function daGetSDACConnectionList: TppComponentList; +begin + if (FSDACConnectionList = nil) then + FSDACConnectionList := TppComponentList.Create(nil); + + Result := FSDACConnectionList; +end; {function, daGetSDACConnectionList} + + +initialization + {register the SDAC descendant classes} + RegisterClasses([TdaChildSDACQuery, TdaChildSDACTable, TdaChildSDACStoredProc]); + + {register DADE descendant session, dataset, dataview} + daRegisterSession(TdaSDACSession); + daRegisterDataSet(TdaSDACDataSet); + daRegisterDataView(TdaSDACQueryDataView); + + {initialize internal reference variables} + FSDACConnection := nil; + FSDACConnectionList := nil; + +finalization + {free the default connection object} + FSDACConnection.Free; + FSDACConnectionList.Free; + + {unregister the SDAC descendant classes} + UnRegisterClasses([TdaChildSDACQuery, TdaChildSDACTable, TdaChildSDACStoredProc]); + + {unregister DADE descendant the session, dataset, dataview} + daUnRegisterSession(TdaSDACSession); + daUnRegisterDataSet(TdaSDACDataSet); + daUnRegisterDataView(TdaSDACQueryDataView); +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/ReportBuilder/myEURpt.dfm b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/ReportBuilder/myEURpt.dfm new file mode 100644 index 0000000..b6ccbcd --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/ReportBuilder/myEURpt.dfm @@ -0,0 +1,1159 @@ +object myEndUserSolution: TmyEndUserSolution + Left = 244 + Top = 44 + AutoScroll = False + Caption = 'EndUser: MSSQLServer via SDAC' + ClientHeight = 579 + ClientWidth = 427 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + Icon.Data = { + 0000010001002020100000000000E80200001600000028000000200000004000 + 0000010004000000000080020000000000000000000000000000000000000000 + 0000000080000080000000808000800000008000800080800000C0C0C0008080 + 80000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000884000000000000 + 000083BBBBB34003BBBBB800000000000004BBBBBBBB308BBBBBBB0000000000 + 00003BBBBBB3403BBBBBB3000000000000000BBBBBB404BBBBBB300000000000 + 000003BBBBB008BBBBBB800000000000000003BBBBB003BBBBBB000000000000 + 000003BBBBB48BBBBBB3000000000000000003BBBBBBBBBBBB30000000000000 + 000003BBBBBBBBBBB800000000000000000003BBBBB33BBBBB80000000000000 + 000003BBBBB003BBBBB4000000000000000003BBBBB003BBBBB8000000000000 + 000003BBBBB003BBBBB300000000000000000BBBBBB84BBBBBB8000000000000 + 00043BBBBBBBBBBBBBB00000000000000004BBBBBBBBBBBBB340000000000000 + 0000433888883338400000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8FFFF00 + 603FFE00403FFF00403FFF80807FFF81807FFF8180FFFF8000FFFF8001FFFF80 + 03FFFF8001FFFF8180FFFF8180FFFF8180FFFF8000FFFE0001FFFE0001FFFF00 + 07FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF} + OldCreateOrder = True + Position = poScreenCenter + ShowHint = True + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + object Shape8: TShape + Left = 181 + Top = 454 + Width = 2 + Height = 28 + Brush.Style = bsClear + Pen.Width = 2 + Shape = stRoundRect + Visible = False + end + object Shape20: TShape + Left = 181 + Top = 362 + Width = 2 + Height = 25 + Brush.Style = bsClear + Pen.Width = 2 + Shape = stRoundRect + Visible = False + end + object Shape7: TShape + Left = 222 + Top = 327 + Width = 38 + Height = 2 + Brush.Style = bsClear + Pen.Width = 2 + Shape = stRoundRect + Visible = False + end + object Shape26: TShape + Left = 181 + Top = 258 + Width = 2 + Height = 81 + Brush.Style = bsClear + Pen.Width = 2 + Shape = stRoundRect + Visible = False + end + object Shape25: TShape + Left = 93 + Top = 220 + Width = 56 + Height = 2 + Brush.Style = bsClear + Pen.Width = 2 + Shape = stRoundRect + Visible = False + end + object Shape24: TShape + Left = 94 + Top = 263 + Width = 56 + Height = 2 + Brush.Style = bsClear + Pen.Width = 2 + Shape = stRoundRect + Visible = False + end + object Shape1: TShape + Left = 254 + Top = 295 + Width = 103 + Height = 72 + Brush.Color = clRed + Shape = stRoundRect + Visible = False + end + object Shape4: TShape + Left = 7 + Top = 246 + Width = 103 + Height = 72 + Brush.Color = clYellow + Shape = stRoundRect + Visible = False + end + object Shape11: TShape + Left = 253 + Top = 205 + Width = 103 + Height = 72 + Brush.Color = clNavy + Shape = stRoundRect + Visible = False + end + object Label6: TLabel + Left = 277 + Top = 210 + Width = 55 + Height = 13 + Caption = 'Database' + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -12 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentColor = False + ParentFont = False + Transparent = True + Visible = False + end + object Shape12: TShape + Left = 254 + Top = 226 + Width = 102 + Height = 1 + Brush.Color = clBlack + Visible = False + end + object Shape9: TShape + Left = 130 + Top = 386 + Width = 103 + Height = 72 + Brush.Color = clTeal + Shape = stRoundRect + Visible = False + end + object Label5: TLabel + Left = 137 + Top = 391 + Width = 89 + Height = 13 + Caption = 'Data Dictionary' + Color = clWhite + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -12 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentColor = False + ParentFont = False + Transparent = True + Visible = False + end + object Shape10: TShape + Left = 131 + Top = 407 + Width = 102 + Height = 1 + Visible = False + end + object Shape6: TShape + Left = 130 + Top = 294 + Width = 103 + Height = 72 + Brush.Color = clBlue + Shape = stRoundRect + Visible = False + end + object Label7: TLabel + Left = 156 + Top = 299 + Width = 51 + Height = 13 + Caption = 'Designer' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -12 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + Transparent = True + Visible = False + end + object Shape5: TShape + Left = 131 + Top = 315 + Width = 101 + Height = 1 + Visible = False + end + object Label8: TLabel + Left = 43 + Top = 251 + Width = 31 + Height = 13 + Caption = 'Items' + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -12 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + Transparent = True + Visible = False + end + object Shape3: TShape + Left = 8 + Top = 267 + Width = 101 + Height = 1 + Visible = False + end + object Label1: TLabel + Left = 286 + Top = 300 + Width = 39 + Height = 13 + Caption = 'Report' + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -12 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentColor = False + ParentFont = False + Transparent = True + Visible = False + end + object Shape2: TShape + Left = 255 + Top = 316 + Width = 101 + Height = 1 + Brush.Color = clBlack + Visible = False + end + object Shape15: TShape + Left = 8 + Top = 165 + Width = 103 + Height = 72 + Brush.Color = clLime + Shape = stRoundRect + Visible = False + end + object Label2: TLabel + Left = 38 + Top = 170 + Width = 42 + Height = 13 + Caption = 'Folders' + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -12 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + Transparent = True + Visible = False + end + object Shape16: TShape + Left = 8 + Top = 185 + Width = 102 + Height = 1 + Visible = False + end + object Shape22: TShape + Left = 130 + Top = 205 + Width = 103 + Height = 72 + Brush.Color = clFuchsia + Shape = stRoundRect + Visible = False + end + object Label10: TLabel + Left = 158 + Top = 210 + Width = 47 + Height = 13 + Caption = 'Explorer' + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -12 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + Transparent = True + Visible = False + end + object Shape23: TShape + Left = 131 + Top = 226 + Width = 101 + Height = 1 + Visible = False + end + object Shape29: TShape + Left = 66 + Top = 467 + Width = 2 + Height = 16 + Brush.Style = bsClear + Pen.Width = 2 + Shape = stRoundRect + Visible = False + end + object Shape18: TShape + Left = 16 + Top = 477 + Width = 103 + Height = 72 + Brush.Color = clAqua + Shape = stRoundRect + Visible = False + end + object Shape17: TShape + Left = 291 + Top = 467 + Width = 2 + Height = 17 + Brush.Style = bsClear + Pen.Width = 2 + Shape = stRoundRect + Visible = False + end + object Shape13: TShape + Left = 132 + Top = 478 + Width = 103 + Height = 72 + Brush.Color = clAqua + Shape = stRoundRect + Visible = False + end + object Label3: TLabel + Left = 166 + Top = 483 + Width = 34 + Height = 13 + Caption = 'Fields' + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -12 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + Transparent = True + Visible = False + end + object Shape14: TShape + Left = 133 + Top = 499 + Width = 102 + Height = 1 + Visible = False + end + object Label9: TLabel + Left = 48 + Top = 482 + Width = 39 + Height = 13 + Caption = 'Tables' + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -12 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + Transparent = True + Visible = False + end + object Shape19: TShape + Left = 17 + Top = 498 + Width = 102 + Height = 1 + Visible = False + end + object Shape21: TShape + Left = 245 + Top = 477 + Width = 103 + Height = 72 + Brush.Color = clAqua + Shape = stRoundRect + Visible = False + end + object Shape27: TShape + Left = 246 + Top = 498 + Width = 102 + Height = 1 + Visible = False + end + object Label4: TLabel + Left = 280 + Top = 482 + Width = 30 + Height = 13 + Caption = 'Joins' + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -12 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + Transparent = True + Visible = False + end + object Shape28: TShape + Left = 67 + Top = 467 + Width = 226 + Height = 2 + Brush.Style = bsClear + Pen.Width = 2 + Shape = stRoundRect + Visible = False + end + object btnLaunch: TButton + Left = 342 + Top = 165 + Width = 75 + Height = 25 + Caption = 'Launch' + TabOrder = 0 + OnClick = btnLaunchClick + end + object Memo1: TMemo + Left = 7 + Top = 5 + Width = 411 + Height = 150 + Lines.Strings = ( + 'End-User Reporting using MSSQLServer with the SDAC' + + '----------------------------------------------------------------' + + '---------------------------') + ReadOnly = True + TabOrder = 1 + end + object pnlStatusBar: TPanel + Left = 0 + Top = 561 + Width = 427 + Height = 18 + Align = alBottom + Alignment = taLeftJustify + TabOrder = 2 + end + object btCreate: TButton + Left = 120 + Top = 165 + Width = 75 + Height = 25 + Caption = 'Create' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + TabOrder = 3 + OnClick = btCreateClick + end + object btDrop: TButton + Left = 200 + Top = 165 + Width = 75 + Height = 25 + Caption = 'Drop' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + TabOrder = 4 + OnClick = btDropClick + end + object seDatabase: TMSConnection + Database = 'SDACDemos' + Authentication = auServer + Username = 'Sa' + Server = 'server' + Left = 289 + Top = 233 + end + object tblTable: TMSTable + TableName = 'RB_TABLE' + Connection = seDatabase + Left = 21 + Top = 508 + end + object dsTable: TDataSource + DataSet = tblTable + Left = 52 + Top = 508 + end + object plTable: TppDBPipeline + DataSource = dsTable + UserName = 'Table' + Visible = False + Left = 85 + Top = 508 + end + object tblField: TMSTable + TableName = 'RB_FIELD' + Connection = seDatabase + Left = 137 + Top = 509 + end + object dsField: TDataSource + DataSet = tblField + Left = 169 + Top = 509 + end + object plField: TppDBPipeline + DataSource = dsField + UserName = 'Field' + Visible = False + Left = 201 + Top = 508 + end + object ppDataDictionary: TppDataDictionary + AutoJoin = True + BuilderSettings.DatabaseName = 'seDatabase' + BuilderSettings.SessionType = 'SDACSession' + FieldFieldNames.AutoSearch = 'AUTOSEARCH' + FieldFieldNames.DataType = 'DATATYPE' + FieldFieldNames.FieldName = 'FIELD_NAME' + FieldFieldNames.FieldAlias = 'FIELD_ALIAS' + FieldFieldNames.Mandatory = 'MANDATORY' + FieldFieldNames.Searchable = 'SEARCHABLE' + FieldFieldNames.Selectable = 'SORTABLE' + FieldFieldNames.Sortable = 'SORTABLE' + FieldFieldNames.TableName = 'table_name' + FieldPipeline = plField + JoinFieldNames.TableName1 = 'TABLE_NAME1' + JoinFieldNames.TableName2 = 'TABLE_NAME2' + JoinFieldNames.JoinType = 'JOIN_TYPE' + JoinFieldNames.FieldNames1 = 'FIELD_NAMES1' + JoinFieldNames.FieldNames2 = 'FIELD_NAMES2' + JoinFieldNames.Operators = 'OPERATORS' + JoinPipeline = plJoin + TableFieldNames.TableName = 'TABLE_NAME' + TableFieldNames.TableAlias = 'TABLE_ALIAS' + TablePipeline = plTable + UserName = 'DataDictionary' + UseTableOwnerName = True + ValidateFieldNames = False + ValidateTableNames = False + Left = 169 + Top = 416 + end + object ppDesigner: TppDesigner + AllowDataSettingsChange = True + Caption = 'ReportBuilder Pro' + DataSettings.DatabaseName = 'seDatabase' + DataSettings.SessionType = 'SDACSession' + DataSettings.AllowEditSQL = True + DataSettings.DatabaseType = dtMSSQLServer + DataSettings.DataDictionary = ppDataDictionary + DataSettings.GuidCollationType = gcString + DataSettings.IsCaseSensitive = True + DataSettings.SQLType = sqSQL1 + DataSettings.UseDataDictionary = True + Position = poScreenCenter + Report = ppReport + IniStorageType = 'IniFile' + IniStorageName = '($WINSYS)\RBuilder.ini' + WindowHeight = 400 + WindowLeft = 100 + WindowTop = 50 + WindowWidth = 600 + Left = 170 + Top = 323 + end + object tblItem: TMSTable + TableName = 'RB_ITEM' + Connection = seDatabase + Left = 14 + Top = 277 + end + object dsItem: TDataSource + DataSet = tblItem + Left = 46 + Top = 278 + end + object plItem: TppDBPipeline + DataSource = dsItem + RefreshAfterPost = True + UserName = 'plItem' + Visible = False + Left = 77 + Top = 278 + end + object ppReport: TppReport + AutoStop = False + DataPipeline = SDACQueryDataView1.plDept + PrinterSetup.BinName = 'Default' + PrinterSetup.DocumentName = 'Report' + PrinterSetup.PaperName = 'Letter 8 1/2 x 11 in' + PrinterSetup.PrinterName = 'Default' + PrinterSetup.mmMarginBottom = 6350 + PrinterSetup.mmMarginLeft = 6350 + PrinterSetup.mmMarginRight = 6350 + PrinterSetup.mmMarginTop = 6350 + PrinterSetup.mmPaperHeight = 279401 + PrinterSetup.mmPaperWidth = 215900 + PrinterSetup.PaperSize = 1 + Template.DatabaseSettings.DataPipeline = plItem + Template.DatabaseSettings.Name = 'Dept' + Template.DatabaseSettings.NameField = 'Name' + Template.DatabaseSettings.TemplateField = 'Template' + Template.FileName = 'D:\NDF\Delphi\odac3\Demos\ReportBuilder\Reports\Dept.rtm' + Template.SaveTo = stDatabase + Units = utScreenPixels + DeviceType = 'Screen' + OutlineSettings.CreateNode = True + OutlineSettings.CreatePageNodes = True + OutlineSettings.Enabled = False + OutlineSettings.Visible = False + TextSearchSettings.DefaultString = '' + TextSearchSettings.Enabled = False + Left = 289 + Top = 326 + Version = '9.01' + mmColumnWidth = 0 + DataPipelineName = 'plDept' + object ppTitleBand1: TppTitleBand + mmBottomOffset = 0 + mmHeight = 13229 + mmPrintPosition = 0 + object ppLabel1: TppLabel + UserName = 'Label1' + Border.BorderPositions = [] + Border.Color = clBlack + Border.Style = psSolid + Border.Visible = False + Border.Weight = 1.000000000000000000 + Caption = 'Departaments' + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Name = 'Arial' + Font.Size = 20 + Font.Style = [fsBold, fsItalic] + Transparent = True + mmHeight = 8467 + mmLeft = 77788 + mmTop = 1852 + mmWidth = 47625 + BandType = 1 + end + object ppSystemVariable1: TppSystemVariable + UserName = 'SystemVariable1' + Border.BorderPositions = [] + Border.Color = clBlack + Border.Style = psSolid + Border.Visible = False + Border.Weight = 1.000000000000000000 + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Name = 'Arial' + Font.Size = 8 + Font.Style = [] + Transparent = True + mmHeight = 3704 + mmLeft = 188384 + mmTop = 529 + mmWidth = 14288 + BandType = 1 + end + end + object ppHeaderBand1: TppHeaderBand + mmBottomOffset = 0 + mmHeight = 7673 + mmPrintPosition = 0 + object ppLabel2: TppLabel + UserName = 'Label2' + Border.BorderPositions = [] + Border.Color = clBlack + Border.Style = psSolid + Border.Visible = False + Border.Weight = 1.000000000000000000 + Caption = 'Number' + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Name = 'Arial' + Font.Size = 10 + Font.Style = [fsBold] + Transparent = True + mmHeight = 4233 + mmLeft = 7673 + mmTop = 529 + mmWidth = 13229 + BandType = 0 + end + object ppLabel3: TppLabel + UserName = 'Label3' + Border.BorderPositions = [] + Border.Color = clBlack + Border.Style = psSolid + Border.Visible = False + Border.Weight = 1.000000000000000000 + Caption = 'Name' + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Name = 'Arial' + Font.Size = 10 + Font.Style = [fsBold] + Transparent = True + mmHeight = 4233 + mmLeft = 26988 + mmTop = 529 + mmWidth = 9790 + BandType = 0 + end + object ppLabel4: TppLabel + UserName = 'Label4' + Border.BorderPositions = [] + Border.Color = clBlack + Border.Style = psSolid + Border.Visible = False + Border.Weight = 1.000000000000000000 + Caption = 'Location' + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Name = 'Arial' + Font.Size = 10 + Font.Style = [fsBold] + Transparent = True + mmHeight = 4233 + mmLeft = 81492 + mmTop = 794 + mmWidth = 14552 + BandType = 0 + end + object ppShape1: TppShape + UserName = 'Shape1' + mmHeight = 265 + mmLeft = 4498 + mmTop = 6085 + mmWidth = 191294 + BandType = 0 + end + end + object ppDetailBand1: TppDetailBand + mmBottomOffset = 0 + mmHeight = 6615 + mmPrintPosition = 0 + object ppDBText1: TppDBText + UserName = 'DBText1' + Border.BorderPositions = [] + Border.Color = clBlack + Border.Style = psSolid + Border.Visible = False + Border.Weight = 1.000000000000000000 + DataField = 'DEPTNO' + DataPipeline = SDACQueryDataView1.plDept + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Name = 'Arial' + Font.Size = 10 + Font.Style = [] + Transparent = True + DataPipelineName = 'plDept' + mmHeight = 4233 + mmLeft = 7673 + mmTop = 1323 + mmWidth = 17198 + BandType = 4 + end + object ppDBText2: TppDBText + UserName = 'DBText2' + Border.BorderPositions = [] + Border.Color = clBlack + Border.Style = psSolid + Border.Visible = False + Border.Weight = 1.000000000000000000 + DataField = 'DNAME' + DataPipeline = SDACQueryDataView1.plDept + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Name = 'Arial' + Font.Size = 10 + Font.Style = [] + Transparent = True + DataPipelineName = 'plDept' + mmHeight = 4233 + mmLeft = 27252 + mmTop = 1323 + mmWidth = 52123 + BandType = 4 + end + object ppDBText3: TppDBText + UserName = 'DBText3' + Border.BorderPositions = [] + Border.Color = clBlack + Border.Style = psSolid + Border.Visible = False + Border.Weight = 1.000000000000000000 + DataField = 'LOC' + DataPipeline = SDACQueryDataView1.plDept + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Name = 'Arial' + Font.Size = 10 + Font.Style = [] + Transparent = True + DataPipelineName = 'plDept' + mmHeight = 4233 + mmLeft = 81756 + mmTop = 1323 + mmWidth = 31750 + BandType = 4 + end + end + object daDataModule1: TdaDataModule + object SDACQueryDataView1: TdaSDACQueryDataView + UserName = 'Query_Dept' + Height = 305 + Left = 10 + NameColumnWidth = 105 + SizeColumnWidth = 35 + SortMode = 0 + Top = 10 + TypeColumnWidth = 52 + Width = 242 + AutoSearchTabOrder = 0 + object plDept: TppChildDBPipeline + AutoCreateFields = False + UserName = 'plDept' + Left = 200 + Top = 272 + object ppField1: TppField + FieldAlias = 'Deptno' + FieldName = 'DEPTNO' + FieldLength = 0 + DataType = dtInteger + DisplayWidth = 0 + Position = 0 + TableName = 'DEPT' + end + object ppField2: TppField + FieldAlias = 'Dname' + FieldName = 'DNAME' + FieldLength = 0 + DisplayWidth = 0 + Position = 1 + TableName = 'DEPT' + end + object ppField3: TppField + FieldAlias = 'Loc' + FieldName = 'LOC' + FieldLength = 0 + DisplayWidth = 0 + Position = 2 + TableName = 'DEPT' + end + end + object daSQL1: TdaSQL + DatabaseName = 'seDatabase' + DatabaseType = dtMSSQLServer + DataPipelineName = 'plDept' + LinkColor = clBlack + MaxSQLFieldAliasLength = 25 + SQLText.Strings = ( + 'SELECT DEPT.DEPTNO, DEPT.DNAME, DEPT.LOC' + 'FROM SCOTT.DEPT DEPT' + 'ORDER BY DEPT.DEPTNO') + SQLType = sqSQL1 + object TdaField + Alias = 'Deptno' + DataType = dtInteger + DisplayWidth = 0 + FieldAlias = 'Deptno' + FieldLength = 0 + FieldName = 'DEPTNO' + SQLFieldName = 'DEPTNO' + TableAlias = 'Dept' + TableName = 'DEPT' + TableSQLAlias = 'DEPT' + end + object TdaField + Alias = 'Dname' + DisplayWidth = 0 + FieldAlias = 'Dname' + FieldLength = 0 + FieldName = 'DNAME' + SQLFieldName = 'DNAME' + TableAlias = 'Dept' + TableName = 'DEPT' + TableSQLAlias = 'DEPT' + end + object TdaField + Alias = 'Loc' + DisplayWidth = 0 + FieldAlias = 'Loc' + FieldLength = 0 + FieldName = 'LOC' + SQLFieldName = 'LOC' + TableAlias = 'Dept' + TableName = 'DEPT' + TableSQLAlias = 'DEPT' + end + object TdaField + ChildType = 2 + Alias = 'Deptno' + DataType = dtInteger + DisplayWidth = 0 + FieldAlias = 'Deptno' + FieldLength = 0 + FieldName = 'DEPTNO' + SQLFieldName = 'DEPTNO' + TableAlias = 'Dept' + TableName = 'DEPT' + TableSQLAlias = 'DEPT' + end + object TdaTable + ChildType = 5 + Alias = 'Dept' + JoinType = dajtNone + OwnerName = 'SCOTT' + SQLAlias = 'DEPT' + TableAlias = 'Dept' + TableName = 'DEPT' + end + end + end + end + end + object tblFolder: TMSTable + TableName = 'RB_FOLDER' + Connection = seDatabase + Left = 12 + Top = 195 + end + object dsFolder: TDataSource + DataSet = tblFolder + Left = 43 + Top = 195 + end + object plFolder: TppDBPipeline + DataSource = dsFolder + RefreshAfterPost = True + UserName = 'plFolder' + Visible = False + Left = 75 + Top = 196 + end + object ppReportExplorer: TppReportExplorer + Designer = ppDesigner + FolderFieldNames.FolderId = 'FOLDER_ID' + FolderFieldNames.Name = 'FOLDER_NAME' + FolderFieldNames.ParentId = 'PARENT_ID' + FolderPipeline = plFolder + ItemFieldNames.Deleted = 'DELETED' + ItemFieldNames.FolderId = 'FOLDER_ID' + ItemFieldNames.ItemId = 'ITEM_ID' + ItemFieldNames.Modified = 'MODIFIED' + ItemFieldNames.Name = 'ITEM_NAME' + ItemFieldNames.Size = 'ITEM_SIZE' + ItemFieldNames.Template = 'TEMPLATE' + ItemFieldNames.ItemType = 'ITEM_TYPE' + ItemPipeline = plItem + FormCaption = 'Report Explorer' + FormIcon.Data = { + 0000010001002020100000000000E80200001600000028000000200000004000 + 0000010004000000000080020000000000000000000000000000000000000000 + 0000000080000080000000808000800000008000800080800000C0C0C0008080 + 80000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000884000000000000 + 000083BBBBB34003BBBBB800000000000004BBBBBBBB308BBBBBBB0000000000 + 00003BBBBBB3403BBBBBB3000000000000000BBBBBB404BBBBBB300000000000 + 000003BBBBB008BBBBBB800000000000000003BBBBB003BBBBBB000000000000 + 000003BBBBB48BBBBBB3000000000000000003BBBBBBBBBBBB30000000000000 + 000003BBBBBBBBBBB800000000000000000003BBBBB33BBBBB80000000000000 + 000003BBBBB003BBBBB4000000000000000003BBBBB003BBBBB8000000000000 + 000003BBBBB003BBBBB300000000000000000BBBBBB84BBBBBB8000000000000 + 00043BBBBBBBBBBBBBB00000000000000004BBBBBBBBBBBBB340000000000000 + 0000433888883338400000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8FFFF00 + 603FFE00403FFF00403FFF80807FFF81807FFF8180FFFF8000FFFF8001FFFF80 + 03FFFF8001FFFF8180FFFF8180FFFF8180FFFF8000FFFE0001FFFE0001FFFF00 + 07FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF} + FormPosition = poScreenCenter + FormHeight = 400 + FormLeft = 100 + FormTop = 50 + FormWidth = 600 + Left = 168 + Top = 235 + end + object tblJoin: TMSTable + TableName = 'RB_JOIN' + Connection = seDatabase + Left = 251 + Top = 510 + end + object dsJoin: TDataSource + DataSet = tblJoin + Left = 282 + Top = 511 + end + object plJoin: TppDBPipeline + DataSource = dsJoin + RefreshAfterPost = True + UserName = 'plJoin' + Visible = False + Left = 314 + Top = 510 + end + object sqCreate: TMSQuery + Connection = seDatabase + SQL.Strings = ( + 'CREATE TABLE [dbo].[RB_FIELD] (' + #9'[TABLE_NAME] [varchar] (60) NOT NULL ,' + #9'[FIELD_NAME] [varchar] (60) NOT NULL ,' + #9'[FIELD_ALIAS] [varchar] (60) NULL ,' + #9'[DATATYPE] [varchar] (60) NULL ,' + #9'[SELECTABLE] [varchar] (1) NULL ,' + #9'[SEARCHABLE] [varchar] (1) NULL ,' + #9'[SORTABLE] [varchar] (1) NULL ,' + #9'[AUTOSEARCH] [varchar] (1) NULL ,' + #9'[MANDATORY] [varchar] (1) NULL ' + ') ON [PRIMARY]' + '' + 'CREATE TABLE [dbo].[RB_FOLDER] (' + #9'[FOLDER_ID] [int] IDENTITY (1, 1) NOT NULL ,' + #9'[FOLDER_NAME] [char] (60) NULL ,' + #9'[PARENT_ID] [int] NULL ' + ') ON [PRIMARY]' + '' + 'CREATE TABLE [dbo].[RB_ITEM] (' + #9'[ITEM_ID] [int] IDENTITY (1, 1) NOT NULL ,' + #9'[FOLDER_ID] [int] NULL ,' + #9'[ITEM_NAME] [char] (60) NULL ,' + #9'[ITEM_SIZE] [int] NULL ,' + #9'[ITEM_TYPE] [int] NULL ,' + #9'[MODIFIED] [int] NULL ,' + #9'[DELETED] [int] NULL ,' + #9'[TEMPLATE] [text] NULL ' + ') ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]' + '' + 'CREATE TABLE [dbo].[RB_JOIN] (' + #9'[TABLE_NAME1] [varchar] (60) NOT NULL ,' + #9'[TABLE_NAME2] [varchar] (60) NOT NULL ,' + #9'[JOIN_TYPE] [varchar] (60) NULL ,' + #9'[FIELD_NAMES1] [varchar] (255) NULL ,' + #9'[OPERATORS] [varchar] (60) NULL ,' + #9'[FIELD_NAMES2] [varchar] (60) NULL ' + ') ON [PRIMARY]' + '' + 'CREATE TABLE [dbo].[RB_TABLE] (' + #9'[TABLE_NAME] [varchar] (60) NOT NULL ,' + #9'[TABLE_ALIAS] [varchar] (60) NULL ' + ') ON [PRIMARY]' + '' + '/*ALTER TABLE [dbo].[RB_FOLDER] WITH NOCHECK ADD ' + #9'CONSTRAINT [PK_RB_FOLDER] PRIMARY KEY CLUSTERED ' + #9'(' + #9#9'[FOLDER_ID]' + #9') ON [PRIMARY] ' + '' + 'ALTER TABLE [dbo].[RB_ITEM] WITH NOCHECK ADD ' + #9'CONSTRAINT [PK_RB_ITEM] PRIMARY KEY CLUSTERED ' + #9'(' + #9#9'[ITEM_ID]' + #9') ON [PRIMARY] ' + '' + 'ALTER TABLE [dbo].[RB_TABLE] WITH NOCHECK ADD ' + #9'CONSTRAINT [PK_RB_TABLE] PRIMARY KEY CLUSTERED ' + #9'(' + #9#9'[TABLE_NAME]' + #9') ON [PRIMARY] ' + '' + '*/') + Debug = True + Left = 8 + Top = 336 + end + object sqDrop: TMSQuery + Connection = seDatabase + SQL.Strings = ( + + 'if exists (select * from dbo.sysobjects where id = object_id(N'#39'[' + + 'dbo].[RB_FIELD]'#39') and OBJECTPROPERTY(id, N'#39'IsUserTable'#39') = 1)' + 'drop table [dbo].[RB_FIELD]' + '' + + 'if exists (select * from dbo.sysobjects where id = object_id(N'#39'[' + + 'dbo].[RB_FOLDER]'#39') and OBJECTPROPERTY(id, N'#39'IsUserTable'#39') = 1)' + 'drop table [dbo].[RB_FOLDER]' + '' + + 'if exists (select * from dbo.sysobjects where id = object_id(N'#39'[' + + 'dbo].[RB_ITEM]'#39') and OBJECTPROPERTY(id, N'#39'IsUserTable'#39') = 1)' + 'drop table [dbo].[RB_ITEM]' + '' + + 'if exists (select * from dbo.sysobjects where id = object_id(N'#39'[' + + 'dbo].[RB_JOIN]'#39') and OBJECTPROPERTY(id, N'#39'IsUserTable'#39') = 1)' + 'drop table [dbo].[RB_JOIN]' + '' + + 'if exists (select * from dbo.sysobjects where id = object_id(N'#39'[' + + 'dbo].[RB_TABLE]'#39') and OBJECTPROPERTY(id, N'#39'IsUserTable'#39') = 1)' + 'drop table [dbo].[RB_TABLE]') + Debug = True + Left = 40 + Top = 336 + end + object MyTable1: TMSTable + TableName = 'rb_folder' + Connection = seDatabase + Left = 12 + Top = 195 + end +end diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/ReportBuilder/myEURpt.pas b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/ReportBuilder/myEURpt.pas new file mode 100644 index 0000000..f454a3a --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/ReportBuilder/myEURpt.pas @@ -0,0 +1,260 @@ + +////////////////////////////////////////////////// +// MS SQL Server Data Access Components +// Copyright © 1998,2000 Core Lab. All right reserved. +// ReportBuilder Report Demo +// Based on Digital Metaphors Corporation's demos +////////////////////////////////////////////////// + +unit myEURpt; + +interface + +{ By removing the 'x' which begins each of these compiler directives, + you can enable different functionality within the end-user reporting + solution. + + DADE - the data tab where queries can be created by the end-user + + BDE - BDE support for the Query Tools + + ADO - ADO support for the Query Tools + + IBExpress - Interbase Express support for the Query Tools + + + RAP - the calc tab, where calculations can be coded at run-time + (You must download and install a copy of the RAP beta in order + to enable this feature) + + CrossTab - adds the CrossTab component to the component palette in the + report designer. + + CheckBox - adds a checkbox component to the component palette in the + report designer. + + TeeChart - adds a teechart component to the report designer component + palette. This component works with the TeeChart delivered + with Delphi 3 and 4. It does NOT work with TeeChart 4.01, + which must be purchased from TeeMach. + + TeeChart401 - adds a teechart component for use with TeeChart 4.01 from + TeeMach. + + UseDesignPath - determines whether the path used by the Database + object on this form is replaced in the OnCreate event handler of + this form with the current path.} + +{$DEFINE DADE} {remove the 'x' to enable DADE} +{x$DEFINE BDE} {remove the 'x' to enable Borland Database Engine (BDE) } +{x$DEFINE ADO} {remove the 'x' to enable ADO} +{x$DEFINE IBExpress} {remove the 'x' to enable Interbase Express} +{$DEFINE SDAC} {remove the 'x' to enable MS SQL Server Data Access Components} +{$DEFINE CrossTab} {remove the 'x' to enable CrossTab} +{x$DEFINE RAP} {remove the 'x' to enable RAP} +{x$DEFINE CheckBox} {remove the 'x' to enable CheckBox} +{x$DEFINE TeeChart} {remove the 'x' to enable standard TeeChart} +{x$DEFINE TeeChart401} {remove the 'x' to enable TeeChart 4.01} +{x$DEFINE UseDesignPath} {remove the 'x' to use the design-time settings of Database object on this form} + +uses + +{$IFDEF DADE} + daDatMan, +{$ENDIF} + +{$IFDEF BDE} + daDBBDE, +{$ENDIF} + +{$IFDEF ADO} + daADO, +{$ENDIF} + +{$IFDEF IBExpress} + daIBExpress, +{$ENDIF} + +{$IFDEF SDAC} + daSDAC, +{$ENDIF} + +{$IFDEF CrossTab} + ppCTDsgn, +{$ENDIF} + +{$IFDEF RAP} + raIDE, +{$ENDIF} + +{$IFDEF CheckBox} + myChkBox, +{$ENDIF} + +{$IFDEF TeeChart} + ppChrt, ppChrtDB, +{$ENDIF} + +{$IFDEF TeeChart401} + ppChrt, ppChrtDP, +{$ENDIF} + + Windows, Classes, Controls, SysUtils, Forms, StdCtrls, ExtCtrls, Dialogs, Graphics, DB, ppComm, + ppCache, ppClass, ppProd, ppReport, ppRptExp, ppBands, ppEndUsr, ppDBPipe, ppDB, ppPrnabl, + ppStrtch, ppDsgnDB, ppTypes, MSAccess, OLEDBAccess, ppFormWrapper, daDataView, daQueryDataView, ppModule, + daDataModule, ppCtrls, ppVar, ppRelatv, MemDS, DBAccess, ppViewr, daDatMod, + daDataVw, daQuery, daQClass, ppDBBDE, SdacVcl; + +type + TmyEndUserSolution = class(TForm) + Shape11: TShape; + Label6: TLabel; + Shape12: TShape; + seDatabase: TMSConnection; + Shape9: TShape; + Label5: TLabel; + Shape10: TShape; + tblTable: TMSTable; + dsTable: TDataSource; + plTable: TppDBPipeline; + tblField: TMSTable; + dsField: TDataSource; + plField: TppDBPipeline; + ppDataDictionary: TppDataDictionary; + Shape6: TShape; + Label7: TLabel; + Shape5: TShape; + ppDesigner: TppDesigner; + Shape4: TShape; + Label8: TLabel; + Shape3: TShape; + tblItem: TMSTable; + dsItem: TDataSource; + plItem: TppDBPipeline; + ppReport: TppReport; + Label1: TLabel; + Shape1: TShape; + Shape2: TShape; + Shape15: TShape; + Label2: TLabel; + Shape16: TShape; + tblFolder: TMSTable; + dsFolder: TDataSource; + plFolder: TppDBPipeline; + btnLaunch: TButton; + ppReportExplorer: TppReportExplorer; + Shape22: TShape; + Label10: TLabel; + Shape23: TShape; + Shape24: TShape; + Shape25: TShape; + Shape26: TShape; + Memo1: TMemo; + pnlStatusBar: TPanel; + Shape7: TShape; + Shape20: TShape; + Shape29: TShape; + Shape18: TShape; + Shape17: TShape; + Shape8: TShape; + Shape13: TShape; + Label3: TLabel; + Shape14: TShape; + Label9: TLabel; + Shape19: TShape; + Shape21: TShape; + Shape27: TShape; + Label4: TLabel; + Shape28: TShape; + tblJoin: TMSTable; + dsJoin: TDataSource; + plJoin: TppDBPipeline; + ppHeaderBand1: TppHeaderBand; + ppDetailBand1: TppDetailBand; + btCreate: TButton; + btDrop: TButton; + sqCreate: TMSQuery; + sqDrop: TMSQuery; + ppLabel1: TppLabel; + ppDBText1: TppDBText; + ppDBText2: TppDBText; + ppDBText3: TppDBText; + ppSystemVariable1: TppSystemVariable; + ppTitleBand1: TppTitleBand; + ppLabel2: TppLabel; + ppLabel3: TppLabel; + ppLabel4: TppLabel; + ppShape1: TppShape; + SDACQueryDataView1: TdaSDACQueryDataView; + MyTable1: TMSTable; + procedure FormCreate(Sender: TObject); + procedure btnLaunchClick(Sender: TObject); + procedure btCreateClick(Sender: TObject); + procedure btDropClick(Sender: TObject); + private + procedure LoadEndEvent(Sender: TObject); + procedure PreviewFormCreateEvent(Sender: TObject); + public + end; + +var + myEndUserSolution: TmyEndUserSolution; + +implementation + +{$R *.DFM} + +{------------------------------------------------------------------------------} +{ TmyReportObjects.FormCreate } + +procedure TmyEndUserSolution.FormCreate(Sender: TObject); +begin + //Session.SQLHourGlass := False; + + ClientHeight := btnLaunch.Top + btnLaunch.Height + pnlStatusBar.Height + 8; + + ppReport.Template.OnLoadEnd := LoadEndEvent; +end; {procedure, FormCreate} + +{------------------------------------------------------------------------------} +{ TmyReportObjects.btnLaunchClick } + +procedure TmyEndUserSolution.btnLaunchClick(Sender: TObject); +begin + if not(ppReportExplorer.Execute) then begin + pnlStatusBar.Caption := 'Error: ' + ppReportExplorer.ErrorMessage; + MessageBeep(0); + end + else + pnlStatusBar.Caption := 'Explorer Launch Successful.' +end; {procedure, btnLaunchClick} + +{------------------------------------------------------------------------------} +{ TmyReportObjects.LoadEndEvent } + +procedure TmyEndUserSolution.LoadEndEvent(Sender: TObject); +begin + ppReport.OnPreviewFormCreate := PreviewFormCreateEvent; +end; {procedure, LoadEndEvent} + +{------------------------------------------------------------------------------} +{ TmyReportObjects.PreviewFormCreateEvent } + +procedure TmyEndUserSolution.PreviewFormCreateEvent(Sender: TObject); +begin + ppReport.PreviewForm.WindowState := wsMaximized; + + TppViewer(ppReport.PreviewForm.Viewer).ZoomSetting := zs100Percent; +end; {procedure, PreviewFormCreateEvent} + +procedure TmyEndUserSolution.btCreateClick(Sender: TObject); +begin + sqCreate.Execute; +end; + +procedure TmyEndUserSolution.btDropClick(Sender: TObject); +begin + sqDrop.Execute; +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/ReportBuilder/rbSDAC.cfg b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/ReportBuilder/rbSDAC.cfg new file mode 100644 index 0000000..0d811bd --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/ReportBuilder/rbSDAC.cfg @@ -0,0 +1,41 @@ +-$A+ +-$B- +-$C+ +-$D+ +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L+ +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$YD +-$Z1 +-cg +-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-H+ +-W+ +-M +-$M16384,1048576 +-K$00400000 +-N"d:\program files\borland\delphi5\Projects" +-LE"d:\program files\borland\delphi5\Projects" +-LN"d:\program files\borland\delphi5\Projects" +-U"d:\program files\borland\delphi5\Projects" +-O"d:\program files\borland\delphi5\Projects" +-I"d:\program files\borland\delphi5\Projects" +-R"d:\program files\borland\delphi5\Projects" +-Z diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/ReportBuilder/rbSDAC.dpk b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/ReportBuilder/rbSDAC.dpk new file mode 100644 index 0000000..aa87404 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/ReportBuilder/rbSDAC.dpk @@ -0,0 +1,42 @@ +package rbSDAC; + +{$R *.res} +{$ALIGN ON} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'ReportBuilder Pro Data Access for SDAC'} +{$IMPLICITBUILD OFF} + +requires + dac70, + vclx, + rbRCL97, + rbIDE97, + rbDB97, + rbDAD97, + dacvcl70, + sdacvcl70, + sdac70; + +contains + daSDAC in 'daSDAC.pas'; + +end. diff --git a/internal/4.10.0.10/1/Demos/Win32/ThirdParty/ReportBuilder/rbSDAC.res b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/ReportBuilder/rbSDAC.res new file mode 100644 index 0000000..4aa33a2 Binary files /dev/null and b/internal/4.10.0.10/1/Demos/Win32/ThirdParty/ReportBuilder/rbSDAC.res differ diff --git a/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/ASPNet/Global.asax b/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/ASPNet/Global.asax new file mode 100644 index 0000000..6aaca6a --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/ASPNet/Global.asax @@ -0,0 +1,2 @@ +<%@ Application Codebehind="Global.pas" Inherits="Global.TGlobal" %> + diff --git a/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/ASPNet/Global.pas b/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/ASPNet/Global.pas new file mode 100644 index 0000000..722c22a --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/ASPNet/Global.pas @@ -0,0 +1,99 @@ +unit Global; + +interface + +uses + System.Collections, System.ComponentModel, + System.Web, System.Web.SessionState, System.Data; + +type + TGlobal = class(System.Web.HttpApplication) + {$REGION 'Designer Managed Code'} + strict private + procedure InitializeComponent; + {$ENDREGION} + strict protected + procedure Application_Start(sender: System.Object; e: EventArgs); + procedure Session_Start(sender: System.Object; e: EventArgs); + procedure Application_BeginRequest(sender: System.Object; e: EventArgs); + procedure Application_EndRequest(sender: System.Object; e: EventArgs); + procedure Application_AuthenticateRequest(sender: System.Object; e: EventArgs); + procedure Application_Error(sender: System.Object; e: EventArgs); + procedure Session_End(sender: System.Object; e: EventArgs); + procedure Application_End(sender: System.Object; e: EventArgs); + private + { Private Declarations } + public + constructor Create; + end; + +implementation + +{$REGION 'Designer Managed Code'} +/// +/// Required method for Designer support -- do not modify +/// the contents of this method with the code editor. +/// +procedure TGlobal.InitializeComponent; +begin + +end; +{$ENDREGION} + +constructor TGlobal.Create; +begin + inherited; + // + // Required for Designer support + // + InitializeComponent; + // + // TODO: Add any constructor code after InitializeComponent call + // +end; + +procedure TGlobal.Application_Start(sender: System.Object; e: EventArgs); +begin + +end; + +procedure TGlobal.Session_Start(sender: System.Object; e: EventArgs); +var + dataSet : System.Data.DataSet; +begin + dataSet := System.Data.DataSet.Create(); + HttpContext.Current.Session.Add('dataset', dataSet); +end; + +procedure TGlobal.Application_BeginRequest(sender: System.Object; e: EventArgs); +begin + +end; + +procedure TGlobal.Application_EndRequest(sender: System.Object; e: EventArgs); +begin + +end; + +procedure TGlobal.Application_AuthenticateRequest(sender: System.Object; e: EventArgs); +begin + +end; + +procedure TGlobal.Application_Error(sender: System.Object; e: EventArgs); +begin + +end; + +procedure TGlobal.Session_End(sender: System.Object; e: EventArgs); +begin +// HttpContext.Current.Session.Clear(); +end; + +procedure TGlobal.Application_End(sender: System.Object; e: EventArgs); +begin + +end; + +end. + diff --git a/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/ASPNet/ReadMe.txt b/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/ASPNet/ReadMe.txt new file mode 100644 index 0000000..e553296 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/ASPNet/ReadMe.txt @@ -0,0 +1,8 @@ +SQL Server Data Access Components +Copyright 1997-2007, Core Lab. All Rights Reserved +-------------------------------------------------- + +Uses MSDataAdapter to create a simple ASP .NET application. This +application creates an ASP.NET application that lets you connect to +a database and execute queries. Shows how to display query results +in a DataGrid and send user changes back to the database. \ No newline at end of file diff --git a/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/ASPNet/Web.bdsproj b/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/ASPNet/Web.bdsproj new file mode 100644 index 0000000..9bcdf8a --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/ASPNet/Web.bdsproj @@ -0,0 +1,186 @@ + + + + + + + + + + + + Web.dpr + + + 7.0 + + + 0 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + Borland.Vcl + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + + + 0 + 0 + 1 + True + False + False + 4096 + 1048576 + 4194304 + + + + .\bin + + + + + System.XML.dll;System.Web.dll;System.Drawing.dll;System.Data.dll;System.dll + + + True + + + + http://localhost/SdacWebDelphi/WebForm.aspx + "iexplore.exe" + True + + + + + + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + + + + + True + True + WebForm.aspx + IIS + \ + SdacWebDelphi + + + + + + + + + + + + + + + + + + + + diff --git a/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/ASPNet/Web.config b/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/ASPNet/Web.config new file mode 100644 index 0000000..ac436da --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/ASPNet/Web.config @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/ASPNet/Web.dpr b/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/ASPNet/Web.dpr new file mode 100644 index 0000000..cf5b2ab --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/ASPNet/Web.dpr @@ -0,0 +1,82 @@ +library Web; + +{%AspWebConfigContainer 'Web.config'} +{%DelphiDotNetAssemblyCompiler '$(SystemRoot)\microsoft.net\framework\v1.1.4322\System.dll'} +{%DelphiDotNetAssemblyCompiler '$(SystemRoot)\microsoft.net\framework\v1.1.4322\System.Data.dll'} +{%DelphiDotNetAssemblyCompiler '$(SystemRoot)\microsoft.net\framework\v1.1.4322\System.Drawing.dll'} +{%DelphiDotNetAssemblyCompiler '$(SystemRoot)\microsoft.net\framework\v1.1.4322\System.Web.dll'} +{%DelphiDotNetAssemblyCompiler '$(SystemRoot)\microsoft.net\framework\v1.1.4322\System.XML.dll'} +{%DelphiDotNetAssemblyCompiler '..\..\bin\CoreLab.Sdac.AdoNet.dll'} +{%AspMarkupContainer 'Global.asax'} +{%AspMarkupContainer 'WebForm.aspx'} + +uses + System.Reflection, + System.Runtime.CompilerServices, + Global in 'Global.pas' {Global.TGlobal: System.Web.HttpApplication}, + WebForm in 'WebForm.pas' {WebForm.TWebForm: System.Web.UI.Page}; + +// +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +// +[assembly: AssemblyDescription('')] +[assembly: AssemblyConfiguration('')] +[assembly: AssemblyCompany('')] +[assembly: AssemblyProduct('')] +[assembly: AssemblyCopyright('')] +[assembly: AssemblyTrademark('')] +[assembly: AssemblyCulture('')] + +// The Delphi compiler controls the AssemblyTitleAttribute via the ExeDescription. +// You can set this in the IDE via the Project Options. +// Manually setting the AssemblyTitle attribute below will override the IDE +// setting. +// [assembly: AssemblyTitle('')] + + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion('1.0.*')] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory which is +// %Project Directory%\bin\. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile('..\\..\\mykey.snk')] +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile('')] +[assembly: AssemblyKeyName('')] + +begin +end. diff --git a/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/ASPNet/WebForm.aspx b/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/ASPNet/WebForm.aspx new file mode 100644 index 0000000..af75463 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/ASPNet/WebForm.aspx @@ -0,0 +1,136 @@ +<%@ Page language="c#" Codebehind="WebForm.aspx.cs" AutoEventWireup="false" Inherits="WebForm.TWebForm" %> + + + + WebForm + + + + + + +
+ + + + + + +
+ Using SDAC .NET with ASP .NET +
+ + + + + + SQL + + + + + Result + + + + + + + + + + + + + + + + + + + + + + + + +
+ Username + + + +
+ Password + + + +
+ Database + + + +
+ Server + + + +
+ + + + +
+
+
+ + + + + + + + + + + + +
+ + \ No newline at end of file diff --git a/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/ASPNet/WebForm.pas b/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/ASPNet/WebForm.pas new file mode 100644 index 0000000..42f6a10 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/ASPNet/WebForm.pas @@ -0,0 +1,265 @@ + +unit WebForm; + +interface + +uses + System.Collections, System.ComponentModel, + System.Data, System.Drawing, System.Web, System.Web.SessionState, + System.Web.UI, System.Web.UI.WebControls, System.Web.UI.HtmlControls, + System.Globalization, DB, MSAccess, CoreLab.Sdac.DataAdapter; + +type + TWebForm = class(System.Web.UI.Page) + {$REGION 'Designer Managed Code'} + strict private + procedure InitializeComponent; + procedure btTest_Click(sender: System.Object; e: System.EventArgs); + procedure btFill_Click(sender: System.Object; e: System.EventArgs); + procedure btUpdate_Click(sender: System.Object; e: System.EventArgs); + procedure btInsertRecord_Click(sender: System.Object; e: System.EventArgs); + procedure dataGrid_EditCommand(source: System.Object; e: System.Web.UI.WebControls.DataGridCommandEventArgs); + procedure dataGrid_DeleteCommand(source: System.Object; e: System.Web.UI.WebControls.DataGridCommandEventArgs); + procedure dataGrid_CancelCommand(source: System.Object; e: System.Web.UI.WebControls.DataGridCommandEventArgs); + procedure dataGrid_UpdateCommand(source: System.Object; e: System.Web.UI.WebControls.DataGridCommandEventArgs); + {$ENDREGION} + strict private + procedure Page_Load(sender: System.Object; e: System.EventArgs); + strict protected + lbTitle: System.Web.UI.WebControls.Label; + lbInfo: System.Web.UI.WebControls.Label; + btInsertRecord: System.Web.UI.WebControls.Button; + btUpdate: System.Web.UI.WebControls.Button; + Label2: System.Web.UI.WebControls.Label; + btFill: System.Web.UI.WebControls.Button; + tbSQL: System.Web.UI.WebControls.TextBox; + lbResult: System.Web.UI.WebControls.Label; + lbError: System.Web.UI.WebControls.Label; + tbUsername: System.Web.UI.WebControls.TextBox; + tbDatabase: System.Web.UI.WebControls.TextBox; + tbPassword: System.Web.UI.WebControls.TextBox; + tbServer: System.Web.UI.WebControls.TextBox; + lbState: System.Web.UI.WebControls.Label; + btTest: System.Web.UI.WebControls.Button; + dataGrid: System.Web.UI.WebControls.DataGrid; + MSDataAdapter: CoreLab.Sdac.DataAdapter.MSDataAdapter; + DataSet: System.Data.DataSet; + protected + MSConnection: TMSConnection; + MSQuery: TMSQuery; + procedure OnInit(e: EventArgs); override; + procedure BindGrid(); + public + { Public Declarations } + end; + +implementation + +{$REGION 'Designer Managed Code'} +/// +/// Required method for Designer support -- do not modify +/// the contents of this method with the code editor. +/// +procedure TWebForm.InitializeComponent; +begin + Self.MSDataAdapter := CoreLab.Sdac.DataAdapter.MSDataAdapter.Create; + Include(Self.btInsertRecord.Click, Self.btInsertRecord_Click); + Include(Self.btUpdate.Click, Self.btUpdate_Click); + Include(Self.btFill.Click, Self.btFill_Click); + Include(Self.btTest.Click, Self.btTest_Click); + Include(Self.dataGrid.CancelCommand, Self.dataGrid_CancelCommand); + Include(Self.dataGrid.EditCommand, Self.dataGrid_EditCommand); + Include(Self.dataGrid.UpdateCommand, Self.dataGrid_UpdateCommand); + Include(Self.dataGrid.DeleteCommand, Self.dataGrid_DeleteCommand); + // + // MSDataAdapter + // + Self.MSDataAdapter.DataSet := nil; + Self.MSDataAdapter.Name := ''; + Self.MSDataAdapter.Tag := nil; + // + Include(Self.Load, Self.Page_Load); +end; +{$ENDREGION} + +procedure TWebForm.Page_Load(sender: System.Object; e: System.EventArgs); +begin + dataSet := System.Data.DataSet(HttpContext.Current.Session['dataset']); +end; + +procedure TWebForm.OnInit(e: EventArgs); +begin + // + // Required for Designer support + // + InitializeComponent; + + MSConnection := TMSConnection.Create(nil); + with MSConnection do begin + LoginPrompt := False; + Username := 'sa'; + Database := 'Northwind'; + Password := ''; + end; + MSQuery := TMSQuery.Create(nil); + with MSQuery do begin + Connection := MSConnection; + SQL.Text := 'select * from Orders'; + end; + MSDataAdapter.DataSet := MSQuery; + + tbUsername.Text := MSConnection.Username; + tbDatabase.Text := MSConnection.Database; + tbPassword.Text := MSConnection.Password; + tbServer.Text := MSConnection.Server; + tbSQL.Text := MSQuery.SQL.Text; + + inherited OnInit(e); +end; + +procedure TWebForm.BindGrid(); +begin + if dataSet.Tables['Table'] <> Nil then begin + dataGrid.DataSource := dataSet.Tables['Table'].DefaultView; + lbResult.Visible := true; + btInsertRecord.Visible := true; + if dataSet.Tables['Table'].GetChanges() <> Nil then + lbInfo.Text := 'Changed' + end + else begin + dataGrid.DataSource := Nil; + lbResult.Visible := false; + btInsertRecord.Visible := false; + end; + + dataGrid.DataBind(); +end; + +procedure TWebForm.dataGrid_UpdateCommand(source: System.Object; e: System.Web.UI.WebControls.DataGridCommandEventArgs); +var + i : integer; + colValue: string; +begin + for i := 2 to e.Item.Cells.Count - 1 do + if e.Item.Cells[i].Controls.Count > 0 then begin + colValue := System.Web.UI.WebControls.TextBox(e.Item.Cells[i].Controls[0]).Text; + if colValue = '' then + dataSet.Tables['Table'].Rows[e.Item.ItemIndex][i - 2] := Convert.DBNull + else + dataSet.Tables['Table'].Rows[e.Item.ItemIndex][i - 2] := colValue; + end; + + dataGrid.EditItemIndex := -1; + BindGrid(); +end; + +procedure TWebForm.dataGrid_CancelCommand(source: System.Object; e: System.Web.UI.WebControls.DataGridCommandEventArgs); +begin + dataGrid.EditItemIndex := -1; + BindGrid(); +end; + +procedure TWebForm.dataGrid_DeleteCommand(source: System.Object; e: System.Web.UI.WebControls.DataGridCommandEventArgs); +begin + dataSet.Tables['Table'].Rows[e.Item.ItemIndex].Delete(); + BindGrid(); +end; + +procedure TWebForm.dataGrid_EditCommand(source: System.Object; e: System.Web.UI.WebControls.DataGridCommandEventArgs); +begin + dataGrid.EditItemIndex := System.Int32(e.Item.ItemIndex); + BindGrid(); +end; + +procedure TWebForm.btInsertRecord_Click(sender: System.Object; e: System.EventArgs); +var + row : DataRow; +begin + row := dataSet.Tables['Table'].NewRow(); + dataSet.Tables['Table'].Rows.Add(row); + dataGrid.EditItemIndex := dataSet.Tables['Table'].Rows.Count - 1; + BindGrid(); +end; + +procedure TWebForm.btUpdate_Click(sender: System.Object; e: System.EventArgs); +begin + if dataSet.Tables['Table'] <> Nil then begin + try try + MSConnection.Username := tbUsername.Text; + MSConnection.Database := tbDatabase.Text; + MSConnection.Password := tbPassword.Text; + MSConnection.Server := tbServer.Text; + + MSQuery.SQL.Text := tbSQL.Text; + + MSDataAdapter.Update(dataSet, 'Table'); + + lbInfo.Text := 'Updated'; + except + on exception : Exception do begin + lbError.Text := exception.Message; + end; + end; + finally + BindGrid(); + end; + end; +end; + +procedure TWebForm.btFill_Click(sender: System.Object; e: System.EventArgs); +var + i : integer; + table : DataTable; +begin + try try + dataSet.Clear(); + for i := 0 to dataSet.Tables.Count - 1 do begin + table := dataSet.Tables[i]; + table.Constraints.Clear(); + table.Columns.Clear(); + end; + dataSet.Tables.Clear(); + + MSConnection.Username := tbUsername.Text; + MSConnection.Database := tbDatabase.Text; + MSConnection.Password := tbPassword.Text; + MSConnection.Server := tbServer.Text; + + MSQuery.SQL.Text := tbSQL.Text; + + MSDataAdapter.Fill(dataSet, 'Table'); + + lbInfo.Text := 'Filled'; + except + on exception : Exception do + lbError.Text := exception.Message; + end; + finally + BindGrid(); + end; +end; + +procedure TWebForm.btTest_Click(sender: System.Object; e: System.EventArgs); +begin + try + MSConnection.Username := tbUsername.Text; + MSConnection.Database := tbDatabase.Text; + MSConnection.Password := tbPassword.Text; + MSConnection.Server := tbServer.Text; + + MSConnection.Open; + lbState.Text := 'Success'; + lbState.ForeColor := Color.Blue; + MSConnection.Close; + except on exception: Exception do + begin + lbState.Text := 'Failed'; + lbState.ForeColor := Color.Red; + lbError.Text := exception.Message; + end; + end; + +end; + +end. + diff --git a/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/ASPNet/WebForm.resx b/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/ASPNet/WebForm.resx new file mode 100644 index 0000000..1afaad5 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/ASPNet/WebForm.resx @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + + 157, 17 + + + False + + \ No newline at end of file diff --git a/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/Failover/About.nfm b/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/Failover/About.nfm new file mode 100644 index 0000000..0d8a146 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/Failover/About.nfm @@ -0,0 +1,108 @@ +object AboutForm: TAboutForm + Left = 352 + Top = 192 + BorderIcons = [biSystemMenu] + BorderStyle = bsDialog + Caption = 'About FailOver Demo' + ClientHeight = 343 + ClientWidth = 416 + Color = clBtnFace + ParentFont = True + OldCreateOrder = True + Position = poScreenCenter + OnMouseMove = FormMouseMove + PixelsPerInch = 96 + TextHeight = 13 + object Label3: TLabel + Left = 16 + Top = 36 + Width = 156 + Height = 13 + Caption = 'Copyright '#169' 1997-2007 Core Lab' + end + object lbWeb: TLabel + Left = 16 + Top = 306 + Width = 73 + Height = 13 + Cursor = crHandPoint + Caption = 'www.crlab.com' + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlue + Font.Height = 13 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [fsUnderline] + ParentFont = False + OnClick = lbWebClick + OnMouseMove = lbWebMouseMove + end + object lbDemo: TLabel + Left = 16 + Top = 8 + Width = 119 + Height = 20 + Caption = 'FailOver Demo' + Font.Charset = DEFAULT_CHARSET + Font.Color = clGreen + Font.Height = -16 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + end + object OKBtn: TButton + Left = 319 + Top = 308 + Width = 75 + Height = 24 + Cancel = True + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 0 + end + object meAbout: TMemo + Left = 16 + Top = 56 + Width = 385 + Height = 241 + Color = clBtnFace + Lines.Strings = ( + 'This demo program shows how to use DisconnectedMode, Pooling, ' + + 'CachedUpdates and LocalMasterDetail options. Usage of these opti' + + 'ons and ' + + 'usage of the OnConectionLost event are recommended working in un' + + 'stable ' + 'and/or slow network.' + '' + + 'The '#39'Open'#39' button opens two data sets. They are linked by Master' + + '/Detail ' + + 'relationship. You can preconnect to database before opening the ' + + 'datasets, but ' + 'usage of disconnected mode has no advantages in this case.' + '' + + 'The grid above displays the master data set, the grid below disp' + + 'lays the detail ' + + 'data set. The '#39'Kill session'#39' button terminates session on the se' + + 'rver, which ' + + 'causes connection break. This does not work for with all SQL ser' + + 'vers and with ' + + 'all users. The memo at the bottom of the main form keeps track o' + + 'f connection ' + 'messages.' + '' + + 'See the "Working in unstable and slow networks" topic in help fo' + + 'r more ' + 'detailed information.') + TabOrder = 1 + end +end diff --git a/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/Failover/About.pas b/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/Failover/About.pas new file mode 100644 index 0000000..79a6909 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/Failover/About.pas @@ -0,0 +1,67 @@ +unit About; + +interface +uses + Classes, SysUtils, +{$IFNDEF LINUX} + Windows, Menus, ImgList, StdCtrls, ComCtrls, Buttons, ExtCtrls, Graphics, + Controls, Forms, Dialogs, ShellApi; +{$ELSE} + QMenus, QImgList, QStdCtrls, QComCtrls, QButtons, QExtCtrls, QGraphics, + QControls, QForms, QDialogs; +{$ENDIF} + +type + TAboutForm = class(TForm) + OKBtn: TButton; + Label3: TLabel; + lbWeb: TLabel; + lbDemo: TLabel; + meAbout: TMemo; + procedure lbWebClick(Sender: TObject); + procedure lbWebMouseMove(Sender: TObject; Shift: TShiftState; X, + Y: Integer); + procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X, + Y: Integer); + private + { Private declarations } + public + { Public declarations } + end; + +var + AboutForm: TAboutForm; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} +{$IFDEF LINUX} +{$R *.xfm} +{$ENDIF} + +procedure TAboutForm.lbWebMouseMove(Sender: TObject; Shift: TShiftState; X, + Y: Integer); +begin + lbWeb.Font.Color := $4080FF; +end; + +procedure TAboutForm.FormMouseMove(Sender: TObject; Shift: TShiftState; X, + Y: Integer); +begin + lbWeb.Font.Color := $FF0000; +end; + +procedure TAboutForm.lbWebClick(Sender: TObject); +begin +{$IFDEF MSWINDOWS} + ShellExecute(0, 'open', 'www.crlab.com', '', '', SW_SHOW); + lbWeb.Font.Color := $FF0000; +{$ENDIF} +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/Failover/Data.nfm b/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/Failover/Data.nfm new file mode 100644 index 0000000..9983c11 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/Failover/Data.nfm @@ -0,0 +1,112 @@ +object DM: TDM + OldCreateOrder = False + Left = 185 + Top = 105 + Height = 227 + Width = 284 + object Connection: TMSConnection + Database = 'master' + Options.DisconnectedMode = True + Options.LocalFailover = True + Pooling = True + Left = 32 + Top = 32 + end + object quDetail: TMSQuery + Connection = Connection + SQL.Strings = ( + 'select * from emp') + Debug = True + CachedUpdates = True + Options.LocalMasterDetail = True + MasterSource = dsMaster + MasterFields = 'DEPTNO' + DetailFields = 'DEPTNO' + Left = 104 + Top = 88 + end + object quMaster: TMSQuery + Connection = Connection + SQL.Strings = ( + 'select * from dept' + '') + Debug = True + CachedUpdates = True + Left = 104 + Top = 32 + end + object dsDetail: TDataSource + DataSet = quDetail + Left = 136 + Top = 80 + end + object dsMaster: TDataSource + DataSet = quMaster + Left = 136 + Top = 24 + end + object scCreate: TMSScript + SQL.Strings = ( + 'CREATE TABLE DEPT (' + ' DEPTNO INT PRIMARY KEY ,' + ' DNAME VARCHAR(14) ,' + ' LOC VARCHAR(13)' + ');' + '' + 'CREATE TABLE EMP (' + ' EMPNO INT IDENTITY PRIMARY KEY,' + ' ENAME VARCHAR(10),' + ' JOB VARCHAR(9),' + ' MGR INT,' + ' HIREDATE DATETIME,' + ' SAL FLOAT,' + ' COMM FLOAT,' + ' DEPTNO INT CONSTRAINT FK_DEPTNO REFERENCES DEPT' + ');' + '' + 'INSERT INTO DEPT VALUES (10,'#39'ACCOUNTING'#39','#39'NEW YORK'#39');' + 'INSERT INTO DEPT VALUES (20,'#39'RESEARCH'#39','#39'DALLAS'#39');' + 'INSERT INTO DEPT VALUES (30,'#39'SALES'#39','#39'CHICAGO'#39');' + 'INSERT INTO DEPT VALUES (40,'#39'OPERATIONS'#39','#39'BOSTON'#39');' + '' + 'INSERT INTO EMP VALUES' + '('#39'SMITH'#39','#39'CLERK'#39',7902,CAST('#39'12/17/80'#39' AS DATETIME),800,NULL,20);' + 'INSERT INTO EMP VALUES' + '('#39'ALLEN'#39','#39'SALESMAN'#39',7698,'#39'02/20/81'#39',1600,300,30);' + 'INSERT INTO EMP VALUES' + '('#39'WARD'#39','#39'SALESMAN'#39',7698,'#39'02/22/81'#39',1250,500,30);' + 'INSERT INTO EMP VALUES' + '('#39'JONES'#39','#39'MANAGER'#39',7839,'#39'04/02/81'#39',2975,NULL,20);' + 'INSERT INTO EMP VALUES' + '('#39'MARTIN'#39','#39'SALESMAN'#39',7698,'#39'09/28/81'#39',1250,1400,30);' + 'INSERT INTO EMP VALUES' + '('#39'BLAKE'#39','#39'MANAGER'#39',7839,'#39'05/01/81'#39',2850,NULL,30);' + 'INSERT INTO EMP VALUES' + '('#39'CLARK'#39','#39'MANAGER'#39',7839,'#39'06/09/81'#39',2450,NULL,10);' + 'INSERT INTO EMP VALUES' + '('#39'SCOTT'#39','#39'ANALYST'#39',7566,'#39'07/13/87'#39',3000,NULL,20);' + 'INSERT INTO EMP VALUES' + '('#39'KING'#39','#39'PRESIDENT'#39',NULL,'#39'11/17/81'#39',5000,NULL,10);' + 'INSERT INTO EMP VALUES' + '('#39'TURNER'#39','#39'SALESMAN'#39',7698,'#39'09/08/81'#39',1500,0,30);' + 'INSERT INTO EMP VALUES' + '('#39'ADAMS'#39','#39'CLERK'#39',7788,'#39'07/13/87'#39',1100,NULL,20);' + 'INSERT INTO EMP VALUES' + '('#39'JAMES'#39','#39'CLERK'#39',7698,'#39'12/03/81'#39',950,NULL,30);' + 'INSERT INTO EMP VALUES' + '('#39'FORD'#39','#39'ANALYST'#39',7566,'#39'12/03/81'#39',3000,NULL,20);' + 'INSERT INTO EMP VALUES' + '('#39'MILLER'#39','#39'CLERK'#39',7782,'#39'01/23/82'#39',1300,NULL,10);') + Connection = Connection + Left = 200 + Top = 24 + end + object scDrop: TMSScript + SQL.Strings = ( + 'DROP TABLE EMP;' + 'DROP TABLE DEPT;') + Connection = Connection + Left = 200 + Top = 80 + end +end diff --git a/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/Failover/Data.pas b/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/Failover/Data.pas new file mode 100644 index 0000000..0bbfda2 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/Failover/Data.pas @@ -0,0 +1,96 @@ +unit Data; + +interface + +uses + Classes, SysUtils, Windows, Menus, ImgList, StdCtrls, ComCtrls, Buttons, + ExtCtrls, Graphics, Controls, Forms, DB, + MemData, DBAccess, MSAccess, MemDS, SdacVcl, DAScript, MSScript; + +type + TDM = class(TDataModule) + Connection: TMSConnection; + quDetail: TMSQuery; + quMaster: TMSQuery; + dsMaster: TDataSource; + dsDetail: TDataSource; + scCreate: TMSScript; + scDrop: TMSScript; + private + public + procedure KillSession; + function InTransaction: boolean; + procedure StartTransaction; + procedure RollbackTransaction; + procedure CommitTransaction; + end; + +const + ProductColor: TColor = $5D5DCC; + +var + DM: TDM; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} + +uses + Main; + +{ TDM } + +procedure TDM.KillSession; +var + KillConnection: TMSConnection; + Query: TMSQuery; + SPID: string; +begin + Query := TMSQuery.Create(nil); + try + Query.Connection := Connection; + Query.SQL.Text := 'SELECT @@SPID AS ''SPID'''; + Query.Open; + SPID := Query.FieldByName('SPID').AsString; + finally + Query.Free; + end; + KillConnection := TMSConnection.Create(nil); + try + KillConnection.Server := Connection.Server; + KillConnection.Username := Connection.Username; + KillConnection.Password := Connection.Password; + KillConnection.Database := Connection.Database; + KillConnection.LoginPrompt := False; + KillConnection.ExecSQL(Format('KILL %s', [SPID]), []); + finally + KillConnection.Free; + end; +end; + +function TDM.InTransaction: boolean; +begin + Result := Connection.InTransaction; +end; + +procedure TDM.StartTransaction; +begin + Connection.StartTransaction; +end; + +procedure TDM.CommitTransaction; +begin + Connection.Commit; +end; + +procedure TDM.RollbackTransaction; +begin + Connection.Rollback; +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/Failover/FailOver_VclNet.bdsproj b/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/Failover/FailOver_VclNet.bdsproj new file mode 100644 index 0000000..3a6e56e --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/Failover/FailOver_VclNet.bdsproj @@ -0,0 +1,184 @@ + + + + + + + + + + + + FailOver_VclNet.dpr + + + + + + + + + + + + + + 7.0 + + + 0 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + Borland.Vcl + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + + + 0 + 0 + 1 + True + False + False + 4096 + 1048576 + 4194304 + + + + + + + + d:\windows\microsoft.net\framework\v1.1.4322 + d:\windows\microsoft.net\framework\v1.1.4322\System.Drawing.dll + + + True + + + + + + False + + + + + + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1033 + 1252 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/Failover/FailOver_VclNet.dpr b/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/Failover/FailOver_VclNet.dpr new file mode 100644 index 0000000..d4fc643 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/Failover/FailOver_VclNet.dpr @@ -0,0 +1,17 @@ +program FailOver_VclNet; + +{%DelphiDotNetAssemblyCompiler '$(SystemRoot)\microsoft.net\framework\v1.1.4322\system.drawing.dll'} + +uses + Forms, + Main in 'Main.pas' {MainForm}, + Data in 'Data.pas' {DM: TDataModule}, + About in 'About.pas' {AboutForm}; + +{$R *.res} + +begin + Application.Initialize; + Application.CreateForm(TMainForm, MainForm); + Application.Run; +end. diff --git a/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/Failover/FailOver_VclNet.res b/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/Failover/FailOver_VclNet.res new file mode 100644 index 0000000..c2869c8 Binary files /dev/null and b/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/Failover/FailOver_VclNet.res differ diff --git a/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/Failover/Main.nfm b/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/Failover/Main.nfm new file mode 100644 index 0000000..a30c0c5 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/Failover/Main.nfm @@ -0,0 +1,758 @@ +object MainForm: TMainForm + Left = 200 + Top = 130 + Width = 820 + Height = 480 + Caption = 'FailOver Demo' + Color = clBtnFace + Constraints.MinHeight = 480 + Constraints.MinWidth = 820 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + OnActivate = FormActivate + OnCreate = FormCreate + OnDestroy = FormDestroy + PixelsPerInch = 96 + TextHeight = 13 + object pnRight: TPanel + Left = 256 + Top = 49 + Width = 556 + Height = 385 + Align = alClient + BevelOuter = bvNone + ParentColor = True + TabOrder = 0 + object Splitter1: TSplitter + Left = 0 + Top = 331 + Width = 556 + Height = 2 + Cursor = crVSplit + Align = alTop + Beveled = True + Color = clBtnFace + ParentColor = False + ResizeStyle = rsUpdate + end + object pnMiddle: TPanel + Left = 0 + Top = 0 + Width = 556 + Height = 331 + Align = alTop + BevelOuter = bvNone + Constraints.MinHeight = 160 + ParentColor = True + TabOrder = 0 + object Splitter: TSplitter + Left = 0 + Top = 153 + Width = 556 + Height = 2 + Cursor = crVSplit + Align = alTop + Beveled = True + Color = clBtnFace + MinSize = 100 + ParentColor = False + ResizeStyle = rsUpdate + end + object pnDetail: TPanel + Left = 0 + Top = 155 + Width = 556 + Height = 176 + Align = alClient + BevelOuter = bvNone + ParentColor = True + TabOrder = 0 + object DBGrid2: TDBGrid + Left = 0 + Top = 27 + Width = 556 + Height = 149 + Align = alClient + DataSource = DM.dsDetail + TabOrder = 0 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object Panel9: TPanel + Left = 0 + Top = 0 + Width = 556 + Height = 27 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object Panel7: TPanel + Left = 0 + Top = 2 + Width = 242 + Height = 24 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object DBNavigator2: TDBNavigator + Left = 1 + Top = 1 + Width = 240 + Height = 22 + DataSource = DM.dsDetail + Flat = True + TabOrder = 0 + end + end + end + end + object pnMaster: TPanel + Left = 0 + Top = 0 + Width = 556 + Height = 153 + Align = alTop + BevelOuter = bvNone + Constraints.MinHeight = 100 + ParentColor = True + TabOrder = 1 + object DBGrid1: TDBGrid + Left = 0 + Top = 1 + Width = 556 + Height = 152 + Align = alBottom + Anchors = [akLeft, akTop, akRight, akBottom] + DataSource = DM.dsMaster + TabOrder = 0 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + end + end + object pnBottom: TPanel + Left = 0 + Top = 333 + Width = 556 + Height = 52 + Align = alClient + BevelOuter = bvNone + Color = clGreen + TabOrder = 1 + object meLog: TMemo + Left = 0 + Top = 0 + Width = 556 + Height = 52 + Align = alClient + ReadOnly = True + ScrollBars = ssVertical + TabOrder = 0 + end + end + end + object pnLeft: TPanel + Left = 0 + Top = 49 + Width = 256 + Height = 385 + Align = alLeft + BevelOuter = bvNone + ParentColor = True + TabOrder = 1 + object Panel8: TPanel + Left = 1 + Top = 128 + Width = 243 + Height = 254 + BevelOuter = bvNone + TabOrder = 0 + object cbPooling: TCheckBox + Left = 8 + Top = 138 + Width = 150 + Height = 17 + Caption = 'Pooling' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + ParentFont = False + TabOrder = 6 + OnClick = cbPoolingClick + end + object pnPooling: TPanel + Left = 26 + Top = 157 + Width = 215 + Height = 95 + BevelOuter = bvNone + Color = clGreen + TabOrder = 7 + object Panel10: TPanel + Left = 1 + Top = 1 + Width = 213 + Height = 93 + Anchors = [akLeft, akTop, akRight, akBottom] + BevelOuter = bvNone + TabOrder = 0 + object Label2: TLabel + Left = 6 + Top = 54 + Width = 90 + Height = 13 + Caption = 'ConnectionLifetime' + end + object Label3: TLabel + Left = 6 + Top = 8 + Width = 61 + Height = 13 + Caption = 'MaxPoolSize' + end + object Label4: TLabel + Left = 6 + Top = 31 + Width = 58 + Height = 13 + Caption = 'MinPoolSize' + end + object cbValidate: TCheckBox + Left = 6 + Top = 77 + Width = 111 + Height = 14 + Alignment = taLeftJustify + Caption = 'Validate' + TabOrder = 3 + OnClick = cbValidateClick + end + object edMaxPoolSize: TEdit + Left = 104 + Top = 4 + Width = 103 + Height = 21 + TabOrder = 0 + OnExit = edMaxPoolSizeExit + end + object edMinPoolSize: TEdit + Left = 104 + Top = 27 + Width = 103 + Height = 21 + TabOrder = 1 + OnExit = edMinPoolSizeExit + end + object edConnectionLifetime: TEdit + Left = 104 + Top = 50 + Width = 103 + Height = 21 + TabOrder = 2 + OnExit = edConnectionLifetimeExit + end + end + end + object cbCachedUpdates: TCheckBox + Left = 8 + Top = 7 + Width = 150 + Height = 17 + Caption = 'CachedUpdates' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + ParentFont = False + TabOrder = 0 + OnClick = cbCachedUpdatesClick + end + object cbFailover: TCheckBox + Left = 8 + Top = 88 + Width = 73 + Height = 17 + Caption = 'Failover' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + ParentFont = False + TabOrder = 4 + OnClick = cbFailoverClick + end + object cbLocalMasterDetail: TCheckBox + Left = 8 + Top = 27 + Width = 150 + Height = 17 + Caption = 'LocalMasterDetail' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + ParentFont = False + TabOrder = 1 + OnClick = cbLocalMasterDetailClick + end + object cbDisconnectedMode: TCheckBox + Left = 8 + Top = 68 + Width = 150 + Height = 17 + Caption = 'DisconnectedMode' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + ParentFont = False + TabOrder = 3 + OnClick = cbDisconnectedModeClick + end + object cbFetchAll: TCheckBox + Left = 8 + Top = 48 + Width = 97 + Height = 17 + Caption = 'FetchAll' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + ParentFont = False + TabOrder = 2 + OnClick = cbFetchAllClick + end + object pnFailover: TPanel + Left = 26 + Top = 106 + Width = 215 + Height = 28 + BevelOuter = bvNone + Color = clGreen + TabOrder = 5 + object Panel16: TPanel + Left = 1 + Top = 1 + Width = 213 + Height = 26 + Anchors = [akLeft, akTop, akRight, akBottom] + BevelOuter = bvNone + TabOrder = 0 + object Label7: TLabel + Left = 5 + Top = 7 + Width = 52 + Height = 13 + Caption = 'RetryMode' + end + object coRetryMode: TComboBox + Left = 69 + Top = 3 + Width = 141 + Height = 21 + Style = csDropDownList + ItemHeight = 13 + TabOrder = 0 + Items.Strings = ( + 'Default' + 'Raise' + 'Reconnect' + 'ReconnectExecute') + end + end + end + end + object Panel2: TPanel + Left = 0 + Top = 0 + Width = 256 + Height = 122 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object Panel1: TPanel + Left = 2 + Top = 1 + Width = 253 + Height = 122 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object Panel15: TPanel + Left = 1 + Top = 1 + Width = 251 + Height = 60 + BevelOuter = bvNone + TabOrder = 0 + object Label1: TLabel + Left = 11 + Top = 6 + Width = 48 + Height = 13 + Alignment = taRightJustify + Caption = 'Updates' + Font.Charset = DEFAULT_CHARSET + Font.Color = clMaroon + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + end + object Panel12: TPanel + Left = 12 + Top = 26 + Width = 229 + Height = 24 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btApply: TSpeedButton + Left = 1 + Top = 1 + Width = 75 + Height = 22 + Caption = 'Apply' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clMaroon + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + Transparent = False + OnClick = btApplyClick + end + object btCancel: TSpeedButton + Left = 153 + Top = 1 + Width = 75 + Height = 22 + Caption = 'Cancel' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clMaroon + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + Transparent = False + OnClick = btCancelClick + end + object btCommit: TSpeedButton + Left = 77 + Top = 1 + Width = 75 + Height = 22 + Caption = 'Commit' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clMaroon + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + Transparent = False + OnClick = btCommitClick + end + end + end + object Panel17: TPanel + Left = 1 + Top = 62 + Width = 251 + Height = 58 + BevelOuter = bvNone + TabOrder = 1 + object Label6: TLabel + Left = 11 + Top = 6 + Width = 74 + Height = 13 + Alignment = taRightJustify + Caption = 'Transactions' + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + end + object Panel5: TPanel + Left = 12 + Top = 26 + Width = 229 + Height = 24 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btStartTrans: TSpeedButton + Left = 1 + Top = 1 + Width = 75 + Height = 22 + Caption = 'Start' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + Transparent = False + OnClick = btStartTransClick + end + object btCommitTrans: TSpeedButton + Left = 77 + Top = 1 + Width = 75 + Height = 22 + Caption = 'Commit' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + Transparent = False + OnClick = btCommitTransClick + end + object btRollbackTrans: TSpeedButton + Left = 153 + Top = 1 + Width = 75 + Height = 22 + Caption = 'Rollback' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + Transparent = False + OnClick = btRollbackTransClick + end + end + end + end + end + end + object StatusBar: TStatusBar + Left = 0 + Top = 434 + Width = 812 + Height = 19 + Panels = < + item + Width = 208 + end + item + Width = 208 + end + item + Width = 208 + end + item + Width = 50 + end> + end + object pnTop: TPanel + Left = 0 + Top = 0 + Width = 812 + Height = 49 + Align = alTop + BevelOuter = bvNone + ParentColor = True + TabOrder = 3 + OnMouseMove = pnTopMouseMove + object lbAbout: TLabel + Left = 762 + Top = 6 + Width = 34 + Height = 13 + Cursor = crHandPoint + Anchors = [akTop, akRight] + Caption = 'About' + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlue + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold, fsUnderline] + ParentFont = False + OnClick = lbAboutClick + OnMouseMove = lbAboutMouseMove + end + object Panel18: TPanel + Left = 2 + Top = 1 + Width = 418 + Height = 47 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btConnect: TSpeedButton + Left = 167 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Connect' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + NumGlyphs = 2 + ParentFont = False + Transparent = False + OnClick = btConnectClick + end + object btDisconnect: TSpeedButton + Left = 250 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Disconnect' + Enabled = False + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + NumGlyphs = 2 + ParentFont = False + Transparent = False + OnClick = btDisconnectClick + end + object btClose: TSpeedButton + Left = 84 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Close' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + Transparent = False + OnClick = btCloseClick + end + object btOpen: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Open' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + Transparent = False + OnClick = btOpenClick + end + object btKillSession: TSpeedButton + Left = 333 + Top = 1 + Width = 84 + Height = 22 + Caption = 'Kill session' + Enabled = False + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clRed + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + ParentFont = False + Transparent = False + OnClick = btKillSessionClick + end + object btCreate: TSpeedButton + Left = 1 + Top = 24 + Width = 82 + Height = 22 + Caption = 'Create' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + ParentFont = False + Transparent = False + OnClick = btCreateDropClick + end + object btDrop: TSpeedButton + Left = 84 + Top = 24 + Width = 82 + Height = 22 + Caption = 'Drop' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + ParentFont = False + Transparent = False + OnClick = btCreateDropClick + end + object DBNavigator1: TDBNavigator + Left = 167 + Top = 24 + Width = 250 + Height = 22 + DataSource = DM.dsMaster + Flat = True + TabOrder = 0 + end + end + object cbDebug: TCheckBox + Left = 685 + Top = 5 + Width = 64 + Height = 17 + Anchors = [akTop, akRight] + Caption = 'Debug' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + TabOrder = 1 + OnClick = cbDebugClick + end + end +end diff --git a/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/Failover/Main.pas b/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/Failover/Main.pas new file mode 100644 index 0000000..aee12c7 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/Failover/Main.pas @@ -0,0 +1,533 @@ +unit Main; + +interface + +uses + Classes, SysUtils, + Windows, Menus, ImgList, StdCtrls, ComCtrls, Buttons, ExtCtrls, Graphics, + Controls, Forms, Dialogs, Grids, DBCtrls, DBGrids, + DB, MemData, DBAccess, Data, About; + +type + TMainForm = class(TForm) + DBGrid1: TDBGrid; + pnTop: TPanel; + btConnect: TSpeedButton; + btDisconnect: TSpeedButton; + btOpen: TSpeedButton; + btClose: TSpeedButton; + pnMaster: TPanel; + pnRight: TPanel; + pnLeft: TPanel; + pnMiddle: TPanel; + DBGrid2: TDBGrid; + Panel7: TPanel; + DBNavigator2: TDBNavigator; + Panel8: TPanel; + cbFailover: TCheckBox; + cbLocalMasterDetail: TCheckBox; + cbCachedUpdates: TCheckBox; + cbPooling: TCheckBox; + pnPooling: TPanel; + Panel10: TPanel; + cbValidate: TCheckBox; + edMaxPoolSize: TEdit; + edMinPoolSize: TEdit; + edConnectionLifetime: TEdit; + Label2: TLabel; + Label3: TLabel; + Label4: TLabel; + pnBottom: TPanel; + meLog: TMemo; + cbDisconnectedMode: TCheckBox; + cbFetchAll: TCheckBox; + Panel12: TPanel; + btApply: TSpeedButton; + btCancel: TSpeedButton; + btCommit: TSpeedButton; + Label1: TLabel; + Panel5: TPanel; + btStartTrans: TSpeedButton; + btCommitTrans: TSpeedButton; + btRollbackTrans: TSpeedButton; + Label6: TLabel; + StatusBar: TStatusBar; + btKillSession: TSpeedButton; + coRetryMode: TComboBox; + Label7: TLabel; + pnDetail: TPanel; + Splitter: TSplitter; + DBNavigator1: TDBNavigator; + Panel9: TPanel; + lbAbout: TLabel; + pnFailover: TPanel; + Panel16: TPanel; + Panel18: TPanel; + Splitter1: TSplitter; + Panel15: TPanel; + Panel17: TPanel; + Panel1: TPanel; + cbDebug: TCheckBox; + Panel2: TPanel; + btDrop: TSpeedButton; + btCreate: TSpeedButton; + procedure FormCreate(Sender: TObject); + procedure btConnectClick(Sender: TObject); + procedure btDisconnectClick(Sender: TObject); + procedure btOpenClick(Sender: TObject); + procedure btCloseClick(Sender: TObject); + procedure cbFailoverClick(Sender: TObject); + procedure FormDestroy(Sender: TObject); + procedure cbPoolingClick(Sender: TObject); + procedure edMaxPoolSizeExit(Sender: TObject); + procedure edMinPoolSizeExit(Sender: TObject); + procedure edConnectionLifetimeExit(Sender: TObject); + procedure cbValidateClick(Sender: TObject); + procedure cbCachedUpdatesClick(Sender: TObject); + procedure cbDisconnectedModeClick(Sender: TObject); + procedure FormActivate(Sender: TObject); + procedure cbLocalMasterDetailClick(Sender: TObject); + procedure cbFetchAllClick(Sender: TObject); + procedure btApplyClick(Sender: TObject); + procedure btCommitClick(Sender: TObject); + procedure btCancelClick(Sender: TObject); + procedure btStartTransClick(Sender: TObject); + procedure btCommitTransClick(Sender: TObject); + procedure btRollbackTransClick(Sender: TObject); + procedure btKillSessionClick(Sender: TObject); + procedure lbAboutClick(Sender: TObject); + procedure cbDebugClick(Sender: TObject); + procedure lbAboutMouseMove(Sender: TObject; Shift: TShiftState; X, + Y: Integer); + procedure pnTopMouseMove(Sender: TObject; Shift: TShiftState; X, + Y: Integer); + procedure btCreateDropClick(Sender: TObject); + private + FActivated, + FShouldNotUpdateControls: boolean; + procedure OptionsToEditors; + procedure EditorsToOptions; + function GetShouldNotUpdateControls: boolean; + + procedure ConnectionAfterConnect(Sender: TObject); + procedure ConnectionAfterDisconnect(Sender: TObject); + procedure ConnectionConnectionLost(Sender: TObject; + Component: TComponent; ConnLostCause: TConnLostCause; + var RetryMode: TRetryMode); + procedure dsUpdateData(Sender: TObject); + procedure dsDataChange(Sender: TObject; Field: TField); + + procedure ShowPending; + procedure ShowTrans; + public + property ShouldNotUpdateControls: boolean read GetShouldNotUpdateControls; + end; + +var + MainForm: TMainForm; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} + +{$IFNDEF VER130} +{$IFNDEF VER140} +{$IFNDEF CLR} + {$DEFINE XPMAN} + {$R WindowsXP.res} +{$ENDIF} +{$ENDIF} +{$ENDIF} + +{$IFDEF XPMAN} +uses + UxTheme; +{$ENDIF} + +function TMainForm.GetShouldNotUpdateControls: boolean; +begin + Result := not FActivated or FShouldNotUpdateControls; +end; + +procedure TMainForm.OptionsToEditors; +begin + FShouldNotUpdateControls := True; + cbFailover.Checked := DM.Connection.Options.LocalFailover; + cbPooling.Checked := DM.Connection.Pooling; + with DM.Connection.PoolingOptions do begin + edMaxPoolSize.Text := IntToStr(MaxPoolSize); + edMinPoolSize.Text := IntToStr(MinPoolSize); + edConnectionLifetime.Text := IntToStr(ConnectionLifetime); + cbValidate.Checked := Validate; + end; + cbCachedUpdates.Checked := DM.quDetail.CachedUpdates; + cbLocalMasterDetail.Checked := DM.quDetail.Options.LocalMasterDetail; + cbFetchAll.Checked := DM.quDetail.FetchAll; + cbDisconnectedMode.Checked := DM.Connection.Options.DisconnectedMode; + cbDebug.Checked := DM.quMaster.Debug; + FShouldNotUpdateControls := False; +end; + +procedure TMainForm.EditorsToOptions; +var + OnExit: TNotifyEvent; +begin + if ActiveControl is TEdit then + OnExit := TEdit(ActiveControl).OnExit + else + if ActiveControl is TMemo then + OnExit := TMemo(ActiveControl).OnExit + else + Exit; + if Assigned(OnExit) then + OnExit(nil); +end; + +procedure TMainForm.FormCreate(Sender: TObject); +{$IFDEF XPMAN} + procedure UpdateStyle(Control: TWinControl); + var + Panel: TPanel; + i: integer; + begin + for i := 0 to Control.ControlCount - 1 do begin + if Control.Controls[i] is TSpeedButton then + TSpeedButton(Control.Controls[i]).Flat := False + else + if Control.Controls[i] is TDBNavigator then + TDBNavigator(Control.Controls[i]).Flat := False; + if Control.Controls[i] is TWinControl then begin + if (Control.Controls[i] is TPanel) then begin + Panel := TPanel(Control.Controls[i]); + Panel.ParentBackground := False; + Panel.Color := clBtnFace; + end; + UpdateStyle(TWinControl(Control.Controls[i])); + end; + end; + end; +{$ENDIF} + +begin + DM := TDM.Create(nil); + AboutForm := TAboutForm.Create(nil); +{$IFDEF XPMAN} + if UseThemes then + UpdateStyle(Self); +{$ENDIF} + DM.Connection.AfterConnect := ConnectionAfterConnect; + DM.Connection.AfterDisconnect := ConnectionAfterDisconnect;; + DM.Connection.OnConnectionLost := ConnectionConnectionLost; + DM.dsDetail.OnStateChange := dsUpdateData; + DM.dsDetail.OnDataChange := dsDataChange; + DM.dsMaster.OnStateChange := dsUpdateData; + DM.dsMaster.OnDataChange := dsDataChange; + OptionsToEditors; +end; + +procedure TMainForm.FormDestroy(Sender: TObject); +begin + DM.Free; + AboutForm.Free; +end; + +procedure TMainForm.FormActivate(Sender: TObject); +begin + FActivated := True; +end; + +procedure TMainForm.btConnectClick(Sender: TObject); +begin + EditorsToOptions; + DM.Connection.Connect; +end; + +procedure TMainForm.btDisconnectClick(Sender: TObject); +begin + EditorsToOptions; + DM.Connection.Disconnect; +end; + +procedure TMainForm.btOpenClick(Sender: TObject); +begin + EditorsToOptions; + DM.quMaster.Open; + DM.quDetail.Open; +end; + +procedure TMainForm.btCloseClick(Sender: TObject); +begin + EditorsToOptions; + DM.quMaster.Close; + DM.quDetail.Close; +end; + +procedure TMainForm.cbDisconnectedModeClick(Sender: TObject); +begin + if ShouldNotUpdateControls then + Exit; + try + DM.Connection.Options.DisconnectedMode := cbDisconnectedMode.Checked; + except + OptionsToEditors; + raise; + end; +end; + +procedure TMainForm.cbFailoverClick(Sender: TObject); +begin + if ShouldNotUpdateControls then + Exit; + DM.Connection.Options.LocalFailover := cbFailover.Checked; +end; + +procedure TMainForm.cbPoolingClick(Sender: TObject); +begin + if ShouldNotUpdateControls then + Exit; + DM.Connection.Pooling := cbPooling.Checked; +end; + +procedure TMainForm.edMaxPoolSizeExit(Sender: TObject); +begin + try + DM.Connection.PoolingOptions.MaxPoolSize := StrToInt(edMaxPoolSize.Text); + except + OptionsToEditors; + raise; + end; +end; + +procedure TMainForm.edMinPoolSizeExit(Sender: TObject); +begin + try + DM.Connection.PoolingOptions.MinPoolSize := StrToInt(edMinPoolSize.Text); + except + OptionsToEditors; + raise; + end; +end; + +procedure TMainForm.edConnectionLifetimeExit(Sender: TObject); +begin + try + DM.Connection.PoolingOptions.ConnectionLifetime := StrToInt(edConnectionLifetime.Text); + except + OptionsToEditors; + raise; + end; +end; + +procedure TMainForm.cbValidateClick(Sender: TObject); +begin + if ShouldNotUpdateControls then + Exit; + DM.Connection.PoolingOptions.Validate := cbValidate.Checked; +end; + +procedure TMainForm.cbCachedUpdatesClick(Sender: TObject); +begin + if ShouldNotUpdateControls then + Exit; + try + DM.quDetail.CachedUpdates := cbCachedUpdates.Checked; + DM.quMaster.CachedUpdates := cbCachedUpdates.Checked; + except + OptionsToEditors; + raise; + end; +end; + +procedure TMainForm.ConnectionConnectionLost(Sender: TObject; + Component: TComponent; ConnLostCause: TConnLostCause; + var RetryMode: TRetryMode); +var + Msg: string; +begin + case ConnLostCause of + clUnknown: + Msg := 'for reasons not known'; + clExecute: + Msg := 'during SQL execution'; + clOpen: + Msg := 'during query opening'; + clApply: + Msg := 'during DataSet.ApplyUpdates'; + clServiceQuery: + Msg := 'during service information request'; + clTransStart: + Msg := 'during transaction start'; + clConnectionApply: + Msg := 'during Connection.ApplyUpdates'; + clConnect: + Msg := 'during connection establishing'; + end; + meLog.Lines.Add(TimeToStr(Now) + ' ' + Component.Name + ' - Connection lost ' + Msg); + if coRetryMode.ItemIndex <> 0 then + RetryMode := TRetryMode(coRetryMode.ItemIndex - 1) +end; + +procedure TMainForm.ConnectionAfterConnect(Sender: TObject); +begin + btConnect.Enabled := False; + btDisconnect.Enabled := True; + btKillSession.Enabled := True; +end; + +procedure TMainForm.ConnectionAfterDisconnect(Sender: TObject); +begin + btDisconnect.Enabled := False; + btKillSession.Enabled := False; + btConnect.Enabled := True; +end; + +procedure TMainForm.dsUpdateData(Sender: TObject); +begin + ShowPending; +end; + +procedure TMainForm.dsDataChange(Sender: TObject; Field: TField); +begin + ShowPending; +end; + +procedure TMainForm.cbLocalMasterDetailClick(Sender: TObject); +begin + try + DM.quDetail.Options.LocalMasterDetail := cbLocalMasterDetail.Checked; + except + OptionsToEditors; + raise; + end; +end; + +procedure TMainForm.cbFetchAllClick(Sender: TObject); +begin + DM.quDetail.FetchAll := cbFetchAll.Checked; + DM.quMaster.FetchAll := cbFetchAll.Checked; +end; + +procedure TMainForm.ShowPending; +begin + if DM.quMaster.UpdatesPending then + StatusBar.Panels[0].Text := 'Master Updates Pending' + else + StatusBar.Panels[0].Text := ''; + if DM.quDetail.UpdatesPending then + StatusBar.Panels[1].Text := 'Detail Updates Pending' + else + StatusBar.Panels[1].Text := ''; +end; + +procedure TMainForm.ShowTrans; +begin + if DM.InTransaction then + StatusBar.Panels[2].Text := 'UpdateTransaction is Active' + else + StatusBar.Panels[2].Text := ''; +end; + +procedure TMainForm.btApplyClick(Sender: TObject); +begin + if DM.quMaster.UpdatesPending then + DM.quMaster.ApplyUpdates; + if DM.quDetail.UpdatesPending then + DM.quDetail.ApplyUpdates; + ShowPending; +end; + +procedure TMainForm.btCommitClick(Sender: TObject); +begin + DM.quMaster.CommitUpdates; + DM.quDetail.CommitUpdates; + ShowPending; +end; + +procedure TMainForm.btCancelClick(Sender: TObject); +begin + if DM.quMaster.UpdatesPending then + DM.quMaster.CancelUpdates; + if DM.quDetail.UpdatesPending then + DM.quDetail.CancelUpdates; + ShowPending; +end; + +procedure TMainForm.btStartTransClick(Sender: TObject); +begin + DM.StartTransaction; + ShowTrans; +end; + +procedure TMainForm.btCommitTransClick(Sender: TObject); +begin + DM.CommitTransaction; + ShowTrans; +end; + +procedure TMainForm.btRollbackTransClick(Sender: TObject); +begin + DM.RollbackTransaction; + ShowTrans; +end; + +procedure TMainForm.btKillSessionClick(Sender: TObject); +begin + try + DM.KillSession; + btKillSession.Enabled := False; + meLog.Lines.Add(TimeToStr(Now) + ' Session was killed'); + except + on e: Exception do + meLog.Lines.Add(TimeToStr(Now) + ' ' + Trim(e.Message)); + end; +end; + +procedure TMainForm.lbAboutMouseMove(Sender: TObject; Shift: TShiftState; + X, Y: Integer); +begin + lbAbout.Font.Color := $4080FF; +end; + +procedure TMainForm.pnTopMouseMove(Sender: TObject; Shift: TShiftState; X, + Y: Integer); +begin + lbAbout.Font.Color := $FF0000; +end; + +procedure TMainForm.lbAboutClick(Sender: TObject); +begin + AboutForm.ShowModal; + lbAbout.Font.Color := $FF0000; +end; + +procedure TMainForm.cbDebugClick(Sender: TObject); +begin + DM.quMaster.Debug := cbDebug.Checked; + DM.quDetail.Debug := cbDebug.Checked; + DM.scCreate.Debug := cbDebug.Checked; + DM.scDrop.Debug := cbDebug.Checked; +end; + +procedure TMainForm.btCreateDropClick(Sender: TObject); +var + s: string; +begin + if Sender = btDrop then + s := 'removed from database' + else + s := 'created in database'; + if MessageDlg(Format('Objects required for the demo will be %s. Continue?', [s]), + mtConfirmation, [mbYes, mbNo], 0) = mrYes then begin + if Sender = btCreate then + DM.scCreate.Execute + else + DM.scDrop.Execute; + end; +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/WinForms/DataSet.bdsproj b/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/WinForms/DataSet.bdsproj new file mode 100644 index 0000000..3f96cde --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/WinForms/DataSet.bdsproj @@ -0,0 +1,177 @@ + + + + + + + + + + + + DataSet.dpr + + + + + + + + + + + + + + + + + + + + + + 7.0 + + + 0 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + Borland.Vcl + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + + + 0 + 0 + 1 + True + False + False + 4096 + 1048576 + 4194304 + + + + + + + + D:\WINDOWS\microsoft.net\framework\v1.1.4322;D:\Program Files\CoreLab\Sdac for Delphi2005\Demos\dotNet\WinForms + D:\Program Files\CoreLab\Sdac for Delphi2005\Demos\dotNet\WinForms\Borland.VclDbRtl.dll;D:\Program Files\CoreLab\Sdac for Delphi2005\Demos\dotNet\WinForms\Borland.VclRtl.dll;D:\Program Files\CoreLab\Sdac for Delphi2005\Demos\dotNet\WinForms\Borland.Delphi.dll;D:\Program Files\CoreLab\Sdac for Delphi2005\Demos\dotNet\WinForms\CoreLab.Sdac.AdoNet.dll;D:\Program Files\CoreLab\Sdac for Delphi2005\Demos\dotNet\WinForms\CoreLab.Dac.dll;D:\Program Files\CoreLab\Sdac for Delphi2005\Demos\dotNet\WinForms\CoreLab.Sdac.dll;D:\WINDOWS\microsoft.net\framework\v1.1.4322\System.Design.dll;D:\WINDOWS\microsoft.net\framework\v1.1.4322\System.XML.dll;D:\WINDOWS\microsoft.net\framework\v1.1.4322\System.Windows.Forms.dll;D:\WINDOWS\microsoft.net\framework\v1.1.4322\System.Drawing.dll;D:\WINDOWS\microsoft.net\framework\v1.1.4322\System.Data.dll;D:\WINDOWS\microsoft.net\framework\v1.1.4322\System.dll + + + True + + + + + + False + + + + + + False + + + + $00000000 + + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/WinForms/DataSet.dpr b/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/WinForms/DataSet.dpr new file mode 100644 index 0000000..a36dabb --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/WinForms/DataSet.dpr @@ -0,0 +1,81 @@ +program DataSet; + +{%DelphiDotNetAssemblyCompiler '$(SystemRoot)\microsoft.net\framework\v1.1.4322\System.dll'} +{%DelphiDotNetAssemblyCompiler '$(SystemRoot)\microsoft.net\framework\v1.1.4322\System.Data.dll'} +{%DelphiDotNetAssemblyCompiler '$(SystemRoot)\microsoft.net\framework\v1.1.4322\System.Drawing.dll'} +{%DelphiDotNetAssemblyCompiler '$(SystemRoot)\microsoft.net\framework\v1.1.4322\System.Windows.Forms.dll'} +{%DelphiDotNetAssemblyCompiler '$(SystemRoot)\microsoft.net\framework\v1.1.4322\System.XML.dll'} +{%DelphiDotNetAssemblyCompiler '$(SystemRoot)\microsoft.net\framework\v1.1.4322\System.Design.dll'} +{%DelphiDotNetAssemblyCompiler 'CoreLab.Sdac.dll'} +{%DelphiDotNetAssemblyCompiler 'CoreLab.Dac.dll'} +{%DelphiDotNetAssemblyCompiler 'CoreLab.Sdac.AdoNet.dll'} +{%DelphiDotNetAssemblyCompiler 'Borland.Delphi.dll'} +{%DelphiDotNetAssemblyCompiler 'Borland.VclRtl.dll'} +{%DelphiDotNetAssemblyCompiler 'Borland.VclDbRtl.dll'} + +uses + System.Reflection, + System.Runtime.CompilerServices, + System.Windows.Forms, + MainForm in 'MainForm.pas' {MainForm.TMainForm: System.Windows.Forms.Form}; + +// +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +// +[assembly: AssemblyTitle('')] +[assembly: AssemblyDescription('')] +[assembly: AssemblyConfiguration('')] +[assembly: AssemblyCompany('')] +[assembly: AssemblyProduct('')] +[assembly: AssemblyCopyright('')] +[assembly: AssemblyTrademark('')] +[assembly: AssemblyCulture('')] + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion('1.0.*')] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory which is +// %Project Directory%\bin\. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile('..\\..\\mykey.snk')] +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile('')] +[assembly: AssemblyKeyName('')] + +[STAThread] +begin + Application.Run(TMainForm.Create); +end. diff --git a/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/WinForms/MainForm.pas b/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/WinForms/MainForm.pas new file mode 100644 index 0000000..406c92c --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/WinForms/MainForm.pas @@ -0,0 +1,312 @@ +unit MainForm; + +interface + +uses + System.Drawing, System.Collections, System.ComponentModel, + System.Windows.Forms, System.Data, System.Globalization, + DB, MSAccess, DBAccess, SdacVcl, CoreLab.Sdac.DataAdapter; + +type + TMainForm = class(System.Windows.Forms.Form) + {$REGION 'Designer Managed Code'} + strict private + /// + /// Required designer variable. + /// + Components: System.ComponentModel.Container; + topPanel: System.Windows.Forms.Panel; + btConnect: System.Windows.Forms.Button; + btDisconnect: System.Windows.Forms.Button; + btFill: System.Windows.Forms.Button; + btClear: System.Windows.Forms.Button; + tbSql: System.Windows.Forms.TextBox; + dataGrid: System.Windows.Forms.DataGrid; + splitter: System.Windows.Forms.Splitter; + statusBar: System.Windows.Forms.StatusBar; + StatusBarPanel1: System.Windows.Forms.StatusBarPanel; + dataSet: System.Data.DataSet; + MSDataAdapter1: CoreLab.Sdac.DataAdapter.MSDataAdapter; + btUpdate: System.Windows.Forms.Button; + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + procedure InitializeComponent; + procedure btConnect_Click(sender: System.Object; e: System.EventArgs); + procedure btDisconnect_Click(sender: System.Object; e: System.EventArgs); + procedure btFill_Click(sender: System.Object; e: System.EventArgs); + procedure btClear_Click(sender: System.Object; e: System.EventArgs); + procedure TMainForm_Load(sender: System.Object; e: System.EventArgs); + procedure tbSql_Leave(sender: System.Object; e: System.EventArgs); + procedure btUpdate_Click(sender: System.Object; e: System.EventArgs); + {$ENDREGION} + strict protected + /// + /// Clean up any resources being used. + /// + procedure Dispose(Disposing: Boolean); override; + protected + ConnectDialog: TMSConnectDialog; + MSConnection: TMSConnection; + MSQuery: TMSQuery; + public + constructor Create; + end; + +implementation + +uses + MSConnectForm; + +{$REGION 'Windows Form Designer generated code'} +/// +/// Required method for Designer support - do not modify +/// the contents of this method with the code editor. +/// +procedure TMainForm.InitializeComponent; +type + TArrayOfSystem_Windows_Forms_StatusBarPanel = array of System.Windows.Forms.StatusBarPanel; +begin + Self.topPanel := System.Windows.Forms.Panel.Create; + Self.btClear := System.Windows.Forms.Button.Create; + Self.btFill := System.Windows.Forms.Button.Create; + Self.btDisconnect := System.Windows.Forms.Button.Create; + Self.btConnect := System.Windows.Forms.Button.Create; + Self.tbSql := System.Windows.Forms.TextBox.Create; + Self.dataGrid := System.Windows.Forms.DataGrid.Create; + Self.dataSet := System.Data.DataSet.Create; + Self.splitter := System.Windows.Forms.Splitter.Create; + Self.statusBar := System.Windows.Forms.StatusBar.Create; + Self.StatusBarPanel1 := System.Windows.Forms.StatusBarPanel.Create; + Self.MSDataAdapter1 := CoreLab.Sdac.DataAdapter.MSDataAdapter.Create; + Self.btUpdate := System.Windows.Forms.Button.Create; + Self.topPanel.SuspendLayout; + (System.ComponentModel.ISupportInitialize(Self.dataGrid)).BeginInit; + (System.ComponentModel.ISupportInitialize(Self.dataSet)).BeginInit; + (System.ComponentModel.ISupportInitialize(Self.StatusBarPanel1)).BeginInit; + Self.SuspendLayout; + // + // topPanel + // + Self.topPanel.Controls.Add(Self.btUpdate); + Self.topPanel.Controls.Add(Self.btClear); + Self.topPanel.Controls.Add(Self.btFill); + Self.topPanel.Controls.Add(Self.btDisconnect); + Self.topPanel.Controls.Add(Self.btConnect); + Self.topPanel.Dock := System.Windows.Forms.DockStyle.Top; + Self.topPanel.Location := System.Drawing.Point.Create(0, 0); + Self.topPanel.Name := 'topPanel'; + Self.topPanel.Size := System.Drawing.Size.Create(568, 24); + Self.topPanel.TabIndex := 0; + // + // btClear + // + Self.btClear.Location := System.Drawing.Point.Create(368, 0); + Self.btClear.Name := 'btClear'; + Self.btClear.TabIndex := 3; + Self.btClear.Text := 'Clear'; + Include(Self.btClear.Click, Self.btClear_Click); + // + // btFill + // + Self.btFill.Location := System.Drawing.Point.Create(200, 0); + Self.btFill.Name := 'btFill'; + Self.btFill.TabIndex := 2; + Self.btFill.Text := 'Fill'; + Include(Self.btFill.Click, Self.btFill_Click); + // + // btDisconnect + // + Self.btDisconnect.Location := System.Drawing.Point.Create(76, 0); + Self.btDisconnect.Name := 'btDisconnect'; + Self.btDisconnect.TabIndex := 1; + Self.btDisconnect.Text := 'Disconnect'; + Include(Self.btDisconnect.Click, Self.btDisconnect_Click); + // + // btConnect + // + Self.btConnect.Location := System.Drawing.Point.Create(0, 0); + Self.btConnect.Name := 'btConnect'; + Self.btConnect.TabIndex := 0; + Self.btConnect.Text := 'Connect'; + Include(Self.btConnect.Click, Self.btConnect_Click); + // + // tbSql + // + Self.tbSql.Dock := System.Windows.Forms.DockStyle.Top; + Self.tbSql.Font := System.Drawing.Font.Create('Courier New', 9.75); + Self.tbSql.Location := System.Drawing.Point.Create(0, 24); + Self.tbSql.Multiline := True; + Self.tbSql.Name := 'tbSql'; + Self.tbSql.Size := System.Drawing.Size.Create(568, 64); + Self.tbSql.TabIndex := 1; + Self.tbSql.Text := ''; + Include(Self.tbSql.Leave, Self.tbSql_Leave); + // + // dataGrid + // + Self.dataGrid.AllowNavigation := False; + Self.dataGrid.DataMember := ''; + Self.dataGrid.DataSource := Self.dataSet; + Self.dataGrid.Dock := System.Windows.Forms.DockStyle.Fill; + Self.dataGrid.HeaderForeColor := System.Drawing.SystemColors.ControlText; + Self.dataGrid.Location := System.Drawing.Point.Create(0, 90); + Self.dataGrid.Name := 'dataGrid'; + Self.dataGrid.Size := System.Drawing.Size.Create(568, 253); + Self.dataGrid.TabIndex := 2; + Self.dataGrid.AllowSorting := False; + // + // dataSet + // + Self.dataSet.DataSetName := 'NewDataSet'; + Self.dataSet.Locale := System.Globalization.CultureInfo.Create(''); + // + // splitter + // + Self.splitter.Cursor := System.Windows.Forms.Cursors.HSplit; + Self.splitter.Dock := System.Windows.Forms.DockStyle.Top; + Self.splitter.Location := System.Drawing.Point.Create(0, 88); + Self.splitter.Name := 'splitter'; + Self.splitter.Size := System.Drawing.Size.Create(568, 2); + Self.splitter.TabIndex := 3; + Self.splitter.TabStop := False; + // + // statusBar + // + Self.statusBar.Location := System.Drawing.Point.Create(0, 343); + Self.statusBar.Name := 'statusBar'; + Self.statusBar.Panels.AddRange(TArrayOfSystem_Windows_Forms_StatusBarPanel.Create(Self.StatusBarPanel1)); + Self.statusBar.ShowPanels := True; + Self.statusBar.Size := System.Drawing.Size.Create(568, 22); + Self.statusBar.TabIndex := 4; + // + // StatusBarPanel1 + // + Self.StatusBarPanel1.AutoSize := System.Windows.Forms.StatusBarPanelAutoSize.Spring; + Self.StatusBarPanel1.Width := 552; + // + // MSDataAdapter1 + // + Self.MSDataAdapter1.DataSet := nil; + Self.MSDataAdapter1.Name := ''; + Self.MSDataAdapter1.Tag := nil; + // + // btUpdate + // + Self.btUpdate.Location := System.Drawing.Point.Create(280, 0); + Self.btUpdate.Name := 'btUpdate'; + Self.btUpdate.TabIndex := 4; + Self.btUpdate.Text := 'Update'; + Include(Self.btUpdate.Click, Self.btUpdate_Click); + // + // TMainForm + // + Self.AutoScaleBaseSize := System.Drawing.Size.Create(5, 13); + Self.ClientSize := System.Drawing.Size.Create(568, 365); + Self.Controls.Add(Self.dataGrid); + Self.Controls.Add(Self.splitter); + Self.Controls.Add(Self.tbSql); + Self.Controls.Add(Self.topPanel); + Self.Controls.Add(Self.statusBar); + Self.Name := 'TMainForm'; + Self.Text := 'Sdac .NET demo - using DataSet component'; + Include(Self.Load, Self.TMainForm_Load); + Self.topPanel.ResumeLayout(False); + (System.ComponentModel.ISupportInitialize(Self.dataGrid)).EndInit; + (System.ComponentModel.ISupportInitialize(Self.dataSet)).EndInit; + (System.ComponentModel.ISupportInitialize(Self.StatusBarPanel1)).EndInit; + Self.ResumeLayout(False); +end; +{$ENDREGION} + +procedure TMainForm.Dispose(Disposing: Boolean); +begin + if Disposing then + begin + if Components <> nil then + Components.Dispose(); + end; + inherited Dispose(Disposing); +end; + +constructor TMainForm.Create; +begin + inherited Create; + // + // Required for Windows Form Designer support + // + InitializeComponent; + ConnectDialog := TMSConnectDialog.Create(nil); + with ConnectDialog do begin + SavePassword := True; + Caption := 'Connect'; + UsernameLabel := 'Username'; + PasswordLabel := 'Password'; + ServerLabel := 'Server'; + ConnectButton := 'Connect'; + CancelButton := 'Cancel'; + end; + MSConnection := TMSConnection.Create(nil); + with MSConnection do begin + ConnectDialog := ConnectDialog; + LoginPrompt := True; + Username := 'sa'; + Database := 'Northwind'; + Password := ''; + end; + MSQuery := TMSQuery.Create(nil); + with MSQuery do begin + Connection := MSConnection; + SQL.Text := 'select * from Orders'; + end; + MSDataAdapter1.DataSet := MSQuery; +end; + +procedure TMainForm.btUpdate_Click(sender: System.Object; e: System.EventArgs); +begin + MSDataAdapter1.Update(dataSet, 'Table1'); +end; + +procedure TMainForm.TMainForm_Load(sender: System.Object; e: System.EventArgs); +begin + tbSql.Text := MSQuery.SQL.Text; +end; + +procedure TMainForm.tbSql_Leave(sender: System.Object; e: System.EventArgs); +begin + MSQuery.SQL.Text := tbSql.Text; +end; + +procedure TMainForm.btConnect_Click(sender: System.Object; e: System.EventArgs); +begin + MSConnection.Open; +end; + +procedure TMainForm.btDisconnect_Click(sender: System.Object; e: System.EventArgs); +begin + MSConnection.Close; +end; + +procedure TMainForm.btFill_Click(sender: System.Object; e: System.EventArgs); +begin + MSDataAdapter1.Fill(dataSet, 'Table1'); + dataGrid.DataMember := 'Table1'; +end; + +procedure TMainForm.btClear_Click(sender: System.Object; e: System.EventArgs); +var + table: DataTable; + i: integer; +begin + dataGrid.DataMember := ''; + dataSet.Clear; + + for i := 0 to dataSet.Tables.Count - 1 do begin + table := dataSet.Tables[i]; + table.Constraints.Clear; + table.Columns.Clear; + end; +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/WinForms/MainForm.resx b/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/WinForms/MainForm.resx new file mode 100644 index 0000000..e036091 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/WinForms/MainForm.resx @@ -0,0 +1,208 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + False + + + True + + + 8, 8 + + + True + + + Private + + + False + + + Private + + + False + + + Private + + + False + + + Private + + + False + + + Private + + + False + + + Private + + + False + + + Private + + + 17, 17 + + + Private + + + False + + + Private + + + False + + + Private + + + Private + + + 107, 17 + + + Private + + + False + + + Private + + + False + + + (Default) + + + False + + + False + + + 8, 8 + + + True + + + 64 + + + True + + \ No newline at end of file diff --git a/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/WinForms/ReadMe.txt b/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/WinForms/ReadMe.txt new file mode 100644 index 0000000..e00d37f --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/Miscellaneous/WinForms/ReadMe.txt @@ -0,0 +1,7 @@ +SQL Server Data Access Components +Copyright 1997-2007, Core Lab. All Rights Reserved +-------------------------------------------------- + +Shows how to use SDAC to create a WinForm application. This demo +project creates a simple WinForms application and fills a data grid +from an MSDataAdapter data source. \ No newline at end of file diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Base/CategoryFrame.nfm b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Base/CategoryFrame.nfm new file mode 100644 index 0000000..6cf1e3d --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Base/CategoryFrame.nfm @@ -0,0 +1,5 @@ +inherited CategoryFrame: TCategoryFrame + Width = 451 + Height = 304 + Align = alClient +end diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Base/CategoryFrame.pas b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Base/CategoryFrame.pas new file mode 100644 index 0000000..becc115 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Base/CategoryFrame.pas @@ -0,0 +1,193 @@ +unit CategoryFrame; + +interface + +uses +{$IFDEF LINUX} + QControls, QStdCtrls, QComCtrls, QGraphics, QForms, +{$ELSE} + Controls, StdCtrls, ShellApi, Windows, Forms, +{$IFDEF WIN32} + OleCtrls, SHDocVw, mshtml, ActiveX, +{$ELSE} + Graphics, Types, +{$ENDIF} +{$ENDIF} +{$IFNDEF VER130} + Variants, +{$ENDIF} + SysUtils, Classes, DemoFrame; + +type +{$IFNDEF WIN32} + TOnNavigate = procedure (DemoDescription: string) of object; +{$ELSE} + TOnNavigate = procedure (Index: integer) of object; +{$ENDIF} + + TCategoryFrame = class(TDemoFrame) + protected + FOnNavigate: TOnNavigate; + FDemosDescription: {$IFNDEF WIN32}TListBox{$ELSE}TWebBrowser{$ENDIF}; + FTempFileName: string; // for Win98 problem avoidance + public + procedure SetDemoDescriptions(Descriptions: TStrings); + constructor Create(AOwner: TComponent); override; + {$IFNDEF WIN32} + procedure DemosDescriptionDblClick(Sender: TObject); + procedure DemoDescriptionMouseMove(Sender: TObject; + Shift: TShiftState; X, Y: Integer); + {$ELSE} + procedure DemosDescriptionBeforeNavigate2(Sender: TObject; + const pDisp: IDispatch; var URL, Flags, TargetFrameName, PostData, + Headers: OleVariant; var Cancel: WordBool); + {$ENDIF} + property OnNavigate: TOnNavigate read FOnNavigate write FOnNavigate; + {$IFNDEF WIN32} + property DemosDescription: TListBox read FDemosDescription; + {$ENDIF} + end; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} +{$IFDEF LINUX} +{$R *.xfm} +{$ENDIF} + +{$IFDEF VER130} +function TryStrToInt(const S: string; out Value: Integer): boolean; +begin + Result := True; + try + Value := StrToInt(S); + except + Result := False + end; +end; +{$ENDIF} + +constructor TCategoryFrame.Create(AOwner: TComponent); +begin + inherited; +{$IFNDEF WIN32} + FDemosDescription := TListBox.Create(self); +{$IFDEF LINUX} + FDemosDescription.Font.Name := 'adobe-courier'; + FDemosDescription.Font.Pitch := fpFixed; +{$ENDIF} +{$IFDEF CLR} + FDemosDescription.Font.Name := 'courier new'; + FDemosDescription.Font.Size := 11; +{$ENDIF} + FDemosDescription.OnDblClick := DemosDescriptionDblClick; + FDemosDescription.OnMouseMove := DemoDescriptionMouseMove; +{$ELSE} + FDemosDescription := TWebBrowser.Create(self); + FDemosDescription.Navigate('about:blank'); // to create document object + FDemosDescription.OnBeforeNavigate2 := DemosDescriptionBeforeNavigate2; +{$ENDIF} + InsertControl(FDemosDescription); + FDemosDescription.Align := alClient; +end; + +{$IFNDEF WIN32} + +procedure TCategoryFrame.SetDemoDescriptions(Descriptions: TStrings); +begin + FDemosDescription.Items.Assign(Descriptions); +end; + +procedure TCategoryFrame.DemoDescriptionMouseMove(Sender: TObject; + Shift: TShiftState; X, Y: Integer); +var + n: integer; +begin + n := FDemosDescription.ItemAtPos(Point(X, Y), True); + If (n = -1) or (Trim(FDemosDescription.Items[n]) = '') or (FDemosDescription.Items[n][1] = ' ') then + FDemosDescription.Cursor := crDefault + else + FDemosDescription.Cursor := crHandPoint; +end; + +// Navigation +procedure TCategoryFrame.DemosDescriptionDblClick(Sender: TObject); +begin + inherited; + if (Trim(FDemosDescription.Items[FDemosDescription.ItemIndex]) <> '') and (pos(' ', FDemosDescription.Items[FDemosDescription.ItemIndex]) <> 1) and Assigned(FOnNavigate) then begin + FOnNavigate(FDemosDescription.Items[FDemosDescription.ItemIndex]); + end; +end; + +{$ELSE} + +procedure TCategoryFrame.SetDemoDescriptions(Descriptions: TStrings); +var + v: Variant; + HTMLDocument: IHTMLDocument2; + Len: integer; +begin + HTMLDocument := FDemosDescription.Document as IHTMLDocument2; + if Assigned(HTMLDocument) then begin + v := VarArrayCreate([0, 0], varVariant); + v[0] := Descriptions.Text; + HTMLDocument.Write(PSafeArray(TVarData(v).VArray)); + HTMLDocument.Close; + end + else begin + Len := GetEnvironmentVariable(PChar('TEMP'), nil, 0); + if Len > 0 then + begin + SetLength(FTempFileName, Len - 1); + GetEnvironmentVariable(PChar('TEMP'), PChar(FTempFileName), Len); + end; + if Length(FTempFileName) > 1 then begin + if FTempFileName[length(FTempFileName) - 1] <> '\' then + FTempFileName := FTempFileName + '\'; + FTempFileName := FTempFileName + 'DAC_Demo_tmp.html'; + Descriptions.SaveToFile(FTempFileName); + FDemosDescription.Navigate(FTempFileName) + end; + end; +end; + +// Navigation +procedure TCategoryFrame.DemosDescriptionBeforeNavigate2(Sender: TObject; + const pDisp: IDispatch; var URL, Flags, TargetFrameName, PostData, + Headers: OleVariant; var Cancel: WordBool); +var + Index: integer; + str: string; +begin + str := ExtractFileName(URL); + if (str = 'blank') or (str = ExtractFileName(FTempFileName)) then // navigating 'about:blank', or the html temporary file + Exit; // let navigator to handle + // our handler + Cancel := True; +{$IFNDEF LINUX} + if not TryStrToInt(str, Index) then begin + str := ExtractFilePath(Application.Exename) + copy(url, 4, Length(url) - 3); + ShellExecute(0, 'open', PChar(str), '', '.', SW_SHOW); + exit; + end; +{$ENDIF} + if Assigned(FOnNavigate) then + FOnNavigate(Index); +end; + +{$ENDIF} + +{$IFDEF WIN32} +initialization + OleInitialize(nil); + +finalization + OleUninitialize; +{$ENDIF} + +end. diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Base/DacDemo.inc b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Base/DacDemo.inc new file mode 100644 index 0000000..27dc695 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Base/DacDemo.inc @@ -0,0 +1,13 @@ +{$IFNDEF LINUX} + { $DEFINE USE_SYNEDIT} + {$IFNDEF VER130} + {$IFNDEF VER140} + {$IFNDEF CLR} + {$DEFINE XPMAN} + {$ENDIF} + {$ENDIF} + {$ENDIF} +{$ENDIF} +{$IFNDEF CLR} + {$DEFINE HAVE_COMPRESS} +{$ENDIF} \ No newline at end of file diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Base/DemoBase.pas b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Base/DemoBase.pas new file mode 100644 index 0000000..5bebb5b --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Base/DemoBase.pas @@ -0,0 +1,416 @@ +unit DemoBase; + +interface + +uses + Classes, SysUtils, DemoFrame, CategoryFrame, DBAccess, MemUtils, +{$IFDEF LINUX} + QControls, QGraphics, QComCtrls, QForms +{$ELSE} + Windows, ComCtrls, Controls, Graphics, Forms, + HTMLConsts, ShellAPI +{$ENDIF} + ; + +type + TDemoType = (dtDemo, dtCategory); + + TDemo = class + protected + FName: string; + FFileName: string; + FHint: string; + FDescription: string; + FDemoType: TDemoType; + FFrameClass: TDemoFrameClass; + FFrame: TDemoFrame; + public + constructor Create(Name, Hint, Description: string; DemoType: TDemoType; FrameClass: TDemoFrameClass; FileName: string = ''); + destructor Destroy; override; + + procedure LoadDemoCode(Strings: TStrings); + procedure LoadFormCode(Strings: TStrings); + procedure OpenDemoFolder; + procedure FreeFrame; + + property Name: string read FName; + property Hint: string read FHint; + property Description: string read FDescription; + property DemoType: TDemoType read FDemoType; + property FrameClass: TDemoFrameClass read FFrameClass; + property Frame: TDemoFrame read FFrame; + end; + + TDemos = class + protected + FDemoTreeNodes: TTreeNodes; + FSelectedDemo: TDemo; + FSupplementaryDemosDescription: TStrings; + function GetSelectedDemo: TDemo; + function GetItems(Index: integer): TDemo; + + function WrapDescription(Demo: TDemo): TStrings; + public + constructor Create(TreeNodes: TTreeNodes); virtual; + destructor Destroy; override; + + procedure RegisterCategory(CategoryName, Hint: string; ImgIndex: integer = -1; SupplementaryDemo: boolean = False); + procedure RegisterDemo(DemoName, DemoHint, DemoDescription, DemoCategory: string; FrameClass: TDemoFrameClass; ImgIndex: integer; FileName: string = ''; SupplementaryDemo: boolean = False); + procedure Clear; + //Navigation + function SelectDemo(DemoIndex: integer): TDemo; //Create demo frame by DemoIndex + + function GetDemoIndex(AbsoluteIndex: integer): integer; + + property Items[Index: integer]: TDemo read GetItems; default; + property SelectedDemo: TDemo read GetSelectedDemo; + end; + +implementation + +const + MainDemosHeader = 'Main Demo Projects'; + SupplementaryDemosHeader = 'Supplementary Demo Projects'; + SupplementaryDemosNote = ' Note, the demo projects listed below are separate projects. ' {$IFNDEF WIN32} + #13#10 {$ENDIF} + ' This project contains only their descriptions and links to their folders.'; + +{$IFNDEF WIN32} +procedure WriteTable(CategoryName, CategoryDescription: string; List: TStrings); +var + strs: TStringList; +begin + List.Add(' '); + List.Add(' ' + CategoryName); + strs := TStringList.Create; + strs.Text := CategoryDescription; + List.AddStrings(strs); + strs.Free; +end; +{$ELSE} +procedure WriteTable(CategoryName, CategoryDescription: string; List: TStrings); +begin + if CategoryName = '' then begin // used to close virtual category + List.Add(''); + Exit; + end; + + List.Add('

' + CategoryName + '

'); + List.Add(''); + List.Add(''); + List.Add(''); + List.Add(''); + List.Add(''); + if CategoryDescription <> '' then begin + List.Add(CategoryDescription); + List.Add('
DemoDescription
'); + end; +end; +{$ENDIF} + +constructor TDemos.Create(TreeNodes: TTreeNodes); +begin + inherited Create; + + if not Assigned(TreeNodes) then + raise Exception.Create('TreeNodes should be set'); + FDemoTreeNodes := TreeNodes; + FSupplementaryDemosDescription := TStringList.Create; +{$IFNDEF WIN32} + FSupplementaryDemosDescription.Text := #13#10' ' + SupplementaryDemosHeader; + FSupplementaryDemosDescription.Add(SupplementaryDemosNote); +{$ENDIF} +end; + +destructor TDemos.Destroy; +begin + Clear; + inherited; +end; + +procedure TDemos.RegisterCategory(CategoryName, Hint: string; ImgIndex: integer = -1; SupplementaryDemo: boolean = False); +var + Node: TTreeNode; + Index: integer; + Category: TDemo; +begin + if SupplementaryDemo then + WriteTable(CategoryName, Hint, FSupplementaryDemosDescription) + else begin + Category := TDemo.Create(CategoryName, Hint, '', dtCategory, TCategoryFrame); + Node := FDemoTreeNodes.AddChildObject(FDemoTreeNodes.GetFirstNode, CategoryName, Category); + if ImgIndex < 0 then + Index := 0 + else + Index := ImgIndex; + Node.ImageIndex := Index; + Node.SelectedIndex := Index; + {$IFNDEF LINUX} + Node.StateIndex := Index; + {$ENDIF} + end; +end; + +procedure TDemos.RegisterDemo(DemoName, DemoHint, DemoDescription, DemoCategory: string; FrameClass: TDemoFrameClass; ImgIndex: integer; FileName: string = ''; SupplementaryDemo: boolean = False); + + function FindCategoryNode(CategoryName: string): TTreeNode; + var + RootNode: TTreeNode; + begin + RootNode := FDemoTreeNodes.GetFirstNode; + if RootNode <> nil then + Result := RootNode.getFirstChild + else + Result := nil; + while Result <> nil do begin + if Result.Text = CategoryName then + break; + Result := Result.getNextSibling; + end; + end; + +{$IFNDEF WIN32} + function CompleteWithSpaces(s: string; ResultLength: word): string; + var + n, i: integer; + begin + result := s; + n := ResultLength - Length(s); + if n > 0 then + for i := 1 to n do + result := result + ' '; + end; +{$ENDIF} + + function ToTableLine(Name, Description, DemoLink: string): string; + begin + {$IFDEF WIN32} + Result := Format(' ' + + '%s%s'#13#10, + [DemoLink, Name, Description]); + {$ELSE} + Result := CompleteWithSpaces(Name, 15) + '- ' + Description + {$IFDEF LINUX}#13{$ELSE}#13#10{$ENDIF}; + {$ENDIF} + end; + +var + CategoryNode, DemoNode: TTreeNode; + Index: integer; + Category, Demo: TDemo; +begin + if SupplementaryDemo then + FSupplementaryDemosDescription.Text := FSupplementaryDemosDescription.Text + ToTableLine(DemoName, DemoDescription, '..\' + DemoCategory + '\' + DemoName) + else begin + CategoryNode := FindCategoryNode(DemoCategory); + if not Assigned(CategoryNode) then + raise Exception.Create('DemoCategory is wrong'); + + Category := TDemo(CategoryNode.Data); + Demo := TDemo.Create(DemoName, DemoHint, DemoDescription, dtDemo, FrameClass, FileName); + DemoNode := FDemoTreeNodes.AddChildObject(CategoryNode, Demo.Name, Demo); + if ImgIndex < 0 then + Index := 1 + else + Index := ImgIndex; + DemoNode.ImageIndex := Index; + DemoNode.SelectedIndex := Index; + {$IFNDEF LINUX} + DemoNode.StateIndex := Index; + {$ENDIF} + + Category.FDescription := Category.FDescription + ToTableLine(DemoName, DemoDescription, IntToStr(DemoNode.AbsoluteIndex)); + end; +end; + +procedure TDemos.Clear; +var + i: integer; +begin + for i := 0 to FDemoTreeNodes.Count - 1 do + if FDemoTreeNodes[i].Data <> nil then + TDemo(FDemoTreeNodes[i].Data).Free; +end; + +function TDemos.GetSelectedDemo: TDemo; +begin + if FSelectedDemo <> nil then + Result := FSelectedDemo + else + raise Exception.Create('No selected demo'); +end; + +function TDemos.GetDemoIndex(AbsoluteIndex: integer): integer; +var + i: integer; +begin + Result := -1; + for i := 0 to FDemoTreeNodes.Count - 1 do + if FDemoTreeNodes[i].AbsoluteIndex = AbsoluteIndex then begin + if FDemoTreeNodes[i].Data <> nil then + Result := i; + Break; + end; +end; + +function TDemos.GetItems(Index: integer): TDemo; +var + i: integer; +begin + i := GetDemoIndex(Index); + if i >= 0 then + Result := TDemo(FDemoTreeNodes[i].Data) + else + raise Exception.Create('Wrong demo index'); +end; + +function TDemos.WrapDescription(Demo: TDemo): TStrings; + +var + CatNode, RootNode: TTreeNode; +begin + Result := TStringList.Create; +{$IFDEF WIN32} + Result.Add(HTMLHeader); + Result.Add('

' + MainDemosHeader + '

'); +{$ELSE} + Result.Add(''); + Result.Add(' ' + MainDemosHeader); + Result.Add(''); +{$ENDIF} + if Demo <> GetItems(0) then //RootCategory + WriteTable(Demo.Name, Demo.Description, Result) + else begin + RootNode := FDemoTreeNodes.GetFirstNode; + CatNode := RootNode.getFirstChild; + while CatNode <> nil do begin + WriteTable(TDemo(CatNode.Data).Name, TDemo(CatNode.Data).Description, Result); + CatNode := CatNode.getNextSibling; + end; +{$IFDEF WIN32} + Result.Add('


' + SupplementaryDemosHeader + '

'); + Result.Add('

' + SupplementaryDemosNote + '

'); +{$ENDIF} + + Result.AddStrings(FSupplementaryDemosDescription); + end; +{$IFDEF WIN32} + Result.Add(HTMLFooter); +{$ENDIF} +end; + +function TDemos.SelectDemo(DemoIndex: integer): TDemo; //Init and show demo by DemoIndex +var + Descriptions: TStrings; +begin + Result := GetItems(DemoIndex); + if (FSelectedDemo <> nil) and (Result <> FSelectedDemo) then + if FSelectedDemo.DemoType <> dtCategory then + FSelectedDemo.FreeFrame //In case of demo selection change we should free demo frame except category description + else + FSelectedDemo.Frame.Hide; + FSelectedDemo := Result; + with FSelectedDemo do + if FFrame = nil then begin + FFrame := FFrameClass.Create(nil); + if DemoType = dtCategory then begin + Descriptions := WrapDescription(FSelectedDemo); + try + TCategoryFrame(FFrame).SetDemoDescriptions(Descriptions); + finally + Descriptions.Free; + end; + end; + end + else + FFrame.Show; +end; + +{TDemo} +constructor TDemo.Create(Name, Hint, Description: string; DemoType: TDemoType; FrameClass: TDemoFrameClass; FileName: string = ''); +begin + inherited Create; + + FName := Name; + if FileName = '' then + FFileName := Name + else + FFileName := FileName; + FHint := Hint; + FDescription := Description; + FFrameClass := FrameClass; + FDemoType := DemoType; +end; + +destructor TDemo.Destroy; +begin + FreeFrame; + + inherited; +end; + +procedure TDemo.LoadDemoCode(Strings: TStrings); +var + FileName: string; +begin + if DemoType = dtCategory then + Strings.Clear + else begin + {$IFDEF LINUX} + FileName := Format('%s/%s/%s.pas', [ExtractFilePath(Application.ExeName), Name, FFileName]); + {$ELSE} + FileName := Format('%s\%s\%s.pas', [ExtractFilePath(Application.ExeName), Name, FFileName]); + {$ENDIF} + + if FileExists(FileName) then + Strings.LoadFromFile(FileName) + else + Strings.Clear; + end; +end; + +procedure TDemo.LoadFormCode(Strings: TStrings); +var + FileName: string; +begin + if DemoType = dtCategory then + Strings.Clear + else begin + {$IFDEF LINUX} + FileName := Format('%s/%s/%s.xfm', [ExtractFilePath(Application.ExeName), Name, FFileName]); + {$ENDIF} + {$IFDEF CLR} + FileName := Format('%s\%s\%s.nfm', [ExtractFilePath(Application.ExeName), Name, FFileName]); + {$ENDIF} + {$IFDEF WIN32} + FileName := Format('%s\%s\%s.dfm', [ExtractFilePath(Application.ExeName), Name, FFileName]); + {$ENDIF} + + if FileExists(FileName) then + Strings.LoadFromFile(FileName) + else + Strings.Clear; + end; +end; + +procedure TDemo.OpenDemoFolder; +{$IFNDEF LINUX} +var + FolderName: string; +begin + if DemoType = dtDemo then begin + FolderName := ExtractFilePath(Application.ExeName) + Name; + ShellExecute(0, 'open', PChar(FolderName), '', '.', SW_SHOW); + end; +end; +{$ELSE} +begin + +end; +{$ENDIF} + +procedure TDemo.FreeFrame; +begin + FFrame.Free; + FFrame := nil; +end; + + +end. diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Base/DemoForm.nfm b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Base/DemoForm.nfm new file mode 100644 index 0000000..631bd91 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Base/DemoForm.nfm @@ -0,0 +1,937 @@ +object DemoForm: TDemoForm + Left = 71 + Top = 139 + Width = 957 + Height = 500 + Caption = 'Data Access Components demos' + Color = clSilver + Constraints.MinHeight = 500 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + Scaled = False + ShowHint = True + WindowState = wsMaximized + OnCreate = FormCreate + OnDestroy = FormDestroy + OnResize = FormResize + PixelsPerInch = 96 + TextHeight = 13 + object TVSplitter: TSplitter + Left = 216 + Top = 69 + Height = 374 + Beveled = True + Color = 9790720 + MinSize = 150 + ParentColor = False + OnCanResize = TVSplitterCanResize + OnMoved = TVSplitterMoved + end + object MainPanel: TPanel + Left = 219 + Top = 69 + Width = 730 + Height = 374 + Align = alClient + BevelOuter = bvNone + Constraints.MinWidth = 730 + TabOrder = 2 + object pnDemo: TPanel + Left = 0 + Top = 0 + Width = 730 + Height = 374 + Align = alClient + BevelOuter = bvNone + TabOrder = 1 + end + object pnSource: TPanel + Left = 0 + Top = 0 + Width = 730 + Height = 374 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + Visible = False + end + end + object StatusBar: TStatusBar + Left = 0 + Top = 443 + Width = 949 + Height = 20 + Font.Charset = DEFAULT_CHARSET + Font.Color = clBtnText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + Panels = < + item + Width = 220 + end + item + Width = 100 + end + item + Width = 480 + end + item + Width = 50 + end> + UseSystemFont = False + end + object PanelUnderTree: TPanel + Left = 0 + Top = 69 + Width = 216 + Height = 374 + Align = alLeft + BevelOuter = bvNone + TabOrder = 0 + object TreeView: TTreeView + Left = 0 + Top = 22 + Width = 351 + Height = 352 + Align = alLeft + HideSelection = False + HotTrack = True + Images = ImageList1 + Indent = 21 + ParentShowHint = False + ReadOnly = True + ShowHint = True + TabOrder = 0 + OnChange = TreeViewChange + OnClick = TreeViewClick + OnKeyDown = TreeViewKeyDown + OnMouseMove = TreeViewMouseMove + end + object ToolBar: TToolBar + Left = 0 + Top = 0 + Width = 216 + Height = 22 + AutoSize = True + ButtonWidth = 28 + Caption = 'ToolBar' + DisabledImages = ilDisabledButtons + EdgeInner = esNone + EdgeOuter = esNone + Flat = True + Images = ilButtons + TabOrder = 1 + object tbBrowseBack: TToolButton + Left = 0 + Top = 0 + Hint = 'Back' + Caption = ' Back ' + DropdownMenu = BackHistoryPopup + ImageIndex = 0 + Style = tbsDropDown + OnClick = tbBrowseBackClick + end + object tbBrowseForward: TToolButton + Left = 41 + Top = 0 + Hint = 'Forward' + DropdownMenu = ForwardHistoryPopup + ImageIndex = 1 + Style = tbsDropDown + OnClick = tbBrowseForwardClick + end + end + end + object pnTopLabel: TPanel + Left = 0 + Top = 0 + Width = 949 + Height = 41 + Align = alTop + BevelOuter = bvNone + TabOrder = 3 + object lbTitle: TLabel + Left = 0 + Top = 0 + Width = 949 + Height = 42 + Cursor = crArrow + Align = alTop + Caption = 'DAC demos' + Color = 9790720 + Constraints.MinWidth = 130 + Font.Charset = RUSSIAN_CHARSET + Font.Color = clWhite + Font.Height = -35 + Font.Name = 'Verdana' + Font.Style = [fsBold, fsItalic] + ParentColor = False + ParentFont = False + OnMouseMove = lbTitleMouseMove + end + object lbAbout: TLabel + Left = 854 + Top = 12 + Width = 34 + Height = 13 + Caption = 'About' + Color = 9790720 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [fsBold, fsUnderline] + ParentColor = False + ParentFont = False + OnClick = lbAboutClick + OnMouseMove = lbAboutMouseMove + end + end + object Panel2: TPanel + Left = 0 + Top = 41 + Width = 949 + Height = 28 + Align = alTop + BevelOuter = bvNone + TabOrder = 4 + object Shape1: TShape + Left = 0 + Top = 25 + Width = 949 + Height = 3 + Align = alBottom + Brush.Color = 9790720 + Pen.Color = clBtnFace + end + object Panel1: TPanel + Left = 1 + Top = 1 + Width = 375 + Height = 24 + BevelOuter = bvNone + Color = 9790720 + TabOrder = 0 + object sbConnect: TSpeedButton + Left = 1 + Top = 1 + Width = 100 + Height = 22 + Hint = 'Connect to database' + Caption = 'Connect' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [fsBold] + Glyph.Data = { + F6050000424DF60500000000000036000000280000001E000000100000000100 + 180000000000C005000000000000000000000000000000000000800080800080 + 8000808000808000808000808000808000808000808000804B40388000808000 + 8080008080008080008080008080008080008080008080008080008080008080 + 00808000803E3E3E800080800080800080800080000080008080008080008080 + 00808000808000808000808000808000808000808000804C40373E352D800080 + 8000808000808000808000808000808000808000808000808000808000808000 + 808000803E3E3E33333380008080008000008000808000808000808000808000 + 808000808000808000807E6A5C80008066574B594B414C403880008080008080 + 0080800080800080800080800080800080800080800080686868800080555555 + 4949493E3E3E8000808000800000800080800080800080800080800080800080 + 8000808000808000807E6B5D72615466564B594B428000808000808000808000 + 808000808000808000808000808000808000808000806868685E5E5E54545449 + 49498000808000800000800080A2C8D864A8C0608D9F5D83964A768D346D8C30 + 70925C8AA38874647E6B5C73615466564B800080800080800080C8C8C8A7A7A7 + 8D8D8D8484847878787070707373738C8C8C7171716868685F5F5F5454548000 + 808000800000800080638CA53FBCE884D5E8A1EBF673E4FF24BEF3039FDE148B + BE45729080008080008080008066574B8000808000808E8E8EBBBBBBD1D1D1E6 + E6E6DFDFDFBCBCBCA0A0A08D8D8D767676800080800080800080555555800080 + 00008000806B94AD44C4F090EAFAA1EBF671D9F424BCF201A7E8039CDA2A6384 + 800080800080800080736154800080800080969696C3C3C3E4E4E4E6E6E6D5D5 + D5BBBBBBA8A8A89D9D9D6666668000808000808000805F5F5F80008000008000 + 806B94AD44C4F08DE4F4A1EBF670D7F224B9EE01A7E8039CDA2F688897806F91 + 7A6A887464800080800080800080969696C3C3C3DFDFDFE6E6E6D3D3D3B8B8B8 + A8A8A89D9D9D6B6B6B7D7D7D77777771717180008080008000008000806B9CAD + 3FBCE88EE4F5A1EBF670D7F224B9EE01A7E8039CDA306B8A8000808000808000 + 808000808000808000809B9B9BBBBBBBDFDFDFE6E6E6D3D3D3B8B8B8A8A8A89D + 9D9D6D6D6D80008080008080008080008080008000008000806B9CB53BB8E67E + E4FEA1EBF672D9F224B9EE01A7E8039CDA326D8D800080800080800080800080 + 8000808000809E9E9EB8B8B8E0E0E0E6E6E6D5D5D5B8B8B8A8A8A89D9D9D7070 + 708000808000808000808000808000800000800080739CB53BB8E67EE4FEA1EB + F66FD7F21FB7EE01A7E8039CDA346F8F80008080008080008080008080008080 + 00809E9E9EB8B8B8E0E0E0E6E6E6D3D3D3B6B6B6A8A8A89D9D9D727272800080 + 800080800080800080800080000080008073A5BD3BB8E67EE4FEA0EAF56ED6F2 + 1FB7EE01A7E8039CDA317092800080800080800080800080800080800080A6A6 + A6B8B8B8E0E0E0E5E5E5D2D2D2B6B6B6A8A8A89D9D9D73737380008080008080 + 0080800080800080000080008073A5BD58C9E78CECFFA0EAF5A6EDF894E7F871 + D9F63CBDE9437C97800080800080800080800080800080800080A6A6A6C5C5C5 + E7E7E7E5E5E5E8E8E8E2E2E2D6D6D6BCBCBC7D7D7D8000808000808000808000 + 8080008000008000806691A2A0DFEAC5F9FDC5F9FDC5F9FDC5F9FDC5F9FDA0DF + EA6691A2800080800080800080800080800080800080919191DBDBDBF4F4F4F4 + F4F4F4F4F4F4F4F4F4F4F4DBDBDB919191800080800080800080800080800080 + 0000800080B8D1DB84AFBF6FA2B46B9BAE6C9DAF6B9BAE6FA2B484AFBFB8D1DB + 800080800080800080800080800080800080D1D1D1AFAFAFA1A1A19B9B9B9D9D + 9D9B9B9BA1A1A1AFAFAFD1D1D180008080008080008080008080008000008000 + 8080008080008080008080008080008080008080008080008080008080008080 + 0080800080800080800080800080800080800080800080800080800080800080 + 8000808000808000808000808000808000808000808000800000} + NumGlyphs = 2 + ParentFont = False + Transparent = False + OnClick = sbConnectClick + end + object sbDisconnect: TSpeedButton + Left = 102 + Top = 1 + Width = 100 + Height = 22 + Hint = 'Dsisconnect from database' + Caption = 'Disconnect' + Enabled = False + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [fsBold] + Glyph.Data = { + 9A050000424D9A0500000000000036000000280000001E0000000F0000000100 + 1800000000006405000000000000000000000000000000000000800080800080 + 800080800080800080800080800080AFBBF7800080800080800080CFCBE38000 + 80800080800080800080800080800080800080800080800080800080CBCBCB80 + 0080800080800080D2D2D2800080800080800080000080008080008080008080 + 0080800080800080CFCBE31140FD6178EE8000806176EA3154F2CFCBE3800080 + 800080800080800080800080800080800080800080D2D2D27373739898988000 + 809696967F7F7FD2D2D280008080008000008000808000808000808000808000 + 808000808000803157F90134FF214BF90134FF3155F480008080008080008080 + 00808000808000808000808000808000808000808383836B6B6B7A7A7A6B6B6B + 8080808000808000808000800000800080A2C8D864A8C0608D9F5D83964A768D + 346D8CFFFFFF1140FD0134FF113FFC800080800080800080800080800080C8C8 + C8A7A7A78D8D8D848484787878707070FFFFFF7373736B6B6B72727280008080 + 00808000808000800000800080638CA53FBCE884D5E8A1EBF673E4FFFFFFFF61 + 7CF60134FF0134FF0134FF6178EE8000808000808000808000808E8E8EBBBBBB + D1D1D1E6E6E6DFDFDFFFFFFF9D9D9D6B6B6B6B6B6B6B6B6B9898988000808000 + 8080008000008000806B94AD44C4F090EAFAA1EBF671D9F4BFC8F70134FF3158 + FBFFFFFF3157F91140FDBFC8F7800080800080800080969696C3C3C3E4E4E4E6 + E6E6D5D5D5D5D5D56B6B6B848484FFFFFF838383737373D5D5D5800080800080 + 00008000806B94AD44C4F08DE4F4A1EBF670D7F224B9EEAFBBF7FFFFFF2F6888 + 800080CFCBE3800080800080800080800080969696C3C3C3DFDFDFE6E6E6D3D3 + D3B8B8B8CBCBCBFFFFFF6B6B6B800080D2D2D280008080008080008000008000 + 806B9CAD3FBCE88EE4F5A1EBF670D7F224B9EE01A7E8039CDA306B8A80008080 + 00808000808000808000808000809B9B9BBBBBBBDFDFDFE6E6E6D3D3D3B8B8B8 + A8A8A89D9D9D6D6D6D80008080008080008080008080008000008000806B9CB5 + 3BB8E67EE4FEA1EBF672D9F224B9EE01A7E8039CDA326D8D8000808000808000 + 808000808000808000809E9E9EB8B8B8E0E0E0E6E6E6D5D5D5B8B8B8A8A8A89D + 9D9D7070708000808000808000808000808000800000800080739CB53BB8E67E + E4FEA1EBF66FD7F21FB7EE01A7E8039CDA346F8F800080800080800080800080 + 8000808000809E9E9EB8B8B8E0E0E0E6E6E6D3D3D3B6B6B6A8A8A89D9D9D7272 + 72800080800080800080800080800080000080008073A5BD3BB8E67EE4FEA0EA + F56ED6F21FB7EE01A7E8039CDA31709280008080008080008080008080008080 + 0080A6A6A6B8B8B8E0E0E0E5E5E5D2D2D2B6B6B6A8A8A89D9D9D737373800080 + 800080800080800080800080000080008073A5BD58C9E78CECFFA0EAF5A6EDF8 + 94E7F871D9F63CBDE9437C97800080800080800080800080800080800080A6A6 + A6C5C5C5E7E7E7E5E5E5E8E8E8E2E2E2D6D6D6BCBCBC7D7D7D80008080008080 + 008080008080008000008000806691A2A0DFEAC5F9FDC5F9FDC5F9FDC5F9FDC5 + F9FDA0DFEA6691A2800080800080800080800080800080800080919191DBDBDB + F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4DBDBDB9191918000808000808000808000 + 808000800000800080B8D1DB84AFBF6FA2B46B9BAE6C9DAF6B9BAE6FA2B484AF + BFB8D1DB800080800080800080800080800080800080D1D1D1AFAFAFA1A1A19B + 9B9B9D9D9D9B9B9BA1A1A1AFAFAFD1D1D1800080800080800080800080800080 + 0000800080800080800080800080800080800080800080800080800080800080 + 8000808000808000808000808000808000808000808000808000808000808000 + 808000808000808000808000808000808000808000808000808000800000} + NumGlyphs = 2 + ParentFont = False + Transparent = False + OnClick = sbDisconnectClick + end + object btCreate: TSpeedButton + Left = 203 + Top = 1 + Width = 85 + Height = 22 + Hint = 'Create database objects' + Caption = 'Create' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [fsBold] + Glyph.Data = { + 36060000424D3606000000000000360000002800000020000000100000000100 + 1800000000000006000000000000000000000000000000000000800080800080 + AC9584785E4B785E4B785E4B785E4B785E4B785E4B785E4B785E4B785E4B785E + 4B785E4B785E4B8000808000808000809292925B5B5B5B5B5B5B5B5B5B5B5B5B + 5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B800080800080800080 + AC9584FEFCFCFAEEE8F8E9E2F7E5DCF5E0D6F4DCD0F3D7C9F2D2C4F1CFBFEFCB + B9EEC8B5785E4B800080800080800080929292FCFCFCEDEDEDE8E8E8E4E4E4DF + DFDFDBDBDBD5D5D5D1D1D1CDCDCDC9C9C9C6C6C65B5B5B800080800080800080 + AC9584FFFFFFFEFDFBFDF9F7FCF5F2FAF1ECF9EBE5F7E6DEF6E1D7F4DBCFF3D6 + C9F0CBB9785E4B800080800080800080929292FFFFFFFCFCFCF8F8F8F4F4F4F0 + F0F0EAEAEAE5E5E5E0E0E0DADADAD5D5D5C9C9C95B5B5B800080800080800080 + AD9786FFFFFFFFFFFFFEFDFBFEF9F7FCF5F29B9491020202F8E6DEF6E1D7F4DB + CFF0CEBD785E4B800080800080800080949494FFFFFFFFFFFFFCFCFCF8F8F8F4 + F4F4939393020202E5E5E5E0E0E0DADADACCCCCC5B5B5B800080800080800080 + AF9A89A8A6A3020202868381D8D6D6020202020202D6CCC8F9EBE50202020202 + 02A38D82785E4B800080800080800080979797A5A5A5020202828282D6D6D602 + 0202020202CBCBCBEAEAEA0202020202028C8C8C5B5B5B800080800080800080 + B29C8CD9D9D9FFFFFF020202020202FFFDFBD7D5D2020202D6CCC9020202F8E6 + DEF2D5C7785E4B800080800080800080999999D9D9D9FFFFFF020202020202FC + FCFCD4D4D4020202CCCCCC020202E5E5E5D3D3D35B5B5B800080800080800080 + B59F8FFFFFFF020202FFFFFF020202FFFFFFFEFCFC020202D6D0CE020202FAEC + E5F4D9CD785E4B8000808000808000809C9C9CFFFFFF020202FFFFFF020202FF + FFFFFCFCFC020202D0D0D0020202EBEBEBD8D8D85B5B5B800080800080800080 + B9A393020202D9D9D9FFFFFF020202D9D9D9FFFFFF020202D7D4D2020202FBF0 + EBF5DDD1785E4B800080800080800080A0A0A0020202D9D9D9FFFFFF020202D9 + D9D9FFFFFF020202D3D3D3020202EFEFEFDCDCDC5B5B5B800080800080800080 + BBA697D9D9D9020202020202D9D9D9020202020202B9B9B9FFFCFC020202FCF5 + F1F6E2D8785E4B800080800080800080A3A3A3D9D9D9020202020202D9D9D902 + 0202020202B9B9B9FCFCFC020202F4F4F4E1E1E15B5B5B8000808000802AAFDA + 44CBF06BE5FF3BBEE599D8DF91E1F681D0E9FFFFFFFFFFFFFFFFFFFEFCFBFDF9 + F7D9CBC0785E4B800080800080ADADADC7C7C7DFDFDFBBBBBBD3D3D3DEDEDECE + CECEFFFFFFFFFFFFFFFFFFFBFBFBF8F8F8C9C9C95B5B5B80008080008052DAFB + 32B7DF7FE9FD5FC6E693F0FF31B6DFA0E8F9FFFFFFFFFFFFFFFFFFFFFFFFFEFC + FCD9CBC0785E4B800080800080D4D4D4B4B4B4E3E3E3C4C4C4EAEAEAB3B3B3E5 + E5E5FFFFFFFFFFFFFFFFFFFFFFFFFCFCFCC9C9C95B5B5B8000808000807CEAFF + 93F1FFBFF8FFAFE8F4C7FBFF93F1FF9FF0FFFFFFFFFFFFFFFFFFFFFAF0EB785E + 4B785E4B785E4B800080800080E4E4E4EAEAEAF3F3F3E5E5E5F6F6F6EAEAEAEB + EBEBFFFFFFFFFFFFFFFFFFEFEFEF5B5B5B5B5B5B5B5B5B80008080008021AAD9 + 55BFE1AFE8F4F0FFFDB4EBF655BFE138BBE5FFFFFFFFFFFFFFFFFF967E6BF4DB + CED1BAAF785E4B800080800080A9A9A9BDBDBDE5E5E5FCFCFCE8E8E8BDBDBDB9 + B9B9FFFFFFFFFFFFFFFFFF7A7A7AD9D9D9B9B9B95B5B5B8000808000807CEAFF + 96F3FFC7FBFFADE5F3C3FBFF96F3FF8BD7E2FEFDFBFDFBF9FDF9F6967E6BD1BA + AFAC9584800080800080800080E4E4E4ECECECF6F6F6E3E3E3F6F6F6ECECECD1 + D1D1FCFCFCFAFAFAF8F8F87A7A7AB9B9B992929280008080008080008051D9FA + 33B8E08CF1FF5AC2E390F1FF30B6DF4BD2F4BBA696B9A293B69F8FB29C8BB099 + 88800080800080800080800080D3D3D3B5B5B5EAEAEAC0C0C0EAEAEAB3B3B3CD + CDCDA3A3A3A0A0A09C9C9C9999999696968000808000808000808000802AAFDA + 44CBF07CEAFF25AEDB72E8FF4CD4F52AAFDA8000808000808000808000808000 + 80800080800080800080800080ADADADC7C7C7E4E4E4ACACACE1E1E1CECECEAD + ADAD800080800080800080800080800080800080800080800080} + NumGlyphs = 2 + ParentFont = False + Transparent = False + OnClick = btScriptClick + end + object btDrop: TSpeedButton + Left = 289 + Top = 1 + Width = 85 + Height = 22 + Hint = 'Drop database objects' + Caption = 'Drop' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [fsBold] + Glyph.Data = { + 36060000424D3606000000000000360000002800000020000000100000000100 + 1800000000000006000000000000000000000000000000000000800080800080 + A37A77A37A77A37A77A37A77A37A77A37A77A37A77A37A77A37A77A37A77A37A + 77A37A779063608000808000808000807D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D + 7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D7D676767800080800080800080 + A67E78FFE8D2FFE8D2FFE8D1FFE6CEFFE3C5FFDEBDFFDDBAFFD8B2FFD6AEFFD2 + A5FFD2A3936662800080800080800080808080E3E3E3E3E3E3E3E3E3E1E1E1DD + DDDDD7D7D7D6D6D6D0D0D0CECECEC9C9C9C8C8C8696969800080800080800080 + AB817AFFE8D2FFE8D2FFE6CEFFE3C6FFE1C2FFDDBBFFDAB6FFD7B0FFD4A9FFD2 + A4FFD2A3966965800080800080800080838383E3E3E3E3E3E3E1E1E1DDDDDDDB + DBDBD6D6D6D3D3D3CFCFCFCBCBCBC9C9C9C8C8C86C6C6C800080800080800080 + B0837CFFECD9FFECD9FFE8D2FFE6CEFFE3C6FFE1C2FFDDBBFFD9B4FFD7B0FFD4 + A9FFD4A99A6C67800080800080800080858585E8E8E8E8E8E8E3E3E3E1E1E1DD + DDDDDBDBDBD6D6D6D2D2D2CFCFCFCBCBCBCBCBCB6F6F6F800080800080800080 + B6897FFFEEDDFFEEDDFFECD9DFD1D8FFE6CEFFE3C6FFE1C2EFD2BFFFD9B4FFD7 + B0FFD7B09E6F698000808000808000808A8A8AEAEAEAEAEAEAE8E8E8D4D4D4E1 + E1E1DDDDDDDBDBDBCFCFCFD2D2D2CFCFCFCFCFCF727272800080800080800080 + BC8E81FFF2E4FFF2E4CFCBE31342FD637AEEFFE6CE6378EA3356F2EFD2BFFFD9 + B4FFD9B4A2726B8000808000808000808F8F8FEFEFEFEFEFEFD2D2D27474749A + 9A9AE1E1E1979797808080CFCFCFD2D2D2D2D2D2757575800080800080800080 + C39581FFF4E8FFF4E8EFE6E63359F90336FF234DF90336FF3357F4EFD6C5FFDD + BBFFDDBBA5766D800080800080800080949494F1F1F1F1F1F1E6E6E68484846C + 6C6C7B7B7B6C6C6C828282D3D3D3D6D6D6D6D6D6787878800080800080800080 + CA9B84FFF7F0FFF7F0FFF4E8EFE6E61342FD0336FF1341FCEFDBD0FFE3C6FFE0 + C1FFE1C2A8796F800080800080800080999999F5F5F5F5F5F5F1F1F1E6E6E674 + 74746C6C6C747474D9D9D9DDDDDDDADADADBDBDB7B7B7B800080800080800080 + D2A187FFF9F4FFF9F4FFF7F0637EF60336FF0336FF0336FF637AEEFFE6CEFFE3 + C6FFE3C6AC7C718000808000808000809E9E9EF8F8F8F8F8F8F5F5F59F9F9F6C + 6C6C6C6C6C6C6C6C9A9A9AE1E1E1DDDDDDDDDDDD7D7D7D800080800080800080 + D9A88AFFFDFBFFFDFBBFC8F70336FF335AFBDFDAE73359F91342FDDFD1D8FFE6 + CEFFE6CEAE7E74800080800080800080A4A4A4FCFCFCFCFCFCD5D5D56C6C6C86 + 8686DEDEDE848484747474D4D4D4E1E1E1E1E1E1808080800080800080800080 + DFAE8CFFFFFFFFFFFFFFFDFBAFBBF7EFEBF0FFF4E8EFE6E6CFCBE3FFECD9FFC8 + C2FFB0B0B08075800080800080800080A9A9A9FFFFFFFFFFFFFCFCFCCBCBCBEC + ECECF1F1F1E6E6E6D2D2D2E8E8E8CCCCCCB8B8B8818181800080800080800080 + E5B38FFDFDFDFDFDFDFFFFFFFFFFFFFFFFFEFFFAF6FFF9F3FFF5EAF4DECEB281 + 76B28176B28176800080800080800080ADADADFCFCFCFCFCFCFFFFFFFFFFFFFE + FEFEF9F9F9F7F7F7F2F2F2DBDBDB838383838383838383800080800080800080 + EAB891FEFEFEFEFEFEFFFFFFFFFFFFFFFFFFFFFFFEFFFAF6FFF9F3F5E1D2B281 + 76EDA757D2AA95800080800080800080B1B1B1FEFEFEFEFEFEFFFFFFFFFFFFFF + FFFFFEFEFEF9F9F9F7F7F7DEDEDE838383969696A8A8A8800080800080800080 + EFBC92FFFFFFFFFFFFFCFCFCFAFAFAF7F7F7F5F5F5F2F1F1F0EDEAE9DAD0B281 + 76D9B198800080800080800080800080B5B5B5FFFFFFFFFFFFFBFBFBFAFAFAF7 + F7F7F5F5F5F1F1F1ECECECD8D8D8838383ADADAD800080800080800080800080 + F2BF94DCA987DCA987DCA987DCA987DCA987DCA987DCA987DCA987DCA987B281 + 76800080800080800080800080800080B7B7B7A4A4A4A4A4A4A4A4A4A4A4A4A4 + A4A4A4A4A4A4A4A4A4A4A4A4A4A4838383800080800080800080800080800080 + 8000808000808000808000808000808000808000808000808000808000808000 + 8080008080008080008080008080008080008080008080008080008080008080 + 0080800080800080800080800080800080800080800080800080} + NumGlyphs = 2 + ParentFont = False + Transparent = False + OnClick = btScriptClick + end + end + object cbDebug: TCheckBox + Left = 871 + Top = 8 + Width = 68 + Height = 13 + Hint = 'Set Debug property for connection and query components' + Caption = 'Debug' + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentColor = False + ParentFont = False + TabOrder = 1 + OnClick = cbDebugClick + end + object pnShowSource: TPanel + Left = 440 + Top = 1 + Width = 259 + Height = 24 + BevelOuter = bvNone + Color = 9790720 + TabOrder = 2 + object sbDemo: TSpeedButton + Left = 1 + Top = 1 + Width = 85 + Height = 22 + Hint = 'Show demo' + GroupIndex = 1 + Down = True + Caption = 'Demo' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [fsBold] + ParentFont = False + Transparent = False + OnClick = sbDemoClick + end + object sbSource: TSpeedButton + Left = 87 + Top = 1 + Width = 85 + Height = 22 + Hint = 'Show demo source code' + GroupIndex = 1 + Caption = 'Demo source' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [fsBold] + ParentFont = False + Transparent = False + OnClick = sbSourceClick + end + object sbFormText: TSpeedButton + Left = 173 + Top = 1 + Width = 85 + Height = 22 + Hint = 'Show demo form as text' + GroupIndex = 1 + Caption = 'Form as text' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [fsBold] + ParentFont = False + Transparent = False + OnClick = sbFormTextClick + end + end + object pnOpenDemoDir: TPanel + Left = 720 + Top = 1 + Width = 138 + Height = 24 + BevelOuter = bvNone + Color = 9790720 + TabOrder = 3 + object sbOpenDemoDir: TSpeedButton + Left = 1 + Top = 1 + Width = 136 + Height = 22 + Hint = 'Open folder containing the demo source files' + Caption = 'Open demo folder' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + Glyph.Data = { + 36030000424D3603000000000000360000002800000010000000100000000100 + 1800000000000003000000000000000000000000000000000000FFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFF728890628190627A81527281526272425A62424A5232 + 3A42223232222232121A22121212121222FFFFFFFFFFFFFFFFFF72889090A0B0 + 72B0D00290D00290D00290D00290C01288C01281B01281B0227AA0227290224A + 62FFFFFFFFFFFFFFFFFF81889081C0D090A8B081E0FF62D0FF52C8FF52C8FF42 + C0F032B0F032A8F022A0E01290D0226A815B6369FFFFFFFFFFFF8190A081D0F0 + 90A8B090C0D072D8FF62D0FF62D0FF52C8FF52C0FF42B8F032B0F032A8F01288 + D0224A62FFFFFFFFFFFF8190A081D8F081C8E090A8B081E0FF72D0FF62D8FF62 + D0FF62D0FF52C8FF42C0F042B8F032B0F0226A816C8B9AFFFFFF8198A090E0F0 + 90E0FF90A8B090B8C072D8FF62D8FF62D8FF62D8FF62D0FF52D0FF52C8FF42B8 + F032A0E04B6979FFFFFF8198A090E0F0A0E8FF81C8E090A8B081E0FF81E0FF81 + E0FF81E0FF81E0FF81E0FF81E0FF72D8FF72D8FF52A8D087929D90A0A0A0E8F0 + A0E8FFA0E8FF90B0C090B0C090A8B090A8B081A0B081A0B08198A08198A08190 + A08190A081889072889090A0B0A0E8F0A0F0FFA0E8FFA0E8FF81D8FF62D8FF62 + D8FF62D8FF62D8FF62D8FF62D8FF728890FFFFFFFFFFFFFFFFFF90A0B0A0F0F0 + B0F0F0A0F0FFA0E8FFA0E8FF72D8FF90A0A08198A08198A08190A08190907288 + 90FFFFFFFFFFFFFFFFFF90A8B0A0D0E0B0F0F0B0F0F0A0F0FFA0E8FF90A0B0B3 + C9CEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF906A52906A52906A52CDD6DA90A8B0 + 90A8B090A8B090A8B090A8B0B6C5CAFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFD2C7C6906A52906A52FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFF907A62C8BAB3FFFFFFFFFFFFA09081D2CDC7907A62FFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD8D8D3A09081A08881B098 + 81C5BEB7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF} + ParentFont = False + Transparent = False + OnClick = sbOpenDemoDirClick + end + end + end + object ImageList1: TImageList + Height = 17 + Left = 616 + Top = 8 + end + object BackHistoryPopup: TPopupMenu + OnPopup = BackHistoryPopupPopup + Left = 8 + Top = 133 + end + object ForwardHistoryPopup: TPopupMenu + OnPopup = ForwardHistoryPopupPopup + Left = 40 + Top = 133 + end + object ilButtons: TImageList + Left = 88 + Top = 141 + Bitmap = { + 494C010102000400040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000001000000001002000000000000010 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000C0D0 + C9007DAC86002C7D31000269090002640700005E0400206323006D967200C3CF + CB0000000000000000000000000000000000000000000000000000000000C0D0 + C9007DAC86002C7D31000269090002640700005E0400206323006D967200C3CF + CB00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000AEC7B600328C + 36000C98220011B62F000DB4250009B21C0006B0160001AE0B00009107001065 + 1400B4C6BB000000000000000000000000000000000000000000AEC7B600328C + 36000C98220011B62F000DB4250009B21C0006B0160001AE0B00009107001065 + 1400B4C6BB000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000B0C9B800178C23001CB6 + 45001BBA440017B83A0012B630003CC352001AB72D0008B21B0004AF110000AD + 090000670500B6C7BD00000000000000000000000000B0C9B800178C23001CB6 + 45001BBA440017B83A005DCD720079D588000BB3210008B21B0004AF110000AD + 090000670500B6C7BD0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000CCDDD30043A4480023B7530024BE + 580021BD51001CBA45006FD38800FFFFFF00B5E8BE000EB426000AB21D0007B1 + 180002AE0D0010691400C9D5D00000000000CCDDD30043A4480023B7530024BE + 580021BD51001CBA4500D4F2DC00FFFFFF00A6E4B1000EB426000AB21D0007B1 + 180002AE0D0010691400C9D5D000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000009CCEA10017A437002EC26B002CC1 + 660025BF5A0076D69500FFFFFF00FFFFFF009AE0AB0013B6310011B62E000BB3 + 210009B21C00078E120086A88B00000000009CCEA10017A437002EC26B002CC1 + 660025BF5A001CBB470075D69400FFFFFF00FFFFFF00A6E4B10011B62E000BB3 + 210009B21C00078E120086A88B00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000040B1410028BB5E002EC26B002EC2 + 6B007CD9A100FFFFFF00FFFFFF00ACE6BF001CBB47001ABA430015B8380012B6 + 30000FB52A000AB21D00227A27000000000040B1410028BB5E002EC26B002EC2 + 6B001CBB47001CBB470025BE590076D69700FFFFFF00FFFFFF00A6E4B10014B7 + 34000FB52A000AB21D00227A2700000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000040B141002EC26B002EC26B007CD9 + A300FFFFFF00FFFFFF00F1FBF50092DFAC0092DFAC008EDDA3008DDDA2008BDC + 9D0014B7340011B62F00057710000000000040B141002EC26B0062D19000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00A8E5 + B60014B7340011B62F0005771000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000040B841002EC26B0048CA7E00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF001BBA440017B83A00097E14000000000040B841002EC26B0062D19000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00D5F3 + DE001BBA440017B83A00097E1400000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000040BB410033C36E002EC26B007CD9 + A300FFFFFF00FFFFFF00FFFFFF00A4E4BE0097E1B50097E1B50095E0B10092DF + AC0021BD51001CBA4500077F13000000000040BB410033C36E002EC26B002EC2 + 6B002EC26B002EC26B002EC26B0089DDAC00FFFFFF00FFFFFF00D7F3E2002EC2 + 6B0021BD51001CBA4500077F1300000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000040BB410044C665003FC776002EC2 + 6B007CD9A300FFFFFF00FFFFFF00D8F4E3003BC674002EC26B002EC26B002CC1 + 660025BF5A0023BE5700238B2C000000000040BB410044C665003FC776002EC2 + 6B002EC26B002EC26B0055CD8700F2FBF600FFFFFF00D8F4E3002EC26B002CC1 + 660025BF5A0023BE5700238B2C00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000A2D7A50031BE3C0072D5950052CC + 820035C470007CD9A300FFFFFF00FFFFFF00A4E4BE002EC26B002EC26B002EC2 + 6B002DC26A0033963B009EC8A40000000000A2D7A50031BE3C0072D5950052CC + 820035C470002EC26B00BEECD100FFFFFF00D8F4E3002EC26B002EC26B002EC2 + 6B002DC26A001AA73E009EC8A400000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000D7E7DC0040C2400075D6830082DA + A00066D28E0044C879007FDAA400F2FBF60089DDAC002EC26B002EC26B002EC2 + 6B002BBF640023962900C3E2C70000000000D7E7DC0040BB410075D6830082DA + A00066D28E002EC26B002EC26B0097E1B5002EC26B002EC26B002EC26B002EC2 + 6B002BBF640023962900C3E2C700000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000C9E3CD0040C2400077D7 + 800098E0AD0076D798005ACE86003AC573002EC26B002EC26B002EC26B0028BD + 5E00189E2600C9E4CD00000000000000000000000000C9E3CD0040BB410077D7 + 800098E0AD0076D798005ACE86003AC573002EC26B002EC26B002EC26B0028BD + 5E00189E2600C9E4CD0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000CAE4CE0040C2 + 400047CB490084DA91008CDCA6006AD391004ECB7F002DBF610017B1360043B5 + 4700CAE5CE000000000000000000000000000000000000000000CAE4CE0040BB + 410047CB490084DA91008CDCA6006AD391004ECB7F002DBF610017B1360043B5 + 4700CAE5CE000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000DBE9 + DF009AD99D0040C2400040C2400040C2400040C2400040C240009AD99D00DBEA + DE0000000000000000000000000000000000000000000000000000000000DBE9 + DF009AD99D0040C2400040C2400040C2400040C2400040C240009AD99D00DBEA + DE00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000100000000100010000000000800000000000000000000000 + 000000000000000000000000FFFFFF00FFFFFFFF00000000E00FE00F00000000 + C007C00700000000800380030000000000010001000000000001000100000000 + 0001000100000000000100010000000000010001000000000001000100000000 + 0001000100000000000100010000000000010001000000008003800300000000 + C007C00700000000E00FE00F0000000000000000000000000000000000000000 + 000000000000} + end + object ilDisabledButtons: TImageList + Left = 120 + Top = 141 + Bitmap = { + 494C010102000400040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000001000000001002000000000000010 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000CCCC + CC009B9B9B005D5D5D00404040003D3D3D00383838004848480086868600CCCC + CC0000000000000000000000000000000000000000000000000000000000CCCC + CC009B9B9B005D5D5D00404040003D3D3D00383838004848480086868600CCCC + CC00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000BFBFBF006868 + 6800656565007B7B7B0076767600727272006F6F6F006A6A6A00575757004343 + 4300C0C0C0000000000000000000000000000000000000000000BFBFBF006868 + 6800656565007B7B7B0076767600727272006F6F6F006A6A6A00575757004343 + 4300C0C0C0000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000C1C1C1005F5F5F008383 + 830085858500808080007B7B7B00929292007C7C7C00727272006C6C6C006868 + 68003E3E3E00C2C2C200000000000000000000000000C1C1C1005F5F5F008383 + 83008585850080808000A5A5A500B3B3B30074747400727272006C6C6C006868 + 68003E3E3E00C2C2C20000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000D8D8D8007D7D7D00888888008E8E + 8E008B8B8B0085858500B1B1B100FFFFFF00D5D5D50077777700727272007070 + 70006A6A6A0045454500D2D2D20000000000D8D8D8007D7D7D00888888008E8E + 8E008B8B8B0085858500E8E8E800FFFFFF00CDCDCD0077777700727272007070 + 70006A6A6A0045454500D2D2D200000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000BBBBBB0073737300979797009595 + 95008F8F8F00B7B7B700FFFFFF00FFFFFF00C8C8C8007C7C7C007B7B7B007474 + 740072727200595959009B9B9B0000000000BBBBBB0073737300979797009595 + 95008F8F8F0086868600B7B7B700FFFFFF00FFFFFF00CDCDCD007B7B7B007474 + 740072727200595959009B9B9B00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000828282008E8E8E00979797009797 + 9700BDBDBD00FFFFFF00FFFFFF00D3D3D30086868600848484007F7F7F007B7B + 7B0079797900727272005757570000000000828282008E8E8E00979797009797 + 970086868600868686008E8E8E00B8B8B800FFFFFF00FFFFFF00CDCDCD007D7D + 7D00797979007272720057575700000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000828282009797970097979700BEBE + BE00FFFFFF00FFFFFF00F8F8F800C7C7C700C7C7C700C2C2C200C2C2C200C0C0 + C0007D7D7D007B7B7B004B4B4B00000000008282820097979700B1B1B100FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00D0D0 + D0007D7D7D007B7B7B004B4B4B00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008787870097979700A4A4A400FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00858585008080800051515100000000008787870097979700B1B1B100FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00E9E9 + E900858585008080800051515100000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000888888009999990097979700BEBE + BE00FFFFFF00FFFFFF00FFFFFF00D1D1D100CBCBCB00CBCBCB00C9C9C900C7C7 + C7008B8B8B008585850051515100000000008888880099999900979797009797 + 9700979797009797970097979700C5C5C500FFFFFF00FFFFFF00EAEAEA009797 + 97008B8B8B008585850051515100000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000888888009A9A9A009F9F9F009797 + 9700BEBEBE00FFFFFF00FFFFFF00EBEBEB009E9E9E0097979700979797009595 + 95008F8F8F008E8E8E006363630000000000888888009A9A9A009F9F9F009797 + 97009797970097979700AAAAAA00F8F8F800FFFFFF00EBEBEB00979797009595 + 95008F8F8F008E8E8E0063636300000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000C2C2C20087878700B6B6B600A8A8 + A8009B9B9B00BEBEBE00FFFFFF00FFFFFF00D1D1D10097979700979797009797 + 9700979797006F6F6F00B8B8B80000000000C2C2C20087878700B6B6B600A8A8 + A8009B9B9B0097979700DEDEDE00FFFFFF00EBEBEB0097979700979797009797 + 97009797970077777700B8B8B800000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000E1E1E1008C8C8C00B2B2B200BEBE + BE00B1B1B100A1A1A100BFBFBF00F8F8F800C5C5C50097979700979797009797 + 97009393930068686800D6D6D60000000000E1E1E10088888800B2B2B200BEBE + BE00B1B1B1009797970097979700CBCBCB009797970097979700979797009797 + 97009393930068686800D6D6D600000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000D9D9D9008C8C8C00B2B2 + B200C8C8C800B9B9B900ABABAB009D9D9D009797970097979700979797009090 + 90006B6B6B00DADADA00000000000000000000000000D9D9D90088888800B2B2 + B200C8C8C800B9B9B900ABABAB009D9D9D009797970097979700979797009090 + 90006B6B6B00DADADA0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000DADADA008C8C + 8C0095959500BABABA00C3C3C300B3B3B300A6A6A600929292007B7B7B008787 + 8700DBDBDB000000000000000000000000000000000000000000DADADA008888 + 880095959500BABABA00C3C3C300B3B3B300A6A6A600929292007B7B7B008787 + 8700DBDBDB000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000E4E4 + E400C0C0C0008C8C8C008C8C8C008C8C8C008C8C8C008C8C8C00C0C0C000E4E4 + E40000000000000000000000000000000000000000000000000000000000E4E4 + E400C0C0C0008C8C8C008C8C8C008C8C8C008C8C8C008C8C8C00C0C0C000E4E4 + E400000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000100000000100010000000000800000000000000000000000 + 000000000000000000000000FFFFFF00FFFFFFFF00000000E00FE00F00000000 + C007C00700000000800380030000000000010001000000000001000100000000 + 0001000100000000000100010000000000010001000000000001000100000000 + 0001000100000000000100010000000000010001000000008003800300000000 + C007C00700000000E00FE00F0000000000000000000000000000000000000000 + 000000000000} + end +end diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Base/DemoForm.pas b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Base/DemoForm.pas new file mode 100644 index 0000000..95bbae7 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Base/DemoForm.pas @@ -0,0 +1,667 @@ +{$I DacDemo.inc} + +unit DemoForm; + +interface + +uses +{$IFNDEF WIN32} + Types, +{$ENDIF} + SysUtils, Classes, DB, +{$IFDEF LINUX} + QControls, QStdCtrls, QComCtrls, QGraphics, QMenus, QTypes, QImgList, QForms, + QButtons, QExtCtrls, Qt, QDialogs, +{$ELSE} + Windows, Forms, Messages, Controls, StdCtrls, + Graphics, ImgList, ToolWin, + ComCtrls, Dialogs, ExtCtrls, Tabs, Menus, DBCtrls, Buttons, ShellAPI, +{$IFNDEF VER130} + Variants, +{$ENDIF} +{$ENDIF} +{$IFDEF CLR} + System.ComponentModel, +{$ENDIF} + DBAccess, + DAScript, + DemoBase, + DemoFrame, + CategoryFrame + {$IFDEF XPMAN}, UxTheme{$ENDIF} + {$IFDEF USE_SYNEDIT}, SynMemo, SynEdit, SynEditHighlighter, SynHighlighterPas{$ENDIF} + ; +const + MAX_HISTORY_SIZE = 6; + +type + TDemoForm = class(TForm) + StatusBar: TStatusBar; + ImageList1: TImageList; + PanelUnderTree: TPanel; + TreeView: TTreeView; + MainPanel: TPanel; + Shape1: TShape; + TVSplitter: TSplitter; + pnTopLabel: TPanel; + lbTitle: TLabel; + lbAbout: TLabel; + Panel2: TPanel; + Panel1: TPanel; + sbConnect: TSpeedButton; + sbDisconnect: TSpeedButton; + btCreate: TSpeedButton; + btDrop: TSpeedButton; + cbDebug: TCheckBox; + pnSource: TPanel; + pnDemo: TPanel; + sbDemo: TSpeedButton; + pnShowSource: TPanel; + ToolBar: TToolBar; + tbBrowseBack: TToolButton; + tbBrowseForward: TToolButton; + BackHistoryPopup: TPopupMenu; + ForwardHistoryPopup: TPopupMenu; + ilButtons: TImageList; + ilDisabledButtons: TImageList; + sbSource: TSpeedButton; + sbFormText: TSpeedButton; + pnOpenDemoDir: TPanel; + sbOpenDemoDir: TSpeedButton; + + procedure FormCreate(Sender: TObject); virtual; + procedure TreeViewChange(Sender: TObject; Node: TTreeNode); + procedure TreeViewKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); + procedure TreeViewClick(Sender: TObject); + procedure TreeViewMouseMove(Sender: TObject; Shift: TShiftState; X, + Y: Integer); + procedure TVSplitterMoved(Sender: TObject); + procedure TVSplitterCanResize(Sender: TObject; var NewSize: Integer; + var Accept: Boolean); + procedure lbAboutClick(Sender: TObject); virtual; + procedure lbAboutMouseMove(Sender: TObject; Shift: TShiftState; X, + Y: Integer); + procedure lbTitleMouseMove(Sender: TObject; Shift: TShiftState; X, + Y: Integer); + procedure cbDebugClick(Sender: TObject); + procedure sbOpenDemoDirClick(Sender: TObject); + procedure sbConnectClick(Sender: TObject); + procedure sbDisconnectClick(Sender: TObject); + procedure FormDestroy(Sender: TObject); + procedure HistoryItemClick(Sender: TObject); + procedure sbDemoClick(Sender: TObject); + procedure FormResize(Sender: TObject); + procedure BackHistoryPopupPopup(Sender: TObject); + procedure ForwardHistoryPopupPopup(Sender: TObject); + procedure tbBrowseBackClick(Sender: TObject); + procedure tbBrowseForwardClick(Sender: TObject); + procedure btScriptClick(Sender: TObject); + procedure OnScriptError(Sender: TObject; E: Exception; SQL: String; + var Action: TErrorAction); + procedure sbSourceClick(Sender: TObject); + procedure sbFormTextClick(Sender: TObject); + protected + Demos: TDemos; + ActiveNode: TTreeNode; + //History + History: Array of integer; //Absolute indexes in TreeView + HistoryIndex: integer; //Current History index + HistoryEnd: integer; + IgnoreScriptErrors: boolean; + DropScriptActive: boolean; + DemoSourceLoaded, FormSourceLoaded: boolean; + + //Product customization + function GetConnection: TCustomDAConnection; virtual; abstract; //This function should return DAC product specific connection (i.e. OraSession, MyConnection) + function ApplicationTitle: string; virtual; abstract; //This function should return DAC product specific title + function ProductName: string; virtual; abstract; ////This function should return product name + procedure RegisterDemos; virtual; abstract; //This procedure should regiter DAC product specific demos + //XP manifest + {$IFDEF XPMAN} + procedure ReplaceFlatStyle(Control: TWinControl; Flat: boolean); + {$ENDIF} + //Demo selection + procedure InitializeDemoFrame(Frame: TDemoFrame; DemoType: TDemoType); virtual; + procedure UpdateDemo; + procedure ShowDemo; + procedure ShowDemoSource; + procedure ShowFormSource; + {$IFNDEF WIN32} + procedure OnNavigate(DemoDescription: string); + {$ELSE} + procedure OnNavigate(Index: integer); + {$ENDIF} + //History + procedure SelectDemo; + procedure NavigateHistory(Offset: integer); + procedure GetBackHistory(BackList: TStrings); + procedure GetForwardHistory(ForwardList: TStrings); + procedure DisableBrowse(Back, Forward: boolean); + procedure FillHistoryPopup(BackHistory: boolean); + //Connection + procedure AfterConnect(Sender: TObject); + procedure AfterDisconnect(Sender: TObject); + public +{$IFDEF USE_SYNEDIT} + SourceBrowser: TSynMemo; +{$ELSE} + SourceBrowser: TMemo; +{$ENDIF} + function GetIsXPMan: boolean; + function ProductColor: TColor; virtual; abstract; //This function should return DAC product specific color + procedure ExecCreateScript; virtual; abstract; + procedure ExecDropScript; virtual; abstract; + end; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} +{$IFDEF LINUX} +{$R *.xfm} +{$ENDIF} + +{$IFDEF XPMAN} + {$R WindowsXP.res} +{$ENDIF} + +procedure TDemoForm.FormCreate(Sender: TObject); +begin + SetLength(History, MAX_HISTORY_SIZE); + HistoryIndex := -1; + Demos := TDemos.Create(TreeView.Items); + RegisterDemos; +{$IFDEF XPMAN} + if GetIsXPMan then begin + ReplaceFlatStyle(Self, False); + pnTopLabel.Color := ProductColor; + end; +{$ENDIF} + +{$IFDEF USE_SYNEDIT} + SourceBrowser := TSynMemo.Create(pnSource); + + SourceBrowser.Highlighter := TSynPasSyn.Create(SourceBrowser); + SourceBrowser.Options := [eoAltSetsColumnMode, eoAutoIndent, eoAutoSizeMaxScrollWidth, eoDisableScrollArrows, eoDragDropEditing, eoDropFiles, eoEnhanceEndKey, eoGroupUndo, eoHideShowScrollbars, eoKeepCaretX, eoShowScrollHint, eoSmartTabDelete, eoSmartTabs, eoTabIndent, eoTabsToSpaces]; + with SourceBrowser.Gutter do begin + Visible := True; + AutoSize := True; + DigitCount := 3; + LeftOffset := 0; + RightOffset := 0; + ShowLineNumbers := True; + Width := 1; + end; +{$ELSE} + SourceBrowser := TMemo.Create(pnSource); + SourceBrowser.ScrollBars := ssVertical; + SourceBrowser.Font.Name := 'Courier New'; + SourceBrowser.Font.Size := 10; +{$ENDIF} + with SourceBrowser do begin + Parent := pnSource; + Align := alClient; + ReadOnly := True; + end; + Resize; + TreeView.Items[0].Expand(True); + TreeView.Items[0].Selected := True; + with GetConnection do begin + AfterConnect := Self.AfterConnect; + AfterDisconnect := Self.AfterDisconnect; + end; + SelectDemo; +end; + +procedure TDemoForm.FormDestroy(Sender: TObject); +begin + with GetConnection do begin + AfterConnect := nil; + AfterDisconnect := nil; + end; + SetLength(History, 0); + Demos.Free; +end; + +//TreeView routines +procedure TDemoForm.TreeViewChange(Sender: TObject; Node: TTreeNode); +begin + if (TreeView.Selected.Data <> nil) then + StatusBar.Panels[0].Text := TDemo(TreeView.Selected.Data).Hint + else + StatusBar.Panels[0].Text := TreeView.Selected.Text; + StatusBar.Repaint; +end; + +procedure TDemoForm.TreeViewKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); +begin + if Key = {$IFDEF LINUX}4100{$ELSE}13{$ENDIF} then + SelectDemo; +end; + +procedure TDemoForm.TreeViewClick(Sender: TObject); +begin + SelectDemo; +end; + +//TreeView Hints +procedure TDemoForm.TreeViewMouseMove(Sender: TObject; + Shift: TShiftState; X, Y: Integer); +var + Node: TTreeNode; +begin + Node := TreeView.GetNodeAt(X, Y); + if (Node <> nil) and (Node.Data <> nil) then + TreeView.Hint := TDemo(Node.Data).Hint + else + TreeView.Hint := ''; +end; + +//Sizing constraints +procedure TDemoForm.TVSplitterMoved(Sender: TObject); +begin + if PanelUnderTree.ClientWidth = 0 then + PanelUnderTree.ClientWidth := 150; +end; + +procedure TDemoForm.TVSplitterCanResize(Sender: TObject; + var NewSize: Integer; var Accept: Boolean); +begin + Accept := (NewSize >= PanelUnderTree.Constraints.MinWidth) and + ((ClientWidth - MainPanel.Constraints.MinWidth - NewSize) > 0); +end; + +function TDemoForm.GetIsXPMan: boolean; +begin + Result := {$IFDEF XPMAN}UseThemes; {$ELSE} False;{$ENDIF} +end; + +{$IFDEF XPMAN} +procedure TDemoForm.ReplaceFlatStyle(Control: TWinControl; Flat: boolean); +var + i: integer; +begin + for i := 0 to Control.ControlCount - 1 do + if Control.Controls[i] is TSpeedButton then + TSpeedButton(Control.Controls[i]).Flat := Flat + else + if Control.Controls[i] is TDBNavigator then + TDBNavigator(Control.Controls[i]).Flat := Flat + else + if Control.Controls[i] is TWinControl then begin + if Control.Controls[i] is TPanel then begin + TPanel(Control.Controls[i]).ParentBackground := False; + TPanel(Control.Controls[i]).Color := clBtnFace; + end; + ReplaceFlatStyle(TWinControl(Control.Controls[i]), Flat); + end; +end; +{$ENDIF} + +//Demo Change +procedure TDemoForm.InitializeDemoFrame(Frame: TDemoFrame; DemoType: TDemoType); +begin + Frame.Connection := GetConnection; + Frame.SetDebug(cbDebug.Checked); + Frame.Parent := pnDemo; + if DemoType = dtCategory then //Attach browser event handlers + TCategoryFrame(Frame).OnNavigate := OnNavigate; +{$IFDEF XPMAN} + if GetIsXPMan then + ReplaceFlatStyle(Frame, False); +{$ENDIF} + Frame.Initialize; +end; + +procedure TDemoForm.UpdateDemo; +var + i: integer; +begin + for i := 1 to StatusBar.Panels.Count - 1 do + StatusBar.Panels[i].Text := ''; + ActiveNode := TreeView.Selected; + if (ActiveNode <> nil) then + with Demos.SelectDemo(ActiveNode.AbsoluteIndex) do begin + InitializeDemoFrame(Frame, DemoType); + DemoSourceLoaded := False; + FormSourceLoaded := False; + if DemoType = dtCategory then begin + pnShowSource.Visible := False; + pnOpenDemoDir.Visible := False; + ShowDemo; + end + else begin + pnShowSource.Visible := True; + {$IFNDEF LINUX} + pnOpenDemoDir.Visible := True; + {$ELSE} + pnOpenDemoDir.Visible := False; + {$ENDIF} + if sbDemo.Down then + ShowDemo + else + if sbSource.Down then + ShowDemoSource + else + ShowFormSource; + end; + Self.Caption := ApplicationTitle + ' - ' + Name; + Application.Title := ApplicationTitle; + end; + StatusBar.Repaint; +end; + +procedure TDemoForm.ShowDemo; +begin + pnSource.Visible := False; + pnDemo.Visible := True; +end; + +procedure TDemoForm.ShowDemoSource; +begin + if not DemoSourceLoaded then begin + Demos.SelectedDemo.LoadDemoCode(SourceBrowser.Lines); + DemoSourceLoaded := True; + FormSourceLoaded := False; + end; + pnSource.Visible := True; + pnDemo.Visible := False; +end; + +procedure TDemoForm.ShowFormSource; +begin + if not FormSourceLoaded then begin + Demos.SelectedDemo.LoadFormCode(SourceBrowser.Lines); + FormSourceLoaded := True; + DemoSourceLoaded := False; + end; + pnSource.Visible := True; + pnDemo.Visible := False; +end; + +//User control +procedure TDemoForm.sbOpenDemoDirClick(Sender: TObject); +begin + Demos.SelectedDemo.OpenDemoFolder; +end; + +procedure TDemoForm.cbDebugClick(Sender: TObject); +begin + Demos.SelectedDemo.Frame.SetDebug(cbDebug.Checked); +end; + +{$IFNDEF WIN32} +procedure TDemoForm.OnNavigate(DemoDescription: string); +var + Node: TTreeNode; + DemoName, CategoryName, FolderName: string; + ListBox: TListBox; + i: integer; +begin + Node := TreeView.Items.GetFirstNode; + DemoName := Trim(Copy(DemoDescription, 1, pos('-', DemoDescription) - 1)); + while Node <> nil do begin + if TDemo(Node.Data).Name = DemoName then begin + TreeView.Selected := Node; + SelectDemo; + break; + end; + Node := Node.GetNext; + end; + // Demo was not found in the tree. This is supplementary demo. + + if (Demos.SelectedDemo.DemoType = dtCategory) and (DemoName <> '') then begin + ListBox := TCategoryFrame(Demos.SelectedDemo.Frame).DemosDescription; + for i := ListBox.ItemIndex downto 0 do + if (ListBox.Items[i] <> '') and (ListBox.Items[i][1] = ' ') then begin + CategoryName := Trim(ListBox.Items[i]); + Break; + end; + end; +{$IFNDEF LINUX} + FolderName := ExtractFilePath(ExtractFileDir(Application.ExeName)) + CategoryName + '\' + DemoName; + ShellExecute(0, 'open', FolderName, '', '.', SW_SHOW); +{$ENDIF} +end; + +{$ELSE} +procedure TDemoForm.OnNavigate(Index: integer); +begin + TreeView.Items[Index].Selected := True; + SelectDemo; +end; +{$ENDIF} + +procedure TDemoForm.lbAboutClick(Sender: TObject); +begin + lbAbout.Font.Color := $FFFFFF; + lbAbout.Cursor := crDefault; +end; + +//About highlite +procedure TDemoForm.lbAboutMouseMove(Sender: TObject; + Shift: TShiftState; X, Y: Integer); +begin + lbAbout.Font.Color := TColor($FF00001A); //clHotLight + lbAbout.Cursor := crHandPoint; +end; + +procedure TDemoForm.lbTitleMouseMove(Sender: TObject; + Shift: TShiftState; X, Y: Integer); +begin + lbAbout.Font.Color := $FFFFFF; + lbAbout.Cursor := crDefault; +end; + +procedure TDemoForm.sbConnectClick(Sender: TObject); +begin + GetConnection.Connect; +end; + +procedure TDemoForm.sbDisconnectClick(Sender: TObject); +begin + GetConnection.Disconnect; +end; + +procedure TDemoForm.AfterConnect(Sender: TObject); +begin + sbDisconnect.Enabled := True; + sbConnect.Enabled := False; +end; + +procedure TDemoForm.AfterDisconnect(Sender: TObject); +begin + sbDisconnect.Enabled := False; + sbConnect.Enabled := True; +end; + +//History +procedure TDemoForm.SelectDemo; +var + i: integer; +begin + if TreeView.Selected = ActiveNode then //Same demo selected + Exit; + UpdateDemo; + if HistoryIndex = (MAX_HISTORY_SIZE - 1) then + for i := 0 to MAX_HISTORY_SIZE - 2 do + History[i] := History[i + 1] + else + Inc(HistoryIndex); + History[HistoryIndex] := ActiveNode.AbsoluteIndex; + HistoryEnd := HistoryIndex; + DisableBrowse(HistoryIndex = 0, True); +end; + +procedure TDemoForm.NavigateHistory(Offset: integer); +begin + if ((HistoryIndex + Offset) < 0) or ((HistoryIndex + Offset) >= MAX_HISTORY_SIZE) then + raise Exception.Create('Wrong history index'); + HistoryIndex := HistoryIndex + Offset; + TreeView.Items[Demos.GetDemoIndex(History[HistoryIndex])].Selected := True; + DisableBrowse(HistoryIndex = 0, HistoryIndex = HistoryEnd); + UpdateDemo; +end; + +procedure TDemoForm.GetBackHistory(BackList: TStrings); +var + i: integer; +begin + BackList.Clear; + for i := HistoryIndex - 1 downto 0 do + BackList.Add(Demos[History[i]].Name); +end; + +procedure TDemoForm.GetForwardHistory(ForwardList: TStrings); +var + i: integer; +begin + ForwardList.Clear; + for i := HistoryIndex + 1 to HistoryEnd do + ForwardList.Add(Demos[History[i]].Name); +end; + +procedure TDemoForm.DisableBrowse(Back, Forward: boolean); +begin + tbBrowseBack.Enabled := not Back; + tbBrowseForward.Enabled := not Forward; +end; + +procedure TDemoForm.FillHistoryPopup(BackHistory: boolean); +var + NewItem: TMenuItem; + List: TStrings; + i: integer; + HistoryPopup: TPopupMenu; +begin + if BackHistory then + HistoryPopup := BackHistoryPopup + else + HistoryPopup := ForwardHistoryPopup; + HistoryPopup.Items.Clear; + List := TStringList.Create; + if BackHistory then + GetBackHistory(List) + else + GetForwardHistory(List); + for i := 1 to List.Count do begin + NewItem := TMenuItem.Create(HistoryPopup); + HistoryPopup.Items.Add(NewItem); + NewItem.Caption := List[i - 1]; + if BackHistory then + NewItem.Tag := -i + else + NewItem.Tag := i; + NewItem.OnClick := HistoryItemClick; + end; + List.Free; +end; + +procedure TDemoForm.HistoryItemClick(Sender: TObject); +begin + if Sender is TMenuItem then + NavigateHistory(TMenuItem(Sender).Tag); +end; + +procedure TDemoForm.BackHistoryPopupPopup(Sender: TObject); +begin + FillHistoryPopup(True); +end; + +procedure TDemoForm.ForwardHistoryPopupPopup(Sender: TObject); +begin + FillHistoryPopup(False); +end; + +procedure TDemoForm.tbBrowseBackClick(Sender: TObject); +begin + NavigateHistory(-1); +end; + +procedure TDemoForm.tbBrowseForwardClick(Sender: TObject); +begin + NavigateHistory(1); +end; + +procedure TDemoForm.sbDemoClick(Sender: TObject); +begin + ShowDemo; +end; + +procedure TDemoForm.sbSourceClick(Sender: TObject); +begin + ShowDemoSource; +end; + +procedure TDemoForm.sbFormTextClick(Sender: TObject); +begin + ShowFormSource; +end; + +procedure TDemoForm.FormResize(Sender: TObject); +begin + lbAbout.Left := lbAbout.Parent.ClientWidth - 100; + cbDebug.Left := cbDebug.Parent.ClientWidth - 100; + pnOpenDemoDir.Left := cbDebug.Left - (pnOpenDemoDir.Width + 15); + pnShowSource.Left := pnOpenDemoDir.Left - (pnShowSource.Width + 15); +end; + +procedure TDemoForm.OnScriptError(Sender: TObject; E: Exception; + SQL: String; var Action: TErrorAction); +var + OperationStr, + ScriptFileStr, + MessageStr: string; +begin + if DropScriptActive then begin + OperationStr := 'drop'; + ScriptFileStr := 'UninstallDemoObjects.sql'; + end + else begin + OperationStr := 'create'; + ScriptFileStr := 'InstallDemoObjects.sql'; + end; + MessageStr := Format('An error has been occured: %s' + + #$d#$d'You can manually %s objects required for demo by using the ' + + 'following file: %%%s%%\Demos\%s' + + #$d'%%%s%% is the %s installation path on your computer.' + #13#10 + 'Ignore this exception?', + [E.Message, OperationStr, ProductName, ScriptFileStr, ProductName, ProductName]); + Action := eaContinue; + if not IgnoreScriptErrors then + case MessageDlg(MessageStr, mtError, [mbYes, mbNo{$IFNDEF LINUX}, mbYesToAll{$ENDIF}], 0) of + mrNo: + Action := eaAbort; + {$IFNDEF LINUX} + mrYesToAll: + IgnoreScriptErrors := True; + {$ENDIF} + end; +end; + +procedure TDemoForm.btScriptClick(Sender: TObject); +var + s: string; +begin + DropScriptActive := Sender = btDrop; + if DropScriptActive then + s := 'removed from database' + else + s := 'created in database'; + if MessageDlg(Format('Objects required for the demo will be %s. Continue?', [s]), + mtConfirmation, [mbYes, mbNo], 0) = mrYes then begin + IgnoreScriptErrors := False; + GetConnection.Connect; + if Sender = btCreate then + ExecCreateScript + else + ExecDropScript; + end; +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Base/DemoFrame.nfm b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Base/DemoFrame.nfm new file mode 100644 index 0000000..08110ca --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Base/DemoFrame.nfm @@ -0,0 +1,7 @@ +object DemoFrame: TDemoFrame + Left = 0 + Top = 0 + Width = 308 + Height = 228 + TabOrder = 0 +end diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Base/DemoFrame.pas b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Base/DemoFrame.pas new file mode 100644 index 0000000..6636031 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Base/DemoFrame.pas @@ -0,0 +1,57 @@ +unit DemoFrame; + +interface + +uses + Classes, +{$IFDEF LINUX} + QControls, QStdCtrls, QGraphics, QForms, +{$ELSE} + Forms, Windows, Messages, SysUtils, StdCtrls, Graphics, Controls, Dialogs, + ComCtrls, Buttons, ExtCtrls, DBCtrls, +{$ENDIF} + DBAccess + {$IFNDEF VER130}, Variants{$ENDIF} + ; + +type + TDemoFrame = class(TFrame) + public + Connection: TCustomDAConnection; + procedure Initialize; virtual; + procedure SetDebug(Value: boolean); virtual; + + procedure AssignConnectionTo(Dest: TCustomDAConnection); + end; + + TDemoFrameClass = class of TDemoFrame; + + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} +{$IFDEF LINUX} +{$R *.xfm} +{$ENDIF} + +procedure TDemoFrame.Initialize; +begin +end; + +procedure TDemoFrame.SetDebug(Value: boolean); +begin +end; + +procedure TDemoFrame.AssignConnectionTo(Dest: TCustomDAConnection); +begin + Dest.Assign(Connection); + Dest.AfterConnect := nil; + Dest.AfterDisconnect := nil; +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Base/HtmlConsts.pas b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Base/HtmlConsts.pas new file mode 100644 index 0000000..32944d8 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Base/HtmlConsts.pas @@ -0,0 +1,142 @@ +unit HtmlConsts; + +interface + +const + HTMLHeader: string = + ''#13#10 + + ''#13#10 + + ''#13#10 + + ' Samples - Oracle Data Access Components'#13#10 + + ''#13#10 + + ''#13#10 + + ''#13#10; + + HTMLFooter: string = '' + #13#10 + ''; + +implementation + +end. diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Base/SdacAbout.nfm b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Base/SdacAbout.nfm new file mode 100644 index 0000000..0067eb0 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Base/SdacAbout.nfm @@ -0,0 +1,3078 @@ +object SdacAboutForm: TSdacAboutForm + Left = 582 + Top = 202 + BorderIcons = [biSystemMenu] + BorderStyle = bsDialog + Caption = 'About SDAC' + ClientHeight = 276 + ClientWidth = 386 + Color = clBtnFace + ParentFont = True + OldCreateOrder = True + Position = poScreenCenter + OnMouseMove = FormMouseMove + PixelsPerInch = 96 + TextHeight = 13 + object Bevel1: TBevel + Left = 8 + Top = 8 + Width = 123 + Height = 263 + end + object Image1: TImage + Left = 9 + Top = 9 + Width = 120 + Height = 260 + AutoSize = True + Picture.Data = { + 07544269746D6170D66D0100424DD66D01000000000036000000280000007800 + 0000040100000100180000000000A06D0100C30E0000C30E0000000000000000 + 0000020000020000020000020000020000020000020000020000020000020000 + 0200000200000200000200000200000200000200000200000200000200000200 + 0002000002000002000002000002000002000002000002000002000002000002 + 0000020000020000020000020000020000020000020000020000020000020000 + 0200000200000200000200000200000200000200000200000200000200000200 + 0002000002000002000002000002000002000002000002000002000002000002 + 0000020000020000020000020000020000020000020000020000020000020000 + 0200000200000200000200000200000200000200000200000200000200000200 + 0002000002000002000002000002000002000002000002000002000002000002 + 0000020000020000020000020000020000020000020000020000020000020000 + 0200000200000200000200000200000200000200000200000200000200000200 + 0002000002000002000002000025258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C02000002000025258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C02000002000025258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C02 + 000002000025258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C02000002000025258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C02000002000025258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C02000002000025258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C02 + 000002000025258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C26268C26268C26268C26268C27278D27278D27278D27278D27278D27278D27 + 278D26268C26268C26268C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C02000002000025258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C26268C26268C + 27278D28288D28288E29298E2A2A8F2B2B8F2C2C902D2D902D2D902E2E912E2E + 912E2E912E2E912E2E912D2D902C2C902B2B8F29298E28288E28288D27278D26 + 268C26268C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C02000002000025258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C26268C27278D28 + 288D28288E29298E2A2A8F2C2C902D2D902E2E91303092323293333393343494 + 3636953737953939963A3A973A3A973A3A973A3A973838963636953434943232 + 933030922E2E912B2B8F29298E28288D27278D26268C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C02000002000025258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C26268C26268C2727 + 8D28288D28288E29298E2A2A8F2B2B8F2C2C902D2D902E2E9130309232329334 + 34943737953A3A973C3C9840409A42429B45459D47479E49499F4A4A9F49499F + 48489E46469E43439C40409A3C3C983838963434943030922D2D902A2A8F2828 + 8E27278D26268C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C02 + 000002000025258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C26268C + 26268C27278D27278D27278D26268C26268C25258C25258C25258C25258C2525 + 8C25258C26268C28288E2C2C902F2F913434943A3A9740409A45459D4B4BA051 + 51A35555A55858A75959A85A5AA85858A75555A55151A34B4BA046469E40409A + 3A3A973535953030922D2D9029298E28288D26268C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C02000002000025258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C26268C26268C26268C + 27278D27278D27278D27278D27278D27278D27278D26268C26268C25258C2525 + 8C2E2E9139399644449C4D4DA15757A65E5EAA6363AD6767AF6868AF6767AF63 + 63AD5E5EAA5757A75050A348489E40409A3A3A973434942E2E912B2B8F28288E + 27278D26268C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C02000002000025258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C26268C27278D27278D28288D28 + 288E29298E29298E2A2A8F2B2B8F2B2B8F2B2B8F2B2B8F2B2B8F2B2B8F2A2A8F + 2A2A8F29298E28288E28288D27278D25258C28288E39399648489E5656A66262 + AC6A6AB17171B47474B57373B56F6FB36969B06262AC5858A74F4FA245459D3D + 3D993535952F2F912B2B8F28288E27278D26268C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C02000002000025258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C26268C27278D28288D28288E2929 + 8E2B2B8F2C2C902D2D902E2E912F2F9130309231319231319232329332329331 + 31923131923030922F2F912E2E912E2E912D2D902B2B8F2A2A8F28288E27278D + 26268C2A2A8F3F3F9A5151A36262AC6F6FB37878B87C7CBA7D7DBA7A7AB97373 + B56969B05E5EAA5353A448489E3F3F9A3636953030922C2C9028288E27278D26 + 268C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C02 + 000002000025258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C26268C27278D28288D28288E29298E + 2B2B8F2D2D902E2E913030923232933434943535953636953737953838963838 + 963838963838963838963737953636953535953434943333933232933030922F + 2F912E2E912C2C902A2A8F28288E27278D25258C3636954D4DA16262AC7272B5 + 7E7EBB8484BE8686BF8181BD7A7AB96F6FB36363AC5656A649499F3F3F9A3636 + 952F2F912B2B8F28288D26268C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C02000002000025258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C26268C27278D28288D29298E2B + 2B8F2D2D902F2F913131923434943636953838963A3A973B3B983C3C983E3E99 + 3E3E993E3E993E3E993E3E993D3D993C3C983B3B983A3A973A3A973838963737 + 953535953434943333933232933030922E2E912D2D902B2B8F29298E28288D26 + 268C3030924B4BA06363AC7575B68383BE8B8BC28C8CC28787C07E7EBB7272B5 + 6363AD5656A649499F3D3D993434942E2E912A2A8F28288D26268C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C02000002000025258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C26268C27278D28288D2929 + 8E2C2C902E2E913030923434943636953939963B3B983E3E9940409A41419B42 + 429B43439C43439C43439C3E3E963333872929772424711C1C651B1B6317175E + 12125612125617175E1919631A1A6520206F2323742A2A822F2F8F3030922E2E + 912E2E912C2C902A2A8F28288D26268C2E2E914C4CA16666AE7B7BBA8989C191 + 91C59191C58B8BC28080BC7272B56363AC5353A446469E3B3B983333932D2D90 + 29298E27278D26268C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C02000002000025258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C26268C27278D28288D + 29298E2C2C902E2E913131923434943838963B3B983E3E9941419B43439C4545 + 9D46469E46469E44449B35358725257119196012125612125612125612125612 + 1256121256121256121256121256121256121256121256121256121256121256 + 1212561717601F1F6F26267F2D2D902D2D902B2B8F29298E28288D26268C3333 + 935151A36D6DB28181BD9090C49696C89494C78C8CC38080BC6F6FB35F5FAB50 + 50A342429B3838963030922B2B8F28288D26268C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C02 + 000002000025258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C26268C27278D28 + 288D29298E2B2B8F2E2E913131923535953939963D3D9940409A43439C46469E + 48489E49499F4A4A9F3A3A8A26267115155A1212561212561212561212561212 + 5612125612125612125612125612125612125612125612125612125612125612 + 125612125612125612125612125612125612125614145A1D1D6C2727822D2D90 + 2B2B8F29298E28288D25258C3A3A975A5AA87575B68A8AC19696C89A9ACA9696 + C88C8CC27C7CBA6B6BB15A5AA84B4BA03E3E993434942E2E9129298E27278D26 + 268C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C02000002000025258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2626 + 8C27278D28288E2B2B8F2E2E913131923434943939963D3D9941419B45459D48 + 489E4B4BA04B4BA048489B2E2E7A17175D121256121256121256121256121256 + 12125612125612125613135814145A15155B16165C16165D17175D17175D1616 + 5D16165C15155B14145A13135812125612125612125612125612125612125612 + 125612125615155C2020742B2B8D2A2A8F28288E27278D25258C45459D6464AD + 7F7FBB9292C69C9CCB9D9DCB9696C88888C07777B76464AD5353A444449C3939 + 963030922B2B8F28288D26268C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C02000002000025258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 26268C27278D28288E2A2A8F2D2D903030923434943838963D3D9941419B4545 + 9D49499F4C4CA14E4EA247479A2C2C7714145912125612125612125612125612 + 125612125714145A16165D1818601A1A621B1B641D1D661D1D671E1E681E1E69 + 1F1F691F1F691E1E691E1E681D1D671C1C651B1B6419196118186016165D1414 + 5A1212571212561212561212561212561212561313591E1E7129298B29298E28 + 288D26268C3030925252A47272B58B8BC29A9ACAA0A0CD9E9ECC9292C68282BD + 6F6FB35C5CA94B4BA03E3E993434942D2D9028288E27278D25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C02000002000025258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C26268C27278D28288D29298E2C2C902E2E913333933737953C3C9840409A + 45459D4A4A9F4D4DA14F4FA249499B2A2A731313571212561212561212561212 + 5612125715155B17175E1A1A621C1C651E1E6820206B21216D23236F24247125 + 257225257326267427277527277526267425257325257224247123236F21216D + 20206A1E1E681C1C651A1A6217175E15155B1212571212561212561212561212 + 561313581C1C6E28288A28288E27278D25258C40409A6363AC8080BC9696C8A1 + A1CDA3A3CE9B9BCA8C8CC27979B86565AE5252A443439C3737952F2F912A2A8F + 27278D26268C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C02 + 000002000025258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C26268C27278D28288E2A2A8F2E2E913131923535953A3A9740 + 409A44449C49499F4C4CA15050A35050A1343480141459121256121256121256 + 12125614145917175D1919611D1D661F1F6921216D2323702525732727752929 + 782A2A7A2B2B7B2C2C7D2D2D7E2D2D7E2D2D7F2D2D7F2D2D7E2D2D7E2C2C7D2B + 2B7B2A2A7A29297827277525257323237021216D1F1F691C1C6519196117175D + 1313581212561212561212561212561313591F1F7429298D28288D26268C2E2E + 915252A47474B58E8EC39F9FCCA6A6D0A2A2CE9595C78282BD6E6EB25A5AA849 + 499F3B3B983232932C2C9028288D26268C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C02000002000025258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C26268C27278D28288D29298E2C2C902F2F913434943939 + 963E3E9943439C48489E4C4CA15050A35151A34343921D1D6312125612125612 + 125612125614145A18185F1B1B631E1E6821216C2323702626742828772B2B7B + 2D2D7E2E2E803030823131843232863333873434883434883434893434893434 + 883434883333873232863131843030822E2E802D2D7E2B2B7B28287726267423 + 237021216C1E1E681B1B6318185F14145A12125612125612125612125615155E + 22227D28288E27278D25258C43439C6767AF8686BF9B9BCAA6A6D0A6A6D09C9C + CB8B8BC27676B76262AC4F4FA240409A3434942E2E9128288E27278D25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C02000002000025258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C26268C27278D28288E2B2B8F2E2E91323293 + 3636953B3B9840409A46469E4B4BA04F4FA25151A34E4E9E2A2A721212561212 + 5612125612125614145A18185F1B1B641F1F6922226E2525722828762B2B7B2D + 2D7E2F2F8131318433338735358A36368C37378D39398F3939903A3A913A3A92 + 3B3B933B3B933A3A923A3A9139399039398F37378D36368C35358A3333873131 + 842F2F812E2E7E2C2C7B28287625257222226E1F1F691B1B6418185F14145A12 + 125612125612125612125618186525258728288D26268C3535955A5AA87B7BBA + 9595C7A5A5D0AAAAD2A2A2CE9292C67F7FBB6969B05555A545459D3838962F2F + 912A2A8F27278D26268C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C02000002000025258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C26268C28288D29298E2C2C902F + 2F913434943939963F3F9A44449C49499F4E4EA25151A35353A43A3A8516165A + 12125612125612125614145918185F1B1B641F1F6923236F2626742929782C2C + 7D2F2F8131318434348836368B38388E3939903B3B933C3C953E3E973F3F983F + 3F9940409A41419B41419B41419B40409A40409A3F3F993F3F983E3E973C3C95 + 3B3B9339399038388E3C3C8D43438F3E3E8A3232822C2C7D2929782626742222 + 6E1F1F691B1B6418185F14145912125612125612125613135821217728288D27 + 278D28288E4C4CA17070B48E8EC3A2A2CEAAAAD2A7A7D19999C98686BF7070B4 + 5C5CA94A4A9F3B3B983232932C2C9028288D26268C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C02 + 000002000025258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C26268C27278D28288D2A2A + 8F2E2E913131923636953B3B9841419B47479E4C4CA15151A35353A44949971F + 1F6612125612125612125613135817175D1A1A631F1F6922226E252574292979 + 2C2C7E2F2F8232328634348A37378D3939913B3B943D3D973F3F9940409C4242 + 9D43439F4343A04444A14545A24545A24545A34545A34545A24545A24444A143 + 43A042429E42429D40409C40409948489B54549F55559D505099474793383889 + 2F2F822C2C7D28287825257422226E1E1E691A1A6317175D1313581212561212 + 561616591D1D6825258527278D25258C40409A6565AE8686BF9E9ECCAAAAD2AA + AAD29F9FCC8D8DC37878B86363AC4F4FA240409A3434942E2E9128288E27278D + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C02000002000025258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C26268C27278D + 28288E2B2B8F2E2E913333933838963E3E9944449C4A4A9F4F4FA25353A45454 + A332327C12125612125612125612125615155C1A1A621D1D6821216D25257328 + 28782C2C7E2F2F8232328735358B38388F3A3A933D3D963F3F9941419C43439F + 4444A14646A44747A54848A74848A74949A94A4AAA4A4AAA4A4AAA4A4AAA4A4A + AA4A4AAA4949A94848A74848A74646A54646A45151A76060AC6060AA4E4EA04B + 4B9C55559F4F4F9A3B3B8D3232872F2F822C2C7D28287825257221216D1D1D67 + 19196115155B12125616165919195C16165A1F1F7627278D26268C3434945959 + A87B7BBA9797C8A7A7D1ABABD3A4A4CF9494C78080BC6969B05555A544449C38 + 38962F2F912A2A8F27278D26268C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C02000002000025258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C26268C26 + 268C28288D29298E2C2C903030923434943A3A9740409A46469E4C4CA15151A3 + 5555A54E4E9C21216812125612125612125614145A1818601C1C6620206C2424 + 722828772B2B7D2F2F8232328735358B3838903B3B943E3E9840409C42429E44 + 44A14646A44848A74949A94A4AAA4B4BAC4C4CAD4D4DAF4E4EB04E4EB04E4EB1 + 4E4EB14E4EB14E4EB14E4EB04E4EB04D4DAF4C4CAD4B4BAC5757AF6B6BB76A6A + B55656AA4545A142429E5050A25A5AA452529E41419435358B3232872F2F822B + 2B7D28287724247121216C2020681C1C611C1C5F1A1A5D141458121256191968 + 27278A26268C29298E4D4DA17171B49090C4A4A4CFACACD3A8A8D19A9ACA8686 + BF7070B45B5BA849499F3A3A973131922B2B8F28288D26268C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C02000002000025258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C26268C27278D28288E2A2A8F2E2E913232933737953D3D9943439C49499F4F + 4FA25353A45656A641418D16165A12125612125612125616165D1A1A631F1F69 + 2323702727752A2A7B2F2F8132328635358B3838903B3B943E3E9840409C4343 + A04545A34747A64949A94B4BAB4C4CAD4E4EAF4F4FB15050B35151B45252B552 + 52B65252B65353B75353B75353B75353B75252B65252B65252B55151B45A5AB7 + 7373C07474BF5B5BB34D4DAC4949A94747A64545A34F4FA45E5EA85757A44444 + 9738389035358B32328630308133337F34347C3131782C2C712424691B1B6013 + 135612125612125615155D23238127278D25258C42429B6666AE8787C09F9FCC + ABABD3ABABD3A0A0CD8D8DC37777B76161AC4D4DA13E3E993333932C2C902828 + 8E26268C25258C25258C25258C25258C25258C25258C25258C25258C25258C02 + 000002000025258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C26268C27278D28288E2B2B8F2E2E913434943939963F3F9A4545 + 9D4B4BA05151A35555A55555A42E2E7612125512125512125514145918185F1D + 1D6621216C2525722929782D2D7E30308334348938388E3B3B923E3E9740409B + 43439F4646A34848A64A4AA94C4CAC4E4EAE4F4FB15050B25252B55353B65454 + B75454B85555B95656BA5656BB5656BB5656BB5656BB5656BB5656BB5656BA55 + 55B95C5CBC7676C67C7CC76262BB5252B34F4FB14E4EAE4C4CAC4A4AA94848A6 + 5454A96262AC5A5AA649499B3E3E9440409248489346468E40408736367F2C2C + 7624246D1D1D6618185E1313571212551212551212561E1E7227278D26268C37 + 37955C5CA97E7EBB9999C9AAAAD2ADADD4A4A4CF9393C67E7EBB6767AF5252A4 + 41419B3535952E2E9129298E27278D25258C25258C25258C25258C25258C2525 + 8C25258C25258C02000002000025258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C26268C28288D29298E2C2C903030923535953A3A97 + 41419B47479E4D4DA15252A45656A64C4C991D1D631212551212551212551616 + 5B1A1A621F1F6823236F2727752B2B7C2F2F8133338736368C3A3A923D3D9640 + 409B43439F4646A34848A64A4AA94C4CAC4E4EAF5050B25252B55353B65454B8 + 5555BA5656BB5757BC5858BE5858BE5959BF5959BF5959C05959C05959C05959 + C05959BF5959BF5959BF6C6CC68787D06E6EC55555BA5454B85353B65252B450 + 50B24E4EAF4C4CAC4C4CAA5454AB6464B06161AC5757A45858A254549D464694 + 3A3A8A3131822B2B7A27277522226E1F1F681A1A6215155A1212561212551212 + 5518186526268A26268C2D2D905151A37575B69393C6A7A7D1AEAED4A9A9D199 + 99C98484BE6D6DB25757A745459D3838962F2F912A2A8F27278D26268C25258C + 25258C25258C25258C25258C25258C02000002000025258C25258C25258C2525 + 8C25258C25258C25258C25258C26268C27278D28288D2A2A8F2E2E9131319237 + 37953D3D9943439C4A4A9F5050A35454A55757A73C3C86141458121255121255 + 13135718185F1D1D6621216C2525722A2A792D2D7E32328535358A39398F3C3C + 943F3F9942429D4545A24848A64A4AA94D4DAD4E4EB05050B25252B55454B755 + 55BA5656BB5858BD5858BE5959C05A5AC15B5BC25B5BC35C5CC35C5CC45C5CC4 + 5C5CC45C5CC45C5CC45C5CC45C5CC35B5BC26E6EC98C8CD57474CA5A5ABF5858 + BD5656BB5555BA5454B75252B55050B24E4EB04D4DAD5656AE6666B36464AF58 + 58A745459B3F3F9638388F3535893131832D2D7E29297929297326266E222268 + 1C1C6016165916165915155816165E23238127278D25258C46469E6C6CB18C8C + C3A4A4CFAEAED4ABABD39E9ECC8A8AC17373B55D5DA94A4A9F3B3B983131922B + 2B8F28288D26268C25258C25258C25258C25258C25258C02000002000025258C + 25258C25258C25258C25258C25258C25258C26268C27278D28288E2B2B8F2E2E + 913333933939963F3F9A45459D4B4BA05151A35656A65454A229297012125512 + 125512125515155A1A1A611F1F6823236F2727752B2B7C30308233338737378D + 3B3B923E3E9742429C4444A04747A54A4AA94C4CAC4E4EB05050B25252B55454 + B85656BA5757BC5858BE5959C05A5AC15B5BC35C5CC45D5DC45D5DC65E5EC65E + 5EC75E5EC75E5EC75E5EC75E5EC75E5EC75E5EC75E5EC75E5EC66565C87E7ED2 + 8B8BD67373CC5E5EC25959C05858BE5757BC5656BA5454B85252B55050B24E4E + AF5454AF5656AE4A4AA64444A041419C3E3E973D3D933C3C8F3D3D8B3F3F8938 + 388233337B2E2E7527276D2222661B1B5F17175A17175A17175A1F1F7427278D + 25258C3D3D996363AC8585BF9F9FCCADADD4AEAED4A3A3CE9090C47979B86262 + AC4E4EA23F3F9A3434942D2D9028288E26268C25258C25258C25258C25258C02 + 000002000025258C25258C25258C25258C25258C25258C26268C27278D29298E + 2C2C902F2F913434943A3A9740409A47479E4D4DA15353A45757A64F4F9C1E1E + 6312125512125512125617175C1B1B6420206B2525712929782D2D7E32328535 + 358A3939903D3D9540409A43439F4646A34949A84C4CAC4E4EAF5050B25252B5 + 5454B85656BB5757BC5959BF5A5AC05B5BC25C5CC45D5DC45E5EC65E5EC75E5E + C75F5FC86060C96060C96060C96060C96060C96060C96060C96060C96060C960 + 60C95F5FC86565CA8181D49292DA7575CE5E5EC55B5BC25A5AC05858BE5757BC + 5656BA5454B85252B55050B24E4EAF4B4BAB4949A74848A44E4EA35252A25353 + 9E4F4F9942428F3C3C893535812D2D7929297322226B1E1E641A1A5E16165917 + 175A19195C1C1C6A26268A26268C3434945959A87D7DBA9999C9AAAAD2AFAFD5 + A6A6D09595C77F7FBB6868AF5353A442429B3636952E2E9129298E27278D2525 + 8C25258C25258C02000002000025258C25258C25258C25258C25258C26268C28 + 288D29298E2D2D903030923535953C3C9842429B49499F4F4FA25454A55757A7 + 43438E15155A11115511115514145918185F1D1D6722226D2626742A2A7A2E2E + 8133338736368C3A3A923D3D9741419D4444A14747A64A4AAA4D4DAE4F4FB151 + 51B55353B75555BA5656BC5A5AC05F5FC36161C46262C66363C76464C96363C9 + 6464CA6565CB6464CB6565CD6464CC6363CC6161CC6060CC6060CC6060CC6060 + CC6060CC6060CB6060CB6060CB5F5FC96464CB8080D68F8FDB7A7AD15F5FC75B + 5BC45A5AC25959C15757BE5656BC5555BA5353B75151B54F4FB15252B06161B3 + 6262B15D5DAC5050A34242993C3C9338388D3232862E2E802A2A792525732020 + 6C1C1C6518185F13135812125615155819196125258526268C2C2C905050A374 + 74B59292C6A7A7D1AFAFD5AAAAD29A9ACA8585BF6E6EB25858A746469E3A3A97 + 3030922A2A8F28288D26268C25258C02000002000025258C25258C25258C2626 + 8C27278D28288E2A2A8F2E2E913232933737953E3E9944449C4B4BA05151A356 + 56A65858A733337C11115511115511115515155B1A1A621F1F69232370282876 + 2C2C7D30308334348938388F3C3C943F3F9A43439F4646A44949A84B4BAC4E4E + B05050B35252B65454B95656BC5757BE5D5DC16262C56464C76565C86565C966 + 66CA6565CB6666CB6767CD6666CD6666CE6767CE6666CE6666CE6565CE6262CD + 6161CD6161CD6161CD6161CD6161CC6161CC6161CC6060CC6060CB6767CE7C7C + D59393DD7A7AD26262C95D5DC65B5BC45A5AC25959C05757BE5656BB5656BA5E + 5EBB6F6FC06B6BBB5D5DB35050AB4646A342429E3F3F993B3B9437378E343489 + 3030822B2B7C27277522226E1D1D6719196014145912125612125616165B2222 + 7C26268C25258C45459D6A6AB18B8BC2A3A3CEADADD4ABABD39E9ECC8B8BC275 + 75B65E5EAA4B4BA03D3D993333932C2C9028288E26268C02000002000025258C + 25258C26268C27278D28288E2B2B8F2E2E9134349439399640409A46469E4C4C + A15252A45757A65454A225256C11115511115512125617175D1C1C6420206B25 + 25722929792E2E8032328636368C3A3A923D3D9741419C4444A14747A64A4AAA + 4D4DAE4F4FB25151B55353B85555BB5757BE5959C05C5CC36464C76565C86666 + CA6767CB6767CC6767CB6868CD6767CD6868CE6868CE6767CE6767CF6868CF67 + 67CF6767CF6666CE6363CE6262CE6262CD6262CD6262CD6262CD6161CD6161CC + 6161CC6161CC6868CE8282D88F8FDC7B7BD46565CB5D5DC75C5CC55B5BC45A5A + C25959C06969C57A7AC96F6FC35C5CB94F4FB14C4CAD4A4AA94747A54444A040 + 409B3D3D9639399035358B3131852D2D7E2828772424711F1F691A1A6216165B + 1111551111551313561E1E7227278D25258C3B3B986060AB8282BD9D9DCBABAB + D3ACACD3A3A3CE9191C57B7BBA6565AE5151A341419B3636952E2E9129298E02 + 000002000025258C26268C28288D29298E2C2C903030923535953A3A9741419B + 48489E4E4EA25353A45757A74B4B971A1A5F11115511115514145918185F1D1D + 6722226E2626742B2B7B2F2F8233338837378E3B3B943F3F9942429E4545A348 + 48A84B4BAC4E4EB05050B35353B75454BA5656BC5858BF5959C15B5BC36060C6 + 6767CA6767CA6868CC6868CC6969CE6969CE6868CE6969CE6868CE6868CF6969 + CF6868CF6868D06868D06767D06767D06464CF6262CE6262CE6262CE6262CE62 + 62CE6262CD6262CD6161CD6161CC6161CC6666CE8080D89595DF7878D35F5FC9 + 5D5DC75D5DC65E5EC56A6AC88282D17474CA5A5ABE5454B95252B65050B34D4D + AF4B4BAC4848A74545A342429D3E3E983A3A9236368C3232862E2E802A2A7A25 + 257320206C1C1C6517175E1313571111551212561A1A6726268A26268C323293 + 5656A67979B89595C7A7A7D1ACACD3A6A6D09797C88282BD6C6CB15757A74646 + 9E3A3A9731319202000002000027278D28288D2A2A8F2E2E913232933737953D + 3D9943439C4A4A9F5050A35454A55757A73E3E8814145811115511115515155B + 1A1A621F1F692323702828772C2C7D30308335358A3939903C3C9640409B4444 + A04747A54A4AA94D4DAE4F4FB25151B55353B85555BB5757BE5959C05A5AC25B + 5BC45C5CC66464C96969CB6969CC6969CD6A6ACE6969CF6A6ACF6A6ACF6969CF + 6A6ACF6969CF6969D06969D06868D06868D06868D06767D06565CF6262CE6262 + CE6262CE6262CE6262CE6262CE6262CE6262CD6262CD6161CD6161CC7979D597 + 97E18080D75F5FCA5F5FC95E5EC86E6ECD8383D57676CE6060C45959C05757BE + 5555BB5353B85151B54E4EB14C4CAD4949A94646A443439F3F3F9A3C3C943838 + 8F3434893030822B2B7C27277522226E1D1D6718185F14145911115512125517 + 175F24248426268C28288D4A4A9F6E6EB28C8CC3A2A2CEAAAAD2A8A8D19C9CCB + 8989C17474B55E5EAA4C4CA13F3F9A02000002000028288E2B2B8F2E2E913333 + 933939963F3F9A45459D4B4BA05151A35656A65555A42E2E7611115511115512 + 125617175D1C1C6420206B2525722929792E2E8032328636368C3A3A923D3D97 + 41419D4545A24848A64B4BAB4D4DAF5050B35252B65454BA5656BC5858BF5959 + C15B5BC35C5CC55D5DC75E5EC86565CB6B6BCD6B6BCE6A6ACF6B6BCF6B6BCF68 + 68CF6868CF6969CF6868CF6868D06868D06969D06969D06868D06868D06868D0 + 6565CF6262CE6262CE6262CE6262CE6262CE6262CE6262CE6262CE6262CD6262 + CD6B6BD18B8BDD8D8DDD6D6DD16060CC6060CB6B6BCE8484D87F7FD56464CA5C + 5CC45B5BC35959C15757BE5656BC5454B95252B65050B24D4DAE4A4AAA4747A6 + 4444A140409C3D3D9639399035358B3131842D2D7E2828772424701F1F691A1A + 6215155B11115512125617175B22227C27278D25258C3E3E996262AC8282BD9A + 9ACAA7A7D1A9A9D19F9FCC8F8FC47B7BBA6767AF5454A50200000200002C2C90 + 3030923434943A3A9740409A47479E4D4DA15252A45757A64C4C991D1D631111 + 5511115514145918185F1D1D6722226D2626742B2B7B2F2F8233338837378E3B + 3B943F3F9942429F4646A44949A94C4CAD4E4EB15151B55353B85555BB5757BE + 5959C05A5AC25B5BC45C5CC65D5DC75E5EC85F5FC96666CC6C6CCF6C6CD06C6C + CF6B6BD06B6BD06464CE6262CD6262CE6262CE6262CE6464CF6969D06969D069 + 69D06868D06868D06565CF6262CE6262CE6262CE6262CE6262CE6262CE6262CE + 6262CE6262CE6262CE7E7ED89898E27A7AD76363CE6161CC6060CC8181D88585 + D96A6ACD5E5EC85D5DC75C5CC65B5BC45A5AC25858BF5757BD5555BA5353B750 + 50B34E4EB04B4BAC4848A74545A342429D3E3E983A3A9236368C3232862E2E80 + 2A2A7925257220206B1C1C6417175D1212561212561616591F1F7127278C2626 + 8C3131925454A57575B69191C5A2A2CEA7A7D1A2A2CE9595C78383BE6F6FB302 + 00000200003232933737953C3C9843439C49499F4F4FA25353A45757A641418C + 15155A11115511115515155B1A1A621F1F692323702828772C2C7D3030833434 + 8A3939903C3C9640409B4444A04747A54A4AAA4D4DAE4F4FB25151B55454B956 + 56BC5757BE5959C15B5BC35C5CC45D5DC75E5EC85F5FC95F5FC96060CB6767CE + 6D6DD06D6DD06D6DD16D6DD06C6CD06464CF6262CE6262CE6262CE6262CE6464 + CF6969D06969D06969D06969D06868D06666CF6262CE6262CE6262CE6262CE62 + 62CE6262CE6262CE6262CE6262CE6464CF8D8DDE9292E06969D06262CD6161CD + 7070D28F8FDE7272D36060CB5F5FC95F5FC95D5DC75D5DC65C5CC45A5AC35959 + C05757BE5555BB5353B85151B54F4FB14C4CAD4949A94646A443439F3F3F9A3C + 3C9438388F3434892F2F822B2B7B26267422226D1D1D6718185F141459131356 + 18185B1A1A6425258826268C25258C45459D6767AF8484BE9898C9A3A3CEA2A2 + CE9999C98A8AC10200000200003939963F3F9A45459D4B4BA05050A35454A555 + 55A42D2D7611115511115512125717175E1B1B6420206B2424722929792D2D80 + 31318635358C3939923D3D9741419D4545A24848A64B4BAC4D4DB04F4FB35252 + B75454BA5656BD5757BF5959C25A5AC45B5BC65C5CC75D5DC85E5EC95E5ECA5F + 5FCB6060CC6868CE6D6DD16C6CD16D6DD16D6DD16C6CD16363CF6161CE6161CE + 6161CE6161CE6363CF6969D06969D06868D06868D06868D06565CF6161CE6161 + CE6161CE6161CE6161CE6161CE6161CE6161CE6262CE7070D49696E27F7FDA61 + 61CE6161CD6666CF8282DA8686DB6262CD6060CC5F5FCB5E5ECA5E5EC95D5DC8 + 5C5CC75B5BC55A5AC35858C15757BF5555BC5454BA5353B75151B34D4DAE4B4B + AB4747A64343A03F3F9B3C3C9638389034348A3030832C2C7D2727762323701E + 1E681A1A6215155B16165918185B16165D22227E27278D26268C3434945555A5 + 7474B58C8CC29A9ACA9E9ECC9A9ACA02000002000040409A46469E4C4CA15151 + A35555A54B4B991D1D6311115511115514145A1818601D1D6722226E2626742A + 2A7B2F2F8233338837378E3B3B943E3E994444A04D4DA65555AC5858B15A5AB5 + 5858B75353B85454BB5656BE5858C05959C25B5BC45C5CC65D5DC75E5EC95E5E + C95F5FCB6060CC6060CC6060CC6868CF6E6ED16E6ED16D6DD26D6DD26C6CD163 + 63CF6161CE6161CE6161CE6161CE6363CF6969D06969D06969D06868D06868D0 + 6565CF6161CE6161CE6161CE6161CE6161CE6161CE6161CE6161CE6464CF7B7B + D89595E27272D46161CE6262CE7272D48A8ADD7676D56161CD6161CC6060CC5F + 5FCB5F5FCB5E5EC95D5DC85D5DC75B5BC65A5AC45959C25D5DC26868C46A6AC2 + 6A6AC16B6BBF6262B85959B14F4FAA4646A441419D3D3D9739399235358C3131 + 862D2D8029297924247220206B1B1B641A1A6019195C1616591212561C1C7028 + 288C27278D25258C41419B5F5FAB7979B88C8CC29595C702000002000048489E + 4D4DA15252A45555A53B3B8613135811115512125616165C1A1A631F1F692323 + 702828772C2C7D30308334348A3838903C3C963F3F9B4747A25555AA5A5AB05E + 5EB46060B86262BB6464BE6161C05858BF5858C15A5AC35B5BC55C5CC75D5DC8 + 5E5EC95E5ECA5F5FCB6060CC6060CC6060CC6060CD6969CF6F6FD16E6ED26E6E + D26D6DD26D6DD26363CF6161CE6161CE6161CE6161CE6363CF6A6AD16A6AD169 + 69D06969D06868D06565CF6262CE6363CF6161CE6161CE6161CE6161CE6464CF + 6262CE6868D18989DE8D8DDF6969D16161CE6565CF8080D98B8BDE6969D06262 + CD6161CD6161CC6060CC6060CC5F5FCB5E5EC95E5EC95D5DC85D5DC86565C879 + 79CF8484D18686D18383CD8080CA7A7AC57575C26868B85858AF4646A442429F + 3E3E993B3B9437378E3333882F2F822A2A7B26267422226E1E1E681E1E641C1C + 6012125611115517176226268628288D26268C29298E46469E6161AC7575B602 + 00000200004F4FA25252A44F4F9E27276F11115511115514145918185F1C1C66 + 21216C2525732929792E2E8031318535358B3939913D3D9741419C4848A35656 + AB5C5CB05F5FB46161B86464BC6767BF6868C36969C46666C55B5BC35B5BC55C + 5CC65D5DC75E5EC95F5FCA5F5FCA6060CB6060CB6060CC6161CC6161CC6A6AD0 + 6F6FD26F6FD16E6ED16E6ED16D6DD16464CE6161CD6161CD6161CD6161CD6363 + CE6A6AD06A6AD06A6AD06969D06969D06A6AD07272D47676D57B7BD87A7AD77A + 7AD77D7DD87C7CD87878D68383DB9A9AE48383DB6363CE6363CE6A6AD18686DC + 8181D96565CF6262CC6262CC6161CC6161CC6060CB6060CB5F5FCA5E5EC95E5E + C96C6CCD8383D58F8FD98C8CD78989D48585D08484CE8282CB7D7DC77979C36F + 6FBD5B5BB14646A54343A03F3F9A3C3C9538388F3434893030832C2C7D282877 + 23237024246C25256919195E12125611115516165B23237D28288E28288D2626 + 8C28288E40409A0200000200005151A339398415155911115512125716165C1A + 1A621E1E6923236F2727762B2B7C2F2F8233338837378E3B3B933E3E9942429E + 4949A45959AD5D5DB16161B66363BA6666BD6868C06A6AC36C6CC66D6DC86D6D + C96969CA5D5DC65E5EC85E5EC95F5FCA6060CB6060CB6060CB6060CC6161CC61 + 61CC6161CD6A6AD06F6FD26F6FD26F6FD16E6ED16D6DD16464CE6161CD6161CD + 6161CD6161CD6363CE6A6AD06A6AD06A6AD06A6AD06B6BD08282DA9292E19B9B + E49393E19494E19494E19595E29393E19393E19A9AE48F8FDF7474D56464CE64 + 64CE7272D48B8BDE7777D66464CF6363CE6262CD6262CC6262CC6161CC6060CB + 6060CB5F5FCA6666CD8181D69292DD9191DC8A8AD77E7ED17070CA6969C67272 + C87C7CCA7F7FC97B7BC46E6EBD5454AE4747A64444A141419C3D3D9739399135 + 358B3131852E2E802929792929752C2C7323236A181860141459121256151558 + 1A1A6726268828288E28288D27278D0200000200002020671111551111551515 + 5B1919601D1D6621216D2525732929782D2D7E31318535358A3838903C3C953F + 3F9B4343A04A4AA65959AE5F5FB46262B86565BA6767BE6969C16B6BC46D6DC7 + 6E6EC97070CB7070CC7070CD6C6CCD6060CA5F5FCA6060CB6060CB6060CC6060 + CC6161CC6161CC6262CD6464CE6C6CD07070D26F6FD26F6FD26F6FD16E6ED164 + 64CE6161CD6161CD6161CD6161CD6363CE6B6BD06B6BD06A6AD06A6AD07070D3 + 9B9BE49393E06A6AD07777D67777D67878D67070D37474D47474D56969D06F6F + D26868D06565CE6565CE7878D68B8BDE7070D36363CE6363CE6363CE6262CD62 + 62CC6262CC6161CC6060CB6060CB7474D39090DD9393DE8F8FDB7676D15F5FC6 + 5C5CC35B5BC25C5CC16868C47A7AC98080CA7C7CC66767BA4E4EAD4848A74545 + A242429E3E3E993B3B9337378E3333882F2F822E2E7D32327C2D2D752020691B + 1B6316165D1313571111551313581F1F7529298E29298E020000020000121256 + 15155A18185F1C1C651F1F6A2424702727762B2B7C2F2F8233338737378D3A3A + 923D3D9741419D4444A14C4CA75C5CB06060B56464B96666BC6868C06B6BC26D + 6DC56E6EC76F6FCA7070CB7171CC7272CE7272CF7272CF6D6DCF6161CB6060CB + 6060CC6161CC6161CC6464CE6A6AD06E6ED17070D27070D27070D27070D26F6F + D26F6FD26E6ED16464CE6161CD6161CD6161CD6161CD6363CE6B6BD06B6BD06B + 6BD06A6AD07777D59C9CE48484DB6767CF6767CF6262CD6161CD6161CD6161CD + 6161CD6262CD6464CE6565CE6565CE6666CE7777D68F8FE06868CF6363CE6363 + CE6363CE6363CE6262CD6262CC6262CC6161CC6464CE8383D99595E19595E082 + 82D86262CA5D5DC75C5CC65B5BC45A5AC25858C06969C57F7FCD8080CA7474C3 + 5656B44C4CAD4949A94646A54343A03F3F9B3C3C9538389035358A3232853939 + 8536368028287421216D1E1E6719196116165C12125711115515155F23237C02 + 00000200001818601C1C651F1F6A22226F2626742929792E2E8031318535358A + 38388F3B3B943F3F9A42429E4545A34E4EAA5E5EB26363B76565BB6868BE6A6A + C16C6CC46D6DC66C6CC76767C87272CC7272CD7373CF7373CF7373D17474D274 + 74D16E6ED06161CC6161CC6565CD6C6CD17272D27272D27272D27272D27171D2 + 7070D27070D27070D26F6FD26F6FD16464CE6161CD6161CD6161CD6161CD6464 + CE6C6CD06C6CD06B6BD06B6BD07D7DD79898E38888DC6969D06868CF6868CF65 + 65CE6363CE6161CD6262CD6565CE6666CF6666CF6565CE6666CF7878D68F8FDF + 6A6AD16363CE6363CE6363CE6363CE6363CE6262CD6262CD6262CC6A6ACF8C8C + DE9797E19292DF7272D25F5FCA5E5EC95D5DC75C5CC65B5BC55A5AC36060C37D + 7DCE8585D07F7FCB5D5DBB4F4FB24D4DAE4A4AAA4747A64444A141419D3D3D97 + 3A3A9237378D40408E3E3E8A2F2F7F28287724247120206B1C1C661919611616 + 5C1313581111550200000200001F1F6A22226F2525742929792C2C7D2F2F8233 + 338836368D3939923D3D9740409C4343A14646A54B4BAA5E5EB36363B86666BB + 6868BF6B6BC26D6DC56E6EC86C6CC85F5FC55B5BC66767CB7373CF7373D07474 + D17474D27474D27474D27474D26E6ED16C6CD07373D37373D37373D37272D371 + 71D27171D27171D27070D27070D27070D26F6FD26E6ED16262CE6060CD6060CD + 6060CD6060CD6262CE6B6BD16B6BD16B6BD06A6AD07D7DD89B9BE48484DB6B6B + D16868D06767CF6767CF6767CF6464CE6464CE6666CF6666CF6565CF6565CF66 + 66CF7B7BD78888DD6E6ED36060CD6161CD6262CE6262CE6262CE6262CE6161CD + 6161CD6C6CD08D8DDF9797E38E8EDE6B6BD05F5FCB5E5ECA5D5DC95D5DC85C5C + C65B5BC55C5CC47C7CD08888D48282CF6262C05252B74F4FB34D4DB04A4AAB48 + 48A84444A342429F3E3E9A3B3B954646974848943333872D2D802A2A7B262676 + 2323701F1F6B1D1D661A1A6217175F0200000200002626742929792C2C7D2F2F + 8232328735358B3838903C3C953E3E9A41419E4444A34747A74A4AAB5757B365 + 65BB6868BE6A6AC06C6CC36D6DC56F6FC86E6ECA6060C65B5BC65C5CC75D5DC9 + 6868CD7575D17575D27575D27575D37575D37575D37575D37575D37474D37373 + D37373D37373D37272D37171D27171D27171D27070D27070D27070D26969D060 + 60CD6060CD6060CD6060CD6060CD6060CD6767CF6B6BD16B6BD16B6BD07373D4 + 9E9EE58686DB6B6BD16969D06868D06767CF6767CF6767CF6767CF6666CF6666 + CF6666CF6565CF6565CF7D7DD88484DB6B6BD16060CD6060CD6161CD6262CE62 + 62CE6262CE6262CE6161CD6A6AD18C8CDE9898E39292E07474D46060CB5F5FCB + 5E5ECA5D5DC95D5DC85C5CC76868CB8484D58B8BD78181D16262C35454BA5252 + B85050B44E4EB14B4BAE4848A94646A54343A141419C49499D51519D38388F33 + 33893030842D2D7F29297A26267624247121216D1E1E690200000200002D2D7F + 2F2F8232328735358B37378F3A3A943D3D9840409D4343A14646A54848A94B4B + AD4E4EB16262BA6969BF6B6BC26D6DC56F6FC67171C96E6ECA6161C75C5CC65C + 5CC75D5DC95E5ECA5E5ECA6A6ACF7676D27676D37676D37676D37575D47575D4 + 7575D37474D37474D37373D37373D37373D37272D37171D27171D26F6FD26D6D + D16969D06161CD6060CD6060CD6060CD6060CD6060CD6060CD6161CD6767CF69 + 69D06A6AD07272D39E9EE58585DB6B6BD16969D06969D06868D06868D06767CF + 6767CF6767CF6666CF6666CF6666CF6565CF7979D78989DD6969D06060CD6060 + CD6060CD6161CD6262CE6262CE6262CE6262CE6565CF8585DB9999E49797E286 + 86DC6969D05F5FCB5F5FCB5E5ECA5D5DC96161CA7777D28F8FDB8E8ED98080D2 + 5F5FC35656BE5555BC5353B95151B64F4FB34C4CAF4A4AAB4747A74747A55353 + A75555A43E3E9839399136368D3333883030842D2D802B2B7C29297826267402 + 000002000033338835358C3838903A3A943D3D9840409C4242A04545A44747A7 + 4A4AAB4C4CAF4E4EB25151B56767BF6D6DC36F6FC67070C97272CA7373CB6A6A + CB5C5CC75D5DC85D5DC95E5ECA5F5FCB5F5FCB5F5FCB6A6AD07777D37777D376 + 76D47676D47575D47575D47575D37474D37474D37373D37373D37171D26B6BD1 + 6767CF6363CE6161CD6060CD6060CD6060CD6060CD6060CD6060CD6060CD6060 + CD6060CD6060CD6060CD6262CE7272D49A9AE38D8DDE6A6AD06A6AD16C6CD16D + 6DD26C6CD16969D06B6BD16767CF6A6AD06666CF6666CF6262CE6A6AD18C8CDF + 6D6DD26060CD6060CD6060CD6060CD6262CE6262CE6262CE6262CE6262CE7575 + D59494E19999E49595E28383DA6C6CD16464CD6060CB6767CD7878D48D8DDB91 + 91DD9090DC7676D05B5BC45858C15757BF5555BD5353BA5252B75050B44E4EB1 + 4B4BAD4E4EAC5B5BAF5757AA43439E3E3E993D3D9641419543439341418F3F3F + 8C3B3B883838840200000200003939913B3B943D3D9840409C4242A04444A247 + 47A64949AA4B4BAE4E4EB15050B45252B75454BA6868C37171C77272C97373CB + 7474CD7575CE7575CF6969CC5D5DC95E5ECA5F5FCB5F5FCB5F5FCC5F5FCC6060 + CC6B6BD07777D47676D47676D47676D47575D47575D47575D37474D37070D268 + 68D06363CE6060CD6060CD6060CD6060CD6060CD6060CD6060CD6060CD6060CD + 6060CD6060CD6060CD6060CD6060CD6060CD6060CD6C6CD29191E19393E18383 + DB8686DB8B8BDD8787DC8888DC8686DC8B8BDE8D8DDE8484DB7373D46363CE60 + 60CD6D6DD28989DD7676D66060CD6060CD6060CD6262CE6363CE6363CE6262CE + 6262CE6262CE6868D08181DA9797E39999E49797E38E8EDF8080D97D7DD78484 + DA9292E09595DF9292DE8888D96767CC5B5BC65A5AC35959C25858C05656BD54 + 54BB5252B85151B54E4EB25757B36666B75757AE4646A44343A04848A05757A5 + 5B5BA353539E4F4F9A4D4D974A4A940200000200003E3E9940409D4242A04444 + A24646A64848A94B4BAC4D4DB04F4FB35151B55252B85454BB5656BD6363C373 + 73CA7474CB7575CE7676CF7676D07777D17878D16A6ACE5F5FCB5F5FCB5F5FCC + 6060CC6060CC6060CD6060CD6B6BD17777D47676D47676D47676D47575D47272 + D36969D06161CD6060CD6060CD6060CD6060CD6060CD6060CD6060CD6060CD60 + 60CD6060CD6060CD6060CD6060CD6060CD6060CD6060CD6060CD6060CD6262CE + 7575D58E8EDF9898E39797E39393E19898E39898E39E9EE59696E29797E29F9F + E58383DB6363CE6060CD6868D08484DB8181DA6161CE6060CD6262CE6464CE64 + 64CE6363CE6363CE6262CE6262CE6363CE6B6BD18787DD9595E29999E49898E3 + 9696E29696E29797E29696E19494E18A8ADC6E6ED05F5FC95C5CC75B5BC65A5A + C45959C35858C15656BE5555BC5353BA5252B75E5EBA7070C05555B24A4AAB47 + 47A75252AA6464AF5555A749499F48489C4747994242960200000200004343A1 + 4545A44747A64848A94A4AAC4C4CAF4E4EB25050B45252B75353BA5555BC5656 + BE5858C05B5BC36D6DCA7777CE7878D07878D17979D27878D27979D47A7AD36B + 6BCF5F5FCC6060CC6060CC6060CD6060CD6060CD6060CD6B6BD07676D47676D4 + 7575D46C6CD16262CE6060CD6060CD6060CD6060CD6060CD6060CD6060CD6060 + CD6060CD6060CD6060CD6060CD6060CD6060CD6060CD6060CD6060CD6060CD60 + 60CD6060CD6060CD6060CD6E6ED37171D46F6FD37171D47575D57676D67070D2 + 7373D47979D69393E18E8EDF6A6AD16060CD6363CE7B7BD88B8BDE6B6BD26262 + CE6464CE6464CE6464CE6363CE6363CE6363CE6262CE6161CD6161CD6C6CD27B + 7BD89090E09696E39999E49797E29696E28D8DDE8080D86B6BD05F5FCB5E5ECA + 5D5DC95C5CC75C5CC65B5BC55959C35959C25757C05656BD5656BC6A6AC26F6F + C25454B54D4DB04C4CAD6262B56767B54E4EA84343A141419E40409C3E3E9902 + 00000200004747A84848AA4A4AAC4C4CAF4D4DB24F4FB45151B75252B95454BC + 5555BD5757C05858C25858C35A5AC55C5CC77070CD7878D17979D27979D37979 + D47A7AD47A7AD57878D46C6CD05F5FCC5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F + 5FCD6363CE6565CF6363CE5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD + 5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5F + CD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD6060CD5F5FCD5F5FCD5F + 5FCD5F5FCD6161CE6262CE6161CD7A7AD89797E37575D65F5FCD5F5FCD6F6FD3 + 8C8CDF7C7CD86565CF6464CF6363CE6363CE6363CE6363CE6262CE6161CE5F5F + CD5F5FCD5F5FCD6161CE6767D07979D77B7BD87C7CD87A7AD66F6FD26363CE5E + 5ECB5E5ECB5E5ECB5D5DCA5C5CC95C5CC85B5BC75A5AC65959C45858C25858C1 + 6060C37979CB6666C25252B84F4FB55353B46F6FBE6969BB4C4CAD4747A84545 + A64343A24242A10200000200004B4BAE4C4CB04D4DB24F4FB45151B75252B953 + 53BB5454BD5656BF5757C15858C35959C45A5AC65B5BC75C5CC85F5FC97171D0 + 7A7AD47B7BD47A7AD47A7AD57B7BD57B7BD57A7AD56C6CD15F5FCD5F5FCD5F5F + CD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F + 5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD + 5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5F + CD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD6E6ED39696E38181DA63 + 63CF5F5FCD6363CE8484DC8C8CDE6F6FD46464CF6464CF6363CE6363CE6363CE + 6262CE5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD6060CE6363CE6363CF5F5F + CD5F5FCC5F5FCC5E5ECC5E5ECB5E5ECB5E5ECB5D5DCA5C5CC95C5CC95B5BC75A + 5AC65A5AC55C5CC57171CC7C7CCF5E5EC25454BC5353BA6262BE7B7BC76262BB + 4C4CB04B4BAE4949AB4848AA4747A80200000200004F4FB35050B55151B65252 + B95353BA5454BC5656BE5757BF5858C15959C35A5AC45B5BC55B5BC65C5CC85C + 5CC85D5DC96060CB7373D17B7BD37B7BD47B7BD47B7BD47B7BD57B7BD57A7AD5 + 6C6CD05F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5F + CC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F + 5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC + 5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC6565 + CE8787DC9393E16C6CD15F5FCC6262CD7171D39292E08080D86767CF6464CE64 + 64CE6363CD6262CD5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC + 5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCB5F5FCB5E5ECB5E5ECA5E5ECA5E5E + CA5D5DC95C5CC85C5CC75B5BC66A6ACB8181D27272CB5858C05656BF5B5BBF74 + 74C87C7CCA5D5DBB5050B54F4FB34D4DB14C4CAF4B4BAD0200000200005252B7 + 5353B95454BB5555BC5656BE5757BF5858C15959C35A5AC45A5AC55B5BC65C5C + C75C5CC85D5DC95E5ECA5E5ECA5E5ECA6060CC7373D27C7CD47C7CD47B7BD57B + 7BD57B7BD57B7BD57A7AD56C6CD05F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC + 5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5F + CC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F + 5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC + 5F5FCC5F5FCC6060CD7171D39A9AE38080D96464CD6666CE6666CE8383DA9494 + E06F6FD26565CE6464CE6262CD5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F + 5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCB5F5FCB + 5E5ECB5E5ECA5E5ECA5E5ECA5D5DC95C5CC86262C97E7ED47E7ED36363C85959 + C35858C16969C78383D07373C85858BD5353B95252B75151B64F4FB44F4FB302 + 00000200005454BC5555BD5656BF5757C05858C15959C35A5AC45A5AC55B5BC6 + 5C5CC75C5CC85D5DC95D5DC95E5ECA5E5ECA5E5ECA5E5ECB5F5FCB6262CC7474 + D37C7CD57C7CD57B7BD57B7BD57B7BD57B7BD57979D46464CE5F5FCC5F5FCC5F + 5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC + 5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5F + CC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F + 5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC6565CE8989DD9393E07676D46767CE + 6767CE6C6CD18888DC9090DE7171D36363CD6060CC5F5FCC5F5FCC5F5FCC5F5F + CC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F + 5FCC5F5FCC5F5FCB5F5FCB5E5ECB5E5ECB5E5ECA5E5ECA6161CB7C7CD58787DA + 6C6CCD5C5CC65A5AC55F5FC67E7ED28282D26464C65757BF5555BD5454BC5353 + BA5353B95252B80200000200005757C05858C15858C25959C35A5AC45A5AC55B + 5BC65C5CC75C5CC85C5CC85D5DC95E5ECA5E5ECA5E5ECA5E5ECB5E5ECB5F5FCB + 5F5FCB5F5FCC6262CD7474D37C7CD57C7CD57B7BD57B7BD57B7BD57B7BD56666 + CE5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F + 5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC + 5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5F + CC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC6060CC7373D496 + 96E18E8EDE6D6DD06767CE6767CE7272D39191DF8989DD6C6CD15F5FCC5F5FCC + 5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5F + CC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCB5F5FCB5E5ECB6161CB7A + 7AD58C8CDC7272D15E5EC95C5CC85C5CC76868CB8E8ED97B7BD25D5DC55858C2 + 5858C15757BF5656BF5555BD5454BC0200000200005959C35A5AC45A5AC55B5B + C55B5BC65C5CC75C5CC85C5CC85D5DC95E5ECA5E5ECA5E5ECA5E5ECB5E5ECB5F + 5FCB5F5FCB5F5FCC5F5FCC5F5FCC5F5FCC7171D27C7CD57C7CD57C7CD57B7BD5 + 7B7BD57979D46464CE5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5F + CC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F + 5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC + 5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5F + CC5F5FCC6B6BD19595E19898E27373D46767CF6767CE6767CE7676D58B8BDD89 + 89DC7272D36060CC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC + 5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5F + CB6363CC7E7ED78A8ADC7777D45E5ECA5E5ECA5D5DC95D5DC96666CB8888D981 + 81D66E6ECD5A5AC55A5AC45959C35858C25858C15757C00200000200005A5AC5 + 5A5AC65B5BC75B5BC85B5BC85C5CC95C5CC95D5DCA5D5DCA5D5DCA5D5DCA5D5D + CB5E5ECB5E5ECB5E5ECB5E5ECC5E5ECC5E5ECC5E5ECC6565CE7B7BD57C7CD57C + 7CD57B7BD57B7BD57A7AD56E6ED15E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC + 5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5E + CC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E + 5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC + 5E5ECC5E5ECC5E5ECC6464CE8686DC9797E27E7ED86C6CD16767CF6666CF6666 + CE6767CE7272D38B8BDE8A8ADE7171D36060CD5E5ECC5E5ECC5E5ECC5E5ECC5E + 5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC + 5E5ECC6161CD6C6CD28282DA8B8BDD7676D55D5DCB5D5DCB5D5DCA5D5DCA5D5D + CA5E5ECA6A6ACE8484D98B8BDA6D6DCE5B5BC65A5AC55959C55959C45858C302 + 00000200005B5BC85B5BC85C5CC95C5CC95C5CC95D5DCA5D5DCA5D5DCA5D5DCB + 5D5DCB5E5ECB5E5ECB5E5ECB5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC7171 + D27C7CD67C7CD67C7CD57C7CD57B7BD57777D46161CD5E5ECC5E5ECC5E5ECC5E + 5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC + 5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5E + CC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E + 5ECC5E5ECC5E5ECC5E5ECC5E5ECC6464CE8484DB9B9BE47A7AD76464CE6666CF + 6767CF6767CF6666CF6666CE6666CE7070D28181DA8E8EDF8383DA6E6ED26363 + CE5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E + 5ECC5E5ECC5E5ECC6C6CD17979D78989DD8686DC7171D46060CD5E5ECB5E5ECB + 5D5DCB5D5DCB5D5DCA5D5DCA5D5DCA6565CD8B8BDB8C8CDB7070D05E5EC95B5B + C75A5AC65A5AC60200000200005C5CC95D5DCA5D5DCA5D5DCA5D5DCA5D5DCA5D + 5DCB5D5DCB5E5ECB5E5ECB5E5ECB5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC + 5E5ECC6363CE7B7BD57C7CD67C7CD67C7CD57C7CD57C7CD56B6BD05E5ECC5E5E + CC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E + 5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC + 5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5E + CC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC6464CE8282DA9696E27E7ED860 + 60CD5E5ECC6262CD6767CF6767CF6666CF6666CF6666CE6565CE6767CF7272D4 + 8D8DDF8A8ADD8080D97474D56A6AD16464CE5F5FCC5E5ECC5E5ECC6060CD6161 + CD6060CD5F5FCC6666CF6E6ED27C7CD88585DB8C8CDE7D7DD86A6AD15E5ECC5E + 5ECC5E5ECC5E5ECC5E5ECB5E5ECB5D5DCB5D5DCB5D5DCA5D5DCA6666CD8787DB + 9191DF7474D35F5FCA5B5BC85B5BC80200000200005D5DCA5D5DCA5D5DCB5D5D + CB5D5DCB5E5ECB5E5ECB5E5ECB5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E + 5ECC5E5ECC5E5ECC5E5ECC6E6ED17D7DD67D7DD67C7CD67C7CD67C7CD67777D4 + 5F5FCC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5E + CC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E + 5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC + 5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC6464CE8181DA9898 + E37F7FD96161CD5E5ECC5E5ECC5F5FCC6666CF6767CF6767CF6767CF6666CF66 + 66CE6262CD5F5FCC6262CE7C7CD88484DB8A8ADD8585DB7F7FD97C7CD87272D4 + 7B7BD87979D67676D57373D48181DA8585DB8484DB8989DD7B7BD86F6FD36161 + CD5E5ECC5E5ECC5F5FCC6060CD5F5FCC5E5ECC5E5ECC5E5ECB5E5ECB5E5ECB5D + 5DCB5D5DCB6767CE8787DB8E8EDE7676D46161CC5D5DCA0200000200005E5ECB + 5E5ECB5E5ECB5E5ECB5E5ECB5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5E + CC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5F5FCC7777D47E7ED67D7DD67D7DD67C + 7CD67C7CD66B6BD05E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC + 5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5E + CC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E + 5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC6363CE + 8282DA9595E28282DA6464CE5E5ECC5E5ECC5E5ECC5E5ECC6262CD6767CF6767 + CF6868D07373D47070D26464CE5F5FCC5E5ECC6161CD6868D07171D47B7BD781 + 81DA8282DA8888DC8282DA8282DA8282DA8989DD7F7FD97979D67676D66969D0 + 5E5ECC5E5ECC5E5ECC5E5ECC6060CD7878D67676D66868D05E5ECC5E5ECC5E5E + CC5E5ECC5E5ECC5E5ECB5E5ECB5E5ECB6969CF8282D99292E07171D35F5FCC02 + 00000200005E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC + 5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC6666CF7C7CD57E7E + D67E7ED67D7DD67D7DD67979D56262CD5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E + 5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC + 5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5F5FCC6161CD6363CE6363CE6161CD5F5F + CC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E + 5ECC5E5ECC7676D59999E38282DA6464CE5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC + 5F5FCC6767CF6767CF7B7BD79696E29595E17A7AD66868D05E5ECC5E5ECC5E5E + CC5E5ECC5E5ECC6060CD6565CF6565CF6868D06969D06969D16161CD6161CD64 + 64CE6060CD5E5ECC5E5ECC5F5FCC6262CD6F6FD38585DB9494E19898E38282DA + 6060CD5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC6464CF9393 + E08484DA6363CD0200000200005E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC63 + 63CE6D6DD17272D27171D27171D27171D27171D27171D27171D27171D27070D2 + 7676D47E7ED67E7ED67E7ED67D7DD67D7DD67272D25F5FCC5E5ECC5E5ECC5E5E + CC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E + 5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC6262CD6969CF7070D27373D37373D3 + 7373D37272D26E6ED16767CF6161CD5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5E + CC5E5ECC5E5ECC5E5ECC6262CE8A8ADE9393E16C6CD25E5ECC5E5ECC5E5ECC5E + 5ECC5E5ECC5E5ECC5E5ECC6666CE7D7DD89797E29898E29898E29C9CE48E8EDE + 7A7AD66868CF6262CD6262CD6262CD6161CD6161CD6161CD6161CD6060CD5F5F + CC5E5ECC5E5ECC5E5ECC5E5ECC5F5FCC6666CF7070D38181DA9292E09595E281 + 81DA8383DB9393E18181DA6464CE5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC + 5F5FCC7272D49090E08181DA5E5ECC0200000200005D5DCC5D5DCC5D5DCC5D5D + CC5D5DCC6868D07A7AD57D7DD67D7DD67D7DD67D7DD67D7DD67D7DD67D7DD67D + 7DD67D7DD67D7DD67D7DD67D7DD67D7DD67D7DD67D7DD67C7CD66969D05D5DCC + 5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5D + CC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC6767CF7373D37575D475 + 75D37474D37474D37373D37373D37272D37272D36F6FD26565CF5D5DCC5D5DCC + 5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC6262CE7F7FD99999E47B7BD86161 + CE5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5E5ECC7070D39D9DE49595E17575D574 + 74D58888DC9696E29C9CE49191E18787DC7A7AD77070D36767D06363CE6363CE + 6262CE6161CD6161CD5E5ECC5D5DCC6363CE6E6ED37A7AD78585DC9292E19494 + E18585DC7171D46161CD6060CD7676D69494E28888DD6464CF5D5DCC5D5DCC5D + 5DCC5D5DCC5D5DCC7171D48F8FE08C8CDF6C6CD25D5DCC0200000200005D5DCC + 5D5DCC5D5DCC5D5DCC6464CE7C7CD67D7DD67D7DD67D7DD67D7DD67D7DD67D7D + D67D7DD67D7DD67D7DD67D7DD67D7DD67D7DD67D7DD67D7DD67D7DD67D7DD67A + 7AD56363CE5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC + 5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC6A6AD07676 + D47676D47575D47575D37575D37474D37474D37373D37373D37373D37272D371 + 71D26868CF5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC6868D1 + 8B8BDE9696E27B7BD86565CF5D5DCC5D5DCC5D5DCC5E5ECC7070D49292E09696 + E17878D66767CF6767CF6767CF7272D48080D99090E09595E19595E19494E07F + 7FD96666CF6363CE6363CE6262CE6161CD6161CD5E5ECC7D7DD98E8EDF9191E1 + 8E8EDF8181DA7070D46464CF5D5DCC5D5DCC5D5DCC5F5FCD7A7AD79494E28787 + DD6868D05D5DCC5D5DCC5D5DCC7171D48F8FE09191E17272D45D5DCC5D5DCC02 + 00000200005D5DCB5D5DCB5D5DCB5D5DCB7171D27D7DD57D7DD57D7DD57D7DD5 + 7D7DD57D7DD57D7DD57D7DD57D7DD57D7DD57D7DD57D7DD57D7DD57D7DD57D7D + D57D7DD57D7DD57777D35E5ECB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D + 5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB + 6868CE7777D37676D37676D37676D37575D37272D26F6FD16E6ED17171D17373 + D27373D27272D27272D27171D26565CE5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D + 5DCB5D5DCB5E5ECB6B6BD18A8ADE9898E37B7BD76060CC5D5DCB5D5DCB6F6FD3 + 8F8FDF9191E07373D36969CE6868CE6767CE6767CE6767CE6767CE6D6DD07676 + D58080D99B9BE39595E16C6CD16363CD6363CD6363CD6262CD6161CC6161CC87 + 87DC9696E37575D56363CD6262CD5E5ECC5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB + 6363CD7777D69393E18B8BDE6767CF5E5ECB6F6FD29090E09191E07373D45D5D + CB5D5DCB5D5DCB0200000200005D5DCB5D5DCB5D5DCB5D5DCB7A7AD47D7DD57D + 7DD57D7DD57D7DD57D7DD57D7DD57D7DD57D7DD57D7DD57D7DD57D7DD57D7DD5 + 7D7DD57D7DD57D7DD57D7DD57D7DD56F6FD15D5DCB5D5DCB5D5DCB5D5DCB5D5D + CB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D + 5DCB5D5DCB6161CC7575D37777D37777D37676D37474D26868CF6161CC5D5DCB + 5D5DCB6161CC6868CE7171D17373D27272D27272D26F6FD16060CC5D5DCB5D5D + CB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB6969D08B8BDE9999E47C7CD863 + 63CD7272D48F8FE08E8EDF6F6FD26464CD6868CF6868CE6868CE6767CE6767CE + 6767CE6666CE6565CE6767CF8888DC9696E16E6ED16363CD6363CD6363CD6363 + CD6262CD6868CF8888DC8D8DDF5E5ECB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D + 5DCB5D5DCB5D5DCB5D5DCB6060CC7979D69393E18686DC7B7BD78F8FDF9292E1 + 7272D45E5ECC5D5DCB5D5DCB5D5DCB0200000200005D5DCB5D5DCB5D5DCB5D5D + CB7B7BD57D7DD57D7DD57D7DD57D7DD57D7DD57C7CD57C7CD57C7CD57C7CD57C + 7CD57C7CD57C7CD57C7CD57C7CD57C7CD57C7CD57272D26060CC5D5DCB5D5DCB + 5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5D + CB5D5DCB5D5DCB5D5DCB5D5DCB6A6ACF7878D47878D47777D37474D26464CD5D + 5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB6363CD7171D27373D27272D27272D2 + 6767CE5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB6666 + CF8787DC9999E48C8CDE9393E19090E06E6ED25D5DCB5E5ECB6565CD6868CE68 + 68CE6767CE6767CE6767CE6666CE6666CE6969D08686DB9494E17070D26464CD + 6363CD6363CD6363CD6262CD6969CF8787DC8989DD6161CD5D5DCB5D5DCB5D5D + CB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB6262CD7474D58C8CDE98 + 98E38C8CDE7373D45D5DCB5D5DCB5D5DCB5D5DCB5D5DCB0200000200005D5DCB + 5D5DCB5D5DCB5D5DCB7B7BD57D7DD57D7DD57D7DD57D7DD57878D46565CE6565 + CD6565CD6565CD6565CD6565CD6565CD6565CD6565CD6565CE6262CD5D5DCB5D + 5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB + 5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5E5ECB7373D27878D47878D47777 + D36969CF5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB6868CE73 + 73D27373D27272D26E6ED05E5ECB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB + 5D5DCB5D5DCB5D5DCB6565CE7E7ED99090E08989DD6F6FD25D5DCB5D5DCB5D5D + CB5D5DCB5F5FCC6060CC6060CC6060CC6060CC6060CC5F5FCC6262CD8686DB8F + 8FDF6C6CD16363CD6464CD6363CD6363CD6363CD6565CE8787DC8C8CDE6464CE + 5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5D + CB5E5ECB6B6BD17272D46D6DD15E5ECB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB02 + 00000200005D5DCB5D5DCB5D5DCB5D5DCB7B7BD57D7DD57D7DD57D7DD57D7DD5 + 7676D35D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5D + CB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D + 5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB6161CC7878D4 + 7878D47878D47575D36161CC5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5D + CB5D5DCB6161CC7171D17373D27373D27171D26060CC5D5DCB5D5DCB5D5DCB5D + 5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB6363CD6868CF6666CF5E5ECB + 5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5D + CB5D5DCB8686DC8E8EDF6A6AD06363CD6565CD6464CD6363CD6363CD6363CD86 + 86DC8D8DDF6767CF5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB + 5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5E5ECC5E5ECB5D5DCB5D5DCB5D5DCB5D5D + CB5D5DCB5D5DCB0200000200005C5CCB5C5CCB5C5CCB5C5CCB7B7BD57D7DD57D + 7DD57D7DD57D7DD57575D35D5DCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB + 5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5C + CB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C + 5CCB6363CD7777D47878D47777D47171D25C5CCB5C5CCB5C5CCB5C5CCB5C5CCB + 5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB6D6DD17272D27272D27171D26161CD5C5C + CB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C + 5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB + 5C5CCB5C5CCB5C5CCB5C5CCB8181DA8F8FE06868D06262CD6464CD6464CD6363 + CD6262CD6464CE8787DD8B8BDE6666CF5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C + 5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB + 5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB0200000200005C5CCB5C5CCB5C5CCB5C5C + CB7B7BD57D7DD57D7DD57D7DD57D7DD57575D35D5DCB5C5CCB5C5CCB5C5CCB5C + 5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB + 5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5C + CB5C5CCB5C5CCB5C5CCB6363CD7878D47979D47878D47171D25C5CCB5C5CCB5C + 5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB6E6ED17373D27272D2 + 7272D26161CD5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5C + CB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C + 5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5F5FCC7D7DD99191E16969D06262CD + 6464CE6464CD6363CD6363CD6262CD8888DD8B8BDE6565CF5C5CCB5C5CCB5C5C + CB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C + 5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB0200000200005C5CCB + 5C5CCB5C5CCB5C5CCB7B7BD57D7DD57D7DD57D7DD57D7DD57575D35C5CCB5C5C + CB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C + 5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB + 5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB6060CC7878D47979D47979D47575 + D36060CC5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB6060CC71 + 71D27474D37373D27272D25F5FCC5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB + 5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5C + CB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB6161CD8181DA8E + 8EDF6868D06363CD6464CE6464CE6464CD6363CD6464CE7F7FDA9090E06363CE + 5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5C + CB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB02 + 00000200005C5CCB5C5CCB5C5CCB5C5CCB7B7BD57D7DD57D7DD57D7DD57D7DD5 + 7777D46464CE6464CD6464CD6464CD6464CD6464CD6464CD6464CD6464CD6464 + CE6161CD5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C + 5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5D5DCB7474D3 + 7979D47979D47878D46969CF5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5C + CB5C5CCB6868CF7474D37474D37474D36F6FD15D5DCB5C5CCB5C5CCB5C5CCB5C + 5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB + 5C5CCB5C5CCB5C5CCB5C5CCB5E5ECC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5F + CC6161CD8181DA9797E27474D56969D07171D36E6ED16F6FD16C6CD17373D489 + 89DE9090E06363CE5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB + 5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5C + CB5C5CCB5C5CCB0200000200005C5CCB5C5CCB5C5CCB5C5CCB7B7BD57D7DD57D + 7DD57D7DD57D7DD57D7DD57B7BD57B7BD57B7BD57B7BD57B7BD57B7BD57B7BD5 + 7B7BD57B7BD57B7BD57B7BD57171D25F5FCC5C5CCB5C5CCB5C5CCB5C5CCB5C5C + CB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C + 5CCB5C5CCB6A6ACF7979D47979D47979D47676D36464CD5C5CCB5C5CCB5C5CCB + 5C5CCB5C5CCB5C5CCB6363CD7272D27575D37474D37474D36767CE5C5CCB5C5C + CB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C + 5CCB5C5CCB5C5CCB5C5CCB5C5CCB5D5DCB6666CE6A6ACF6A6ACF6969CF6969CF + 6868CF6868CF6868CF6767CE7A7AD69696E29999E49595E19090DF9191E09191 + E09797E39898E39393E17C7CD85E5ECC5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C + 5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB + 5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB0200000200005C5CCB5C5CCB5C5CCB5C5C + CB7979D47D7DD57D7DD57D7DD57D7DD57D7DD57D7DD57D7DD57D7DD57D7DD57D + 7DD57D7DD57D7DD57D7DD57D7DD57D7DD57D7DD57D7DD56F6FD15C5CCB5C5CCB + 5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5C + CB5C5CCB5C5CCB5C5CCB5C5CCB6060CC7777D47979D47979D47979D47676D369 + 69CF6060CC5C5CCB5C5CCB6060CC6868CF7474D37676D37575D37575D37272D2 + 6060CC5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5C + CB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB6565CE6B6BD06B6BD06B + 6BD06A6ACF6969CF6969CF6969CF6868CF6868CF6A6AD07B7BD78989DC8B8BDD + 8C8CDE8F8FDF8E8EDF8282DA8787DD7878D66363CE5C5CCB5C5CCB5C5CCB5C5C + CB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C + 5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB0200000200005B5BCB + 5B5BCB5B5BCB5B5BCB7070D27C7CD57C7CD57C7CD57C7CD57C7CD57C7CD57C7C + D57C7CD57C7CD57C7CD57C7CD57C7CD57C7CD57C7CD57C7CD57C7CD57C7CD575 + 75D35C5CCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB + 5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB6767CF7979D47979 + D47979D47878D47777D47474D37070D27070D27373D37676D47575D37575D375 + 75D37474D36565CE5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB + 5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5C5CCB6969 + CF6B6BD06A6AD06A6AD06A6AD06969CF6969CF6969CF6868CF6767CF6767CF68 + 68CF6B6BD06A6AD06D6DD16666CE6464CE6969D06565CF5D5DCC5B5BCB5B5BCB + 5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5B + CB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB02 + 00000200005B5BCA5B5BCA5B5BCA5B5BCA6262CC7B7BD47C7CD57C7CD57C7CD5 + 7C7CD57C7CD57C7CD57C7CD57C7CD57C7CD57C7CD57C7CD57C7CD57C7CD57C7C + D57C7CD57C7CD57979D46161CC5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B + 5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA + 5B5BCA6B6BCF7979D47979D47878D37878D37777D37777D37777D37777D37676 + D37676D37575D37575D26969CE5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B + 5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA + 5B5BCA5E5ECB6A6ACF6C6CCF6B6BCF6A6ACF6A6ACF6A6ACF6969CF6969CE6969 + CE6868CE6767CE6767CE6767CE6666CE6666CE6565CD6565CD6464CD5D5DCB5B + 5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA + 5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5B + CA5B5BCA5B5BCA0200000200005B5BCA5B5BCA5B5BCA5B5BCA5B5BCA6767CE79 + 79D47C7CD57C7CD57C7CD57C7CD57C7CD57C7CD57C7CD57C7CD57C7CD57C7CD5 + 7C7CD57C7CD57C7CD57C7CD57C7CD57B7BD46767CE5B5BCA5B5BCA5B5BCA5B5B + CA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B + 5BCA5B5BCA5B5BCA5B5BCA5B5BCA6767CE7575D37979D47878D37878D37777D3 + 7777D37777D37777D37676D37373D26666CE5B5BCA5B5BCA5B5BCA5B5BCA5B5B + CA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B + 5BCA5B5BCA5B5BCA5B5BCA6161CC6C6CCF6C6CCF6C6CCF6B6BCF6A6ACF6A6ACF + 6A6ACF6969CF6969CE6969CE6868CE6767CE6767CE6767CE6666CE6565CD6464 + CD5F5FCB5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B + 5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA + 5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA0200000200005B5BCA5B5BCA5B5BCA5B5B + CA5B5BCA5B5BCA6060CC6A6ACF6F6FD06E6ED06E6ED06E6ED06E6ED06E6ED06E + 6ED06E6ED06E6ED07373D27C7CD57C7CD57C7CD57C7CD57C7CD57070D15C5CCA + 5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5B + CA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA6060CB6969CE73 + 73D27777D37777D37777D37676D37272D16868CE6060CB5B5BCA5B5BCA5B5BCA + 5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5B + CA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA6767CE6D6DD06C6CD06C6CCF6C + 6CCF6B6BCF6767CE6363CD6464CD6363CD6363CD6363CC6363CC6262CC6262CC + 6262CC6060CC5D5DCB5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5B + CA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B + 5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA0200000200005B5BCA + 5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5B + CA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA6464CD7A7AD47C7CD57C7CD57C7CD57C + 7CD57878D36060CB5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA + 5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5B + CA5B5BCA5B5BCA5C5CCA5F5FCB6262CC6262CC5F5FCB5C5CCA5B5BCA5B5BCA5B + 5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA + 5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5E5ECB6C6CCF6D6D + D06D6DD06C6CD06C6CCF6A6ACF6060CB5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B + 5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA + 5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5B + CA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA02 + 00000200005B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA + 5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5C5CCA7575D27C7C + D57C7CD57C7CD57C7CD57C7CD56969CF5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B + 5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA + 5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5B + CA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B + 5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA + 6363CD6E6ED06E6ED06D6DD06D6DD06C6CD06969CE5C5CCA5B5BCA5B5BCA5B5B + CA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B + 5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA + 5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5B + CA5B5BCA5B5BCA0200000200005A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A + 5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA + 5A5ACA6B6BD07B7BD57B7BD57B7BD57B7BD57B7BD57575D35B5BCA5A5ACA5A5A + CA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A + 5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA + 5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5A + CA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A + 5ACA5A5ACA5B5BCA6B6BCF6D6DD06D6DD06D6DD06C6CD06C6CD06363CD5A5ACA + 5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5A + CA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A + 5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA + 5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA0200000200005A5ACA5A5ACA5A5ACA5A5A + CA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A + 5ACA5A5ACA5A5ACA5A5ACA5F5FCC7979D47B7BD57B7BD57B7BD57B7BD57B7BD5 + 6868CF5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5A + CA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A + 5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA + 5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5A + CA5A5ACA5A5ACA5A5ACA5A5ACA6363CD6F6FD16E6ED06E6ED06D6DD06D6DD06B + 6BD05D5DCB5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA + 5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5A + CA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A + 5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA0200000200005A5ACA + 5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5A + CA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA6F6FD17B7BD57B7BD57B + 7BD57B7BD57B7BD57676D35D5DCB5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA + 5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5A + CA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A + 5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA + 5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5D5DCB6C6CD06F6FD16F6FD16E6E + D06D6DD06D6DD06666CE5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A + 5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA + 5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5A + CA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA02 + 00000200005A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA + 5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA6262 + CD7A7AD47B7BD57B7BD57B7BD57B7BD57B7BD56C6CD05A5ACA5A5ACA5A5ACA5A + 5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA + 5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5A + CA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A + 5ACA5A5ACA5A5ACA5A5ACA5A5AC95959C85959C85959C75959C76565CC7070D0 + 6F6FD06F6FD16F6FD16E6ED06D6DD05F5FCC5A5ACA5A5ACA5A5ACA5A5ACA5A5A + CA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A + 5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA + 5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5A + CA5A5ACA5A5ACA0200000200005A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A + 5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA + 5A5ACA5A5ACA5A5ACA6E6ED07B7BD57B7BD57B7BD57B7BD57B7BD57979D46060 + CC5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A + 5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5AC95A5AC95A5ACA5A5ACA + 5A5ACA5A5ACA5A5AC95A5AC95A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5A + CA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5AC95959C75858C55757C45656C25A + 5AC36C6CCB6E6ECD6F6FCF6F6FD06F6FD16F6FD16666CE5A5AC95A5AC95A5ACA + 5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5A + CA5A5ACA5A5ACA5A5AC95A5AC95A5AC95A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A + 5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5AC95A5AC95A5AC95A5AC9 + 5A5AC95A5AC95A5AC95A5ACA5A5ACA0200000200005A5ACA5A5ACA5A5ACA5A5A + CA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A + 5ACA5A5ACA5A5ACA5A5ACA5A5ACA5D5DCB7171D17B7BD57B7BD57B7BD57B7BD5 + 7B7BD57B7BD56363CD5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5A + CA5A5ACA5A5ACA5A5ACA5A5ACA5A5AC95A5AC95959C85959C75858C55858C458 + 58C45858C55858C55858C55858C45858C45858C45858C55959C75959C75959C8 + 5959C85959C85959C85959C75959C75959C75959C85959C75858C45656C25555 + BF5353BB5252B95858BA6969C16A6AC56C6CC96D6DCC6D6DCE6D6DCE6666CB59 + 59C55858C45858C55858C65959C75959C85959C85959C85959C85959C85959C8 + 5959C85959C85959C75959C75858C55858C45858C45858C45858C45858C65959 + C75959C75959C75959C85959C85959C75959C75959C75959C75858C55858C458 + 58C45757C45757C35757C35757C45858C45858C55959C70200000200005959CA + 5959CA5959CA5959CA5959CA5959CA5959CA5959CA5959CA5959CA5959CA5959 + CA5959CA5959CA5959CA5959CA5959CA5959CA5C5CCB7070D17A7AD57A7AD57A + 7AD57A7AD57A7AD57A7AD57878D45F5FCC5959CA5959CA5959CA5959CA5959CA + 5959CA5959CA5959CA5959CA5959CA5959CA5959C95858C85757C65656C25454 + C05353BD5353BD5353BD5353BD5353BD5353BD5353BC5353BC5353BD5353BD54 + 54BF5555C05656C25555C15555C15656C25555C15555C15555C15656C25555C1 + 5353BD5252BA5050B54D4DB04B4BAB5050AC6161B56464BA6666BF6969C56969 + C66868C66868C56060C15454BD5353BD5454BE5555C05656C25656C25656C256 + 56C25656C25656C25555C15555C15555C05454BF5353BD5353BD5353BC5353BC + 5353BD5454BF5454C05555C05555C05656C25656C25555C15555C15555C15454 + C05454BE5353BD5353BD5252BB5252BB5252BB5353BC5353BD5454BF5555C102 + 00000200005959C95959C95959C95959C95959C95959C95959C95959C95959C9 + 5959C95959C95959C95959C95959C95959C95959C95959C95B5BCA7070D17A7A + D47A7AD47A7AD47A7AD47A7AD47A7AD47A7AD46969CE5959C95959C95959C959 + 59C95959C95959C95959C95959C95959C95959C95959C95959C95858C75757C3 + 5555C05252BA5050B54F4FB34F4FB24F4FB14F4FB24F4FB34E4EB14E4EB04D4D + AF4E4EB14E4EB14F4FB35151B65151B85151B75151B75151B85151B85151B751 + 51B75151B85151B74F4FB34D4DAE4B4BA94848A245459B45459B5050A35C5CAB + 6060B36363B86565BC6363BA6161B86161B75A5AB54F4FB14F4FB35050B55151 + B85252B85151B85151B85252B85151B85151B75151B75151B64F4FB34E4EB14E + 4EB14E4EB14E4EB14F4FB25050B55151B65151B65151B65151B85151B85151B8 + 5151B85151B85050B54F4FB34F4FB24F4FB14E4EB14E4EB14E4EB04E4EB04E4E + B14F4FB35151B80200000200005959C95959C95959C95959C95959C95959C959 + 59C95959C95959C95959C95959C95959C95959C95959C95959C95959C95C5CCA + 7070D17A7AD47A7AD47A7AD47A7AD47A7AD47A7AD47A7AD46969CE5959C95959 + C95959C95959C95959C95959C95959C95959C95959C95959C95959C95959C959 + 59C85757C55555C05252B94F4FB14B4BAA4A4AA84A4AA64949A64A4AA74A4AA7 + 4949A44848A24848A24848A24848A24949A64B4BA94C4CAB4B4BA94B4BAA4C4C + AC4C4CAC4B4BA94C4CAB4C4CAD4C4CAB4A4AA64848A246469E4242953E3E8D3E + 3E8D4141924C4C9A5757A35B5BAA5E5EAE5D5DAC5A5AA95959A85959A85454A7 + 4B4BA64B4BA94C4CAD4D4DAD4C4CAC4C4CAD4D4DAD4C4CAC4B4BA94B4BA94A4A + A84848A34747A04747A04747A04747A14848A34A4AA84B4BAA4B4BA94B4BA94C + 4CAC4C4CAC4C4CAB4C4CAB4C4CAC4B4BA94A4AA64949A54949A54949A44848A2 + 4747A14747A14848A24949A64D4DAD0200000200005959C95959C95959C95959 + C95959C95959C95959C95959C95959C95959C95959C95959C95959C95959C959 + 59C95C5CCA7070D17A7AD47A7AD47A7AD47A7AD47A7AD47A7AD47A7AD46969CE + 5959C95959C95959C95959C95959C95959C95959C95959C95959C95959C95959 + C95959C95959C95858C75656C25252BA4F4FB14A4AA646469E45459B44449A44 + 449944449A44449A42429540409141419241419241419242429444449A45459B + 44449A44449A46469E45459D44449A45459B46469E45459C4343974242944141 + 923D3D8A3939813939813B3B853C3C8846468F52529954549D53539A51519751 + 51975050985151994D4D9945459A46469E46469E45459D46469E46469E45459C + 4444994444994343974040913E3E8D3F3F8F40408F4040904141934444994545 + 9B44449944449A45459D45459D45459B45459B45459D44449A43439743439743 + 43984343974242944141924141924141934343984848A20200000200005959C9 + 5959C95959C95959C95959C95959C95959C95959C95959C95959C95959C95959 + C95959C95959C95C5CCA7070D17A7AD47A7AD47A7AD47A7AD47A7AD47A7AD47A + 7AD46969CE5959C95959C95959C95959C95959C95959C95959C95F5FCB6161CC + 5F5FCB5959C95959C95959C95959C95858C75454BF5050B54B4BAA46469E4242 + 9441419240409140408F4040914040903D3D8A3B3B853B3B853B3B863B3B853C + 3C883E3E8C3E3E8D3D3D8B3E3E8C3F3F8F3E3E8D3D3D8B3E3E8C40408F42428F + 4D4D926D6DA45D5D9A3A3A8236367A35357937377D37377D38387F4242874D4D + 8F4B4B8C4949884A4A8A4B4B8C4A4A8C4B4B8D4848914141924040913F3F8F40 + 408F4040913E3E8D3D3D8A3D3D8B3C3C883A3A8238387F3939813A3A843B3B84 + 3C3C883E3E8D40408F3E3E8C3E3E8C40408F3F3F8F3E3E8C3F3F8E40408F3E3E + 8D3D3D8B3E3E8C3F3F8F3E3E8D3D3D8B3C3C883C3C883C3C883F3F8E44449A02 + 00000200005959C95959C95959C95959C95959C95959C95959C95959C95959C9 + 5959C95959C95959C95959C95B5BCA7070D07A7AD47A7AD47A7AD47A7AD47A7A + D47A7AD47A7AD46969CE5959C95959C95959C95959C95959C95959C95959C969 + 69CE7878D37A7AD47878D36B6BCF5D5DCA5959C95959C95858C65454BE4F4FB3 + 4A4AA743439840408F3F3F8E3E3E8D3E3E8C3E3E8D3E3E8C3B3B8438387F3939 + 8039398038387F3939803B3B853B3B853939813939813B3B843A3A8338387F3B + 3B824646894C4C8A7777A3E8E8E8B7B7C939398035357835357736367A363679 + 35357837377D41418447478445458147478347478647478647478749498B4747 + 8E3D3D883B3B853B3B863C3C883A3A843939803A3A8239398036367934347636 + 367937377D37377D3939803C3C873C3C883A3A833A3A823B3B863B3B853A3A82 + 3A3A843C3C873A3A843A3A823B3B843C3C883C3C873A3A843939813939803939 + 813C3C884242950200000200005959C95959C95959C95959C95959C95959C959 + 59C95959C95959C95959C95959C95959C95959C96868CE7A7AD47A7AD47A7AD4 + 7A7AD47A7AD47A7AD47A7AD46969CE5959C95959C95959C95959C95959C95959 + C95959C96969CE7A7AD47A7AD47A7AD47A7AD47A7AD47575D26767CE5A5AC958 + 58C65454BD4F4FB35F5FAF6F6FAD6161A13E3E8D3E3E8D3E3E8C4949936A6AA3 + 67679D38387F38387F39398037377D38387F3A3A843A3A8438387F38387E3939 + 8138387E3E3E7D4747814C4C884C4C877777A2EBEBEBBBBBCC57579164649736 + 367A37377D36367A35357837377C5B5B946A6A9A5A5A8D464683484885474785 + 47478649498B4B4B8D4242893A3A823A3A833A3A8439398037377D3939805959 + 9262629362629135357735357936367A37377D3A3A843B3B8439398038387F3A + 3A8239398138387E39398068689D66669A4E4E8B39398051519167679C66669A + 38387E38387E3939803C3C884343970200000200005858C95858C95858C95858 + C95858C95858C95858C95858C95858C95858C95858C95858C95959C97070D179 + 79D47979D47979D47979D47979D47878D36868CE5858C95858C95858C95858C9 + 5858C95858C95858C96868CE7979D47979D47979D47979D47979D47979D47979 + D47979D47474D26464CB6363C5C5C5E0ECECECECECECEAEAEAB0B0CC3F3F8F83 + 83B4E6E6E6E3E3E3E3E3E3D7D7DC5B5B963A3A8466669DE3E3E3B4B4C93B3B88 + 66669DE2E2E2B6B6C848488573739DE9E9E9C0C0D04D4D8A7A7AA7F1F1F1E9E9 + E9E6E6E6E3E3E3C7C7D1505090393981434385C1C1CFE3E3E3E3E3E3E3E3E3A3 + A3BC4A4A8B4A4A8A9292B5E4E4E49393B848488E8A8AB2E3E3E38989B1393983 + 5B5B95CBCBD5E0E0E0E2E2E2E2E2E2E0E0E05A5A9366669BE4E4E4B5B5CA3C3C + 8967679EE3E3E3B5B5C9393983383880C4C4D3E7E7E7E9E9E9BCBCCEAFAFC7E9 + E9E9E6E6E6E4E4E4D6D6DB7D7DA93B3B883F3F8F44449C0200000200005858C9 + 5858C95858C95858C95858C95858C95858C95858C95858C95858C95858C95858 + C95959C97474D27979D47979D47979D47979D47979D46C6CD05858C95858C958 + 58C95858C95858C95858C95858C96868CE7979D37979D37979D37979D37979D3 + 7979D47979D47979D47979D47979D47878D2C6C6EAF8F8F8C0C0DE7979BA8A8A + BEB8B8D46666AAF6F6F6E5E5EB7B7BB49191BDECECECDDDDE23E3E8F6C6CA7E9 + E9E9BBBBD14949957676A8E7E7E7BDBDCE50508D7878A5EEEEEEC6C6D7525293 + 8080B1FBFBFBD5D5E38080B2B1B1CBE9E9E9ADADC83D3D8CB2B2CCECECECA7A7 + C76C6CA8CACADAE9E9E99696BB5050959999BFEAEAEA9999C04F4F999090BAE9 + E9E98E8EB83D3D8CD7D7E1EAEAEA8F8FBB6C6CA66B6BA59999BE60609F6D6DA7 + ECECECBBBBD14141946C6CA7E9E9E9BABACF3D3D8C6B6BA4ECECECD5D5DF4646 + 8C5252929090B860609E3D3D8C4A4A93E6E6E6D8D8DD4040924343984747A302 + 00000200005858C95858C95858C95858C95858C95858C95858C95858C95858C8 + 5858C85757C75757C65757C47070CD7676CF7676CF7777D07777D07777D07171 + CD5D5DC65656C45656C45656C55757C65757C66666CB7676CF7676CE7676CE76 + 76CE7676CE7676CE7676CE7676CE7777D07777D17878D27878D2FFFFFFFFFFFF + 7777C36464B45D5DAA5555A49D9DCBFFFFFFA7A7D14646A045459ED4D4E5F4F4 + F47474B27E7EB5F6F6F6C9C9DD5E5EA58484B7F2F2F2C6C6D857579A8080B1F7 + F7F7CDCDDF58589E8585BAFFFFFFD4D4E75C5CA56464A7F7F7F7F2F2F2424297 + FAFAFAF8F8F85151A344449B8282B9F5F5F5C9C9DC55559FA2A2CBF5F5F5A1A1 + CC5656A89999C8F5F5F59797C77575B5FBFBFBDEDEEA7575B77474B57373B472 + 72B25050A27474B5F7F7F7C4C4DD4747A27474B5F2F2F2C2C2DA44449B7272B2 + F2F2F2C2C2D83F3F913E3E8E3F3F8F8A8ABCBABAD6DCDCE7EFEFEFDFDFE54646 + 9F4848A54C4CAD0200000200005858C95858C95858C95858C95858C95858C958 + 58C95858C85757C75656C55555C35454BF5252BC6262C17171C67171C77171C7 + 7272C87272C87171C76D6DC45A5ABF5252BC5353BE5454BF6363C47373C97272 + C87171C77070C57070C57070C47070C47070C57171C77272C87373CA7575CD76 + 76CFFFFFFFFFFFFF6F6FC36A6AB96565B06262ABA6A6D0FFFFFF9D9DCE4848A6 + 4848A4CECEE6FFFFFF8585BE8A8AC0FFFFFFD5D5E96363AE8A8AC0FEFEFECFCF + E35B5BA28787BAFFFFFFD4D4E75D5DA58888BEFFFFFFD4D4E95F5FAA5E5EA9FF + FFFFFFFFFF5050A2FFFFFFFFFFFF4848A44C4CA58585BEFFFFFFD3D3E75A5AA7 + A8A8D2FFFFFFAAAAD75757B2A0A0D3FFFFFF9F9FD37B7BC2FFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFDFDFD7B7BC27B7BC2FFFFFFCFCFE94D4DB17C7CC3FEFEFECC + CCE64B4BAB7A7AC0FBFBFBC9C9E246469F44449C9C9CCBFFFFFFFFFFFFFFFFFF + C0C0E06D6DBA4C4CAE4E4EB25050B80200000200005858C95858C95858C95858 + C95858C95858C95858C95858C85656C55555C15252BC5050B64E4EB25252B167 + 67B96A6ABA6B6BBB6C6CBD6B6BBC6A6ABA6A6AB96767B85454B34E4EB35E5EBA + 6E6EC06D6DBF6C6CBD6B6BBB6A6ABA6A6AB96969B86161B55E5EB46A6ABA6C6C + BD6E6EC17272C87474CBDADAF1FFFFFFB2B2DF6A6AB97979BAABABD29595C5FF + FFFFE6E6F35454AC6D6DB8FFFFFFFFFFFF6B6BB08C8CC1FFFFFFE0E0EF6E6EB4 + ABABD2FFFFFFDFDFEE6868ABA9A9CFFFFFFFD4D4E85555A48484BEFFFFFFDFDF + EE6B6BB28A8AC2FFFFFFE9E9F35C5CA7DCDCEDFFFFFFA0A0D05B5BAAC9C9E2FF + FFFFB2B2D55B5BA8A8A8D3FFFFFFC0C0E35353B8C5C5E7FFFFFFA2A2D95D5DBD + F3F3FAE8E8F65252BC5252BCDCDCF1FFFFFF6868C37F7FCCFFFFFFDCDCF25E5E + C0A2A2DAFFFFFFD1D1EC5050B87F7FC9FFFFFFD0D0EA4C4CAE4B4BACCFCFE9FF + FFFF9595D14F4FB55050B87E7ECB5151BA5252BC5454BF0200000200005858C9 + 5858C95858C95858C95858C95858C95858C95757C65555C15252BC4F4FB44B4B + AB4848A54747A24E4EA55E5EAA6262AC6464AF6262AC6060A96060A96161AA5E + 5EAA5959AA6666B26666B46666B36565B06363AE6262AC6262AB5959A647479E + 45459E4D4DA25959A96565B36D6DBE7070C58D8DD2F6F6FBFFFFFFFFFFFFFFFF + FFD4D4E65C5CA1B7B7D7FFFFFFFFFFFFFFFFFFFFFFFF9494C76060A88A8AC0FF + FFFFF5F5F9FFFFFFFFFFFFFFFFFFD4D4E7FFFFFFFFFFFFFFFFFF9E9ECB434399 + 7676B5FFFFFFF4F4F9FFFFFFFFFFFFFFFFFFA7A7CD5959A17A7AB4F3F3F9FFFF + FFFFFFFFFFFFFFDEDEEC6363A75858A2A7A7D0FFFFFFF4F4FAFFFFFFFFFFFFFF + FFFF7777CE5555C29A9ADBFFFFFFE8E8F7DDDDF3FFFFFFBBBBE75555C38282D3 + FFFFFFF4F4FBFFFFFFFFFFFFFFFFFFA4A4DE5555C1FFFFFFFFFFFFFFFFFFFFFF + FFD1D1EC8B8BD0FFFFFFF4F4FBD1D1EEF4F4FBD2D2EE5555C15555C35656C302 + 00000200005757C85757C85757C85757C85757C85757C85757C75555C35252BC + 4E4EB44949A944449D4040943F3F913F3F9145459256569A5B5B9E59599C5656 + 9756569656569757579759599B5C5CA15D5DA35D5DA35C5CA15C5CA05B5B9E52 + 52994141913D3D8C3D3D8C3E3E8F3F3F9147479D5959AE6565BB6D6DC07979C5 + A6A6D6ACACD3A8A8CC6D6DA554549543438E7E7EB49999C59A9AC76666A94747 + 975B5BA16767A78787B97D7DB47272AEA6A6CB9B9BC455559D6666A79C9CC88D + 8DC03F3F913D3D8C4A4A947272AC7171A96C6CA6A5A5CA9A9AC3535396535395 + 5252956969A3A4A4C8A4A4CA9898C15D5D9D5151965252986A6AAA7C7CBE6565 + BB7F7FCDA4A4DE8383D55757C75757C75757C76D6DCEA5A5E1A5A5E18F8FDA57 + 57C75757C76262CB8484D67979D26D6DCEA5A5E19A9ADD5757C75757C7A5A5E1 + FFFFFFDDDDF38282D37676CD5454C26C6CCBA4A4E0A5A5E0A5A5E16D6DCE5757 + C75757C75757C70200000200005757C85757C85757C85757C85757C85757C857 + 57C75454C25151B94C4CAE4646A23F3F923B3B883A3A85393984393983414189 + 52529352528F4F4F8A4F4F894F4F8A4F4F8951518D5454935656975656975555 + 955555954E4E923F3F8C3B3B873939823838813838813A3A853F3F914747A24C + 4CAD5656B66464BA6868B65F5FA656569651518D4E4E8A3D3D823838813B3B88 + 3C3C8A3C3C8942428E5656985757985757975858995656974E4E9043438E3F3F + 8F3E3E8F3E3E8E3D3D8D3B3B873838813838813939823B3B844A4A8C52529351 + 51914E4E8D4D4D8B4D4D8B4D4D8B4E4E8E5050924E4E8F4C4C8B4C4C8D4B4B8F + 43439145459E4B4BAD5050B85454C15656C65757C85757C85757C85757C85757 + C85757C85757C85757C85757C85757C85757C85757C85757C85757C85757C857 + 57C85757C88484D7FFFFFFD2D2F05656C65656C65656C65757C75757C75757C7 + 5757C85757C85757C85757C85757C80200000200005757C85757C85757C85757 + C85757C85757C85757C75454C14F4FB74A4AAB44449D3D3D8C38388137377E36 + 367C36367B3838804040874C4C884B4B834A4A824A4A824A4A804B4B834F4F8A + 51518D51518D51518D4B4B8C3C3C883A3A8639398236367C35357A35357A3737 + 7D3C3C8A45459E4A4AAB4D4DB15E5EB76767B45D5DA35353914D4D8649498139 + 397934347837377F393983393982404088545494555594555594555594545492 + 47478A3B3B883C3C8B3C3C8B3C3C8A3B3B8838388135357935357935357A3636 + 7C39398148488A4D4D8A4A4A854949844949834949834A4A864C4C8B4A4A8648 + 48844646833D3D833C3C8A4343994A4AA94F4FB75454C05656C65757C85757C8 + 5757C85757C85757C85757C85757C85757C85757C85757C85757C85757C85757 + C85757C85757C85757C85757C85757C85757C85757C85757C85757C85757C857 + 57C85757C85757C85757C85757C85757C85757C85757C80200000200005757C8 + 5757C85757C85757C85757C85757C85757C75454C04F4FB77474BC5959A63C3C + 8B37377F36367B3535793434774D4D8B65659C3E3E834848824A4A814A4A8048 + 487E49497F56568C7777A27777A152528C3B3B845B5B975B5B9839398336367D + 35357A35357936367C3C3C8944449D4A4AAB4D4DB27575C18D8DC65E5EA45454 + 924C4C8548488038387734347737377E5E5E986A6AA057579553539355559454 + 549360609A8080AD7676A73B3B883C3C8B3C3C8A3C3C8A5E5E9C67679B656596 + 33337634347735357950508D6B6BA07272A14848814848824949834848826C6C + 9C7777A56B6B9B4545813B3B7F3939823C3C8A43439B4A4AAB5050B85454C156 + 56C65757C85757C85757C85757C85757C85757C85757C85757C85757C85757C8 + 5757C85757C85757C85757C85757C85757C85757C85757C85757C85757C85757 + C85757C85757C85757C85757C85757C85757C85757C85757C85757C85757C802 + 00000200005757C85757C85757C85757C85757C85757C85757C75454C2B2B2DC + ECECECE6E6E6B8B8CDE2E2E2B3B3C635357A70709EE7E7E7E3E3E3CCCCD6CBCB + D4DDDDDD7575A04C4C85616192DFDFE3EAEAEAECECEC8D8DB39999BCE8E8E8E3 + E3E3B4B4C9DDDDDDDBDBDB3838813939833E3E8F4646A14B4BAD8989CDFAFAFA + F2F2F2DADAE3D5D5DDE3E3E37575A13C3C7F5B5B94D4D4DEEFEFEFF1F1F1EFEF + EF9D9DC0565697A8A8C6EFEFEFF1F1F1F2F2F2E6E6EB3E3E8E6262A2D5D5DFE8 + E8E8E7E7E7E7E7E7E8E8E85B5B95B2B2CAEFEFEFECECECECECECDEDEE28B8BB0 + 4E4E8BE4E4E8EEEEEEECECECEAEAEAD0D0D95C5C983C3C893F3F914646A04C4C + AF5151BA5454C25757C75757C85757C85757C85757C85757C85757C85757C857 + 57C85757C85757C85757C85757C85757C85757C85757C85757C85757C85757C8 + 5757C85757C85757C85757C85757C85757C85757C85757C85757C85757C85757 + C85757C85757C80200000200005757C85757C85757C85757C85757C85757C857 + 57C78282D3FDFDFDDFDFEC8080BE9D9DC5EAEAEABABACE383880C0C0D3F1F1F1 + 7878AC4A4A95D2D2DDE5E5E57373A74F4F909999BBEFEFEFB7B7CF3C3C885353 + 95F6F6F6F2F2F24B4B976161A3E5E5E5E0E0E03D3D8C3E3E9043439A4949A94E + 4EB4D1D1ECFFFFFF9B9BD16F6FB6D9D9E2E7E7E77B7BAB42428DD6D6E1EDEDED + 9393BF7070AD9797C2A1A1C69999C1F4F4F4D3D3E18E8EBA8686B6D0D0E14141 + 96DEDEE9F1F1F19191BE6D6DA96B6BA59999BE6161A09292BC6262A34040934B + 4B97EDEDEDE0E0E54E4E94A6A6C76666A44C4C997A7AB0E6E6E6ADADC9404093 + 43439A4848A64E4EB35252BC5555C35757C75757C85757C85757C85757C85757 + C85757C85757C85757C85757C85757C85757C85757C85757C85757C85757C857 + 57C85757C85757C85757C85757C85757C85757C85757C85757C85757C85757C8 + 5757C85757C85757C85757C85757C80200000200005656C85656C85656C85656 + C85656C85656C85656C8A4A4E0FFFFFFA1A1D94C4CB07575BAF3F3F3C1C1D63C + 3C8CBCBCD7FBFBFB9696C44E4EA1C5C5DDEFEFEF7171B343439B9595C4F4F4F4 + 9595C33F3F933E3E91F2F2F8FEFEFE8080BB44449EEFEFEFE6E6E643439C4444 + 9F4747A64D4DB25050BAC5C5E9FFFFFFB3B3E07474BFD0D0E4F2F2F28484B977 + 77B5F7F7F7D2D2E44646A44646A24C4CA46060ABD4D4E8FCFCFC9494C66262AC + 5555A64545A17676BBFFFFFFE3E3EF7575B97373B57272B27070B24F4FA14343 + 9B8C8CC2BBBBDADFDFEBF6F6F6E9E9EF45459E5151A49999CAC6C6DFE6E6EDEE + EEEEB3B3D14545A14747A64C4CB05050B95353C05555C55656C75656C85656C8 + 5656C85656C85656C85656C85656C85656C85656C85656C85656C85656C85656 + C85656C85656C85656C85656C85656C85656C85656C85656C85656C85656C856 + 56C85656C85656C85656C85656C85656C85656C85656C80200000200005656C8 + 5656C85656C85656C85656C85656C85656C8A4A4E1FFFFFFA3A3DD5050B97C7C + C5FBFBFBC8C8E04242995A5AA5CDCDE4FFFFFFFFFFFFFFFFFFFEFEFE7979C24A + 4AAB9D9DD0FBFBFB9A9ACD44449F44449E7777B9E6E6F3FFFFFFFFFFFFFCFCFC + F2F2F24A4AAC4B4BAE4D4DB35050BA5252BF6B6BCBD6D6F0FFFFFFFFFFFFFFFF + FFFFFFFF8F8FC97F7FC3FFFFFFCFCFE94D4DB24C4CB05151B16767B9D7D7ECFF + FFFF9191CC6969B95C5CB34B4BAD7B7BC3FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FDFDFD7A7AC19E9ED2FFFFFFFFFFFFFFFFFFC3C3E36E6EBD4B4BADCFCFE9FFFF + FFFFFFFFF3F3FAB3B3DB5656B24C4CB04D4DB35050B95252BF5454C35555C656 + 56C85656C85656C85656C85656C85656C85656C85656C85656C85656C85656C8 + 5656C85656C85656C85656C85656C85656C85656C85656C85656C85656C85656 + C85656C85656C85656C85656C85656C85656C85656C85656C85656C85656C802 + 00000200005656C85656C85656C85656C85656C85656C85656C88E8EDAFFFFFF + E8E8F75E5EC47F7FCCFFFFFFCFCFE94848A85353AB5555AF4B4BAE7C7CC7E7E7 + F5FFFFFF7F7FCC4F4FB8A1A1D9FFFFFFA0A0D64B4BAE4A4AAD6363B84C4CB059 + 59B98A8ACFFFFFFFFEFEFE5050B95050BA5151BD5353C15454C46060C97272CE + 7575CE9898D9ECECF8FFFFFF9494D36363C0F3F3FAFFFFFF8080CE5252BB8585 + CFA7A7DBB2B2DEFFFFFFCFCFEB7979C76C6CC3ADADDE5B5BBDF3F3FAE8E8F650 + 50BA5050BADCDCF1FFFFFF6767C2D0D0ECFFFFFF9797D65050BB5050B97F7FCC + 5050B9FFFFFFFFFFFF6868C45050BA5C5CBE7272C65050BA5151BB5252BF5454 + C35555C55656C75656C85656C85656C85656C85656C85656C85656C85656C856 + 56C85656C85656C85656C85656C85656C85656C85656C85656C85656C85656C8 + 5656C85656C85656C85656C85656C85656C85656C85656C85656C85656C85656 + C85656C85656C80200000200005656C85656C85656C85656C85656C85656C856 + 56C85656C8D2D2F0FFFFFFFFFFFFFFFFFFFFFFFFD0D0EC4E4EB57C7CC7FFFFFF + D0D0ECDCDCF1FFFFFFE8E8F75E5EC48181D1FFFFFFFFFFFFFFFFFFFFFFFFA1A1 + D9A2A2DAF3F3FAD1D1EDE8E8F6FFFFFFC6C6EA5353C15353C25454C35555C555 + 55C68383D6FFFFFFDBDBF3E4E4F5FFFFFFECECF87D7DCF6E6ECAA7A7DFFFFFFF + FFFFFFFFFFFFFFFFFFB5B5E47C7CCEE3E3F5FFFFFFFFFFFFFFFFFFFFFFFF5353 + C19898DAFFFFFFE8E8F7DDDDF3FFFFFFBABAE65353C28C8CD6FFFFFFF4F4FBD1 + D1EFF4F4FBD1D1EE5353C1AFAFE2FFFFFFE8E8F7D1D1EFFFFFFFA3A3DE5353C1 + 5454C35454C35555C55656C75656C75656C85656C85656C85656C85656C85656 + C85656C85656C85656C85656C85656C85656C85656C85656C85656C85656C856 + 56C85656C85656C85656C85656C85656C85656C85656C85656C85656C85656C8 + 5656C85656C85656C85656C85656C80200000200005656C85656C85656C85656 + C85656C85656C85656C85656C85656C89A9ADEA5A5E1A4A4E1FFFFFFD1D1EE52 + 52BF5E5EC28C8CD4A3A3DDA4A4DF9898DC6060CA5656C76060CABBBBE8FFFFFF + BBBBE78282D36A6ACA6B6BCB9898DBA4A4E0A4A4E08E8ED95555C65656C75656 + C75656C75656C85656C86161CC9C9CDFB7B7E7B7B7E7AEAEE48181D57878D278 + 78D27878D28A8AD8B7B7E7B7B7E7AEAEE48181D57878D27878D2A5A5E1B7B7E7 + B0B0E57878D25656C75656C76D6DCEA5A5E1A5A5E18E8EDA5656C75656C75656 + C76D6DCEA5A5E1A5A5E1A5A5E16D6DCE5656C75656C77878D2A5A5E1A5A5E19A + 9ADD6161CB5656C75656C75656C75656C75656C85656C85656C85656C85656C8 + 5656C85656C85656C85656C85656C85656C85656C85656C85656C85656C85656 + C85656C85656C85656C85656C85656C85656C85656C85656C85656C85656C856 + 56C85656C85656C85656C85656C85656C85656C85656C80200000200005656C8 + 5656C85656C85656C85656C85656C85656C85656C85656C85656C85656C88383 + D6FFFFFFD2D2F05555C55454C45555C55555C55555C65656C75656C85656C856 + 56C8A5A5E2FFFFFFA5A5E15555C65555C65555C65656C75656C75656C85656C8 + 5656C85656C85656C85656C85656C85656C85656C86666CD7878D37878D37878 + D37878D37878D37878D37878D37878D37878D37878D37878D37878D37878D378 + 78D37878D37878D36666CD5656C85656C85656C85656C85656C85656C85656C8 + 5656C85656C85656C85656C85656C85656C85656C85656C85656C85656C85656 + C85656C85656C85656C85656C85656C85656C85656C85656C85656C85656C856 + 56C85656C85656C85656C85656C85656C85656C85656C85656C85656C85656C8 + 5656C85656C85656C85656C85656C85656C85656C85656C85656C85656C85656 + C85656C85656C85656C85656C85656C85656C85656C85656C85656C85656C802 + 00000200005555C75555C75555C75555C75555C75555C75555C75555C75555C7 + 5555C75555C76C6CCEA4A4E19898DC5555C55454C45454C45454C45454C55555 + C65555C65555C65555C75555C75555C75555C75555C75555C75555C75555C755 + 55C75555C75555C65555C65454C55454C55454C45454C45454C55454C55A5AC8 + 7474D07777D27777D27777D27777D27777D27777D27777D27777D27777D27777 + D27777D27777D27777D27777D27474D15A5AC95555C75555C75555C75555C755 + 55C75555C75555C75555C75555C75555C75555C65555C65555C75555C75555C7 + 5555C75555C75555C75555C75555C75555C75555C75555C75555C75555C75555 + C75555C65555C65454C55454C55454C45454C45454C55454C55555C65555C655 + 55C75555C75555C75555C75555C75555C75555C75555C75555C75555C75555C7 + 5555C75555C75555C75555C75555C75555C75555C75555C75555C75555C75555 + C75555C75555C70200000200005555C75555C75555C75555C75555C75555C755 + 55C75555C75555C75555C75555C65454C55454C45353C25252BF5151BE5151BD + 5151BD5151BD5151BE5252C05353C25454C45454C55555C65555C65555C75555 + C75555C75555C75555C65454C55353C35252C15151BE5151BD5050BB5050BB51 + 51BD5151BE5252C15F5FC77474D07777D17777D17777D17676D07575CF7575CE + 7575CE7575CE7474CD7474CD7575CE7575CE7373CE5F5FC85454C55555C65555 + C65555C75555C75555C75555C75555C75555C65454C55454C45353C35353C253 + 53C25353C35454C45454C55555C65555C75555C75555C75555C75555C75555C7 + 5555C75555C65454C55353C35252C15151BE5151BD5050BB5050BB5151BD5151 + BE5252C15353C35454C55555C65555C65555C65454C55454C45353C35353C353 + 53C35353C25353C25353C35353C35353C35454C45454C55555C65555C65555C7 + 5555C75555C75555C75555C75555C70200000200005555C75555C75555C75555 + C75555C75555C75555C75555C75555C75555C65454C45252C15151BD4F4FB84D + 4DB44C4CB24B4BB04B4BB04C4CB14D4DB34E4EB64F4FB85050BB5252BF5353C2 + 5454C45555C65555C65555C65454C55353C35252BF5050BB4E4EB74C4CB24B4B + AF4A4AAC4A4AAC4B4BAF4C4CB24E4EB75050BB5959C26767C87171CD7272CD71 + 71CB6F6FC86E6EC66E6EC56D6DC36C6CC26C6CC26B6BC26363C05858BE5151BE + 5252C15353C35454C55555C65555C75555C75555C75555C65454C55353C25252 + BF5050BB4F4FB94F4FB95050BB5151BE5353C25454C45555C65555C75555C755 + 55C75555C75555C65454C55353C35252BF5050BB4E4EB74C4CB24B4BAF4A4AAC + 4A4AAC4B4BAF4C4CB24E4EB75050BB5252BF5353C25353C35353C25252C15151 + BE5050BB5050BB4F4FB94F4FB84F4FB84F4FB94F4FBA5050BB5151BE5252C153 + 53C35454C55555C65555C75555C75555C75555C75555C70200000200005555C7 + 5555C75555C75555C75555C75555C75555C75555C75555C65454C45252BF4F4F + B94C4CB24949AB4747A54646A34545A24646A34646A54747A74848A94A4AAC4B + 4BB04D4DB54F4FBA5151BE5353C25454C45454C45353C25151BD4E4EB64B4BAF + 4747A64444A042429B41419942429A43439C4545A24848A84B4BAF4E4EB65050 + BB5151BD5151BD5050BB4E4EB64C4CB14A4AAE4949AB4848A94848A94949AB4A + 4AAD4C4CB14E4EB75050BC5252C15454C45555C65555C75555C75555C75454C5 + 5353C25151BD4E4EB64B4BAF4949AC4949AC4A4AAE4D4DB35050BB5252C05454 + C45555C65555C75555C75555C65454C55353C25151BD4E4EB64B4BAF4747A644 + 44A042429B41419942429A43439C4545A24848A84B4BAF4E4EB65050BB5151BD + 5151BD5050BB4E4EB64C4CB14A4AAE4949AB4848A94848A94949AB4A4AAD4C4C + B14E4EB75050BC5252C15454C45555C65555C75555C75555C75555C75555C702 + 00000200005555C75555C75555C75555C75555C75555C75555C75555C75454C5 + 5252C04F4FB94B4BB04646A542429B4040953E3E923E3E924040954141974242 + 9A43439C44449E4545A24848A84A4AAE4D4DB55050BB5151BE5151BE5050BB4C + 4CB24848A843439C3E3E913B3B893838833737823838843B3B893E3E9042429A + 4545A24949AB4C4CB14D4DB44D4DB54C4CB24949AC4747A544449E4141994040 + 9640409641419944449E4747A54B4BAF4E4EB75151BE5353C25454C55555C755 + 55C75555C65454C45151BD4D4DB54949AA44449F41419941419943439D4747A5 + 4C4CB15050BB5353C25454C55555C75555C65454C55353C25050BB4C4CB34848 + A843439C3E3E913B3B893838833737823838843B3B893E3E9042429A4545A249 + 49AB4C4CB14D4DB44D4DB54C4CB24949AC4747A544449E414199404096404096 + 41419944449E4747A54B4BAF4E4EB75151BE5353C25454C55555C75555C75555 + C75555C75555C70200000200005555C75555C75555C75555C75555C75555C755 + 55C75555C65353C35050BC4C4CB14646A44040953B3B8B393985383884393986 + 3B3B8B3D3D8E3E3E903E3E913E3E913F3F9341419744449E4747A74B4BAF4D4D + B44D4DB44B4BAF4646A34040953A3A8734347B3131722F2F6F30307031317334 + 347B3838833C3C8D4040974444A04747A74949AC4A4AAC4848A84545A1404097 + 3C3C8C38388336367E36367E3838833C3C8C4141994747A54C4CB15050BB5353 + C25454C55555C75555C75555C65252C14F4FB84949AB43439C3C3C8C38388338 + 38823A3A894040954747A54D4DB35151BD5454C45555C65454C55353C25050BB + 4C4CB14646A44040953A3A8734347B3131722F2F6F30307031317334347B3838 + 833C3C8D4040974444A04747A74949AC4A4AAC4848A84545A14040973C3C8C38 + 388336367E36367E3838833C3C8C4141994747A54C4CB15050BB5353C25454C5 + 5555C75555C75555C75555C75555C70200000200005454C75454C75454C75454 + C75454C75454C75454C75454C65151C14D4DB74848AA41419A3A3A8A36368035 + 357E36367F3838853B3B8C3D3D913E3E923C3C8F3B3B8B3939883939883C3C8D + 3F3F9643439F4646A54646A643439E3D3D913737823030722B2B672929622A2A + 622B2B672E2E6E3232773636803A3A893D3D904141994444A04646A54646A645 + 45A341419B3C3C8E3636803131732E2E6C2E2E6C3131733636813E3E924444A2 + 4A4AB04F4FBB5252C25353C55454C75454C75353C45050BD4B4BB14444A13C3C + 8D34347B2F2F702F2F7033337839398741419B4949AC4E4EB95252C25353C552 + 52C35050BD4C4CB34646A53E3E933737823030722B2B672929622A2A622B2B67 + 2E2E6E3232773636803A3A893D3D904141994444A04646A54646A64545A34141 + 9B3C3C8E3636803131732E2E6C2E2E6C3131733636813E3E924444A24A4AB04F + 4FBB5252C25353C55454C75454C75454C75454C75454C70200000200005454C7 + 5454C75454C75454C75454C75454C75454C75353C55050BE4C4CB34646A53E3E + 9338388535357E35357E3838853C3C8E40409742429C42429B3F3F953B3B8C37 + 378335357D35357E3838853B3B8C3E3E933F3F943B3B8C35357E2F2F6F292962 + 26265B26265B2929612D2D6A31317436367F3939873C3C8E3E3E934141994343 + 9E4545A24545A44545A241419A3B3B8C34347B2D2D6A2929622929622D2D6A34 + 347B3D3D904545A34B4BB35050BD5252C35454C65454C75454C65252C24E4EB8 + 4848AA3F3F953636802E2E6C2929622929622E2E6C35357E3E3E934646A54C4C + B55050BE5252C25151BF4D4DB74747A93F3F963737822F2F7029296226265B26 + 265B2929612D2D6A31317436367F3939873C3C8E3E3E9341419943439E4545A2 + 4545A44545A241419A3B3B8C34347B2D2D6A2929622929622D2D6A34347B3D3D + 904545A34B4BB35050BD5252C35454C65454C75454C75454C75454C75454C702 + 00000200005454C75454C75454C75454C75454C75454C75454C75353C55050BD + 4B4BB14444A26A6AA78888B18787AF8888B18B8BB87878B46666B24747A94646 + A643439E3D3D9037378232327630307231317433337936368036368033337839 + 39746F6F9084849BA7A7B4A7A7B69393AB75759E3838853D3D9040409742429C + 43439E4444A14545A34646A54646A64545A441419B3B3B8C3333782B2B652727 + 5B27275B2B2B6533337A3E3E924646A54C4CB55151BF5353C55454C65454C753 + 53C55151BF4C4CB37A7AB86565A03C3C7B2A2A6226265926265B2B2B67333379 + 3C3C8D4444A24B4BB14F4FBB5151BF4F4FBB4A4AAF43439E3939873C3C797070 + 9184849BA7A7B4A7A7B69393AB75759E3838853D3D9040409742429C43439E44 + 44A14545A34646A54646A64545A441419B3B3B8C3333782B2B6527275B27275B + 2B2B6533337A3E3E924646A54C4CB55151BF5353C55454C65454C75454C75454 + C75454C75454C70200000200005454C75454C75454C75454C75454C75454C754 + 54C75353C44F4FBC8E8ECBE4E4EAECECECECECECEFEFEFF2F2F2F5F5F5F5F5F5 + F2F2F2E1E1E8A7A7D05A5AAD4040973737833030722C2C692B2B662C2C692E2E + 6C2E2E6D8181A1D4D4D7E0E0E0E0E0E0E2E2E2E3E3E3E5E5E5E5E5E5CFCFDB85 + 85BD4747A94848AB4848AB4848AC7777C0F7F7F7F3F3F3CBCBDFB9B9D1B0B0C6 + AAAABDA7A7B6B4B4BEDDDDDDE5E5E56565993F3F954747A94E4EB85252C25454 + C65454C65454C65353C44F4FBB4949ACD2D2DEDDDDDDD5D5D5BABAC175759026 + 265B2C2C693333793B3B8C43439E4949AE4D4DB74F4FBB4D4DB64747A83E3E93 + 8686ABD4D4D8E0E0E0E0E0E0E2E2E2E3E3E3E5E5E5E5E5E5CFCFDB8585BD4747 + A94848AB4848AB4848AC7777C0F7F7F7F3F3F3CBCBDFB9B9D1B0B0C6AAAABDA7 + A7B6B4B4BEDDDDDDE5E5E56565993F3F954747A94E4EB85252C25454C65454C6 + 5454C75454C75454C75454C75454C70200000200005454C75454C75454C75454 + C75454C75454C75454C75353C46767C6FDFDFDFAFAFAFAFAFAFBFBFBF1F1F7B4 + B4D99D9DD2A0A0D8C5C5E9FEFEFEF2F2F2E5E5E59393BD42428A2F2F6F292962 + 26265B26265B27275D9C9CB1E9E9E9E9E9E9EBEBEBEFEFEFF3F3F3F7F7F7F8F8 + F8F9F9F9F7F7F7F4F4F4D1D1E67979C74D4DB74D4DB65959BB7C7CC9C4C4E7FC + FCFCF2F2F2E8E8E8E0E0E0DDDDDDDEDEDEA5A5B76C6C9543438841419A4949AE + 5050BD5353C55454C75454C75454C65151C14D4DB66A6AB6EFEFEFE5E5E5DDDD + DDD7D7D7BDBDC32929602F2F7036367F3C3C8D42429D4848AB4C4CB34D4DB64A + 4AB04444A1A5A5C4E9E9E9E9E9E9EBEBEBEFEFEFF3F3F3F7F7F7F8F8F8F9F9F9 + F7F7F7F4F4F4D1D1E67979C74D4DB74D4DB65959BB7C7CC9C4C4E7FCFCFCF2F2 + F2E8E8E8E0E0E0DDDDDDDEDEDEA5A5B76C6C9543438841419A4949AE5050BD53 + 53C55454C75454C75454C75454C75454C75454C75454C70200000200005353C6 + 5353C65353C65353C65353C65353C65353C65252C4A1A1DCFFFFFFFFFFFFFFFF + FF9B9BCC5151AB4848AC4C4CB54F4FBD5252C37474CEF3F3FAF2F2F2E2E2E2B7 + B7C638387126265C2323532222519A9AAEEDEDEDEFEFEFF2F2F2F6F6F6FCFCFC + FFFFFFF2F2F6BFBFDB9C9CCF9F9FD6B8B8E3E7E7F6FEFEFEB8B8E36666C34D4D + B94D4DB94D4DB9CFCFEBFFFFFFF5F5F5EBEBEBE4E4E4B1B1C028285F2D2D6A36 + 368241419B4A4AAF4F4FBD5252C45353C65353C65252C34F4FBC4949AFB1B1D6 + F6F6F6EFEFEFE6E6E6E0E0E0DCDCDC4F4F7F3232783838863D3D9041419B4646 + A74949AE4949AF4747A9ABABCFF1F1F1F0F0F0F2F2F2F6F6F6FCFCFCFFFFFFF2 + F2F6BFBFDB9C9CCF9F9FD6B8B8E3E7E7F6FEFEFEB8B8E36666C34D4DB94D4DB9 + 4D4DB9CFCFEBFFFFFFF5F5F5EBEBEBE4E4E4B1B1C028285F2D2D6A3636824141 + 9B4A4AAF4F4FBD5252C45353C65353C65353C65353C65353C65353C65353C602 + 00000200005353C65353C65353C65353C65353C65353C65353C65252C4A2A2DD + FFFFFFFFFFFF9292CE4848AC4A4AB04C4CB64E4EBB5151C15252C35050BE7C7C + C9FEFEFEECECECDEDEDEA9A9B824245722225070708BECECECF2F2F2F7F7F7FB + FBFBFFFFFFFFFFFF8F8FB13737833F3F974646A74A4AB14C4CB54C4CB69494D3 + E7E7F5FFFFFF4C4CB54C4CB64D4DB7A0A0D7FFFFFFFFFFFFF4F4F4EAEAEA8181 + 9E28285F2D2D6B37378241419C4A4AAF4F4FBD5353C55353C65353C55151C14D + 4DB75353AEF2F2F8FDFDFDF8F8F8F0F0F09B9BB0CDCDD58F8FAF3737833C3C8E + 3E3E9541419B4444A34747A94747A98D8DC6F8F8F8F7F7F7F8F8F8FBFBFBFFFF + FFFFFFFF8F8FB13737833F3F974646A74A4AB14C4CB54C4CB69494D3E7E7F5FF + FFFF4C4CB54C4CB64D4DB7A0A0D7FFFFFFFFFFFFF4F4F4EAEAEA81819E28285F + 2D2D6B37378241419C4A4AAF4F4FBD5353C55353C65353C65353C65353C65353 + C65353C65353C60200000200005353C65353C65353C65353C65353C65353C653 + 53C65353C5B9B9E7FFFFFFD0D0ED4D4DB74C4CB64D4DB94F4FBC5050BE5151C1 + 5050BE4D4DB74747AAE6E6F1F6F6F6E8E8E8DEDEDE6D6D8A222250CFCFD6F1F1 + F1F7F7F7FBFBFBFEFEFEFFFFFF51517C2E2E6E3838853F3F974545A44848AB48 + 48AC4848AB4747A85252ADC1C1E24747A94949AE4A4AB17A7AC5FFFFFFFFFFFF + FBFBFBEFEFEF5B5B842828602D2D6B37378341419C4A4AAF4F4FBD5252C45353 + C55252C34F4FBD4B4BB28E8EC6FFFFFFFFFFFFFFFFFFF9F9F9797999A3A3BCD4 + D4DD3B3B8D3F3F9740409A41419B43439F4545A44545A5E6E6F2FEFEFEFDFDFD + FDFDFDFEFEFEFFFFFF51517C2E2E6E3838853F3F974545A44848AB4848AC4848 + AB4747A85252ADC1C1E24747A94949AE4A4AB17A7AC5FFFFFFFFFFFFFBFBFBEF + EFEF5B5B842828602D2D6B37378341419C4A4AAF4F4FBD5252C45353C55353C5 + 5353C55353C65353C65353C65353C60200000200005353C65353C65353C65353 + C65353C65353C65353C65353C5D1D1EFFFFFFF8A8AD55050BE4F4FBD5050BE50 + 50BF5050BE4F4FBC4C4CB54747AA41419BCACAE0FEFEFEF2F2F2E9E9E99898AC + 666687F1F1F1F5F5F5F9F9F9FBFBFBFBFBFB8989A226265C2E2E6D3737833E3E + 9442429E4444A24343A141419C3F3F973E3E943E3E943F3F9742429E4646A678 + 78C0FFFFFFFFFFFFFEFEFEF1F1F15B5B8428285F2D2D6A37378241419B4949AE + 4E4EBB5151C25252C35050BF4D4DB74747A9D9D9EAFFFFFFFFFFFFFFFFFFFEFE + FE454576676798F4F4F46E6EAE42429E42429E41419B41419B42429E8181BEFF + FFFFFFFFFFFFFFFFFDFDFDFBFBFB8989A326265C2E2E6D3737833E3E9442429E + 4444A24343A141419C3F3F973E3E943E3E943F3F9742429E4646A67878C0FFFF + FFFFFFFFFEFEFEF1F1F15B5B8428285F2D2D6A37378241419B4949AE4E4EBB51 + 51C25252C35252C35252C45252C45353C55353C65353C60200000200005353C6 + 5353C65353C65353C65353C65353C65353C65353C6D1D1F0FFFFFF5252C45252 + C35151C15151C15050BE4E4EBA4B4BB24646A7404099393988E4E4EDFFFFFFFA + FAFAF3F3F3BBBBC98888A6F8F8F8F9F9F9F9F9F9F7F7F7E4E4E823235526265B + 2D2D6B35357F3B3B8D3F3F963F3F973E3E943A3A8B36368234347C34347B3636 + 803A3A8B3F3F977575B9FFFFFFFFFFFFFBFBFBEEEEEE5A5A8127275C2C2C6835 + 357F4040984747AA4C4CB64F4FBD4F4FBC4C4CB64949AE6868B1FFFFFFFFFFFF + FFFFFFFFFFFFD3D3DE2B2B6735357EE2E2EDADADD24545A54444A241419B3F3F + 963F3F979999C8FFFFFFFFFFFFFFFFFFF8F8F8E4E4E824245526265B2D2D6B35 + 357F3B3B8D3F3F963F3F973E3E943A3A8B36368234347C34347B3636803A3A8B + 3F3F977575B9FFFFFFFFFFFFFBFBFBEEEEEE5A5A8127275C2C2C6835357F4040 + 984747AA4C4CB64F4FBD4F4FBD5050BE5050C05151C15252C35353C55353C602 + 00000200005353C65353C65353C65353C65353C65353C65353C65353C69898DD + A3A3E15353C55252C45151C25050BE4D4DB74949AF4444A23E3E943737846767 + 99FFFFFFFFFFFFFFFFFFFEFEFEC5C5D5C8C8D9FFFFFFFEFEFEF9F9F9F3F3F39D + 9DB225255927275D2D2D6B35357E3B3B8D3E3E953E3E953C3C8E373782313174 + 2D2D6B2C2C6A2F2F6F34347B3B3B8C7272B3FFFFFFFFFFFFFAFAFAECECEC5858 + 7F26265A2A2A6533337B3D3D924444A24949AD4B4BB24949AF4747A843439FB1 + B1D3FFFFFFFFFFFFFEFEFEFEFEFE8B8BA82E2E6D3838869A9ACAECECF35252AE + 4545A44040993C3C903B3B8DCBCBE1FFFFFFFFFFFFFFFFFFF5F5F59E9EB42525 + 5927275D2D2D6B35357E3B3B8D3E3E953E3E953C3C8E3737823131742D2D6B2C + 2C6A2F2F6F34347B3B3B8C7272B3FFFFFFFFFFFFFAFAFAECECEC58587F26265A + 2A2A6533337B3D3D924444A24949AD4B4BB34B4BB34C4CB44D4DB74F4FBC5151 + C15252C45353C60200000200005252C65252C65252C65252C65252C65252C652 + 52C65252C65252C65252C65252C55151C34F4FBE4C4CB64747AC42429F3B3B90 + 35357F2E2E70D3D3DFFFFFFFFFFFFFFFFFFFFFFFFF9191B5C9C9DEFFFFFFFFFF + FFFBFBFBF2F2F28484A42828612929632E2E6E35357F3B3B8E3E3E963E3E953A + 3A8D34347D2D2D6C28286127275F2A2A653030733737846F6FAEFFFFFFFFFFFF + F8F8F8EAEAEA57577D24245728286131317639398A3F3F974242A04343A24141 + 9E3E3E96474795F2F2F6FFFFFFFEFEFEFBFBFBFBFBFB4444722F2F713A3A8B5B + 5BADFDFDFD9898CE4444A33E3E95393989373784CACADEFFFFFFFFFFFFFFFFFF + F2F2F28383A32828602929632E2E6E35357F3B3B8E3E3E963E3E953A3A8D3434 + 7D2D2D6C28286127275F2A2A653030733737846F6FAEFFFFFFFFFFFFF8F8F8EA + EAEA57577D24245728286131317639398A3F3F974242A04444A34444A34444A5 + 4747AC4B4BB44D4DBB5050C15252C50200000200005252C65252C65252C65252 + C65252C65252C65252C65252C65252C65252C55151C34F4FBE4C4CB64747AB41 + 419C3A3A8C33337B2D2D6CA3A3B9FBFBFBFFFFFFFFFFFFFFFFFFFFFFFF60609E + CCCCE3FFFFFFFFFFFFFEFEFEF1F1F16161942D2D6D2C2C6B3030733535813B3B + 8E3D3D943D3D933939893232782B2B6727275D26265C2929632F2F723636836F + 6FABFFFFFFFFFFFFF7F7F7E8E8E856567B2424562828602F2F713636823A3A8D + 3C3C913C3C9139398A3636828585B0FFFFFFFFFFFFFCFCFCF8F8F8CECED82929 + 633232783C3C904444A5CECEE9E0E0ED4343A23D3D9437378434347DC9C9DCFF + FFFFFFFFFFFFFFFFF1F1F16060902C2C6A2C2C6A3030733535813B3B8E3D3D94 + 3D3D933939893232782B2B6727275D26265C2929632F2F723636836F6FABFFFF + FFFFFFFFF7F7F7E8E8E856567B2424562828602F2F713636823A3A8D3C3C913D + 3D933C3C923E3E9642429F4747AB4B4BB64F4FBE5151C40200000200005252C6 + 5252C65252C65252C65252C65252C65252C65252C65252C65151C44F4FBF4C4C + B74747AC40409B3939893232783838719F9FB5F5F5F5FCFCFCFFFFFFFFFFFFFF + FFFFCACAE03F3F999C9CD0FFFFFFFFFFFFFFFFFFF5F5F5C6C6D5B6B6C9B9B9CC + E3E3E8F4F4F4F4F4F4EFEFEFE6E6E6DDDDDDD4D4D4BBBBC3A4A4B3ABABBA2C2C + 6A3232793838886F6FAEFFFFFFFFFFFFF5F5F5E6E6E657577E26265B2929632F + 2F7234347E37378437378636368333337B303074D5D5E2FFFFFFFEFEFEF9F9F9 + F4F4F48787A52D2D6D3535813E3E974545A89292CFF8F8F88888C13D3D943737 + 8433337B9292B9FFFFFFFFFFFFFFFFFFF5F5F5C5C5D3B6B6C9B9B9CCE3E3E8F4 + F4F4F4F4F4EFEFEFE6E6E6DDDDDDD4D4D4BBBBC3A4A4B3ABABBA2C2C6A323279 + 3838886F6FAEFFFFFFFFFFFFF5F5F5E6E6E657577E26265B2929632F2F723434 + 7E3737843838863737863737843939893E3E954444A44949B14E4EBC5151C302 + 00000200005252C65252C65252C65252C65252C65252C65252C65252C65252C5 + 5050C14D4DBA4848AF41419E3A3A8B323278515181C4C4CFF2F2F2FAFAFAFFFF + FFFFFFFFFFFFFFF2F2F75A5AA94646A98787CDFFFFFFFFFFFFFFFFFFFDFDFDCD + CDDF9A9AC08F8FB99393BD9696C29898C5B1B1D5EAEAEFECECECE2E2E2DBDBDB + D8D8D8C6C6CF33337B3838863C3C917171B1FFFFFFFFFFFFF4F4F4E5E5E55959 + 852A2A662D2D6D32327835358036368235358033337B30307456568AFCFCFCFE + FEFEFBFBFBF5F5F5EFEFEF3A3A7632327939398A40409B4646AA5555B5F9F9F9 + D8D8E53E3E9638388735357F7878AAFFFFFFFFFFFFFFFFFFFCFCFCCCCCDC9999 + BE8F8FB89393BD9696C29898C5B1B1D5EAEAEFECECECE2E2E2DBDBDBD8D8D8C6 + C6CF33337B3838863C3C917171B1FFFFFFFFFFFFF4F4F4E5E5E55959852A2A66 + 2D2D6D32327835358036368235358134347F34347D3636823B3B904242A04848 + AF4D4DBA5151C30200000200005252C65252C65252C65252C65252C65252C652 + 52C65252C65151C44F4FBE4B4BB44444A53C3C9033337B77779CDEDEE1F1F1F1 + F9F9F9FFFFFFFFFFFFFFFFFFF2F2F86868B24747AC4B4BB54D4DBBE8E8F6FFFF + FFFFFFFFFFFFFF9898CC41419E3E3E963D3D933D3D943E3E973E3E97CBCBE2F8 + F8F8F0F0F0E9E9E9E4E4E4A0A0BF3B3B8D3E3E9741419E9A9ACBFFFFFFFFFFFF + F6F6F6E8E8E85F5F9232327834347D38388639398A8888B37C7CAB35357F3232 + 78A9A9C4FEFEFEFFFFFFFCFCFCF5F5F5B0B0C835358139398A3E3E974444A448 + 48AE4A4AB3CECEE9F3F3F39292C43C3C923A3A8B39398AE5E5F0FFFFFFFFFFFF + FFFFFF9696C73F3F993D3D943D3D933D3D943E3E973E3E97CBCBE2F8F8F8F0F0 + F0E9E9E9E4E4E4A0A0BF3B3B8D3E3E9741419E9A9ACBFFFFFFFFFFFFF6F6F6E8 + E8E85F5F9232327834347D38388639398A8787B27A7AA936368235357F373784 + 3C3C904242A04848AF4D4DBA5151C30200000200005252C65252C65252C65252 + C65252C65252C65252C65252C65151C34D4DBB4848AE40409B43438BABABC1EC + ECECF2F2F2FAFAFAFFFFFFFFFFFFFFFFFFF2F2F86969B54848AD4B4BB54D4DBA + 4E4EBC8A8AD4FFFFFFFFFFFFFFFFFFC3C3E64747AC4545A64343A242429F4141 + 9E41419DF2F2F8FFFFFFFFFFFFF8F8F8F2F2F27B7BB74242A04545A74747AC9C + 9CD2FFFFFFFFFFFFFEFEFEF0F0F0C5C5D54646933C3C913E3E973F3F999898C1 + D0D0DC3B3B8D515195FFFFFFFFFFFFFFFFFFFFFFFFFAFAFA8585BA3F3F984141 + 9E4545A64848AE4B4BB64D4DB9CFCFECFBFBFBF5F5F56767B341419E41419C81 + 81BFFFFFFFFFFFFFFFFFFFC1C1E34646A94444A54343A242429F41419E41419D + F2F2F8FFFFFFFFFFFFF8F8F8F2F2F27B7BB74242A04545A74747AC9C9CD2FFFF + FFFFFFFFFEFEFEF0F0F0C5C5D54646933C3C913E3E973F3F999595BEC8C8D33B + 3B8F3A3A8D3B3B9040409A4545A74A4AB34E4EBD5151C30200000200005151C5 + 5151C55151C55151C55151C55151C55151C55151C54F4FC04B4BB64545A86060 + A5C8C8D6EFEFEFF5F5F5FBFBFBFFFFFFFFFFFFFFFFFFD8D8EA5D5DB24848AF4A + 4AB54B4BB74C4CB84C4CB84D4DBAB8B8E5FFFFFFFFFFFFFFFFFF6363C04949B2 + 4747AE4646AB4646A97777BEFFFFFFFFFFFFFFFFFFFFFFFFCDCDE74646AA4848 + AF4A4AB44A4AB5DBDBF0FFFFFFFFFFFFFFFFFFFEFEFED1D1E4E7E7EE8989C35C + 5CB17E7EC0E6E6EDF2F2F29696C8D9D9EBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + 6969B74646AA4747AD4949B24B4BB64D4DBB4D4DBCDBDBF1FFFFFFFFFFFFF2F2 + F96C6CBD4646AB4747ADB6B6DFFFFFFFFFFFFFFFFFFF6262BF4949B24747AE46 + 46AB4646A97777BEFFFFFFFFFFFFFFFFFFFFFFFFCDCDE74646AA4848AF4A4AB4 + 4A4AB5DBDBF0FFFFFFFFFFFFFFFFFFFEFEFED1D1E4E7E7EE8989C35C5CB17D7D + BFDEDEE5E4E4E48181BA40409D4242A04444A64848AF4C4CB84E4EBF5050C302 + 00000200005151C55151C55151C55151C55151C55151C55151C55151C44F4FC0 + 4A4AB46767B4E6E6EBF3F3F3F7F7F7FEFEFEFFFFFFFFFFFFFFFFFFA4A4CE5151 + AD4A4AB34B4BB74B4BB74A4AB54949B24848B04A4AB34C4CB8ACACE0FFFFFFFF + FFFFDCDCF25959C04C4CB94B4BB65656B9DBDBF0FFFFFFFFFFFFFFFFFFF3F3FA + 5656B96363C1A0A0DAA0A0DBC4C4E8FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5252 + AFCECEE9FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFC3C3E79E9ED74C4CB94D4DBB4E4EBD7E7ED1C4C4EAFFFFFF + FFFFFFFFFFFFFFFFFFF3F3FAABABDE4C4CB94D4DBBACACE0FFFFFFFFFFFFDCDC + F25959C04C4CB94B4BB65656B9DBDBF0FFFFFFFFFFFFFFFFFFF3F3FA5656B963 + 63C1A0A0DBA1A1DCC4C4E9FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5555B7CECEEA + FFFFFFFFFFFFFEFEFEF9F9F9F1F1F1E1E1E85252B14848AF4949B24C4CB94E4E + BD4F4FC15151C40200000200005151C55151C55151C55151C55151C55151C551 + 51C55151C44E4EBF5656B9E1E1EDF8F8F8FBFBFBFEFEFEFFFFFFFFFFFFF1F1F6 + 7B7BB24242A14949B14C4CB94C4CB94A4AB44747AE4545A84444A54646AA4949 + B24C4CB97D7DD0DCDCF3FFFFFFE8E8F7ADADE2A1A1DCE7E7F6FFFFFFFFFFFFFF + FFFFC4C4E85959C04E4EBD7171CAD0D0EDD0D0EDDBDBF1FFFFFFFFFFFFFFFFFF + FFFFFFFFFFFF4646AA4747AC9D9DD4FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFD0D0EDD0D0EDD0D0EDD0D0EED0D0EED0D0EED0D0EE5050C25050C25050C396 + 96DBD0D0EFD0D0EFD0D0EFD0D0EFD0D0EFD0D0EFD0D0EE5050C25050C25050C3 + 7F7FD3DCDCF3FFFFFFE8E8F7ADADE2A1A1DCE7E7F6FFFFFFFFFFFFFFFFFFC4C4 + E85A5AC14E4EBE7272CDD0D0EFD0D0EFDCDCF3FFFFFFFFFFFFFFFFFFFFFFFFFF + FFFF4E4EBD4E4EBDA1A1DCFFFFFFFFFFFFFFFFFFFFFFFFFAFAFA9B9BD64D4DBB + 4E4EBD4F4FC05050C25050C35151C40200000200005151C55151C55151C55151 + C55151C55151C55151C55151C44F4FC09E9ED7FFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFD5D5E14D4D8B3B3B904343A44949B24B4BB74949B24646AB4343A240409B + 3F3F9A4242A14747AC4A4AB54E4EBE5151C47474D1A2A2E0C5C5EBD1D1EFD0D0 + EFC5C5EBA2A2DE6767CA5050C24F4FC14F4FC04E4EBD4C4CB94A4AB44848AF46 + 46AB5050AC7575BC9B9BCED9D9EC4343A44444A64646AB6060BAB7B7E2F3F3FA + F3F3FBA1A1DE5050C25050C25050C35151C45151C45151C55151C55151C55151 + C55151C55151C55151C55151C55151C55151C55151C55151C55151C55151C551 + 51C55151C55151C55151C55151C57474D1A2A2E0C5C5EBD1D1EFD0D0EFC5C5EB + A2A2DE6767CA5050C25050C35151C45151C45151C55151C55151C55151C55D5D + C97F7FD4A2A2E0DCDCF35151C45151C45151C46868CCB9B9E7F3F3FBF3F3FBA2 + A2DF5050C25050C25050C35151C45151C45151C55151C50200000200005151C5 + 5151C55151C55151C55151C55151C55151C55151C54F4FC0F3F3FAFFFFFFFFFF + FFFFFFFFFFFFFFAAAAC32C2C6C33337C3B3B8F41419F4646AB4848AF4545A841 + 419F3E3E963B3B903B3B9040409B4545A74A4AB34E4EBD5151C45151C55151C5 + 5151C55151C55151C55151C55151C55151C45050C34F4FC04D4DBB4A4AB44747 + AD4444A641419F3F3F9A3E3E973E3E963E3E963E3E963E3E973F3F9941419E44 + 44A54747AD4B4BB64E4EBD5050C25151C45151C55151C55151C55151C55151C5 + 5151C55151C55151C55151C55151C55151C55151C55151C55151C55151C55151 + C55151C55151C55151C55151C55151C55151C55151C55151C55151C55151C551 + 51C55151C55151C55151C55151C55151C55151C55151C55151C55151C55151C5 + 5151C55151C55151C55151C55151C55151C55151C55151C55151C55151C55151 + C55151C55151C55151C55151C55151C55151C55151C55151C55151C55151C502 + 00000200005151C55151C55151C55151C55151C55151C55151C55151C57373CE + FFFFFFFFFFFFFFFFFFFFFFFFD4D4E33D3D7B2F2F7233337D3A3A8D3F3F9A4343 + A34444A541419E6C6CAD52529A38388839398B3E3E974444A64949B24E4EBD50 + 50C35151C45151C45050C35050C35151C45151C45050C34F4FC14E4EBD4C4CB8 + 4848AF4444A640409D3D3D943A3A8D39398A38388839398A39398A39398B3939 + 8B39398C3B3B8F3E3E964242A04747AC4B4BB64E4EBF5050C35151C55151C551 + 51C55151C55151C55151C55151C55151C55151C55151C55151C55151C55151C5 + 5151C55151C55151C55151C55151C55151C55151C55151C55151C55151C55151 + C55151C55151C55151C55151C55151C55151C55151C55151C55151C55151C551 + 51C55151C55151C55151C55151C55151C55151C55151C55151C55151C55151C5 + 5151C55151C55151C55151C55151C55151C55151C55151C55151C55151C55151 + C55151C55151C50200000200005050C55050C55050C55050C55050C55050C550 + 50C55050C57E7ED3FFFFFFFFFFFFFFFFFFFDFDFD7676AC33337E32327C343481 + 38388A3C3C943F3F9B3F3F9B5555A2E9E9E97D7DAE37378639398C3E3E994444 + A84949B44D4DBD4F4FC24F4FC24E4EC04E4EC04D4DBF4E4EC04E4EC04D4DBE4C + 4CBB4949B54646AC4242A13D3D9639398C35358334347F34347F353583373788 + 38388A38388B37378836368636368638388B3D3D964343A44848B24D4DBD4F4F + C25050C55050C55050C55050C55050C55050C55050C55050C55050C55050C550 + 50C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050C5 + 5050C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050 + C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050C550 + 50C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050C5 + 5050C55050C55050C55050C55050C50200000200005050C55050C55050C55050 + C55050C55050C55050C55050C57F7FD4FFFFFFFFFFFFFFFFFFFBFBFB3E3E9839 + 398D37378837378839398C3B3B913C3C943D3D958282B6E9E9E96666A338388B + 3B3B9141419F4646AC4A4AB74D4DBE4E4EC04D4DBF4C4CBB4B4BB94A4AB64A4A + B64A4AB64949B44747AF4444A840409D3B3B9137378733337F32327B32327B34 + 34803737873A3A8F3C3C943C3C9339398D3737883535833737863B3B9141419F + 4747AE4C4CBA4F4FC25050C55050C55050C55050C55050C55050C55050C55050 + C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050C550 + 50C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050C5 + 5050C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050 + C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050C550 + 50C55050C55050C55050C55050C55050C55050C55050C50200000200005050C5 + 5050C55050C55050C55050C55050C55050C55050C55050C5F3F3FBFFFFFFFFFF + FFFFFFFF4F4FAD41419F3E3E983D3D963D3D963D3D973E3E983E3E98C1C1D9EC + ECEC6A6AAB3D3D9740409E4444A84848B24C4CBB4E4EC04E4EC04C4CBB4A4AB6 + 4848B14646AD4646AD4646AC4444A84343A43F3F9B3B3B9137378633337F3232 + 7A3E3E8263639B8A8AB58C8CBA8D8DBE7777B640409D3D3D963A3A8E37378738 + 38893B3B9141419F4646AD4B4BB94F4FC25050C55050C55050C55050C55050C5 + 5050C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050 + C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050C550 + 50C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050C5 + 5050C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050 + C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050C502 + 00000200005050C55050C55050C55050C55050C55050C55050C55050C55050C5 + A2A2E0FFFFFFFFFFFFFFFFFF9A9AD34646AD4444A74242A34242A14242A14242 + A17F7FBFF7F7F7F2F2F27070B74343A64545AB4848B24B4BB94D4DBF4E4EC04D + 4DBD4B4BB94848B24545AB4343A54343A44242A140409E3E3E983B3B90373787 + 3434807B7BA6B8B8CBEBEBEBEFEFEFF3F3F3F4F4F4F1F1F1EBEBEBD9D9E08080 + B93E3E983B3B913B3B913E3E984343A44848B04C4CBB4F4FC25050C55050C550 + 50C55050C55050C55050C45050C45050C44F4FC34F4FC34F4FC34F4FC34F4FC3 + 5050C45050C45050C55050C55050C55050C55050C55050C55050C55050C55050 + C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050C550 + 50C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050C5 + 5050C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050 + C55050C55050C50200000200005050C55050C55050C55050C55050C55050C550 + 50C55050C55050C55C5CC8DCDCF3FFFFFFFFFFFFFFFFFF9999D14646AC4444A8 + 4343A64343A58E8EC9F3F3F9FFFFFFFBFBFB7676C14848B24A4AB64C4CBB4D4D + BF4F4FC24E4EC14D4DBD4A4AB64747AF4343A641419F3F3F9B3D3D973B3B9239 + 398D36368665659DD4D4DEF0F0F0F4F4F4F9F9F9FFFFFFB3B3DA7777C38686CE + DADAF0F3F3F3E9E9E97878BA41419F40409E4242A14444A84848B24B4BB94D4D + BE4E4EC04E4EC04E4EC04E4EC04E4EC04D4DBF4D4DBD4D4DBD4C4CBC4C4CBB4C + 4CBB4C4CBC4D4DBD4D4DBF4E4EC14F4FC35050C45050C55050C55050C55050C5 + 5050C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050 + C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050C550 + 50C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050C5 + 5050C55050C55050C55050C55050C50200000200005050C55050C55050C55050 + C55050C55050C55050C55050C55050C55050C44F4FC2A0A0DCFFFFFFFFFFFFFF + FFFFF2F2F8CBCBE6CDCDE7F2F2F9FFFFFFFFFFFFFFFFFFFFFFFF7979C74A4AB7 + 4C4CBB4E4EC04F4FC24F4FC34F4FC34D4DBE4B4BB84747AF4343A53F3F9C3D3D + 953A3A8E37378842428AA6A6C4F5F5F5F9F9F9FDFDFDFFFFFFD8D8E95959AA44 + 44A84848B24B4BB95858C0FFFFFFF6F6F6E3E3EA4545AB4444A84444A84646AC + 4747AF4848B24949B54A4AB64A4AB64A4AB64A4AB64949B44949B44848B24848 + B24848B04747AF4747AF4747AF4848B24A4AB64B4BB94D4DBE4E4EC15050C450 + 50C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050C5 + 5050C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050 + C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050C550 + 50C55050C55050C55050C55050C55050C55050C55050C50200000200005050C4 + 5050C45050C45050C45050C45050C45050C45050C45050C34F4FC14D4DBC4A4A + B65454B48F8FCBA7A7D4CCCCE5CCCCE5CCCCE5C0C0DF9A9ACD9B9BCE8F8FCA77 + 77C15454B44A4AB54C4CBA4E4EBF4F4FC15050C34F4FC24E4EBF8383CB4848B1 + 4444A63F3F9B3C3C9338388A5C5C9ADEDEE8FCFCFCFFFFFFFFFFFFFFFFFF9595 + C13C3C933F3F9A4343A34646AB4848B14A4AB5FFFFFFFFFFFFFAFAFA7777C448 + 48AF4646AC4545AA4545A84444A84444A74444A64343A54343A54343A54343A5 + 4444A64343A54343A54343A44242A24242A14242A14343A44545A84747AE4A4A + B64D4DBC4F4FC15050C35050C45050C45050C45050C45050C45050C45050C450 + 50C45050C45050C45050C45050C45050C45050C45050C45050C45050C45050C4 + 5050C45050C45050C45050C45050C45050C45050C45050C45050C45050C45050 + C45050C45050C45050C45050C45050C45050C45050C45050C45050C45050C402 + 00000200004F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44E4EC2 + 4C4CBD4949B64646AD4141A23E3E993B3B933A3A903A3A903B3B933C3C953D3D + 973E3E9A3F3F9C4040A04343A54545AB4848B24A4AB84D4DBE4E4EC14E4EC1AA + AADFBCBCE14747AF4242A43D3D9839398D8282B1EBEBF0FCFCFCFFFFFFFFFFFF + C9C9DD5E5E9D37378A39398E3B3B933D3D9740409E4242A45E5EB6FFFFFFFFFF + FFCFCFEC6D6DC54848B34646AE4343A74040A03E3E9A3C3C953B3B923B3B913B + 3B923B3B933C3C953D3D973E3E993E3E9A3D3D983C3C963B3B943B3B933C3C95 + 3E3E9A4242A34646AE4A4AB74D4DBE4E4EC24F4FC44F4FC44F4FC44F4FC44F4F + C44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F + 4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC4 + 4F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4F + C44F4FC44F4FC40200000200004F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F + 4FC44F4FC34D4DC04B4BB94646AE4141A13B3B93373789353583343482353584 + 37378938388C39398E3A3A8F3A3A8F3A3A913C3C953F3F9C4343A54646AE4A4A + B74C4CBC7C7CD0FFFFFFFCFCFC9898CE40409E52529EB3B3CEF6F6F6FBFBFBFE + FEFEC8C8DB6969A034348236368537378737378737378737378939398D3B3B93 + 9999CACDCDE77777C44949B54949B64848B34545AB4040A03C3C943737893333 + 8031317A31317931317933337E35358337378A39398D3A3A913A3A9139398E38 + 388A37378837378939398D3D3D974242A44747B04B4BBA4E4EC14F4FC34F4FC4 + 4F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4F + C44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F + 4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC4 + 4F4FC44F4FC44F4FC44F4FC44F4FC40200000200004F4FC44F4FC44F4FC44F4F + C44F4FC44F4FC44F4FC44F4FC34D4DBE4949B54444A83D3D9737378833337E32 + 327C32327D35358338388A3A3A8F3A3A9039398D37378936368636368638388B + 3C3C954141A14545AC4949B54A4AB89292D3E6E6F4FFFFFFFBFBFBF8F8F8F9F9 + F9E0E0E9ABABC768689D33337F36368538388A39398D38388C37378735358333 + 337E33337E3434814444923C3C954141A24545AC4848B24747B14444AA3F3F9C + 39398D32327D2D2D6F2A2A672929652A2A682D2D6F31317A36368539398D3B3B + 933C3C943B3B9238388C3737873636853737873A3A8F3F3F9C4444AA4949B54D + 4DBF4F4FC34F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC4 + 4F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4F + C44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F + 4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC40200000200004F4FC4 + 4F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44E4EC24C4CBC4747B14141A23A3A + 9135358332327C32327C35358338388C3C3C953E3E9A3E3E993B3B9338388A34 + 348132327B32327C3535843B3B914040A04545AB4646AE4545AB4040A05555A0 + 6B6BA467679B3C3C7B2E2E7330307834348038388A3B3B933D3D983E3E9A3D3D + 973A3A9036368732327D3030762F2F743131793535833B3B9140409F4444AA46 + 46AE4444A93F3F9D38388C30307829296625255B24245825255D2A2A69313179 + 3737893C3C943F3F9C40409F3F3F9D3C3C963A3A8F38388A37378939398D3E3E + 994343A74848B34C4CBC4E4EC24F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F + 4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC4 + 4F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4F + C44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC402 + 00000200004F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44E4EC24B4BBA + 4646AE40409F6868A68787B08686AF8888B28C8CB87777B36363B04343A74242 + A43F3F9B39398E3434802F2F742D2D702F2F763434823A3A9140409E4141A13F + 3F9C3A3A8F3333802E2E732B2B6B3939756565979191B99393C09696C69595C9 + 7171B94E4EAA4242A33F3F9B3A3A903434822F2F752C2C6D2B2B6C2E2E733333 + 803A3A9040409F4444A84444A840409E39398D30307727276222225521215123 + 235850508063639A7676AE9191C39191C79090C78D8DC36060AE3E3E9A3B3B94 + 3A3A903A3A913E3E9A4343A64848B24C4CBC4E4EC24F4FC44F4FC44F4FC44F4F + C44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F + 4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC4 + 4F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4F + C44F4FC44F4FC40200000200004F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F + 4FC44E4EC14B4BB98B8BCAE3E3EAECECECECECECEFEFEFF2F2F2F5F5F5F5F5F5 + F2F2F2E1E1E8A5A5CE5757AC3C3C943434812D2D702A2A682A2A692F2F743535 + 833A3A8F3B3B9138388A32327D2D2D6F7C7CA0C1C1D1FBFBFBFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFF8F8F8EFEFEFC6C6DB8181BD3F3F9C38388C32327B2B2B6C + 2828642929652D2D6F6969A2FFFFFFF8F8F8D7D7E4B8B8D1AFAFC6A9A9BCA5A5 + B5B3B3BDDDDDDDE6E6E6EFEFEFF7F7F7FCFCFCFEFEFEFBFBFBF5F5F5EEEEEEE6 + E6E68D8DC34141A13E3E9A3E3E9940409E4444A94848B34C4CBC4E4EC24F4FC4 + 4F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4F + C44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F + 4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC4 + 4F4FC44F4FC44F4FC44F4FC44F4FC40200000200004E4EC44E4EC44E4EC44E4E + C44E4EC44E4EC44E4EC44D4DC16262C3FDFDFDFAFAFAFAFAFAFBFBFBF1F1F7B2 + B2D89B9BD19D9DD6C3C3E9FEFEFEF2F2F2E5E5E59191BC3F3F882B2B6D272762 + 2727612A2A692E2E753333803434823030796F6F9BDADAE1F9F9F9FEFEFEFFFF + FFFFFFFFD8D8EAA7A7D69D9DD6B7B7E3F3F3FBFFFFFFF7F7F7E9E9E9C8C8D56F + 6FAD3535852D2D7127276225255D272762494984A1A1C6D8D8EBFEFEFEF3F3F3 + E7E7E7E0E0E0DEDEDEE0E0E0E9E9E9D8D8E0B8B8CE9494C19999CD9C9CD5ABAB + E0E7E7F7FFFFFFF6F6F6E1E1E84545AE4343A84141A44242A74545AE4848B54B + 4BBC4D4DC24E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC4 + 4E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4E + C44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E + 4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC40200000200004E4EC4 + 4E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44D4DC29E9EDBFFFFFFFFFFFFFFFF + FF9999CB4E4EA94444AA4747B34B4BBC4D4DC17070CDF3F3FAF2F2F2E2E2E2B6 + B6C635357025255D24245B2626602B2B6B2E2E742E2E739393B1F0F0F0F4F4F4 + F9F9F9FFFFFFD6D6E56F6FAE4242A54747B34B4BBC4D4DC14E4EC3A1A1DFFFFF + FFFCFCFCEBEBEBDBDBDB9494B730307928286423235923235928286530307939 + 398ECCCCE5FFFFFFF5F5F5ECECECE8E8E8E8E8E89D9DB125255E2E2E7339398E + 4141A44848B54C4CBF4E4EC4A1A1DFFFFFFFF9F9F97575C74747B34646AF4646 + B04848B54A4ABA4C4CBF4D4DC24E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E + 4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC4 + 4E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4E + C44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC402 + 00000200004E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44D4DC29F9FDC + FFFFFFFFFFFF8F8FCD4444AA4545AE4848B44A4AB94C4CBF4D4DC14B4BBC7878 + C7FEFEFEECECECDDDDDDA6A6B623235923235724245B2828652B2B6B9F9FB7EF + EFEFF1F1F1F5F5F5FBFBFBABABC53636873E3E9D4545AE4A4ABB4D4DC14E4EC3 + 4E4EC44E4EC49595DBFFFFFFFEFEFEE9E9E9D9D9D99191B02A2A692323582222 + 5524245B2B2B6D3434839696C6FFFFFFFFFFFFF6F6F6EFEFEFECECEC30306026 + 265F2E2E733939904242A54848B54C4CC04E4EC44E4EC4C4C4EBFFFFFF9D9DD9 + 4A4ABA4949B84949B84A4ABB4C4CBE4D4DC14E4EC34E4EC44E4EC44E4EC44E4E + C44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E + 4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC4 + 4E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4E + C44E4EC44E4EC40200000200004E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E + 4EC44E4EC3B7B7E6FFFFFFCECEEC4848B54848B54949B74A4ABA4B4BBC4C4CBF + 4B4BBC4848B54343A8E5E5F1F5F5F5E5E5E5D9D9D96A6A8822225624245B2727 + 629E9EB7F0F0F0F2F2F2F5F5F5F9F9F9A8A8C03030783A3A914242A54848B54C + 4CBF4E4EC34E4EC44E4EC44E4EC44E4EC4A1A1DFFFFFFFFBFBFBE6E6E6D6D6D6 + 8383A224245A20205122225528286431317A6D6DABFFFFFFFFFFFFFEFEFEF5F5 + F5B8B8C622225626265F2E2E743939904242A54848B54C4CC04E4EC44E4EC45A + 5AC7F3F3FBD0D0EE4C4CBF4C4CBF4C4CBE4C4CBF4D4DC14D4DC24E4EC34E4EC4 + 4E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4E + C44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E + 4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC4 + 4E4EC44E4EC44E4EC44E4EC44E4EC40200000200004E4EC44E4EC44E4EC44E4E + C44E4EC44E4EC44E4EC44E4EC3D0D0EFFFFFFF8888D44B4BBC4B4BBC4B4BBC4B + 4BBD4B4BBC4A4ABA4747B34343A83D3D99C9C9DFFBFBFBECECECE0E0E09090A5 + 23235826265F696992F0F0F0F4F4F4F6F6F6F8F8F8DEDEE53737703333803D3D + 984545AC4A4ABA4D4DC24E4EC44E4EC44E4EC44E4EC44E4EC44E4EC4E7E7F6FF + FFFFF4F4F4E0E0E0D3D3D352527A20205020205125255E2E2E736C6CA7FFFFFF + FFFFFFFFFFFFF5F5F5B6B6C522225626265F2E2E743939904242A54848B54C4C + C04E4EC44E4EC44E4EC4B8B8E7FFFFFF4D4DC24D4DC24D4DC24D4DC24E4EC34E + 4EC34E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC4 + 4E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4E + C44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E + 4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC40200000200004E4EC3 + 4E4EC34E4EC34E4EC34E4EC34E4EC34E4EC34E4EC3D0D0EFFFFFFF4D4DC14D4D + C04C4CBE4C4CBE4B4BBB4949B74646AF4242A43C3C97363686E3E3ECFDFDFDF2 + F2F2E9E9E9B0B0BE26265F36366FE3E3E7F4F4F4F7F7F7F8F8F8F8F8F8797999 + 2B2B6A3535853F3F9D4646AF4B4BBB4E4EC24E4EC34E4EC34E4EC34E4EC34E4E + C34E4EC3A0A0DDFFFFFFFFFFFFECECECDADADAAFAFBA2020501F1F4E2323592B + 2B6D6969A2FFFFFFFFFFFFFFFFFFF2F2F2B3B3C122225626265F2E2E7339398F + 4242A44848B44C4CBF4E4EC34E4EC34E4EC35A5AC77D7DD34E4EC34E4EC35858 + C69999DC8383D55656C64E4EC34E4EC34E4EC34E4EC34E4EC34E4EC35F5FC97A + 7AD26565CB4E4EC34E4EC34E4EC34E4EC34E4EC34E4EC34E4EC34E4EC34E4EC3 + 4E4EC34E4EC34E4EC34E4EC34E4EC34E4EC34E4EC34E4EC34E4EC34E4EC34E4E + C34E4EC34E4EC34E4EC34E4EC34E4EC34E4EC34E4EC34E4EC34E4EC34E4EC302 + 00000200004D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC39494DB + A0A0DF4D4DC24C4CC14B4BBF4A4ABB4747B44444AC3F3FA03A3A923333826565 + 98FFFFFFFEFEFEF8F8F8F2F2F2B8B8C82A2A6A8989AEF6F6F6F8F8F8F8F8F8F7 + F7F7D8D8DF2323592B2B6D3636893F3FA14646B24B4BBE4D4DC34D4DC34D4DC3 + 4D4DC34D4DC34D4DC34D4DC36464C8FFFFFFFFFFFFF6F6F6E3E3E3D5D5D55050 + 741E1E4D2222562929696969A0FFFFFFFFFFFFFEFEFEEFEFEFB0B0BE22225625 + 255F2E2E7338388F4141A44747B44B4BBF4D4DC34D4DC34D4DC34D4DC34D4DC3 + 4D4DC34D4DC35757C79A9ADD9B9BDD8F8FD95D5DC84E4EC34D4DC34D4DC34D4D + C34D4DC35E5EC97979D27878D26B6BCD4F4FC44D4DC34D4DC34D4DC34D4DC34D + 4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC3 + 4D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4D + C34D4DC34D4DC30200000200004D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D + 4DC34D4DC34D4DC34D4DC34D4DC24C4CC04A4ABB4747B44343A93E3E9D38388D + 32327D2B2B6ED3D3DFFFFFFFFEFEFEFCFCFCF9F9F98B8BAF303079E2E2ECFBFB + FBFAFAFAF8F8F8F3F3F381819B24245A2C2C7037378C4040A24747B34B4BBE4D + 4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34C4CC0F3F3FAFFFFFFFEFEFE + EBEBEBDBDBDB8E8EA21E1E4C21215428286668689EFFFFFFFFFFFFFCFCFCEFEF + EFB0B0BE22225625255F2E2E7338388F4141A44747B44B4BBF4D4DC34D4DC34D + 4DC34D4DC34D4DC34D4DC34D4DC35757C79B9BDD8E8ED99D9DDE9A9ADD7272CF + 5252C54D4DC34D4DC34D4DC35F5FC97A7AD27373D07A7AD27373D05A5AC74E4E + C34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D + 4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC3 + 4D4DC34D4DC34D4DC34D4DC34D4DC30200000200004D4DC34D4DC34D4DC34D4D + C34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC24C4CC04A4ABB4747B44242A83D + 3D9A36368A3030792A2A6AA2A2B9FBFBFBFEFEFEFFFFFFFFFFFFFFFFFF5C5C9B + 5E5EA1FFFFFFFFFFFFFBFBFBF6F6F6EFEFEF48486F24245B2C2C7038388D4040 + A34747B44B4BBE4D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34C4CC0CE + CEECFFFFFFFFFFFFF2F2F2E2E2E2C3C3C91E1E4C22225529296768689FFFFFFF + FFFFFFFCFCFCEEEEEEAFAFBD22225625255F2E2E7338388F4141A44747B44B4B + BF4D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC35858C79C9CDE7878D265 + 65CB9494DB9E9EDE8383D55A5AC74D4DC34D4DC36060C97979D26161CA6060C9 + 7B7BD37878D16565CB4E4EC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4D + C34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D + 4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC30200000200004D4DC3 + 4D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34C4CC14A4ABC4747 + B44343A93C3C993535872F2F7735356F9E9EB4F5F5F5FCFCFCFFFFFFFFFFFFFF + FFFFC9C9DF3B3B949797C9FFFFFFFFFFFFFCFCFCF4F4F4ECECEC1F1F5024245A + 2C2C7037378C4040A34747B44B4BBE4D4DC34D4DC34D4DC34D4DC34D4DC34D4D + C34D4DC34C4CC0AAAADDFFFFFFFFFFFFF7F7F7E7E7E7E0E0E02B2B5722225629 + 29696969A0FFFFFFFFFFFFFCFCFCEEEEEEAFAFBD22225625255F2E2E7338388F + 4141A44747B44B4BBF4D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC35858 + C79C9CDE7474D04E4EC35B5BC88585D6A0A0DF9191DA6363CA4D4DC36161CA79 + 79D25B5BC84D4DC35C5CC87373D07C7CD36D6DCE5353C54D4DC34D4DC34D4DC3 + 4D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4D + C34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC302 + 00000200004D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC2 + 4B4BBE4848B84444AC3D3D9B3636892F2F764F4F80C4C4CFF2F2F2FAFAFAFFFF + FFFFFFFFFFFFFFF2F2F75757A74141A4A7A7D6FFFFFFFFFFFFFBFBFBF1F1F1BF + BFC92020502323592B2B6E37378A4040A14646B24B4BBE4D4DC34D4DC34D4DC3 + 4D4DC34D4DC34D4DC34D4DC34B4BBE9D9DD7FFFFFFFFFFFFFAFAFAECECECE3E3 + E35555772323592B2B6D6969A3FFFFFFFFFFFFFCFCFCEEEEEEAFAFBD22225625 + 255F2E2E7338388F4141A44747B44B4BBF4D4DC34D4DC34D4DC34D4DC34D4DC3 + 4D4DC34D4DC35858C79C9CDE7575D14F4FC44D4DC35656C67676D19B9BDD9A9A + DD7373D06666CC7979D25C5CC84D4DC34E4EC35757C66A6ACD7C7CD37474D05D + 5DC84E4EC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC3 + 4D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4D + C34D4DC34D4DC30200000200004D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D + 4DC34D4DC34C4CC14A4ABB4646B14040A238388E30307975759BDEDEE1F1F1F1 + F9F9F9FFFFFFFFFFFFFFFFFFF2F2F76565B14343A94545B0CDCDE9FFFFFFFFFF + FFFBFBFBEEEEEEB0B0BE2020512323592A2A6B3535873F3F9E4545B04A4ABC4D + 4DC24D4DC34D4DC34D4DC34D4DC34D4DC34D4DC24B4BBD9C9CD5FFFFFFFFFFFF + FCFCFCEFEFEFE6E6E656567A25255D2E2E736B6BA7FFFFFFFFFFFFFCFCFCEEEE + EEAFAFBD22225625255F2E2E7338388F4141A44747B44B4BBF4D4DC34D4DC34D + 4DC34D4DC34D4DC34D4DC34D4DC35858C79D9DDE7575D14F4FC44D4DC34D4DC3 + 4E4EC36868CC9595DBA3A3E09292DA8585D65C5CC84D4DC34D4DC34D4DC35050 + C46363CB7B7BD37A7AD26767CC5252C54D4DC34D4DC34D4DC34D4DC34D4DC34D + 4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC3 + 4D4DC34D4DC34D4DC34D4DC34D4DC30200000200004C4CC34C4CC34C4CC34C4C + C34C4CC34C4CC34C4CC34C4CC34B4BC04848B84343AB3C3C993F3F89AAAAC0EC + ECECF2F2F2FAFAFAFFFFFFFFFFFFFFFFFFF2F2F86565B44242AB4545B24747B5 + CDCDEAFFFFFFFFFFFFFBFBFBECECECAEAEBD2020532222572929683333823C3C + 9A4444AE4949BB4B4BC14C4CC34C4CC34C4CC34C4CC34C4CC34B4BC14848BA9B + 9BD4FFFFFFFFFFFFFDFDFDF1F1F1EAEAEA58587D27276430307B6C6CABFFFFFF + FFFFFFFCFCFCEEEEEEAFAFBD21215625255F2D2D7338388F4040A44646B44B4B + BF4C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC35757C79D9DDE7575D14E + 4EC44C4CC34C4CC34C4CC34C4CC35E5EC98A8AD8ADADE4AEAEE47171CF4C4CC3 + 4C4CC34C4CC34C4CC34C4CC35C5CC87575D17E7ED46D6DCE5454C64C4CC34C4C + C34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C + 4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC30200000200004C4CC3 + 4C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34A4ABE4646B44141A65D5D + A4C7C7D6EFEFEFF5F5F5FBFBFBFFFFFFFFFFFFFFFFFFD8D8EA5959B04444AE46 + 46B34747B54646B4CDCDEAFFFFFFFFFFFFFBFBFBECECECAEAEBE222256222257 + 27276430307C3A3A944242A84747B74B4BC04C4CC24C4CC34C4CC34C4CC34C4C + C24A4ABE4747B59A9AD0FFFFFFFFFFFFFDFDFDF2F2F2ECECEC4C4C782B2B6D34 + 34846F6FB1FFFFFFFFFFFFFCFCFCEEEEEEAFAFBD21215625255F2D2D7338388F + 4040A44646B44B4BBF4C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC35757 + C79D9DDE7575D14E4EC44C4CC34C4CC34C4CC34C4CC34C4CC35656C68989D8B8 + B8E7A6A6E17171CF5454C64C4CC34C4CC34C4CC34C4CC35555C66C6CCE7E7ED4 + 7474D05B5BC84E4EC44C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4C + C34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC302 + 00000200004D4DC34D4DC34D4DC34D4DC34E4EC34E4EC34E4EC34E4EC24C4CBE + 4747B26464B3E6E6EBF3F3F3F7F7F7FEFEFEFFFFFFFFFFFFFFFFFFA4A4CD4F4F + AB4646B14848B54848B54747B34646B0C1C1E3FFFFFFFFFFFFFDFDFDECECECBA + BAC725255D2323592727622E2E7538388C4141A14747B14B4BBC4D4DC14E4EC3 + 4D4DC34D4DC24C4CC04949BA4646AEBFBFDFFFFFFFFFFFFFFDFDFDF3F3F3EFEF + EF2828643131793A3A8F7272B6FFFFFFFFFFFFFCFCFCEEEEEEAFAFBD22225526 + 265F2F2F743A3A904343A54A4AB54E4EC05050C45050C45050C45050C45050C4 + 5050C44E4EC35A5AC79E9EDE7676D14F4FC44D4DC34D4DC34D4DC34D4DC34D4D + C34C4CC36262CA9090DAA2A2E0A3A3E08080D45959C74D4DC34C4CC34C4CC34C + 4CC34E4EC46565CB7D7DD37B7BD36363CB5050C44C4CC34C4CC34C4CC34C4CC3 + 4C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4C + C34C4CC34C4CC30200000200005656C65757C75858C75B5BC85D5DC95D5DC95E + 5EC95E5EC85C5CC36161BDE1E1EEF8F8F8FBFBFBFEFEFEFFFFFFFFFFFFF2F2F6 + 8484B45151A65858B55858BD5858BC5656B85454B15656AEA4A4D1FFFFFFFFFF + FFFFFFFFEEEEEEDEDEDE3030692A2A602C2C643333724646895454A05E5EB366 + 66C06A6AC86969CB6464C96363C76161C36060BB5E5EAFDDDDEBFFFFFFFFFFFF + FDFDFDF5F5F5D9D9DF42427850508F5C5CA48C8CC4FFFFFFFFFFFFFCFCFCEEEE + EEB4B4BF34345B3A3A6447477B5959996767B17171C27878CE7C7CD37D7DD37D + 7DD37D7DD37E7ED47E7ED47E7ED38585D6A8A8E28585D66161CA6060CA6060CA + 6060CA6060CA6060CA5E5EC96C6CCE7878D26868CC8F8FDAA7A7E19696DC6262 + CB4F4FC44C4CC34C4CC34C4CC34C4CC35C5CC87878D28080D46E6ECE5252C54C + 4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC3 + 4C4CC34C4CC34C4CC34C4CC34C4CC30200000200006262CB6464CB6868CC6F6F + CF6F6FCF7070CF7171D07272CF7070CAB0B0DCFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFD9D9E26464935A5A9A6868B07070BE6E6EC26868BC6464B46363AD6767A8 + 8F8FBDFFFFFFFFFFFFFFFFFFF2F2F2E0E0E059598835356D33336A3B3B725A5A + 8A68689D7474B07F7FBF8787CB8A8ACE7F7FCB7A7AC87676C07777B77E7EB0FF + FFFFFFFFFFFFFFFFFDFDFDF6F6F6ACACBD66668F7777A68484B9A8A8CFFFFFFF + FFFFFFFCFCFCEEEEEEB9B9C046465E4E4E696060817777A08B8BB99A9ACDA5A5 + DAABABE1ADADE3AEAEE4AEAEE4AFAFE4B0B0E4B1B1E5B2B2E5ACACE39191DA77 + 77D17777D17777D17777D17878D27878D27979D27979D27171CF5A5AC85252C5 + 7C7CD3A4A4E0A7A7E16F6FCF5454C64D4DC34C4CC34C4CC34C4CC35454C66F6F + CF8080D47878D25858C74E4EC44C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C + 4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC30200000200005151C4 + 5151C45656C65B5BC75757C65353C45555C55555C55656C1F5F5FBFFFFFFFFFF + FFFFFFFFFFFFFFB0B0C439396F38387C3E3E8F4B4BA25858AF4F4FB04848A844 + 449F4444974C4C95454592F3F3F8FFFFFFFFFFFFFAFAFAE5E5E57676A4313177 + 2E2E6F3434725050824B4B8C4646974A4AA25B5BB06161B65353B24D4DAC4949 + A54E4E9D9797BDFFFFFFFFFFFFFFFFFFFDFDFDF8F8F86363974646914E4EA253 + 53AE8181C4FFFFFFFFFFFFFBFBFBEDEDEDB1B1BE2A2A572F2F6038387345458C + 4F4FA25858B45E5EC06161C76363C96363CA6363CA6363CA6464CA6565CA6666 + CB6464CA5858C65555C55555C55555C55555C55555C55656C55656C55757C654 + 54C54D4DC24C4CC24E4EC36767CB9D9DDEA9A9E28686D65757C64C4CC24C4CC2 + 4C4CC24C4CC24F4FC36565CB8181D47F7FD36464CA4D4DC24C4CC24C4CC24C4C + C24C4CC24C4CC24C4CC24C4CC24C4CC24C4CC24C4CC24C4CC24C4CC24C4CC202 + 00000200004C4CC24C4CC25151C45757C65151C44C4CC24C4CC24C4CC27272CD + FFFFFFFFFFFFFFFFFFFFFFFFD4D4E24A4A7F38387531317B36368A42429A4E4E + A54444A43D3D9B6D6DAE55559B42428B3B3B8A9696C6FFFFFFFFFFFFFFFFFFED + EDEDA1A1C234348631317C3434794F4F8442428637378A3A3A944C4CA25252A8 + 4444A33D3D9D3B3B9641418ECDCDDFFFFFFFFFFFFFFFFFFFFEFEFEC5C5D93737 + 8D3D3D9C4242A84444AD7474C1FFFFFFFFFFFFFAFAFAECECECAEAEBD23235B26 + 26612C2C713535873C3C9A4242AA4747B64A4ABD4B4BC04C4CC24C4CC24C4CC2 + 4C4CC24C4CC24C4CC24C4CC24C4CC24C4CC24C4CC24C4CC24C4CC24C4CC24C4C + C24C4CC24C4CC24C4CC24C4CC24C4CC24C4CC24D4DC25656C59292DAAAAAE29B + 9BDD6565CA4C4CC24C4CC24C4CC24C4CC24C4CC25A5AC77C7CD28181D47171CF + 5151C44C4CC24C4CC24C4CC24C4CC24C4CC24C4CC24C4CC24C4CC24C4CC24C4C + C24C4CC24C4CC20200000200004B4BC24B4BC25050C45656C65050C44B4BC24B + 4BC24B4BC27D7DD2FFFFFFFFFFFFFFFFFFFDFDFD7676AB4444833D3D7E32327F + 3535883E3E9449499D40409A5252A0F1F1F18585B44141893B3B8C48489DE5E5 + F3FFFFFFFFFFFFFAFAFAE5E5E546469C36368D39398655558D43438835358737 + 378E4747984C4C9C3F3F9738389236368B7171A7FFFFFFFFFFFFFFFFFFFFFFFF + FFFFFF6D6DAD3D3D9D4242AA4444B14545B17474C1FFFFFFFFFFFFF8F8F8EAEA + EAADADBF2828672A2A6D2E2E783535893B3B994141A84545B44949BC4A4AC04B + 4BC14B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC2 + 4B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24C4C + C24C4CC27979D2A5A5E1AAAAE27474D04C4CC24B4BC24B4BC24B4BC24B4BC251 + 51C46E6ECE8181D47B7BD25858C74C4CC24B4BC24B4BC24B4BC24B4BC24B4BC2 + 4B4BC24B4BC24B4BC24B4BC24B4BC20200000200004B4BC24B4BC25151C45656 + C65151C44B4BC24B4BC24B4BC27E7ED2FFFFFFFFFFFFFFFFFFFBFBFB3D3D974D + 4D9343438B34348635358A3D3D914646973D3D948181B5EEEEEE6B6BA643438E + 3D3D913D3D9D7474C0FFFFFFFFFFFFFFFFFFF4F4F49797C73D3D9F4141985E5E + 9C49499337378C37378E4545934949963C3C9136368C424290E5E5EFFFFFFFFF + FFFFFFFFFFFFFFFFA3A3CE3E3EA14343AD4545B44747B74646B48282C8FFFFFF + FFFFFFFCFCFCEEEEEEB2B2C62F2F7A30307D3333853838913D3D9D4141A84545 + B44848BA4A4ABF4B4BC14B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B + 4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC2 + 4B4BC24B4BC24B4BC24B4BC24C4CC26767CC9D9DDEACACE38888D75858C64B4B + C24B4BC24B4BC24B4BC24F4FC36363CA8181D48181D46666CB4F4FC34B4BC24B + 4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC20200000200004B4BC2 + 4B4BC25151C45656C65151C44B4BC24B4BC24B4BC24F4FC3F5F5FCFFFFFFFFFF + FFFFFFFF4E4EAB5656A64B4B9B3B3B9439399440409749499B3F3F97C1C1D9EF + EFEF6D6DAD4A4A9A42429E4141A64444B09191D4FFFFFFFFFFFFFFFFFFF2F2F2 + 6E6EBC4848A86A6AAF5050A23C3C983A3A9748489B4C4C9B3E3E95383891BCBC + DAFFFFFFFFFFFFFFFFFFFFFFFFD8D8EC4141A74444B04747B74848BA4848BB47 + 47B89C9CD6FFFFFFFFFFFFFFFFFFF7F7F7BABAD23838913939933B3B973D3D9E + 4040A64343AE4646B64949BC4A4AC04B4BC14B4BC24B4BC24B4BC24B4BC24B4B + C24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B + 4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24C4CC25959C79090D9 + ADADE39B9BDD6767CC4B4BC24B4BC24B4BC24B4BC24D4DC35959C77C7CD38383 + D57272CF5454C54B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC202 + 00000200004B4BC24B4BC25151C45656C65151C44B4BC24B4BC24B4BC24F4FC3 + B1B1E4FFFFFFFFFFFFFFFFFF9999D25E5EB55454AD4141A43E3EA14545A44E4E + A67F7FBFF8F8F8F4F4F47272B85151A94848AB4545B04747B74949BC9E9EDDF6 + F6FCFFFFFFFFFFFFE9E9F18282C87474BE5757B14141A63F3FA44D4DA65252A7 + 4E4EA7CBCBE5FFFFFFFFFFFFFFFFFFFFFFFFCCCCE85050B44646B44848BA4949 + BD4A4ABF4A4ABE4848BBC2C2E7FFFFFFFFFFFFFFFFFFFFFFFFE7E7EE4B4BA940 + 40A54141A74242AA4444AF4646B44848BA4949BD4A4AC04B4BC24B4BC24B4BC2 + 4B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4B + C24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B + 4BC24B4BC25353C57F7FD3ABABE3A7A7E17575D04B4BC24B4BC24B4BC24B4BC2 + 4B4BC25353C57070CF8383D57B7BD25B5BC74B4BC24B4BC24B4BC24B4BC24B4B + C24B4BC24B4BC20200000200004B4BC24B4BC25151C45656C65151C44B4BC24B + 4BC24B4BC24F4FC37676D0DEDEF4FFFFFFFFFFFFFFFFFFA8A8D95A5ABA4646B1 + 4343AD4A4AAF9797D0F3F3FAFFFFFFFBFBFB7777C35757B64D4DB64848B84949 + BC4A4ABF6060C88A8AD7D5D5F0FFFFFFFFFFFFFBFBFBC3C3E38E8ECE4646B244 + 44AF7373BFA4A4D4F3F3F9FFFFFFFFFFFFFFFFFFFFFFFFA0A0D74646B64848BA + 4949BD4A4ABF4B4BC14B4BC17A7AD19E9EDCFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFBCBCE17373C55C5CBC4646B54747B74848BA4949BD4A4ABF4B4BC14B + 4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC2 + 4B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4B + C24B4BC24B4BC24B4BC24B4BC24B4BC25050C46E6ECE9D9DDEAFAFE48888D755 + 55C54B4BC24B4BC24B4BC24B4BC25151C46666CB7F7FD48181D46666CB4D4DC3 + 4B4BC24B4BC24B4BC24B4BC24B4BC20200000200004B4BC24B4BC25151C45656 + C65151C44B4BC24B4BC24B4BC24F4FC36D6DCD5D5DC8A0A0DEFFFFFFFFFFFFFF + FFFFF3F3FACDCDEBCECEECF3F3FAFFFFFFFFFFFFFFFFFFFFFFFF7C7CCC5C5CC1 + 5050BF4B4BBE4A4AC04B4BC16060C97878D16161C97B7BD2C3C3EAFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF3F3FABBBBE57979CB52 + 52BF4A4ABE4A4AC04B4BC14B4BC14B4BC24B4BC2FFFFFFFFFFFFF3F3FBCFCFEE + CECEEDCECEEDCECEEDDBDBF2FFFFFFFEFEFE9C9CD94949BD4949BD4A4ABF4A4A + C04B4BC14B4BC14B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B + 4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC2 + 4B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC26161 + C99494DBB0B0E49494DB6868CC4B4BC24B4BC24B4BC24B4BC24C4CC25D5DC87C + 7CD38585D66E6ECE5454C54B4BC24B4BC24B4BC24B4BC20200000200004B4BC2 + 4B4BC25151C45656C65151C44B4BC24B4BC24B4BC24F4FC36E6ECE5D5DC84C4C + C25757C69595DBBABAE7D5D5F1CFCFEECFCFEEC5C5EBA9A9E1A2A2DE9292D97A + 7AD05C5CC66060C75353C44C4CC14B4BC24B4BC26060C97878D16161C94B4BC2 + 4B4BC25F5FC9ABABE2ACACE3C3C3EACFCFEED4D4F0D5D5F0A2A2DE8686D45656 + C35A5AC66868CA5555C44B4BC14B4BC24B4BC24B4BC24B4BC24B4BC27B7BD26F + 6FCE4B4BC24B4BC24B4BC24B4BC24B4BC24B4BC26363CA7B7BD26363CA4B4BC2 + 4B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4B + C24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B + 4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC2 + 4B4BC24B4BC24B4BC25858C78787D6AFAFE4A6A6E17575D05050C44B4BC24B4B + C24B4BC24B4BC25858C67575D08585D67777D15B5BC74B4BC24B4BC24B4BC202 + 00000200004A4AC24A4AC25050C45656C65050C44A4AC24A4AC24A4AC24E4EC3 + 6D6DCE5C5CC84B4BC24A4AC24E4EC36C6CCD6161CA4C4CC34A4AC25353C55E5E + C95151C44A4AC24A4AC25050C46060C95353C54B4BC24A4AC24A4AC26060C978 + 78D26161CA4A4AC24A4AC25353C58181D56464CB4B4BC24A4AC25D5DC86363CA + 5050C44A4AC24A4AC25A5AC86969CC5454C54A4AC24A4AC24A4AC24A4AC24A4A + C24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A + 4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC2 + 4A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4A + C24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A + 4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24F4FC47676D1A2A2E0B1B1E5 + 8383D55A5AC84B4BC24A4AC24A4AC24A4AC25050C46B6BCD8282D58080D46161 + CA4E4EC34A4AC20200000200004A4AC24A4AC25050C45656C65050C44A4AC24A + 4AC24A4AC24E4EC36D6DCE5C5CC84B4BC24A4AC24E4EC36D6DCE6262CA4C4CC3 + 4A4AC25353C55F5FC95151C44A4AC24A4AC25050C46161CA5353C54B4BC24A4A + C24A4AC26060C97878D26161CA4A4AC24A4AC25353C58282D56464CB4B4BC24A + 4AC25D5DC86464CB5050C44A4AC24A4AC25A5AC86969CD5454C54A4AC24A4AC2 + 4A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4A + C24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A + 4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC2 + 4A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4A + C24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24B + 4BC26060C99191DAB2B2E59696DC6363CA4A4AC24A4AC24A4AC24A4AC24C4CC3 + 5F5FC97A7AD28484D66B6BCD5252C50200000200004A4AC24A4AC25050C45656 + C65050C44A4AC24A4AC24A4AC24E4EC36E6ECE5C5CC84B4BC24A4AC24E4EC36D + 6DCE6262CA4C4CC34A4AC25353C55F5FC95151C44A4AC24A4AC25050C46161CA + 5353C54B4BC24A4AC24A4AC26060C97979D26161CA4A4AC24A4AC25454C58383 + D56464CB4B4BC24A4AC25D5DC86464CB5050C44A4AC24A4AC25A5AC86969CD54 + 54C54A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC2 + 4A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4A + C24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A + 4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC2 + 4A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4A + C24A4AC24A4AC24A4AC24B4BC26060C9ABABE3B3B3E58080D44A4AC24A4AC24A + 4AC24A4AC24A4AC24B4BC26262CA8686D68282D55E5EC90200000200004A4AC2 + 4A4AC25050C45656C65050C44A4AC24A4AC24A4AC24E4EC36E6ECE5C5CC84B4B + C24A4AC24E4EC36D6DCE6262CA4C4CC34A4AC25353C55F5FC95151C44A4AC24A + 4AC25050C46161CA5353C54B4BC24A4AC24A4AC26161CA7A7AD26161CA4A4AC2 + 4A4AC25454C58383D56464CB4B4BC24A4AC25D5DC86464CB5151C44A4AC24A4A + C25A5AC86969CD5454C54A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A + 4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC2 + 4A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4A + C24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A + 4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC2 + 4A4AC24A4AC24A4AC24A4AC24A4AC24D4DC36262CA9E9EDEAEAEE49999DD5959 + C74A4AC24A4AC24A4AC24A4AC24C4CC36262CA8080D48181D56C6CCD4B4BC202 + 00000200004A4AC24A4AC25050C45757C65050C44A4AC24A4AC24A4AC24E4EC3 + 6F6FCE5C5CC84B4BC24A4AC24F4FC46D6DCE6363CA4C4CC34A4AC25353C55F5F + C95151C44A4AC24A4AC25050C46161CA5353C54B4BC24A4AC24A4AC26161CA7A + 7AD26161CA4A4AC24A4AC25454C58383D56464CB4B4BC24A4AC25E5EC96464CB + 5151C44A4AC24A4AC25B5BC86A6ACD5454C54A4AC24A4AC24A4AC24A4AC24A4A + C24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A + 4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC2 + 4A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4A + C24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A + 4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC25050C47070CFAEAEE4B0B0E4 + 8383D55050C44A4AC24A4AC24A4AC24A4AC24F4FC46B6BCD8686D67F7FD46060 + C94A4AC24A4AC20200000200004A4AC14A4AC15050C35757C55050C34A4AC14A + 4AC14A4AC14E4EC27070CE5D5DC84B4BC14A4AC14F4FC36D6DCD6363CA4C4CC2 + 4A4AC15353C45F5FC85151C34A4AC14A4AC15050C36161C95353C44B4BC14A4A + C14A4AC16161C97A7AD26161C94A4AC14A4AC15454C48484D56565CA4B4BC14A + 4AC15E5EC86464CA5151C34A4AC14A4AC15B5BC76A6ACC5454C44A4AC14A4AC1 + 4A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4A + C14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A + 4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC1 + 4A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4A + C14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC15656C58A8AD7B2 + B2E4A6A6E16969CB4B4BC14A4AC14A4AC14A4AC14A4AC15757C57777D08585D5 + 7575D05353C44A4AC14A4AC14A4AC10200000200004A4AC14A4AC15050C35757 + C55050C34A4AC14A4AC14A4AC14E4EC27070CE5E5EC84B4BC14A4AC14F4FC36F + 6FCE6464CA4C4CC24A4AC15353C45F5FC85252C44A4AC14A4AC15050C36262C9 + 5353C44B4BC14A4AC14A4AC16161C97B7BD26262C94A4AC14A4AC15454C48585 + D56565CA4B4BC14A4AC15E5EC86565CA5151C34A4AC14A4AC15B5BC76B6BCC54 + 54C44A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC1 + 4A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4A + C14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A + 4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC1 + 4A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC16464 + CAA1A1DFB2B2E49797DB5656C54B4BC14A4AC14A4AC14A4AC14A4AC16161C980 + 80D38585D56B6BCC4B4BC14A4AC14A4AC14A4AC14A4AC10200000200004949C1 + 4949C14F4FC35757C64F4FC34949C14949C14949C14D4DC27070CE5D5DC84A4A + C14949C14E4EC36E6ECE6363CA4B4BC24949C15252C45F5FC95151C44949C14A + 4AC14F4FC36161C95252C44A4AC14949C14949C16060C97B7BD26161C94949C1 + 4949C15353C48484D56464CA4A4AC14949C15D5DC86464CA5050C34949C14949 + C15A5AC76A6ACC5454C54949C14949C14949C14949C14949C14949C14949C149 + 49C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949C1 + 4949C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949 + C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949C149 + 49C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949C1 + 4949C17272CFADADE3ACACE37E7ED34C4CC24949C14949C14949C14949C14A4A + C16C6CCD8484D57D7DD35E5EC84949C14949C14949C14949C14949C14949C102 + 00000200004949C14949C15050C35757C65050C34949C14949C14949C14D4DC2 + 7070CE5D5DC84A4AC14949C14E4EC36F6FCE6363CA4B4BC24949C15252C45F5F + C95151C44949C14A4AC14F4FC36161C95252C44A4AC14949C14949C16161C97B + 7BD26161C94949C14949C15353C48585D56565CA4A4AC14949C15E5EC86464CA + 5050C34949C14949C15A5AC76A6ACC5454C54949C14949C14949C14949C14949 + C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949C149 + 49C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949C1 + 4949C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949 + C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949C149 + 49C14949C15757C68B8BD7B0B0E4A0A0DF6868CC4C4CC24949C14949C14949C1 + 4949C15656C57777D18484D57272CF5656C54A4AC14949C14949C14949C14949 + C14949C14949C10200000200004949C14949C15050C35757C65050C34949C149 + 49C14949C14D4DC27070CE5D5DC84A4AC14949C14E4EC36F6FCE6363CA4B4BC2 + 4949C15252C45F5FC95151C44949C14A4AC14F4FC36262CA5252C44A4AC14949 + C14949C16161C97C7CD26161C94949C14949C15353C48686D66565CA4A4AC149 + 49C15E5EC86565CA5050C34949C14949C15A5AC76B6BCC5454C54949C14949C1 + 4949C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949 + C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949C149 + 49C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949C1 + 4949C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949 + C14949C14949C14949C16565CA9999DCB0B0E49696DB5C5CC74A4AC14949C149 + 49C14949C14949C16262CA7C7CD28484D56A6ACC5050C34949C14949C14949C1 + 4949C14949C14949C14949C14949C10200000200004949C14949C15050C35757 + C65050C34949C14949C14949C14D4DC27171CF5E5EC84A4AC14949C14E4EC370 + 70CE6363CA4B4BC24949C15353C46060C95151C44949C14A4AC15050C36262CA + 5252C44A4AC14949C14949C16161C97C7CD26262CA4949C14949C15353C48686 + D66666CB4A4AC14949C15E5EC86565CA5050C34949C14949C15B5BC76B6BCC54 + 54C54949C14949C14949C14949C14949C14949C14949C14949C14949C14949C1 + 4949C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949 + C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949C149 + 49C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949C1 + 4949C14949C14949C14949C14949C17676D0A9A9E2ADADE37F7FD35252C44949 + C14949C14949C14949C14D4DC26C6CCD8484D57D7DD35F5FC94C4CC24949C149 + 49C14949C14949C14949C14949C14949C14949C14949C10200000200004949C1 + 4949C15050C35757C65050C34949C14949C14949C14D4DC27171CF5E5EC84A4A + C14949C14E4EC37070CE6363CA4B4BC24949C15353C46060C95151C44949C14A + 4AC15050C36262CA5252C44A4AC14949C14949C16161C97C7CD26262CA4949C1 + 4949C15353C48686D66666CB4A4AC14949C15E5EC86565CA5050C34949C14949 + C15B5BC76B6BCC5454C54949C14949C14949C14949C14949C14949C14949C149 + 49C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949C1 + 4949C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949 + C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949C149 + 49C14949C14949C14949C14949C14949C15959C78787D6AEAEE49E9EDE6E6ECE + 4E4EC34949C14949C14949C14A4AC15959C77575D08484D57171CF5858C64A4A + C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949C102 + 00000200004949C14949C15050C35757C65050C34949C14949C14949C14D4DC2 + 7272CF5E5EC84A4AC14949C14E4EC37171CF6262CA4A4AC14949C15353C46060 + C95151C44949C14A4AC15050C36363CA5151C44A4AC14949C14949C16161C97C + 7CD26262CA4949C14949C15454C58686D66363CA4A4AC14949C15E5EC86565CA + 5050C34949C14949C15B5BC76B6BCC5353C44949C14949C14949C14949C14949 + C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949C149 + 49C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949C1 + 4949C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949 + C14949C14949C14949C14949C14949C14949C14A4AC16666CB9595DBAFAFE492 + 92DA6161C94A4AC14949C14949C14949C14D4DC26262CA7C7CD28383D56969CC + 5050C34949C14949C14949C14949C14949C14949C14949C14949C14949C14949 + C14949C14949C10200000200005454C55454C55C5CC86262CA5F5FC95959C65B + 5BC75B5BC75F5FC87777D16464CA5050C34F4FC35555C57676D07171CE6060C8 + 5D5DC86565CB6E6ECE6262C95959C75A5AC76060C87272CF6868CC6363CA6363 + CA6060C97474D08686D66B6BCD5252C45353C45D5DC78E8ED87979D16767CB66 + 66CB7575D07979D16565CB5F5FC95F5FC96F6FCE7F7FD37070CF6969CC6B6BCD + 6B6BCD6C6CCD6C6CCD6C6CCD6C6CCD6D6DCD6D6DCD6D6DCD6E6ECD6F6FCE6F6F + CE6F6FCE6F6FCE7070CE7070CE7070CE7070CE7171CF7171CF7171CF7272CF72 + 72CF7373CF7373CF7373CF7373CF7474CF7171CE6363CA5A5AC75959C75959C7 + 5959C75959C75959C75A5AC75A5AC75656C54D4DC24949C14E4EC37575D0A8A8 + E1AAAAE28383D55252C44949C14949C14949C14949C15050C36C6CCD8383D57B + 7BD26161C94949C14949C14949C14949C14949C14949C14949C14949C14949C1 + 4949C14949C14949C14949C14949C10200000200006767CB6767CB6D6DCE7474 + D07878D17777D17878D17979D27A7AD27C7CD36969CC5B5BC75B5BC75E5EC979 + 79D28383D58282D58282D58585D68282D57979D27676D17777D17B7BD28989D7 + 8A8AD78B8BD88C8CD88C8CD89191DA8C8CD97373CF6363CA6363CA6B6BCD9898 + DC9696DB9595DB9595DB9999DC9494DB8888D78484D58585D69090D99F9FDE9D + 9DDE9D9DDE9E9EDE9F9FDEA0A0DEA0A0DFA1A1DFA2A2E0A3A3E0A4A4E0A4A4E0 + A6A6E1A7A7E1A7A7E1A7A7E1A8A8E2A9A9E2AAAAE2ABABE2ABABE3ACACE3ADAD + E3AEAEE4AEAEE4AFAFE4AFAFE4B0B0E4B0B0E4B2B2E5B2B2E5B3B3E59292DA75 + 75D07575D07575D07575D07676D17676D17676D17A7AD27272CF5757C65B5BC7 + 8484D5AEAEE49C9CDD6D6DCE4C4CC24848C14848C14848C14949C15757C67373 + D08282D57171CF5555C54848C14848C14848C14848C14848C14848C14848C148 + 48C14848C14848C14848C14848C14848C14848C14848C10200000200005B5BC8 + 5C5CC85D5DC86262CA6666CB6767CB6767CB6868CB6969CC6565CB5858C75454 + C55353C55454C56363CA6C6CCD6E6ECE6E6ECE6E6ECE6C6CCD6666CB6565CB65 + 65CB6767CC7171CF7272D07474D07474D07575D07878D16D6DCE5D5DC85959C7 + 5959C75D5DC87575D07A7AD27B7BD27C7CD27C7CD27474D06F6FCE6F6FCE6F6F + CE7474D07E7ED38181D48181D48181D48383D58383D58383D58484D68484D685 + 85D68585D68686D68787D68787D68888D78989D78989D78989D78989D78B8BD8 + 8B8BD88B8BD88C8CD88C8CD88E8ED98E8ED98E8ED98E8ED98E8ED98E8ED99595 + DBB3B3E58D8DD86666CB6565CB6565CB6565CB6565CB6565CB6363CA7171CF7C + 7CD37474D09595DBAEAEE49191DA5A5AC74949C14848C14848C14848C14B4BC2 + 5F5FC97A7AD28181D46868CC4C4CC24848C14848C14848C14848C14848C14848 + C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848C102 + 00000200004848C14848C14848C14848C14848C14848C14848C14848C14848C1 + 4848C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848 + C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848C148 + 48C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848C1 + 4848C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848 + C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848C148 + 48C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848C1 + 4848C14848C15656C6A6A6E17777D14A4AC24848C14848C14848C14848C14848 + C14848C16464CB9B9BDEB0B0E4A9A9E27F7FD44949C14848C14848C14848C148 + 48C14D4DC36A6ACC8181D47C7CD35E5EC84848C14848C14848C14848C14848C1 + 4848C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848 + C14848C14848C10200000200004848C14848C14848C14848C14848C14848C148 + 48C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848C1 + 4848C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848 + C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848C148 + 48C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848C1 + 4848C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848 + C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848C148 + 48C14848C14848C14848C14848C15656C6A7A7E17878D14A4AC24848C14848C1 + 4848C14848C14848C15252C49191DAC4C4EBA9A9E26B6BCD4848C14848C14848 + C14848C14949C15151C47373D08181D47272CF5555C54848C14848C14848C148 + 48C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848C1 + 4848C14848C14848C14848C14848C10200000200004848C14848C14848C14848 + C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848C148 + 48C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848C1 + 4848C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848 + C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848C148 + 48C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848C1 + 4848C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848 + C14848C14848C14848C14848C14848C14848C14848C15656C6A7A7E17878D14A + 4AC24848C14848C14848C14848C16060C99898DCB7B7E7AFAFE46868CB4848C1 + 4848C14848C14848C14848C15D5DC87C7CD38181D46767CB4C4CC24848C14848 + C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848C148 + 48C14848C14848C14848C14848C14848C14848C14848C10200000200004848C0 + 4848C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848 + C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848C048 + 48C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848C0 + 4848C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848 + C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848C048 + 48C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848C0 + 4848C04848C04848C04848C04848C04848C04848C04848C04848C04848C05656 + C5A7A7E17878D14A4AC14848C04848C04848C07272CFA5A5E0ACACE38D8DD87E + 7ED25B5BC64848C04848C04848C04B4BC16B6BCC7F7FD37E7ED35C5CC74848C0 + 4848C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848 + C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848C002 + 00000200004848C04848C04848C04848C04848C04848C04848C04848C04848C0 + 4848C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848 + C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848C048 + 48C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848C0 + 4848C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848 + C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848C048 + 48C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848C0 + 4848C04848C05656C5A7A7E17878D14A4AC14848C04B4BC18585D5ABABE29E9E + DE6868CB5F5FC87D7DD25B5BC64848C04949C05050C37474CF8181D47373CF53 + 53C44848C04848C04848C04848C04848C04848C04848C04848C04848C04848C0 + 4848C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848 + C04848C04848C00200000200004848C04848C04848C04848C04848C04848C048 + 48C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848C0 + 4848C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848 + C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848C048 + 48C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848C0 + 4848C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848 + C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848C048 + 48C04848C04848C04848C04848C05656C5A8A8E17878D14949C05F5FC89797DB + ACACE28C8CD75B5BC64848C06060C87E7ED35A5AC64848C05F5FC87C7CD28181 + D46565CA4F4FC24848C04848C04848C04848C04848C04848C04848C04848C048 + 48C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848C0 + 4848C04848C04848C04848C04848C00200000200004747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C05555C5A8A8E17878D178 + 78D19F9FDEABABE27878D15151C34747C04747C05F5FC87C7CD26060C86868CB + 7F7FD37C7CD25959C64B4BC14747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C00200000200004747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C05555 + C5A8A8E19E9EDEAAAAE29D9DDD6A6ACC4B4BC14747C04747C04747C05D5DC87F + 7FD37A7AD17F7FD36F6FCE5353C44747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C002 + 00000200004747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C05454C4A9A9E2A9A9E28888D65F5FC84949C14747C04747C04747 + C04747C05D5DC87F7FD37B7BD26464CA4E4EC24747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C00200000200004747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C05050C38F8FD97A7AD15252C44848C04747C0 + 4747C04747C04747C04747C05858C67070CE5D5DC84848C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C00200000200004747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04848C05555C54747C047 + 47C04747C04747C04747C04747C04747C04747C04B4BC14D4DC24747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C00200000200004747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C002 + 00000200004747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C00200000200004747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C00200000200004646C04646C04646C04646 + C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646C046 + 46C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646C0 + 4646C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646 + C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646C046 + 46C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646C0 + 4646C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646 + C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646C046 + 46C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646C0 + 4646C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646 + C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646C046 + 46C04646C04646C04646C04646C04646C04646C04646C00200000200004646C0 + 4646C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646 + C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646C046 + 46C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646C0 + 4646C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646 + C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646C046 + 46C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646C0 + 4646C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646 + C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646C046 + 46C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646C0 + 4646C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646 + C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646C002 + 00000200004545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD + 4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545 + BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD45 + 45BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD + 4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545 + BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD45 + 45BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD + 4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545 + BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD45 + 45BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD + 4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545 + BD4545BD4545BD0200000200004242B84242B84242B84242B84242B84242B842 + 42B84242B84242B84242B84242B84242B84242B84242B84242B84242B84242B8 + 4242B84242B84242B84242B84242B84242B84242B84242B84242B84242B84242 + B84242B84242B84242B84242B84242B84242B84242B84242B84242B84242B842 + 42B84242B84242B84242B84242B84242B84242B84242B84242B84242B84242B8 + 4242B84242B84242B84242B84242B84242B84242B84242B84242B84242B84242 + B84242B84242B84242B84242B84242B84242B84242B84242B84242B84242B842 + 42B84242B84242B84242B84242B84242B84242B84242B84242B84242B84242B8 + 4242B84242B84242B84242B84242B84242B84242B84242B84242B84242B84242 + B84242B84242B84242B84242B84242B84242B84242B84242B84242B84242B842 + 42B84242B84242B84242B84242B84242B84242B84242B84242B84242B84242B8 + 4242B84242B84242B84242B84242B80200000200003F3FB13F3FB13F3FB13F3F + B13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F + 3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB1 + 3F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3F + B13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F + 3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB1 + 3F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3F + B13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F + 3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB1 + 3F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3F + B13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F + 3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB10200000200003A3AA6 + 3A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3A + A63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A + 3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA6 + 3A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3A + A63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A + 3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA6 + 3A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3A + A63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A + 3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA6 + 3A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3A + A63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA602 + 0000020000333399333399333399333399333399333399333399333399333399 + 3333993333993333993333993333993333993333993333993333993333993333 + 9933339933339933339933339933339933339933339933339933339933339933 + 3399333399333399333399333399333399333399333399333399333399333399 + 3333993333993333993333993333993333993333993333993333993333993333 + 9933339933339933339933339933339933339933339933339933339933339933 + 3399333399333399333399333399333399333399333399333399333399333399 + 3333993333993333993333993333993333993333993333993333993333993333 + 9933339933339933339933339933339933339933339933339933339933339933 + 3399333399333399333399333399333399333399333399333399333399333399 + 3333993333993333993333993333993333993333993333993333993333993333 + 993333993333990200000200002C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C + 2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A + 2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C + 8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C + 2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A + 2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C + 8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C + 2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A + 2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C + 8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C + 2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A + 2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A0200000200002323782323782323782323 + 7823237823237823237823237823237823237823237823237823237823237823 + 2378232378232378232378232378232378232378232378232378232378232378 + 2323782323782323782323782323782323782323782323782323782323782323 + 7823237823237823237823237823237823237823237823237823237823237823 + 2378232378232378232378232378232378232378232378232378232378232378 + 2323782323782323782323782323782323782323782323782323782323782323 + 7823237823237823237823237823237823237823237823237823237823237823 + 2378232378232378232378232378232378232378232378232378232378232378 + 2323782323782323782323782323782323782323782323782323782323782323 + 7823237823237823237823237823237823237823237823237823237823237823 + 2378232378232378232378232378232378232378232378020000020000191964 + 1919641919641919641919641919641919641919641919641919641919641919 + 6419196419196419196419196419196419196419196419196419196419196419 + 1964191964191964191964191964191964191964191964191964191964191964 + 1919641919641919641919641919641919641919641919641919641919641919 + 6419196419196419196419196419196419196419196419196419196419196419 + 1964191964191964191964191964191964191964191964191964191964191964 + 1919641919641919641919641919641919641919641919641919641919641919 + 6419196419196419196419196419196419196419196419196419196419196419 + 1964191964191964191964191964191964191964191964191964191964191964 + 1919641919641919641919641919641919641919641919641919641919641919 + 6419196419196419196419196419196419196419196419196419196419196402 + 00000200000E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C + 0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E + 4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E + 0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C + 0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E + 4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E + 0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C + 0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E + 4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E + 0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C + 0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E + 4C0E0E4C0E0E4C02000002000008083F08083F08083F08083F08083F08083F08 + 083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F + 08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F0808 + 3F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08 + 083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F + 08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F0808 + 3F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08 + 083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F + 08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F0808 + 3F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08 + 083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F + 08083F08083F08083F08083F08083F02000002000008083F08083F08083F0808 + 3F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08 + 083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F + 08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F0808 + 3F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08 + 083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F + 08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F0808 + 3F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08 + 083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F + 08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F0808 + 3F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08 + 083F08083F08083F08083F08083F08083F08083F08083F02000002000008083F + 08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F0808 + 3F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08 + 083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F + 08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F0808 + 3F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08 + 083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F + 08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F0808 + 3F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08 + 083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F + 08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F0808 + 3F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F02 + 00000200005E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB0 + 5E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5E + B05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E + 5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB0 + 5E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5E + B05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E + 5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB0 + 5E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5E + B05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E + 5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB0 + 5E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5E + B05E5EB05E5EB00200000200005757AC5757AC5757AC5757AC5757AC5757AC57 + 57AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC + 5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757 + AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC57 + 57AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC + 5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757 + AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC57 + 57AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC + 5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757 + AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC57 + 57AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC + 5757AC5757AC5757AC5757AC5757AC0200000200004A4AA64A4AA64A4AA64A4A + A64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A + 4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA6 + 4A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4A + A64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A + 4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA6 + 4A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4A + A64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A + 4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA6 + 4A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4A + A64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A + 4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA60200000200003B3B9F + 3B3B9F3B3B9F3B3B9F3B3B9F3B3B9F3B3B9F3B3B9F3B3B9F3B3B9F3B3B9F3B3B + 9E3A3A9C39399A38389838389738389738389738389839399B3A3A9D3B3B9E3B + 3B9F3B3B9F3B3B9F3B3B9F3B3B9F3B3B9E3A3A9C39399A383898383898383898 + 39399A3A3A9D3B3B9E3B3B9F3B3B9E3B3B9E3A3A9C39399B39399A39399A3939 + 9A39399A39399B3A3A9C3B3B9E3B3B9E3B3B9F3B3B9F3B3B9F3B3B9F3B3B9E3A + 3A9D39399A38389838389738389839399A39399B3A3A9D3B3B9E3B3B9F3B3B9F + 3B3B9F3B3B9F3B3B9E3A3A9D39399B39399A39399A39399A39399A39399A3939 + 9A39399A39399A39399A39399A39399A39399A39399A39399B3A3A9C3A3A9D3B + 3B9E3A3A9D39399A38389838389838389939399A39399B39399B39399A39399A + 39399A3A3A9C3B3B9E3B3B9E3B3B9E3A3A9D3A3A9D3A3A9D3A3A9D3A3A9C3939 + 9A38389838389838389939399B3A3A9D3B3B9E3B3B9F3B3B9F3B3B9F3B3B9F02 + 00000200002C2C972C2C972C2C972C2C972C2C972C2C972C2C972C2C972C2C96 + 2B2B952A2A9229298D2727872525832525812424802525812525822525832626 + 8628288B2A2A902B2B952C2C962C2C972B2B952A2A9229298D27278725258225 + 258125258125258226268427278829298D2A2A922B2B942A2A9229298D272787 + 25258325258225258225258327278729298D2A2A922C2C962C2C972C2C972C2C + 962B2B9429298F27278926268425258124248025258126268427278729298D2A + 2A922B2B952C2C972C2C972C2C962B2B942A2A9028288A262686252583252582 + 2525812525822525832626842626852626852626842525822525822525822626 + 8528288A29298F29298F28288A26268424248024248025258226268526268626 + 268525258225258125258327278829298F2A2A922A2A9229298E28288A28288A + 28288927278726268425258124247F25258126268528288B2A2A912B2B952C2C + 972C2C972C2C970200000200001F1F911F1F911F1F911F1F911F1F911F1F911F + 1F911F1F901E1E8D1D1D871B1B7E18187416166C15156815156916166B16166D + 17176E17176F1717711818751A1A7D1C1C861E1E8C1E1E8D1D1D881B1B7F1818 + 7416166C15156815156916166A16166A16166A16166E1818751B1B801D1D871D + 1D871B1B7E1818731515691414631414631515691818731B1B7F1D1D891F1F8F + 1F1F911F1F901E1E8D1C1C8519197A17176E15156715156615156916166C1717 + 701818731919791B1B811D1D891F1F8F1F1F911F1F901E1E8D1C1C861A1A7C18 + 187216166A14146514146214146315156817176F18187318187417177116166C + 15156814146516166A1818741A1A7D1A1A7B1717711515661313611414631616 + 6A17176F17176F16166A1414641414621515681818731B1B801D1D871C1C841A + 1A7B18187317177017177017177016166E16166A151566141463151568181872 + 1B1B7F1D1D8A1F1F8F1F1F911F1F9102000002000016168C16168C16168C1616 + 8C16168C16168C16168C1515881414801212730F0F630D0D570C0C520C0C550E + 0E5D0F0F6610106B10106B1010690F0F640F0F6310106812127313137D141480 + 1212760F0F660D0D570C0C510C0C560E0E5E0F0F630E0E5F0C0C560C0C530D0D + 580F0F6712127613137D1212760F0F670C0C540A0A490A0A490C0C540F0F6712 + 127815158516168A16168C1515891414811111710E0E5F0C0C520B0B4E0C0C55 + 0E0E5E0F0F650F0F660F0F6610106911117113137D15158716168C16168C1515 + 881414811212761010680D0D580B0B4C0909450A0A490C0C530F0F6210106B11 + 116E1010690E0E620D0D580B0B500C0C540E0E6010106D1010690D0D5A0A0A4B + 0A0A470B0B4E0D0D5A0E0E5E0D0D5A0B0B500A0A480A0A490C0C530F0F641212 + 7413137E13137910106A0D0D5A0C0C530C0C560D0D5C0E0E610E0E600D0D580B + 0B4E0B0B4D0D0D5710106913137A15158616168C16168C0200000200000F0F89 + 0F0F890F0F890F0F890F0F890F0F890F0F860E0E7E0C0C6E09095B4545778383 + A1A3A3BAC2C2D5C2C2D9C3C3DCA5A5CC7777B22A2A840B0B6A0A0A610A0A5E0B + 0B660C0C710C0C710A0A635555868383A1C1C1D1C2C2D4A4A4C58585B5383881 + 0808510606440606430808516767A08686BB8686BA8585B28383A582829D8282 + 9D64648F0B0B650D0D780E0E850F0F880F0F890E0E820C0C7438387C8383A4A2 + A2B7C1C1D0C2C2D49494B867679F0A0A640A0A5F0A0A5D0A0A640C0C720E0E80 + 0F0F882D2D988787C38787C18686BC8585B58484AA8383A182829B82829D8383 + A58585B18686B88686BB8686B98585B58585AF65659308085009095B39398485 + 85B2A3A3BFC1C1D19393AB8383A336367328286C8484A8C1C1D082829C54547A + 08084D0A0A640C0C754A4A9E7777B119196907074A54547D8383A4A3A3C1C3C3 + D9A4A4C77575A426266006063F0606420808540B0B6B0E0E7D0F0F870F0F8902 + 00000200000C0C870C0C870C0C870C0C870C0C870C0C870B0B800A0A7265659A + E1E1E9FFFFFFFFFFFFF0F0F4A3A3C38585B88585BEA4A4D0F1F1F8FFFFFF7676 + B209096B08086409096709096B565697F0F0F5FFFFFFFFFFFFE1E1E87474A0C2 + C2DBFFFFFFFFFFFFE1E1EA53537B0404380505436464989494C2FFFFFFFFFFFF + FFFFFFFFFFFF9292A864648E0909650A0A770B0B800B0B800B0B800B0B7AA3A3 + C7FFFFFFFFFFFFFFFFFFC1C1D08383A8B2B2CDF0F0F6E1E1EC55558C07075408 + 085C09096D0B0B7C0C0C852A2A968686C39595CAF1F1F7FFFFFFFFFFFFFFFFFF + FFFFFF9292A88383A59494BCC3C3DEF1F1F8FFFFFFFFFFFFFFFFFFC2C2D70808 + 5B555593FFFFFFFFFFFFFFFFFFFFFFFFA2A2B8B2B2C6FFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFE0E0E7B2B2C81818710B0B798585BFFFFFFFD1D1E1C1C1D0FFFFFF + E1E1E8A3A3C2FFFFFFFFFFFFFFFFFFF0F0F433335F04043705054608085E0A0A + 760C0C830C0C870200000200000B0B870B0B870B0B870B0B870B0B870B0B8619 + 1984B2B2D1FFFFFFFFFFFFFFFFFFD1D1DB1616580808680A0A7B0B0B860B0B87 + 1A1A8FD2D2E9FFFFFFC2C2DE18187E0909756666A8FFFFFFFFFFFFFFFFFFB1B1 + C0040441070758090971E1E1EFFFFFFFFFFFFFFFFFFF52527504044107075809 + 0972FFFFFFFFFFFFFFFFFFFFFFFF04043705054807076109096F090973090972 + 090973A3A3CAFFFFFFFFFFFFFFFFFF81819A04044006065307075E171769B2B2 + CAFFFFFF44447706065508086A0A0A7B0B0B850B0B870B0B870B0B879595C9FF + FFFFFFFFFFFFFFFFFFFFFF04043806064C0808690A0A7D1A1A8F6767B4FFFFFF + FFFFFFC2C2DD0909707575B0FFFFFFFFFFFFFFFFFFE1E1EA05054805054B7373 + 9FFFFFFFFFFFFFFFFFFFC1C1CD14144944447E09096E0A0A7F8585C1FFFFFFFF + FFFFFFFFFFA1A1B505054307075C282884FFFFFFFFFFFFFFFFFFF0F0F323234E + 05054307075C0909740B0B820B0B870200000200000B0B870B0B870B0B870B0B + 870B0B870B0B859494C5FFFFFFFFFFFFFFFFFFFFFFFF43436D06065109096D0A + 0A7F0B0B870B0B870B0B871A1A8FD2D2E9FFFFFF8585BF0A0A7DF1F1F7FFFFFF + FFFFFFFFFFFF82829D0404400606520808668484B7FFFFFFFFFFFFFFFFFFC1C1 + CF05054807075E090972FFFFFFFFFFFFFFFFFFFFFFFF03033505054306065507 + 075D07075B07075836367DFFFFFFFFFFFFFFFFFFFFFFFF62628444447144447F + 45458645458344447763638924245C07075709096E0A0A7E0B0B860B0B870B0B + 870B0B878585C1FFFFFFFFFFFFFFFFFFFFFFFF04043806064C0808690A0A7D0B + 0B870B0B878585C3FFFFFFC2C2E00A0A7F191988C2C2E0FFFFFFFFFFFFFFFFFF + B2B2C744447A454581FFFFFFFFFFFFFFFFFFC1C1CE0505410707580909720A0A + 818585C1FFFFFFFFFFFFFFFFFF53537604043F060654080866D1D1E4FFFFFFFF + FFFFFFFFFFA1A1B605054A0808630A0A780B0B840B0B870200000200000B0B87 + 0B0B870B0B870B0B870B0B872A2A93FFFFFFFFFFFFFFFFFFFFFFFFD1D1D90404 + 3C06065209096D0A0A800B0B870B0B870B0B870B0B870B0B840A0A7E0A0A790A + 0A79FFFFFFFFFFFFFFFFFFFFFFFF63638D05054606064F07075D8484B1FFFFFF + FFFFFFFFFFFFC1C1D207075908086B090977FFFFFFFFFFFFFFFFFFFFFFFF0404 + 3C05054506064F06065106064D06064C444480FFFFFFFFFFFFFFFFFFFFFFFFC1 + C1D2C1C1D2C1C1D5FFFFFFFFFFFFFFFFFFFFFFFF73739B0808610909750B0B82 + 0B0B870B0B870B0B870B0B878585C1FFFFFFFFFFFFFFFFFFFFFFFF0404380606 + 4C0808690A0A7D0B0B870B0B870B0B874848A539399E0B0B860B0B860B0B8438 + 38959393BFC2C2D6FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC1C1D006064D + 0808620A0A770B0B838585C1FFFFFFFFFFFFFFFFFF43436804043B06064C0707 + 5AC2C2D7FFFFFFFFFFFFFFFFFFC1C1D207075A09096F0A0A7E0B0B860B0B8702 + 00000200000B0B870B0B870B0B870B0B870B0B876767B3FFFFFFFFFFFFFFFFFF + FFFFFFC1C1CC04043A06064F08086B0A0A7D0B0B870B0B870B0B870B0B840A0A + 7C09096F080866080869C2C2DDFFFFFFFFFFFFFFFFFF9393B907075706065607 + 075AB2B2CDFFFFFFFFFFFFFFFFFFA3A3C409096E0A0A780A0A7AFFFFFFFFFFFF + FFFFFFFFFFFF35356F252569C2C2D5E1E1EAB2B2C9353572171766F0F0F6FFFF + FFFFFFFFFFFFFF17176707075907075CC2C2D7FFFFFFFFFFFFE1E1EB17176C09 + 09720A0A7E0B0B850B0B870B0B870B0B870B0B878585C1FFFFFFFFFFFFFFFFFF + FFFFFF04043806064C0808690A0A7D0B0B870B0B870B0B870B0B870B0B870B0B + 870B0B875858ACC2C2E0E1E1EE9393BC07075B07075B64649CFFFFFFFFFFFFFF + FFFFC1C1D50707600909700A0A7E0B0B858585C1FFFFFFFFFFFFFFFFFF72728E + 04043A050549060656F0F0F5FFFFFFFFFFFFFFFFFF64649A09096C0A0A7B0B0B + 840B0B870B0B870200000200000B0B870B0B870B0B870B0B870B0B877676BCFF + FFFFFFFFFFFFFFFFFFFFFFC1C1CE04043A0505480707610909740A0A800B0B83 + 0A0A810A0A7A09096D07075B06065307075A282881D2D2E7FFFFFFFFFFFFF1F1 + F76666A508086B6565A1FFFFFFFFFFFFFFFFFFD2D2E51818800A0A7E0B0B8229 + 2990FFFFFFFFFFFFFFFFFFFFFFFFD1D1E3B2B2D1FFFFFFFFFFFFFFFFFFA3A3C7 + 0909706666ABFFFFFFFFFFFFFFFFFF7575B009096E27277EFFFFFFFFFFFFFFFF + FF6666A50909760A0A7F0B0B840B0B870B0B870B0B870B0B870B0B858585BFFF + FFFFFFFFFFFFFFFFFFFFFF0404370505490808650A0A790B0B850B0B860B0B87 + 0B0B870B0B870B0B870B0B879595CBFFFFFFFFFFFFF1F1F709097009096D7575 + ADFFFFFFFFFFFFFFFFFF9494BF0909750A0A7E0B0B840B0B868585C0FFFFFFFF + FFFFFFFFFFE0E0E7727292545486C2C2D8FFFFFFFFFFFFFFFFFFB2B2D1090974 + 0A0A7C0B0B830B0B870B0B870B0B870200000200000B0B870B0B870B0B870B0B + 870B0B8739399EFFFFFFFFFFFFFFFFFFFFFFFFC1C1D104044005054606065608 + 08670909730A0A7709097509096DB2B2CDC1C1D405054906065409096C191986 + 8585C3E1E1F0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD2D2E66666AE0A0A800B0B + 830B0B86C3C3E1FFFFFFFFFFFFFFFFFFFFFFFFB3B3D7C2C2DFFFFFFFFFFFFFFF + FFFFF1F1F747479D0A0A7F0B0B832A2A95A4A4D2F1F1F8FFFFFFD2D2E7FFFFFF + FFFFFFE1E1EF8585BE0A0A7F0B0B820B0B850B0B870B0B870B0B870B0B870B0B + 850A0A818585BBFFFFFFFFFFFFFFFFFFFFFFFF04043A0505490707600909730A + 0A800B0B840B0B870B0B870B0B870B0B870B0B870B0B877676BCE1E1F0FFFFFF + C2C2E0D2D2E7FFFFFFFFFFFFFFFFFF8585BD0A0A7E0B0B820B0B850B0B860B0B + 858585BEFFFFFFFFFFFFFFFFFFD1D1DAF0F0F4FFFFFFFFFFFFFFFFFFFFFFFFA4 + A4CE1919860A0A810B0B850B0B870B0B870B0B870B0B870200000200000B0B87 + 0B0B870B0B870B0B870B0B870B0B87C3C3E1FFFFFFFFFFFFFFFFFFFFFFFF1616 + 5C06064E06065307075D08086708086B08086B8484B2FFFFFFFFFFFF06065107 + 075D0909710A0A800B0B870B0B871A1A8F4848A54848A54848A40B0B850B0B86 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B8739399E2A2A960B0B + 870B0B8739399E39399E0B0B870B0B870B0B870B0B870B0B870B0B870B0B8739 + 399E4848A54848A42A2A940B0B850B0B860B0B870B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B830A0A7D8484B8FFFFFFFFFFFFFFFFFFFFFFFF0505460606 + 4F07075E09096D0A0A7A0B0B820B0B860B0B870B0B870B0B870B0B870B0B870B + 0B870B0B871A1A8F4848A54848A54848A439399C0B0B850B0B860B0B870B0B87 + 0B0B870B0B860B0B828585BCFFFFFFFFFFFFFFFFFF8282A106064C0707604747 + 982A2A920B0B860B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B8702 + 00000200000B0B870B0B870B0B870B0B870B0B870B0B871A1A8FD2D2E9FFFFFF + FFFFFFFFFFFFA3A3C70808620707600808620808660808697474ABFFFFFFFFFF + FFFFFFFF08086609096D0A0A7A0B0B830B0B870B0B870B0B870B0B870B0B870B + 0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B + 0B870B0B870B0B870B0B870B0B870B0B830A0A7D9494C2FFFFFFFFFFFFFFFFFF + FFFFFF07075D0707600808680909710A0A7A0B0B820B0B860B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B + 0B870B0B870B0B870B0B870B0B860A0A818585BCFFFFFFFFFFFFFFFFFF8383AB + 07075C08086B0A0A7A0B0B840B0B870B0B870B0B870B0B870B0B870B0B870B0B + 870B0B870B0B870200000200000B0B870B0B870B0B870B0B870B0B870B0B870B + 0B871A1A8F9595CBFFFFFFFFFFFFFFFFFFE1E1EE7575B14747956666A8C2C2DD + FFFFFFFFFFFFFFFFFFF1F1F70A0A790A0A7D0A0A810B0B850B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B + 0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B872A2A968585C2A4A4D0F1F1F7FF + FFFFFFFFFFFFFFFFFFFFFFC2C2DC8484BA4747990A0A7A0A0A800B0B840B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B872A2A964848A2C2C2DFFFFFFFFF + FFFFFFFFFF8484B70909720A0A790A0A810B0B860B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B870B0B870B0B870200000200000B0B870B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B871A1A8F6767B49595CAC3C3E1C3C3E0C2 + C2E0C2C2E08585C05757A90B0B827676BA6767B30B0B850B0B850B0B860B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B + 0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B872A2A968585 + C38585C28585C28585C18585C18585C18585C18585C18585C14848A10B0B830B + 0B850B0B860B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B876767B4C3C3 + E1C3C3E1C2C2E0C2C2E0F1F1F88585C00A0A800B0B820B0B850B0B870B0B870B + 0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870200000200000B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B + 0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B + 0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B + 0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B8702 + 00000200000B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B + 0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B + 0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B + 0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B + 870B0B870B0B870200000200000B0B870B0B870B0B870B0B870B0B870B0B870B + 0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B + 0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B + 0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B + 0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B870B0B870B0B870200000200000B0B870B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B + 0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B + 0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B + 0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B + 0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B87020000020000020000 + 0200000200000200000200000200000200000200000200000200000200000200 + 0002000002000002000002000002000002000002000002000002000002000002 + 0000020000020000020000020000020000020000020000020000020000020000 + 0200000200000200000200000200000200000200000200000200000200000200 + 0002000002000002000002000002000002000002000002000002000002000002 + 0000020000020000020000020000020000020000020000020000020000020000 + 0200000200000200000200000200000200000200000200000200000200000200 + 0002000002000002000002000002000002000002000002000002000002000002 + 0000020000020000020000020000020000020000020000020000020000020000 + 0200000200000200000200000200000200000200000200000200000200000200 + 0002000002000002000002000002000002000002000002000002000002000002 + 0000} + end + object Label1: TLabel + Left = 146 + Top = 22 + Width = 230 + Height = 20 + Caption = 'SQL Server Data Access' + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Height = -17 + Font.Name = 'Verdana' + Font.Pitch = fpVariable + Font.Style = [fsBold, fsItalic] + ParentFont = False + end + object Label3: TLabel + Left = 146 + Top = 108 + Width = 156 + Height = 13 + Caption = 'Copyright '#169' 1997-2007 Core Lab' + end + object Label5: TLabel + Left = 146 + Top = 132 + Width = 26 + Height = 13 + Caption = 'Web:' + end + object Label6: TLabel + Left = 146 + Top = 156 + Width = 31 + Height = 13 + Caption = 'E-mail:' + end + object lbMail: TLabel + Left = 186 + Top = 156 + Width = 80 + Height = 13 + Cursor = crHandPoint + Caption = 'sdac@crlab.com' + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlue + Font.Height = 13 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [fsUnderline] + ParentColor = False + ParentFont = False + OnClick = lbMailClick + OnMouseMove = lbMailMouseMove + end + object lbWeb: TLabel + Left = 186 + Top = 132 + Width = 101 + Height = 13 + Cursor = crHandPoint + Caption = 'www.crlab.com/sdac' + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlue + Font.Height = 13 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [fsUnderline] + ParentFont = False + OnClick = lbWebClick + OnMouseMove = lbWebMouseMove + end + object Label4: TLabel + Left = 186 + Top = 46 + Width = 119 + Height = 20 + Caption = 'Components' + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Height = -17 + Font.Name = 'Verdana' + Font.Pitch = fpVariable + Font.Style = [fsBold, fsItalic] + ParentFont = False + end + object Label10: TLabel + Left = 146 + Top = 180 + Width = 32 + Height = 13 + Caption = 'Forum:' + end + object lbForum: TLabel + Left = 186 + Top = 180 + Width = 109 + Height = 13 + Cursor = crHandPoint + Caption = 'www.crlab.com/forums' + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlue + Font.Height = 13 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [fsUnderline] + ParentFont = False + OnClick = lbForumClick + OnMouseMove = lbForumMouseMove + end + object OKBtn: TButton + Left = 308 + Top = 248 + Width = 75 + Height = 24 + Cancel = True + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 0 + end +end diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Base/SdacAbout.pas b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Base/SdacAbout.pas new file mode 100644 index 0000000..6438bb5 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Base/SdacAbout.pas @@ -0,0 +1,127 @@ + +////////////////////////////////////////////////// +// MS SQL Server Data Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +// SDAC About Window +// Created: 24.07.01 +// Last modified: 14.01.02 +////////////////////////////////////////////////// + +unit SdacAbout; + +interface +uses + Windows, SysUtils, Classes, Graphics, Forms, Controls, StdCtrls, +{$IFDEF WIN32} + Jpeg, +{$ENDIF} + Buttons, ExtCtrls; +type + TSdacAboutForm = class(TForm) + OKBtn: TButton; + Image1: TImage; + Label1: TLabel; + Label3: TLabel; + Label5: TLabel; + Label6: TLabel; + lbMail: TLabel; + lbWeb: TLabel; + Label4: TLabel; + Bevel1: TBevel; + Label10: TLabel; + lbForum: TLabel; + procedure lbWebClick(Sender: TObject); + procedure lbMailClick(Sender: TObject); + procedure lbWebMouseMove(Sender: TObject; Shift: TShiftState; X, + Y: Integer); + procedure lbMailMouseMove(Sender: TObject; Shift: TShiftState; X, + Y: Integer); + procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X, + Y: Integer); + procedure lbForumMouseMove(Sender: TObject; Shift: TShiftState; X, + Y: Integer); + procedure lbForumClick(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + end; + +var + SdacAboutForm: TSdacAboutForm; + +procedure ShowAbout; + +implementation + +uses + ShellApi; + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} + +procedure ShowAbout; +begin + with TSdacAboutForm.Create(Application) do + try + ShowModal; + finally + Free; + end; +end; + +procedure TSdacAboutForm.lbWebClick(Sender: TObject); +begin +{$IFDEF MSWINDOWS} + ShellExecute(0, 'open', 'http://www.crlab.com/sdac', '', '', SW_SHOW); + lbWeb.Font.Color := $FF0000; +{$ENDIF} +end; + +procedure TSdacAboutForm.lbMailClick(Sender: TObject); +begin +{$IFDEF MSWINDOWS} + ShellExecute(0, 'open', 'mailto:sdac@crlab.com', 'zxczxc', '', SW_SHOW); + lbMail.Font.Color := $FF0000; +{$ENDIF} +end; + +procedure TSdacAboutForm.lbForumClick(Sender: TObject); +begin +{$IFDEF MSWINDOWS} + ShellExecute(0, 'open', 'www.crlab.com/forums/viewforum.php?f=6', '', '', SW_SHOW); + lbWeb.Font.Color := $FF0000; +{$ENDIF} +end; + +procedure TSdacAboutForm.lbWebMouseMove(Sender: TObject; Shift: TShiftState; X, + Y: Integer); +begin + lbWeb.Font.Color := $4080FF; +end; + +procedure TSdacAboutForm.lbMailMouseMove(Sender: TObject; Shift: TShiftState; + X, Y: Integer); +begin + lbMail.Font.Color := $4080FF; +end; + +procedure TSdacAboutForm.lbForumMouseMove(Sender: TObject; + Shift: TShiftState; X, Y: Integer); +begin + lbForum.Font.Color := $4080FF; +end; + +procedure TSdacAboutForm.FormMouseMove(Sender: TObject; Shift: TShiftState; X, + Y: Integer); +begin + lbWeb.Font.Color := $FF0000; + lbMail.Font.Color := $FF0000; + lbForum.Font.Color := $FF0000; +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Base/SdacDemoForm.nfm b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Base/SdacDemoForm.nfm new file mode 100644 index 0000000..d4b657d --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Base/SdacDemoForm.nfm @@ -0,0 +1,896 @@ +inherited SDACForm: TSDACForm + Left = 190 + Top = 236 + Caption = 'SDACForm' + PixelsPerInch = 96 + TextHeight = 13 + inherited TVSplitter: TSplitter + Color = clGreen + end + inherited pnTopLabel: TPanel + inherited lbTitle: TLabel + Caption = ' SDAC' + Color = clGreen + end + inherited lbAbout: TLabel + Left = 939 + Color = clGreen + end + end + inherited Panel2: TPanel + inherited Shape1: TShape + Brush.Color = clGreen + end + inherited Panel1: TPanel + Color = clGreen + end + inherited pnShowSource: TPanel + Color = clGreen + end + inherited pnOpenDemoDir: TPanel + Color = clGreen + end + end + inherited ImageList1: TImageList + Left = 593 + Top = 15 + Bitmap = { + 494C01010C000E00040010001100FFFFFFFFFF00FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000004400000001002000000000000044 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000800000000000000000 + 0000000000000080000000000000008000000080000000800000000000000000 + 0000000000000000000000000000000000000000000000800000000000000000 + 0000000000000080000000000000008000000080000000800000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000800000000000000000 + 0000000000000080000000000000008000000080000000800000000000008BB8 + CB00317DA400317DA400317DA400699BB7000000000000800000000000000080 + 0000000000000080000000000000000000000000000000800000000000000000 + 0000000000000000000000000000000000000000000000800000000000000080 + 0000000000000080000000000000000000000000000000800000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000800000000000000080 + 00000000000000800000000000000000000000000000008000000000000063B6 + D50082E9F70054D5FB003296CF001479B4000000000000800000000000000080 + 0000000000000080000000000000008000000080000000000000000000000000 + 0000000000000000000000000000000000000000000000800000000000000080 + 0000000000000080000000000000008000000080000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000800000000000000080 + 00000000000000800000000000000080000000800000000000000000000063B6 + D50082E9F70054D5FB003296CF001479B400000000000080000000800000B1A4 + 9A000080000000800000B1A49A00B1A49A000080000000800000634935006349 + 350063493500634935006349350063493500000000000080000000800000B1A4 + 9A000080000000800000B1A49A00B1A49A000080000000800000634935006349 + 3500634935006349350063493500634935000000000000000000000000000000 + 0000BBB0A700000000000000000000000000BBB0A7000000000000000000BBB0 + A7000000000000000000BBB0A700573E2B000000000000800000008000000000 + 00000080000000800000000000000000000000800000008000000000000063B6 + D50082E9F70054D5FB003296CF001479B40000000000BBA69700D2BDA800D4BD + AA00E9D6CA00E9D6CA00E9D7CC00E9D6CA00E9D6CA00E9D6CA00E9D6CA00E7CF + C200E6CEC000E6CCBE00E6CCBD006349350000000000BBA69700D2BDA800D4BD + AA00E9D6CA00E9D6CA00E9D7CC00E9D6CA00E9D6CA00E9D6CA00E9D6CA00E7CF + C200E6CEC000E6CCBE00E6CCBD006349350000000000C4B2A500D8C5B300D9C5 + B500EDDED700EDDDD400ECDCD200ECDBD100EBD9CF00D9C5B500EAD5CA00EAD5 + C900E8D4C800E8D2C600E8D2C500573E2B000000000000000000000000000000 + 000000000000000000000000000000000000DDD3CB00B1A49A006349350063B6 + D50082E9F70054D5FB003296CF001479B40000000000BBA69700FEFEFC00D2BD + A800FDF8F600FCF6F300FBF3EF00FAF0EA00F9ECE600D2BDA800F7E6DE00F6E3 + D900F5E0D500F4DDD200E6CCBE006349350000000000BBA69700FEFEFC00D2BD + A800FDF8F600FCF6F300FBF3EF00FAF0EA00F9ECE600D2BDA800F7E6DE00F6E3 + D900F5E0D500F4DDD200E6CCBE006349350000000000B39D8D00FEFEFC00CDB5 + 9F00FDF7F500FCF5F100FAF1ED00F9EEE700F8EAE300CDB59F00F6E3DA00F5DF + D400F4DCD000F3D9CD00E3C6B700573E2B000000000000000000000000000000 + 000000000000000000000000000000000000BBA69700D5C7BD00F6EFEA00C6E7 + ED009ED7E1009ED7E1009ED7E100699BB70000000000BBA69700D2BDA800D2BD + A800FDFBFA00D2BDA800D2BDA800D2BDA800FAEFEA00D2BDA800F8E9E100D2BD + A800D2BDA800D2BDA800E6CEC0006349350000000000BBA69700D2BDA800D2BD + A800FDFBFA00D2BDA800D2BDA800D2BDA800FAEFEA00D2BDA800F8E9E100AC8F + 7100AC8F7100AC8F7100E6CEC0006349350000000000B39D8D00CDB59F00CDB5 + 9F00FDFAF900CDB59F00CDB59F00CDB59F00F9EDE700CDB59F00F7E6DD00CDB5 + 9F00CDB59F00CDB59F00E3C8B900573E2B000000000000000000000000000000 + 00000000000000000000BBA69700634935006349350063493500634935006349 + 35006349350063493500EFE0D8006349350000000000BBA69700FFFFFF00D2BD + A800FEFDFD00FEFBFB00FDF9F700FCF6F300FBF3EF00D2BDA800F9ECE600F8EA + E200F7E6DD00F6E3D900E7CFC1006349350000000000BBA69700FFFFFF00D2BD + A800FEFDFD00FEFBFB00FDF9F700FCF6F300FBF3EF00D2BDA800F9ECE600F8EA + E200F7E6DD00F6E3D900E7CFC1006349350000000000B39D8D00FFFFFF00CDB5 + 9F00FEFDFD00FEFAFA00FDF8F600FCF5F100FAF1ED00CDB59F00F8EAE300F7E7 + DE00F6E3D900F5DFD400E4C9BA00573E2B000000000000000000E2DEDE00D9DA + D4000000000000000000BBA69700D5C7BD00F6EFEA00F3EAE400F1E5DE00EFE1 + D800D0BEB10063493500F0E4DC006349350000000000BBA69700D2BDA800D2BD + A800FFFFFF00D2BDA800D2BDA800D2BDA800FCF6F300D2BDA800FAEFEA00D2BD + A800D2BDA800D2BDA800E7D0C3006349350000000000BBA69700D2BDA800D2BD + A800FFFFFF00D2BDA800D2BDA800D2BDA800FCF6F300D2BDA800FAEFEA00F9ED + E600AC8F7100F7E6DE00E7D0C3006349350000000000B39D8D00CDB59F00CDB5 + 9F00FFFFFF00CDB59F00CDB59F00CDB59F00FCF5F100CDB59F00F9EDE700CDB5 + 9F00CDB59F00CDB59F00E4CABC00573E2B000000000000000000E0DDDD003A87 + 1A00DDD3CB00B1A49A0063493500634935006349350063493500634935006349 + 3500EFE0D80063493500BBA697006349350000000000BBA69700FFFFFF00D2BD + A800FFFFFF00FFFFFF00FFFEFC00FEFBFA00FDF9F700D2BDA800FBF3EF00FAF0 + EB00F9ECE600F7E9E100E8D2C6006349350000000000BBA69700FFFFFF00D2BD + A800FFFFFF00FFFFFF00FFFEFC00FEFBFA00FDF9F700D2BDA800FBF3EF00AC8F + 7100AC8F7100AC8F7100E8D2C6006349350000000000B39D8D00FFFFFF00CDB5 + 9F00FFFFFF00FFFFFF00FFFEFC00FEFAF900FDF8F600CDB59F00FAF1ED00F9EE + E800F8EAE300F6E6DD00E5CDBF00573E2B00000000007CAA680036851600277D + 0400277D0400EAE3DE00F6EFEA00F1E9E200F1E5DE00EFE1D800D0BEB1006349 + 3500F0E4DC0063493500BBA69700BBA6970000000000BBA69700D2BDA800D2BD + A800FFFFFF00D2BDA800D2BDA800D2BDA800FEFBFA00D2BDA800FCF6F300D2BD + A800D2BDA800D2BDA800E8D3C8006349350000000000BBA69700D2BDA800D2BD + A800FFFFFF00D2BDA800D2BDA800D2BDA800FEFBFA00D2BDA800FCF6F300FCF3 + EF00AC8F7100F9EDE600E8D3C8006349350000000000B39D8D00CDB59F00CDB5 + 9F00FFFFFF00CDB59F00CDB59F00CDB59F00FEFAF900CDB59F00FCF5F100CDB5 + 9F00CDB59F00CDB59F00E5CEC100573E2B007FAB6B0030820E00000000002F81 + 0D00DDD3CB00FCFAF900D4C6BC00BAA69600BBA69700D2C1B500EFE0D8006349 + 3500BBA6970063493500000000000000000000000000BBA69700FFFFFF00D2BD + A800FFFFFF00FFFFFF00FFFFFF00FFFFFF00FEFDFD00D2BDA800FDF9F700FCF6 + F300FBF3EF00FAF0EA00E9D5CA006349350000000000BBA69700FFFFFF00D2BD + A800FFFFFF00FFFFFF00FFFFFF00FFFFFF00FEFDFD00D2BDA800FDF9F700FCF6 + F300FBF3EF00FAF0EA00E9D5CA006349350000000000B39D8D00FFFFFF00CDB5 + 9F00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FEFDFD00CDB59F00FDF8F600FCF5 + F100FAF1ED00F9EEE700E6D0C400573E2B000000000000000000000000000000 + 0000BBA69700FAF6F300BBA69700F7F1ED00F5EDE700BBA69700F0E4DC006349 + 3500BBA69700BBA69700000000000000000000000000EFAD8C00EFAD9400EFAD + 8C00EFAD8C00EFA58400EFA57B00E7946B00EF946300E7845200EF844A00E773 + 4200E7733900E7733900E7733900CE6A370000000000EFAD8C00EFAD9400EFAD + 8C00EFAD8C00EFA58400EFA57B00E7946B00EF946300E7845200EF844A00E773 + 4200E7733900E7733900E7733900CE6A370000000000E7A18000E69E7D00E49A + 7800E3957200DF916C00DD8C6500DB865E00D9805700D57B5000D2764800D16F + 4200CE693C00CD653600CA613100C85E2D000000000000000000000000000000 + 0000BBA69700BBA69700FAF6F300F8F4F000F7F0EC00F5ECE600BBA697006349 + 35000000000000000000000000000000000000000000F7B59400FFC6A500FFCE + AD00FFC6A500FFC6A500FFBD9C00FFBD9400FFB58C00FFB58C00FFAD7B00FFAD + 7B00FFA57300FF9C7300F7946300CE69380000000000F7B59400FFC6A500FFCE + AD00FFC6A500FFC6A500FFBD9C00FFBD9400FFB58C00FFB58C00FFAD7B00FFAD + 7B00FFA57300FF9C7300F7946300CE69380000000000E7A18000E69F7D00E49A + 7800E3957100E1916C00DD8C6500DB865E00D9805800D57A5000D3764900D16F + 4200CF6A3C00CD653600CA613100C85D2E00000000002F810D00000000003082 + 0E006C904900BBA69700BBA69700BBA69700BBA69700BBA69700BBA69700BBA6 + 97000000000000000000000000000000000000000000EFAD8C00EFAD8C00EFAD + 8C00EFAD9400EFAD8C00EFAD8C00EFA58400EFA57B00E7946B00EF946300E78C + 5A00EF845200E77B4200E77B4200CE69380000000000EFAD8C00EFAD8C00EFAD + 8C00EFAD9400EFAD8C00EFAD8C00EFA58400EFA57B00E7946B00EF946300E78C + 5A00EF845200E77B4200E77B4200CE69380000000000E7A18000E69F7D00E49A + 7800E3957100E1916C00DD8C6500DB865E00D9805800D57A5000D3764900D16F + 4200CF6A3C00CD653600CA613100C85D2E00277D0400277D0400368516007CAA + 6800000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000003A871A00E0DDDD000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000800000000000000000 + 0000000000000080000000000000008000000080000000800000000000000000 + 0000000000000000000000000000000000000000000000800000000000000000 + 0000000000000080000000000000008000000080000000800000000000000000 + 0000000000000000000000000000000000000000000000800000000000000000 + 0000000000000080000000000000008000000080000000800000000000000000 + 0000000000000000000000000000000000000000000000800000000000000000 + 0000000000000080000000000000008000000080000000800000000000000000 + 0000000000000000000000000000000000000000000000800000000000000080 + 0000000000000080000000000000000000000000000000800000A7BED7006195 + A800688F9C0031738D00206C910092ADC4000000000000800000000000000080 + 0000000000000080000000000000000000000000000000800000000000000000 + 0000000000000000000000000000000000000000000000800000000000000080 + 0000000000000080000000000000000000000000000000800000000000000000 + 0000000000000000000000000000000000000000000000800000000000000080 + 0000000000000080000000000000000000000000000000800000447DA500447D + A500447DA500447DA500447DA500000000000000000000800000000000000080 + 00000000000000800000000000000080000000800000000000004692B9005FDA + FF00A1ECF80057D1F60002A8E7003B8EB4000000000000800000000000000080 + 0000000000000080000000000000008000000080000000000000000000000000 + 0000000000000000000000000000000000000000000000800000000000000080 + 0000000000000080000000000000008000000080000000000000000000000000 + 0000000000000000000000000000000000000000000000800000000000000080 + 0000000000000080000000000000008000000080000000000000447DA5008ADE + F00055C2E6003AB4E100447DA500000000000000000000800000008000000000 + 00000080000000800000000000000000000000800000008000004DA0C9005FD8 + FC00A0EAF60056CEF40003AAEB003286AD00000000000080000000800000B1A4 + 9A000080000000800000B1A49A00B1A49A000080000000800000634935006349 + 3500634935006349350063493500634935000000000000800000008000000000 + 0000008000000080000000000000000000000080000000800000000000000000 + 0000000000000000000000000000000000000000000000800000008000000000 + 0000008000000080000000000000000000000080000000800000447DA500A1EB + F60081D9EE0050C0E500447DA500000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000050A5C8005ED8 + FC00A0EAF60056CFF40005ACED0027789C0000000000BBA69700D2BDA800D4BD + AA00E9D6CA00E9D6CA00E9D7CC00E9D6CA00E9D6CA00E9D6CA00E9D6CA00E7CF + C200E6CEC000E6CCBE00E6CCBD00634935000000000000000000000000000000 + 0000000000000000000000000000529CED00BECEE30000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000447DA5008DE7 + FA009EE9F50077D4EC00447DA500000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000051A7CB005DD6 + FC00A0EAF60056CFF40001A6E7003A8DB60000000000BBA69700FEFEFC00D2BD + A800FDF8F600FCF6F300FBF3EF00FAF0EA00FAEFEB00E6DBCF00247C0000659F + 4700F9EDE600F5E1D700E6CCBE00634935000000000000000000000000000000 + 000000000000000000000000000082B2E9002D8BF100BECEE300000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000447DA500447D + A5004278A000447DA500447DA500000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000004EA9CD0060DA + FC009EE8F5004DCBF40000A5EB00348BB30000000000BBA69700D2BDA800D2BD + A800FDFBFA00D2BDA800D2BDA800D2BDA800FBF2ED00E6DBCF00FBF3EF00FBF1 + EC00FAEEE800F6E3D900E6CEC0006349350000000000A7BED7006191A900698A + 9D00316F8D002068910092ADC400000000004597F1003E85F400BECEE3000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000996952000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000067B6D0008BEF + FF00ADF8FF008AEFFF0059DDFF005DA8C20000000000BBA69700FFFFFF00D2BD + A800FEFDFD00FEFBFB00FDF9F700FCF6F300FCF5F100E6DBCF005E9C40007AAC + 6000FBF1EC00F8E9E100E8D1C30063493500000000004692B9005FDAFF00A1EC + F80057D1F60002A8E7003B8EB400000000009ABDE7004498F400377FF300BECE + E300000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000996952000000000000000000000000006448370062483700624A34006249 + 35006449350064483700624A3400634833006248370000000000AAD2DE0099D3 + E00095CED7009ED0D500A3D7DD00A8C8D10000000000BBA69700D2BDA800D2BD + A800FFFFFF00D2BDA800D2BDA800D3BFAB00FCF7F500E6DBCF0097BD8200247C + 0000A5C38F00FBF1ED00EBD8CD00664D3900000000004DA0C9005FD8FC00A0EA + F60056CEF40003AAEB003286AD000000000000000000589EED00408DF4003279 + F300BECEE3000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000099695200000000000000000000000000B7A89500FFFAF700D2BDA700FCF6 + F100F7F2EF00FAE9E000F6E6DF00F7E6DD006149330000000000000000000000 + 00000000000000000000000000000000000000000000BBA69700FFFFFF00D2BD + A800FFFFFF00FFFFFF00FFFEFC00FEFCFB00FEFBFA00E6DBCF00FDF8F6007AAD + 6200247C0000B3CB9F00F0E2DB006F5745000000000050A0C8005ED8FC00A0EA + F60056CFF40005ACED0027789C000000000000000000B2C8E5002F84F3002872 + F2002F74F300BECEE30000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000E6CA + BE0070311700E6CABE000000000000000000BDA59900D0BDA800D3BBA700FEF7 + F400D4BCA800D0BCAA00D3BBA700F8E8E1006448370000000000000000000000 + 00000000000000000000000000000000000000000000BBA69700D2BDA800D2BD + A800FFFFFF00D2BDA800D6C3B000E3D6C80098C18600B2C29800FDFAF800FDF8 + F6004F9531005E9C4000F2E7E10077604E000000000051A2CB005DD6FC00A0EA + F60056CFF40001A6E7003A8DB6000000000000000000000000004694EF00256F + F2002272F2003079F300BECEE3000000000000000000447DA500447DA500447D + A500447DA500447DA50000000000000000000000000000000000E6CABE009C59 + 3900BD69400095492700E6CABE0000000000BBA79500FFFDFD00CFBCA700FAF8 + F800FDF6F300FAF0E900F9EEEA00F9ECE400654A360000000000000000005D8A + 4400337F130036751600000000000000000000000000BBA69700FFFFFF00D2BD + A800FFFFFF00FFFFFF00FFFFFF00FFFFFF007BB0660031820E00B5D1A700A6C8 + 95003284100097BE8200F2E5DF00725B4900000000004EA4CE0060DAFC009EE8 + F5004DCBF40000A5EB00348BB30000000000000000002B87F2003382F300226E + F2002275F2002281F2002D8BF100A6C3E60000000000447DA5008ADEF00055C2 + E6003AB4E100447DA500000000000000000000000000E6CABE00A56C5100D58E + 6B00DD8B6400CC764D00974D2B00E6CABE00BBA69700D4BDA700D1BEA900FEF9 + FB00D4BDA700D2BDA800D2BDA700FBF0EC005F49370000000000000000000000 + 00003485130035861300000000000000000000000000EFAD8C00EFAD9400EFAD + 8C00EFAD8C00EFA58400EFA57B00E7946B00E7AB8D00ECBFA9008E9F5900598D + 2B00588C2A00999D5C00E6B19700CE6A37000000000068B1D1008BEFFF00ADF8 + FF008AEFFF0059DDFF005DA8C200000000000000000082B2E9002F7EF300226D + F2002276F2002281F200000000000000000000000000447DA500A1EBF60081D9 + EE0050C0E5004278A0009969520099695200996952007F503900CF937600E8A7 + 8700E59E7B00E0926C00C2744E0074391F00BFAD9C00FEFAF900D8C5B000FCF7 + F600FCF3EF00F6EAE800FCF1ED00F8EFEE006950350000000000000000003485 + 1300000000006CA15400000000000000000000000000F7B59400FFC6A500FFCE + AD00FFC6A500FFC6A500FFBD9C00FFBD9400E1977300E4A28300E9B59D00EABA + A200E8B79E00E4A98B00D9886000D272430000000000AAD2DE0099D3E00095CE + D7009ED0D500A3D7DD00A8C8D1000000000000000000000000003176F300226E + F2002276F2002380F2002E8AF1000000000000000000447DA5008DE7FA009EE9 + F50077D4EC00447DA500000000000000000000000000E6CABE00A7725800DD9F + 8100EAAA8B00DA977800A2664900E6CABE00E9A98A00E3A08100E49D7C00DD99 + 7600D9957000D8896000D47F5200B37334009A7935003485130034851300A7C0 + 9A000000000000000000000000000000000000000000EFAD8C00EFAD8C00EFAD + 8C00EFAD9400EFAD8C00EFAD8C00EFA58400EFA57B00E7946B00EF946300E78C + 5A00EF845200E77B4200E77B4200CE6938000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000009ABDE700217C + F200227EF2002283F2002287F2004696EF0000000000447DA500447DA500447D + A500447DA500447DA50000000000000000000000000000000000E6CABE00A772 + 5800CF937600A7725800E6CABE0000000000EAAC8E00E7A38000E39B7900DF94 + 6E00DC8A6100D7805400D5784B00CE6E3E00C66B370000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000E6CA + BE007F503900E6CABE0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000C2A6A400C2A6 + A400C2A6A400C2A6A400C2A6A400C2A6A400C2A6A400C2A6A400C2A6A400C2A6 + A400C2A6A400C2A6A40000000000000000000000000000800000000000000000 + 0000000000000080000000000000008000000080000000800000000000000000 + 00000000000000000000000000000000000000000000DB322E00DB322E00DB32 + 2E0000000000DB322E0000000000DB322E000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000C2A6A400FEFC + FB00FEFCFB00FEFCFB00FEFCFB00FEFCFB00FEFCFB00FEFCFB00FEFCFB00FEFC + FB00FEFCFB00C2A6A40000000000000000000000000000800000000000000080 + 0000000000000080000000000000000000000000000000800000A5C7D5005F95 + A800678E9C002F728C001E6B900091B1C40000000000DB322E00000000000000 + 000000000000DB322E00DB322E00DF8785000000000000000000A6C7D5006195 + A800688F9C0031738D00206C910092B1C4000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000C2A6A400FEFC + FB00FEFCFB00FEFCFB00FEFCFB00FEFCFB00FEFCFB00FEFCFB00FEFCFB00FEFC + FB00FEFCFB00C2A6A40000000000000000000000000000800000000000000080 + 00000000000000800000000000000080000000800000000000004497B8005FDA + FF00A1ECF80057D1F60002A8E7003B8EB40000000000DB322E00000000000000 + 000000000000DB322E0000000000DB322E0000000000000000004698B8005FDA + FF00A1ECF80057D1F60002A8E7003B8EB40077848F006E7C8500626F7900535F + 6800444E5600333C4300252C3200191F240010151A0010151A0010151A001015 + 1A0010151A0010151A0010151A00000000000000000000000000C2A6A400FEFA + F500FEFCFB00FEFAF500FEFAF500FEFCFB00FEFAF500FEFAF500FEFCFB00FEFA + F500FEFAF500C2A6A40000000000000000000000000000800000008000000000 + 00000080000000800000000000000000000000800000008000004AA4C8005FD8 + FC00A0EAF60056CEF40003AAEB003286AD0000000000DB322E00DB322E00DB32 + 2E0000000000DB322E00DB322E00DB322E0000000000000000004DA5C9005FD8 + FC00A0EAF60056CEF40003AAEB003286AD0079879200A2DFF00072CDEA004BB8 + E20039AEDB002FA9D90028A1D2002398C700228EBC002083AE001B81AB00177E + A9001D799F0021749600191F2400000000000000000000000000C2A6A400FEFA + F500FEFAF500FEFAF500FEFAF500FEFAF500FEFAF500FEFAF500FEFAF500FEFA + F500FEFAF500C2A6A400000000000000000000000000BBA79600BBA69700BBA6 + 9700BBA69700BBA69700BBA69700BBA69700BBA69700BBA697004CA3C6005ED8 + FC00A0EAF60056CFF40005ACED0027789C000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000050A5C8005ED8 + FC00A0EAF60056CFF40005ACED0027789C007C8A9500A9ECF60095E5FC0082DE + FB0075D5FA006CD0F7005DC5F40052BEF00044B4EC0038ABE9002EA4E300229A + DF001890D7001D799F0022292F00000000000000000000000000C2A6A400FEF7 + F000FEF7F000FEF7F000FEF7F000FEF7F000FEF7F000FEF7F000FEF7F000FEF7 + F000FEF7F000C2A6A400000000000000000000000000BBA69700F3E2D900EEE1 + D900EEDED800EBDFD300EEDDD400EBDBD400EADAD400E9DAD1004EA6CA005DD6 + FC00A0EAF60056CFF40001A6E7003A8DB6000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000051A7CB005DD6 + FC00A0EAF60056CFF40001A6E7003A8DB6007F8E9800B6EEF8009BE8FB0095E5 + FC0082DEFB0075D5FA006ACAF4005DC5F4004FBCF00044B4EC0038ABE9002EA4 + E3001F96DC00177EA9002F363D00000000000000000000000000C2A6A400FEF7 + F000FEF7F000FEF7F000FEF7F000FEF3E900FEF7F000FEF7F000FEF3E900FEF7 + F000FEF7F000C2A6A400000000000000000000000000BBA79600F1E1DA00F0E0 + D900CDBAB200CCBCAF00CABBB200CFBBB000EBDBD400CCBAAF004BA8CD0060DA + FC009EE8F5004DCBF40000A5EB00348BB30000000000BBA69700634935006349 + 35006349350063493500634935006349350063493500634935004BA6C90060DA + FC009EE8F5004DCBF40000A5EB00348BB30083959F00B6EEF800ABEDFB009BE8 + FB008BE2FC0082DEFB0075D5FA006ACAF4005DC5F4004FBCF00040B3ED0038AB + E900269EE2001282B4003D454D00000000000000000000000000C2A6A400FEF3 + E900FEF3E900FEF3E900FEF3E900FEF3E900FEF3E900FEF3E900FEF3E900FEF3 + E900FEF3E900C2A6A400000000000000000000000000B8A59600F4E2DB00F1E1 + DA00FFF3ED00FFF3EF00FCF4ED00CCB9B100E9DDD300FFF3ED0065B5D0008BEF + FF00ADF8FF008AEFFF0059DDFF005DA8C20000000000BBA69700EBE6E200EBE4 + E000EAE1DC00D2BDA800E8DCD400E5D3C900E4CFC500D2BDA80067B6D0008BEF + FF00ADF8FF008AEFFF0059DDFF005DA8C20083959F00BEF0F900ABF0F700A5EC + FB009BE8FB008BE2FC007EDCFC0075D5FA0065CCF7005DC5F4004FBCF00040B3 + ED002EA4E3000E8ABF004B555E00000000000000000000000000C2A6A400FFF0 + E200FFF0E200FEF3E900FFEEDE00FEF3E900FFEEDE00FEF3E900FFEEDE00FEF3 + E900FFEEDE00C2A6A400000000000000000000000000BBA79500F1E4DC00EEE3 + DB00F1E2D900F0E0D900EEDED700EDDED500EFDFD300E9DCD400AAD2DE0099D3 + E00095CED7009ED0D500A3D7DD00A8C8D10000000000BBA69700FFFFFE00FEFD + FC00FDFAF900D2BDA800FCF5F100F9EBE400F8E8E000D2BDA800AAD2DE0099D3 + E00095CED7009ED0D500A3D7DD00A8C8D100869AA300BEF0F900B6EEF800B6EE + F800A5ECFB0095E5FC008BE2FC007EDCFC0075D5FA0065CCF7005DC5F4004FBC + F00037A9E7000E8FC70059656D00000000000000000000000000C2A6A400FEF3 + E900FFEEDE00FFF0E200FEF3E900FFEEDE00FFF0E200DDCFC200DDCFC200DDCF + C200DDCFC200C2A6A400000000000000000000000000B9A69700F3E3DC00F5E3 + DC00FFFFFF00FFFFFF00FFFFFF00FBFFFF00FDFFFF00FFFFFE00FFFFFF00FDFF + FF00E4D7CF00E9D7D000624837000000000000000000BBA69700D2BDA800D2BD + A800D2BDA800D2BDA800D2BDA800D2BDA800D2BDA800D2BDA800D2BDA800D2BD + A800D2BDA8006349350000000000000000008A9DA700BEF0F900B6EEF800B6EE + F800ABF0F700A5ECFB0095E5FC008BE2FC007EDCFC0071D3FA0065CCF70057C3 + F3004FBCF0001B99CF0065727C00000000000000000000000000C2A6A400FFEE + DE00FFEEDE00FFEEDE00FFEEDE00FFEEDE00FFEEDE00C3B4A800C3B4A800C3B4 + A800C3B4A800C2A6A400000000000000000000000000BBA69700F1E4DC00EEE4 + DA00F0E2DC00F3E2D900F3E2D900F0E0D900ECDED800EADDD500E9DDD300E9DD + D300EBD9D200E9D9D200644934000000000000000000BBA69700FFFFFF00FFFF + FF00FFFEFE00D2BDA800FDFAF900FAF1ED00F9EDE800D2BDA800F7E7DF00F7E4 + DC00F5E1D7006349350000000000000000008FA4AC00BEF0F900BEF0F900BEF0 + F900BEF0F900B4F2F800ABEDFB00A5ECFB0095E5FC008ADFFC007EDCFC0075D5 + FA006ACAF4005DC5F40065727C00000000000000000000000000C2A6A400FFEE + DE00FFEAD700FFEEDE00FFEAD700FFEAD700FFEEDE00B0A29600B0A29600B0A2 + 9600B0A29600C2A6A400000000000000000000000000BBA59A00F3E3DD00F4E5 + DC00FDFFFF00FFFFFF00FFFFFE00FFFFFE00FFFFFE00FFFFFE00FFFFFF00FFFE + FF00E8DCD200E9D9D200624A34000000000000000000BBA69700FFFFFF00FFFF + FF00FFFFFF00D2BDA800FEFCFB00FBF4F100FAF1EC00D2BDA800F8EAE300F7E7 + DF00F6E4DB006349350000000000000000008FA4AC008FA4AC008FA4AC008FA4 + AC008FA4AC008CA0A9008A9DA7008A9DA700869AA300869AA3008395A0008395 + A0008395A0008395A00000000000000000000000000000000000C2A6A400FFEA + D700FFEAD700FFEAD700FFEAD700FFEAD700C9B9AC00FEFAF500FEF7F000E6DA + D900C2A6A40000000000000000000000000000000000BBA59900F4E4DD00F5E2 + DD00F5E3DC00F2E2DB00F0E3DB00EFE1DB00EDE0D800EEDFD600EDDED500EDDD + D600EBDBD400ECDAD300634834000000000000000000BBA69700D2BDA800D2BD + A800D2BDA800D2BDA800D2BDA800D2BDA800D2BDA800D2BDA800D2BDA800D2BD + A800D2BDA8006349350000000000000000008FA4AC00B2E4EC00B6EEF800B6EE + F800A9ECF60092E1F3008FA4AC00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000C2A6A400FFEA + D700FFE6D000FFEAD700FFE6D000FFEAD700C5B5A900FEFAF500DDCFC200C2A6 + A4000000000000000000000000000000000000000000E1997100E1966F00E092 + 6E00E1926900DD8E6300DD895F00DC865C00DB815800D97D5200D6794C00D374 + 4800CF724100D06E3E00D26C3C000000000000000000BBA69700FFFFFF00FFFF + FF00FFFFFF00D2BDA800FFFFFF00FDFAF800FCF7F400D2BDA800FAF1EB00F9EE + E700F8EAE300634935000000000000000000000000008FA4AC008FA4AC008FA4 + AC008FA4AC008FA4AC0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000C2A6A400FFE6 + D000FFE6D000FFE6D000FFE6D000FFE6D000C9B9AC00DDCFC200C2A6A4000000 + 00000000000000000000000000000000000000000000E3977300E2977100DF93 + 6F00E0906B00DD8C6600DB896000D9855B00D7825500D47E5000D47A4B00D375 + 4700D2714500D56F3F00D06C3C000000000000000000BBA69700FFFFFF00FFFF + FF00FFFFFF00D2BDA800FFFFFF00FEFBFA00FDF9F700D2BDA800FBF3EF00FAF0 + EA00F9ECE6006349350000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000C2A6A400C2A6 + A400C2A6A400C2A6A400C2A6A400C2A6A400C2A6A400C2A6A400000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000BBA69700BBA69700BBA6 + 9700BBA69700BBA69700BBA69700BBA69700BBA69700BBA69700BBA69700BBA6 + 9700BBA69700BBA697000000000000000000424D3E000000000000003E000000 + 2800000040000000440000000100010000000000200200000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFF + BA3FBA3FAABBBA20ABBFABBF98ABABA0AA7FAA7FAAABAA608000800080009320 + 800080008000FF00800080008000FF00800080008000FC00800080008000CC00 + 800080008000C00080008000800080008000800080002003800080008000F003 + 800080008000F00F800080008000A00F8000800080000FFFFFFFFFFFFFFF9FFF + FFFFFFFFFFFFFFFFBA3FBA3FBA3FBA3FAB80ABBFABBFAB81AA40AA7FAA7FAA41 + 93008000933F9301FFC08000FE7FFFC1FFC08000FE3FFFC1FFC08000811FFFF7 + FFC08000810FFFF7004080008187FFF7007F80008183FFE3007F800081C183C1 + 00638000818083800073800081838000006B800081C18380000F8000FFC083C1 + 007FFFFFFFFFFFE3FFFFFFFFFFFFFFFFFFFFC003BA3F8AFFFFFFC003AB80B8C0 + FFFFC003AA40BAC00001C003930088C00001C0038000FFC00001C0038000FFC0 + 0001C003800080000001C003800080000001C003800080000001C00380018003 + 0001C003800180030001C003800180030003C0078001800301FFC00F80018003 + 83FFC01F80018003FFFFC03FFFFF8003} + end + object MSConnection: TMSConnection + Database = 'master' + ConnectDialog = MSConnectDialog1 + Left = 465 + Top = 10 + end + object MSConnectDialog1: TMSConnectDialog + Caption = 'Connect' + UsernameLabel = 'User Name' + PasswordLabel = 'Password' + ServerLabel = 'Server' + DatabaseLabel = 'Database' + ConnectButton = 'Connect' + CancelButton = 'Cancel' + LabelSet = lsCustom + Left = 500 + Top = 10 + end + object scCreate: TMSScript + SQL.Strings = ( + 'CREATE TABLE SDAC_Long_char (' + ' Code INT IDENTITY (1, 1) PRIMARY KEY,' + ' Title VARCHAR(30),' + ' Value VARCHAR(5000)' + ');' + '' + 'CREATE TABLE SDAC_Pictures (' + ' UID int IDENTITY (1, 1) PRIMARY KEY NOT NULL,' + ' Name VARCHAR(50),' + ' Picture IMAGE' + ');' + '' + 'CREATE TABLE Loaded1 (' + ' uid INT IDENTITY (1, 1) NOT NULL PRIMARY KEY,' + ' Field1 VARCHAR(20),' + ' Field2 VARCHAR(20),' + ' Field3 VARCHAR(20)' + ');' + '' + 'CREATE TABLE Loaded2 (' + ' uid INT IDENTITY (1, 1) NOT NULL PRIMARY KEY,' + ' Field1 VARCHAR(20),' + ' Field2 VARCHAR(20),' + ' Field3 VARCHAR(20)' + ');' + '' + 'CREATE TABLE ThreadTable (' + ' ID INT,' + ' NAME VARCHAR(30)' + ');' + '' + 'CREATE TABLE SDAC_Text (' + ' UID INT IDENTITY PRIMARY KEY,' + ' [Name] NVARCHAR(50),' + ' TextField TEXT' + ');' + '' + 'CREATE TABLE Sdac_Loaded (' + ' Code INT,' + ' Num INT,' + ' Num1 FLOAT,' + ' Str VARCHAR(50),' + ' Dat DATETIME' + ');' + '' + 'CREATE TABLE CRGRID_TEST(' + ' Id int PRIMARY KEY,' + ' Name VARCHAR(10),' + ' Country VARCHAR(30),' + ' City VARCHAR(30),' + ' Street VARCHAR(30),' + ' BirthDate DATETIME,' + ' Job VARCHAR(9),' + ' Hiredate DATETIME,' + ' Sal NUMERIC(7, 2),' + ' Remarks TEXT' + ');' + '' + 'INSERT INTO CRGRID_TEST ' + + ' (Id, Name, Country, City, Street, BirthDate, Job, HireDate, Sa' + + 'l)' + 'VALUES ' + + ' (5001, '#39'SMITH'#39', '#39'ENGLAND'#39', '#39'LONDON'#39', '#39'BOND st.'#39', '#39'12-OCT-63'#39', ' + + #39'CLERK'#39','#39'17-DEC-80'#39', 800);' + 'INSERT INTO CRGRID_TEST' + + ' (Id, Name, Country, City, Street, BirthDate, Job, HireDate, Sa' + + 'l)' + 'VALUES ' + + ' (5002, '#39'ALLEN'#39', '#39'ENGLAND'#39', '#39'LONDON'#39', '#39'BAKER st.'#39', '#39'04-MAR-61'#39',' + + ' '#39'SALESMAN'#39','#39'20-FEB-81'#39', 1600);' + 'INSERT INTO CRGRID_TEST ' + + ' (Id, Name, Country, City, Street, BirthDate, Job, HireDate, Sa' + + 'l)' + 'VALUES ' + + ' (5003, '#39'MARTIN'#39', '#39'FRANCE'#39', '#39'LION'#39', '#39'WEAVER st.'#39', '#39'23-JAN-57'#39', ' + + #39'MANAGER'#39','#39'02-APR-81'#39', 2900);' + ' ' + ' CREATE TABLE DEPT (' + ' DEPTNO INT PRIMARY KEY,' + ' DNAME VARCHAR(14),' + ' LOC VARCHAR(13)' + ');' + 'INSERT INTO DEPT VALUES (10,'#39'ACCOUNTING'#39','#39'NEW YORK'#39');' + 'INSERT INTO DEPT VALUES (20,'#39'RESEARCH'#39','#39'DALLAS'#39');' + 'INSERT INTO DEPT VALUES (30,'#39'SALES'#39','#39'CHICAGO'#39');' + 'INSERT INTO DEPT VALUES (40,'#39'OPERATIONS'#39','#39'BOSTON'#39');' + '' + 'CREATE TABLE emp (' + ' EMPNO int IDENTITY(1,1) NOT NULL PRIMARY KEY,' + ' ENAME varchar(10) default NULL,' + ' JOB varchar(9) default NULL,' + ' MGR int default NULL,' + ' HIREDATE datetime default NULL,' + ' SAL float default NULL,' + ' COMM float default NULL,' + ' DEPTNO int default NULL' + ' );' + + 'INSERT INTO emp VALUES ('#39'SMITH'#39', '#39'CLERK'#39', 7902, '#39'1980-12-17 00:0' + + '0:00'#39', 800, NULL, 20);' + + 'INSERT INTO emp VALUES ('#39'ALLEN'#39', '#39'SALESMAN'#39', 7698, '#39'1981-02-20 0' + + '0:00:00'#39', 1600, 300, 30);' + + 'INSERT INTO emp VALUES ('#39'WARD'#39', '#39'SALESMAN'#39', 7698, '#39'1981-02-22 00' + + ':00:00'#39', 1250, 500, 30);' + + 'INSERT INTO emp VALUES ('#39'JONES'#39', '#39'MANAGER'#39', 7839, '#39'1981-04-02 00' + + ':00:00'#39', 2975, NULL, 20);' + + 'INSERT INTO emp VALUES ('#39'MARTIN'#39', '#39'SALESMAN'#39', 7698, '#39'1981-09-28 ' + + '00:00:00'#39', 1250, 1400, 30);' + + 'INSERT INTO emp VALUES ('#39'BLAKE'#39', '#39'MANAGER'#39', 7839, '#39'1981-05-01 00' + + ':00:00'#39', 2850, NULL, 30);' + + 'INSERT INTO emp VALUES ('#39'CLARK'#39', '#39'MANAGER'#39', 7839, '#39'1981-06-09 00' + + ':00:00'#39', 2450, NULL, 10);' + + 'INSERT INTO emp VALUES ('#39'SCOTT'#39', '#39'ANALYST'#39', 7566, '#39'1987-07-13 00' + + ':00:00'#39', 3000, NULL, 20);' + + 'INSERT INTO emp VALUES ('#39'KING'#39', '#39'PRESIDENT'#39', NULL, '#39'1981-11-17 0' + + '0:00:00'#39', 5000, NULL, 10);' + + 'INSERT INTO emp VALUES ('#39'TURNER'#39', '#39'SALESMAN'#39', 7698, '#39'1981-09-08 ' + + '00:00:00'#39', 1500, 0, 30);' + + 'INSERT INTO emp VALUES ('#39'ADAMS'#39', '#39'CLERK'#39', 7788, '#39'1987-07-13 00:0' + + '0:00'#39', 1100, NULL, 20);' + + 'INSERT INTO emp VALUES ('#39'JAMES'#39', '#39'CLERK'#39', 7698, '#39'1981-12-03 00:0' + + '0:00'#39', 950, NULL, 30);' + + 'INSERT INTO emp VALUES ('#39'FORD'#39', '#39'ANALYST'#39', 7566, '#39'1981-12-03 00:' + + '00:00'#39', 3000, NULL, 20);' + + 'INSERT INTO emp VALUES ('#39'MILLER'#39', '#39'CLERK'#39', 7782, '#39'1982-01-23 00:' + + '00:00'#39', 1300, NULL, 10);' + '' + 'GO' + '' + 'CREATE PROCEDURE SDAC_InsertEmp ' + #9'@ENAME'#9'nvarchar(20),' + #9'@JOB'#9'nvarchar(10)' + 'AS' + #9'INSERT INTO ' + #9#9'EMP (ENAME, JOB) ' + #9'VALUES' + #9#9'(@ENAME, @JOB) ' + #9'RETURN @@Identity;' + '' + 'GO' + '' + 'CREATE PROCEDURE SDAC_UpdateEmp ' + #9'@EMPNO'#9'int,' + #9'@ENAME'#9'nvarchar(20),' + #9'@JOB'#9'nvarchar(10),' + ' @EMPINFO nvarchar(30) OUTPUT' + 'AS' + #9'UPDATE EMP' + #9'SET ' + #9#9'ENAME = @ENAME, JOB = @JOB ' + #9'WHERE' + #9#9'EMPNO = @EMPNO' + ' SET @EMPINFO = CAST(@EMPNO AS nvarchar) + '#39' '#39' + @JOB' + ' RETURN @EMPNO;' + '' + 'GO' + '' + 'CREATE PROCEDURE SDAC_DeleteEmp ' + #9'@EMPNO'#9'int,' + #9'@Result'#9'int OUTPUT' + 'AS' + #9'DELETE Emp' + #9'WHERE' + #9#9'EmpNO = @EmpNO' + #9'SET @Result = @EmpNO + 2;' + '' + 'GO' + '' + 'CREATE PROCEDURE "Ten Most High-Paid Employees" AS' + 'BEGIN' + ' SET ROWCOUNT 10' + ' SELECT Emp.EName AS TenMostHighPaidEmployees, Emp.SAL' + ' FROM Emp' + ' ORDER BY Emp.SAL DESC' + ' SET ROWCOUNT 0' + 'END;'#9) + OnError = OnScriptError + Connection = MSConnection + Left = 465 + Top = 45 + end + object scDrop: TMSScript + SQL.Strings = ( + + 'IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'#39'[' + + 'Loaded1]'#39') AND OBJECTPROPERTY(id, N'#39'IsUserTable'#39') = 1)' + ' DROP TABLE [Loaded1];' + + 'IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'#39'[' + + 'Loaded2]'#39') AND OBJECTPROPERTY(id, N'#39'IsUserTable'#39') = 1)' + ' DROP TABLE [Loaded2];' + + 'IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'#39'[' + + 'SDAC_Long_char]'#39') AND OBJECTPROPERTY(id, N'#39'IsUserTable'#39') = 1)' + ' DROP TABLE [SDAC_Long_char];' + + 'IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'#39'[' + + 'SDAC_Pictures]'#39') AND OBJECTPROPERTY(id, N'#39'IsUserTable'#39') = 1)' + ' DROP TABLE [SDAC_Pictures];' + + 'IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'#39'[' + + 'dbo].[SDAC_DeleteEmp]'#39') AND OBJECTPROPERTY(id, N'#39'IsProcedure'#39') =' + + ' 1)' + ' DROP PROCEDURE [dbo].[SDAC_DeleteEmp];' + + 'IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'#39'[' + + 'dbo].[SDAC_InsertEmp]'#39') AND OBJECTPROPERTY(id, N'#39'IsProcedure'#39') =' + + ' 1)' + ' DROP PROCEDURE [dbo].[SDAC_InsertEmp];' + + 'IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'#39'[' + + 'dbo].[SDAC_UpdateEmp]'#39') AND OBJECTPROPERTY(id, N'#39'IsProcedure'#39') =' + + ' 1)' + ' DROP PROCEDURE [dbo].[SDAC_UpdateEmp];' + + 'IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'#39'[' + + 'ThreadTable]'#39') AND OBJECTPROPERTY(id, N'#39'IsUserTable'#39') = 1)' + ' DROP TABLE [ThreadTable];' + + 'IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'#39'[' + + 'SDAC_Text]'#39') AND OBJECTPROPERTY(id, N'#39'IsUserTable'#39') = 1)' + ' DROP TABLE [SDAC_Text];' + + 'IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'#39'[' + + 'SDAC_Loaded]'#39') AND OBJECTPROPERTY(id, N'#39'IsUserTable'#39') = 1)' + ' DROP TABLE [SDAC_Loaded];' + + 'IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'#39'[' + + 'dbo].[Ten Most High-Paid Employees]'#39') AND OBJECTPROPERTY(id, N'#39'I' + + 'sProcedure'#39') = 1)' + ' DROP PROCEDURE [dbo].[Ten Most High-Paid Employees];' + + 'IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'#39'[' + + 'CRGRID_TEST]'#39') AND OBJECTPROPERTY(id, N'#39'IsUserTable'#39') = 1)' + ' DROP TABLE [CRGRID_TEST];' + + 'IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'#39'[' + + 'SDAC_Loaded]'#39') AND OBJECTPROPERTY(id, N'#39'IsUserTable'#39') = 1)' + ' DROP TABLE [SDAC_Loaded];' + + 'IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'#39'[' + + 'emp]'#39') AND OBJECTPROPERTY(id, N'#39'IsUserTable'#39') = 1)' + ' DROP TABLE [emp];' + + 'IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'#39'[' + + 'dept]'#39') AND OBJECTPROPERTY(id, N'#39'IsUserTable'#39') = 1)' + ' DROP TABLE [dept];') + OnError = OnScriptError + Connection = MSConnection + Left = 500 + Top = 46 + end +end diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Base/SdacDemoForm.pas b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Base/SdacDemoForm.pas new file mode 100644 index 0000000..db2a022 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Base/SdacDemoForm.pas @@ -0,0 +1,184 @@ +{$I DacDemo.inc} +unit SdacDemoForm; + +interface + +uses + SysUtils, Classes, DB, + {$IFDEF VER6P} + Variants, + {$ENDIF} + Windows, Messages, Graphics, Controls, Forms, SdacVcl, + Dialogs, Menus, ImgList, StdCtrls, ComCtrls, Buttons, ExtCtrls, ToolWin, + DBAccess, MSAccess, SdacAbout, DemoFrame, DemoForm, DemoBase, DAScript, + MSScript; + +type + TSdacForm = class(TDemoForm) + MSConnection: TMSConnection; + MSConnectDialog1: TMSConnectDialog; + scCreate: TMSScript; + scDrop: TMSScript; + procedure lbAboutClick(Sender: TObject); override; + procedure cbDebugClick(Sender: TObject); + private + { Private declarations } + protected + //Product customization + function GetConnection: TCustomDAConnection; override; + function ApplicationTitle: string; override; + function ProductName: string; override; + procedure RegisterDemos; override; + public + function ProductColor: TColor; override; + procedure ExecCreateScript; override; + procedure ExecDropScript; override; + end; + +var + SdacForm: TSdacForm; + +implementation + +uses + CachedUpdates, +{$IFDEF CRDBGRID} + CRDBGrid, +{$ENDIF} + ConnectDialog, FetchAll, LongStrings, MasterDetail, + Pictures, Query, ServerCursors, Sql, StoredProc, StoredProcUpdates, +{$IFNDEF STD} + ServiceBroker, +{$ENDIF} +{$IFDEF WIN32} + Threads, +{$ENDIF} + FilterAndIndex, Table, Text, UpdateSQL, VTable{$IFNDEF STD}, Loader{$ENDIF}; + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} + +function TSdacForm.GetConnection: TCustomDAConnection; +begin + Result := MSConnection; +end; + +function TSdacForm.ProductColor: TColor; +begin + Result := clGreen; +end; + +procedure TSdacForm.ExecCreateScript; +begin + scCreate.Execute; +end; + +procedure TSdacForm.ExecDropScript; +begin + scDrop.Execute; +end; + +function TSdacForm.ApplicationTitle: string; +begin + Result := 'SQL Server Data Access Components demos'; +end; + +function TSdacForm.ProductName: string; +begin + Result := 'SDAC'; +end; + +procedure TSdacForm.RegisterDemos; +begin + Demos.RegisterCategory('SDAC Demo', 'SDAC Demo'); + Demos.RegisterCategory('Working with components', 'Working with components'); + Demos.RegisterCategory('General demos', 'General demos'); + Demos.RegisterCategory('SQL Server specific', 'SQL Server specific'); + + Demos.RegisterDemo('ConnectDialog', 'Customizing login dialog', 'Demonstrates how to customize the SDAC connect dialog. Changes the standard SDAC connect dialog to two custom connect dialogs. The first customized sample dialog is inherited from the TForm class, ' + 'and the second one is inherited from the default SDAC connect dialog class.', 'Working with components', TConnectDialogFrame, 2); +{$IFDEF CRDBGRID} + Demos.RegisterDemo('CRDBGrid', 'Using TCRDBGrid component', 'Demonstrates how to work with the TCRDBGrid component. Shows off the main TCRDBGrid features, like filtering, searching, stretching, using compound headers, and more.', 'Working with components', TCRDBGridFrame, 3); +{$ENDIF} +{$IFNDEF STD} + Demos.RegisterDemo('Loader', 'Using TMSLoader component', 'Uses the TMSLoader component to quickly load data into a server table. This demo also compares the two TMSLoader data loading handlers: GetColumnData and PutData.', 'Working with components', TLoaderFrame, 4); +{$ENDIF} + Demos.RegisterDemo('Query', 'Using TMSQuery component', 'Demonstrates working with TMSQuery, which is one of the most useful SDAC components. Includes many TMSQuery usage scenarios. Demonstrates how to execute queries in both standard and NonBlocking mode' + ' and how to edit data and export it to XML files. Note: This is a very good introductory demo. We recommend starting here when first becoming familiar with SDAC.', 'Working with components', TQueryFrame, 5); + Demos.RegisterDemo('Sql', 'Using TMSSQL component', 'Uses the TMSSQL component to execute SQL statements. Demonstrates how to work in a separate thread, in standard mode, in NonBlocking mode, and how to break long-duration query execution.', 'Working with components', TSqlFrame, 6); + Demos.RegisterDemo('StoredProc', 'Using TMSStoredProc component', 'Uses the TMSStoredProc component to access an editable recordset from an MS SQL stored procedure in the client application.', 'Working with components', TStoredProcFrame, 7); + Demos.RegisterDemo('Table', 'Using TMSTable component', 'Demonstrates how to use TMSTable to work with data from a single table on the server without manually writing any SQL queries. Performs server-side data sorting and filtering and retrieves results for browsing and editing.', 'Working with components', TTableFrame, 8); + Demos.RegisterDemo('UpdateSQL', 'Using TMSUpdateSQL component', 'Demonstrates using the TMSUpdateSQL component to customize update commands. Lets you optionally use TMSSQL and TMSQuery objects for carrying out insert, delete, query, and update commands.', 'Working with components', TUpdateSQLFrame, 9); + Demos.RegisterDemo('VirtualTable', 'Using TVirtualTable component', 'Demonstrates working with the TVirtualTable component. This sample shows how to fill virtual dataset with data from other datasets, filter data by a given criteria, locate specified records, perform file operations, and change data and table structure.', 'Working with components', TVirtualTableFrame, 10, 'VTable'); +{$IFNDEF STD} + Demos.RegisterDemo('ServiceBroker', 'Using TMSServiceBroker component', 'Demonstrates working with the TMSServiceBroker component. This sample shows how to organize simple messaging.', 'Working with components', TServiceBrokerFrame, 11); +{$ENDIF} + + Demos.RegisterDemo('CachedUpdates', 'Cached updates, transaction control', 'Demonstrates how to perform the most important tasks of working with data in CachedUpdates mode, including highlighting uncommitted changes, managing transactions, and committing changes in a batch.', 'General demos', TCachedUpdatesFrame, 1); + Demos.RegisterDemo('FetchAll', 'Illustrates how to open TMSQuery with or without fetching all data to client', 'Demonstrates how to open a query that returns a large recordset using different values of the FetchAll option. This demo lets the user to fill in the table used in the query.', 'General demos', TFetchAllFrame, 1); + Demos.RegisterDemo('FilterAndIndex', 'Using Filter and IndexFieldNames', 'Demonstrates SDAC''s local storage functionality. This sample shows how to perform local filtering, sorting and locating by multiple fields, including by calculated and lookup fields.', 'General demos', TFilterAndIndexFrame, 1); Demos.RegisterDemo('MasterDetail', 'Master/detail relationship', 'Master/detail relationship', 'General demos', TMasterDetailFrame, 1); + Demos.RegisterDemo('Pictures', 'Working with BLOB field', 'Uses SDAC functionality to work with graphics. The sample demonstrates how to retrieve binary data from MS SQL database and display it on visual components. Sample also shows how to load and save pictures to files and to the database.', 'General demos', TPicturesFrame, 1); + Demos.RegisterDemo('StoredProcUpdates', 'Using StoredProcs to Insert, Update and Delete with TMSQuery component', 'Demonstrates updating a recordset using stored procedures. Update events are tied to stored procedure calls in design time, and every recordset change causes the corresponding stored procedure call to be performed. ' + 'The commands to call stored procedures are stored in the SQLInsert, SQLDelete, SQLUpdate properties of TMSQuery.', 'General demos', TStoredProcUpdatesFrame, 1); +{$IFNDEF CLR} + Demos.RegisterDemo('Threads', 'Using Sdac in multi-threaded environment', 'Demonstrates how SDAC can be used in multithreaded applications. This sample allows you to set up several threads and test SDAC''s performance with multithreading.', 'General demos', TThreadsFrame, 1); +{$ENDIF} + Demos.RegisterDemo('LongStrings', 'Working with string fields', 'Demonstrates SDAC functionality for working with long string fields (fields that have more than 256 characters). Shows the different ways they can be displayed as memo fields and string fields.', 'SQL Server specific', TLongStringsFrame, 1); + Demos.RegisterDemo('ServerCursors', 'Open and navigate using client and server cursor types', 'Compares performance of opening a large recordset with different cursor types: client cursor in FetchAll=True mode, client cursor in FetchAll=False mode, and server cursor.', 'SQL Server specific', TServerCursorsFrame, 1); + Demos.RegisterDemo('Text', 'Working with long string fields', 'Uses SDAC functionality to work with text. The sample demonstrates how to retrieve text data from MS SQL database and display it on visual components. Sample also shows how to load and save text to files and to the database.', 'SQL Server specific', TTextFrame, 1); + + Demos.RegisterCategory('Miscellaneous', '', -1, True); +{$IFDEF CLR} + Demos.RegisterDemo('AspNet', 'AspNet', 'Uses MSDataAdapter to create a simple ASP .NET application. This demo shows how to create an ASP.NET application that lets you connect to a database and execute queries. ' + 'Application displays query results in a DataGrid and sends user changes back to the database.', 'Miscellaneous', nil, 1, '', True); +{$ENDIF} +{$IFNDEF CLR} + Demos.RegisterDemo('Dll', 'Dll', 'Demonstrates creating and loading DLLs for SDAC-based projects. This demo project consists of two parts - an MS_Dll project that creates a DLL of a form that sends a query to the server and displays its results, ' + 'and an MS_Exe project that can be executed to display a form for loading and running this DLL. Allows you to build a dll for one SDAC-based project and load and test it from a separate application.', 'Miscellaneous', nil, 1, '', True); +{$ENDIF} + Demos.RegisterDemo('FailOver', 'FailOver', 'Demonstrates the recommended approach to working with unstable networks. This sample lets you perform transactions and updates in several different modes, ' + 'simulate a sudden session termination, and view what happens to your data state when connections to the server are unexpectedly lost. Shows off CachedUpdates, LocalMasterDetail, FetchAll, Pooling, and different Failover modes.', 'Miscellaneous', nil, 1, '', True); +{$IFNDEF CLR} + Demos.RegisterDemo('Midas', 'Midas', 'Demonstrates using MIDAS technology with SDAC. This project consists of two parts: a MIDAS server that processes requests to the database and a thin MIDAS client that displays an interactive grid. ' + 'This demo shows how to build thin clients that display interactive components and delegate all database interaction to a server application for processing.', 'Miscellaneous', nil, 1, '', True); + Demos.RegisterDemo('Performance', 'Performance', 'Measures SDAC performance on several types of queries. This project lets you compare SDAC performance to BDE, ADO, and dbExpress. Tests the following functionality: Fetch, Master/Detail, ' + 'Stored Procedure Call, Multi Executing, and Insert/Post.', 'Miscellaneous', nil, 1, '', True); +{$ENDIF} +{$IFDEF CLR} + Demos.RegisterDemo('WinForms', 'AspNet', 'Shows how to use SDAC to create a WinForm application. This demo project creates a simple WinForms application and fills a data grid from an MSDataAdapter data source.', 'Miscellaneous', nil, 1, '', True); +{$ENDIF} + +{$IFNDEF CLR} + Demos.RegisterCategory('', '', -1, True); +{$ENDIF} + Demos.RegisterCategory('TechnologySpecific', '', -1, True); + Demos.RegisterDemo('MSSQLCompact', 'MSSQLCompact', 'Demonstrates how to create applications that work with MS SQL Server Compact Edition. Demo connects to a database and opens a table. If the specified database does not exists, it will be created automatically.', 'TechnologySpecific', nil, 1, '', True); +{$IFNDEF CLR} + Demos.RegisterCategory('', '', -1, True); +{$ENDIF} + +{$IFNDEF CLR} + Demos.RegisterCategory('ThirdParty', '', -1, True); + Demos.RegisterDemo('FastReport', 'FastReport hint', 'Demonstrates how SDAC can be used with FastReport components. This project consists of two parts. The first part is several packages that integrate SDAC components into the FastReport editor. ' + 'The second part is a demo application that lets you design and preview reports with SDAC technology in the FastReport editor.', 'ThirdParty', nil, 1, '', True); + Demos.RegisterDemo('InfoPower', 'InfoPower hint', 'Uses InfoPower components to display recordsets retrieved with SDAC. This demo project displays an InfoPower grid component and fills it with the result of an SDAC query. Shows how to link SDAC data sources to InfoPower components.', 'ThirdParty', nil, 1, '', True); + Demos.RegisterDemo('IntraWeb', 'IntraWeb hint', 'A collection of sample projects that show how to use SDAC components as data sources for IntraWeb applications. Contains IntraWeb samples for setting up a connection, querying ' + 'a database and modifying data and working with CachedUpdates and MasterDetail relationships.', 'ThirdParty', nil, 1, '', True); + Demos.RegisterDemo('QuickReport', 'QuickReport hint', 'Lets you launch and view a QuickReport application based on SDAC. This demo project lets you modify the application in design-time.', 'ThirdParty', nil, 1, '', True); + Demos.RegisterDemo('ReportBuilder', 'ReportBuilder hint', 'Uses SDAC data sources to create a ReportBuilder report that takes data from an MS SQL database. This demo project shows how to set up a ReportBuilder document in design-time and how to integrate SDAC components into the ' + 'Report Builder editor to perform document design in run-time.', 'ThirdParty', nil, 1, '', True); +{$ENDIF} +{$IFNDEF CLR} + Demos.RegisterCategory('', '', -1, True); +{$ENDIF} + +end; + +procedure TSdacForm.lbAboutClick(Sender: TObject); +begin + inherited; + SdacAboutForm.ShowModal; +end; + +procedure TSdacForm.cbDebugClick(Sender: TObject); +begin + inherited; + scCreate.Debug := (Sender as TCheckBox).Checked; + scDrop.Debug := (Sender as TCheckBox).Checked; +end; + +end. + diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/CRDBGrid/CRDBGrid.nfm b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/CRDBGrid/CRDBGrid.nfm new file mode 100644 index 0000000..717f548 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/CRDBGrid/CRDBGrid.nfm @@ -0,0 +1,264 @@ +inherited CRDBGridFrame: TCRDBGridFrame + Width = 441 + Height = 275 + Align = alClient + object CRDBGrid: TCRDBGrid + Left = 0 + Top = 51 + Width = 441 + Height = 224 + OptionsEx = [dgeLocalFilter, dgeLocalSorting] + Align = alClient + DataSource = DataSource + TabOrder = 0 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + Columns = < + item + Expanded = False + FieldName = 'ID' + Width = 63 + Visible = True + end + item + Expanded = False + FieldName = 'NAME' + Title.Caption = 'PERSON|NAME' + Width = 63 + Visible = True + end + item + Expanded = False + FieldName = 'COUNTRY' + Title.Caption = 'PERSON|ADDRESS|COUNTRY' + Width = 63 + Visible = True + end + item + Expanded = False + FieldName = 'CITY' + Title.Caption = 'PERSON|ADDRESS|CITY' + Width = 63 + Visible = True + end + item + Expanded = False + FieldName = 'STREET' + Title.Caption = 'PERSON|ADDRESS|STREET' + Width = 63 + Visible = True + end + item + Expanded = False + FieldName = 'BIRTHDATE' + Title.Caption = 'PERSON|BIRTHDATE' + Width = 63 + Visible = True + end + item + Expanded = False + FieldName = 'JOB' + Title.Caption = 'JOB|JOB NAME' + Width = 63 + Visible = True + end + item + Expanded = False + FieldName = 'HIREDATE' + Title.Caption = 'JOB|HIREDATE' + Width = 63 + Visible = True + end + item + Expanded = False + FieldName = 'SAL' + Title.Caption = 'JOB|SAL' + Width = 63 + Visible = True + end + item + Expanded = False + FieldName = 'REMARKS' + Width = 63 + Visible = True + end> + end + object Panel2: TPanel + Left = 0 + Top = 0 + Width = 441 + Height = 51 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object Panel1: TPanel + Left = 1 + Top = 1 + Width = 438 + Height = 49 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btOpen: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Open' + Flat = True + Transparent = False + OnClick = btOpenClick + end + object btClose: TSpeedButton + Left = 84 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Close' + Flat = True + Transparent = False + OnClick = btCloseClick + end + object Panel3: TPanel + Left = 1 + Top = 24 + Width = 436 + Height = 24 + BevelOuter = bvNone + TabOrder = 0 + object chkFiltered: TCheckBox + Left = 5 + Top = 4 + Width = 65 + Height = 17 + Caption = 'Filtered' + TabOrder = 0 + OnClick = chkFilteredClick + end + object chkFilterBar: TCheckBox + Left = 91 + Top = 4 + Width = 65 + Height = 17 + Action = actFilterBar + TabOrder = 1 + end + object chkSearchBar: TCheckBox + Left = 178 + Top = 4 + Width = 81 + Height = 17 + Action = actSearchBar + TabOrder = 2 + end + object chkRecCount: TCheckBox + Left = 265 + Top = 4 + Width = 89 + Height = 17 + Caption = 'Record Count' + TabOrder = 3 + OnClick = chkRecCountClick + end + object chkStretch: TCheckBox + Left = 368 + Top = 4 + Width = 57 + Height = 17 + Caption = 'Stretch' + TabOrder = 4 + OnClick = chkStretchClick + end + end + object DBNavigator1: TDBNavigator + Left = 167 + Top = 1 + Width = 270 + Height = 22 + Flat = True + TabOrder = 1 + end + end + end + object MSQuery: TMSQuery + Connection = SDACForm.MSConnection + SQL.Strings = ( + 'SELECT * FROM crgrid_test') + Left = 8 + Top = 88 + end + object DataSource: TDataSource + DataSet = MSQuery + Left = 40 + Top = 88 + end + object ActionList1: TActionList + Left = 72 + Top = 96 + object actSearchBar: TAction + Caption = 'Search Bar' + OnExecute = actSearchBarExecute + OnUpdate = actSearchBarUpdate + end + object actFilterBar: TAction + Caption = 'Filter Bar' + OnExecute = actFilterBarExecute + OnUpdate = actFilterBarUpdate + end + end + object scCreate: TMSSQL + SQL.Strings = ( + 'CREATE TABLE CRGRID_TEST(' + ' Id int PRIMARY KEY,' + ' Name VARCHAR(10),' + ' Country VARCHAR(30),' + ' City VARCHAR(30),' + ' Street VARCHAR(30),' + ' BirthDate DATETIME,' + ' Job VARCHAR(9),' + ' Hiredate DATETIME,' + ' Sal NUMERIC(7, 2),' + ' Remarks TEXT' + ');' + '' + 'INSERT INTO CRGRID_TEST ' + + ' (Id, Name, Country, City, Street, BirthDate, Job, HireDate, Sa' + + 'l)' + 'VALUES ' + + ' (5001, '#39'SMITH'#39', '#39'ENGLAND'#39', '#39'LONDON'#39', '#39'BOND st.'#39', '#39'12-OCT-63'#39', ' + + #39'CLERK'#39','#39'17-DEC-80'#39', 800);' + '' + 'INSERT INTO CRGRID_TEST' + + ' (Id, Name, Country, City, Street, BirthDate, Job, HireDate, Sa' + + 'l)' + 'VALUES ' + + ' (5002, '#39'ALLEN'#39', '#39'ENGLAND'#39', '#39'LONDON'#39', '#39'BAKER st.'#39', '#39'04-MAR-61'#39',' + + ' '#39'SALESMAN'#39','#39'20-FEB-81'#39', 1600);' + '' + 'INSERT INTO CRGRID_TEST ' + + ' (Id, Name, Country, City, Street, BirthDate, Job, HireDate, Sa' + + 'l)' + 'VALUES ' + + ' (5003, '#39'MARTIN'#39', '#39'FRANCE'#39', '#39'LION'#39', '#39'WEAVER st.'#39', '#39'23-JAN-57'#39', ' + + #39'MANAGER'#39','#39'02-APR-81'#39', 2900);') + CommandTimeout = 0 + Left = 448 + Top = 8 + end + object scDrop: TMSSQL + SQL.Strings = ( + 'DROP TABLE CRGRID_TEST') + CommandTimeout = 0 + Left = 488 + Top = 8 + end +end diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/CRDBGrid/CRDBGrid.pas b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/CRDBGrid/CRDBGrid.pas new file mode 100644 index 0000000..d0eb5bf --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/CRDBGrid/CRDBGrid.pas @@ -0,0 +1,129 @@ +unit CRDBGrid; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + Db, MemDS, DBAccess, Grids, DBGrids, CRGrid, StdCtrls, + ActnList, ExtCtrls, DBCtrls, MSAccess, SdacVcl, + Buttons, DemoFrame, SdacDemoForm; + +type + TCRDBGridFrame = class(TDemoFrame) + MSQuery: TMSQuery; + DataSource: TDataSource; + ActionList1: TActionList; + actSearchBar: TAction; + actFilterBar: TAction; + scCreate: TMSSQL; + scDrop: TMSSQL; + CRDBGrid: TCRDBGrid; + Panel2: TPanel; + Panel1: TPanel; + btOpen: TSpeedButton; + btClose: TSpeedButton; + Panel3: TPanel; + chkFiltered: TCheckBox; + chkFilterBar: TCheckBox; + chkSearchBar: TCheckBox; + chkRecCount: TCheckBox; + chkStretch: TCheckBox; + DBNavigator1: TDBNavigator; + procedure btOpenClick(Sender: TObject); + procedure btCloseClick(Sender: TObject); + procedure actSearchBarExecute(Sender: TObject); + procedure actSearchBarUpdate(Sender: TObject); + procedure actFilterBarExecute(Sender: TObject); + procedure actFilterBarUpdate(Sender: TObject); + procedure chkFilteredClick(Sender: TObject); + procedure chkRecCountClick(Sender: TObject); + procedure chkStretchClick(Sender: TObject); + private + { Private declarations } + public + // Demo management + procedure Initialize; override; + procedure SetDebug(Value: boolean); override; + end; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} + +procedure TCRDBGridFrame.btOpenClick(Sender: TObject); +begin + MSQuery.Open; +end; + +procedure TCRDBGridFrame.btCloseClick(Sender: TObject); +begin + MSQuery.Close; +end; + +procedure TCRDBGridFrame.actSearchBarExecute(Sender: TObject); +begin + actSearchBar.Checked := not actSearchBar.Checked; + if actSearchBar.Checked then + CRDBGrid.OptionsEx := CRDBGrid.OptionsEx + [dgeSearchBar] + else + CRDBGrid.OptionsEx := CRDBGrid.OptionsEx - [dgeSearchBar]; +end; + +procedure TCRDBGridFrame.actSearchBarUpdate(Sender: TObject); +begin + actSearchBar.Checked := dgeSearchBar in CRDBGrid.OptionsEx; +end; + +procedure TCRDBGridFrame.actFilterBarExecute(Sender: TObject); +begin + actFilterBar.Checked := not actFilterBar.Checked; + if actFilterBar.Checked then + CRDBGrid.OptionsEx := CRDBGrid.OptionsEx + [dgeFilterBar] + else + CRDBGrid.OptionsEx := CRDBGrid.OptionsEx - [dgeFilterBar]; +end; + +procedure TCRDBGridFrame.actFilterBarUpdate(Sender: TObject); +begin + actFilterBar.Checked := dgeFilterBar in CRDBGrid.OptionsEx; +end; + +procedure TCRDBGridFrame.chkFilteredClick(Sender: TObject); +begin + CRDBGrid.Filtered := chkFiltered.Checked; +end; + +procedure TCRDBGridFrame.chkRecCountClick(Sender: TObject); +begin + if chkRecCount.Checked then + CRDBGrid.OptionsEx := CRDBGrid.OptionsEx + [dgeRecordCount] + else + CRDBGrid.OptionsEx := CRDBGrid.OptionsEx - [dgeRecordCount]; +end; + +procedure TCRDBGridFrame.chkStretchClick(Sender: TObject); +begin + if chkStretch.Checked then + CRDBGrid.OptionsEx := CRDBGrid.OptionsEx + [dgeStretch] + else + CRDBGrid.OptionsEx := CRDBGrid.OptionsEx - [dgeStretch]; +end; + +// Demo management +procedure TCRDBGridFrame.Initialize; +begin + inherited; + MSQuery.Connection := Connection as TMSConnection; +end; + +procedure TCRDBGridFrame.SetDebug(Value: boolean); +begin + MSQuery.Debug := Value; +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/CachedUpdates/CachedUpdates.nfm b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/CachedUpdates/CachedUpdates.nfm new file mode 100644 index 0000000..5eb14e3 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/CachedUpdates/CachedUpdates.nfm @@ -0,0 +1,372 @@ +inherited CachedUpdatesFrame: TCachedUpdatesFrame + Width = 443 + Height = 277 + Align = alClient + object DBGrid: TDBGrid + Left = 0 + Top = 102 + Width = 443 + Height = 175 + Align = alClient + DataSource = DataSource + Options = [dgEditing, dgTitles, dgIndicator, dgColumnResize, dgColLines, dgRowLines, dgTabs, dgCancelOnExit] + TabOrder = 0 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + OnDrawDataCell = DBGridDrawDataCell + end + object Panel8: TPanel + Left = 0 + Top = 0 + Width = 443 + Height = 102 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object ToolBar: TPanel + Left = 1 + Top = 1 + Width = 667 + Height = 100 + BevelOuter = bvNone + Color = clGreen + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + ParentFont = False + TabOrder = 0 + object btOpen: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Open' + Flat = True + Transparent = False + OnClick = btOpenClick + end + object btClose: TSpeedButton + Left = 84 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Close' + Flat = True + Transparent = False + OnClick = btCloseClick + end + object RefreshRecord: TSpeedButton + Left = 408 + Top = 1 + Width = 82 + Height = 22 + Caption = 'RefreshRecord' + Flat = True + Transparent = False + OnClick = RefreshRecordClick + end + object DBNavigator: TDBNavigator + Left = 167 + Top = 1 + Width = 240 + Height = 22 + DataSource = DataSource + Flat = True + TabOrder = 0 + end + object Panel1: TPanel + Left = 1 + Top = 47 + Width = 368 + Height = 52 + BevelOuter = bvNone + TabOrder = 1 + object Label2: TLabel + Left = 5 + Top = 5 + Width = 48 + Height = 13 + Caption = 'Updates' + Font.Charset = DEFAULT_CHARSET + Font.Color = clMaroon + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + end + object Panel3: TPanel + Left = 20 + Top = 23 + Width = 333 + Height = 24 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btApply: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Apply' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clMaroon + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + Transparent = False + OnClick = btApplyClick + end + object btCommit: TSpeedButton + Left = 84 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Commit' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clMaroon + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + Transparent = False + OnClick = btCommitClick + end + object btCancel: TSpeedButton + Left = 167 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Cancel' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clMaroon + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + Transparent = False + OnClick = btCancelClick + end + object btRevertRecord: TSpeedButton + Left = 250 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Revert' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clMaroon + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + Transparent = False + OnClick = btRevertRecordClick + end + end + end + object Panel2: TPanel + Left = 1 + Top = 24 + Width = 317 + Height = 22 + BevelOuter = bvNone + TabOrder = 2 + object Label4: TLabel + Left = 220 + Top = 5 + Width = 51 + Height = 13 + Caption = 'Batch Size' + end + object cbCachedUpdates: TCheckBox + Left = 8 + Top = 4 + Width = 97 + Height = 12 + Caption = 'CachedUpdates' + TabOrder = 0 + OnClick = cbCachedUpdatesClick + end + object cbCustomUpdate: TCheckBox + Left = 113 + Top = 4 + Width = 97 + Height = 14 + Caption = 'Custom Update' + TabOrder = 1 + OnClick = cbCustomUpdateClick + end + object edUpdateBatchSize: TEdit + Left = 276 + Top = 1 + Width = 37 + Height = 21 + TabOrder = 2 + Text = '1' + end + end + object Panel4: TPanel + Left = 370 + Top = 47 + Width = 296 + Height = 52 + BevelOuter = bvNone + TabOrder = 3 + object Label3: TLabel + Left = 5 + Top = 5 + Width = 74 + Height = 13 + Caption = 'Transactions' + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + end + object Panel5: TPanel + Left = 24 + Top = 23 + Width = 250 + Height = 24 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btStartTrans: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Start' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + Transparent = False + OnClick = btStartTransClick + end + object btCommitTrans: TSpeedButton + Left = 84 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Commit' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + Transparent = False + OnClick = btCommitTransClick + end + object btRollBackTrans: TSpeedButton + Left = 167 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Rollback' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + Transparent = False + OnClick = btRollbackTransClick + end + end + end + object Panel6: TPanel + Left = 319 + Top = 24 + Width = 347 + Height = 22 + BevelOuter = bvNone + TabOrder = 4 + object Label1: TLabel + Left = 6 + Top = 4 + Width = 64 + Height = 13 + Caption = 'RecordTypes' + end + object cbDeleted: TCheckBox + Left = 284 + Top = 4 + Width = 59 + Height = 17 + Caption = 'Deleted' + TabOrder = 0 + OnClick = cbDeletedClick + end + object cbInserted: TCheckBox + Left = 221 + Top = 4 + Width = 61 + Height = 17 + Caption = 'Inserted' + TabOrder = 1 + OnClick = cbInsertedClick + end + object cbModified: TCheckBox + Left = 155 + Top = 4 + Width = 67 + Height = 17 + Caption = 'Modified' + TabOrder = 2 + OnClick = cbModifiedClick + end + object cbUnmodified: TCheckBox + Left = 77 + Top = 4 + Width = 76 + Height = 17 + Caption = 'Unmodified' + TabOrder = 3 + OnClick = cbUnmodifiedClick + end + end + object Panel7: TPanel + Left = 491 + Top = 1 + Width = 175 + Height = 22 + BevelOuter = bvNone + TabOrder = 5 + end + end + end + object DataSource: TDataSource + DataSet = MSQuery + OnStateChange = DataSourceStateChange + OnDataChange = DataSourceDataChange + Left = 233 + Top = 50 + end + object MSQuery: TMSQuery + SQL.Strings = ( + 'SELECT * FROM Emp') + CachedUpdates = True + OnUpdateError = MSQueryUpdateError + OnCalcFields = MSQueryCalcFields + Left = 205 + Top = 48 + end +end diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/CachedUpdates/CachedUpdates.pas b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/CachedUpdates/CachedUpdates.pas new file mode 100644 index 0000000..7d6313f --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/CachedUpdates/CachedUpdates.pas @@ -0,0 +1,319 @@ +unit CachedUpdates; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + DBCtrls, ExtCtrls, Db, Grids, DBGrids, MemDS, StdCtrls, ToolWin, + ComCtrls, Buttons, DBAccess, MSAccess, SdacVcl, + DemoFrame, SdacDemoForm; + +type + TCachedUpdatesFrame = class(TDemoFrame) + DBGrid: TDBGrid; + DataSource: TDataSource; + MSQuery: TMSQuery; + Panel8: TPanel; + ToolBar: TPanel; + btOpen: TSpeedButton; + btClose: TSpeedButton; + RefreshRecord: TSpeedButton; + DBNavigator: TDBNavigator; + Panel1: TPanel; + Label2: TLabel; + Panel3: TPanel; + btApply: TSpeedButton; + btCommit: TSpeedButton; + btCancel: TSpeedButton; + btRevertRecord: TSpeedButton; + Panel2: TPanel; + cbCachedUpdates: TCheckBox; + cbCustomUpdate: TCheckBox; + Panel4: TPanel; + Label3: TLabel; + Panel5: TPanel; + btStartTrans: TSpeedButton; + btCommitTrans: TSpeedButton; + btRollBackTrans: TSpeedButton; + Panel6: TPanel; + Label1: TLabel; + cbDeleted: TCheckBox; + cbInserted: TCheckBox; + cbModified: TCheckBox; + cbUnmodified: TCheckBox; + Panel7: TPanel; + Label4: TLabel; + edUpdateBatchSize: TEdit; + procedure btOpenClick(Sender: TObject); + procedure btCloseClick(Sender: TObject); + procedure btApplyClick(Sender: TObject); + procedure btCancelClick(Sender: TObject); + procedure btStartTransClick(Sender: TObject); + procedure btCommitTransClick(Sender: TObject); + procedure btRollbackTransClick(Sender: TObject); + procedure cbCachedUpdatesClick(Sender: TObject); + procedure MSQueryUpdateError(DataSet: TDataSet; E: EDatabaseError; + UpdateKind: TUpdateKind; var UpdateAction: TUpdateAction); + procedure MSQueryUpdateRecord(DataSet: TDataSet; + UpdateKind: TUpdateKind; var UpdateAction: TUpdateAction); + procedure cbCustomUpdateClick(Sender: TObject); + procedure MSQueryCalcFields(DataSet: TDataSet); + procedure btCommitClick(Sender: TObject); + procedure cbUnmodifiedClick(Sender: TObject); + procedure cbModifiedClick(Sender: TObject); + procedure cbInsertedClick(Sender: TObject); + procedure cbDeletedClick(Sender: TObject); + procedure DataSourceDataChange(Sender: TObject; Field: TField); + procedure DataSourceStateChange(Sender: TObject); + procedure DBGridDrawDataCell(Sender: TObject; const Rect: TRect; + Field: TField; State: TGridDrawState); + procedure btRevertRecordClick(Sender: TObject); + procedure RefreshRecordClick(Sender: TObject); + private + { Private declarations } + procedure ShowTrans; + procedure ShowPending; + procedure ShowUpdateRecordTypes; + public + destructor Destroy; override; + + // Demo management + procedure Initialize; override; + procedure SetDebug(Value: boolean); override; + end; + +implementation + +uses + UpdateAction; + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} + +procedure TCachedUpdatesFrame.ShowTrans; +begin + if MSQuery.Connection .InTransaction then + SdacForm.StatusBar.Panels[2].Text := 'In Transaction' + else + SdacForm.StatusBar.Panels[2].Text := ''; +end; + +procedure TCachedUpdatesFrame.ShowPending; +begin + if MSQuery.UpdatesPending then + SdacForm.StatusBar.Panels[1].Text := 'Updates Pending' + else + SdacForm.StatusBar.Panels[1].Text := ''; +end; + +procedure TCachedUpdatesFrame.ShowUpdateRecordTypes; +begin + if MSQuery.CachedUpdates then begin + cbUnmodified.Checked := rtUnmodified in MSQuery.UpdateRecordTypes; + cbModified.Checked := rtModified in MSQuery.UpdateRecordTypes; + cbInserted.Checked := rtInserted in MSQuery.UpdateRecordTypes; + cbDeleted.Checked := rtDeleted in MSQuery.UpdateRecordTypes; + end; +end; + +procedure TCachedUpdatesFrame.btOpenClick(Sender: TObject); +begin + MSQuery.Open; +end; + +procedure TCachedUpdatesFrame.btCloseClick(Sender: TObject); +begin + MSQuery.Close; +end; + +procedure TCachedUpdatesFrame.btApplyClick(Sender: TObject); +begin + MSQuery.Options.UpdateBatchSize := StrToInt(edUpdateBatchSize.Text); + MSQuery.ApplyUpdates; + ShowPending; +end; + +procedure TCachedUpdatesFrame.btCommitClick(Sender: TObject); +begin + MSQuery.CommitUpdates; + ShowPending; +end; + +procedure TCachedUpdatesFrame.btCancelClick(Sender: TObject); +begin + MSQuery.CancelUpdates; + ShowPending; +end; + +procedure TCachedUpdatesFrame.btStartTransClick(Sender: TObject); +begin + MSQuery.Connection.StartTransaction; + ShowTrans; +end; + +procedure TCachedUpdatesFrame.btCommitTransClick(Sender: TObject); +begin + MSQuery.Connection.Commit; + ShowTrans; +end; + +procedure TCachedUpdatesFrame.btRollbackTransClick(Sender: TObject); +begin + MSQuery.Connection.Rollback; + ShowTrans; +end; + +destructor TCachedUpdatesFrame.Destroy; +begin + FreeAndNil(UpdateActionForm); + inherited; +end; + +procedure TCachedUpdatesFrame.cbCachedUpdatesClick(Sender: TObject); +begin + try + MSQuery.CachedUpdates := cbCachedUpdates.Checked; + except + cbCachedUpdates.Checked := MSQuery.CachedUpdates; + raise; + end; + ShowUpdateRecordTypes; +end; + +procedure TCachedUpdatesFrame.MSQueryUpdateError(DataSet: TDataSet; E: EDatabaseError; + UpdateKind: TUpdateKind; var UpdateAction: TUpdateAction); +begin + UpdateActionForm.rgAction.ItemIndex := Ord(UpdateAction); + UpdateActionForm.rgKind.ItemIndex := Ord(UpdateKind); + UpdateActionForm.lbField.Caption := String(DataSet.Fields[0].Value); + UpdateActionForm.lbMessage.Caption := E.Message; + UpdateActionForm.ShowModal; + UpdateAction := TUpdateAction(UpdateActionForm.rgAction.ItemIndex); +end; + +procedure TCachedUpdatesFrame.MSQueryUpdateRecord(DataSet: TDataSet; + UpdateKind: TUpdateKind; var UpdateAction: TUpdateAction); +begin + UpdateActionForm.rgAction.ItemIndex := Ord(UpdateAction); + UpdateActionForm.rgKind.ItemIndex := Ord(UpdateKind); + UpdateActionForm.lbField.Caption := String(DataSet.Fields[0].NewValue); + UpdateActionForm.lbMessage.Caption := ''; + UpdateActionForm.ShowModal; + UpdateAction := TUpdateAction(UpdateActionForm.rgAction.ItemIndex); +end; + +procedure TCachedUpdatesFrame.cbCustomUpdateClick(Sender: TObject); +begin + if cbCustomUpdate.Checked then + MSQuery.OnUpdateRecord := MSQueryUpdateRecord + else + MSQuery.OnUpdateRecord := nil; +end; + +procedure TCachedUpdatesFrame.MSQueryCalcFields(DataSet: TDataSet); +var + St:string; +begin + case Ord(TCustomMSDataSet(DataSet).UpdateStatus) of + 0: St := 'Unmodified'; + 1: St := 'Modified'; + 2: St := 'Inserted'; + 3: St := 'Deleted'; + end; + DataSet.FieldByName('Status').AsString := St; + +{ case Ord(TMSDataSet(DataSet).UpdateResult) of + 0: St := 'Fail'; + 1: St := 'Abort'; + 2: St := 'Skip'; + 3: St := 'Applied'; + end; + DataSet.FieldByName('Result').AsString := St;} +end; + +procedure TCachedUpdatesFrame.cbUnmodifiedClick(Sender: TObject); +begin + if cbUnmodified.Checked then + MSQuery.UpdateRecordTypes := MSQuery.UpdateRecordTypes + [rtUnmodified] + else + MSQuery.UpdateRecordTypes := MSQuery.UpdateRecordTypes - [rtUnmodified]; +end; + +procedure TCachedUpdatesFrame.cbModifiedClick(Sender: TObject); +begin + if cbModified.Checked then + MSQuery.UpdateRecordTypes := MSQuery.UpdateRecordTypes + [rtModified] + else + MSQuery.UpdateRecordTypes := MSQuery.UpdateRecordTypes - [rtModified]; +end; + +procedure TCachedUpdatesFrame.cbInsertedClick(Sender: TObject); +begin + if cbInserted.Checked then + MSQuery.UpdateRecordTypes := MSQuery.UpdateRecordTypes + [rtInserted] + else + MSQuery.UpdateRecordTypes := MSQuery.UpdateRecordTypes - [rtInserted]; +end; + +procedure TCachedUpdatesFrame.cbDeletedClick(Sender: TObject); +begin + if cbDeleted.Checked then + MSQuery.UpdateRecordTypes := MSQuery.UpdateRecordTypes + [rtDeleted] + else + MSQuery.UpdateRecordTypes := MSQuery.UpdateRecordTypes - [rtDeleted]; +end; + +procedure TCachedUpdatesFrame.DataSourceStateChange(Sender: TObject); +begin + ShowPending; + SdacForm.StatusBar.Panels[3].Text := 'Record ' + IntToStr(MSQuery.RecNo) + ' of ' + IntToStr(MSQuery.RecordCount) ; +end; + +procedure TCachedUpdatesFrame.DataSourceDataChange(Sender: TObject; Field: TField); +begin + DataSourceStateChange(nil); +end; + +procedure TCachedUpdatesFrame.DBGridDrawDataCell(Sender: TObject; const Rect: TRect; + Field: TField; State: TGridDrawState); +begin + if MSQuery.UpdateResult in [uaFail,uaSkip] then + TDBGrid(Sender).Canvas.Brush.Color := clRed + else + if MSQuery.UpdateStatus <> usUnmodified then + TDBGrid(Sender).Canvas.Brush.Color := clYellow; + + TDBGrid(Sender).DefaultDrawDataCell(Rect, Field, State); +end; + +procedure TCachedUpdatesFrame.btRevertRecordClick(Sender: TObject); +begin + MSQuery.RevertRecord; + ShowPending; +end; + +procedure TCachedUpdatesFrame.RefreshRecordClick(Sender: TObject); +begin + MSQuery.RefreshRecord; +end; + +// Demo management +procedure TCachedUpdatesFrame.Initialize; +begin + inherited; + MSQuery.Connection := Connection as TMSConnection; + UpdateActionForm := TUpdateActionForm.Create(nil); + cbCachedUpdates.Checked := MSQuery.CachedUpdates; + ShowUpdateRecordTypes; +end; + +procedure TCachedUpdatesFrame.SetDebug(Value: boolean); +begin + MSQuery.Debug := Value; +end; + +end. \ No newline at end of file diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/CachedUpdates/UpdateAction.nfm b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/CachedUpdates/UpdateAction.nfm new file mode 100644 index 0000000..22e0817 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/CachedUpdates/UpdateAction.nfm @@ -0,0 +1,139 @@ +object UpdateActionForm: TUpdateActionForm + Left = 586 + Top = 306 + Width = 235 + Height = 300 + HorzScrollBar.Range = 199 + VertScrollBar.Range = 131 + AutoScroll = False + Caption = 'UpdateAction' + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = 11 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [] + OldCreateOrder = True + PixelsPerInch = 96 + TextHeight = 13 + object Panel1: TPanel + Left = 5 + Top = 4 + Width = 217 + Height = 262 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object Panel5: TPanel + Left = 1 + Top = 1 + Width = 215 + Height = 128 + BevelOuter = bvNone + TabOrder = 0 + object Label1: TLabel + Left = 6 + Top = 15 + Width = 46 + Height = 13 + Caption = 'Message:' + end + object Label2: TLabel + Left = 6 + Top = 1 + Width = 35 + Height = 13 + Caption = 'Record' + end + object lbField: TLabel + Left = 64 + Top = 2 + Width = 141 + Height = 13 + AutoSize = False + Caption = 'lbFileld' + end + object lbMessage: TLabel + Left = 7 + Top = 29 + Width = 201 + Height = 95 + AutoSize = False + Caption = 'lbMessage' + WordWrap = True + end + end + object Panel7: TPanel + Left = 1 + Top = 130 + Width = 98 + Height = 131 + BevelOuter = bvNone + TabOrder = 1 + object rgAction: TRadioGroup + Left = 6 + Top = 1 + Width = 87 + Height = 126 + Caption = 'UpdateAction' + Items.Strings = ( + 'Fail' + 'Abort' + 'Skip' + 'Retry' + 'Applied' + 'Default') + TabOrder = 0 + end + end + object Panel4: TPanel + Left = 100 + Top = 130 + Width = 116 + Height = 89 + BevelOuter = bvNone + TabOrder = 2 + object rgKind: TRadioGroup + Left = 7 + Top = 2 + Width = 103 + Height = 83 + Caption = 'UpdateKind' + Enabled = False + Items.Strings = ( + 'Modify' + 'Insert' + 'Delete') + TabOrder = 0 + end + end + object Panel9: TPanel + Left = 100 + Top = 220 + Width = 116 + Height = 41 + BevelOuter = bvNone + TabOrder = 3 + object Panel2: TPanel + Left = 16 + Top = 9 + Width = 84 + Height = 24 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btOk: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Ok' + Flat = True + Transparent = False + OnClick = btOkClick + end + end + end + end +end diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/CachedUpdates/UpdateAction.pas b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/CachedUpdates/UpdateAction.pas new file mode 100644 index 0000000..3322b25 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/CachedUpdates/UpdateAction.pas @@ -0,0 +1,48 @@ +unit UpdateAction; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + StdCtrls, ExtCtrls, Buttons; + +type + TUpdateActionForm = class(TForm) + Panel1: TPanel; + Panel5: TPanel; + Label1: TLabel; + Label2: TLabel; + lbField: TLabel; + lbMessage: TLabel; + Panel7: TPanel; + rgAction: TRadioGroup; + Panel4: TPanel; + rgKind: TRadioGroup; + Panel9: TPanel; + Panel2: TPanel; + btOk: TSpeedButton; + procedure btOkClick(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + end; + +var + UpdateActionForm: TUpdateActionForm; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} + +procedure TUpdateActionForm.btOkClick(Sender: TObject); +begin + ModalResult := mrOk; +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/ConnectDialog/ConnectDialog.nfm b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/ConnectDialog/ConnectDialog.nfm new file mode 100644 index 0000000..78c07d3 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/ConnectDialog/ConnectDialog.nfm @@ -0,0 +1,115 @@ +inherited ConnectDialogFrame: TConnectDialogFrame + Width = 441 + Height = 275 + Align = alClient + object DBGrid: TDBGrid + Left = 0 + Top = 54 + Width = 441 + Height = 221 + Align = alClient + DataSource = DataSource + TabOrder = 0 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object ToolBar: TPanel + Left = 0 + Top = 0 + Width = 441 + Height = 54 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object Panel1: TPanel + Left = 1 + Top = 1 + Width = 398 + Height = 52 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btOpen: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Open' + Flat = True + Transparent = False + OnClick = btOpenClick + end + object btClose: TSpeedButton + Left = 84 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Close' + Flat = True + Transparent = False + OnClick = btCloseClick + end + object DBNavigator: TDBNavigator + Left = 167 + Top = 1 + Width = 230 + Height = 22 + DataSource = DataSource + Flat = True + TabOrder = 0 + end + object Panel3: TPanel + Left = 1 + Top = 24 + Width = 396 + Height = 27 + BevelOuter = bvNone + TabOrder = 1 + object rbInherited: TRadioButton + Left = 216 + Top = 5 + Width = 113 + Height = 17 + Caption = 'Inherited connect' + TabOrder = 0 + OnClick = rbInheritedClick + end + object rbMy: TRadioButton + Left = 112 + Top = 5 + Width = 81 + Height = 17 + Caption = 'My connect' + TabOrder = 1 + OnClick = rbMyClick + end + object rbDefault: TRadioButton + Left = 8 + Top = 5 + Width = 65 + Height = 17 + Caption = 'Default' + Checked = True + TabOrder = 2 + TabStop = True + OnClick = rbDefaultClick + end + end + end + end + object DataSource: TDataSource + DataSet = MSQuery + Left = 464 + Top = 32 + end + object MSQuery: TMSQuery + Connection = SDACForm.MSConnection + SQL.Strings = ( + 'SELECT * FROM Emp') + Left = 432 + Top = 32 + end +end diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/ConnectDialog/ConnectDialog.pas b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/ConnectDialog/ConnectDialog.pas new file mode 100644 index 0000000..219c3f7 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/ConnectDialog/ConnectDialog.pas @@ -0,0 +1,93 @@ +unit ConnectDialog; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + Db, MemDS, Grids, DBGrids, DBCtrls, StdCtrls, ExtCtrls, DBAccess, + MSAccess, SdacVcl, Buttons, DemoFrame, + InheritedConnectForm, MyConnectForm; + +type + TConnectDialogFrame = class(TDemoFrame) + DataSource: TDataSource; + MSQuery: TMSQuery; + DBGrid: TDBGrid; + ToolBar: TPanel; + Panel1: TPanel; + btOpen: TSpeedButton; + btClose: TSpeedButton; + DBNavigator: TDBNavigator; + Panel3: TPanel; + rbInherited: TRadioButton; + rbMy: TRadioButton; + rbDefault: TRadioButton; + procedure btOpenClick(Sender: TObject); + procedure btCloseClick(Sender: TObject); + procedure rbDefaultClick(Sender: TObject); + procedure rbMyClick(Sender: TObject); + procedure rbInheritedClick(Sender: TObject); + private + { Private declarations } + public + destructor Destroy; override; + // Demo management + procedure Initialize; override; + procedure SetDebug(Value: boolean); override; + end; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} + +destructor TConnectDialogFrame.Destroy; +begin + MSQuery.Connection.ConnectDialog.DialogClass := ''; + inherited; +end; + + +procedure TConnectDialogFrame.btOpenClick(Sender: TObject); +begin + MSQuery.Open; +end; + +procedure TConnectDialogFrame.btCloseClick(Sender: TObject); +begin + MSQuery.Close; +end; + +procedure TConnectDialogFrame.rbDefaultClick(Sender: TObject); +begin + MSQuery.Connection.ConnectDialog.DialogClass := ''; +end; + +procedure TConnectDialogFrame.rbMyClick(Sender: TObject); +begin + MSQuery.Connection.ConnectDialog.DialogClass := 'TfmMyConnect'; +end; + +procedure TConnectDialogFrame.rbInheritedClick(Sender: TObject); +begin + MSQuery.Connection.ConnectDialog.DialogClass := 'TfmInheritedConnect'; +end; + +// Demo management +procedure TConnectDialogFrame.Initialize; +begin + inherited; + MSQuery.Connection := Connection as TMSConnection; +end; + +procedure TConnectDialogFrame.SetDebug(Value: boolean); +begin + MSQuery.Debug:= Value; +end; + +end. + diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/ConnectDialog/ConnectForm.nfm b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/ConnectDialog/ConnectForm.nfm new file mode 100644 index 0000000..722acee --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/ConnectDialog/ConnectForm.nfm @@ -0,0 +1,112 @@ +object ConnectForm: TConnectForm + Left = 368 + Top = 255 + ActiveControl = edUsername + BorderIcons = [] + BorderStyle = bsDialog + Caption = 'Connect' + ClientHeight = 175 + ClientWidth = 291 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + Scaled = False + PixelsPerInch = 96 + TextHeight = 13 + object Panel: TPanel + Left = 8 + Top = 8 + Width = 273 + Height = 121 + BevelInner = bvRaised + BevelOuter = bvLowered + FullRepaint = False + TabOrder = 0 + object lbUsername: TLabel + Left = 16 + Top = 20 + Width = 73 + Height = 13 + AutoSize = False + Caption = 'Username' + Layout = tlCenter + end + object lbPassword: TLabel + Left = 16 + Top = 54 + Width = 73 + Height = 13 + AutoSize = False + Caption = 'Password' + Layout = tlCenter + end + object lbServer: TLabel + Left = 16 + Top = 88 + Width = 73 + Height = 13 + AutoSize = False + Caption = 'Server' + Layout = tlCenter + end + object edUsername: TEdit + Left = 104 + Top = 16 + Width = 153 + Height = 21 + AutoSelect = False + MaxLength = 32767 + TabOrder = 0 + end + object edPassword: TEdit + Left = 104 + Top = 50 + Width = 153 + Height = 21 + AutoSelect = False + MaxLength = 32767 + PasswordChar = '*' + TabOrder = 1 + end + object edServer: TComboBox + Left = 104 + Top = 84 + Width = 153 + Height = 21 + DropDownCount = 10 + ItemHeight = 13 + TabOrder = 2 + end + end + object btConnect: TButton + Left = 52 + Top = 141 + Width = 89 + Height = 25 + Caption = 'Connect' + Default = True + TabOrder = 1 + OnClick = btConnectClick + end + object btCancel: TButton + Left = 148 + Top = 141 + Width = 89 + Height = 25 + Cancel = True + Caption = 'Cancel' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + ModalResult = 2 + ParentFont = False + TabOrder = 2 + end +end diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/ConnectDialog/ConnectForm.pas b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/ConnectDialog/ConnectForm.pas new file mode 100644 index 0000000..09cd94c --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/ConnectDialog/ConnectForm.pas @@ -0,0 +1,123 @@ + +////////////////////////////////////////////////// +// MS SQL Server Data Access Components +// Copyright © 1998-2001 Core Lab. All right reserved. +// Connect Form +////////////////////////////////////////////////// + +unit ConnectForm; +interface +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + StdCtrls, ExtCtrls, DBAccess, OLEDBAccess, OLEDBIntf, OLEDBC; + +type + TConnectForm = class(TForm) + Panel: TPanel; + lbUsername: TLabel; + lbPassword: TLabel; + lbServer: TLabel; + edUsername: TEdit; + btConnect: TButton; + btCancel: TButton; + edPassword: TEdit; + edServer: TComboBox; + procedure btConnectClick(Sender: TObject); + + private + FConnectDialog: TCustomConnectDialog; + FRetries: integer; + FOldCreateOrder: boolean; + FRetry: boolean; + + procedure SetConnectDialog(Value: TCustomConnectDialog); + + protected + procedure DoInit; virtual; + procedure DoConnect; virtual; + + public + + published + property ConnectDialog: TCustomConnectDialog read FConnectDialog write SetConnectDialog; + + property OldCreateOrder: boolean read FOldCreateOrder write FOldCreateOrder; + end; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} + +procedure TConnectForm.DoInit; +begin + FRetry := False; + FRetries := FConnectDialog.Retries; + Caption := FConnectDialog.Caption; + + with FConnectDialog do begin + lbUsername.Caption := UsernameLabel; + lbPassword.Caption := PasswordLabel; + lbServer.Caption := ServerLabel; + btConnect.Caption := ConnectButton; + btCancel.Caption := CancelButton; + + FConnectDialog.GetServerList(edServer.Items); + edUsername.Text := Connection.Username; + edPassword.Text := Connection.Password; + edServer.Text := Connection.Server; + + if (edUsername.Text <> '') and (edPassword.Text = '') then + ActiveControl := edPassword; + end; +end; + +procedure TConnectForm.DoConnect; +begin + FConnectDialog.Connection.Password := edPassword.Text; + FConnectDialog.Connection.Server := edServer.Text; + FConnectDialog.Connection.UserName := edUsername.Text; + try + FConnectDialog.Connection.PerformConnect(FRetry); + ModalResult := mrOk; + except + on E: EMSError do begin + Dec(FRetries); + FRetry := True; + if FRetries = 0 then + ModalResult := mrCancel; + + if E.MSSQLErrorCode <= NE_MAX_NETERROR then + ActiveControl := edServer + else + if E.OLEDBErrorCode = DB_SEC_E_AUTH_FAILED then + if ActiveControl <> edUsername then + ActiveControl := edPassword; + raise; + end + else + raise; + end; +end; + +procedure TConnectForm.SetConnectDialog(Value: TCustomConnectDialog); +begin + FConnectDialog := Value; + DoInit; +end; + +procedure TConnectForm.btConnectClick(Sender: TObject); +begin + DoConnect; +end; + +initialization + if GetClass('TConnectForm') = nil then + Classes.RegisterClass(TConnectForm); +// Classes.GroupDescendentsWith(TConnectForm, TForm); +end. + diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/ConnectDialog/InheritedConnectForm.nfm b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/ConnectDialog/InheritedConnectForm.nfm new file mode 100644 index 0000000..3eba499 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/ConnectDialog/InheritedConnectForm.nfm @@ -0,0 +1,43 @@ +inherited fmInheritedConnect: TfmInheritedConnect + Left = 359 + Top = 212 + Caption = 'Inherited Connect' + PixelsPerInch = 96 + TextHeight = 13 + inherited Panel: TPanel + BevelOuter = bvNone + inherited lbUsername: TLabel + Width = 80 + Font.Color = clNavy + Font.Style = [fsBold] + ParentFont = False + end + inherited lbPassword: TLabel + Width = 55 + Font.Color = clNavy + Font.Style = [fsBold] + ParentFont = False + end + inherited lbServer: TLabel + Width = 38 + Font.Color = clNavy + Font.Style = [fsBold] + ParentFont = False + end + inherited lbDatabase: TLabel + Font.Color = clNavy + Font.Style = [fsBold] + ParentFont = False + end + end + inherited btConnect: TButton + Left = 98 + Width = 82 + Height = 22 + end + inherited btCancel: TButton + Left = 193 + Width = 82 + Height = 22 + end +end diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/ConnectDialog/InheritedConnectForm.pas b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/ConnectDialog/InheritedConnectForm.pas new file mode 100644 index 0000000..a937a48 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/ConnectDialog/InheritedConnectForm.pas @@ -0,0 +1,32 @@ +unit InheritedConnectForm; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + StdCtrls, Mask, ExtCtrls, MSConnectForm; + +type + TfmInheritedConnect = class(TMSConnectForm) + private + { Private declarations } + public + { Public declarations } + end; + +var + fmInheritedConnect: TfmInheritedConnect; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} + +initialization + if GetClass('TfmInheritedConnect') = nil then + Classes.RegisterClass(TfmInheritedConnect); +end. diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/ConnectDialog/MyConnectForm.nfm b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/ConnectDialog/MyConnectForm.nfm new file mode 100644 index 0000000..d9a93b0 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/ConnectDialog/MyConnectForm.nfm @@ -0,0 +1,151 @@ +object fmMyConnect: TfmMyConnect + Left = 305 + Top = 192 + BorderStyle = bsDialog + Caption = 'My Connect' + ClientHeight = 216 + ClientWidth = 288 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + PixelsPerInch = 96 + TextHeight = 13 + object Panel: TPanel + Left = 8 + Top = 8 + Width = 273 + Height = 201 + BevelInner = bvRaised + BevelOuter = bvLowered + TabOrder = 0 + object lbUsername: TLabel + Left = 16 + Top = 20 + Width = 54 + Height = 13 + Caption = 'Username' + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsItalic] + ParentFont = False + end + object lbPassword: TLabel + Left = 16 + Top = 54 + Width = 52 + Height = 13 + Caption = 'Password' + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsItalic] + ParentFont = False + end + object lbServer: TLabel + Left = 16 + Top = 88 + Width = 37 + Height = 13 + Caption = 'Server' + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsItalic] + ParentFont = False + end + object Bevel1: TBevel + Left = 1 + Top = 150 + Width = 270 + Height = 6 + Shape = bsBottomLine + end + object lbDatabase: TLabel + Left = 16 + Top = 122 + Width = 52 + Height = 13 + Caption = 'Database' + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsItalic] + ParentFont = False + end + object edUsername: TEdit + Left = 104 + Top = 16 + Width = 153 + Height = 21 + TabOrder = 0 + end + object edPassword: TMaskEdit + Left = 104 + Top = 50 + Width = 153 + Height = 21 + PasswordChar = '*' + TabOrder = 1 + end + object edServer: TComboBox + Left = 104 + Top = 84 + Width = 153 + Height = 21 + ItemHeight = 13 + TabOrder = 2 + end + object edDatabase: TEdit + Left = 104 + Top = 118 + Width = 153 + Height = 21 + TabOrder = 3 + end + end + object btConnect: TBitBtn + Left = 81 + Top = 174 + Width = 82 + Height = 24 + Caption = 'OK' + Default = True + TabOrder = 1 + OnClick = btConnectClick + Glyph.Data = { + DE010000424DDE01000000000000760000002800000024000000120000000100 + 0400000000006801000000000000000000001000000000000000000000000000 + 80000080000000808000800000008000800080800000C0C0C000808080000000 + FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00333333333333 + 3333333333333333333333330000333333333333333333333333F33333333333 + 00003333344333333333333333388F3333333333000033334224333333333333 + 338338F3333333330000333422224333333333333833338F3333333300003342 + 222224333333333383333338F3333333000034222A22224333333338F338F333 + 8F33333300003222A3A2224333333338F3838F338F33333300003A2A333A2224 + 33333338F83338F338F33333000033A33333A222433333338333338F338F3333 + 0000333333333A222433333333333338F338F33300003333333333A222433333 + 333333338F338F33000033333333333A222433333333333338F338F300003333 + 33333333A222433333333333338F338F00003333333333333A22433333333333 + 3338F38F000033333333333333A223333333333333338F830000333333333333 + 333A333333333333333338330000333333333333333333333333333333333333 + 0000} + NumGlyphs = 2 + end + object btCancel: TBitBtn + Left = 177 + Top = 174 + Width = 82 + Height = 24 + TabOrder = 2 + Kind = bkCancel + end +end diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/ConnectDialog/MyConnectForm.pas b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/ConnectDialog/MyConnectForm.pas new file mode 100644 index 0000000..6ed1db5 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/ConnectDialog/MyConnectForm.pas @@ -0,0 +1,128 @@ +unit MyConnectForm; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, OLEDBIntf, + OLEDBC, StdCtrls, Mask, ExtCtrls, Buttons, MSAccess, OLEDBAccess, DBAccess, SdacVcl; + +type + TfmMyConnect = class(TForm) + Panel: TPanel; + lbUsername: TLabel; + lbPassword: TLabel; + lbServer: TLabel; + edUsername: TEdit; + edPassword: TMaskEdit; + edServer: TComboBox; + btConnect: TBitBtn; + btCancel: TBitBtn; + Bevel1: TBevel; + edDatabase: TEdit; + lbDatabase: TLabel; + procedure btConnectClick(Sender: TObject); + private + FConnectDialog: TMSConnectDialog; + FRetries:integer; + FRetry: boolean; + + procedure SetConnectDialog(Value: TMSConnectDialog); + + protected + procedure DoInit; virtual; + procedure DoConnect; virtual; + + public + + published + property ConnectDialog: TMSConnectDialog read FConnectDialog write SetConnectDialog; + + end; + +var + fmMyConnect: TfmMyConnect; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} + +procedure TfmMyConnect.DoInit; +begin + FRetry := False; + FRetries := FConnectDialog.Retries; + Caption := FConnectDialog.Caption; + + lbUsername.Caption := FConnectDialog.UsernameLabel; + lbPassword.Caption := FConnectDialog.PasswordLabel; + lbServer.Caption := FConnectDialog.ServerLabel; + btConnect.Caption := FConnectDialog.ConnectButton; + btCancel.Caption := FConnectDialog.CancelButton; + + FConnectDialog.GetServerList(edServer.Items); + edUsername.Text := FConnectDialog.Connection.Username; + edPassword.Text := FConnectDialog.Connection.Password; + edServer.Text := FConnectDialog.Connection.Server; + edDatabase.Text := FConnectDialog.Connection.Database; + + if (edUsername.Text <> '') and (edPassword.Text = '') then + ActiveControl := edPassword; +end; + +procedure TfmMyConnect.DoConnect; +begin + FConnectDialog.Connection.Password := edPassword.Text; + FConnectDialog.Connection.Server := edServer.Text; + FConnectDialog.Connection.UserName := edUsername.Text; + FConnectDialog.Connection.Database := edDatabase.Text; + try + FConnectDialog.Connection.PerformConnect(FRetry); + ModalResult := mrOk; + except + on E: EMSError do begin + Dec(FRetries); + FRetry := True; + if FRetries = 0 then + ModalResult := mrCancel; + + if E.MSSQLErrorCode <= NE_MAX_NETERROR then + ActiveControl := edServer + else + if E.OLEDBErrorCode = DB_SEC_E_AUTH_FAILED then + if ActiveControl <> edUsername then + ActiveControl := edPassword; + raise; + end + else + raise; + end; +end; + +procedure TfmMyConnect.SetConnectDialog(Value: TMSConnectDialog); +begin + FConnectDialog:= Value; + DoInit; +end; + +procedure TfmMyConnect.btConnectClick(Sender: TObject); +begin + DoConnect; +end; + +initialization + if GetClass('TfmMyConnect') = nil then begin + {$IFDEF VER6P} + Classes.StartClassGroup(TfmMyConnect); + {$ENDIF} + Classes.RegisterClass(TfmMyConnect); + {$IFDEF VER6P} + ActivateClassGroup(TfmMyConnect); + {$ENDIF} + end; + +end. + diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/FetchAll/FetchAll.nfm b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/FetchAll/FetchAll.nfm new file mode 100644 index 0000000..216a2cf --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/FetchAll/FetchAll.nfm @@ -0,0 +1,188 @@ +inherited FetchAllFrame: TFetchAllFrame + Width = 691 + Height = 277 + Align = alClient + object Splitter1: TSplitter + Left = 0 + Top = 105 + Width = 691 + Height = 2 + Cursor = crVSplit + Align = alTop + Color = clGreen + ParentColor = False + end + object DBGrid: TDBGrid + Left = 0 + Top = 107 + Width = 691 + Height = 170 + Align = alClient + DataSource = DataSource + TabOrder = 0 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object ToolBar: TPanel + Left = 0 + Top = 0 + Width = 691 + Height = 25 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object Panel1: TPanel + Left = 1 + Top = 0 + Width = 727 + Height = 24 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btClose: TSpeedButton + Left = 84 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Close' + Flat = True + Transparent = False + OnClick = btCloseClick + end + object btOpen: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Open' + Flat = True + Transparent = False + OnClick = btOpenClick + end + object btFillTables: TSpeedButton + Left = 480 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Fill tables' + Flat = True + Transparent = False + OnClick = btFillTablesClick + end + object DBNavigator: TDBNavigator + Left = 167 + Top = 1 + Width = 230 + Height = 22 + DataSource = DataSource + Flat = True + TabOrder = 0 + end + object Panel2: TPanel + Left = 398 + Top = 1 + Width = 81 + Height = 22 + BevelOuter = bvNone + TabOrder = 1 + object FetchAllCB: TCheckBox + Left = 9 + Top = 4 + Width = 70 + Height = 17 + Caption = 'FetchAll' + TabOrder = 0 + OnClick = FetchAllCBClick + end + end + object Panel3: TPanel + Left = 563 + Top = 1 + Width = 163 + Height = 22 + BevelOuter = bvNone + TabOrder = 2 + object Label1: TLabel + Left = 6 + Top = 5 + Width = 52 + Height = 13 + Caption = 'Row count' + end + object edRowCount: TEdit + Left = 68 + Top = 2 + Width = 91 + Height = 21 + TabOrder = 0 + Text = '3000' + end + end + end + end + object Memo: TMemo + Left = 0 + Top = 25 + Width = 691 + Height = 80 + Align = alTop + ScrollBars = ssVertical + TabOrder = 2 + end + object DataSource: TDataSource + DataSet = MSQuery + Left = 528 + Top = 120 + end + object MSQuery: TMSQuery + Connection = SDACForm.MSConnection + SQL.Strings = ( + 'select TOP 100000 * from Loaded1, Loaded2') + ReadOnly = True + FetchAll = False + Left = 496 + Top = 120 + end + object MSSQLFillTables: TMSSQL + Connection = SDACForm.MSConnection + SQL.Strings = ( + 'declare' + ' @i INTEGER;' + 'begin' + ' SET @i = 0' + ' WHILE @i <= :Cnt' + ' BEGIN' + ' SET @i = @i + 1' + ' INSERT INTO Loaded1 (' + ' Field1,' + ' Field2,' + ' Field3)' + ' VALUES (' + ' '#39'01234567890123456789'#39',' + ' '#39'12345678901234567890'#39',' + ' '#39'23456789012345678901'#39');' + ' INSERT INTO Loaded2 (' + ' Field1,' + ' Field2,' + ' Field3)' + ' VALUES (' + ' '#39'01234567890123456789'#39',' + ' '#39'12345678901234567890'#39',' + ' '#39'23456789012345678901'#39');' + ' END;' + 'end;') + CommandTimeout = 0 + Left = 525 + Top = 60 + ParamData = < + item + DataType = ftInteger + Name = 'Cnt' + ParamType = ptInput + Value = 1000 + end> + end +end diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/FetchAll/FetchAll.pas b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/FetchAll/FetchAll.pas new file mode 100644 index 0000000..15d7b36 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/FetchAll/FetchAll.pas @@ -0,0 +1,100 @@ +unit FetchAll; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + DBCtrls, ExtCtrls, Db, Grids, DBGrids, StdCtrls, ToolWin, SdacVcl, + ComCtrls, Buttons, MemDS, DBAccess, MSAccess, OLEDBAccess, DemoFrame, + SdacDemoForm; + +type + TFetchAllFrame = class(TDemoFrame) + DBGrid: TDBGrid; + DataSource: TDataSource; + ToolBar: TPanel; + Memo: TMemo; + MSQuery: TMSQuery; + Panel1: TPanel; + btClose: TSpeedButton; + DBNavigator: TDBNavigator; + btOpen: TSpeedButton; + Splitter1: TSplitter; + Panel2: TPanel; + FetchAllCB: TCheckBox; + btFillTables: TSpeedButton; + Panel3: TPanel; + Label1: TLabel; + edRowCount: TEdit; + MSSQLFillTables: TMSSQL; + procedure btOpenClick(Sender: TObject); + procedure btCloseClick(Sender: TObject); + procedure FetchAllCBClick(Sender: TObject); + procedure btFillTablesClick(Sender: TObject); + private + { Private declarations } + public + // Demo management + procedure Initialize; override; + procedure SetDebug(Value: boolean); override; + end; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} + +procedure TFetchAllFrame.btOpenClick(Sender: TObject); +var + dt: TDateTime; +begin + MSQuery.Connection.Open; + + MSQuery.SQL.Assign(Memo.Lines); + + if MSQuery.FetchAll then + SdacForm.StatusBar.Panels[1].Text := 'FetchAll is True' + else + SdacForm.StatusBar.Panels[1].Text := 'FetchAll is False'; + + dt := Now; + MSQuery.Open; + SdacForm.StatusBar.Panels[2].Text := 'Opened in ' + TimeToStr(Now - dt); + SdacForm.StatusBar.Update; +end; + +procedure TFetchAllFrame.btCloseClick(Sender: TObject); +begin + MSQuery.Close; +end; + +procedure TFetchAllFrame.FetchAllCBClick(Sender: TObject); +begin + MSQuery.FetchAll := FetchAllCB.Checked; +end; + +// Demo management +procedure TFetchAllFrame.Initialize; +begin + inherited; + MSQuery.Connection := Connection as TMSConnection; + Memo.Lines.Text := MSQuery.SQL.Text; + FetchAllCB.Checked := MSQuery.FetchAll; +end; + +procedure TFetchAllFrame.SetDebug(Value: boolean); +begin + MSQuery.Debug := Value; +end; + +procedure TFetchAllFrame.btFillTablesClick(Sender: TObject); +begin + MSSQLFillTables.ParamByName('cnt').AsString := edRowCount.Text; + MSSQLFillTables.Execute; +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/FilterAndIndex/FilterAndIndex.nfm b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/FilterAndIndex/FilterAndIndex.nfm new file mode 100644 index 0000000..6bff59c --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/FilterAndIndex/FilterAndIndex.nfm @@ -0,0 +1,311 @@ +inherited FilterAndIndexFrame: TFilterAndIndexFrame + Width = 443 + Height = 277 + Align = alClient + object DBGrid: TDBGrid + Left = 166 + Top = 47 + Width = 277 + Height = 230 + Align = alClient + DataSource = DataSource + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + ParentFont = False + TabOrder = 0 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object Panel4: TPanel + Left = 0 + Top = 0 + Width = 443 + Height = 47 + Align = alTop + BevelOuter = bvNone + Locked = True + TabOrder = 1 + object ToolBar: TPanel + Left = 0 + Top = 0 + Width = 651 + Height = 47 + Align = alLeft + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btClose: TSpeedButton + Left = 84 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Close' + Flat = True + Transparent = False + OnClick = btCloseClick + end + object btOpen: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Open' + Flat = True + Transparent = False + OnClick = btOpenClick + end + object Panel5: TPanel + Left = 388 + Top = 1 + Width = 149 + Height = 22 + BevelOuter = bvNone + TabOrder = 0 + object cbCalcFields: TCheckBox + Left = 8 + Top = 0 + Width = 142 + Height = 23 + Caption = 'Calculated/Lookup fields' + Color = clBtnFace + ParentColor = False + TabOrder = 0 + OnClick = cbCalcFieldsClick + end + end + object Panel2: TPanel + Left = 167 + Top = 24 + Width = 483 + Height = 22 + BevelOuter = bvNone + TabOrder = 1 + object cbFilter: TCheckBox + Left = 380 + Top = 0 + Width = 54 + Height = 21 + Caption = 'Filter' + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + ParentColor = False + ParentFont = False + TabOrder = 0 + OnClick = cbFilterClick + end + object edFilter: TEdit + Left = 6 + Top = 2 + Width = 365 + Height = 21 + Anchors = [akLeft, akTop, akRight] + TabOrder = 1 + Text = 'DEPTNO = 10' + OnExit = edFilterExit + end + end + object DBNavigator1: TDBNavigator + Left = 167 + Top = 1 + Width = 220 + Height = 23 + DataSource = DataSource + Flat = True + TabOrder = 2 + end + object Panel1: TPanel + Left = 538 + Top = 1 + Width = 112 + Height = 22 + BevelOuter = bvNone + TabOrder = 3 + object cbCacheCalcFields: TCheckBox + Left = 9 + Top = 0 + Width = 100 + Height = 23 + Caption = 'CacheCalcFields' + Color = clBtnFace + ParentColor = False + TabOrder = 0 + OnClick = cbCacheCalcFieldsClick + end + end + object Panel6: TPanel + Left = 0 + Top = 24 + Width = 166 + Height = 22 + BevelOuter = bvNone + TabOrder = 4 + object cbIndex: TCheckBox + Left = 9 + Top = 3 + Width = 64 + Height = 15 + Caption = 'Index' + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + ParentColor = False + ParentFont = False + TabOrder = 0 + OnClick = cbIndexClick + end + end + end + end + object Panel3: TPanel + Left = 0 + Top = 47 + Width = 166 + Height = 230 + Align = alLeft + BevelOuter = bvNone + ParentColor = True + TabOrder = 2 + object Panel8: TPanel + Left = 0 + Top = 146 + Width = 166 + Height = 84 + Align = alBottom + BevelOuter = bvNone + Caption = 'Panel8' + Color = clGreen + TabOrder = 0 + object Panel7: TPanel + Left = 1 + Top = 1 + Width = 164 + Height = 82 + BevelOuter = bvNone + TabOrder = 0 + object Label1: TLabel + Left = 6 + Top = 3 + Width = 90 + Height = 13 + Caption = 'IndexFieldNames =' + end + object lbIndexFieldNames: TLabel + Left = 6 + Top = 22 + Width = 126 + Height = 54 + AutoSize = False + Transparent = False + WordWrap = True + end + end + end + object lbFields: TListBox + Left = 0 + Top = 0 + Width = 166 + Height = 146 + Align = alClient + ItemHeight = 13 + MultiSelect = True + TabOrder = 1 + OnClick = lbFieldsClick + end + end + object Query: TMSQuery + Connection = SDACForm.MSConnection + SQL.Strings = ( + 'SELECT * FROM Emp') + Debug = True + RefreshOptions = [roAfterInsert, roAfterUpdate] + Left = 272 + Top = 55 + end + object DataSource: TDataSource + DataSet = Query + Left = 304 + Top = 55 + end + object Query2: TMSQuery + Connection = SDACForm.MSConnection + SQL.Strings = ( + 'SELECT * FROM Emp') + Debug = True + OnCalcFields = Query2CalcFields + Left = 272 + Top = 88 + object Query2CALCULATED: TIntegerField + FieldKind = fkCalculated + FieldName = 'CALCULATED' + Calculated = True + end + object Query2LOOKUP: TStringField + FieldKind = fkLookup + FieldName = 'LOOKUP' + LookupDataSet = LookupQuery + LookupKeyFields = 'DEPTNO' + LookupResultField = 'DNAME' + KeyFields = 'DEPTNO' + Lookup = True + end + object Query2EMPNO: TIntegerField + FieldName = 'EMPNO' + Required = True + end + object Query2ENAME: TStringField + FieldName = 'ENAME' + Size = 10 + end + object Query2JOB: TStringField + FieldName = 'JOB' + Size = 9 + end + object Query2MGR: TIntegerField + FieldName = 'MGR' + end + object Query2HIREDATE: TDateTimeField + FieldName = 'HIREDATE' + end + object Query2SAL: TFloatField + FieldName = 'SAL' + end + object Query2COMM: TFloatField + FieldName = 'COMM' + end + object Query2DEPTNO: TIntegerField + FieldName = 'DEPTNO' + end + end + object LookupQuery: TMSQuery + Connection = SDACForm.MSConnection + SQL.Strings = ( + 'SELECT * FROM Dept') + Left = 304 + Top = 88 + object LookupQueryDEPTNO: TIntegerField + FieldName = 'DEPTNO' + Required = True + end + object LookupQueryDNAME: TStringField + FieldName = 'DNAME' + Size = 14 + end + object LookupQueryLOC: TStringField + FieldName = 'LOC' + Size = 13 + end + end +end diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/FilterAndIndex/FilterAndIndex.pas b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/FilterAndIndex/FilterAndIndex.pas new file mode 100644 index 0000000..7891adf --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/FilterAndIndex/FilterAndIndex.pas @@ -0,0 +1,206 @@ +unit FilterAndIndex; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + DBCtrls, ExtCtrls, Grids, DBGrids, StdCtrls, ToolWin, ComCtrls, SdacVcl, + MemDS, DBAccess, MSAccess, DB, Buttons, DemoFrame, SdacDemoForm; + +type + TFilterAndIndexFrame = class(TDemoFrame) + Query: TMSQuery; + DBGrid: TDBGrid; + DataSource: TDataSource; + Panel4: TPanel; + ToolBar: TPanel; + btClose: TSpeedButton; + btOpen: TSpeedButton; + DBNavigator1: TDBNavigator; + Panel3: TPanel; + Query2: TMSQuery; + LookupQuery: TMSQuery; + Query2EMPNO: TIntegerField; + Query2ENAME: TStringField; + Query2JOB: TStringField; + Query2MGR: TIntegerField; + Query2HIREDATE: TDateTimeField; + Query2SAL: TFloatField; + Query2COMM: TFloatField; + Query2DEPTNO: TIntegerField; + LookupQueryDEPTNO: TIntegerField; + LookupQueryDNAME: TStringField; + LookupQueryLOC: TStringField; + Query2CALCULATED: TIntegerField; + Query2LOOKUP: TStringField; + Label1: TLabel; + lbIndexFieldNames: TLabel; + Panel5: TPanel; + Panel2: TPanel; + Panel7: TPanel; + Panel8: TPanel; + lbFields: TListBox; + cbFilter: TCheckBox; + cbCalcFields: TCheckBox; + Panel1: TPanel; + cbCacheCalcFields: TCheckBox; + edFilter: TEdit; + Panel6: TPanel; + cbIndex: TCheckBox; + procedure btOpenClick(Sender: TObject); + procedure btCloseClick(Sender: TObject); + procedure Query2CalcFields(DataSet: TDataSet); + procedure cbFilterClick(Sender: TObject); + procedure cbCalcFieldsClick(Sender: TObject); + procedure cbIndexClick(Sender: TObject); + procedure lbFieldsClick(Sender: TObject); + procedure cbCacheCalcFieldsClick(Sender: TObject); + procedure edFilterExit(Sender: TObject); + private + FOldActive: boolean; + FFilterFilterNames: TStringList; + procedure BeginChange; + procedure EndChange; + public + destructor Destroy; override; + // Demo management + procedure Initialize; override; + procedure SetDebug(Value: boolean); override; + end; + +var + FilterAndIndexFrame: TFilterAndIndexFrame; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} + +procedure TFilterAndIndexFrame.btOpenClick(Sender: TObject); +var + i: integer; +begin + if DataSource.DataSet.Active then + Exit; + lbFields.Items.Clear; + lbFieldsClick(nil); + cbFilterClick(nil); + DataSource.DataSet.Open; + for i := 0 to DataSource.DataSet.FieldCount - 1 do + lbFields.Items.Add(DataSource.DataSet.Fields[i].FieldName); +end; + +procedure TFilterAndIndexFrame.btCloseClick(Sender: TObject); +begin + DataSource.DataSet.Close; +end; + +procedure TFilterAndIndexFrame.Query2CalcFields(DataSet: TDataSet); +begin + Query2CALCULATED.AsInteger := Query2EMPNO.AsInteger * 2; +end; + +procedure TFilterAndIndexFrame.BeginChange; +begin + FOldActive := DataSource.DataSet.Active; + if FOldActive then + btCloseClick(nil); +end; + +procedure TFilterAndIndexFrame.EndChange; +begin + if FOldActive then + btOpenClick(nil); +end; + +procedure TFilterAndIndexFrame.cbFilterClick(Sender: TObject); +begin + DataSource.DataSet.Filtered := cbFilter.Checked; + DataSource.DataSet.Filter := edFilter.Text; +end; + +procedure TFilterAndIndexFrame.cbCalcFieldsClick(Sender: TObject); +begin + BeginChange; + if cbCalcFields.Checked then + DataSource.DataSet := Query2 + else + DataSource.DataSet := Query; + EndChange; +end; + +procedure TFilterAndIndexFrame.cbIndexClick(Sender: TObject); +begin + if cbIndex.Checked then + TMSQuery(DataSource.DataSet).IndexFieldNames := lbIndexFieldNames.Caption + else + TMSQuery(DataSource.DataSet).IndexFieldNames := '' +end; + +procedure TFilterAndIndexFrame.lbFieldsClick(Sender: TObject); +var + i, k: integer; + s: string; +begin + i := 0; + while i < FFilterFilterNames.Count do begin + k := lbFields.Items.IndexOf(FFilterFilterNames[i]); + if (k < 0) or not lbFields.Selected[k] then + FFilterFilterNames.Delete(i) + else + Inc(i); + end; + for i := 0 to lbFields.Items.Count - 1 do + if lbFields.Selected[i] and + (FFilterFilterNames.IndexOf(lbFields.Items[i]) < 0) then + FFilterFilterNames.Add(lbFields.Items[i]); + + s := ''; + for i := 0 to FFilterFilterNames.Count - 1 do begin + if s <> '' then + s := s + ', '; + s := s + FFilterFilterNames[i]; + end; + lbIndexFieldNames.Caption := s; + + cbIndexClick(nil); +end; + +procedure TFilterAndIndexFrame.cbCacheCalcFieldsClick(Sender: TObject); +begin + BeginChange; + TMSQuery(DataSource.DataSet).Options.CacheCalcFields := cbCacheCalcFields.Checked; + EndChange; +end; + +procedure TFilterAndIndexFrame.edFilterExit(Sender: TObject); +begin + cbFilterClick(nil); +end; + +destructor TFilterAndIndexFrame.Destroy; +begin + FFilterFilterNames.Free; + inherited; +end; + +// Demo management +procedure TFilterAndIndexFrame.Initialize; +begin + inherited; + Query.Connection := Connection as TMSConnection; + Query2.Connection := Connection as TMSConnection; + FFilterFilterNames := TStringList.Create; +end; + +procedure TFilterAndIndexFrame.SetDebug(Value: boolean); +begin + Query.Debug := Value; + Query2.Debug := Value; +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Loader/Fetch.nfm b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Loader/Fetch.nfm new file mode 100644 index 0000000..9030202 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Loader/Fetch.nfm @@ -0,0 +1,62 @@ +object FetchForm: TFetchForm + Left = 396 + Top = 205 + BorderIcons = [biSystemMenu] + BorderStyle = bsDialog + Caption = 'Loading' + ClientHeight = 134 + ClientWidth = 299 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + FormStyle = fsStayOnTop + KeyPreview = True + OldCreateOrder = False + Position = poMainFormCenter + OnKeyDown = FormKeyDown + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 13 + object Label1: TLabel + Left = 8 + Top = 61 + Width = 287 + Height = 13 + Caption = 'Press Cancel button to interrupt loading operation.' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + end + object Panel1: TPanel + Left = 102 + Top = 93 + Width = 84 + Height = 24 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btCancel: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Cancel' + Flat = True + Transparent = False + OnClick = btCancelClick + end + end + object ProgressBar: TProgressBar + Left = 8 + Top = 25 + Width = 287 + Height = 16 + TabOrder = 1 + end +end diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Loader/Fetch.pas b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Loader/Fetch.pas new file mode 100644 index 0000000..6019ccf --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Loader/Fetch.pas @@ -0,0 +1,72 @@ +unit Fetch; + +interface + +uses +{$IFDEF LINUX} + QGraphics, QControls, QForms, QDialogs, QStdCtrls, + QDBCtrls, QComCtrls, QExtCtrls, QGrids, QButtons, +{$ELSE} + Windows, Messages,Graphics, Controls, Forms, Dialogs, Buttons, + DBCtrls, ExtCtrls, Grids, DBGrids, StdCtrls, ToolWin, ComCtrls, +{$ENDIF} +{$IFDEF CLR} + System.ComponentModel, +{$ENDIF} + SysUtils, Classes; + +type + TFetchForm = class(TForm) + Label1: TLabel; + Panel1: TPanel; + btCancel: TSpeedButton; + ProgressBar: TProgressBar; + procedure btCancelClick(Sender: TObject); + procedure FormKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); + procedure FormShow(Sender: TObject); + private + { Private declarations } + public + CancelLoad: boolean; + end; + +var + FetchForm: TFetchForm; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} +{$IFDEF LINUX} +{$R *.xfm} +{$ENDIF} + +procedure TFetchForm.btCancelClick(Sender: TObject); +begin + CancelLoad := True; + Hide; +end; + +procedure TFetchForm.FormKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); + +{$IFDEF LINUX} +const + VK_ESCAPE = 27; +{$ENDIF} +begin + if Key = VK_ESCAPE then + Close; +end; + +procedure TFetchForm.FormShow(Sender: TObject); +begin + ProgressBar.Position := 0; +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Loader/Loader.nfm b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Loader/Loader.nfm new file mode 100644 index 0000000..d159881 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Loader/Loader.nfm @@ -0,0 +1,185 @@ +inherited LoaderFrame: TLoaderFrame + Width = 443 + Height = 277 + Align = alClient + object Panel2: TPanel + Left = 0 + Top = 0 + Width = 443 + Height = 64 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object ToolBar: TPanel + Left = 1 + Top = 1 + Width = 586 + Height = 62 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btOpen: TSpeedButton + Left = 1 + Top = 1 + Width = 85 + Height = 24 + Caption = 'Open' + Flat = True + Transparent = False + OnClick = btOpenClick + end + object btClose: TSpeedButton + Left = 87 + Top = 1 + Width = 85 + Height = 24 + Caption = 'Close' + Flat = True + Transparent = False + OnClick = btCloseClick + end + object btLoad: TSpeedButton + Left = 173 + Top = 1 + Width = 85 + Height = 24 + Caption = 'Load' + Flat = True + Transparent = False + OnClick = btLoadClick + end + object btDeleteAll: TSpeedButton + Left = 259 + Top = 1 + Width = 85 + Height = 24 + Caption = 'Delete All' + Flat = True + Transparent = False + OnClick = btDeleteAllClick + end + object DBNavigator: TDBNavigator + Left = 345 + Top = 1 + Width = 240 + Height = 24 + DataSource = DataSource + Flat = True + TabOrder = 0 + end + object Panel1: TPanel + Left = 1 + Top = 26 + Width = 171 + Height = 35 + BevelOuter = bvNone + TabOrder = 1 + object Label1: TLabel + Left = 6 + Top = 14 + Width = 49 + Height = 13 + Caption = 'Load rows' + end + object edRows: TEdit + Left = 66 + Top = 10 + Width = 87 + Height = 21 + TabOrder = 0 + Text = '1000' + end + end + object Panel3: TPanel + Left = 173 + Top = 26 + Width = 412 + Height = 35 + BevelOuter = bvNone + TabOrder = 2 + object rgEvent: TRadioGroup + Left = 9 + Top = -1 + Width = 225 + Height = 32 + Columns = 2 + Items.Strings = ( + 'GetColumnData' + 'PutData') + TabOrder = 0 + OnClick = rgEventClick + end + end + end + end + object DBGrid: TDBGrid + Left = 0 + Top = 64 + Width = 443 + Height = 213 + Align = alClient + DataSource = DataSource + TabOrder = 1 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object DataSource: TDataSource + DataSet = Query + Left = 440 + Top = 64 + end + object Query: TMSQuery + Connection = SDACForm.MSConnection + SQL.Strings = ( + 'SELECT * FROM Sdac_Loaded ORDER BY CODE') + AfterOpen = QueryAfterOpen + BeforeClose = QueryBeforeClose + AfterRefresh = QueryAfterOpen + Left = 408 + Top = 64 + end + object MSLoader: TMSLoader + Connection = SDACForm.MSConnection + TableName = 'Sdac_Loaded' + Columns = < + item + Name = 'Code' + FieldType = ftInteger + Size = 0 + end + item + Name = 'Num' + FieldType = ftInteger + Size = 0 + end + item + Name = 'Num1' + FieldType = ftFloat + Size = 0 + Precision = 15 + end + item + Name = 'Str' + Size = 50 + end + item + Name = 'Dat' + FieldType = ftDateTime + Size = 0 + end> + OnGetColumnData = MSLoaderGetColumnData + Left = 408 + Top = 96 + end + object TruncCommand: TMSSQL + Connection = SDACForm.MSConnection + SQL.Strings = ( + 'TRUNCATE TABLE SDAC_Loaded') + CommandTimeout = 0 + Left = 408 + Top = 128 + end +end diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Loader/Loader.pas b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Loader/Loader.pas new file mode 100644 index 0000000..945d828 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Loader/Loader.pas @@ -0,0 +1,245 @@ +unit Loader; + +interface + +uses +{$IFNDEF VER130} + Variants, +{$ENDIF} + SysUtils, +{$IFDEF LINUX} + Types, Classes, QGraphics, QControls, QForms, QDialogs, QStdCtrls, + QDBCtrls, QComCtrls, QExtCtrls, QGrids, QDBGrids, QButtons, SdacClx, +{$ELSE} + Windows, Messages, Classes, Graphics, Controls, Forms, Dialogs, Buttons, + Grids, DBGrids, StdCtrls, ExtCtrls, DBCtrls, SdacVcl, +{$ENDIF} +{$IFDEF CLR} + System.ComponentModel, +{$ENDIF} + Db, MemDS, DBAccess, Fetch, + DALoader, MSLoader, MSScript, MSAccess, DemoFrame, DAScript, SDacDemoForm + ; + +type + TLoaderFrame = class(TDemoFrame) + DataSource: TDataSource; + Query: TMSQuery; + MSLoader: TMSLoader; + TruncCommand: TMSSQL; + Panel2: TPanel; + ToolBar: TPanel; + btOpen: TSpeedButton; + btClose: TSpeedButton; + btLoad: TSpeedButton; + btDeleteAll: TSpeedButton; + DBNavigator: TDBNavigator; + Panel1: TPanel; + Label1: TLabel; + edRows: TEdit; + DBGrid: TDBGrid; + Panel3: TPanel; + rgEvent: TRadioGroup; + procedure btOpenClick(Sender: TObject); + procedure btCloseClick(Sender: TObject); + procedure btLoadClick(Sender: TObject); + procedure btDeleteAllClick(Sender: TObject); + procedure QueryAfterOpen(DataSet: TDataSet); + procedure QueryBeforeClose(DataSet: TDataSet); + procedure PutData(Sender: TMSLoader); + procedure rgEventClick(Sender: TObject); + procedure QueryBeforeFetch(DataSet: TCustomDADataSet; + var Cancel: Boolean); + procedure QueryAfterFetch(DataSet: TCustomDADataSet); + procedure MSLoaderGetColumnData(Sender: TObject; Column: TMSColumn; + Row: Integer; var Value: Variant; var IsEOF: Boolean); + private + { Private declarations } + public + PMInterval: integer; + Count: integer; + destructor Destroy; override; + + // Demo management + procedure Initialize; override; + procedure SetDebug(Value: boolean); override; + end; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} +{$IFDEF LINUX} +{$R *.xfm} +{$ENDIF} + +destructor TLoaderFrame.Destroy; +begin + FreeAndNil(FetchForm); + inherited; +end; + +procedure TLoaderFrame.btOpenClick(Sender: TObject); +begin + Query.Open; +end; + +procedure TLoaderFrame.btCloseClick(Sender: TObject); +begin + Query.Close; +end; + +procedure TLoaderFrame.btLoadClick(Sender: TObject); +var + Start, Finish, Freq: Integer; +begin + Start := GetTickCount; + ShortDateFormat := 'yyyy-mm-dd'; + MSLoader.Connection.Connect; + FetchForm.Show; + Count := StrToInt(edRows.Text); + FetchForm.ProgressBar.Max := Count; + FetchForm.CancelLoad := False; + try + MSLoader.Load; // loading rows + finally + FetchForm.Hide; + Finish := GetTickCount; + Freq := 1000; + SDacForm.StatusBar.Panels[2].Text := 'Time: ' + FloatToStr(Round((Finish - Start) / Freq * 100) / 100) + ' sec.'; + if Query.Active then + Query.Refresh; + end; +end; + +procedure TLoaderFrame.MSLoaderGetColumnData(Sender: TObject; + Column: TMSColumn; Row: Integer; var Value: Variant; var IsEOF: Boolean); +begin + IsEOF := Row > Count; + case Column.Index of + 0: Value := Row; + 1: Value := Random(100); + 2: Value := Random*100; + 3: Value := 'abc01234567890123456789'; + 4: Value := Date; + else + Value := Null; + end; + + FetchForm.ProgressBar.Position := Row; + + if PMInterval = 100 then begin // 100 fields per time + Application.ProcessMessages; + if FetchForm.CancelLoad then begin + MessageDlg('Loading was cancelled by user.' + #13#10 + + 'Sucessfully loaded '+ IntToStr(Row - 1) + ' rows.', mtInformation, [mbOK], 0); + IsEof := True; + end; + end + else + inc(PMInterval); +end; + +procedure TLoaderFrame.PutData(Sender: TMSLoader); +var + i: integer; +begin + PMInterval := 0; + + for i := 1 to Count do begin + Sender.PutColumnData(0, i, i); + Sender.PutColumnData('NUM', i, Random(100)); + Sender.PutColumnData(2, i, Random*100); + Sender.PutColumnData(3, i, 'abc01234567890123456789'); + Sender.PutColumnData(4, i, Date); + FetchForm.ProgressBar.Position := i; + if PMInterval = 100 then begin // 100 records per time + PMInterval := 0; + Application.ProcessMessages; + if FetchForm.CancelLoad then begin + MessageDlg('Loading was cancelled by user.' + #13#10 + + 'Sucessfully loaded '+ IntToStr(i) + ' rows.', mtInformation, [mbOK], 0); + Abort; + end; + end + else + inc(PMInterval); + end; +end; + +procedure TLoaderFrame.btDeleteAllClick(Sender: TObject); +begin + TruncCommand.Execute; + if Query.Active then + Query.Refresh; +end; + +procedure TLoaderFrame.QueryAfterOpen(DataSet: TDataSet); +begin + SDACForm.StatusBar.Panels[1].Text := 'Count: ' + IntToStr(DataSet.RecordCount); +end; + +procedure TLoaderFrame.QueryBeforeClose(DataSet: TDataSet); +begin + SDACForm.StatusBar.Panels[1].Text := ''; +end; + +procedure TLoaderFrame.rgEventClick(Sender: TObject); +begin + if rgEvent.ItemIndex = 0 then begin + MSLoader.OnGetColumnData := MSLoaderGetColumnData; + MSLoader.OnPutData := nil; + end + else begin + MSLoader.OnGetColumnData := nil; + MSLoader.OnPutData := PutData; + end +end; + +procedure TLoaderFrame.QueryBeforeFetch(DataSet: TCustomDADataSet; + var Cancel: Boolean); +begin + if DataSet.FetchingAll then begin + FetchForm.Show; + Application.ProcessMessages; + Cancel := not FetchForm.Visible; + + if Cancel then + SdacForm.StatusBar.Panels[1].Text := 'RecordCount: ' + IntToStr(DataSet.RecordCount); + end; +end; + +procedure TLoaderFrame.QueryAfterFetch(DataSet: TCustomDADataSet); +begin + if not DataSet.FetchingAll then begin + FetchForm.Close; + Application.ProcessMessages; + + SdacForm.StatusBar.Panels[1].Text := 'RecordCount: ' + IntToStr(DataSet.RecordCount); + end; +end; + +// Demo management +procedure TLoaderFrame.Initialize; +begin + inherited; + Query.Connection := Connection as TMSConnection; + MSLoader.Connection := Connection as TMSConnection; + TruncCommand.Connection := Connection as TMSConnection; + + if FetchForm = nil then + FetchForm := TFetchForm.Create(SDACForm); + rgEvent.ItemIndex := 1; +end; + +procedure TLoaderFrame.SetDebug(Value: boolean); +begin + Query.Debug := Value; + TruncCommand.Debug := Value; +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/LongStrings/LongStrings.nfm b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/LongStrings/LongStrings.nfm new file mode 100644 index 0000000..1966184 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/LongStrings/LongStrings.nfm @@ -0,0 +1,186 @@ +inherited LongStringsFrame: TLongStringsFrame + Width = 443 + Height = 277 + Align = alClient + object Splitter1: TSplitter + Left = 0 + Top = 193 + Width = 443 + Height = 2 + Cursor = crVSplit + Align = alTop + end + object DBGrid: TDBGrid + Left = 0 + Top = 25 + Width = 443 + Height = 168 + Align = alTop + DataSource = DataSource + TabOrder = 2 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object ToolBar: TPanel + Left = 0 + Top = 0 + Width = 443 + Height = 25 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object ToolButton1: TToolButton + Left = 390 + Top = 2 + Width = 17 + Caption = 'ToolButton1' + Style = tbsSeparator + end + object Panel1: TPanel + Left = 1 + Top = 0 + Width = 498 + Height = 24 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btClose: TSpeedButton + Left = 84 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Close' + Flat = True + Transparent = False + OnClick = btCloseClick + end + object btOpen: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Open' + Flat = True + Transparent = False + OnClick = btOpenClick + end + object Panel2: TPanel + Left = 398 + Top = 1 + Width = 99 + Height = 22 + BevelOuter = bvNone + TabOrder = 0 + object cbLongStrings: TCheckBox + Left = 7 + Top = 4 + Width = 97 + Height = 17 + Caption = 'LongStrings' + TabOrder = 0 + OnClick = cbLongStringsClick + end + end + object DBNavigator: TDBNavigator + Left = 167 + Top = 1 + Width = 230 + Height = 22 + DataSource = DataSource + Flat = True + TabOrder = 1 + end + end + end + object meComments: TDBMemo + Left = 0 + Top = 221 + Width = 443 + Height = 56 + Align = alClient + DataField = 'VALUE' + DataSource = DataSource + ScrollBars = ssVertical + TabOrder = 3 + end + object ToolBar1: TPanel + Left = 0 + Top = 195 + Width = 443 + Height = 26 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object ToolButton2: TToolButton + Left = 150 + Top = 2 + Width = 25 + Caption = 'ToolButton2' + Style = tbsSeparator + end + object Panel3: TPanel + Left = 1 + Top = 1 + Width = 250 + Height = 24 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btClear: TSpeedButton + Left = 167 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Clear' + Flat = True + Transparent = False + OnClick = btClearClick + end + object btSave: TSpeedButton + Left = 84 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Save to file' + Flat = True + Transparent = False + OnClick = btSaveClick + end + object btLoad: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Load from file' + Flat = True + Transparent = False + OnClick = btLoadClick + end + end + end + object DataSource: TDataSource + DataSet = MSQuery + Left = 440 + Top = 88 + end + object OpenDialog: TOpenDialog + Left = 264 + Top = 219 + end + object SaveDialog: TSaveDialog + Left = 296 + Top = 219 + end + object MSQuery: TMSQuery + Connection = SDACForm.MSConnection + SQL.Strings = ( + 'SELECT * FROM SDAC_Long_char') + Debug = True + FetchRows = 1 + Left = 408 + Top = 88 + end +end diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/LongStrings/LongStrings.pas b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/LongStrings/LongStrings.pas new file mode 100644 index 0000000..998881a --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/LongStrings/LongStrings.pas @@ -0,0 +1,138 @@ +unit LongStrings; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + DBCtrls, ExtCtrls, Db, Grids, DBGrids, StdCtrls, ToolWin, SdacVcl, + ComCtrls, MemDS, DBAccess, MSAccess, Buttons, DemoFrame, SdacDemoForm; + +type + TLongStringsFrame = class(TDemoFrame) + DBGrid: TDBGrid; + DataSource: TDataSource; + ToolBar: TPanel; + meComments: TDBMemo; + Splitter1: TSplitter; + ToolBar1: TPanel; + OpenDialog: TOpenDialog; + SaveDialog: TSaveDialog; + ToolButton1: TToolButton; + ToolButton2: TToolButton; + Panel1: TPanel; + Panel2: TPanel; + DBNavigator: TDBNavigator; + btClose: TSpeedButton; + btOpen: TSpeedButton; + cbLongStrings: TCheckBox; + Panel3: TPanel; + btClear: TSpeedButton; + btSave: TSpeedButton; + btLoad: TSpeedButton; + MSQuery: TMSQuery; + procedure btOpenClick(Sender: TObject); + procedure btCloseClick(Sender: TObject); + procedure btLoadClick(Sender: TObject); + procedure btSaveClick(Sender: TObject); + procedure cbLongStringsClick(Sender: TObject); + procedure btClearClick(Sender: TObject); + private + { Private declarations } + public + // Demo management + procedure Initialize; override; + procedure SetDebug(Value: boolean); override; + end; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} + +procedure TLongStringsFrame.btOpenClick(Sender: TObject); +begin + MSQuery.Open; +end; + +procedure TLongStringsFrame.btCloseClick(Sender: TObject); +begin + MSQuery.Close; +end; + +procedure TLongStringsFrame.btLoadClick(Sender: TObject); +var + List: TStringList; +begin + if MSQuery.Active and OpenDialog.Execute then begin + if MSQuery.State = dsBrowse then + MSQuery.Edit; + + if MSQuery.FieldByName('Value') is TBlobField then + TBlobField(MSQuery.FieldByName('Value')).LoadFromFile(OpenDialog.FileName) + else begin + List := TStringList.Create; + try + List.LoadFromFile(OpenDialog.FileName); + MSQuery.FieldByName('Value').AsString := List.Text; + finally + List.Free; + end; + end; + end; +end; + +procedure TLongStringsFrame.btSaveClick(Sender: TObject); +var + List: TStringList; +begin + if not MSQuery.EOF and SaveDialog.Execute then + if MSQuery.FieldByName('Value') is TBlobField then + TBlobField(MSQuery.FieldByName('Value')).SaveToFile(SaveDialog.FileName) + else begin + List := TStringList.Create; + try + List.Text := MSQuery.FieldByName('Value').AsString; + List.SaveToFile(SaveDialog.FileName); + finally + List.Free; + end; + end; +end; + +procedure TLongStringsFrame.cbLongStringsClick(Sender: TObject); +var + OldActive: boolean; +begin + OldActive := MSQuery.Active; + MSQuery.Active := False; + MSQuery.Options.LongStrings := cbLongStrings.Checked; + MSQuery.Active := OldActive; +end; + +procedure TLongStringsFrame.btClearClick(Sender: TObject); +begin + if MSQuery.Active then begin + if MSQuery.State = dsBrowse then + MSQuery.Edit; + MSQuery.FieldByName('Value').AsString := ''; + end; +end; + +// Demo management +procedure TLongStringsFrame.Initialize; +begin + inherited; + MSQuery.Connection := Connection as TMSConnection; + cbLongStrings.Checked := MSQuery.Options.LongStrings; +end; + +procedure TLongStringsFrame.SetDebug(Value: boolean); +begin + MSQuery.Debug := Value; +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/MasterDetail/MasterDetail.nfm b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/MasterDetail/MasterDetail.nfm new file mode 100644 index 0000000..d826427 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/MasterDetail/MasterDetail.nfm @@ -0,0 +1,277 @@ +inherited MasterDetailFrame: TMasterDetailFrame + Width = 443 + Height = 277 + Align = alClient + object Splitter1: TSplitter + Left = 0 + Top = 0 + Width = 443 + Height = 1 + Cursor = crVSplit + Align = alTop + end + object Splitter3: TSplitter + Left = 0 + Top = 143 + Width = 443 + Height = 1 + Cursor = crVSplit + Align = alTop + Color = clGreen + ParentColor = False + end + object DBGrid: TDBGrid + Left = 0 + Top = 27 + Width = 443 + Height = 116 + Align = alTop + DataSource = dsMaster + TabOrder = 0 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object ToolBar: TPanel + Left = 0 + Top = 1 + Width = 443 + Height = 26 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object Panel2: TPanel + Left = 0 + Top = 0 + Width = 554 + Height = 24 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btOpen: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Open' + Flat = True + Transparent = False + OnClick = btOpenClick + end + object btClose: TSpeedButton + Left = 84 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Close' + Flat = True + Transparent = False + OnClick = btCloseClick + end + object DBNavigator: TDBNavigator + Left = 167 + Top = 1 + Width = 240 + Height = 22 + DataSource = dsMaster + Flat = True + TabOrder = 0 + end + object Panel4: TPanel + Left = 408 + Top = 1 + Width = 145 + Height = 22 + BevelOuter = bvNone + TabOrder = 1 + object cbLocalMasterDetail: TCheckBox + Left = 10 + Top = 3 + Width = 135 + Height = 17 + Caption = 'Use LocaMasterDetail' + TabOrder = 0 + OnClick = cbLocalMasterDetailClick + end + end + end + end + object ToolBar1: TPanel + Left = 0 + Top = 145 + Width = 443 + Height = 26 + Align = alTop + BevelOuter = bvNone + TabOrder = 2 + object Panel1: TPanel + Left = 1 + Top = 1 + Width = 650 + Height = 24 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object DBNavigator1: TDBNavigator + Left = 1 + Top = 1 + Width = 240 + Height = 22 + DataSource = dsDetail + Flat = True + TabOrder = 0 + end + object Panel6: TPanel + Left = 532 + Top = 1 + Width = 117 + Height = 22 + BevelOuter = bvNone + TabOrder = 1 + object cbCacheCalcFields: TCheckBox + Left = 5 + Top = 3 + Width = 108 + Height = 17 + Caption = 'CacheCalcFields' + Enabled = False + TabOrder = 0 + OnClick = cbCacheCalcFieldsClick + end + end + object Panel3: TPanel + Left = 242 + Top = 1 + Width = 289 + Height = 22 + BevelOuter = bvNone + TabOrder = 2 + object rbSQL: TRadioButton + Left = 5 + Top = 4 + Width = 63 + Height = 17 + Caption = 'SQL link' + Checked = True + TabOrder = 0 + TabStop = True + OnClick = rbClick + end + object rbSimpleFields: TRadioButton + Left = 75 + Top = 4 + Width = 97 + Height = 17 + Caption = 'Simple field link' + TabOrder = 1 + OnClick = rbClick + end + object rbCalcFields: TRadioButton + Left = 175 + Top = 4 + Width = 113 + Height = 17 + Caption = 'Calculated field link' + TabOrder = 2 + OnClick = rbClick + end + end + end + end + object DBGrid1: TDBGrid + Left = 0 + Top = 171 + Width = 443 + Height = 106 + Align = alClient + DataSource = dsDetail + TabOrder = 3 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object quMaster: TMSQuery + Connection = SDACForm.MSConnection + SQL.Strings = ( + 'SELECT * FROM dept') + OnCalcFields = quCalcFields + Left = 376 + Top = 32 + object quMasterDEPTNO: TIntegerField + FieldName = 'DEPTNO' + end + object quMasterDNAME: TStringField + FieldName = 'DNAME' + Size = 14 + end + object quMasterLOC: TStringField + FieldName = 'LOC' + Size = 13 + end + object quMasterDEPTNO_CALCULATED: TIntegerField + FieldKind = fkCalculated + FieldName = 'DEPTNO_CALCULATED' + Calculated = True + end + end + object quDetail: TMSQuery + Connection = SDACForm.MSConnection + SQL.Strings = ( + 'SELECT * FROM emp' + 'WHERE DeptNo = :DeptNo') + OnCalcFields = quCalcFields + MasterSource = dsMaster + Left = 376 + Top = 216 + ParamData = < + item + DataType = ftUnknown + Name = 'DeptNo' + end> + object quDetailEMPNO: TIntegerField + FieldName = 'EMPNO' + end + object quDetailENAME: TStringField + FieldName = 'ENAME' + Size = 10 + end + object quDetailJOB: TStringField + FieldName = 'JOB' + Size = 9 + end + object quDetailMGR: TIntegerField + FieldName = 'MGR' + end + object quDetailHIREDATE: TDateTimeField + FieldName = 'HIREDATE' + end + object quDetailSAL: TFloatField + FieldName = 'SAL' + end + object quDetailCOMM: TFloatField + FieldName = 'COMM' + end + object quDetailDEPTNO: TIntegerField + FieldName = 'DEPTNO' + end + object quDetailDEPTNO_CALCULATED: TIntegerField + FieldKind = fkCalculated + FieldName = 'DEPTNO_CALCULATED' + Calculated = True + end + end + object dsDetail: TDataSource + DataSet = quDetail + Left = 408 + Top = 216 + end + object dsMaster: TDataSource + DataSet = quMaster + Left = 408 + Top = 32 + end +end diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/MasterDetail/MasterDetail.pas b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/MasterDetail/MasterDetail.pas new file mode 100644 index 0000000..4e368da --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/MasterDetail/MasterDetail.pas @@ -0,0 +1,189 @@ +unit MasterDetail; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + DBCtrls, ExtCtrls, Db, Grids, DBGrids, StdCtrls, ToolWin, +{$IFNDEF VER130} { Delphi 6 or higher } + Variants, +{$ENDIF} + ComCtrls, Buttons, MemDS, DBAccess, MSAccess, SdacVcl, DemoFrame, SdacDemoForm; + +type + TMasterDetailFrame = class(TDemoFrame) + quMaster: TMSQuery; + Splitter1: TSplitter; + quDetail: TMSQuery; + dsDetail: TDataSource; + dsMaster: TDataSource; + DBGrid: TDBGrid; + ToolBar: TPanel; + Panel2: TPanel; + btOpen: TSpeedButton; + btClose: TSpeedButton; + DBNavigator: TDBNavigator; + ToolBar1: TPanel; + Panel1: TPanel; + DBNavigator1: TDBNavigator; + DBGrid1: TDBGrid; + Splitter3: TSplitter; + Panel4: TPanel; + cbLocalMasterDetail: TCheckBox; + Panel6: TPanel; + cbCacheCalcFields: TCheckBox; + Panel3: TPanel; + rbSQL: TRadioButton; + rbSimpleFields: TRadioButton; + rbCalcFields: TRadioButton; + quMasterDEPTNO: TIntegerField; + quMasterDNAME: TStringField; + quMasterLOC: TStringField; + quMasterDEPTNO_CALCULATED: TIntegerField; + quDetailEMPNO: TIntegerField; + quDetailENAME: TStringField; + quDetailJOB: TStringField; + quDetailMGR: TIntegerField; + quDetailHIREDATE: TDateTimeField; + quDetailSAL: TFloatField; + quDetailCOMM: TFloatField; + quDetailDEPTNO: TIntegerField; + quDetailDEPTNO_CALCULATED: TIntegerField; + procedure btOpenClick(Sender: TObject); + procedure btCloseClick(Sender: TObject); + procedure cbLocalMasterDetailClick(Sender: TObject); + procedure rbClick(Sender: TObject); + procedure cbCacheCalcFieldsClick(Sender: TObject); + procedure quCalcFields(DataSet: TDataSet); + private + { Private declarations } + public + // Demo management + procedure Initialize; override; + procedure SetDebug(Value: boolean); override; + end; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} + +procedure TMasterDetailFrame.btOpenClick(Sender: TObject); +begin + quMaster.Open; + quDetail.Open; +end; + +procedure TMasterDetailFrame.btCloseClick(Sender: TObject); +begin + quDetail.Close; + quMaster.Close; +end; + +procedure TMasterDetailFrame.cbLocalMasterDetailClick(Sender: TObject); +var + OldActive: boolean; +begin + OldActive := quDetail.Active; + quDetail.Close; + try + quDetail.Options.LocalMasterDetail := cbLocalMasterDetail.Checked; + if OldActive then + quDetail.Open; + except + cbLocalMasterDetail.Checked := quDetail.Options.LocalMasterDetail; + raise; + end; +end; + +procedure TMasterDetailFrame.rbClick(Sender: TObject); +var + OldActive: boolean; +begin + OldActive := dsMaster.DataSet.Active; + if OldActive then + btCloseClick(nil); + cbCacheCalcFields.Enabled := Sender = rbCalcFields; + + if rbSQL.Checked then begin + quDetail.SQL.Text := 'SELECT * FROM Emp WHERE DeptNo = :DeptNo'; + quDetail.DetailFields := ''; + quDetail.MasterFields := ''; + quMaster.FieldByName('DEPTNO_CALCULATED').Visible := False; + quDetail.FieldByName('DEPTNO_CALCULATED').Visible := False; + cbLocalMasterDetail.Checked := False; + cbLocalMasterDetail.Enabled := False; + cbCacheCalcFields.Enabled := False; + end + else begin + if rbSimpleFields.Checked then begin + quDetail.SQL.Text := 'SELECT * FROM Emp'; + quDetail.DetailFields := 'DEPTNO'; + quDetail.MasterFields := 'DEPTNO'; + quMaster.FieldByName('DEPTNO_CALCULATED').Visible := False; + quDetail.FieldByName('DEPTNO_CALCULATED').Visible := False; + cbLocalMasterDetail.Enabled := True; + cbCacheCalcFields.Enabled := False; + end + else begin + quDetail.SQL.Text := 'SELECT * FROM Emp'; + quDetail.DetailFields := 'DEPTNO_CALCULATED'; + quDetail.MasterFields := 'DEPTNO_CALCULATED'; + quMaster.FieldByName('DEPTNO_CALCULATED').Visible := True; + quDetail.FieldByName('DEPTNO_CALCULATED').Visible := True; + cbLocalMasterDetail.Enabled := True; + cbLocalMasterDetail.Checked := True; + cbCacheCalcFields.Enabled := True; + end; + end; + cbCacheCalcFieldsClick(nil); + if OldActive then + btOpenClick(nil); +end; + +procedure TMasterDetailFrame.cbCacheCalcFieldsClick(Sender: TObject); +var + OldActive: boolean; +begin + OldActive := dsMaster.DataSet.Active; + if OldActive then + btCloseClick(nil); + quMaster.Options.CacheCalcFields := cbCacheCalcFields.Checked and cbCacheCalcFields.Enabled; + quDetail.Options.CacheCalcFields := quMaster.Options.CacheCalcFields; + if OldActive then + btOpenClick(nil); +end; + +procedure TMasterDetailFrame.quCalcFields(DataSet: TDataSet); +var + Dst, Src: TField; +begin + Src := DataSet.FieldByName('DEPTNO'); + Dst := DataSet.FieldByName('DEPTNO_CALCULATED'); + if Src.IsNull then + Dst.Value := Null + else + Dst.AsInteger := Src.AsInteger * 2; +end; + +// Demo management +procedure TMasterDetailFrame.Initialize; +begin + inherited; + quMaster.Connection := Connection as TMSConnection; + quDetail.Connection := Connection as TMSConnection; + rbClick(nil); +end; + +procedure TMasterDetailFrame.SetDebug(Value: boolean); +begin + quMaster.Debug := Value; + quDetail.Debug := Value; +end; + +end. + diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Pictures/Pictures.nfm b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Pictures/Pictures.nfm new file mode 100644 index 0000000..7e9e9b5 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Pictures/Pictures.nfm @@ -0,0 +1,170 @@ +inherited PicturesFrame: TPicturesFrame + Width = 443 + Height = 277 + Align = alClient + object Splitter1: TSplitter + Left = 0 + Top = 119 + Width = 443 + Height = 2 + Cursor = crVSplit + Align = alTop + Color = clBtnFace + ParentColor = False + end + object ScrollBox1: TScrollBox + Left = 0 + Top = 146 + Width = 443 + Height = 131 + Align = alClient + TabOrder = 0 + object DBImage: TDBImage + Left = 0 + Top = 0 + Width = 439 + Height = 127 + Align = alClient + Center = False + Constraints.MinHeight = 50 + DataField = 'PICTURE' + DataSource = dsPictures + TabOrder = 0 + end + end + object ToolBar: TPanel + Left = 0 + Top = 0 + Width = 443 + Height = 26 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object Panel2: TPanel + Left = 0 + Top = 1 + Width = 408 + Height = 24 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btOpen: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Open' + Flat = True + Transparent = False + OnClick = btOpenClick + end + object btClose: TSpeedButton + Left = 84 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Close' + Flat = True + Transparent = False + OnClick = btCloseClick + end + object DBNavigator: TDBNavigator + Left = 167 + Top = 1 + Width = 240 + Height = 22 + DataSource = dsPictures + Flat = True + TabOrder = 0 + end + end + end + object DBGrid: TDBGrid + Left = 0 + Top = 26 + Width = 443 + Height = 93 + Align = alTop + Constraints.MinHeight = 50 + DataSource = dsPictures + Options = [dgEditing, dgTitles, dgIndicator, dgColumnResize, dgColLines, dgRowLines, dgConfirmDelete] + TabOrder = 2 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object ToolBar1: TPanel + Left = 0 + Top = 121 + Width = 443 + Height = 25 + Align = alTop + BevelOuter = bvNone + TabOrder = 3 + object Panel1: TPanel + Left = 2 + Top = 0 + Width = 259 + Height = 24 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btLoad: TSpeedButton + Left = 1 + Top = 1 + Width = 85 + Height = 22 + Caption = 'Load from file ...' + Flat = True + Transparent = False + OnClick = btLoadClick + end + object btSave: TSpeedButton + Left = 87 + Top = 1 + Width = 85 + Height = 22 + Caption = 'Save to file ...' + Flat = True + Transparent = False + OnClick = btSaveClick + end + object btClear: TSpeedButton + Left = 173 + Top = 1 + Width = 85 + Height = 22 + Caption = 'Clear' + Flat = True + Transparent = False + OnClick = btClearClick + end + end + end + object OpenPictureDialog: TOpenPictureDialog + Filter = 'Bitmaps (*.bmp)|*.bmp' + Left = 288 + Top = 115 + end + object SavePictureDialog: TSavePictureDialog + Filter = 'Bitmaps (*.bmp)|*.bmp' + Left = 320 + Top = 116 + end + object dsPictures: TDataSource + DataSet = quPictures + Left = 376 + Top = 16 + end + object quPictures: TMSQuery + Connection = SDACForm.MSConnection + SQL.Strings = ( + 'SELECT * FROM SDAC_Pictures') + Debug = True + FetchRows = 1 + Left = 344 + Top = 16 + end +end diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Pictures/Pictures.pas b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Pictures/Pictures.pas new file mode 100644 index 0000000..935e884 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Pictures/Pictures.pas @@ -0,0 +1,107 @@ +unit Pictures; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + DBCtrls, ExtCtrls, Db, Grids, DBGrids, StdCtrls, ToolWin, + ComCtrls, ExtDlgs, Buttons, MemDS, DBAccess, MSAccess, + DemoFrame, SdacDemoForm; + +type + TPicturesFrame = class(TDemoFrame) + OpenPictureDialog: TOpenPictureDialog; + ScrollBox1: TScrollBox; + SavePictureDialog: TSavePictureDialog; + ToolBar: TPanel; + Panel2: TPanel; + btOpen: TSpeedButton; + btClose: TSpeedButton; + DBNavigator: TDBNavigator; + DBGrid: TDBGrid; + ToolBar1: TPanel; + Panel1: TPanel; + btLoad: TSpeedButton; + btSave: TSpeedButton; + btClear: TSpeedButton; + Splitter1: TSplitter; + dsPictures: TDataSource; + quPictures: TMSQuery; + DBImage: TDBImage; + procedure btOpenClick(Sender: TObject); + procedure btCloseClick(Sender: TObject); + procedure btLoadClick(Sender: TObject); + procedure btSaveClick(Sender: TObject); + procedure btClearClick(Sender: TObject); + private + { Private declarations } + public + // Demo management + procedure Initialize; override; + procedure SetDebug(Value: boolean); override; + end; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} + +procedure TPicturesFrame.btOpenClick(Sender: TObject); +begin + quPictures.Open; +end; + +procedure TPicturesFrame.btCloseClick(Sender: TObject); +begin + quPictures.Close; +end; + +procedure TPicturesFrame.btLoadClick(Sender: TObject); +var + BlobField: TBlobField; + FileName: string; +begin + if OpenPictureDialog.Execute then begin + if quPictures.State in [dsBrowse] then + quPictures.Edit; + BlobField := quPictures.FieldByName('Picture') as TBlobField; + FileName := OpenPictureDialog.FileName; + BlobField.LoadFromFile(FileName); + end; +end; + +procedure TPicturesFrame.btSaveClick(Sender: TObject); +begin + if SavePictureDialog.Execute then begin + TBlobField(quPictures.FieldByName('Picture')). + SaveToFile(SavePictureDialog.FileName); + end; +end; + +procedure TPicturesFrame.btClearClick(Sender: TObject); +begin + if quPictures.State in [dsBrowse] then + quPictures.Edit; + TBlobField(quPictures.FieldByName('Picture')).Clear; +end; + +// Demo management +procedure TPicturesFrame.Initialize; +begin + inherited; + quPictures.Connection := Connection as TMSConnection; +end; + +procedure TPicturesFrame.SetDebug(Value: boolean); +begin + quPictures.Debug := Value; +end; + +end. + + + diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Query/Query.nfm b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Query/Query.nfm new file mode 100644 index 0000000..48f1bde --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Query/Query.nfm @@ -0,0 +1,310 @@ +inherited QueryFrame: TQueryFrame + Width = 443 + Height = 277 + Align = alClient + object Splitter1: TSplitter + Left = 0 + Top = 160 + Width = 443 + Height = 1 + Cursor = crVSplit + Align = alTop + Color = clGreen + ParentColor = False + end + object DBGrid: TDBGrid + Left = 0 + Top = 187 + Width = 443 + Height = 90 + Align = alClient + Constraints.MinWidth = 50 + DataSource = DataSource + TabOrder = 0 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object TPanel + Left = 0 + Top = 161 + Width = 443 + Height = 26 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object Panel9: TPanel + Left = 1 + Top = 1 + Width = 398 + Height = 24 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btRefreshRecord: TSpeedButton + Left = 232 + Top = 1 + Width = 82 + Height = 22 + Caption = 'RefreshRecord' + Flat = True + Transparent = False + OnClick = btRefreshRecordClick + end + object btSaveToXML: TSpeedButton + Left = 315 + Top = 1 + Width = 82 + Height = 22 + Caption = 'SaveToXML' + Flat = True + Transparent = False + OnClick = btSaveToXMLClick + end + object DBNavigator: TDBNavigator + Left = 1 + Top = 1 + Width = 230 + Height = 22 + DataSource = DataSource + Flat = True + TabOrder = 0 + end + end + end + object ToolBar: TPanel + Left = 0 + Top = 0 + Width = 443 + Height = 80 + Align = alTop + BevelOuter = bvNone + TabOrder = 2 + object Panel1: TPanel + Left = -8 + Top = 0 + Width = 563 + Height = 78 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btClose: TSpeedButton + Left = 92 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Close' + Flat = True + Transparent = False + OnClick = btCloseClick + end + object btOpen: TSpeedButton + Left = 9 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Open' + Flat = True + Transparent = False + OnClick = btOpenClick + end + object btPrepare: TSpeedButton + Left = 175 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Prepare' + Flat = True + Transparent = False + OnClick = btPrepareClick + end + object btUnPrepare: TSpeedButton + Left = 258 + Top = 1 + Width = 82 + Height = 22 + Caption = 'UnPrepare' + Flat = True + Transparent = False + OnClick = btUnPrepareClick + end + object btExecute: TSpeedButton + Left = 341 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Execute' + Flat = True + Transparent = False + OnClick = btExecuteClick + end + object Panel2: TPanel + Left = 424 + Top = 25 + Width = 138 + Height = 52 + BevelOuter = bvNone + TabOrder = 0 + object cbRefreshBeforeEdit: TCheckBox + Left = 11 + Top = 1 + Width = 121 + Height = 17 + Caption = 'Refresh BeforeEdit' + TabOrder = 0 + OnClick = cbRefreshBeforeEditClick + end + object cbRefreshAfterInsert: TCheckBox + Left = 11 + Top = 18 + Width = 121 + Height = 17 + Caption = 'Refresh AfterInsert' + TabOrder = 1 + OnClick = cbRefreshAfterInsertClick + end + object cbRefreshAfterUpdate: TCheckBox + Left = 11 + Top = 35 + Width = 121 + Height = 17 + Caption = 'Refresh AfterUpdate' + TabOrder = 2 + OnClick = cbRefreshAfterUpdateClick + end + end + object Panel5: TPanel + Left = 258 + Top = 24 + Width = 165 + Height = 26 + BevelOuter = bvNone + TabOrder = 1 + object StaticText1: TLabel + Left = 6 + Top = 7 + Width = 54 + Height = 13 + Caption = 'FetchRows' + end + object edFetchRows: TEdit + Left = 67 + Top = 2 + Width = 91 + Height = 21 + TabOrder = 0 + OnExit = edFetchRowsExit + end + end + object Panel6: TPanel + Left = 9 + Top = 51 + Width = 414 + Height = 26 + BevelOuter = bvNone + TabOrder = 2 + object Label5: TLabel + Left = 7 + Top = 8 + Width = 22 + Height = 13 + Caption = 'Filter' + end + object edFilter: TEdit + Left = 37 + Top = 3 + Width = 260 + Height = 21 + TabOrder = 0 + OnExit = edFetchRowsExit + end + object cbFiltered: TCheckBox + Left = 328 + Top = 5 + Width = 58 + Height = 17 + Caption = 'Filtered' + TabOrder = 1 + OnClick = cbFilteredClick + end + end + object Panel7: TPanel + Left = 9 + Top = 24 + Width = 248 + Height = 26 + BevelOuter = bvNone + TabOrder = 3 + object Label2: TLabel + Left = 5 + Top = 7 + Width = 73 + Height = 13 + Caption = 'Updating Table' + end + object edUpdatingTable: TEdit + Left = 93 + Top = 3 + Width = 148 + Height = 21 + TabOrder = 0 + OnExit = edFetchRowsExit + end + end + object Panel3: TPanel + Left = 424 + Top = 1 + Width = 138 + Height = 23 + BevelOuter = bvNone + TabOrder = 4 + object cbNonBlocking: TCheckBox + Left = 11 + Top = 4 + Width = 90 + Height = 16 + Caption = 'NonBlocking' + TabOrder = 0 + OnClick = cbNonBlockingClick + end + end + end + end + object Memo: TMemo + Left = 0 + Top = 80 + Width = 443 + Height = 80 + Align = alTop + ScrollBars = ssVertical + TabOrder = 3 + OnExit = edFetchRowsExit + end + object DataSource: TDataSource + DataSet = MSQuery + OnStateChange = DataSourceStateChange + OnDataChange = DataSourceDataChange + Left = 108 + Top = 105 + end + object MSQuery: TMSQuery + Connection = SDACForm.MSConnection + SQL.Strings = ( + 'SELECT dept.DeptNo, dept.DNAME, emp.EmpNo, emp.ENAME, emp.JOB ' + 'FROM dept, emp' + 'WHERE dept.DEPTNO = emp.DEPTNO') + Debug = True + AfterOpen = MSQueryAfterOpen + Left = 76 + Top = 105 + end + object SaveDialog: TSaveDialog + DefaultExt = 'xml' + Filter = 'XML (*.xml)|*.xml' + Options = [ofOverwritePrompt, ofHideReadOnly, ofEnableSizing] + Left = 138 + Top = 103 + end +end diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Query/Query.pas b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Query/Query.pas new file mode 100644 index 0000000..9d5e10e --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Query/Query.pas @@ -0,0 +1,276 @@ +unit Query; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + DBCtrls, ExtCtrls, Db, Grids, DBGrids, StdCtrls, ToolWin, + ComCtrls, Buttons, MemDS, DBAccess, MSAccess, + SdacVcl, DemoFrame, SdacDemoForm; + +type + TQueryFrame = class(TDemoFrame) + DataSource: TDataSource; + MSQuery: TMSQuery; + DBGrid: TDBGrid; + Panel9: TPanel; + btRefreshRecord: TSpeedButton; + DBNavigator: TDBNavigator; + Splitter1: TSplitter; + ToolBar: TPanel; + Panel1: TPanel; + btClose: TSpeedButton; + btOpen: TSpeedButton; + Panel2: TPanel; + cbRefreshBeforeEdit: TCheckBox; + cbRefreshAfterInsert: TCheckBox; + cbRefreshAfterUpdate: TCheckBox; + Panel5: TPanel; + StaticText1: TLabel; + edFetchRows: TEdit; + Panel6: TPanel; + Label5: TLabel; + edFilter: TEdit; + cbFiltered: TCheckBox; + Panel7: TPanel; + edUpdatingTable: TEdit; + Label2: TLabel; + Memo: TMemo; + btPrepare: TSpeedButton; + btUnPrepare: TSpeedButton; + btExecute: TSpeedButton; + Panel3: TPanel; + cbNonBlocking: TCheckBox; + btSaveToXML: TSpeedButton; + SaveDialog: TSaveDialog; + procedure btOpenClick(Sender: TObject); + procedure btCloseClick(Sender: TObject); + procedure btRefreshRecordClick(Sender: TObject); + procedure DataSourceDataChange(Sender: TObject; Field: TField); + procedure DataSourceStateChange(Sender: TObject); + procedure cbFilteredClick(Sender: TObject); + procedure cbRefreshBeforeEditClick(Sender: TObject); + procedure cbRefreshAfterInsertClick(Sender: TObject); + procedure cbRefreshAfterUpdateClick(Sender: TObject); + procedure MSQueryAfterOpen(DataSet: TDataSet); + procedure edFetchRowsExit(Sender: TObject); + procedure btPrepareClick(Sender: TObject); + procedure btUnPrepareClick(Sender: TObject); + procedure btExecuteClick(Sender: TObject); + procedure cbNonBlockingClick(Sender: TObject); + procedure btSaveToXMLClick(Sender: TObject); + private + { Private declarations } + procedure AssignProperties; + procedure ShowState; + public + // Demo management + procedure Initialize; override; + procedure SetDebug(Value: boolean); override; + end; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} + +procedure TQueryFrame.ShowState; +var + St: string; + + procedure AddSt(S:string); + begin + if St <> '' then + St := St + ', '; + St := St + S; + end; + +begin + St := ''; + + if MSQuery.Prepared then begin + AddSt('Prepared'); + + if MSQuery.IsQuery then + AddSt('IsQuery'); + end; + + if MSQuery.Active then + AddSt('Active') + else + AddSt('Inactive'); + + if MSQuery.Executing then + AddSt('Executing'); + + if MSQuery.Fetching then + AddSt('Fetching'); + + edUpdatingTable.Text := MSQuery.UpdatingTable; + + SdacForm.StatusBar.Panels[2].Text := St; +end; + +procedure TQueryFrame.AssignProperties; +begin + try + MSQuery.FetchRows := StrToInt(edFetchRows.Text); + except + edFetchRows.SetFocus; + raise; + end; + try + MSQuery.UpdatingTable := edUpdatingTable.Text; + except + edUpdatingTable.SetFocus; + raise; + end; + + MSQuery.Filter := edFilter.Text; + if MSQuery.SQL.Text <> Memo.Lines.Text then + MSQuery.SQL.Assign(Memo.Lines); +end; + +procedure TQueryFrame.btOpenClick(Sender: TObject); +begin + try + AssignProperties; + MSQuery.Open; + finally + ShowState; + end; +end; + +procedure TQueryFrame.btCloseClick(Sender: TObject); +begin + MSQuery.Close; + ShowState; +end; + +procedure TQueryFrame.btRefreshRecordClick(Sender: TObject); +begin + MSQuery.RefreshRecord; +end; + +procedure TQueryFrame.DataSourceStateChange(Sender: TObject); +begin + SdacForm.StatusBar.Panels[1].Text := 'Record ' + IntToStr(MSQuery.RecNo) + ' of ' + IntToStr(MSQuery.RecordCount); +end; + +procedure TQueryFrame.DataSourceDataChange(Sender: TObject; Field: TField); +begin + DataSourceStateChange(nil); +end; + +procedure TQueryFrame.cbFilteredClick(Sender: TObject); +begin + try + MSQuery.Filtered := cbFiltered.Checked; + finally + cbFiltered.Checked := MSQuery.Filtered; + end; +end; + +procedure TQueryFrame.cbRefreshBeforeEditClick(Sender: TObject); +begin + if cbRefreshBeforeEdit.Checked then + MSQuery.RefreshOptions := MSQuery.RefreshOptions + [roBeforeEdit] + else + MSQuery.RefreshOptions := MSQuery.RefreshOptions - [roBeforeEdit]; +end; + +procedure TQueryFrame.cbRefreshAfterInsertClick(Sender: TObject); +begin + if cbRefreshAfterInsert.Checked then + MSQuery.RefreshOptions := MSQuery.RefreshOptions + [roAfterInsert] + else + MSQuery.RefreshOptions := MSQuery.RefreshOptions - [roAfterInsert]; +end; + +procedure TQueryFrame.cbRefreshAfterUpdateClick(Sender: TObject); +begin + if cbRefreshAfterUpdate.Checked then + MSQuery.RefreshOptions := MSQuery.RefreshOptions + [roAfterUpdate] + else + MSQuery.RefreshOptions := MSQuery.RefreshOptions - [roAfterUpdate]; +end; + +procedure TQueryFrame.MSQueryAfterOpen(DataSet: TDataSet); +begin + edUpdatingTable.Text := MSQuery.UpdatingTable; +end; + +procedure TQueryFrame.edFetchRowsExit(Sender: TObject); +begin + AssignProperties; +end; + +procedure TQueryFrame.btPrepareClick(Sender: TObject); +begin + try + AssignProperties; + MSQuery.Prepare; + finally + ShowState; + end; +end; + +procedure TQueryFrame.btUnPrepareClick(Sender: TObject); +begin + MSQuery.UnPrepare; + ShowState; +end; + +procedure TQueryFrame.btExecuteClick(Sender: TObject); +begin + try + AssignProperties; + MSQuery.Execute; + finally + ShowState; + end; +end; + +procedure TQueryFrame.cbNonBlockingClick(Sender: TObject); +begin + try + MSQuery.Options.NonBlocking := cbNonBlocking.Checked; + finally + cbNonBlocking.Checked := MSQuery.Options.NonBlocking; + end; +end; + +procedure TQueryFrame.btSaveToXMLClick(Sender: TObject); +begin + if SaveDialog.Execute then + MSQuery.SaveToXML(SaveDialog.FileName); +end; + +// Demo management +procedure TQueryFrame.Initialize; +begin + inherited; + MSQuery.Connection := Connection as TMSConnection; + edFetchRows.Text := IntToStr(MSQuery.FetchRows); + + cbRefreshBeforeEdit.Checked := roBeforeEdit in MSQuery.RefreshOptions; + cbRefreshAfterInsert.Checked := roAfterInsert in MSQuery.RefreshOptions; + cbRefreshAfterUpdate.Checked := roAfterUpdate in MSQuery.RefreshOptions; + + edFilter.Text := MSQuery.Filter; + cbFiltered.Checked := MSQuery.Filtered; + + Memo.Lines.Text := MSQuery.SQL.Text; +end; + +procedure TQueryFrame.SetDebug(Value: boolean); +begin + MSQuery.Debug := Value; +end; + +end. + diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/SdacDemo_VclNet.bdsproj b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/SdacDemo_VclNet.bdsproj new file mode 100644 index 0000000..402f933 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/SdacDemo_VclNet.bdsproj @@ -0,0 +1,222 @@ + + + + + + + + + + + + SdacDemo_VclNet.dpr + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 7.0 + + + 0 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + Borland.Vcl + False + + False + True + False + True + True + False + False + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + True + False + False + 4096 + 1048576 + 4194304 + + + + + + + + + True + ..\SdacDemo\ConnectDialog + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1033 + 1252 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/SdacDemo_VclNet.cfg b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/SdacDemo_VclNet.cfg new file mode 100644 index 0000000..86fed96 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/SdacDemo_VclNet.cfg @@ -0,0 +1,47 @@ +-$A- +-$B- +-$C+ +-$D+ +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J- +-$K- +-$L+ +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$YD +-$Z1 +-cg +-vn +-AWinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-NSBorland.Vcl +-H+ +-W+ +-M +-$M4096,1048576 +-K$00400000 +-U"..\ConnectDialog\" +-O"..\ConnectDialog\" +-I"..\ConnectDialog\" +-R"..\ConnectDialog\" +-LU"d:\windows\microsoft.net\framework\v1.1.4322\System.Drawing.dll" +-w-SYMBOL_DEPRECATED +-w-SYMBOL_PLATFORM +-w-UNIT_PLATFORM +-w-UNIT_DEPRECATED +-w-UNSAFE_TYPE +-w-UNSAFE_CODE +-w-UNSAFE_CAST diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/SdacDemo_VclNet.dpr b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/SdacDemo_VclNet.dpr new file mode 100644 index 0000000..e33d232 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/SdacDemo_VclNet.dpr @@ -0,0 +1,60 @@ +{$I Base\DacDemo.inc} + +program SdacDemo_VclNet; + +{%DelphiDotNetAssemblyCompiler 'System.Drawing.dll'} +{%DelphiDotNetAssemblyCompiler 'Borland.VclDbRtl.dll'} +{%DelphiDotNetAssemblyCompiler 'Borland.Delphi.dll'} +{%DelphiDotNetAssemblyCompiler 'Borland.VclRtl.dll'} +{%DelphiDotNetAssemblyCompiler 'Borland.Vcl.dll'} +{%DelphiDotNetAssemblyCompiler 'CoreLab.Dac.dll'} +{%DelphiDotNetAssemblyCompiler 'CoreLab.Sdac.dll'} + +uses + Forms, + CategoryFrame in 'Base\CategoryFrame.pas' {CategoryFrame}, + DemoBase in 'Base\DemoBase.pas', + DemoForm in 'Base\DemoForm.pas' {DemoForm}, + DemoFrame in 'Base\DemoFrame.pas' {DemoFrame}, + HtmlConsts in 'Base\HtmlConsts.pas', + VTable in 'VirtualTable\VTable.pas', + SdacAbout in 'Base\SdacAbout.pas' {SdacAboutForm}, + CachedUpdates in 'CachedUpdates\CachedUpdates.pas' {CachedUpdates}, + UpdateAction in 'CachedUpdates\UpdateAction.pas' {UpdateAction}, + ConnectDialog in 'ConnectDialog\ConnectDialog.pas' {ConnectDialog}, + ConnectForm in 'ConnectDialog\ConnectForm.pas' {MyConnect}, + InheritedConnectForm in 'ConnectDialog\InheritedConnectForm.pas' {InheritedConnect}, +{$IFDEF CRDBGRID} + CRDBGrid in 'CRDBGrid\CRDBGrid.pas' {CRDBGrid}, +{$ENDIF} + FetchAll in 'FetchAll\FetchAll.pas' {FetchAll}, + MasterDetail in 'MasterDetail\MasterDetail.pas' {MasterDetail}, + Pictures in 'Pictures\Pictures.pas' {Pictures}, + ServerCursors in 'ServerCursors\ServerCursors.pas' {ServerCursors}, + Sql in 'Sql\Sql.pas' {SqlFrame}, + StoredProc in 'StoredProc\StoredProc.pas' {StoredProcFrame}, + StoredProcUpdates in 'StoredProcUpdates\StoredProcUpdates.pas' {StoredProcUpdatesFrame}, + Table in 'Table\Table.pas' {TableFrame}, + Text in 'Text\Text.pas' {TextFrame}, + ThreadsData in 'Threads\ThreadsData.pas' {ThreadsData: TDataModule}, + UpdateSQL in 'UpdateSQL\UpdateSQL.pas' {UpdateSQLFrame}, + SdacDemoForm in 'Base\SdacDemoForm.pas' {SdacForm}, + Query in 'Query\Query.pas' {QueryFrame: TFrame}, + FilterAndIndex in 'FilterAndIndex\FilterAndIndex.pas', +{$IFNDEF STD} + Loader in 'Loader\Loader.pas', + Fetch in 'Loader\Fetch.pas' {FetchForm}, + ServiceBroker in 'ServiceBroker\ServiceBroker.pas' {ServiceBroker}, +{$ENDIF} + LongStrings in 'LongStrings\LongStrings.pas'; + +{$R *.res} + +[STAThread] + +begin + Application.Initialize; + Application.CreateForm(TSdacForm, SdacForm); + Application.CreateForm(TSdacAboutForm, SdacAboutForm); + Application.Run; +end. diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/SdacDemo_VclNet.res b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/SdacDemo_VclNet.res new file mode 100644 index 0000000..f8aedde Binary files /dev/null and b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/SdacDemo_VclNet.res differ diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/ServerCursors/ServerCursors.nfm b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/ServerCursors/ServerCursors.nfm new file mode 100644 index 0000000..62dc117 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/ServerCursors/ServerCursors.nfm @@ -0,0 +1,230 @@ +inherited ServerCursorsFrame: TServerCursorsFrame + Width = 441 + Height = 275 + Align = alClient + object Splitter1: TSplitter + Left = 0 + Top = 170 + Width = 441 + Height = 2 + Cursor = crVSplit + Align = alTop + Color = clGreen + ParentColor = False + end + object DBGrid: TDBGrid + Left = 0 + Top = 172 + Width = 441 + Height = 103 + Align = alClient + DataSource = DataSource + TabOrder = 0 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object ToolBar: TPanel + Left = 0 + Top = 0 + Width = 441 + Height = 90 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object Panel1: TPanel + Left = 1 + Top = 1 + Width = 570 + Height = 24 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btOpen: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Open and Last' + Flat = True + Transparent = False + OnClick = btOpenClick + end + object btClose: TSpeedButton + Left = 84 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Close' + Flat = True + Transparent = False + OnClick = btCloseClick + end + object btFillTables: TSpeedButton + Left = 398 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Fill Tables' + Flat = True + Transparent = False + OnClick = btFillTablesClick + end + object DBNavigator: TDBNavigator + Left = 167 + Top = 1 + Width = 230 + Height = 22 + DataSource = DataSource + Flat = True + TabOrder = 0 + end + object Panel3: TPanel + Left = 481 + Top = 1 + Width = 88 + Height = 22 + BevelOuter = bvNone + TabOrder = 1 + object edVal: TEdit + Left = 8 + Top = 2 + Width = 73 + Height = 21 + TabOrder = 0 + Text = '1000' + end + end + end + object Panel2: TPanel + Left = 1 + Top = 24 + Width = 570 + Height = 65 + BevelOuter = bvNone + Color = clGreen + TabOrder = 1 + object Panel4: TPanel + Left = 1 + Top = 1 + Width = 568 + Height = 63 + BevelOuter = bvNone + TabOrder = 0 + object Label1: TLabel + Left = 355 + Top = 5 + Width = 91 + Height = 13 + Caption = 'Open = 0; Last = 0;' + end + object Label2: TLabel + Left = 355 + Top = 23 + Width = 91 + Height = 13 + Caption = 'Open = 0; Last = 0;' + end + object Label3: TLabel + Left = 355 + Top = 41 + Width = 91 + Height = 13 + Caption = 'Open = 0; Last = 0;' + end + object rbCientCursor1: TRadioButton + Left = 10 + Top = 5 + Width = 330 + Height = 16 + Caption = 'Client cursor (CursorType = ctDefaultResultSet, FetchAll = True)' + TabOrder = 0 + OnClick = rbCientCursor2Click + end + object rbCientCursor2: TRadioButton + Left = 10 + Top = 23 + Width = 330 + Height = 17 + Caption = + 'Client cursor (CursorType = ctDefaultResultSet, FetchAll = False' + + ')' + TabOrder = 1 + OnClick = rbCientCursor2Click + end + object rbServerCursor: TRadioButton + Left = 10 + Top = 41 + Width = 330 + Height = 17 + Caption = 'Server cursor (CursorType = ctKeySet)' + TabOrder = 2 + OnClick = rbCientCursor2Click + end + end + end + end + object Memo: TMemo + Left = 0 + Top = 90 + Width = 441 + Height = 80 + Align = alTop + ScrollBars = ssVertical + TabOrder = 2 + end + object DataSource: TDataSource + DataSet = MSQuery + Left = 278 + Top = 60 + end + object MSQuery: TMSQuery + Connection = SDACForm.MSConnection + SQL.Strings = ( + 'select TOP 100000 * from loaded1, loaded2') + ReadOnly = True + Left = 246 + Top = 60 + end + object MSSQLFillTables: TMSSQL + Connection = SDACForm.MSConnection + SQL.Strings = ( + 'declare' + ' @i INTEGER;' + 'begin' + ' SET @i = 0' + ' WHILE @i <= :Cnt' + ' BEGIN' + ' SET @i = @i + 1' + ' INSERT INTO Loaded1 (' + ' Field1,' + ' Field2,' + ' Field3)' + ' VALUES (' + ' '#39'01234567890123456789'#39',' + ' '#39'12345678901234567890'#39',' + ' '#39'23456789012345678901'#39');' + ' INSERT INTO Loaded2 (' + ' Field1,' + ' Field2,' + ' Field3)' + ' VALUES (' + ' '#39'01234567890123456789'#39',' + ' '#39'12345678901234567890'#39',' + ' '#39'23456789012345678901'#39');' + ' END;' + 'end;') + CommandTimeout = 0 + Left = 453 + Top = 28 + ParamData = < + item + DataType = ftInteger + Name = 'Cnt' + ParamType = ptInput + Value = 1000 + end> + end +end diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/ServerCursors/ServerCursors.pas b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/ServerCursors/ServerCursors.pas new file mode 100644 index 0000000..befd86d --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/ServerCursors/ServerCursors.pas @@ -0,0 +1,136 @@ +unit ServerCursors; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + DBCtrls, ExtCtrls, Db, Grids, DBGrids, StdCtrls, ToolWin, + ComCtrls, Buttons, MemDS, DBAccess, MSAccess, + OLEDBAccess, SdacVcl, DemoFrame, SdacDemoForm; + +type + TServerCursorsFrame = class(TDemoFrame) + DBGrid: TDBGrid; + DataSource: TDataSource; + ToolBar: TPanel; + Memo: TMemo; + MSQuery: TMSQuery; + Splitter1: TSplitter; + Panel1: TPanel; + btOpen: TSpeedButton; + btClose: TSpeedButton; + DBNavigator: TDBNavigator; + btFillTables: TSpeedButton; + Panel3: TPanel; + edVal: TEdit; + Panel2: TPanel; + Panel4: TPanel; + rbCientCursor1: TRadioButton; + rbCientCursor2: TRadioButton; + rbServerCursor: TRadioButton; + Label1: TLabel; + Label2: TLabel; + Label3: TLabel; + MSSQLFillTables: TMSSQL; + procedure btOpenClick(Sender: TObject); + procedure btCloseClick(Sender: TObject); + procedure btFillTablesClick(Sender: TObject); + procedure rbCientCursor2Click(Sender: TObject); + private + + public + // Demo management + procedure Initialize; override; + procedure SetDebug(Value: boolean); override; + end; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} + +{$IFDEF CLR} +uses + Variants; +{$ENDIF} + +procedure TServerCursorsFrame.btOpenClick(Sender: TObject); +var + dt: TDateTime; + s: string; +begin + MSQuery.Connection.Open; + MSQuery.SQL.Assign(Memo.Lines); + + dt := Now; + MSQuery.Open; + s := 'Open = ' + TimeToStr(Now - dt) + '; '; + + dt := Now; + MSQuery.Last; + s := s + 'Last = ' + TimeToStr(Now - dt) + ';'; + if rbCientCursor1.Checked then + Label1.Caption := s + else + if rbCientCursor2.Checked then + Label2.Caption := s + else + if rbServerCursor.Checked then + Label3.Caption := s; + SdacForm.StatusBar.Update; +end; + +procedure TServerCursorsFrame.btCloseClick(Sender: TObject); +begin + MSQuery.Close; +end; + +procedure TServerCursorsFrame.btFillTablesClick(Sender: TObject); +begin + MSSQLFillTables.ParamValues['cnt'] := edVal.Text; + MSSQLFillTables.Execute; +end; + +procedure TServerCursorsFrame.rbCientCursor2Click(Sender: TObject); +begin + inherited; + MSQuery.Close; + if rbCientCursor1.Checked then begin + MSQuery.CursorType := ctDefaultResultSet; + MSQuery.FetchAll := True; + end + else + if rbCientCursor2.Checked then begin + MSQuery.CursorType := ctDefaultResultSet; + MSQuery.FetchAll := False; + end + else + MSQuery.CursorType := ctKeySet; +end; + +// Demo management +procedure TServerCursorsFrame.Initialize; +begin + inherited; + MSQuery.Connection := Connection as TMSConnection; + MSSQLFillTables.Connection := Connection as TMSConnection; + Memo.Lines.Text := MSQuery.SQL.Text; + + if MSQuery.CursorType = ctDefaultResultSet then + rbCientCursor1.Checked := True + else + rbServerCursor.Checked := True; +end; + +procedure TServerCursorsFrame.SetDebug(Value: boolean); +begin + MSQuery.Debug := Value; + MSSQLFillTables.Debug := Value; +end; + +end. + diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/ServiceBroker/ServiceBroker.nfm b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/ServiceBroker/ServiceBroker.nfm new file mode 100644 index 0000000..edd7e50 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/ServiceBroker/ServiceBroker.nfm @@ -0,0 +1,312 @@ +inherited ServiceBrokerFrame: TServiceBrokerFrame + Width = 889 + Height = 471 + Align = alClient + object Splitter1: TSplitter + Left = 380 + Top = 0 + Height = 471 + Color = clBtnFace + ParentColor = False + end + object Panel1: TPanel + Left = 0 + Top = 0 + Width = 380 + Height = 471 + Align = alLeft + Anchors = [akTop] + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object Panel3: TPanel + Left = 0 + Top = 0 + Width = 380 + Height = 136 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object Label1: TLabel + Left = 3 + Top = 6 + Width = 111 + Height = 13 + Caption = 'Initiator connection' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + end + object Panel5: TPanel + Left = 1 + Top = 23 + Width = 378 + Height = 112 + Anchors = [akLeft, akTop, akRight, akBottom] + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btInitiatorBeginDialog: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Begin dialog' + Flat = True + Transparent = False + OnClick = btInitiatorBeginDialogClick + end + object btInitiatorEndDialog: TSpeedButton + Left = 84 + Top = 1 + Width = 82 + Height = 22 + Caption = 'End dialog' + Flat = True + Transparent = False + OnClick = btInitiatorEndDialogClick + end + object btInitiatorSend: TSpeedButton + Left = 167 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Send' + Flat = True + Transparent = False + OnClick = btInitiatorSendClick + end + object btInitiatorReceive: TSpeedButton + Left = 250 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Receive' + Flat = True + Transparent = False + OnClick = btInitiatorReceiveClick + end + object Panel7: TPanel + Left = 1 + Top = 24 + Width = 376 + Height = 87 + Anchors = [akLeft, akTop, akRight, akBottom] + BevelOuter = bvNone + TabOrder = 0 + object lbInitiatorMessage: TLabel + Left = 3 + Top = 37 + Width = 43 + Height = 13 + Caption = 'Message' + end + object lbInitiatorWaitTimeout: TLabel + Left = 3 + Top = 66 + Width = 60 + Height = 13 + Caption = 'WaitTimeout' + end + object cbInitiatorAsynchNotification: TCheckBox + Left = 3 + Top = 8 + Width = 166 + Height = 17 + Caption = 'AsynchNotification' + TabOrder = 0 + OnClick = cbInitiatorAsynchNotificationClick + end + object edInitiatorMessage: TEdit + Left = 66 + Top = 33 + Width = 308 + Height = 21 + Anchors = [akLeft, akTop, akRight] + TabOrder = 1 + Text = 'Hello target connection!' + end + object edInitiatorWaitTimeout: TEdit + Left = 66 + Top = 63 + Width = 81 + Height = 21 + TabOrder = 2 + OnChange = edInitiatorWaitTimeoutChange + end + end + object Panel10: TPanel + Left = 333 + Top = 1 + Width = 44 + Height = 22 + Anchors = [akLeft, akTop, akRight] + BevelOuter = bvNone + TabOrder = 1 + end + end + end + object meInitiatorLog: TMemo + Left = 0 + Top = 136 + Width = 380 + Height = 335 + Align = alClient + ReadOnly = True + ScrollBars = ssVertical + TabOrder = 1 + end + end + object Panel2: TPanel + Left = 383 + Top = 0 + Width = 506 + Height = 471 + Align = alClient + BevelOuter = bvNone + Color = clGreen + TabOrder = 1 + object Panel4: TPanel + Left = 0 + Top = 0 + Width = 506 + Height = 136 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object Label2: TLabel + Left = 3 + Top = 6 + Width = 105 + Height = 13 + Caption = 'Target connection' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + end + object Panel6: TPanel + Left = 1 + Top = 23 + Width = 333 + Height = 112 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btTargetReceive: TSpeedButton + Left = 84 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Receive' + Flat = True + Transparent = False + OnClick = btTargetReceiveClick + end + object btTargetSend: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Send' + Flat = True + Transparent = False + OnClick = btTargetSendClick + end + object Panel8: TPanel + Left = 1 + Top = 24 + Width = 331 + Height = 87 + BevelOuter = bvNone + TabOrder = 0 + object lbTargetMessage: TLabel + Left = 3 + Top = 37 + Width = 43 + Height = 13 + Caption = 'Message' + end + object lbTargetWaitTimeout: TLabel + Left = 3 + Top = 66 + Width = 60 + Height = 13 + Caption = 'WaitTimeout' + end + object cbTargetAsynchNotification: TCheckBox + Left = 8 + Top = 7 + Width = 166 + Height = 17 + Caption = 'AsynchNotification' + TabOrder = 0 + OnClick = cbTargetAsynchNotificationClick + end + object edTargetMessage: TEdit + Left = 66 + Top = 33 + Width = 263 + Height = 21 + TabOrder = 1 + Text = 'Hello initiator connection!' + end + object edTargetWaitTimeout: TEdit + Left = 66 + Top = 63 + Width = 81 + Height = 21 + TabOrder = 2 + OnChange = edTargetWaitTimeoutChange + end + end + object Panel9: TPanel + Left = 167 + Top = 1 + Width = 165 + Height = 22 + Anchors = [akLeft, akTop, akRight, akBottom] + BevelOuter = bvNone + TabOrder = 1 + end + end + end + object meTargetLog: TMemo + Left = 0 + Top = 136 + Width = 506 + Height = 335 + Align = alClient + ReadOnly = True + ScrollBars = ssVertical + TabOrder = 1 + end + end + object InitiatorServiceBroker: TMSServiceBroker + WaitTimeout = 5000 + OnMessage = InitiatorServiceBrokerMessage + OnBeginConversation = InitiatorServiceBrokerBeginConversation + OnEndConversation = InitiatorServiceBrokerEndConversation + Left = 240 + Top = 128 + end + object MSConnection2: TMSConnection + Database = 'master' + Left = 384 + Top = 232 + end + object TargetServiceBroker: TMSServiceBroker + Connection = MSConnection2 + WaitTimeout = 5000 + OnMessage = TargetServiceBrokerMessage + OnBeginConversation = TargetServiceBrokerBeginConversation + OnEndConversation = TargetServiceBrokerEndConversation + Left = 416 + Top = 232 + end +end diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/ServiceBroker/ServiceBroker.pas b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/ServiceBroker/ServiceBroker.pas new file mode 100644 index 0000000..d682c66 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/ServiceBroker/ServiceBroker.pas @@ -0,0 +1,279 @@ +unit ServiceBroker; + +interface + +uses +{$IFDEF VER6P} + Variants, +{$ENDIF} + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, + Dialogs, DemoFrame, ExtCtrls, StdCtrls, DB, DBAccess, MSAccess, + MSServiceBroker, Buttons; + +type + TServiceBrokerFrame = class(TDemoFrame) + Panel1: TPanel; + Splitter1: TSplitter; + Panel2: TPanel; + InitiatorServiceBroker: TMSServiceBroker; + MSConnection2: TMSConnection; + TargetServiceBroker: TMSServiceBroker; + Panel3: TPanel; + Panel4: TPanel; + meInitiatorLog: TMemo; + meTargetLog: TMemo; + Label1: TLabel; + Label2: TLabel; + Panel5: TPanel; + Panel6: TPanel; + btInitiatorBeginDialog: TSpeedButton; + btInitiatorEndDialog: TSpeedButton; + btInitiatorSend: TSpeedButton; + btInitiatorReceive: TSpeedButton; + Panel7: TPanel; + cbInitiatorAsynchNotification: TCheckBox; + lbInitiatorMessage: TLabel; + edInitiatorMessage: TEdit; + edInitiatorWaitTimeout: TEdit; + lbInitiatorWaitTimeout: TLabel; + btTargetReceive: TSpeedButton; + btTargetSend: TSpeedButton; + Panel8: TPanel; + cbTargetAsynchNotification: TCheckBox; + lbTargetMessage: TLabel; + edTargetMessage: TEdit; + lbTargetWaitTimeout: TLabel; + edTargetWaitTimeout: TEdit; + Panel9: TPanel; + Panel10: TPanel; + procedure btInitiatorBeginDialogClick(Sender: TObject); + procedure btInitiatorEndDialogClick(Sender: TObject); + procedure btInitiatorSendClick(Sender: TObject); + procedure btInitiatorReceiveClick(Sender: TObject); + procedure cbInitiatorAsynchNotificationClick(Sender: TObject); + procedure edInitiatorWaitTimeoutChange(Sender: TObject); + procedure btTargetSendClick(Sender: TObject); + procedure btTargetReceiveClick(Sender: TObject); + procedure cbTargetAsynchNotificationClick(Sender: TObject); + procedure edTargetWaitTimeoutChange(Sender: TObject); + procedure InitiatorServiceBrokerBeginConversation(Sender: TObject; + Conversation: TMSConversation); + procedure InitiatorServiceBrokerEndConversation(Sender: TObject; + Conversation: TMSConversation; ErrorMessage: String; + ErrorCode: Integer); + procedure InitiatorServiceBrokerMessage(Sender: TObject); + procedure TargetServiceBrokerBeginConversation(Sender: TObject; + Conversation: TMSConversation); + procedure TargetServiceBrokerEndConversation(Sender: TObject; + Conversation: TMSConversation; ErrorMessage: String; + ErrorCode: Integer); + procedure TargetServiceBrokerMessage(Sender: TObject); + private + FMSConversation: TMSConversation; + public + // Demo management + procedure AssignTargetConnection; + procedure Initialize; override; + end; + +var + ServiceBrokerFrame: TServiceBrokerFrame; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} + +const + InitiatorServiceName = 'InitiatorService'; + TargetServiceName = 'TargetService'; + +{ TServiceBrokerFrame } + +procedure TServiceBrokerFrame.AssignTargetConnection; +begin + if Connection.Connected and MSConnection2.Connected then + Exit; + + if not Connection.Connected then + Connection.Connect; + + MSConnection2.Disconnect; + MSConnection2.Assign(Connection); + MSConnection2.LoginPrompt := False; + MSConnection2.Connect; + + InitiatorServiceBroker.CreateServerObjects; + + TargetServiceBroker.CreateServerObjects; +end; + +procedure TServiceBrokerFrame.Initialize; +begin + inherited; + + InitiatorServiceBroker.Connection := Connection as TMSConnection; + + InitiatorServiceBroker.Service := InitiatorServiceName; + TargetServiceBroker.Service := TargetServiceName; + + cbInitiatorAsynchNotification.Checked := InitiatorServiceBroker.AsyncNotification; + cbTargetAsynchNotification.Checked := TargetServiceBroker.AsyncNotification; + + edInitiatorWaitTimeout.Text := IntToStr(InitiatorServiceBroker.WaitTimeout); + edTargetWaitTimeout.Text := IntToStr(TargetServiceBroker.WaitTimeout); + + btInitiatorEndDialog.Enabled := False; +end; + +procedure TServiceBrokerFrame.btInitiatorBeginDialogClick(Sender: TObject); +begin + AssignTargetConnection; + + FMSConversation := InitiatorServiceBroker.BeginDialog(TargetServiceName, '', False); + + // Demo managment + btInitiatorEndDialog.Enabled := True; + btInitiatorBeginDialog.Enabled := False; +end; + +procedure TServiceBrokerFrame.btInitiatorEndDialogClick(Sender: TObject); +begin + FMSConversation.EndConversation; + FMSConversation := nil; + + // Demo managment + btInitiatorEndDialog.Enabled := False; + btInitiatorBeginDialog.Enabled := True; +end; + +procedure TServiceBrokerFrame.btInitiatorSendClick(Sender: TObject); +var + TransmitionStatus: string; +begin + AssignTargetConnection; + if FMSConversation <> nil then begin + FMSConversation.Send(edInitiatorMessage.Text); + TransmitionStatus := FMSConversation.GetTransmissionStatus; + if TransmitionStatus <> '' then + meInitiatorLog.Lines.Add(TransmitionStatus) + else + meInitiatorLog.Lines.Add('Message was send successfully'); + end + else + raise Exception.Create('No active dialog'); +end; + +procedure TServiceBrokerFrame.btInitiatorReceiveClick(Sender: TObject); +begin + AssignTargetConnection; + if InitiatorServiceBroker.Receive then + meInitiatorLog.Lines.Add(InitiatorServiceBroker.CurrentMessage.AsString); +end; + +procedure TServiceBrokerFrame.cbInitiatorAsynchNotificationClick(Sender: TObject); +begin + AssignTargetConnection; + InitiatorServiceBroker.AsyncNotification := cbInitiatorAsynchNotification.Checked; +end; + +procedure TServiceBrokerFrame.edInitiatorWaitTimeoutChange(Sender: TObject); +var + WaitTimeout: integer; +begin + try + WaitTimeout := StrToInt(edInitiatorWaitTimeout.Text); + except + Exit; + end; + InitiatorServiceBroker.WaitTimeout := WaitTimeout; +end; + +procedure TServiceBrokerFrame.InitiatorServiceBrokerBeginConversation( + Sender: TObject; Conversation: TMSConversation); +begin + meInitiatorLog.Lines.Add('Conversation started'); +end; + +procedure TServiceBrokerFrame.InitiatorServiceBrokerEndConversation( + Sender: TObject; Conversation: TMSConversation; ErrorMessage: String; + ErrorCode: Integer); +begin + meInitiatorLog.Lines.Add('Conversation finished'); +end; + +procedure TServiceBrokerFrame.InitiatorServiceBrokerMessage(Sender: TObject); +begin + if InitiatorServiceBroker.Receive then + meInitiatorLog.Lines.Add(InitiatorServiceBroker.CurrentMessage.AsString); +end; + +procedure TServiceBrokerFrame.btTargetSendClick(Sender: TObject); +var + TransmitionStatus: string; + Conversation: TMSConversation; +begin + AssignTargetConnection; + if TargetServiceBroker.ConversationCount > 0 then begin + Conversation := TargetServiceBroker.Conversations[0]; + Conversation.Send(edTargetMessage.Text); + TransmitionStatus := Conversation.GetTransmissionStatus; + if TransmitionStatus <> '' then + meTargetLog.Lines.Add(TransmitionStatus) + else + meTargetLog.Lines.Add('Message was send successfully'); + end + else + raise Exception.Create('No active dialog'); +end; + +procedure TServiceBrokerFrame.btTargetReceiveClick(Sender: TObject); +begin + AssignTargetConnection; + if TargetServiceBroker.Receive then + meTargetLog.Lines.Add(TargetServiceBroker.CurrentMessage.AsString); +end; + +procedure TServiceBrokerFrame.cbTargetAsynchNotificationClick(Sender: TObject); +begin + AssignTargetConnection; + TargetServiceBroker.AsyncNotification := cbTargetAsynchNotification.Checked; +end; + +procedure TServiceBrokerFrame.edTargetWaitTimeoutChange(Sender: TObject); +var + WaitTimeout: integer; +begin + try + WaitTimeout := StrToInt(edTargetWaitTimeout.Text); + except + Exit; + end; + TargetServiceBroker.WaitTimeout := WaitTimeout; +end; + +procedure TServiceBrokerFrame.TargetServiceBrokerBeginConversation( + Sender: TObject; Conversation: TMSConversation); +begin + meTargetLog.Lines.Add('Conversation started'); +end; + +procedure TServiceBrokerFrame.TargetServiceBrokerEndConversation( + Sender: TObject; Conversation: TMSConversation; ErrorMessage: String; + ErrorCode: Integer); +begin + meTargetLog.Lines.Add('Conversation finished'); +end; + +procedure TServiceBrokerFrame.TargetServiceBrokerMessage(Sender: TObject); +begin + if TargetServiceBroker.Receive then + if TargetServiceBroker.CurrentMessage.MessageType <> SEndDialogType then + meTargetLog.Lines.Add(TargetServiceBroker.CurrentMessage.AsString); +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Sql/Sql.nfm b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Sql/Sql.nfm new file mode 100644 index 0000000..7a22794 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Sql/Sql.nfm @@ -0,0 +1,139 @@ +inherited SqlFrame: TSqlFrame + Width = 443 + Height = 277 + Align = alClient + object Label1: TLabel + Left = 456 + Top = 48 + Width = 32 + Height = 13 + Caption = 'Label1' + end + object Splitter1: TSplitter + Left = 0 + Top = 188 + Width = 488 + Height = 3 + Cursor = crVSplit + Align = alTop + end + object ToolBar: TPanel + Left = 0 + Top = 0 + Width = 488 + Height = 26 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object TPanel + Left = 1 + Top = 1 + Width = 350 + Height = 24 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btExecute: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Execute' + Flat = True + Transparent = False + OnClick = btExecuteClick + end + object btBreakExec: TSpeedButton + Left = 167 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Break' + Enabled = False + Flat = True + Transparent = False + OnClick = btBreakExecClick + end + object btExecInThread: TSpeedButton + Left = 84 + Top = 1 + Width = 82 + Height = 22 + Hint = + 'Assing a long-drawn command to memo (e.g. `SELECT SLEEP(10);`) a' + + 'nd push this button.' + Caption = 'Exec in thread' + Flat = True + ParentShowHint = False + ShowHint = True + Transparent = False + OnClick = btExecInThreadClick + end + object Panel1: TPanel + Left = 250 + Top = 1 + Width = 99 + Height = 22 + BevelOuter = bvNone + TabOrder = 0 + object cbNonBlocking: TCheckBox + Left = 7 + Top = 3 + Width = 86 + Height = 17 + Caption = 'NonBlocking' + TabOrder = 0 + OnClick = cbNonBlockingClick + end + end + end + end + object meSQL: TMemo + Left = 0 + Top = 26 + Width = 488 + Height = 162 + Align = alTop + Font.Charset = ANSI_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Courier New' + Font.Style = [] + ParentFont = False + TabOrder = 1 + OnExit = meSQLExit + end + object meResult: TMemo + Left = 0 + Top = 191 + Width = 488 + Height = 70 + TabStop = False + Align = alClient + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Courier New' + Font.Pitch = fpVariable + Font.Style = [] + ParentFont = False + ReadOnly = True + TabOrder = 2 + end + object MSSQL: TMSSQL + Connection = SDACForm.MSConnection + SQL.Strings = ( + 'SET :Cnt = (SELECT COUNT(*) FROM Emp)') + AfterExecute = MSSQLAfterExecute + CommandTimeout = 0 + Left = 224 + Top = 40 + ParamData = < + item + DataType = ftInteger + Name = 'Cnt' + ParamType = ptInputOutput + Value = 830 + end> + end +end diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Sql/Sql.pas b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Sql/Sql.pas new file mode 100644 index 0000000..0727b29 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Sql/Sql.pas @@ -0,0 +1,216 @@ +unit Sql; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + DBCtrls, ExtCtrls, Db, Grids, DBGrids, StdCtrls, ToolWin, + ComCtrls, MSAccess, DBAccess, SdacVcl, Buttons, + DemoFrame, SdacDemoForm, OLEDBAccess, ActiveX; + +type + TSqlFrame = class(TDemoFrame) + ToolBar: TPanel; + meSQL: TMemo; + MSSQL: TMSSQL; + Label1: TLabel; + Splitter1: TSplitter; + meResult: TMemo; + btExecute: TSpeedButton; + btBreakExec: TSpeedButton; + Panel1: TPanel; + cbNonBlocking: TCheckBox; + btExecInThread: TSpeedButton; + procedure btExecuteClick(Sender: TObject); + procedure meSQLExit(Sender: TObject); + procedure MSSQLAfterExecute(Sender: TObject; Result: Boolean); + procedure cbNonBlockingClick(Sender: TObject); + procedure btBreakExecClick(Sender: TObject); + procedure btExecInThreadClick(Sender: TObject); + private + { Private declarations } + OldProvider: TOLEDBProvider; + DoNotRemind: boolean; + FExecThread: TThread; + procedure AssignProperties; + procedure TerminateThread; + public + destructor Destroy; override; + // Demo management + procedure Initialize; override; + procedure SetDebug(Value: boolean); override; + end; + + { TExecThread } + + TExecThread = class(TThread) + protected + procedure Execute; override; + procedure Terminate; + end; + +var + SqlFrame: TSqlFrame; + +implementation + +uses ComObj; + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} + +procedure LogError(EMessage: string); +begin + SqlFrame.meResult.Lines.Add('An error with the following message has beein raised during query execution:' + #13#10 + EMessage); +end; + +{ TExecThread } + +procedure TExecThread.Execute; +begin + CoInitialize(nil); + if SqlFrame.MSSQL <> nil then + try + SqlFrame.btBreakExec.Enabled := True; + SqlFrame.MSSQL.Execute; + except + on e: Exception do begin + LogError(e.Message); + end; + end; + Terminate; +end; + +procedure TExecThread.Terminate; +begin + inherited; + SqlFrame.btBreakExec.Enabled := False; + CoUninitialize; +end; + +{ TSqlFrame } + +procedure TSqlFrame.AssignProperties; +begin + if Trim(MSSQL.SQL.Text) <> Trim(meSQL.Lines.Text) then + MSSQL.SQL.Assign(meSQL.Lines); + MSSQL.NonBlocking := cbNonBlocking.Checked; + if MSSQL.NonBlocking then + btBreakExec.Enabled := False; +end; + +procedure TSqlFrame.TerminateThread; +begin + if FExecThread <> nil then begin + FExecThread.Terminate; + MSSQL.BreakExec; + FExecThread.WaitFor; + FExecThread.Free; + FExecThread := nil; + end; +end; + +procedure TSqlFrame.btExecuteClick(Sender: TObject); +begin + AssignProperties; + meResult.Lines.Clear; + SdacForm.StatusBar.Panels[2].Text := 'Executing...'; + if MSSQL.NonBlocking then + btBreakExec.Enabled := True; + MSSQL.Execute; +end; + +procedure TSqlFrame.meSQLExit(Sender: TObject); +begin + AssignProperties; +end; + +procedure TSqlFrame.MSSQLAfterExecute(Sender: TObject; Result: Boolean); +var + s: string; + i: integer; +begin + btBreakExec.Enabled := False; + if btBreakExec.Enabled then + btBreakExec.Enabled := False; + if Result then + s := 'Success' + ' (' + IntToStr(MSSQL.RowsAffected) + ' rows processed)' + else + s := 'Execution failed'; + SdacForm.StatusBar.Panels[2].Text := s; + + for i := 0 to MSSQL.Params.Count-1 do + meResult.Lines.Add(MSSQL.Params[i].Name + ' = ' + MSSQL.Params[i].AsString); + + meResult.Lines.Add(s); +end; + +procedure TSqlFrame.cbNonBlockingClick(Sender: TObject); +var + oldConnect: boolean; +begin + oldConnect := MSSQL.Connection.Connected; + try + if cbNonBlocking.Checked then begin + if not DoNotRemind then begin + MessageDlg('Note, NonBlocking mode is available only with SQL Native Client installed', mtInformation, [mbOK], 0); + DoNotRemind := True; + end; + MSSQL.Connection.Disconnect; + OldProvider := MSSQL.Connection.Options.Provider; + MSSQL.Connection.Options.Provider := prNativeClient; + end + else + MSSQL.Connection.Options.Provider := OldProvider; + MSSQL.NonBlocking := cbNonBlocking.Checked; + finally + cbNonBlocking.Checked := MSSQL.NonBlocking; + end; + MSSQL.Connection.Connected := oldConnect; +end; + +procedure TSqlFrame.btBreakExecClick(Sender: TObject); +begin + MSSQL.BreakExec; +end; + +destructor TSqlFrame.Destroy; +begin + TerminateThread; + if (self <> nil) and MSSQL.Executing then + MSSQL.BreakExec; + + inherited; +end; + +procedure TSqlFrame.btExecInThreadClick(Sender: TObject); +begin + MSSQL.SQL := meSQL.Lines; + SDACForm.StatusBar.Panels[2].Text := 'Executing...'; + meResult.Lines.Clear; + TerminateThread; + FExecThread := TExecThread.Create(False) +end; + +// Demo management +procedure TSqlFrame.Initialize; +begin + inherited; + + FExecThread := nil; + SqlFrame := Self; + DoNotRemind := False; + MSSQL.Connection := Connection as TMSConnection; + meSQL.Lines := MSSQL.SQL; +end; + +procedure TSqlFrame.SetDebug(Value: boolean); +begin + MSSQL.Debug := Value; +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/StoredProc/StoredProc.nfm b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/StoredProc/StoredProc.nfm new file mode 100644 index 0000000..2b47bd1 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/StoredProc/StoredProc.nfm @@ -0,0 +1,157 @@ +inherited StoredProcFrame: TStoredProcFrame + Width = 441 + Height = 275 + Align = alClient + object DBGrid: TDBGrid + Left = 0 + Top = 49 + Width = 441 + Height = 226 + Align = alClient + DataSource = DataSource + TabOrder = 0 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object ToolBar: TPanel + Left = 0 + Top = 0 + Width = 441 + Height = 49 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object Panel1: TPanel + Left = 1 + Top = 1 + Width = 499 + Height = 24 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btOpen: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Open' + Flat = True + Transparent = False + OnClick = btOpenClick + end + object btClose: TSpeedButton + Left = 84 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Close' + Flat = True + Transparent = False + OnClick = btCloseClick + end + object btPrepare: TSpeedButton + Left = 167 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Prepare' + Flat = True + Transparent = False + OnClick = btPrepareClick + end + object btUnPrepare: TSpeedButton + Left = 250 + Top = 1 + Width = 82 + Height = 22 + Caption = 'UnPrepare' + Flat = True + Transparent = False + OnClick = btUnPrepareClick + end + object btExecute: TSpeedButton + Left = 333 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Execute' + Flat = True + Transparent = False + OnClick = btExecuteClick + end + object btPrepareSQL: TSpeedButton + Left = 416 + Top = 1 + Width = 82 + Height = 22 + Caption = 'PrepareSQL' + Flat = True + Transparent = False + OnClick = btPrepareSQLClick + end + end + object Panel2: TPanel + Left = 1 + Top = 24 + Width = 499 + Height = 24 + BevelOuter = bvNone + Color = clGreen + TabOrder = 1 + object DBNavigator: TDBNavigator + Left = 278 + Top = 1 + Width = 220 + Height = 22 + DataSource = DataSource + Flat = True + TabOrder = 0 + end + object Panel3: TPanel + Left = 1 + Top = 1 + Width = 276 + Height = 22 + BevelOuter = bvNone + TabOrder = 1 + object Label1: TLabel + Left = 4 + Top = 6 + Width = 82 + Height = 13 + Caption = 'StoredProc name' + end + object edStoredProcName: TComboBox + Left = 95 + Top = 1 + Width = 173 + Height = 21 + ItemHeight = 13 + TabOrder = 0 + OnDropDown = edStoredProcNameDropDown + OnExit = edStoredProcNameExit + end + end + end + end + object DataSource: TDataSource + DataSet = MSStoredProc + Left = 432 + Top = 72 + end + object MSStoredProc: TMSStoredProc + StoredProcName = 'Ten Most High-Paid Employees;1' + SQLRefresh.Strings = ( + 'WHERE' + ' DEPTNO = :DEPTNO') + Connection = SDACForm.MSConnection + SQL.Strings = ( + '{CALL "Ten Most High-Paid Employees";1}') + Debug = True + Left = 400 + Top = 72 + end +end diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/StoredProc/StoredProc.pas b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/StoredProc/StoredProc.pas new file mode 100644 index 0000000..6c9b973 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/StoredProc/StoredProc.pas @@ -0,0 +1,170 @@ +unit StoredProc; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + DBCtrls, ExtCtrls, Db, Grids, DBGrids, StdCtrls, ToolWin, + ComCtrls, MemDS, DBAccess, MSAccess, SdacVcl, + Buttons, DemoFrame, SdacDemoForm, DAScript, MSScript; + +type + TStoredProcFrame = class(TDemoFrame) + DataSource: TDataSource; + MSStoredProc: TMSStoredProc; + DBGrid: TDBGrid; + ToolBar: TPanel; + Panel1: TPanel; + btOpen: TSpeedButton; + btClose: TSpeedButton; + btPrepare: TSpeedButton; + btUnPrepare: TSpeedButton; + btExecute: TSpeedButton; + btPrepareSQL: TSpeedButton; + Panel2: TPanel; + DBNavigator: TDBNavigator; + Panel3: TPanel; + Label1: TLabel; + edStoredProcName: TComboBox; + procedure btOpenClick(Sender: TObject); + procedure btCloseClick(Sender: TObject); + procedure btPrepareClick(Sender: TObject); + procedure btUnPrepareClick(Sender: TObject); + procedure btExecuteClick(Sender: TObject); + procedure btPrepareSQLClick(Sender: TObject); + procedure edStoredProcNameExit(Sender: TObject); + procedure edStoredProcNameDropDown(Sender: TObject); + private + { Private declarations } + procedure ShowState; + procedure AssignProperties; + public + // Demo management + procedure Initialize; override; + procedure SetDebug(Value: boolean); override; + end; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} + +procedure TStoredProcFrame.AssignProperties; +begin + if Trim(MSStoredProc.StoredProcName) <> Trim(edStoredProcName.Text) then + MSStoredProc.StoredProcName := edStoredProcName.Text; + ShowState; +end; + +procedure TStoredProcFrame.ShowState; +var + St: string; + + procedure AddSt(S:string); + begin + if St <> '' then + St := St + ', '; + St := St + S; + end; + +begin + St := ''; + + if MSStoredProc.Prepared then begin + AddSt('Prepared'); + + if MSStoredProc.IsQuery then + AddSt('IsQuery'); + + end; + + if MSStoredProc.Active then + AddSt('Active') + else + AddSt('Inactive'); + + SdacForm.StatusBar.Panels[2].Text := St; +end; + +procedure TStoredProcFrame.btOpenClick(Sender: TObject); +begin + try + AssignProperties; + MSStoredProc.Open; + finally + ShowState; + end; +end; + +procedure TStoredProcFrame.btCloseClick(Sender: TObject); +begin + MSStoredProc.Close; + ShowState; +end; + +procedure TStoredProcFrame.btPrepareClick(Sender: TObject); +begin + try + AssignProperties; + MSStoredProc.Prepare; + finally + ShowState; + end; +end; + +procedure TStoredProcFrame.btUnPrepareClick(Sender: TObject); +begin + MSStoredProc.UnPrepare; + ShowState; +end; + +procedure TStoredProcFrame.btExecuteClick(Sender: TObject); +begin + try + AssignProperties; + MSStoredProc.Execute; + finally + ShowState; + end; +end; + +procedure TStoredProcFrame.btPrepareSQLClick(Sender: TObject); +begin + try + AssignProperties; + MSStoredProc.PrepareSQL; + finally + ShowState; + end; +end; + +procedure TStoredProcFrame.edStoredProcNameExit(Sender: TObject); +begin + AssignProperties; +end; + +procedure TStoredProcFrame.edStoredProcNameDropDown(Sender: TObject); +begin + MSStoredProc.Connection.GetStoredProcNames(edStoredProcName.Items); +end; + +// Demo management +procedure TStoredProcFrame.Initialize; +begin + inherited; + MSStoredProc.Connection := Connection as TMSConnection; + edStoredProcName.Text := MSStoredProc.StoredProcName; + ShowState; +end; + +procedure TStoredProcFrame.SetDebug(Value: boolean); +begin + MSStoredProc.Debug := Value; +end; + +end. + diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/StoredProcUpdates/StoredProcUpdates.nfm b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/StoredProcUpdates/StoredProcUpdates.nfm new file mode 100644 index 0000000..050ebbd --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/StoredProcUpdates/StoredProcUpdates.nfm @@ -0,0 +1,101 @@ +inherited StoredProcUpdatesFrame: TStoredProcUpdatesFrame + Width = 441 + Height = 275 + Align = alClient + object Panel1: TPanel + Left = 0 + Top = 0 + Width = 441 + Height = 26 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object Panel2: TPanel + Left = 1 + Top = 1 + Width = 408 + Height = 24 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btClose: TSpeedButton + Left = 84 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Close' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + ParentFont = False + Transparent = False + OnClick = btCloseClick + end + object btOpen: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Open' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + ParentFont = False + Transparent = False + OnClick = btOpenClick + end + object DBNavigator1: TDBNavigator + Left = 167 + Top = 1 + Width = 240 + Height = 22 + DataSource = DataSource + Flat = True + TabOrder = 0 + end + end + end + object DBGrid1: TDBGrid + Left = 0 + Top = 26 + Width = 441 + Height = 249 + Align = alClient + DataSource = DataSource + TabOrder = 1 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object MSQuery: TMSQuery + SQLInsert.Strings = ( + '{:EmpNO = CALL SDAC_InsertEmp;1(:ENAME, :JOB)}') + SQLDelete.Strings = ( + '{CALL SDAC_DeleteEmp;1(:EmpNO, :Result)}') + SQLUpdate.Strings = ( + + '{:RETURN_VALUE = CALL SDAC_UpdateEmp;1(:EMPNO, :ENAME, :JOB, :EM' + + 'PINFO)}') + Connection = SDACForm.MSConnection + SQL.Strings = ( + 'SELECT EMPNO, ENAME, JOB FROM EMP') + Debug = True + BeforeUpdateExecute = MSQueryBeforeUpdateExecute + AfterUpdateExecute = MSQueryAfterUpdateExecute + Left = 48 + Top = 208 + end + object DataSource: TDataSource + DataSet = MSQuery + Left = 80 + Top = 208 + end +end diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/StoredProcUpdates/StoredProcUpdates.pas b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/StoredProcUpdates/StoredProcUpdates.pas new file mode 100644 index 0000000..04781f7 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/StoredProcUpdates/StoredProcUpdates.pas @@ -0,0 +1,133 @@ +{ +Insert - example of using SP with return Identity value as result of executing +Update - example of using SP with return arbitrary value as result of executing +Delete - example of using SP with return arbitrary value as parameter +} + +unit StoredProcUpdates; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + Db, MemDS, DBAccess, Grids, DBGrids, StdCtrls, + ActnList, ExtCtrls, DBCtrls, MSAccess, SdacVcl, + Buttons, DemoFrame, SdacDemoForm; + +type + TStoredProcUpdatesFrame = class(TDemoFrame) + MSQuery: TMSQuery; + DataSource: TDataSource; + Panel1: TPanel; + DBGrid1: TDBGrid; + Panel2: TPanel; + DBNavigator1: TDBNavigator; + btClose: TSpeedButton; + btOpen: TSpeedButton; + procedure btOpenClick(Sender: TObject); + procedure btCloseClick(Sender: TObject); + procedure MSQueryBeforeUpdateExecute(Sender: TCustomMSDataSet; + StatementTypes: TStatementTypes; Params: TMSParams); + procedure MSQueryAfterUpdateExecute(Sender: TCustomMSDataSet; + StatementTypes: TStatementTypes; Params: TMSParams); + private + { Private declarations } + public + // Demo management + procedure Initialize; override; + procedure SetDebug(Value: boolean); override; + end; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} + +{$IFDEF CLR} +uses + Variants; +{$ENDIF} + +procedure TStoredProcUpdatesFrame.btOpenClick(Sender: TObject); +begin + MSQuery.Open; +end; + +procedure TStoredProcUpdatesFrame.btCloseClick(Sender: TObject); +begin + MSQuery.Close; +end; + +procedure TStoredProcUpdatesFrame.MSQueryBeforeUpdateExecute(Sender: TCustomMSDataSet; + StatementTypes: TStatementTypes; Params: TMSParams); +begin + if stInsert in StatementTypes then begin + Params.ParamByName('EMPNO').ParamType := ptResult; + // Params.ParamByName('RETURN_VALUE').DataType was setted equal to Sender.FieldByName('EMPNO').FieldType + end; + + if stUpdate in StatementTypes then begin + Params.ParamByName('RETURN_VALUE').ParamType := ptResult; + Params.ParamByName('RETURN_VALUE').DataType := ftInteger; // Field 'RETURN_VALUE' does not present in Sender, so we need to set DataType manually + + Params.ParamByName('EMPINFO').ParamType := ptOutput; + Params.ParamByName('EMPINFO').DataType := ftWideString; // Field 'EMPINFO' does not present in Sender, so we need to set DataType manually + end; + + if stDelete in StatementTypes then begin + Params.ParamByName('Result').ParamType := ptOutput; + Params.ParamByName('Result').DataType := ftInteger; // Field 'Result' does not present in Sender, so we need to set DataType manually + end; +end; + +procedure TStoredProcUpdatesFrame.MSQueryAfterUpdateExecute(Sender: TCustomMSDataSet; + StatementTypes: TStatementTypes; Params: TMSParams); +var + EMPNO, ReturnedEMPNO: integer; +begin + if stInsert in StatementTypes then begin + EMPNO := Integer(Params.ParamByName('EMPNO').Value); + Sender.FieldByName('EMPNO').ReadOnly := False; + try + Sender.FieldByName('EMPNO').NewValue := EMPNO; + finally + Sender.FieldByName('EMPNO').ReadOnly := True; + end; + end; + + if stUpdate in StatementTypes then begin + EMPNO := Sender.FieldByName('EMPNO').AsInteger; + ReturnedEMPNO := Integer(Params.ParamByName('RETURN_VALUE').Value); + + if EMPNO <> ReturnedEMPNO then + raise Exception.Create('Error on Update occured!'); + + Caption := String(Params.ParamByName('EMPINFO').Value); + end; + + if stDelete in StatementTypes then begin + EMPNO := Params.ParamByName('EMPNO').AsInteger; + ReturnedEMPNO := Integer(Params.ParamByName('Result').Value); + + if EMPNO + 2 {see StoredProc SDAC_DeleteEmployees} <> ReturnedEMPNO then + raise Exception.Create('Error on Delete occured!'); + end; +end; + +// Demo management +procedure TStoredProcUpdatesFrame.Initialize; +begin + inherited; + MSQuery.Connection := Connection as TMSConnection; +end; + +procedure TStoredProcUpdatesFrame.SetDebug(Value: boolean); +begin + MSQuery.Debug := Value; +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Table/Table.nfm b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Table/Table.nfm new file mode 100644 index 0000000..3375e6f --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Table/Table.nfm @@ -0,0 +1,180 @@ +inherited TableFrame: TTableFrame + Width = 441 + Height = 275 + Align = alClient + object DBGrid: TDBGrid + Left = 0 + Top = 76 + Width = 441 + Height = 199 + Align = alClient + DataSource = DataSource + TabOrder = 0 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object ToolBar: TPanel + Left = 0 + Top = 0 + Width = 441 + Height = 76 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object Panel3: TPanel + Left = 1 + Top = 0 + Width = 657 + Height = 75 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btOpen: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Open' + Flat = True + Transparent = False + OnClick = btOpenClick + end + object btClose: TSpeedButton + Left = 84 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Close' + Flat = True + Transparent = False + OnClick = btCloseClick + end + object btPrepare: TSpeedButton + Left = 167 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Prepare' + Flat = True + Transparent = False + OnClick = btPrepareClick + end + object btUnPrepare: TSpeedButton + Left = 250 + Top = 1 + Width = 82 + Height = 22 + Caption = 'UnPrepare' + Flat = True + Transparent = False + OnClick = btUnPrepareClick + end + object btExecute: TSpeedButton + Left = 333 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Execute' + Flat = True + Transparent = False + OnClick = btExecuteClick + end + object DBNavigator: TDBNavigator + Left = 416 + Top = 1 + Width = 240 + Height = 22 + DataSource = DataSource + Flat = True + TabOrder = 0 + end + object Panel7: TPanel + Left = 416 + Top = 24 + Width = 240 + Height = 50 + BevelOuter = bvNone + TabOrder = 1 + object Label3: TLabel + Left = 6 + Top = 4 + Width = 53 + Height = 13 + Caption = 'OrderFields' + end + object edOrderFields: TEdit + Left = 6 + Top = 20 + Width = 219 + Height = 21 + TabOrder = 0 + OnExit = edTableNameExit + end + end + object Panel5: TPanel + Left = 1 + Top = 24 + Width = 165 + Height = 50 + BevelOuter = bvNone + TabOrder = 2 + object Label1: TLabel + Left = 6 + Top = 4 + Width = 56 + Height = 13 + Caption = 'Table name' + end + object edTableName: TComboBox + Left = 6 + Top = 20 + Width = 140 + Height = 21 + ItemHeight = 13 + TabOrder = 0 + OnDropDown = edTableNameDropDown + OnExit = edTableNameExit + end + end + object Panel8: TPanel + Left = 167 + Top = 24 + Width = 248 + Height = 50 + BevelOuter = bvNone + TabOrder = 3 + object Label4: TLabel + Left = 6 + Top = 4 + Width = 43 + Height = 13 + Caption = 'FilterSQL' + end + object edFilterSQL: TEdit + Left = 6 + Top = 20 + Width = 226 + Height = 21 + TabOrder = 0 + OnExit = edTableNameExit + end + end + end + end + object DataSource: TDataSource + DataSet = MSTable + Left = 128 + Top = 32 + end + object MSTable: TMSTable + TableName = 'Emp' + OrderFields = 'EName' + Connection = SDACForm.MSConnection + Debug = True + Left = 96 + Top = 32 + end +end diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Table/Table.pas b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Table/Table.pas new file mode 100644 index 0000000..0911d54 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Table/Table.pas @@ -0,0 +1,176 @@ +unit Table; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + DBCtrls, ExtCtrls, Db, Grids, DBGrids, StdCtrls, ToolWin, + ComCtrls, MemDS, DBAccess, MSAccess, SdacVcl, + Buttons, DemoFrame, SdacDemoForm; + +type + TTableFrame = class(TDemoFrame) + DataSource: TDataSource; + MSTable: TMSTable; + DBGrid: TDBGrid; + ToolBar: TPanel; + Panel3: TPanel; + btOpen: TSpeedButton; + btClose: TSpeedButton; + btPrepare: TSpeedButton; + btUnPrepare: TSpeedButton; + btExecute: TSpeedButton; + DBNavigator: TDBNavigator; + Panel7: TPanel; + Label3: TLabel; + edOrderFields: TEdit; + Panel5: TPanel; + Label1: TLabel; + edTableName: TComboBox; + Panel8: TPanel; + Label4: TLabel; + edFilterSQL: TEdit; + procedure btOpenClick(Sender: TObject); + procedure btCloseClick(Sender: TObject); + procedure btPrepareClick(Sender: TObject); + procedure btUnPrepareClick(Sender: TObject); + procedure btExecuteClick(Sender: TObject); + procedure edTableNameExit(Sender: TObject); + procedure edTableNameDropDown(Sender: TObject); + private + { Private declarations } + procedure ShowState; + procedure AssignProperties; + public + // Demo management + procedure Initialize; override; + procedure SetDebug(Value: boolean); override; + end; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} + +procedure TTableFrame.AssignProperties; +begin + try + if Trim(MSTable.TableName) <> Trim(edTableName.Text) then + MSTable.TableName := edTableName.Text; + + MSTable.FilterSQL := edFilterSQL.Text; + + try + MSTable.OrderFields:= edOrderFields.Text; + except + edOrderFields.SetFocus; + raise; + end; + finally + ShowState; + end; + +end; + +procedure TTableFrame.ShowState; +var + St: string; + + procedure AddSt(S: string); + begin + if St <> '' then + St:= St + ', '; + St:= St + S; + end; + +begin + St:= ''; + + if MSTable.Prepared then begin + AddSt('Prepared'); + + if MSTable.IsQuery then + AddSt('IsQuery'); + end; + + if MSTable.Active then + AddSt('Active') + else + AddSt('Inactive'); + + SdacForm.StatusBar.Panels[2].Text:= St; +end; + +procedure TTableFrame.btOpenClick(Sender: TObject); +begin + try + AssignProperties; + MSTable.Open; + finally + ShowState; + end; +end; + +procedure TTableFrame.btCloseClick(Sender: TObject); +begin + MSTable.Close; + ShowState; +end; + +procedure TTableFrame.btPrepareClick(Sender: TObject); +begin + try + AssignProperties; + MSTable.Prepare; + finally + ShowState; + end; +end; + +procedure TTableFrame.btUnPrepareClick(Sender: TObject); +begin + MSTable.UnPrepare; + ShowState; +end; + +procedure TTableFrame.btExecuteClick(Sender: TObject); +begin + try + AssignProperties; + MSTable.Execute; + finally + ShowState; + end; +end; + +procedure TTableFrame.edTableNameExit(Sender: TObject); +begin + AssignProperties; +end; + +procedure TTableFrame.edTableNameDropDown(Sender: TObject); +begin + MSTable.Connection.GetTableNames(edTableName.Items); +end; + +// Demo management +procedure TTableFrame.Initialize; +begin + inherited; + MSTable.Connection := Connection as TMSConnection; + edTableName.Text:= MSTable.TableName; + edOrderFields.Text:= MSTable.OrderFields; + ShowState; +end; + +procedure TTableFrame.SetDebug(Value: boolean); +begin + MSTable.Debug:= Value; +end; + +end. + diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Text/Text.nfm b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Text/Text.nfm new file mode 100644 index 0000000..4540520 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Text/Text.nfm @@ -0,0 +1,162 @@ +inherited TextFrame: TTextFrame + Width = 441 + Height = 275 + Align = alClient + object Splitter1: TSplitter + Left = 0 + Top = 208 + Width = 441 + Height = 2 + Cursor = crVSplit + Align = alTop + end + object DBGrid: TDBGrid + Left = 0 + Top = 26 + Width = 441 + Height = 182 + Align = alTop + DataSource = DataSource + Options = [dgEditing, dgTitles, dgIndicator, dgColumnResize, dgColLines, dgRowLines, dgTabs, dgConfirmDelete] + TabOrder = 0 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object ToolBar: TPanel + Left = 0 + Top = 0 + Width = 441 + Height = 26 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object ToolButton1: TToolButton + Left = 362 + Top = 2 + Width = 16 + Caption = 'ToolButton1' + Style = tbsSeparator + end + object Panel1: TPanel + Left = 1 + Top = 1 + Width = 398 + Height = 24 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btClose: TSpeedButton + Left = 84 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Close' + Flat = True + Transparent = False + OnClick = btCloseClick + end + object btOpen: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Open' + Flat = True + Transparent = False + OnClick = btOpenClick + end + object DBNavigator: TDBNavigator + Left = 167 + Top = 1 + Width = 230 + Height = 22 + DataSource = DataSource + Flat = True + TabOrder = 0 + end + end + end + object meText: TDBMemo + Left = 0 + Top = 236 + Width = 441 + Height = 39 + Align = alClient + DataField = 'TextField' + DataSource = DataSource + ScrollBars = ssBoth + TabOrder = 2 + end + object ToolBar1: TPanel + Left = 0 + Top = 210 + Width = 441 + Height = 26 + Align = alTop + BevelOuter = bvNone + TabOrder = 3 + object Panel2: TPanel + Left = 1 + Top = 1 + Width = 250 + Height = 24 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btClear: TSpeedButton + Left = 167 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Clear' + Flat = True + Transparent = False + OnClick = btClearClick + end + object btSave: TSpeedButton + Left = 84 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Save to file' + Flat = True + Transparent = False + OnClick = btSaveClick + end + object btLoad: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Load from file' + Flat = True + Transparent = False + OnClick = btLoadClick + end + end + end + object DataSource: TDataSource + DataSet = MSQuery + Left = 440 + Top = 32 + end + object MSQuery: TMSQuery + Connection = SDACForm.MSConnection + SQL.Strings = ( + 'SELECT * FROM SDAC_Text') + Debug = True + Left = 408 + Top = 32 + end + object OpenDialog: TOpenDialog + Left = 240 + Top = 259 + end + object SaveDialog: TSaveDialog + Left = 272 + Top = 259 + end +end diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Text/Text.pas b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Text/Text.pas new file mode 100644 index 0000000..294ccb0 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Text/Text.pas @@ -0,0 +1,100 @@ +unit Text; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + DBCtrls, ExtCtrls, Db, Grids, DBGrids, StdCtrls, ToolWin, + ComCtrls, MemDS, DBAccess, MSAccess, SdacVcl, + Buttons, DemoFrame, DAScript, MSScript; + +type + TTextFrame = class(TDemoFrame) + DBGrid: TDBGrid; + DataSource: TDataSource; + ToolBar: TPanel; + meText: TDBMemo; + MSQuery: TMSQuery; + Splitter1: TSplitter; + ToolBar1: TPanel; + OpenDialog: TOpenDialog; + SaveDialog: TSaveDialog; + ToolButton1: TToolButton; + Panel1: TPanel; + DBNavigator: TDBNavigator; + btClose: TSpeedButton; + btOpen: TSpeedButton; + Panel2: TPanel; + btClear: TSpeedButton; + btSave: TSpeedButton; + btLoad: TSpeedButton; + procedure btOpenClick(Sender: TObject); + procedure btCloseClick(Sender: TObject); + procedure btLoadClick(Sender: TObject); + procedure btSaveClick(Sender: TObject); + procedure btClearClick(Sender: TObject); + private + { Private declarations } + public + // Demo management + procedure Initialize; override; + procedure SetDebug(Value: boolean); override; + end; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} + +procedure TTextFrame.btOpenClick(Sender: TObject); +begin + MSQuery.Open; +end; + +procedure TTextFrame.btCloseClick(Sender: TObject); +begin + MSQuery.Close; +end; + +procedure TTextFrame.btLoadClick(Sender: TObject); +begin + if MSQuery.Active and OpenDialog.Execute then begin + if MSQuery.State = dsBrowse then + MSQuery.Edit; + + TBlobField(MSQuery.FieldByName('TextField')).LoadFromFile(OpenDialog.FileName); + end; +end; + +procedure TTextFrame.btSaveClick(Sender: TObject); +begin + if not MSQuery.EOF and SaveDialog.Execute then + TBlobField(MSQuery.FieldByName('TextField')).SaveToFile(SaveDialog.FileName); +end; + +procedure TTextFrame.btClearClick(Sender: TObject); +begin + if MSQuery.Active then begin + if MSQuery.State = dsBrowse then + MSQuery.Edit; + MSQuery.FieldByName('TextField').Clear; + end; +end; + +// Demo management +procedure TTextFrame.Initialize; +begin + inherited; + MSQuery.Connection := Connection as TMSConnection; +end; + +procedure TTextFrame.SetDebug(Value: boolean); +begin + MSQuery.Debug := Value; +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Threads/Threads.nfm b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Threads/Threads.nfm new file mode 100644 index 0000000..547862f --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Threads/Threads.nfm @@ -0,0 +1,391 @@ +inherited ThreadsFrame: TThreadsFrame + Width = 441 + Height = 275 + Align = alClient + object Panel3: TPanel + Left = 0 + Top = 80 + Width = 441 + Height = 143 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object Splitter2: TSplitter + Left = 261 + Top = 0 + Height = 143 + end + object Panel4: TPanel + Left = 0 + Top = 0 + Width = 261 + Height = 143 + Align = alLeft + BevelOuter = bvNone + TabOrder = 0 + object meSQL: TMemo + Left = 0 + Top = 0 + Width = 261 + Height = 73 + Align = alTop + Font.Charset = RUSSIAN_CHARSET + Font.Color = clBlack + Font.Height = -12 + Font.Name = 'Courier New' + Font.Style = [] + ParentFont = False + ReadOnly = True + ScrollBars = ssVertical + TabOrder = 0 + end + object meLog: TMemo + Left = 0 + Top = 73 + Width = 261 + Height = 70 + Align = alClient + Font.Charset = RUSSIAN_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Courier New' + Font.Style = [] + ParentFont = False + ScrollBars = ssVertical + TabOrder = 1 + end + end + object DBGrid1: TDBGrid + Left = 264 + Top = 0 + Width = 177 + Height = 143 + Align = alClient + DataSource = MSDataSource + TabOrder = 1 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + end + object Panel2: TPanel + Left = 0 + Top = 0 + Width = 441 + Height = 80 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object Panel5: TPanel + Left = 0 + Top = 23 + Width = 418 + Height = 24 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btStart: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Start' + Flat = True + Transparent = False + OnClick = btStartClick + end + object btStop: TSpeedButton + Left = 84 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Stop' + Flat = True + Transparent = False + OnClick = btStopClick + end + object btRun: TSpeedButton + Left = 167 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Run' + Flat = True + Transparent = False + OnClick = btRunClick + end + object btRunMax: TSpeedButton + Left = 250 + Top = 1 + Width = 83 + Height = 22 + Caption = 'RunMax' + Flat = True + Transparent = False + OnClick = btRunMaxClick + end + object btClearLog: TSpeedButton + Left = 334 + Top = 1 + Width = 83 + Height = 22 + Caption = 'ClearLog' + Flat = True + Transparent = False + OnClick = btClearLogClick + end + end + object Panel6: TPanel + Left = 0 + Top = 0 + Width = 418 + Height = 24 + BevelOuter = bvNone + Color = clGreen + TabOrder = 1 + object btOpen: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Open' + Flat = True + Transparent = False + OnClick = btOpenClick + end + object btDeleteAll: TSpeedButton + Left = 84 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Delete All' + Flat = True + Transparent = False + OnClick = btDeleteAllClick + end + object DBNavigator1: TDBNavigator + Left = 167 + Top = 1 + Width = 250 + Height = 22 + Flat = True + TabOrder = 0 + end + end + object Panel11: TPanel + Left = 417 + Top = 0 + Width = 244 + Height = 47 + BevelOuter = bvNone + Color = clGreen + TabOrder = 2 + object Panel10: TPanel + Left = 1 + Top = 1 + Width = 120 + Height = 45 + BevelOuter = bvNone + TabOrder = 0 + object Label1: TLabel + Left = 5 + Top = 23 + Width = 92 + Height = 16 + Caption = 'Thread count' + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Height = -13 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + end + object Label2: TLabel + Left = 5 + Top = 2 + Width = 89 + Height = 16 + Caption = 'Except count' + Font.Charset = DEFAULT_CHARSET + Font.Color = clRed + Font.Height = -13 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + end + object lbThreadCount: TLabel + Left = 104 + Top = 23 + Width = 9 + Height = 16 + Caption = '0' + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Height = -13 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + end + object lbExceptCount: TLabel + Left = 104 + Top = 2 + Width = 9 + Height = 16 + Caption = '0' + Font.Charset = DEFAULT_CHARSET + Font.Color = clRed + Font.Height = -13 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + end + end + object Panel12: TPanel + Left = 122 + Top = 1 + Width = 121 + Height = 45 + BevelOuter = bvNone + TabOrder = 1 + object lbInterval: TLabel + Left = 57 + Top = 23 + Width = 6 + Height = 13 + Caption = '0' + end + object lbTime: TLabel + Left = 57 + Top = 2 + Width = 6 + Height = 13 + Caption = '0' + end + object Label5: TLabel + Left = 6 + Top = 2 + Width = 23 + Height = 13 + Caption = 'Time' + end + object Label6: TLabel + Left = 6 + Top = 23 + Width = 35 + Height = 13 + Caption = 'Interval' + end + end + end + object Panel13: TPanel + Left = 0 + Top = 46 + Width = 342 + Height = 30 + BevelOuter = bvNone + Color = clGreen + TabOrder = 3 + object Panel14: TPanel + Left = 1 + Top = 1 + Width = 164 + Height = 28 + BevelOuter = bvNone + TabOrder = 0 + object Label3: TLabel + Left = 6 + Top = 6 + Width = 54 + Height = 13 + Caption = 'MaxThread' + end + object edCount: TEdit + Left = 68 + Top = 3 + Width = 89 + Height = 21 + TabOrder = 0 + Text = 'edCount' + OnChange = edCountChange + end + end + object Panel9: TPanel + Left = 166 + Top = 1 + Width = 175 + Height = 28 + BevelOuter = bvNone + TabOrder = 1 + object Label4: TLabel + Left = 7 + Top = 7 + Width = 27 + Height = 13 + Caption = 'Mode' + end + object rbInsert: TRadioButton + Left = 41 + Top = 6 + Width = 63 + Height = 17 + Caption = 'INSERT' + TabOrder = 0 + OnClick = rgModeClick + end + object rbSelect: TRadioButton + Left = 105 + Top = 6 + Width = 81 + Height = 17 + Caption = 'SELECT' + TabOrder = 1 + OnClick = rgModeClick + end + end + end + end + object meErrorLog: TMemo + Left = 0 + Top = 223 + Width = 441 + Height = 52 + Align = alClient + Font.Charset = DEFAULT_CHARSET + Font.Color = clRed + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + ParentFont = False + ScrollBars = ssVertical + TabOrder = 2 + end + object Timer: TTimer + Enabled = False + OnTimer = TimerTimer + Left = 48 + Top = 80 + end + object MSDataSource: TDataSource + DataSet = MSQuery + Left = 48 + Top = 112 + end + object scDeleteAll: TMSSQL + Connection = SDACForm.MSConnection + SQL.Strings = ( + 'DELETE FROM ThreadTable') + Debug = True + CommandTimeout = 0 + Left = 116 + Top = 113 + end + object MSQuery: TMSQuery + Connection = SDACForm.MSConnection + SQL.Strings = ( + 'SELECT * FROM ThreadTable') + Left = 16 + Top = 112 + end +end diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Threads/Threads.pas b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Threads/Threads.pas new file mode 100644 index 0000000..a2be42f --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Threads/Threads.pas @@ -0,0 +1,382 @@ +unit Threads; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + StdCtrls, ExtCtrls, Db, MemDS, DBCtrls, ActiveX, + Grids, DBGrids, DBAccess, MSAccess, SdacVcl, + Buttons, ThreadsData, DemoFrame; + +const + WM_ENDTHREAD = $500; + WM_EXCEPTTHREAD = $501; + WM_ENDEXECUTE = $502; + +type + TThreadsFrame = class(TDemoFrame) + Timer: TTimer; + MSDataSource: TDataSource; + scDeleteAll: TMSSQL; + Panel3: TPanel; + Splitter2: TSplitter; + Panel4: TPanel; + meSQL: TMemo; + meLog: TMemo; + DBGrid1: TDBGrid; + Panel2: TPanel; + Panel5: TPanel; + btStart: TSpeedButton; + btStop: TSpeedButton; + btRun: TSpeedButton; + btRunMax: TSpeedButton; + btClearLog: TSpeedButton; + Panel6: TPanel; + btOpen: TSpeedButton; + btDeleteAll: TSpeedButton; + DBNavigator1: TDBNavigator; + Panel11: TPanel; + Panel10: TPanel; + Label1: TLabel; + Label2: TLabel; + lbThreadCount: TLabel; + lbExceptCount: TLabel; + Panel12: TPanel; + lbInterval: TLabel; + lbTime: TLabel; + Label5: TLabel; + Label6: TLabel; + Panel13: TPanel; + Panel14: TPanel; + Label3: TLabel; + edCount: TEdit; + Panel9: TPanel; + Label4: TLabel; + rbInsert: TRadioButton; + rbSelect: TRadioButton; + meErrorLog: TMemo; + MSQuery: TMSQuery; + procedure btRunClick(Sender: TObject); + procedure TimerTimer(Sender: TObject); + procedure btStartClick(Sender: TObject); + procedure btStopClick(Sender: TObject); + procedure edCountChange(Sender: TObject); + procedure btRunMaxClick(Sender: TObject); + procedure btClearLogClick(Sender: TObject); + procedure btOpenClick(Sender: TObject); + procedure rgModeClick(Sender: TObject); + procedure btDeleteAllClick(Sender: TObject); + procedure Button1Click(Sender: TObject); + + private + procedure WMEndExecute(var Msg: TMessage); message WM_ENDTHREAD; + procedure WMException(var Msg: TMessage); message WM_EXCEPTTHREAD; + + function RunThread(ObjectPtr: pointer; Method:pointer; EndMethod: pointer): THandle; + + procedure Execute; + procedure EndExecute(Result: boolean); + + procedure Log(St: string); + procedure ErrorLog(St: string); + + procedure TestConnected; + + public + // Demo management + procedure Initialize; override; + procedure SetDebug(Value: boolean); override; + end; + +implementation + +uses +{$IFNDEF VER130}Variants,{$ENDIF} + SdacDemoForm; + +{$WRITEABLECONST ON} + +{$R *.dfm} + +const + MaxThread: integer = 40; + Interval: integer = 2000; + ExceptCount: integer = 0; + +var + ThreadCount: integer; + ThreadNum: integer; + hCountSec: TRTLCriticalSection; + hLogSec: TRTLCriticalSection; + BegTime: TDateTime; + +type + TMethod = procedure (Self: pointer); + TEndMethod = procedure (Self: pointer; Result: boolean); + + PMethodDesc = ^TMethodDesc; + TMethodDesc = record + ObjectPtr :pointer; + Method :pointer; + EndMethod :pointer; + hWindow :HWND; + end; + +procedure ThreadProc(MethodDesc: PMethodDesc); stdcall; +begin + try + TMethod(MethodDesc^.Method)(MethodDesc.ObjectPtr); + PostMessage(MethodDesc.hWindow, WM_ENDTHREAD, DWORD(MethodDesc), 0); + except + on E:Exception do begin + PostMessage(MethodDesc.hWindow, WM_EXCEPTTHREAD, DWORD(MethodDesc), + DWORD(E)); + ExitThread(0); + end; + end; +end; + +procedure TThreadsFrame.WMEndExecute(var Msg: TMessage); +begin + if PMethodDesc(Msg.wParam).EndMethod <> nil then + TEndMethod(PMethodDesc(Msg.wParam).EndMethod)(PMethodDesc(Msg.wParam).ObjectPtr, True); + Dispose(PMethodDesc(Msg.wParam)); +end; + +procedure TThreadsFrame.WMException(var Msg: TMessage); +begin + if PMethodDesc(Msg.wParam).EndMethod <> nil then + TEndMethod(PMethodDesc(Msg.wParam).EndMethod)(PMethodDesc(Msg.wParam).ObjectPtr, False); + Dispose(PMethodDesc(Msg.wParam)); + raise Exception(Msg.lParam); +end; + +function TThreadsFrame.RunThread(ObjectPtr: pointer; Method: pointer; EndMethod: pointer): THandle; +var + ThreadId: DWORD; + MethodDesc: PMethodDesc; +begin + New(MethodDesc); + + MethodDesc.ObjectPtr := ObjectPtr; + MethodDesc.Method := Method; + MethodDesc.EndMethod := EndMethod; + MethodDesc.hWindow := Handle; + + InterlockedIncrement(ThreadCount); + Result:= CreateThread(nil, 1000, @ThreadProc, MethodDesc, 0, ThreadId); +end; + +procedure TThreadsFrame.Log(St: string); +begin + EnterCriticalSection(hLogSec); + if meLog.Lines.Count > 1000 then + meLog.Lines.Clear; + meLog.Lines.Add(St); + LeaveCriticalSection(hLogSec); +end; + +procedure TThreadsFrame.ErrorLog(St:string); +begin + EnterCriticalSection(hLogSec); + meErrorLog.Lines.Add(St); + LeaveCriticalSection(hLogSec); +end; + +const + Delay = 1000; + +procedure TThreadsFrame.Execute; +var + Data: TdmThreadsData; + ThreadNum: integer; + i: integer; +begin + i := CoInitializeEx(nil, COINIT_APARTMENTTHREADED); + if i <> S_OK then + raise Exception.Create('err - ' + IntToStr(i)); + + EnterCriticalSection(hCountSec); + Inc(Threads.ThreadNum); + ThreadNum := Threads.ThreadNum; + lbThreadCount.Caption := IntToStr(ThreadCount); + LeaveCriticalSection(hCountSec); + + Data := TdmThreadsData.Create(nil); + try + try + with Data do begin + Log(IntToStr(ThreadNum) + ' Connecting...'); + MSConnection.Assign(SdacForm.MSConnection); + MSConnection.LoginPrompt := False; + MSConnection.Connect; + Log(IntToStr(ThreadNum) + ' Connected'); + + if rbInsert.Checked then begin + // INSERT + MSSQL.ParamByName('ID').AsInteger := Random(10000); + MSSQL.Execute; +// MSConnection.Commit; + Log(IntToStr(ThreadNum) + ' Executed'); + end + else begin + // SELECT + MSQuery.Open; + i := 0; + while not MSQuery.Eof do begin + MSQuery.Next; + Inc(i); + end; + Log(IntToStr(ThreadNum) + ' Fetched ' + IntToStr(i) + ' rows'); + MSQuery.Close; + end; + + MSConnection.Disconnect; + Log(IntToStr(ThreadNum) + ' Disconnected'); + end; + except + on E:Exception do begin + MessageBeep(1000); + Log(IntToStr(ThreadNum) + ' ' + IntToStr(ThreadCount) + ' Exception ' + E.Message); + ErrorLog(IntToStr(ThreadNum) + ' ' + IntToStr(ThreadCount) + ' Exception ' + E.Message); + Inc(ExceptCount); + lbExceptCount.Caption := IntToStr(ExceptCount); + end; + end; + finally + Data.Free; + CoUninitialize; + end; +end; + +procedure TThreadsFrame.EndExecute(Result: boolean); +begin + InterlockedDecrement(ThreadCount); + EnterCriticalSection(hCountSec); + lbThreadCount.Caption := IntToStr(ThreadCount); + MessageBeep(1000); + LeaveCriticalSection(hCountSec); +end; + +procedure TThreadsFrame.btRunClick(Sender: TObject); +begin + TestConnected; + RunThread(Self, @TThreadsFrame.Execute, @TThreadsFrame.EndExecute); +end; + +procedure TThreadsFrame.btRunMaxClick(Sender: TObject); +var + i: integer; +begin + TestConnected; + for i := 1 to MaxThread do + RunThread(Self, @TThreadsFrame.Execute, @TThreadsFrame.EndExecute); +end; + +procedure TThreadsFrame.btStartClick(Sender: TObject); +begin + TestConnected; + edCount.Text := IntToStr(MaxThread); + BegTime := Time; + TimerTimer(nil); +end; + +procedure TThreadsFrame.btStopClick(Sender: TObject); +begin + Timer.Enabled := False; +end; + +procedure TThreadsFrame.TimerTimer(Sender: TObject); +begin + if ThreadCount < MaxThread then begin + btRunClick(nil); + if ThreadCount < (MaxThread div 10) * 9 then + Dec(Interval, Interval div 10); + end + else + Inc(Interval, Interval div 10); + + lbInterval.Caption := IntToStr(Interval); + lbExceptCount.Caption := IntToStr(ExceptCount); + Timer.Interval := Random(Interval - 1) + 1; + lbTime.Caption := TimeToStr(Time - BegTime); + + lbInterval.Caption := lbInterval.Caption + ' / ' + IntToStr(Timer.Interval); + + Timer.Enabled := True; +end; + +procedure TThreadsFrame.edCountChange(Sender: TObject); +begin + MaxThread := StrToInt(edCount.Text); +end; + +procedure TThreadsFrame.btClearLogClick(Sender: TObject); +begin + meLog.Lines.Clear; + meErrorLog.Lines.Clear; + ThreadNum := 0; + ExceptCount := 0; + lbExceptCount.Caption := IntToStr(ExceptCount); +end; + +procedure TThreadsFrame.btOpenClick(Sender: TObject); +begin + MSQuery.Close; + MSQuery.Open; +end; + +procedure TThreadsFrame.rgModeClick(Sender: TObject); +begin + if rbInsert.Checked then + meSQL.Lines.Assign(dmThreadsData.MSSQL.SQL) + else + meSQL.Lines.Assign(dmThreadsData.MSQuery.SQL) +end; + +procedure TThreadsFrame.btDeleteAllClick(Sender: TObject); +begin + scDeleteAll.Execute; +// MSConnection.Commit; +end; + +procedure TThreadsFrame.Button1Click(Sender: TObject); +begin + Execute; +end; + +procedure TThreadsFrame.TestConnected; +begin + SdacForm.MSConnection.Connect; + if not SdacForm.MSConnection.Connected then + Abort; +end; + +// Demo management +procedure TThreadsFrame.Initialize; +begin + inherited; + MSQuery.Connection := Connection as TMSConnection; + dmThreadsData := TdmThreadsData.Create(Self); + edCount.Text := IntToStr(MaxThread); + rbInsert.Checked := True; +end; + +procedure TThreadsFrame.SetDebug(Value: boolean); +begin + MSQuery.Debug := Value; +end; + +initialization + + // We are using Windows threading (vs Delphi TThread), so we need to enable IsMultiThread + IsMultiThread := True; + + InitializeCriticalSection(hCountSec); + InitializeCriticalSection(hLogSec); + Randomize; +finalization + DeleteCriticalSection(hCountSec); + DeleteCriticalSection(hLogSec); +end. + diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Threads/ThreadsData.nfm b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Threads/ThreadsData.nfm new file mode 100644 index 0000000..4ba49f4 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Threads/ThreadsData.nfm @@ -0,0 +1,36 @@ +object dmThreadsData: TdmThreadsData + OldCreateOrder = False + Left = 202 + Top = 164 + Height = 477 + Width = 739 + object MSConnection: TMSConnection + Database = 'SDACDemos' + Username = 'Sa' + LoginPrompt = False + Left = 24 + Top = 8 + end + object MSQuery: TMSQuery + Connection = MSConnection + SQL.Strings = ( + 'SELECT * FROM ThreadTable') + FetchRows = 1 + Left = 88 + Top = 8 + end + object MSSQL: TMSSQL + Connection = MSConnection + SQL.Strings = ( + 'INSERT INTO ThreadTable(ID, NAME)' + 'VALUES (:ID, '#39'Some name'#39')') + CommandTimeout = 0 + Left = 144 + Top = 8 + ParamData = < + item + DataType = ftUnknown + Name = 'ID' + end> + end +end diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Threads/ThreadsData.pas b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Threads/ThreadsData.pas new file mode 100644 index 0000000..ced5b17 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/Threads/ThreadsData.pas @@ -0,0 +1,33 @@ +unit ThreadsData; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + Db, MemDS, MSAccess, DBAccess; + +type + TdmThreadsData = class(TDataModule) + MSConnection: TMSConnection; + MSQuery: TMSQuery; + MSSQL: TMSSQL; + private + { Private declarations } + public + { Public declarations } + end; + +var + dmThreadsData: TdmThreadsData; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} + +end. + diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/UpdateSQL/UpdateSQL.nfm b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/UpdateSQL/UpdateSQL.nfm new file mode 100644 index 0000000..ab3c1a3 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/UpdateSQL/UpdateSQL.nfm @@ -0,0 +1,362 @@ +inherited UpdateSQLFrame: TUpdateSQLFrame + Width = 443 + Height = 277 + Align = alClient + object Splitter1: TSplitter + Left = 0 + Top = 121 + Width = 443 + Height = 3 + Cursor = crVSplit + Align = alTop + Beveled = True + Color = clGreen + ParentColor = False + end + object Panel5: TPanel + Left = 0 + Top = 0 + Width = 443 + Height = 49 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object Panel2: TPanel + Left = 1 + Top = 1 + Width = 416 + Height = 47 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btOpen: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Open' + Flat = True + Transparent = False + OnClick = btOpenClick + end + object btClose: TSpeedButton + Left = 84 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Close' + Flat = True + Transparent = False + OnClick = btCloseClick + end + object btPrepare: TSpeedButton + Left = 167 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Prepare' + Flat = True + Transparent = False + OnClick = btPrepareClick + end + object btUnPrepare: TSpeedButton + Left = 250 + Top = 1 + Width = 82 + Height = 22 + Caption = 'UnPrepare' + Flat = True + Transparent = False + OnClick = btUnPrepareClick + end + object btExecute: TSpeedButton + Left = 333 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Execute' + Flat = True + Transparent = False + OnClick = btExecuteClick + end + object Panel4: TPanel + Left = 1 + Top = 24 + Width = 414 + Height = 22 + BevelOuter = bvNone + TabOrder = 0 + object cbDeleteObject: TCheckBox + Left = 13 + Top = 3 + Width = 91 + Height = 17 + Caption = 'DeleteObject' + Color = clBtnFace + ParentColor = False + TabOrder = 0 + OnClick = cbDeleteObjectClick + end + object cbInsertObject: TCheckBox + Left = 116 + Top = 3 + Width = 81 + Height = 17 + Caption = 'InsertObject' + Color = clBtnFace + ParentColor = False + TabOrder = 1 + OnClick = cbDeleteObjectClick + end + object cbModifyObject: TCheckBox + Left = 212 + Top = 3 + Width = 91 + Height = 17 + Caption = 'ModifyObject' + Color = clBtnFace + ParentColor = False + TabOrder = 2 + OnClick = cbDeleteObjectClick + end + object cbRefreshObject: TCheckBox + Left = 311 + Top = 3 + Width = 93 + Height = 17 + Caption = 'RefreshObject' + Color = clBtnFace + ParentColor = False + TabOrder = 3 + OnClick = cbDeleteObjectClick + end + end + end + end + object meSQL: TMemo + Left = 0 + Top = 49 + Width = 443 + Height = 72 + Align = alTop + Anchors = [] + Constraints.MinHeight = 50 + ReadOnly = True + ScrollBars = ssVertical + TabOrder = 1 + OnExit = meSQLExit + end + object Panel3: TPanel + Left = 0 + Top = 124 + Width = 443 + Height = 24 + Align = alTop + BevelOuter = bvNone + TabOrder = 2 + object Panel1: TPanel + Left = 1 + Top = 0 + Width = 315 + Height = 24 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btRefreshRecord: TSpeedButton + Left = 232 + Top = 1 + Width = 82 + Height = 22 + Caption = 'RefreshRecord' + Flat = True + Transparent = False + OnClick = btRefreshRecordClick + end + object DBNavigator1: TDBNavigator + Left = 1 + Top = 1 + Width = 230 + Height = 22 + DataSource = DataSource + Flat = True + TabOrder = 0 + end + end + end + object DBGrid: TDBGrid + Left = 0 + Top = 148 + Width = 443 + Height = 129 + Align = alClient + DataSource = DataSource + TabOrder = 3 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object MSQuery: TMSQuery + Connection = SDACForm.MSConnection + SQL.Strings = ( + 'SELECT * FROM Emp') + Debug = True + UpdateObject = MSUpdateSQL + Left = 18 + Top = 42 + end + object DataSource: TDataSource + DataSet = MSQuery + Left = 82 + Top = 42 + end + object MSUpdateSQL: TMSUpdateSQL + InsertSQL.Strings = ( + 'INSERT INTO Emp' + ' (ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO)' + 'VALUES' + ' (:ENAME, :JOB, :MGR, :HIREDATE, :SAL, :COMM, :DEPTNO)' + 'SET :EMPNO = SCOPE_IDENTITY()') + DeleteSQL.Strings = ( + 'DELETE FROM Emp' + 'WHERE' + ' EMPNO = :Old_EMPNO') + ModifySQL.Strings = ( + 'UPDATE Emp' + 'SET' + + ' ENAME = :ENAME, JOB = :JOB, MGR = :MGR, HIREDATE = :HIREDATE, ' + + 'SAL = :SAL, COMM = :COMM, DEPTNO = :DEPTNO' + 'WHERE' + ' EMPNO = :Old_EMPNO') + RefreshSQL.Strings = ( + + 'SELECT Emp.ENAME, Emp.JOB, Emp.MGR, Emp.HIREDATE, Emp.SAL, Emp.C' + + 'OMM, Emp.DEPTNO FROM Emp' + 'WHERE Emp.EMPNO = :EMPNO ') + Left = 50 + Top = 42 + end + object DeleteSQL: TMSSQL + Connection = SDACForm.MSConnection + SQL.Strings = ( + 'DELETE FROM Emp' + 'WHERE' + ' EMPNO = :Old_EMPNO') + CommandTimeout = 0 + Left = 120 + Top = 15 + ParamData = < + item + DataType = ftUnknown + Name = 'Old_EMPNO' + end> + end + object InsertSQL: TMSSQL + Connection = SDACForm.MSConnection + SQL.Strings = ( + 'INSERT INTO Emp' + ' (ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO)' + 'VALUES' + ' (:ENAME, :JOB, :MGR, :HIREDATE, :SAL, :COMM, :DEPTNO)' + 'SET :EMPNO = SCOPE_IDENTITY()') + CommandTimeout = 0 + Left = 120 + Top = 45 + ParamData = < + item + DataType = ftUnknown + Name = 'ENAME' + end + item + DataType = ftUnknown + Name = 'JOB' + end + item + DataType = ftUnknown + Name = 'MGR' + end + item + DataType = ftUnknown + Name = 'HIREDATE' + end + item + DataType = ftUnknown + Name = 'SAL' + end + item + DataType = ftUnknown + Name = 'COMM' + end + item + DataType = ftUnknown + Name = 'DEPTNO' + end + item + DataType = ftUnknown + Name = 'EMPNO' + end> + end + object ModifyQuery: TMSQuery + Connection = SDACForm.MSConnection + SQL.Strings = ( + 'UPDATE Emp' + 'SET' + + ' ENAME = :ENAME, JOB = :JOB, MGR = :MGR, HIREDATE = :HIREDATE, ' + + 'SAL = :SAL, COMM = :COMM, DEPTNO = :DEPTNO' + 'WHERE' + ' EMPNO = :Old_EMPNO') + Left = 120 + Top = 75 + ParamData = < + item + DataType = ftUnknown + Name = 'ENAME' + end + item + DataType = ftUnknown + Name = 'JOB' + end + item + DataType = ftUnknown + Name = 'MGR' + end + item + DataType = ftUnknown + Name = 'HIREDATE' + end + item + DataType = ftUnknown + Name = 'SAL' + end + item + DataType = ftUnknown + Name = 'COMM' + end + item + DataType = ftUnknown + Name = 'DEPTNO' + end + item + DataType = ftUnknown + Name = 'Old_EMPNO' + end> + end + object RefreshQuery: TMSQuery + Connection = SDACForm.MSConnection + SQL.Strings = ( + + 'SELECT Emp.ENAME, Emp.JOB, Emp.MGR, Emp.HIREDATE, Emp.SAL, Emp.C' + + 'OMM, Emp.DEPTNO FROM Emp' + 'WHERE Emp.EMPNO = :EMPNO ') + Left = 120 + Top = 110 + ParamData = < + item + DataType = ftUnknown + Name = 'EMPNO' + end> + end +end diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/UpdateSQL/UpdateSQL.pas b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/UpdateSQL/UpdateSQL.pas new file mode 100644 index 0000000..6c90805 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/UpdateSQL/UpdateSQL.pas @@ -0,0 +1,191 @@ +unit UpdateSQL; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + DBCtrls, ExtCtrls, Db, Grids, DBGrids, StdCtrls, ToolWin, + ComCtrls, MemDS, DBAccess, MSAccess, SdacVcl, + Buttons, DemoFrame, SdacDemoForm; + +type + TUpdateSQLFrame = class(TDemoFrame) + MSQuery: TMSQuery; + DataSource: TDataSource; + MSUpdateSQL: TMSUpdateSQL; + Panel5: TPanel; + Panel2: TPanel; + btOpen: TSpeedButton; + btClose: TSpeedButton; + btPrepare: TSpeedButton; + btUnPrepare: TSpeedButton; + btExecute: TSpeedButton; + meSQL: TMemo; + Splitter1: TSplitter; + Panel3: TPanel; + Panel1: TPanel; + btRefreshRecord: TSpeedButton; + DBNavigator1: TDBNavigator; + DBGrid: TDBGrid; + DeleteSQL: TMSSQL; + InsertSQL: TMSSQL; + ModifyQuery: TMSQuery; + RefreshQuery: TMSQuery; + Panel4: TPanel; + cbDeleteObject: TCheckBox; + cbInsertObject: TCheckBox; + cbModifyObject: TCheckBox; + cbRefreshObject: TCheckBox; + procedure btOpenClick(Sender: TObject); + procedure btCloseClick(Sender: TObject); + procedure btPrepareClick(Sender: TObject); + procedure btUnPrepareClick(Sender: TObject); + procedure btExecuteClick(Sender: TObject); + procedure meSQLExit(Sender: TObject); + procedure btRefreshRecordClick(Sender: TObject); + procedure cbDeleteObjectClick(Sender: TObject); + private + { Private declarations } + procedure ShowState; + procedure AssignProperties; + public + // Demo management + procedure Initialize; override; + procedure SetDebug(Value: boolean); override; + end; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} + +procedure TUpdateSQLFrame.ShowState; +var + St:string; + + procedure AddSt(S:string); + begin + if St <> '' then + St:= St + ', '; + St:= St + S; + end; + +begin + St:= ''; + + if MSQuery.Prepared then begin + AddSt('Prepared'); + + if MSQuery.IsQuery then + AddSt('IsQuery'); + end; + + if MSQuery.Active then + AddSt('Active') + else + AddSt('Inactive'); + + if MSQuery.Executing then + AddSt('Executing'); + + if MSQuery.Fetching then + AddSt('Fetching'); + + SdacForm.StatusBar.Panels[0].Text:= St; +end; + +procedure TUpdateSQLFrame.AssignProperties; +begin + if MSQuery.SQL.Text <> meSQL.Lines.Text then + MSQuery.SQL.Assign(meSQL.Lines); +end; + +procedure TUpdateSQLFrame.meSQLExit(Sender: TObject); +begin + if Trim(MSQuery.SQL.Text) <> Trim(meSQL.Lines.Text) then + MSQuery.SQL.Text:= meSQL.Lines.Text; + ShowState; +end; + +procedure TUpdateSQLFrame.btOpenClick(Sender: TObject); +begin + try + AssignProperties; + MSQuery.Open; + finally + ShowState; + end; +end; + +procedure TUpdateSQLFrame.btCloseClick(Sender: TObject); +begin + MSQuery.Close; + ShowState; +end; + +procedure TUpdateSQLFrame.btPrepareClick(Sender: TObject); +begin + try + AssignProperties; + MSQuery.Prepare; + finally + ShowState; + end; +end; + +procedure TUpdateSQLFrame.btUnPrepareClick(Sender: TObject); +begin + MSQuery.UnPrepare; + ShowState; +end; + +procedure TUpdateSQLFrame.btExecuteClick(Sender: TObject); +begin + try + AssignProperties; + MSQuery.Execute; + finally + ShowState; + end; +end; + +procedure TUpdateSQLFrame.btRefreshRecordClick(Sender: TObject); +begin + MSQuery.RefreshRecord; +end; + +// Demo management +procedure TUpdateSQLFrame.Initialize; +begin + inherited; + MSQuery.Connection := Connection as TMSConnection; + meSQL.Lines.Assign(MSQuery.SQL); + ShowState; +end; + +procedure TUpdateSQLFrame.SetDebug(Value: boolean); +begin + MSQuery.Debug:= Value; +end; + +procedure TUpdateSQLFrame.cbDeleteObjectClick(Sender: TObject); + function GetComponent(cbObject: TCheckBox; Component: TComponent): TComponent; + begin + if cbObject.Checked then + Result := Component + else + Result := nil; + end; +begin + MSUpdateSQL.DeleteObject := GetComponent(cbDeleteObject, DeleteSQL); + MSUpdateSQL.InsertObject := GetComponent(cbInsertObject, InsertSQL); + MSUpdateSQL.ModifyObject := GetComponent(cbModifyObject, ModifyQuery); + MSUpdateSQL.RefreshObject := GetComponent(cbRefreshObject, RefreshQuery); +end; + +end. + diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/VirtualTable/VTable.nfm b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/VirtualTable/VTable.nfm new file mode 100644 index 0000000..2447d79 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/VirtualTable/VTable.nfm @@ -0,0 +1,565 @@ +inherited VirtualTableFrame: TVirtualTableFrame + Width = 443 + Height = 267 + Align = alClient + object Splitter: TSplitter + Left = 0 + Top = 148 + Width = 443 + Height = 3 + Cursor = crVSplit + Align = alBottom + end + object DBGrid: TDBGrid + Left = 0 + Top = 117 + Width = 443 + Height = 31 + Align = alClient + DataSource = DataSource + TabOrder = 0 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object DBMemo: TDBMemo + Left = 0 + Top = 151 + Width = 443 + Height = 116 + Align = alBottom + DataField = 'MEMO' + DataSource = DataSource + TabOrder = 1 + end + object Panel1: TPanel + Left = 0 + Top = 0 + Width = 443 + Height = 117 + Align = alTop + BevelOuter = bvNone + TabOrder = 2 + object Panel2: TPanel + Left = 1 + Top = 1 + Width = 405 + Height = 115 + BevelOuter = bvNone + Color = 9790720 + TabOrder = 0 + object btOpen: TSpeedButton + Left = 1 + Top = 1 + Width = 100 + Height = 22 + Caption = 'Open' + Flat = True + Transparent = False + OnClick = btOpenClick + end + object btClose: TSpeedButton + Left = 102 + Top = 1 + Width = 100 + Height = 22 + Caption = 'Close' + Flat = True + Transparent = False + OnClick = btCloseClick + end + object btAutoFill: TSpeedButton + Left = 203 + Top = 24 + Width = 100 + Height = 22 + Caption = 'Append 100' + Flat = True + Transparent = False + OnClick = btAutoFillClick + end + object btAddField: TSpeedButton + Left = 203 + Top = 1 + Width = 100 + Height = 22 + Caption = 'Add field' + Flat = True + Transparent = False + OnClick = btAddFieldClick + end + object btDelField: TSpeedButton + Left = 304 + Top = 1 + Width = 100 + Height = 22 + Caption = 'Delete field' + Flat = True + Transparent = False + OnClick = btDelFieldClick + end + object btClear: TSpeedButton + Left = 304 + Top = 24 + Width = 100 + Height = 22 + Caption = 'Clear' + Flat = True + Transparent = False + OnClick = btClearClick + end + object btSave: TSpeedButton + Left = 102 + Top = 24 + Width = 100 + Height = 22 + Caption = 'Save...' + Flat = True + Transparent = False + OnClick = btSaveClick + end + object btLoad: TSpeedButton + Left = 1 + Top = 24 + Width = 100 + Height = 22 + Caption = 'Load...' + Flat = True + Transparent = False + OnClick = btLoadClick + end + object Panel4: TPanel + Left = 1 + Top = 47 + Width = 152 + Height = 33 + BevelOuter = bvNone + TabOrder = 0 + object Label1: TLabel + Left = 5 + Top = 10 + Width = 22 + Height = 13 + Caption = 'Field' + end + object edField: TEdit + Left = 35 + Top = 5 + Width = 111 + Height = 21 + TabOrder = 0 + Text = 'Number' + end + end + object Panel5: TPanel + Left = 1 + Top = 81 + Width = 403 + Height = 33 + BevelOuter = bvNone + TabOrder = 2 + object Label5: TLabel + Left = 5 + Top = 10 + Width = 22 + Height = 13 + Caption = 'Filter' + end + object cbFiltered: TCheckBox + Left = 325 + Top = 7 + Width = 64 + Height = 17 + Caption = 'Filtered' + TabOrder = 1 + OnClick = cbFilteredClick + end + object edFilter: TEdit + Left = 35 + Top = 5 + Width = 267 + Height = 21 + TabOrder = 0 + OnExit = edFilterExit + end + end + object Panel6: TPanel + Left = 154 + Top = 47 + Width = 250 + Height = 33 + BevelOuter = bvNone + TabOrder = 1 + object Label2: TLabel + Left = 5 + Top = 10 + Width = 27 + Height = 13 + Caption = 'Value' + end + object edValue: TEdit + Left = 37 + Top = 5 + Width = 111 + Height = 21 + TabOrder = 0 + Text = '7' + end + object Panel7: TPanel + Left = 158 + Top = 4 + Width = 87 + Height = 24 + BevelOuter = bvNone + Color = 9790720 + TabOrder = 1 + object btLocate: TSpeedButton + Left = 1 + Top = 1 + Width = 85 + Height = 22 + Caption = 'Locate' + Flat = True + Transparent = False + OnClick = btLocateClick + end + end + end + end + end + object OpenDialog: TOpenDialog + DefaultExt = 'xml' + FileName = 'Data1' + Filter = 'Virtual Table Data (*.xml;*.vtd)|*.xml;*.vtd|All Files (*.*)|*.*' + Left = 416 + Top = 34 + end + object SaveDialog: TSaveDialog + DefaultExt = 'xml' + FileName = 'Data1' + Filter = 'XML Virtual Table Data (*.xml)|*.xml|Binary Virtual Table Data (*.vtd)|*.vtd|All Files (*.*)|*.*' + Left = 448 + Top = 34 + end + object VirtualTable: TVirtualTable + Active = True + Filter = 'String LIKE '#39'%1%'#39 + FieldDefs = < + item + Name = 'NUMBER' + DataType = ftFloat + end + item + Name = 'STRING' + DataType = ftString + Size = 50 + end + item + Name = 'DATE' + DataType = ftDateTime + end + item + Name = 'MEMO' + DataType = ftMemo + end> + Left = 416 + Top = 2 + Data = { + 0300040006004E554D42455206000000000000000600535452494E4701003200 + 000000000400444154450B0000000000000004004D454D4F1000000000000000 + 00006400000008000000000000000000F03F2B00000055736520436F7265204C + 616220446174612041636365737320436F6D706F6E656E747320212121202831 + 29080000000000C6BF58C8CC420E0000004D656D6F2076616C75652028312908 + 00000000000000000000402B00000055736520436F7265204C61622044617461 + 2041636365737320436F6D706F6E656E74732021212120283229080000000000 + C6BF58C8CC420E0000004D656D6F2076616C7565202832290800000000000000 + 000008402B00000055736520436F7265204C6162204461746120416363657373 + 20436F6D706F6E656E74732021212120283329080000000000C6BF58C8CC420E + 0000004D656D6F2076616C7565202833290800000000000000000010402B0000 + 0055736520436F7265204C616220446174612041636365737320436F6D706F6E + 656E74732021212120283429080000000000C6BF58C8CC420E0000004D656D6F + 2076616C7565202834290800000000000000000014402B00000055736520436F + 7265204C616220446174612041636365737320436F6D706F6E656E7473202121 + 2120283529080000000000C6BF58C8CC420E0000004D656D6F2076616C756520 + 2835290800000000000000000018402B00000055736520436F7265204C616220 + 446174612041636365737320436F6D706F6E656E747320212121202836290800 + 00000000C6BF58C8CC420E0000004D656D6F2076616C75652028362908000000 + 0000000000001C402B00000055736520436F7265204C61622044617461204163 + 6365737320436F6D706F6E656E74732021212120283729080000000000C6BF58 + C8CC420E0000004D656D6F2076616C7565202837290800000000000000000020 + 402B00000055736520436F7265204C616220446174612041636365737320436F + 6D706F6E656E74732021212120283829080000000000C6BF58C8CC420E000000 + 4D656D6F2076616C7565202838290800000000000000000022402B0000005573 + 6520436F7265204C616220446174612041636365737320436F6D706F6E656E74 + 732021212120283929080000000000C6BF58C8CC420E0000004D656D6F207661 + 6C7565202839290800000000000000000024402C00000055736520436F726520 + 4C616220446174612041636365737320436F6D706F6E656E7473202121212028 + 313029080000000000C6BF58C8CC420F0000004D656D6F2076616C7565202831 + 30290800000000000000000026402C00000055736520436F7265204C61622044 + 6174612041636365737320436F6D706F6E656E74732021212120283131290800 + 00000000C6BF58C8CC420F0000004D656D6F2076616C75652028313129080000 + 0000000000000028402C00000055736520436F7265204C616220446174612041 + 636365737320436F6D706F6E656E7473202121212028313229080000000000C6 + BF58C8CC420F0000004D656D6F2076616C756520283132290800000000000000 + 00002A402C00000055736520436F7265204C6162204461746120416363657373 + 20436F6D706F6E656E7473202121212028313329080000000000C6BF58C8CC42 + 0F0000004D656D6F2076616C75652028313329080000000000000000002C402C + 00000055736520436F7265204C616220446174612041636365737320436F6D70 + 6F6E656E7473202121212028313429080000000000C6BF58C8CC420F0000004D + 656D6F2076616C75652028313429080000000000000000002E402C0000005573 + 6520436F7265204C616220446174612041636365737320436F6D706F6E656E74 + 73202121212028313529080000000000C6BF58C8CC420F0000004D656D6F2076 + 616C756520283135290800000000000000000030402C00000055736520436F72 + 65204C616220446174612041636365737320436F6D706F6E656E747320212121 + 2028313629080000000000C6BF58C8CC420F0000004D656D6F2076616C756520 + 283136290800000000000000000031402C00000055736520436F7265204C6162 + 20446174612041636365737320436F6D706F6E656E7473202121212028313729 + 080000000000C6BF58C8CC420F0000004D656D6F2076616C7565202831372908 + 00000000000000000032402C00000055736520436F7265204C61622044617461 + 2041636365737320436F6D706F6E656E74732021212120283138290800000000 + 00C6BF58C8CC420F0000004D656D6F2076616C75652028313829080000000000 + 0000000033402C00000055736520436F7265204C616220446174612041636365 + 737320436F6D706F6E656E7473202121212028313929080000000000C6BF58C8 + CC420F0000004D656D6F2076616C756520283139290800000000000000000034 + 402C00000055736520436F7265204C616220446174612041636365737320436F + 6D706F6E656E7473202121212028323029080000000000C6BF58C8CC420F0000 + 004D656D6F2076616C756520283230290800000000000000000035402C000000 + 55736520436F7265204C616220446174612041636365737320436F6D706F6E65 + 6E7473202121212028323129080000000000C6BF58C8CC420F0000004D656D6F + 2076616C756520283231290800000000000000000036402C0000005573652043 + 6F7265204C616220446174612041636365737320436F6D706F6E656E74732021 + 21212028323229080000000000C6BF58C8CC420F0000004D656D6F2076616C75 + 6520283232290800000000000000000037402C00000055736520436F7265204C + 616220446174612041636365737320436F6D706F6E656E747320212121202832 + 3329080000000000C6BF58C8CC420F0000004D656D6F2076616C756520283233 + 290800000000000000000038402C00000055736520436F7265204C6162204461 + 74612041636365737320436F6D706F6E656E7473202121212028323429080000 + 000000C6BF58C8CC420F0000004D656D6F2076616C7565202832342908000000 + 00000000000039402C00000055736520436F7265204C61622044617461204163 + 6365737320436F6D706F6E656E7473202121212028323529080000000000C6BF + 58C8CC420F0000004D656D6F2076616C75652028323529080000000000000000 + 003A402C00000055736520436F7265204C616220446174612041636365737320 + 436F6D706F6E656E7473202121212028323629080000000000C6BF58C8CC420F + 0000004D656D6F2076616C75652028323629080000000000000000003B402C00 + 000055736520436F7265204C616220446174612041636365737320436F6D706F + 6E656E7473202121212028323729080000000000C6BF58C8CC420F0000004D65 + 6D6F2076616C75652028323729080000000000000000003C402C000000557365 + 20436F7265204C616220446174612041636365737320436F6D706F6E656E7473 + 202121212028323829080000000000C6BF58C8CC420F0000004D656D6F207661 + 6C75652028323829080000000000000000003D402C00000055736520436F7265 + 204C616220446174612041636365737320436F6D706F6E656E74732021212120 + 28323929080000000000C6BF58C8CC420F0000004D656D6F2076616C75652028 + 323929080000000000000000003E402C00000055736520436F7265204C616220 + 446174612041636365737320436F6D706F6E656E747320212121202833302908 + 0000000000C6BF58C8CC420F0000004D656D6F2076616C756520283330290800 + 00000000000000003F402C00000055736520436F7265204C6162204461746120 + 41636365737320436F6D706F6E656E7473202121212028333129080000000000 + C6BF58C8CC420F0000004D656D6F2076616C7565202833312908000000000000 + 00000040402C00000055736520436F7265204C61622044617461204163636573 + 7320436F6D706F6E656E7473202121212028333229080000000000C6BF58C8CC + 420F0000004D656D6F2076616C75652028333229080000000000000000804040 + 2C00000055736520436F7265204C616220446174612041636365737320436F6D + 706F6E656E7473202121212028333329080000000000C6BF58C8CC420F000000 + 4D656D6F2076616C756520283333290800000000000000000041402C00000055 + 736520436F7265204C616220446174612041636365737320436F6D706F6E656E + 7473202121212028333429080000000000C6BF58C8CC420F0000004D656D6F20 + 76616C756520283334290800000000000000008041402C00000055736520436F + 7265204C616220446174612041636365737320436F6D706F6E656E7473202121 + 212028333529080000000000C6BF58C8CC420F0000004D656D6F2076616C7565 + 20283335290800000000000000000042402C00000055736520436F7265204C61 + 6220446174612041636365737320436F6D706F6E656E74732021212120283336 + 29080000000000C6BF58C8CC420F0000004D656D6F2076616C75652028333629 + 0800000000000000008042402C00000055736520436F7265204C616220446174 + 612041636365737320436F6D706F6E656E747320212121202833372908000000 + 0000C6BF58C8CC420F0000004D656D6F2076616C756520283337290800000000 + 000000000043402C00000055736520436F7265204C6162204461746120416363 + 65737320436F6D706F6E656E7473202121212028333829080000000000C6BF58 + C8CC420F0000004D656D6F2076616C7565202833382908000000000000000080 + 43402C00000055736520436F7265204C61622044617461204163636573732043 + 6F6D706F6E656E7473202121212028333929080000000000C6BF58C8CC420F00 + 00004D656D6F2076616C756520283339290800000000000000000044402C0000 + 0055736520436F7265204C616220446174612041636365737320436F6D706F6E + 656E7473202121212028343029080000000000C6BF58C8CC420F0000004D656D + 6F2076616C756520283430290800000000000000008044402C00000055736520 + 436F7265204C616220446174612041636365737320436F6D706F6E656E747320 + 2121212028343129080000000000C6BF58C8CC420F0000004D656D6F2076616C + 756520283431290800000000000000000045402C00000055736520436F726520 + 4C616220446174612041636365737320436F6D706F6E656E7473202121212028 + 343229080000000000C6BF58C8CC420F0000004D656D6F2076616C7565202834 + 32290800000000000000008045402C00000055736520436F7265204C61622044 + 6174612041636365737320436F6D706F6E656E74732021212120283433290800 + 00000000C6BF58C8CC420F0000004D656D6F2076616C75652028343329080000 + 0000000000000046402C00000055736520436F7265204C616220446174612041 + 636365737320436F6D706F6E656E7473202121212028343429080000000000C6 + BF58C8CC420F0000004D656D6F2076616C756520283434290800000000000000 + 008046402C00000055736520436F7265204C6162204461746120416363657373 + 20436F6D706F6E656E7473202121212028343529080000000000C6BF58C8CC42 + 0F0000004D656D6F2076616C756520283435290800000000000000000047402C + 00000055736520436F7265204C616220446174612041636365737320436F6D70 + 6F6E656E7473202121212028343629080000000000C6BF58C8CC420F0000004D + 656D6F2076616C756520283436290800000000000000008047402C0000005573 + 6520436F7265204C616220446174612041636365737320436F6D706F6E656E74 + 73202121212028343729080000000000C6BF58C8CC420F0000004D656D6F2076 + 616C756520283437290800000000000000000048402C00000055736520436F72 + 65204C616220446174612041636365737320436F6D706F6E656E747320212121 + 2028343829080000000000C6BF58C8CC420F0000004D656D6F2076616C756520 + 283438290800000000000000008048402C00000055736520436F7265204C6162 + 20446174612041636365737320436F6D706F6E656E7473202121212028343929 + 080000000000C6BF58C8CC420F0000004D656D6F2076616C7565202834392908 + 00000000000000000049402C00000055736520436F7265204C61622044617461 + 2041636365737320436F6D706F6E656E74732021212120283530290800000000 + 00C6BF58C8CC420F0000004D656D6F2076616C75652028353029080000000000 + 0000008049402C00000055736520436F7265204C616220446174612041636365 + 737320436F6D706F6E656E7473202121212028353129080000000000C6BF58C8 + CC420F0000004D656D6F2076616C75652028353129080000000000000000004A + 402C00000055736520436F7265204C616220446174612041636365737320436F + 6D706F6E656E7473202121212028353229080000000000C6BF58C8CC420F0000 + 004D656D6F2076616C75652028353229080000000000000000804A402C000000 + 55736520436F7265204C616220446174612041636365737320436F6D706F6E65 + 6E7473202121212028353329080000000000C6BF58C8CC420F0000004D656D6F + 2076616C75652028353329080000000000000000004B402C0000005573652043 + 6F7265204C616220446174612041636365737320436F6D706F6E656E74732021 + 21212028353429080000000000C6BF58C8CC420F0000004D656D6F2076616C75 + 652028353429080000000000000000804B402C00000055736520436F7265204C + 616220446174612041636365737320436F6D706F6E656E747320212121202835 + 3529080000000000C6BF58C8CC420F0000004D656D6F2076616C756520283535 + 29080000000000000000004C402C00000055736520436F7265204C6162204461 + 74612041636365737320436F6D706F6E656E7473202121212028353629080000 + 000000C6BF58C8CC420F0000004D656D6F2076616C7565202835362908000000 + 0000000000804C402C00000055736520436F7265204C61622044617461204163 + 6365737320436F6D706F6E656E7473202121212028353729080000000000C6BF + 58C8CC420F0000004D656D6F2076616C75652028353729080000000000000000 + 004D402C00000055736520436F7265204C616220446174612041636365737320 + 436F6D706F6E656E7473202121212028353829080000000000C6BF58C8CC420F + 0000004D656D6F2076616C75652028353829080000000000000000804D402C00 + 000055736520436F7265204C616220446174612041636365737320436F6D706F + 6E656E7473202121212028353929080000000000C6BF58C8CC420F0000004D65 + 6D6F2076616C75652028353929080000000000000000004E402C000000557365 + 20436F7265204C616220446174612041636365737320436F6D706F6E656E7473 + 202121212028363029080000000000C6BF58C8CC420F0000004D656D6F207661 + 6C75652028363029080000000000000000804E402C00000055736520436F7265 + 204C616220446174612041636365737320436F6D706F6E656E74732021212120 + 28363129080000000000C6BF58C8CC420F0000004D656D6F2076616C75652028 + 363129080000000000000000004F402C00000055736520436F7265204C616220 + 446174612041636365737320436F6D706F6E656E747320212121202836322908 + 0000000000C6BF58C8CC420F0000004D656D6F2076616C756520283632290800 + 00000000000000804F402C00000055736520436F7265204C6162204461746120 + 41636365737320436F6D706F6E656E7473202121212028363329080000000000 + C6BF58C8CC420F0000004D656D6F2076616C7565202836332908000000000000 + 00000050402C00000055736520436F7265204C61622044617461204163636573 + 7320436F6D706F6E656E7473202121212028363429080000000000C6BF58C8CC + 420F0000004D656D6F2076616C75652028363429080000000000000000405040 + 2C00000055736520436F7265204C616220446174612041636365737320436F6D + 706F6E656E7473202121212028363529080000000000C6BF58C8CC420F000000 + 4D656D6F2076616C756520283635290800000000000000008050402C00000055 + 736520436F7265204C616220446174612041636365737320436F6D706F6E656E + 7473202121212028363629080000000000C6BF58C8CC420F0000004D656D6F20 + 76616C75652028363629080000000000000000C050402C00000055736520436F + 7265204C616220446174612041636365737320436F6D706F6E656E7473202121 + 212028363729080000000000C6BF58C8CC420F0000004D656D6F2076616C7565 + 20283637290800000000000000000051402C00000055736520436F7265204C61 + 6220446174612041636365737320436F6D706F6E656E74732021212120283638 + 29080000000000C6BF58C8CC420F0000004D656D6F2076616C75652028363829 + 0800000000000000004051402C00000055736520436F7265204C616220446174 + 612041636365737320436F6D706F6E656E747320212121202836392908000000 + 0000C6BF58C8CC420F0000004D656D6F2076616C756520283639290800000000 + 000000008051402C00000055736520436F7265204C6162204461746120416363 + 65737320436F6D706F6E656E7473202121212028373029080000000000C6BF58 + C8CC420F0000004D656D6F2076616C75652028373029080000000000000000C0 + 51402C00000055736520436F7265204C61622044617461204163636573732043 + 6F6D706F6E656E7473202121212028373129080000000000C6BF58C8CC420F00 + 00004D656D6F2076616C756520283731290800000000000000000052402C0000 + 0055736520436F7265204C616220446174612041636365737320436F6D706F6E + 656E7473202121212028373229080000000000C6BF58C8CC420F0000004D656D + 6F2076616C756520283732290800000000000000004052402C00000055736520 + 436F7265204C616220446174612041636365737320436F6D706F6E656E747320 + 2121212028373329080000000000C6BF58C8CC420F0000004D656D6F2076616C + 756520283733290800000000000000008052402C00000055736520436F726520 + 4C616220446174612041636365737320436F6D706F6E656E7473202121212028 + 373429080000000000C6BF58C8CC420F0000004D656D6F2076616C7565202837 + 3429080000000000000000C052402C00000055736520436F7265204C61622044 + 6174612041636365737320436F6D706F6E656E74732021212120283735290800 + 00000000C6BF58C8CC420F0000004D656D6F2076616C75652028373529080000 + 0000000000000053402C00000055736520436F7265204C616220446174612041 + 636365737320436F6D706F6E656E7473202121212028373629080000000000C6 + BF58C8CC420F0000004D656D6F2076616C756520283736290800000000000000 + 004053402C00000055736520436F7265204C6162204461746120416363657373 + 20436F6D706F6E656E7473202121212028373729080000000000C6BF58C8CC42 + 0F0000004D656D6F2076616C756520283737290800000000000000008053402C + 00000055736520436F7265204C616220446174612041636365737320436F6D70 + 6F6E656E7473202121212028373829080000000000C6BF58C8CC420F0000004D + 656D6F2076616C75652028373829080000000000000000C053402C0000005573 + 6520436F7265204C616220446174612041636365737320436F6D706F6E656E74 + 73202121212028373929080000000000C6BF58C8CC420F0000004D656D6F2076 + 616C756520283739290800000000000000000054402C00000055736520436F72 + 65204C616220446174612041636365737320436F6D706F6E656E747320212121 + 2028383029080000000000C6BF58C8CC420F0000004D656D6F2076616C756520 + 283830290800000000000000004054402C00000055736520436F7265204C6162 + 20446174612041636365737320436F6D706F6E656E7473202121212028383129 + 080000000000C6BF58C8CC420F0000004D656D6F2076616C7565202838312908 + 00000000000000008054402C00000055736520436F7265204C61622044617461 + 2041636365737320436F6D706F6E656E74732021212120283832290800000000 + 00C6BF58C8CC420F0000004D656D6F2076616C75652028383229080000000000 + 000000C054402C00000055736520436F7265204C616220446174612041636365 + 737320436F6D706F6E656E7473202121212028383329080000000000C6BF58C8 + CC420F0000004D656D6F2076616C756520283833290800000000000000000055 + 402C00000055736520436F7265204C616220446174612041636365737320436F + 6D706F6E656E7473202121212028383429080000000000C6BF58C8CC420F0000 + 004D656D6F2076616C756520283834290800000000000000004055402C000000 + 55736520436F7265204C616220446174612041636365737320436F6D706F6E65 + 6E7473202121212028383529080000000000C6BF58C8CC420F0000004D656D6F + 2076616C756520283835290800000000000000008055402C0000005573652043 + 6F7265204C616220446174612041636365737320436F6D706F6E656E74732021 + 21212028383629080000000000C6BF58C8CC420F0000004D656D6F2076616C75 + 652028383629080000000000000000C055402C00000055736520436F7265204C + 616220446174612041636365737320436F6D706F6E656E747320212121202838 + 3729080000000000C6BF58C8CC420F0000004D656D6F2076616C756520283837 + 290800000000000000000056402C00000055736520436F7265204C6162204461 + 74612041636365737320436F6D706F6E656E7473202121212028383829080000 + 000000C6BF58C8CC420F0000004D656D6F2076616C7565202838382908000000 + 00000000004056402C00000055736520436F7265204C61622044617461204163 + 6365737320436F6D706F6E656E7473202121212028383929080000000000C6BF + 58C8CC420F0000004D656D6F2076616C75652028383929080000000000000000 + 8056402C00000055736520436F7265204C616220446174612041636365737320 + 436F6D706F6E656E7473202121212028393029080000000000C6BF58C8CC420F + 0000004D656D6F2076616C75652028393029080000000000000000C056402C00 + 000055736520436F7265204C616220446174612041636365737320436F6D706F + 6E656E7473202121212028393129080000000000C6BF58C8CC420F0000004D65 + 6D6F2076616C756520283931290800000000000000000057402C000000557365 + 20436F7265204C616220446174612041636365737320436F6D706F6E656E7473 + 202121212028393229080000000000C6BF58C8CC420F0000004D656D6F207661 + 6C756520283932290800000000000000004057402C00000055736520436F7265 + 204C616220446174612041636365737320436F6D706F6E656E74732021212120 + 28393329080000000000C6BF58C8CC420F0000004D656D6F2076616C75652028 + 3933290800000000000000008057402C00000055736520436F7265204C616220 + 446174612041636365737320436F6D706F6E656E747320212121202839342908 + 0000000000C6BF58C8CC420F0000004D656D6F2076616C756520283934290800 + 00000000000000C057402C00000055736520436F7265204C6162204461746120 + 41636365737320436F6D706F6E656E7473202121212028393529080000000000 + C6BF58C8CC420F0000004D656D6F2076616C7565202839352908000000000000 + 00000058402C00000055736520436F7265204C61622044617461204163636573 + 7320436F6D706F6E656E7473202121212028393629080000000000C6BF58C8CC + 420F0000004D656D6F2076616C75652028393629080000000000000000405840 + 2C00000055736520436F7265204C616220446174612041636365737320436F6D + 706F6E656E7473202121212028393729080000000000C6BF58C8CC420F000000 + 4D656D6F2076616C756520283937290800000000000000008058402C00000055 + 736520436F7265204C616220446174612041636365737320436F6D706F6E656E + 7473202121212028393829080000000000C6BF58C8CC420F0000004D656D6F20 + 76616C75652028393829080000000000000000C058402C00000055736520436F + 7265204C616220446174612041636365737320436F6D706F6E656E7473202121 + 212028393929080000000000C6BF58C8CC420F0000004D656D6F2076616C7565 + 20283939290800000000000000000059402D00000055736520436F7265204C61 + 6220446174612041636365737320436F6D706F6E656E74732021212120283130 + 3029080000000000C6BF58C8CC42100000004D656D6F2076616C756520283130 + 3029} + end + object DataSource: TDataSource + DataSet = VirtualTable + OnStateChange = DataSourceStateChange + OnDataChange = DataSourceDataChange + Left = 448 + Top = 2 + end +end diff --git a/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/VirtualTable/VTable.pas b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/VirtualTable/VTable.pas new file mode 100644 index 0000000..3ebbefa --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/SdacDemo/VirtualTable/VTable.pas @@ -0,0 +1,201 @@ +unit VTable; + +interface + +uses + Classes, SysUtils, +{$IFNDEF LINUX} + Windows, Messages, Graphics, Controls, Forms, Dialogs, + DBCtrls, ExtCtrls, Grids, DBGrids, StdCtrls, ToolWin, ComCtrls, Buttons, + {$IFNDEF VER130}Variants,{$ENDIF} +{$ELSE} + QGraphics, QControls, QForms, QDialogs, QStdCtrls, + QDBCtrls, QComCtrls, QExtCtrls, QGrids, QDBGrids, QButtons, +{$ENDIF} + DB, MemDS, VirtualTable, DemoFrame, DemoForm; + +type + TVirtualTableFrame = class(TDemoFrame) + DBGrid: TDBGrid; + DBMemo: TDBMemo; + Panel1: TPanel; + Splitter: TSplitter; + OpenDialog: TOpenDialog; + SaveDialog: TSaveDialog; + VirtualTable: TVirtualTable; + DataSource: TDataSource; + Panel2: TPanel; + btOpen: TSpeedButton; + btClose: TSpeedButton; + btAutoFill: TSpeedButton; + btAddField: TSpeedButton; + btDelField: TSpeedButton; + btClear: TSpeedButton; + btSave: TSpeedButton; + btLoad: TSpeedButton; + Panel4: TPanel; + edField: TEdit; + Label1: TLabel; + Panel5: TPanel; + cbFiltered: TCheckBox; + edFilter: TEdit; + Label5: TLabel; + Panel6: TPanel; + edValue: TEdit; + Label2: TLabel; + Panel7: TPanel; + btLocate: TSpeedButton; + procedure btOpenClick(Sender: TObject); + procedure btCloseClick(Sender: TObject); + procedure btAutoFillClick(Sender: TObject); + procedure DataSourceDataChange(Sender: TObject; Field: TField); + procedure DataSourceStateChange(Sender: TObject); + procedure btAddFieldClick(Sender: TObject); + procedure btDelFieldClick(Sender: TObject); + procedure btLocateClick(Sender: TObject); + procedure edFilterExit(Sender: TObject); + procedure cbFilteredClick(Sender: TObject); + procedure btLoadClick(Sender: TObject); + procedure btSaveClick(Sender: TObject); + procedure btClearClick(Sender: TObject); + private + { Private declarations } + FFieldNo: integer; + public + procedure Initialize; override; + end; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} +{$IFDEF LINUX} +{$R *.xfm} +{$ENDIF} + +procedure TVirtualTableFrame.btOpenClick(Sender: TObject); +begin + VirtualTable.Open; + if VirtualTable.Fields.Count > 0 then + edField.Text := VirtualTable.Fields[0].FieldName + else + edField.Text := ''; +end; + +procedure TVirtualTableFrame.btCloseClick(Sender: TObject); +begin + VirtualTable.Close; +end; + +procedure TVirtualTableFrame.btAutoFillClick(Sender: TObject); +var + i:integer; + Field:TField; +begin + Field:= VirtualTable.FindField('STRING1'); + for i:= 1 to 100 do + with VirtualTable do begin + Append; + FieldByName('NUMBER').AsInteger:= i; + FieldByName('STRING').AsString:= 'Use Core Lab Data Access Components !!! (' + IntToStr(i) + ')'; + FieldByName('DATE').AsDateTime:= Date; + FieldByName('MEMO').AsString:= 'Memo value (' + IntToStr(i) + ')'; + + if Field <> nil then + FieldByName('STRING1').AsString:= 'TVirtualTable'; + + Post; + end; +end; + +procedure TVirtualTableFrame.DataSourceStateChange(Sender: TObject); +begin + (Application.MainForm as TDemoForm).StatusBar.Panels[1].Text:= 'RecordCount:' + IntToStr(VirtualTable.RecordCount); + (Application.MainForm as TDemoForm).StatusBar.Panels[2].Text:= 'RecordNo:' + IntToStr(VirtualTable.RecNo); +end; + +procedure TVirtualTableFrame.DataSourceDataChange(Sender: TObject; Field: TField); +begin + DataSourceStateChange(nil); +end; + +procedure TVirtualTableFrame.btAddFieldClick(Sender: TObject); +begin + Inc(FFieldNo); + VirtualTable.AddField('STRING' + IntToStr(FFieldNo), ftString, 30); + btDelField.Enabled := True; +end; + +procedure TVirtualTableFrame.btDelFieldClick(Sender: TObject); +begin + if FFieldNo > 0 then begin + VirtualTable.DeleteField('STRING' + IntToStr(FFieldNo)); + Dec(FFieldNo); + end; + if FFieldNo = 0 then + btDelField.Enabled := False; +end; + +procedure TVirtualTableFrame.btLocateClick(Sender: TObject); +begin + VirtualTable.Locate(edField.Text, Variant(edValue.Text), []); +end; + +procedure TVirtualTableFrame.Initialize; +begin + inherited; + edFilter.Text:= VirtualTable.Filter; + cbFiltered.Checked:= VirtualTable.Filtered; + btDelField.Enabled := False; + FFieldNo := 0; + if (Application.MainForm as TDemoForm).GetIsXPMan then begin + Panel2.Color := clBtnFace; + Panel7.Color := clBtnFace; + end + else begin + Panel2.Color := (Application.MainForm as TDemoForm).ProductColor; + Panel7.Color := Panel2.Color; + end +end; + +procedure TVirtualTableFrame.edFilterExit(Sender: TObject); +begin + VirtualTable.Filter:= edFilter.Text; +end; + +procedure TVirtualTableFrame.cbFilteredClick(Sender: TObject); +begin + try + VirtualTable.Filtered := cbFiltered.Checked; + finally + cbFiltered.Checked := VirtualTable.Filtered; + end; +end; + +procedure TVirtualTableFrame.btLoadClick(Sender: TObject); +begin + OpenDialog.InitialDir := ExtractFilePath(Application.ExeName) + 'VirtualTable'; + if OpenDialog.Execute then + VirtualTable.LoadFromFile(OpenDialog.FileName); +end; + +procedure TVirtualTableFrame.btSaveClick(Sender: TObject); +begin + SaveDialog.InitialDir := ExtractFilePath(Application.ExeName) + 'VirtualTable'; + if SaveDialog.Execute then + if LowerCase(ExtractFileExt(SaveDialog.FileName)) = '.xml' then + VirtualTable.SaveToXML(SaveDialog.FileName) + else + VirtualTable.SaveToFile(SaveDialog.FileName) +end; + +procedure TVirtualTableFrame.btClearClick(Sender: TObject); +begin + VirtualTable.Clear; +end; + +end. diff --git a/internal/4.10.0.10/1/Demos/dotNet/TechnologySpecific/MSSQLCompact/MSSQLCompact_VclNet.bdsproj b/internal/4.10.0.10/1/Demos/dotNet/TechnologySpecific/MSSQLCompact/MSSQLCompact_VclNet.bdsproj new file mode 100644 index 0000000..91f1b01 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/TechnologySpecific/MSSQLCompact/MSSQLCompact_VclNet.bdsproj @@ -0,0 +1,183 @@ + + + + + + + + + + + + MSSQLCompact_VclNet.dpr + + + + + + + + 7.0 + + + 0 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + Borland.Vcl + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + + + 0 + 0 + 1 + True + False + False + 4096 + 1048576 + 4194304 + + + + + + + + d:\windows\microsoft.net\framework\v1.1.4322 + d:\windows\microsoft.net\framework\v1.1.4322\System.Drawing.dll + + + True + + + + + + False + + + + + + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1033 + 1252 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + + + + + + diff --git a/internal/4.10.0.10/1/Demos/dotNet/TechnologySpecific/MSSQLCompact/MSSQLCompact_VclNet.dpr b/internal/4.10.0.10/1/Demos/dotNet/TechnologySpecific/MSSQLCompact/MSSQLCompact_VclNet.dpr new file mode 100644 index 0000000..a602fe9 --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/TechnologySpecific/MSSQLCompact/MSSQLCompact_VclNet.dpr @@ -0,0 +1,15 @@ +program MSSQLCompact_VclNet; + +{%DelphiDotNetAssemblyCompiler '$(SystemRoot)\microsoft.net\framework\v1.1.4322\system.drawing.dll'} + +uses + Forms, + Main in 'Main.pas' {fmMain}; + +{$R *.res} + +begin + Application.Initialize; + Application.CreateForm(TfmMain, fmMain); + Application.Run; +end. diff --git a/internal/4.10.0.10/1/Demos/dotNet/TechnologySpecific/MSSQLCompact/MSSQLCompact_VclNet.res b/internal/4.10.0.10/1/Demos/dotNet/TechnologySpecific/MSSQLCompact/MSSQLCompact_VclNet.res new file mode 100644 index 0000000..3adc036 Binary files /dev/null and b/internal/4.10.0.10/1/Demos/dotNet/TechnologySpecific/MSSQLCompact/MSSQLCompact_VclNet.res differ diff --git a/internal/4.10.0.10/1/Demos/dotNet/TechnologySpecific/MSSQLCompact/Main.nfm b/internal/4.10.0.10/1/Demos/dotNet/TechnologySpecific/MSSQLCompact/Main.nfm new file mode 100644 index 0000000..0dca79a --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/TechnologySpecific/MSSQLCompact/Main.nfm @@ -0,0 +1,353 @@ +object fmMain: TfmMain + Left = 213 + Top = 374 + Width = 975 + Height = 417 + Caption = + 'MSSQL Data Access Demo - using Compact Edition of the MS SQL Ser' + + 'ver' + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + OnClose = FormClose + OnCreate = FormCreate + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 13 + object DBGrid: TDBGrid + Left = 0 + Top = 49 + Width = 967 + Height = 315 + Align = alClient + DataSource = DataSource + TabOrder = 1 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object ToolBar: TPanel + Left = 0 + Top = 0 + Width = 967 + Height = 49 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object Panel1: TPanel + Left = 1 + Top = 1 + Width = 700 + Height = 47 + BevelOuter = bvNone + Color = clGreen + TabOrder = 0 + object btOpen: TSpeedButton + Left = 1 + Top = 24 + Width = 82 + Height = 22 + Caption = 'Open' + Enabled = False + Flat = True + Transparent = False + OnClick = btOpenClick + end + object btClose: TSpeedButton + Left = 84 + Top = 24 + Width = 82 + Height = 22 + Caption = 'Close' + Enabled = False + Flat = True + Transparent = False + OnClick = btCloseClick + end + object btDisconnect: TSpeedButton + Left = 84 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Disconnect' + Enabled = False + Flat = True + Transparent = False + OnClick = btDisconnectClick + end + object btConnect: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Connect' + Flat = True + Transparent = False + OnClick = btConnectClick + end + object DBNavigator: TDBNavigator + Left = 469 + Top = 24 + Width = 230 + Height = 22 + DataSource = DataSource + Flat = True + TabOrder = 0 + end + object Panel2: TPanel + Left = 167 + Top = 1 + Width = 532 + Height = 22 + BevelOuter = bvNone + TabOrder = 1 + object Label1: TLabel + Left = 6 + Top = 4 + Width = 78 + Height = 13 + Caption = 'Database name:' + end + object SpeedButton2: TSpeedButton + Left = 511 + Top = 0 + Width = 22 + Height = 22 + Caption = '...' + Flat = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + Transparent = False + OnClick = SpeedButton2Click + end + object edDBName: TEdit + Left = 88 + Top = 1 + Width = 423 + Height = 21 + TabOrder = 0 + Text = '.\test.sdf' + end + end + object pnTableName: TPanel + Left = 167 + Top = 24 + Width = 301 + Height = 22 + BevelOuter = bvNone + TabOrder = 2 + object lbTableName: TLabel + Left = 6 + Top = 4 + Width = 59 + Height = 13 + Caption = 'Table name:' + Enabled = False + end + object cbTableName: TComboBox + Left = 88 + Top = 1 + Width = 211 + Height = 21 + Enabled = False + ItemHeight = 13 + TabOrder = 0 + OnDropDown = cbTableNameDropDown + end + end + end + object Panel3: TPanel + Left = 705 + Top = 0 + Width = 257 + Height = 24 + BevelOuter = bvNone + Color = clGreen + TabOrder = 1 + object btDrop: TSpeedButton + Left = 84 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Drop' + Flat = True + Transparent = False + OnClick = btDropClick + end + object btCreate: TSpeedButton + Left = 1 + Top = 1 + Width = 82 + Height = 22 + Caption = 'Create' + Flat = True + Transparent = False + OnClick = btCreateClick + end + object Panel4: TPanel + Left = 167 + Top = 1 + Width = 89 + Height = 22 + BevelOuter = bvNone + TabOrder = 0 + object cbDebug: TCheckBox + Left = 13 + Top = 3 + Width = 67 + Height = 17 + Caption = 'Debug' + Checked = True + State = cbChecked + TabOrder = 0 + OnClick = cbDebugClick + end + end + end + end + object StatusBar: TStatusBar + Left = 0 + Top = 364 + Width = 967 + Height = 19 + Panels = < + item + Text = 'State' + Width = 50 + end> + SimplePanel = False + end + object DataSource: TDataSource + DataSet = MSTable + Left = 320 + Top = 144 + end + object MSTable: TMSTable + TableName = 'EMP' + Connection = MSConnection + Debug = True + Left = 288 + Top = 144 + end + object scCreate: TMSScript + SQL.Strings = ( + 'CREATE TABLE EMP (' + ' EMPNO INT PRIMARY KEY,' + ' ENAME NVARCHAR(10),' + ' JOB NVARCHAR(9),' + ' MGR INT,' + ' HIREDATE DATETIME,' + ' SAL FLOAT,' + ' COMM FLOAT' + ');' + '' + '' + 'INSERT INTO EMP' + ' (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM)' + 'VALUES ' + ' (7492, '#39'SMITH'#39','#39'CLERK'#39',7902,'#39'1980-12-17'#39',800,600);' + '' + 'INSERT INTO EMP' + ' (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM)' + 'VALUES ' + ' (7499,'#39'ALLEN'#39','#39'SALESMAN'#39',7698,'#39'1981-2-20'#39',1600,300);' + '' + 'INSERT INTO EMP' + ' (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM)' + 'VALUES ' + ' (7521,'#39'WARD'#39','#39'SALESMAN'#39',7698,'#39'1981-2-22'#39',1250,500);' + '' + 'INSERT INTO EMP' + ' (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM)' + 'VALUES ' + ' (7566,'#39'JONES'#39','#39'MANAGER'#39',7839,'#39'1981-4-2'#39',2975,NULL);' + '' + 'INSERT INTO EMP' + ' (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM)' + 'VALUES ' + ' (7654,'#39'MARTIN'#39','#39'SALESMAN'#39',7698,'#39'1981-9-28'#39',1250,1400);' + '' + 'INSERT INTO EMP' + ' (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM)' + 'VALUES ' + ' (7698,'#39'BLAKE'#39','#39'MANAGER'#39',7839,'#39'1981-5-1'#39',2850,NULL);' + '' + 'INSERT INTO EMP' + ' (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM)' + 'VALUES ' + ' (7782,'#39'CLARK'#39','#39'MANAGER'#39',7839,'#39'1981-6-9'#39',2450,NULL);' + '' + 'INSERT INTO EMP' + ' (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM)' + 'VALUES ' + ' (7788,'#39'SCOTT'#39','#39'ANALYST'#39',7566,'#39'1987-7-13'#39',3000,NULL);' + '' + 'INSERT INTO EMP' + ' (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM)' + 'VALUES ' + ' (7839,'#39'KING'#39','#39'PRESIDENT'#39',NULL,'#39'1981-11-17'#39',5000,NULL);' + '' + 'INSERT INTO EMP' + ' (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM)' + 'VALUES ' + ' (7844,'#39'TURNER'#39','#39'SALESMAN'#39',7698,'#39'1981-9-8'#39',1500,0);' + '' + 'INSERT INTO EMP' + ' (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM)' + 'VALUES ' + ' (7876,'#39'ADAMS'#39','#39'CLERK'#39',7788,'#39'1987-7-13'#39',1100,NULL);' + '' + 'INSERT INTO EMP' + ' (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM)' + 'VALUES ' + ' (7900,'#39'JAMES'#39','#39'CLERK'#39',7698,'#39'1981-12-3'#39',950,NULL);' + '' + 'INSERT INTO EMP' + ' (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM)' + 'VALUES ' + ' (7902,'#39'FORD'#39','#39'ANALYST'#39',7566,'#39'1981-12-3'#39',3000,NULL);' + '' + 'INSERT INTO EMP' + ' (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM)' + 'VALUES ' + ' (7934,'#39'MILLER'#39','#39'CLERK'#39',7782,'#39'1982-1-23'#39',1300,NULL);') + Debug = True + OnError = scError + Connection = MSConnection + Left = 735 + Top = 59 + end + object OpenDialog: TOpenDialog + Filter = 'MS SQL Database Files (*.sdf)|*.sdf|All Files|*.*' + Options = [ofHideReadOnly, ofPathMustExist, ofEnableSizing] + Left = 130 + Top = 145 + end + object MSConnection: TMSConnection + Options.Provider = prCompact + AfterConnect = MSConnectionAfterConnect + AfterDisconnect = MSConnectionAfterDisconnect + Left = 210 + Top = 145 + end + object scDrop: TMSScript + SQL.Strings = ( + 'DROP TABLE EMP;') + Debug = True + OnError = scError + Connection = MSConnection + Left = 805 + Top = 59 + end +end diff --git a/internal/4.10.0.10/1/Demos/dotNet/TechnologySpecific/MSSQLCompact/Main.pas b/internal/4.10.0.10/1/Demos/dotNet/TechnologySpecific/MSSQLCompact/Main.pas new file mode 100644 index 0000000..bb239af --- /dev/null +++ b/internal/4.10.0.10/1/Demos/dotNet/TechnologySpecific/MSSQLCompact/Main.pas @@ -0,0 +1,268 @@ +unit Main; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + DBCtrls, ExtCtrls, Grids, DBGrids, StdCtrls, ToolWin, ComCtrls, + DBAccess, DAScript, Buttons, MSAccess, MSScript, OLEDBAccess, DB, MemDS, SDACVcl; + +type + TfmMain = class(TForm) + DBGrid: TDBGrid; + DataSource: TDataSource; + ToolBar: TPanel; + StatusBar: TStatusBar; + MSTable: TMSTable; + scCreate: TMSScript; + Panel1: TPanel; + btOpen: TSpeedButton; + btClose: TSpeedButton; + DBNavigator: TDBNavigator; + OpenDialog: TOpenDialog; + MSConnection: TMSConnection; + btDisconnect: TSpeedButton; + btConnect: TSpeedButton; + Panel2: TPanel; + edDBName: TEdit; + Label1: TLabel; + pnTableName: TPanel; + lbTableName: TLabel; + cbTableName: TComboBox; + SpeedButton2: TSpeedButton; + Panel3: TPanel; + Panel4: TPanel; + btDrop: TSpeedButton; + btCreate: TSpeedButton; + cbDebug: TCheckBox; + scDrop: TMSScript; + procedure btOpenClick(Sender: TObject); + procedure btCloseClick(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure MSConnectionAfterConnect(Sender: TObject); + procedure MSConnectionAfterDisconnect(Sender: TObject); + procedure btConnectClick(Sender: TObject); + procedure SpeedButton2Click(Sender: TObject); + procedure btDisconnectClick(Sender: TObject); + procedure btCreateClick(Sender: TObject); + procedure btDropClick(Sender: TObject); + procedure cbDebugClick(Sender: TObject); + procedure FormCreate(Sender: TObject); + procedure cbTableNameDropDown(Sender: TObject); + procedure scError(Sender: TObject; E: Exception; SQL: String; + var Action: TErrorAction); + procedure FormClose(Sender: TObject; var Action: TCloseAction); + private + Closing: boolean; + procedure ShowState; + procedure CheckConnected; + public + { Public declarations } + end; + +var + fmMain: TfmMain; + +implementation + +{$IFDEF CLR} +{$R *.nfm} +{$ENDIF} +{$IFDEF WIN32} +{$R *.dfm} +{$ENDIF} +{$IFDEF LINUX} +{$R *.xfm} +{$ENDIF} + +{$IFNDEF VER130} +{$IFNDEF VER140} +{$IFNDEF CLR} + {$DEFINE XPMAN} + {$R WindowsXP.res} +{$ENDIF} +{$ENDIF} +{$ENDIF} + +{$IFDEF XPMAN} +uses + UxTheme; +{$ENDIF} + +procedure TfmMain.ShowState; +var + St:string; + + procedure AddSt(S:string); + begin + if St <> '' then + St:= St + ', '; + St:= St + S; + end; + +begin + St:= ''; + + if MSTable.Active then + AddSt('Active') + else + AddSt('Inactive'); + + StatusBar.Panels[0].Text:= St; +end; + +procedure TfmMain.CheckConnected; +begin + try + MSConnection.Database := edDBName.Text; + + if not FileExists(MSConnection.Database) then + if MessageDlg('Database file ' + MSConnection.Database + ' does not exists.' + + #13#10+'Create database with this name?', mtConfirmation, [mbYes,mbNo,mbCancel], 0) <> mrYes then + Exit; + + MSConnection.Open; // database file will be created automatically if it does not exist + finally + ShowState; + end; +end; + +procedure TfmMain.btOpenClick(Sender: TObject); +begin + try + MSTable.TableName := cbTableName.Text; + MSTable.Open; + finally + ShowState; + end; +end; + +procedure TfmMain.btCloseClick(Sender: TObject); +begin + MSTable.Close; + ShowState; +end; + +procedure TfmMain.FormShow(Sender: TObject); +begin + ShowState; +end; + +procedure TfmMain.MSConnectionAfterConnect(Sender: TObject); +begin + btConnect.Enabled := False; + btDisconnect.Enabled := True; + cbTableName.Enabled := True; + lbTableName.Enabled := True; + btOpen.Enabled := True; + btClose.Enabled := True; + MSConnection.GetTableNames(cbTableName.Items); + + if cbTableName.Items.Count > 0 then + cbTableName.ItemIndex := 0; +end; + +procedure TfmMain.MSConnectionAfterDisconnect(Sender: TObject); +begin + if Closing then // to prevent AV on form close + Exit; + + btConnect.Enabled := True; + btDisconnect.Enabled := False; + cbTableName.Enabled := False; + lbTableName.Enabled := False; + btOpen.Enabled := False; + btClose.Enabled := False; +end; + +procedure TfmMain.btConnectClick(Sender: TObject); +begin + CheckConnected; +end; + +procedure TfmMain.SpeedButton2Click(Sender: TObject); +begin + if OpenDialog.Execute then + edDBName.Text := OpenDialog.FileName; +end; + +procedure TfmMain.btDisconnectClick(Sender: TObject); +begin + MSConnection.Close; +end; + +procedure TfmMain.btCreateClick(Sender: TObject); +begin + CheckConnected; + scCreate.Execute; +end; + +procedure TfmMain.btDropClick(Sender: TObject); +begin + CheckConnected; + scDrop.Execute; +end; + +procedure TfmMain.cbDebugClick(Sender: TObject); +begin + MSTable.Debug := cbDebug.Checked; + scCreate.Debug := cbDebug.Checked; + scDrop.Debug := cbDebug.Checked; +end; + +procedure TfmMain.FormCreate(Sender: TObject); +{$IFDEF XPMAN} + procedure UpdateStyle(Control: TWinControl); + var + Panel: TPanel; + i: integer; + begin + for i := 0 to Control.ControlCount - 1 do begin + if Control.Controls[i] is TSpeedButton then + TSpeedButton(Control.Controls[i]).Flat := False + else + if Control.Controls[i] is TDBNavigator then + TDBNavigator(Control.Controls[i]).Flat := False; + if Control.Controls[i] is TWinControl then begin + if (Control.Controls[i] is TPanel) then begin + Panel := TPanel(Control.Controls[i]); + Panel.ParentBackground := False; + Panel.Color := clBtnFace; + end; + UpdateStyle(TWinControl(Control.Controls[i])); + end; + end; + end; +{$ENDIF} +begin + cbDebugClick(self); + Closing := False; +{$IFDEF XPMAN} + if UseThemes then + UpdateStyle(Self); +{$ENDIF} +end; + +procedure TfmMain.cbTableNameDropDown(Sender: TObject); +begin + MSConnection.GetTableNames(cbTableName.Items); +end; + +procedure TfmMain.scError(Sender: TObject; E: Exception; SQL: String; + var Action: TErrorAction); +begin + if MessageDlg('An error with the following message ocurred:' + #13#10 + + E.Message , mtError, [mbAbort,mbIgnore], 0) = mrAbort then + Action := eaAbort + else + Action := eaContinue; + +end; + +procedure TfmMain.FormClose(Sender: TObject; var Action: TCloseAction); +begin + Closing := True; +end; + +end. + diff --git a/internal/4.10.0.10/1/FAQ.html b/internal/4.10.0.10/1/FAQ.html new file mode 100644 index 0000000..c05b096 --- /dev/null +++ b/internal/4.10.0.10/1/FAQ.html @@ -0,0 +1,689 @@ + + + + Frequently Asked Questions + + + + + + + + + + +
+ + + + + + + + + +
SQL Server Data Access Componentssdac@crlab.com
Frequently Asked Questions 
+
+
+ + + +

+This page contains a list of Frequently Asked Questions for SQL Server Data Access Components. +

+

+If you have encounter a question with using SDAC, please browse through this list first. +If this page does not answer your question, refer to the Getting Support topic in SDAC help. +

+ +
+
+

 

+ +Installation and Deployment +
    +
  1. + I am having a problem installing SDAC or compiling SDAC-based projects...
    + +

    + You may be having a compatibility issue that shows up in one or more of the following forms:

    +

      +
    • Get a "Setup has detected already installed DAC packages which are incompatible with current version" message during SDAC installation. +
    • Get a "Procedure entry point ... not found in ... " message when starting IDE. +
    • Get a "Unit ... was compiled with a different version of ..." message on compilation. +
    +

    + You can have such problems if you installed incompatible SDAC, ODAC, MyDAC or IBDAC versions. All these products use common base packages. The easiest way to avoid the problem is to uninstall all installed DAC products and then download from our site and install the last builds.

    +
  2. + +
  3. + What software should be installed on the client computer so that my applications + that use SDAC can run?
    + SDAC requires OLE DB installed on the workstation. In current versions of Microsoft Windows, + such as Windows 2000, OLE DB is already included as part of the standard installation. But it is highly + recommended to download the latest version (newer than 2.5) of Microsoft + Data Access Components (MDAC). +
  4. +
+ +Licensing and Subscriptions +
    +
  1. + Am I entitled to distribute applications written with SDAC?
    +

    If you have purchased a full version of SDAC, you are entitled to distribute pre-compiled programs created with its use. You are not entitled to propagate any components inherited from SDAC or using SDAC source code. For more information see the License.rtf file in your SDAC installation directory.

    +
  2. + +
  3. + Can I create components using SDAC?
    + +

    You can create your own components that are inherited from SDAC or that use the SDAC source code. You are entitled to sell and distribute compiled application executables that use such components, but not their source code and not the components themselves.

    +
    +
  4. + + + +
  5. + What licensing changes can I expect with SDAC 4.00?
    + +

    The basic SDAC license agreement will remain the same. With SDAC 4.00, the SDAC Edition Matrix will be reorganized and a new SDAC Subscription Program will be introduced.

    +
    +
  6. +
  7. + What do the SDAC 4.00 Edition Levels correspond to?
    + +

    SDAC 4.00 will come in four editions: Trial, Standard, Professional, and Professional with Sources.

    +

    When you upgrade to the new version, your edition level will be automatically updated using the following Edition Correspondence Table.


    +
    + Edition Correspondence Table for Upgrading to SDAC 4.00 + + + + + + +
    Old Edition LevelNew Edition Level
    - No Correspondence -SDAC Standard Edition
    SDAC Standard EditionSDAC Professional Edition
    SDAC Professional EditionSDAC Professional Edition with Sources
    SDAC Trial Edition SDAC Trial Edition

    +

    + The feature list for each edition can be found in the SDAC documentation and on the SDAC website.

    +
    +
  8. + + +
  9. + I have a registered version of SDAC. Will I need to pay to upgrade to future versions?
    + +

    After SDAC 4.00, all upgrades to future versions are free to users with an active SDAC Subscription.

    +

    Users that have a registration for versions of SDAC prior to SDAC 4.00 will have to first upgrade to SDAC 4.00 to jump in on the Subscription program.

    +
    +
  10. + +
  11. + What are the benefits of the SDAC Subscription program?
    + +

    The SDAC Subscription Program is an annual maintenance and support service + for SDAC users.

    +

    Users with a valid SDAC Subscription get the following benefits:

    +
      +
    • Access to new versions of SDAC when they are released +
    • Access to all SDAC updates and bug fixes +
    • Product support through the SDAC Priority Support program +
    • Notification of new product versions +
    +

    Priority Support is an advanced product support program which offers you expedited individual assistance with SDAC-related questions from the SDAC developers themselves. Priority Support is carried out over email and has a two business day response policy.

    + + +

    The SDAC Subscription Program is available for registered users of SDAC 4.00 and higher.

    +
    +
  12. + + + +
  13. + Can I use my version of SDAC after my Subscription expires?
    + +

    Yes, you can. SDAC version licenses are perpetual.

    +
    +
  14. + + + +
  15. + I want a SDAC Subscription! How can I get one?
    + +

    An annual SDAC Subscription is included when ordering or upgrading to any registered (non-Trial) edition of SDAC 4.00 or higher.

    +

    You can renew your SDAC Subscription on the SDAC Ordering Page. For more information, please contact sales@crlab.com.

    +
    +
  16. + +
  17. + Does this mean that if I upgrade to SDAC 4 from SDAC 3, I'll get an annual SDAC Subscription for free?
    + + Yes. + +
  18. + + +
  19. + How do I upgrade to SDAC 4.00?
    + +

    To upgrade to SDAC 4.00, you can get a Version Update from the SDAC Ordering Page. For more information, please contact sales@crlab.com.

    +
    +
  20. +
+ +Performance +
    +
  1. + How productive is SDAC?
    +

    SDAC uses the lowest documented protocol level (OLE DB) to access + the database server. This allows SDAC to achieve high performance. From time to time + we compare SDAC with other products, and SDAC always takes first place.

    +
  2. + +
  3. + Why does the Locate function work so slowly the first time I use it?
    +

    Locate is performed on the client. So if you had set FetchAll to False when opening + your dataset, cached only some of the rows on the client, and then invoked Locate, SDAC will have to + fetch all the remaining rows from the server before performing the operation. On subsequent calls, + Locate should work much faster.

    +

    If the Locate method keeps working slowly on subsequent calls or you are working with FetchAll=True, + try the following. Perform local sorting by a field that is used in the Locate method. Just assign + corresponding field name to the IndexFieldNames property.

    +
  4. + +
+ +How To +
    +
  1. + How can I enable syntax highlighting in SDAC component editors at design time?
    +

    To enable syntax highlighting for SDAC, you should download and install the freeware SynEdit component set.

    +
    +
  2. + +
  3. + How can I determine which version of SDAC am I using?
    +

    You can determine your SDAC version number in several ways: +

      +
    • During installation of SDAC, consult the SDAC Installer screen. +
    • After installation, see the history.html file in your SDAC installation directiory. +
    • At design-time, select SQL Server | About SDAC from the main menu of your IDE. +
    • At run-time, check the value of the SdacVersion and DACVersion constants. +

    +
    +
  4. + +
  5. + How can I stop the cursor from changing to an hour glass during query execution?
    +

    Just set the DBAccess.ChangeCursor variable to False anywhere in your program. + The cursor will stop changing after this command is executed.

    +
  6. + +
  7. + How can I execute a query saved in the SQLInsert, SQLUpdate, + SQLDelete, or SQLRefresh properties of a SDAC dataset?
    +

    The values of these properties are templates for query statements, + and they cannot be manually executed. Usually there is no need to fill these properties + because the text of the query is generated automatically.

    + +

    In special cases, you can set these properties to perform more complicated processing + during a query. These properties are automatically processed by SDAC during the execution + of the Post, Delete, or RefreshRecord methods, and are used to construct the query to + the server. Their values can contain parameters with names of fields in the underlying + data source, which will be later replaced by appropriate data values.

    + +

    For example, you can use the SQLInsert template to insert a row into a query instance as follows.

    +
      +
    1. Fill the SQLInsert property with the parametrized query template you want to use. +
    2. Call Insert. +
    3. Initialize field values of the row to insert. +
    4. Call Post. +
    + +

    The value of the SQLInsert property will then be used by SDAC to perform the last step.

    + +

    Setting these properties is optional and allows you to automatically execute additional + SQL statements, add calls to stored procedures and functions, check input parameters, and/or + store comments during query execution. If these properties are not set, the SDAC dataset + object will generate the query itself using the appropriate insert, update, delete, or + refresh record syntax.

    +
    +
  8. + +
  9. + How can I get a list of the databases on the server?
    +

    Use the TCustomDAConnection.GetDatabaseNames method.

    +
  10. + +
  11. + How can I get a list of the tables list in a database?
    + Use the TCustomDAConnection.GetTableNames method. +
  12. + + +
  13. + Some questions about the visual part of SDAC
    +

    + The following questions usually arise from the same problem: +

      +
    • I set the Debug property to True but nothing happens! +
    • While executing a query, the screen cursor does not change to an hour-glass. +
    • Even if I have LoginPromp set to True, the connect dialog does not appear. +
    + To fix this problem, you should add the SdacVcl unit to the uses clause of your + project.

    +
  14. +
+ +General Questions +
    +
  1. + I would like to develop an application that works with SQL Server. Should I use SDAC or DbxSda?
    +

    DbxSda is our dbExpress driver for SQL Server. + dbExpress technology serves for providing a more or less uniform way to access different servers + (SQL Server, MySQL, Oracle and so on). It is based on drivers that include server-specific features. + Like any universal tool, in many specialized cases dbExpress providers lose some functionality. + For example, the dbExpress design-time is quite poor and cannot be expanded.

    +

    SDAC is a specialized set of components for SQL Server, which has advanced server-specific design-time + and a component interface similar to that of BDE.

    +

    We tried to include maximal support of SQL Server-specific features in both DbxSda and SDAC. However, + the nature of dbExpress technology has some insurmountable restrictions. For example, Unicode fields + cannot be passed from a driver to dbExpress.

    +

    SDAC and DbxSda use the same kernel and thus have similar performance. In some cases dbExpress is + slower because data undergoes additional conversion to correspond to dbExpress standards.

    +

    To summarise, if it is important for you to be able to quickly adapt your application to a database + server other than SQL Server, it is probably better to use DbxSda. In other cases, especially when migrating + from BDE or ADO, you should use SDAC. +

  2. + +
  3. + What are the advantages of SDAC over Delphi ADO components for accessing SQL Server?
    + ADO is a universal components while SDAC is specialized in SQL Server, + so SDAC takes into account lots of server specific features. SDAC has great benefit in performance + (5-10 times in different tests) because it works directly through OLE DB, which is a native SQL Server + interface. Moreover, SDAC provides advanced design-time editors. +
  4. + +
  5. + On connect, I get an "OLE DB error occured. Code 800401F0h. CoInitialize has + not been called" error. What can I do?
    + As SDAC uses OLE DB, it is necessary to + initialize OLE by calling CoInitialize before a new connection is established. Usually VCL does this automatically. SDAC does not call to the CoInitialize and CoUninitialize functions itself, as this may cause unexpected + problems if OLE is used in the program by someone else. +
  6. + +
  7. + Are the SDAC connection components thread-safe?
    +

    Yes, SDAC is thread-safe but there is a restriction. But the same TCustomMSConnection object descendant cannot be used in several threads. So if you have a multithreaded application, you should have a TCustomMSConnection object descendant for each thread that uses SDAC.

    +
  8. + +
  9. + When editing a DataSet, I get an exception with the message 'Update failed. + Found %d records.' or 'Refresh failed. Found %d records.' +
    +

    This error occurs when the database server is unable to determine which record + to modify or delete. In other words, there are either more than one record or no records that suit + the UPDATE criteria. Such situation can happen when you omit the unique field in a SELECT statement + (TCustomDADataSet.SQL) or when another user modifies the table simultaneously. This exception can + be suppressed. Refer to TCustomDADataSet.Options topic in SDAC help for more information.

    +
    +
  10. + +
  11. + + Some questions with using TCustomDADataSet.FetchAll=False mode
    + + Common issues when using FetchAll=False: +
      +
    • I have problems working with temporary tables. +
    • I have problems working with transactions. +
    • Sometimes my application hangs on applying changes to database. +
    +

    Usage of FetchAll=False mode has many advantages; however, it also has some restrictions + since it requires an additional connection to server to be created for data fetching. The + additional connection is created to prevent the main connection from blocking.

    + +

    These problems can be avoided by setting the FetchAll property to True. Please see description of the + FetchAll propery and the CreateConnection option in SDAC help for more information.

    + +

    One more way to solve these problems is to use the Multiple Active Result Sets (MARS) feature. + This feature lets you keep more than one unfetched record set within a single connection. + To enable MARS, set the MultipleActiveResultSets option of TMSConnection to True. + Note: To use MARS, you will need to have SQL Server 2005 and SQL Native Client installed.

    +
  12. +
+ + + +

 

 


+

© 2002-2007 Core Lab. All rights reserved.

+ +
+ + + + + \ No newline at end of file diff --git a/internal/4.10.0.10/1/History.html b/internal/4.10.0.10/1/History.html new file mode 100644 index 0000000..4638da9 --- /dev/null +++ b/internal/4.10.0.10/1/History.html @@ -0,0 +1,877 @@ + + + + SQL Server Data Access Components + + + + + + + + + + +
+ + + + + + + + + +
SQL Server Data Access Componentssdac@crlab.com
History 
+
+ +
+ +

4.10.0.10 02.08.07

+
    +
  • Added the XML data type to the parameters list in design-time parameters editor +
  • Fixed bug with PSGetDefaultOrder method freezing for queries with complicated ORDER BY clauses +
  • Fixed bug in TCRBatchMove with mapping fields by name when Fields count and FieldDefs count are not equal +
  • Fixed bug with adding fields in TVirtualTable +
  • Fixed bug with Pooling and Local Failover +
  • Fixed bug with "Invalid Variant Type" exception under Windows 2000 when TDataSet.Refresh is called +
  • Fixed bug with performance penalty when processing lookup and calculated fields +
  • Problem with DBMonitor integration under Windows Vista Ultimate fixed +
  • Bug with field names quotation in CRDBGrid fixed +
  • Fixed bug with freezing in NonBlocking mode +
  • Fixed bug with setting wrong parameter types for queries provided to SQLInsert, SQLUpdate, SQLDelete, SQLRefresh +
  • Fixed bug with performance penalty when processing lookup and calculated fields +
  • Fixed bug with setting the CanModify flag for computed fields +
  • Fixed bug with ReturnParams option and parameter types in Update SQLs +
  • Fixed bug with the RereshQuick method for queries with the WHERE clause +
  • Fixed bug with setting the Hidden flag for FieldDescs with SQL Server Compact Edition and Windows Vista +
  • Fixed bug in TMSStoredProc with Local Failover and Disconnected Model +
  • Fixed bug compound field names quotation +
  • Changed ancestor of TMSXMLField from TMemoField to TField due to Delphi field types limitation +
+ +

4.10.0.9 12.06.07

+
    +
  • C++Builder 2007 supported +
  • TMSConnection.Options.FailoverPartner property added +
  • Added ability to customize information view about fields in DataSetManager +
  • Replacement of the TwwDataSource with TMSDataSource in the BDE/ADO Migration Wizard added +
  • Performance of some operations in DataSet Manager improved +
  • Bug with the BaseSQL property set to an empty string after assigning macro values fixed +
  • Bug with incorrect registry key used by connect dialog to save/load the Server value fixed +
  • Bug with refreshing records in detail dataset fixed +
  • Fixed bug with lookup and data fields with the same name +
  • Fixed bug with reopening queries in NonBlocking mode +
  • Fixed bug with calling the RefreshQuick method for the detail DataSet +
  • Fixed bug with calculated fields with ftDate and ftTime data types +
  • Fixed bug with comparing string values during locate ans sort operations +
  • Fixed bug with prepared stored procedures, whose result set depends on parameter values +
  • Avoided Delphi 6 bug in the TryStrToBool function +
  • Fixed bug with retrieving stored procedure output parameters with DECIMAL data type +
  • Fixed bug with raising exceptions when locating records on filtered recordsets +
  • Removed restriction on datasets that TMyDataSource can be associated with +
  • Minor bugs in DataSet Manager fixed +
+ +

4.00.0.7 16.05.07

+
    +
  • Added ability to drag datasets between connections in group by connections mode in DataSet Manager +
  • Added ability to assign DataSource and DataField properties of DevExpress DB-aware controls automatically in DataSet Manager +
  • Extended abilities of assigning default controls for datasets and fields in DataSet Manager +
  • Fixed bug in the MSDataAdapter component with reading BLOB fields +
  • Fixed bug with AV failure after second call to CommitUpdates when there are skipped records in cache +
  • Bug with processing stored procedures with XML parameters fixed +
  • Fixed bug with retrieving information about foreign keys of a table using the TMSMetaData component +
  • Fixed AV bug with opening detail DataSet when master DataSet is not TCustomMSDataSet descendant +
  • Fixed bug with "DisposeBuf failed" exception on updating string fields in CachedUpdates mode +
  • Bug when UnPrepare is not called for TCustomDASQL on changing value of a macro fixed +
  • Fixed bug with loading DataSet Manager package in a localized IDE +
  • Fixed minor bugs in DataSet Manager +
  • Fixed Access Violation bug on Delphi 2006 exit on Windows Vista +
  • Fixed minor bugs in installation for C++Builder and Delphi 2007 +
+ +

4.00.0.6 20.04.07

+
    +
  • Added support for DevExpress controls in DataSet Manager +
  • Added support for using TMemDataSet.IndexFieldNames with RefreshQuick +
  • FastScript v1.9 support added +
  • Fixed bug with SQL Generator in design time +
  • Fixed bug with trimming SQL texts in design-time editors +
  • Bug with setting RecNo property for filtered datasets fixed +
  • Bug with PSGetTableName returning incorrect value after changing the SQL property fixed +
  • Bug with calling TDataSet.Edit for master DataSet in CachedUpdates mode fixed +
  • Minor bugs in installation fixed +
  • Fixed bug in SQL Generator with generating REFRESH statements for detail DataSet +
  • Fixed AV failure with deleting records in CachedUpdates mode +
  • Fixed bug when detail DataSet is refreshed on switching master DataSet to Edit mode +
  • Fixed bug with loading files in TMSScript editor +
  • Fixed bug with calling design-time editors of TDADataSource descendants by double click +
  • Fixed access violation when loading DataSet Manager package under Delphi 2007 and Windows Vista +
  • Fixed bug with DataSet Manager when IDE freezes on loading a form with a large quantity of datasets +
  • Fixed bug with SQL Server Compact and databases with maximum database size greater than 128 MB +
  • Fixed bug with executing parametrized queries in Detail DataSet from design-time editor +
  • Fixed bug with the RefreshQuick method and SELECT statements containing column aliases +
  • Fixed bug in RefreshQuick method with semicolon at the end of the SELECT statement +
  • Fixed bug with displaying invalid object property type in object inspector +
  • Fixed bug with filter expression that contains several consecutive left brackets +
+ +

4.00.0.5 06.04.07

+
    +
  • TCustomMSDataSet.CreateProcCall and TMSSQL.CreateProcCall methods added +
  • DataSet Manager stability improved +
  • Fixed bug in SQL Generator with complex SELECT statements +
  • Bug with setting RecNo property for filtered datasets fixed +
  • Bug with Locate on ordered data fixed +
  • Fixed bug with XmlTextReader.Eof property under C++Builder +
  • Internal error in Delphi 5 fixed +
  • Fixed bug with calling RefreshQuick method for SDAC DataSet with parameters in query +
  • Fixed bug with identity columns in SQL generator +
+ +

4.00.0.4 20.03.07

+ +New functionality: +
    +
  • Delphi 2007 for Win32 supported +
  • Disconnected model for working offline and automatically connecting and disconnecting supported +
  • Local failover for detecting connection loss and implicitly reexecuting some operations supported +
  • Added DataSet Manager to control project datasets +
  • New TMSScript component for easy execution of multistatement scripts with the following features added: +
      +
    • Support for executing individual statements in scripts +
    • Support for executing huge scripts stored in files with dynamic loading +
    • Ability to use standard MS SQL client tool syntax +
    +
  • New component for transferring data between all types of TDataSets descendants added +
  • New TMSServiceBroker component for SQL Server 2005 queuing and reliable messaging added +
  • New TMSLoader component for improving records insertion performance added +
  • New TMSDump component for loading data to and from the server added +
  • Data export and import to/from XML supported +
  • WideMemo field type in Delphi 2006 supported +
  • Support for sending messages to DBMonitor from any point of your program added +
  • Added asynchronous execute and fetch modes +
  • Compressed BLOBs supported +
+

+ Support for more MS SQL server functionality: +

    +
  • MS SQL Server Compact Edition supported +
  • Multiple Active Result Sets (MARS) supported +
  • Support for new data types, including XML, varchar(MAX), nvarchar(MAX), varbinary(MAX) added +
  • Support for a new level of transaction isolation added +
  • Support for more server objects in TMSMetaData added +
  • Stored procedure parameters with default values supported +
+ +Extensions and improvements to existing functionality: +
    +
  • General performance improved +
  • Master/detail functionality extensions: +
      +
    • Local master/detail relationship support added +
    • Master/detail relationship in CachedUpdates mode support added +
    +
  • Working with calculated and lookup fields improvements: +
      +
    • Local sorting and filtering added +
    • Record location speed increased +
    • Improved working with lookup fields +
    +
  • Greatly increased performance of applying updates in CachedUpdates mode +
  • Connection pool functionality improvements: +
      +
    • Efficiency significantly improved +
    • API for draining the connection pool added +
    +
  • Ability to customize update commands by attaching external components to TMSUpdateSQL objects added +
  • Support for DefaultValues on record insertion added +
  • Some performance improvements achieved: +
      +
    • NUMERIC fields fetching +
    • Update commands execution while editing data set +
    • DataSet refreshing +
    • Records refreshing after updates and inserts +
    +
  • Support for selecting database name in TMSConnectDialog added +
+ +Usability improvements: +
    +
  • Syntax highlighting in design-time editors added +
  • Demo projects became better organized and clearer +
  • FAQ added +
+ +

3.80.0.34 05.12.06

+
    +
  • Fixed bug with TraceFlags in DASQLMonitor (D16224) +
  • Fixed bug with TDAParam.AsDate property (D16213) +
  • Fixed bug with wrong value of the StatementTypes variable in the BeforeUpdateExecute event +
  • Bug with AV failure when modifying VirtualTable data in design time fixed +
+ +

3.80.0.33 31.10.06

+
    +
  • Bug with ApplyUpdates and OnUpdateError in SDAC Trial fixed +
  • Bug with comparing Unicode strings fixed +
  • Bug with BeforeDisconnect event lost in design time fixed +
  • Bug with debug mode in design time fixed +
  • Bug with RefreshRecord in CachedUpdates mode fixed +
  • Bug with mouse wheeling in FilterBar and Search bar of CRDBGrid fixed (15675) +
+ +

3.80.0.32 29.09.06

+
    +
  • Limited support added for Windows Vista Beta 2 +
  • Memory usage optimized for tables with many fields +
  • Fixed bug with SQLNCLI provider and server cursors +
  • Fixed bug with unquoted '@' symbol in connection string +
  • Design-time bug with IDE version in TMSConnectionEditor in Delphi 2005 fixed +
  • Fixed bug with macros and "&" operand +
+ +

3.80.0.31 28.08.06

+
    +
  • Support for Professional editions of Turbo Delphi, Turbo Delphi for .NET, Turbo C++ added +
  • Bug with automatic detail field value generation fixed (D12886) +
  • Fixed bug with TrimVarChar +
  • Fixed bug with FindKey method when the primary key has field of type Int64 (D12558) +
  • Added capability to use quoted field names in IndexFieldNames property (D10091) +
  • Bug with canceling edit on record with BLOB fields fixed +
  • Bug with WideString lookup fields size fixed +
  • Bug with loading wide strings in TVirtualTable fixed +
  • Added support for macros names in which first symbol is digit +
  • Bugs with parsing macros fixed +
  • Bug with filtering DateTime fields when filter expression format differs from one in local system fixed (D12823) +
+ +

3.70.3.30 07.07.06

+
    +
  • Fixed bug with wrong line number in DAScript.EndLine property (M12015) +
  • Fixed bug with filtering empty strings (S12329) +
  • Bug with using calculated and lookup fields in Master/Detail relationship fixed +
  • Fixed bug with design-time editor for Detail dataset in Master/Detail relationship (M12021, M11914) +
  • Bug with modifying FieldDefs in TVirtualTable fixed +
  • Performance of SaveToFile and LoadFromFile functions in TVirtualTable improved (D12435) +
  • Bug in TVirtualTable Editor fixed +
+ +

3.70.3.29 31.05.06

+
    +
  • New MS SQL Server 2005 data types supported +
  • TMSConnection.Options.InitialFileName property added +
  • Modifying FieldDefs in TVirtualTable component accelerated +
  • Fixed bug with memory leak in TCustomDADataSet (11636) +
  • Bug with calling Parameter Editor from Object Inspector fixed (11671) +
  • Bug with Master-Detail linked by parameters fixed +
+ +

3.70.2.28 18.05.06

+
    +
  • SDAC is now compatible with InterBase Data Access Components +
  • Bug with Prepare method in Delphi 5 fixed +
+ +

3.70.1.27 12.05.06

+
    +
  • Fixed bug with loosing connection for FetchAll=False datasets (M11398) +
  • Added support for MIDAS TDataSet.PSExecuteStatement ResultSet parameter (M11351) +
  • Fixed bug with AV failure in ApplyUpdates after CommitUpdates +
  • Bug with local filter under CLR fixed (11291) +
  • Bug with using alternative memory managers fixed +
+ +

3.70.1.26 14.04.06

+
    +
  • Fixed bug with positioning in grid after TCustomDADataSet.Locate (11256) +
  • Fixed bug with Master/Detail relations and local sorting and filtering (11254, 11255) +
  • TCustomDADataSet.Locate now centers position in DBGrid (10976) +
  • Bug with displaying query objects in objects tree in DBMonitor fixed +
  • Optimized using of system resources when opening query (O11270) +
  • Fixed bug with design-time SQL Generator +
  • Added OLE DB limitation workaround when preparing query with parameters in subquery +
+ +

3.70.1.25 10.03.06

+
    +
  • Ability of trimming (N)VARCHAR fields with CustomDADataSet.Options.TrimVarChar property added +
  • Added support for MIDAS master-detail relations +
  • Fixed bug with fetching (N)VARCHAR(4000) fields +
  • Fixed bug with erroneous exception on TDAParam.LoadFromStream +
  • Bug with AV failure when calling CommitUpdates method of inactive dataset fixed +
  • Bug with error failure when assigning empty dataset to VirtualTable under CLR fixed +
+ +

3.70.0.24 26.01.06

+
    +
  • Support for Delphi 2006 added +
  • Support for MS SQL Server 2005 added +
  • FastReport 3.20 support added +
  • Fixed bug with single MacroChar in string constants inside SQL +
  • Bug with invalid processing of SQL statements when using SQL keywords as macros name fixed +
  • Fixed MS SQL server bug with processing 'SET STATISTICS IO ON' statements +
  • Fixed bug with using CheckRowVersion property and RefreshRecord method +
+ +

3.55.2.22 19.12.05

+
    +
  • Fixed bug with trimming VARCHAR fields +
  • Bug with restoring BaseSQL property fixed +
+ +

3.55.2.21 07.12.05

+
    +
  • TMSConnection.Options.PersistSecurityInfo property added +
  • TCustomDADataSet.FindKey, TCustomDADataSet.FindNearest methods added for BDE compatibility +
  • Fixed bug with Locate by multiple fields +
  • Fixed bug with unchanging RecordCount value after CancelUpdates +
  • Bug with refreshing record after changing SQL property fixed +
  • Fixed SetWhere function bug +
  • Fixed bug with server cursors when RefreshOptions property contains roBeforeEdit flag +
+ +

3.55.1.20 24.10.05

+
    +
  • Fixed bug with open detail TMSTable when master is not opened +
  • Fixed bug with design-time SQL Generator +
  • Fixed bug with EOLEDBError.MessageWide +
  • Bug with updating FilterSQL fixed +
  • Bug with VirtualTable registration in CBuilder fixed +
  • Bug with VtReg.pas in Pro version fixed +
  • Bug with closing dataset (SQL contains macros) when the InsertSQL property changes fixed +
  • Bug with incorrect sequence of calling BeforeClose, BeforeDisconnect events fixed +
+ +

3.55.1.19 11.10.05

+
    +
  • Unicode error messages support added with EOLEDBError.MessageWide +
  • SQL Generator improved: now in design-time format is used instead of +
  • Fixed some bugs in design-time SQL Generator +
  • Fixed bug with Master/Detail relations on string keys that differ in case only +
  • Bug with reexecution after SQL statement changed fixed +
  • Bug with assertion failure with OnNewRecord fixed +
  • Fixed bug with detail refresh when field referenced by MasterFields property is empty +
  • Fixed bug with extra detail record posts after master record changed +
  • Bug with firing AfterScroll Event after detail dataset refresh fixed +
  • Bug with simultaneous use of several DAC products fixed +
  • Bug with changing FilterSQL of inactive dataset fixed +
  • Bug with column sizing with CRDBGrid.OptionsEx.dgeStretch=True at design-time fixed +
  • Bug with TCRColumn.SummaryMode=smLabel for string and date fields fixed +
+ +

3.55.1.18 02.09.05

+
    +
  • Deferred detail dataset refresh feature with TCustomDADataSet.Options.DetailDelay property added +
  • Fixed bug with locating, filtering and local sorting of strings that contain '--' +
  • Fixed DisposeBuf bug +
+ +

3.55.0.17 02.08.05

+
    +
  • Optimized macros processing +
  • Fixed bug with using keywords as param name +
  • Fixed bug with local sorting in dsEdit state +
  • Fixed bug with getting Null for Blob fields +
  • Improved behavior on parsing inline comments +
+ +

3.55.0.16 05.07.05

+
    +
  • Fixed performance bug with calling Execute (ReadOnly = True) +
  • Fixed bug with sorting by GUID fields +
  • Bug with TDAParam.AsString with TDataTime parameters fixed +
  • Fixed bug with TMSConnection.ConnectioString design time editor +
+ +

3.55.0.15 30.05.05

+
    +
  • Ability of automatic preparing query with TCustomDADataSet.Options.AutoPrepare property added +
  • Ability to synchronize position at different DataSets with TCustomDADataSet.GotoCurrent method added +
  • Optimized MSSQLMonitor BLOB parameters processing +
  • Improved behavior on editing master key on Master/Detail relation +
  • Removed TMSStoredProc.ParamCheck property from design-time +
  • Fixed bug with ignoring MSConnection.Options.WorkstationID +
  • Fixed bug with DADataSet.CheckBookmark on filtered datasets +
  • Fixed bug with Transactions on connection lost +
  • Fixed bug with reconnect on connection lost +
+ +

3.50.0.14 29.04.05

+
    +
  • Update Pack 3 is required for Delphi 8 +
  • Fixed bug with FetchAll = False and QueryRecCount = True for Detail queries (6759) +
  • MSQuery.AddWhere improved +
+ +

3.50.0.13 29.03.05

+
    +
  • Fixed bug with quoting fields in SQLRefresh +
  • Fixed bug with FieldDefs.Update and prepared TMSStoredProc (6147) +
  • Fixed bug with roAfterUpdate and changing primary key values (6389) +
+ +

3.50.0.12 24.02.05

+
    +
  • FastReport3 engine and demo added +
  • TCustomDADataSet.UpdateObject support for MIDAS added +
  • Fixed bug with CLR BLOB Locate +
  • Fixed bug with FmtBCD Locate +
+ +

3.50.0.11 24.01.05

+
    +
  • Support for Delphi 2005 added +
  • Support for MS SQL Server 2005 Beta 2 added +
  • Guid fields support for VirtualTable added +
  • Fixed some bugs with connection pooling +
  • Fixed bug MSParam.Size on CLR +
  • Fixed bug with KeepDesignConnected +
  • Fixed bug with design-time SQL generator and macros +
  • Fixed bug with design-time MSStoredProc SQL generator +
  • Fixed bug with IndexFieldNames on identical values +
  • Fixed infrequent bug with IndexFieldNames +
  • Fixed bug with params on MSQuery.Execute with SELECT +
  • Fixed bug with disconnect on fatal error +
+ +

3.00.2.9 23.11.04

+
    +
  • Fixed bug with IndexFieldNames and Locate +
  • Fixed bug with setting MinValue and MaxValue for tinyint fields +
  • Fixed bug with KeepDesignConnected +
+ +

3.00.2.8 28.10.04

+
    +
  • Fixed C++Builder hpp bug +
+ +

3.00.2.5 21.10.04

+
    +
  • lxPartialCompare option for DataSet.LocateEx added +
  • Fixed bug with OnFilterRecord and Blob fields (4962) +
  • Fixed bug with Reconnect and prepared statements (4910) +
  • Fixed bug with BlobField.SetAsString +
+ +

3.00.1.3 10.09.04

+
    +
  • Common class DADataAdapter isolated to CoreLab.Dac.AdoNet.dll library +
  • Fixed bugs with ctKeyset, ctDynamic and default values (4082) +
  • Fixed bug with evaluation period in Trial version +
  • Support for TDAConnectionOptions.AssignTo added +
  • Fixed bug with filtering NULL string values (4776) +
  • Fixed bug with large blobs in TVirtualTable (4769) +
+ +

3.00.0.2 20.08.04

+
    +
  • Fatal errors processing improved +
  • Delphi 7.1 bug fixed +
  • MDAC 2.8 Lost connection bug fixed +
  • Fixed bug with QueryIdentity and complex table names (4634) +
  • Fixed bug with quoting complex names +
+ +

3.00.0.1 21.07.04

+
    +
  • Support for Delphi 8 added +
  • Local sorting ability with TMemDataSet.IndexFieldNames added +
  • Connection pooling support +
  • TCRDBGrid sources in Standard edition +
  • MSDataAdapter component added +
  • .NET Windows Forms demo project added +
  • ASP.NET demo project added +
  • TMSConnection.GetStoredProcNames, GetTableNames, GetDatabaseNames added +
  • TMSConnection.ClientVersion, ServerVersion added +
  • Milliseconds support added +
  • TCRColumn.TotalValue property added +
  • New time trial limitation +
  • Fixed StackOverflow bug with opening empty ctStatic cursors +
  • Fixed bug with Refresh server cursors (4478) +
  • Fixed bug with small memory leak on SQL error (DbxSda4344) +
  • RefreshRecord now updates timestamp field as default +
  • Fixed bug with updating non-dbo owned tables (4193) +
  • Fixed bug with CustomDADataSet.Options.ReturnParams (4159) +
  • Fixed bug with CRDBGrid +
  • Fixed bug with getting RecordCount if Filtered = True (4125) +
  • Fixed bug with getting OldValue after Insert +
  • Fixed bug with TrimFixedChar and dll +
+ +

2.45.2.25 15.03.04

+
    +
  • Mouse wheel support added to CRDBGrid +
  • Local constraints for ctKeyset, ctDynamic disabled (4082) +
  • Fixed bug with quote char in Filter property +
  • Fixed bug with assigning name with spaces to Database property +
  • Fixed bug with getting Identity value that exceeds MaxInt (4081) +
  • Fixed bug with RefreshRecord and binary key fields (4089) +
+ +

2.45.2.24 05.02.04

+
    +
  • Fixed bug with restoring position after Refresh (M3962) +
  • Fixed bug with TCustomMSDataSet.PSGetKeyFields (M4001) +
+ +

2.45.2.23 30.12.03

+
    +
  • Fixed bug with processing ftTime and ftDate parameters +
  • Fixed bug with setting Null value for string parameters +
  • Fixed bug with processing Blob and Memo parameters (3709, 3726) +
+ +

2.45.2.22 24.11.03

+
    +
  • Fixed bug with getting RecordCount (ParamCheck = False) (3524) +
+ +

2.45.2.21 02.10.03

+
    +
  • Methods TMSSQL.BreakExec and TCustomMSDataSet.BreakExec added +
  • Property TMSConnection.Options.AutoTranslate added +
  • Method ExecSQL in TMSConnection added +
  • Methods GetTableNames and GetDatabaseNames in TMSConnection added +
  • Unicode support for Locate on Win9x added +
  • Fixed bug with MSDataSet.BeforeUpdateExecute and AfterUpdateExecute (3347) +
  • Fixed bug with MSParam.Size (3345) +
  • Fixed bug with calling Refresh after RefreshRecord (M3269) +
  • Fixed bug with MSDataSet.UpdatingTable set at design-time (3164) +
  • Bug with opening queries (FilterSQL <> '', StreamedActive = True) fixed (M3497) +
+ +

2.45.1.20 02.07.03

+
    +
  • Fixed bug with possible AV on destroying DataSet in Delphi5 (3069) +
+ +

2.45.1.19 10.06.03

+
    +
  • Parameter processing for complex queries optimized (3058) +
  • Design-time bug occured in Delphi5 and CBuilder5 fixed +
+ +

2.45.1.18 05.06.03

+
    +
  • SQL Generator improved - support for complicated statements added (2993) +
  • SQL Generator improved - "Quote names" checkbox added +
  • Design-time SQL Generator was simplified +
  • TParam -> TDAParam +
  • Bug on Post (Insert/Append) when InsertSQL execution fails fixed +
  • Fixed bug with ApplyUpdates if Options.ReturnParams is False and Options.QueryIdentity is True +
  • Fixed bug on PSGetKeyFields after dataset is closed(3034) +
  • Fixed bug with wildcard Locate on WideString fields +
  • Fixed memory leak on posting BLOB data with ctKeyset, ctDynamic +
  • Fixed bug with trimming char fields having empty values (2987) +
  • Fixed bug with calling RefreshRecord on SELECT w/o data fields +
  • Fixed bug with calling RefreshRecord on ctDynamic (3053) +
  • Fixed bug with MultiSelect DBGrid for ctKeySet, ctStatic (3054) +
+ +

2.45.0.17 05.05.03

+
    +
  • property MSConnection.Options.WorkstationID added +
  • Performance to insert large BLOBs improved +
  • Fixed bug with using SDAC from dll (2963) +
  • Fixed bug with getting SharedObj-parameters from datasets with LookUp fields (2948) +
+ +

2.45.0.16 04.04.03

+
    +
  • Performance significantly improved +
  • event TMSConnection.OnInfoMessage added +
  • Multiple Errors support added +
  • EMSError now inherited from EOLEDBError +
  • property TBlob.AsWideString added +
  • property MSConnection.Options.ApplicationName added (2813) +
  • Parameters parsing improved. Symbol ':' in string literals is ignored (2836) +
  • Network error processing improved (2554, 2571) +
  • MSConnectDialog improved +
  • Performance demo added +
  • Bug with RefreshRecord fixed +
  • Small memory leak in RefreshRecord on ctKeyset, ctDynamic removed +
  • Fixed bug with storing unicode strings in Memo fields +
  • Fixed bug with processing 'Fail' parameter in TMSConnection.OnError (M2876) +
  • Fixed bug with password storing in MSConnection.ConnectString (2841) +
  • Fixed bug with design-time SQL Generator (2885) +
  • Bug with transaction control on ctKeyset, ctDynamic fixed (2885) +
  • Fixed bug with TMSMetaData.Refresh (2872) +
  • Fixed bug with changing TMSMetaData.ObjectType +
+ +

2.40.0.15 24.02.03

+
    +
  • WideString support added +
  • Refresh improved - current record is restored after Refresh call +
  • Supported types list for TVirtualTable extended. WideString, Smallint, Word, Boolean, Largeint, Currency, Date and Time field +
  • pes added (2779) +
  • Performance of VirtualTable.AssignDataSet improved +
  • Property MSDataSet.Options.QuoteNames added +
  • Property MSConnection.Options.KeepDesignConnected added +
  • Property MSConnectDialog.StoreLogInfo published +
  • Bug with SDAC and ADO incompatibility under CBuilder fixed (2751) +
  • Bug with clearing old value for Null output parameters fixed +
  • Bug with wrong setting parameter values in WHERE clause fixed +
  • Bug with processing empty param values in ConnectString fixed +
  • Bug in MSTable.Execute fixed +
  • Support for LIKE expressions in Filter property added(DAC-2706) +
  • Precision and Size property values setting bug for TBCDField and TFMTBCDField fixed(2723) +
  • Bug with getting field aliases on old clients fixed (2780) +
  • Bug with design-time created fields case sensitivity fixed (2663) +
  • Bug with some memory leak on each connection to server fixed (2679) +
+ +

2.35.0.14 30.01.03

+
    +
  • Improved performance for opening queries with lot of parameters +
  • Dataset 'with many fields' update performance improved +
  • 'Connection Lost' error processing improved +
  • MSDataSet.Locate improved (2589) +
  • Fixed bug with compiling applications on C++ Builder +
  • Fixed bug editing MSConnection.ConnectString property on DataModule (2586) +
  • Getting identity improved for MS SQL 2000 (SCOPE_IDENTITY() instead @@Identity) +
  • Fixed bug with getting Identity value after inserting to view (2567) +
+ +

2.35.0.13 04.01.03

+
    +
  • Bug with string quote in filter expression fixed (O2532) +
+ +

2.35.0.12 26.12.02

+
    +
  • Speed optimization for opening small queries (2378) +
  • MSConnection.Options added (2454) +
  • Limited MSConnection.ConnectString support added (2356) +
  • Output string and (var)bytes parameters are now obtained from the server +
  • with the maximum length not depending on set Param.Size (2355) +
  • DBMonitor client implementation moved to COM server +
  • Bug with complex table names fixed +
  • Fixed common bug with lost data in DT-editors(D2137) +
  • Bug with design-time MSConnection in DataModule fixed (O2290) +
  • Design-time editor for MSTable bug fixed (2433) +
  • BLOB fields post for Server Cursors optimized(2117) +
  • Bug with Master/Detail relation for ClientDataSet fixed (O2423) +
  • Fixed some bugs with OutOfMem (1979) +
+ + + +

 

 


© 1997-2007 Core Lab. All rights reserved.

+
+ + + + \ No newline at end of file diff --git a/internal/4.10.0.10/1/Lib/D11/CLRClasses.dcu b/internal/4.10.0.10/1/Lib/D11/CLRClasses.dcu new file mode 100644 index 0000000..ad92790 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/CLRClasses.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/CRAccess.dcu b/internal/4.10.0.10/1/Lib/D11/CRAccess.dcu new file mode 100644 index 0000000..cf7662a Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/CRAccess.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/CRBatchMove.dcu b/internal/4.10.0.10/1/Lib/D11/CRBatchMove.dcu new file mode 100644 index 0000000..4656bc3 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/CRBatchMove.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/CRColFrame.dcu b/internal/4.10.0.10/1/Lib/D11/CRColFrame.dcu new file mode 100644 index 0000000..f0cddd0 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/CRColFrame.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/CRConnectionPool.dcu b/internal/4.10.0.10/1/Lib/D11/CRConnectionPool.dcu new file mode 100644 index 0000000..68c68fc Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/CRConnectionPool.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/CRDataEditor.dcu b/internal/4.10.0.10/1/Lib/D11/CRDataEditor.dcu new file mode 100644 index 0000000..8c7774f Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/CRDataEditor.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/CREditor.dcu b/internal/4.10.0.10/1/Lib/D11/CREditor.dcu new file mode 100644 index 0000000..30d8e4b Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/CREditor.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/CRFrame.dcu b/internal/4.10.0.10/1/Lib/D11/CRFrame.dcu new file mode 100644 index 0000000..fe6c6d2 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/CRFrame.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/CRParser.dcu b/internal/4.10.0.10/1/Lib/D11/CRParser.dcu new file mode 100644 index 0000000..70bef5a Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/CRParser.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/CRTabEditor.dcu b/internal/4.10.0.10/1/Lib/D11/CRTabEditor.dcu new file mode 100644 index 0000000..c4798e6 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/CRTabEditor.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/CRThread.dcu b/internal/4.10.0.10/1/Lib/D11/CRThread.dcu new file mode 100644 index 0000000..67807ca Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/CRThread.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/CRXml.dcu b/internal/4.10.0.10/1/Lib/D11/CRXml.dcu new file mode 100644 index 0000000..5a38d9f Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/CRXml.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/DAConnectionEditor.dcu b/internal/4.10.0.10/1/Lib/D11/DAConnectionEditor.dcu new file mode 100644 index 0000000..cf6d62e Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/DAConnectionEditor.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/DAConsts.dcu b/internal/4.10.0.10/1/Lib/D11/DAConsts.dcu new file mode 100644 index 0000000..25c9b2f Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/DAConsts.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/DADataEditor.dcu b/internal/4.10.0.10/1/Lib/D11/DADataEditor.dcu new file mode 100644 index 0000000..3a4f75a Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/DADataEditor.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/DADesign.dcu b/internal/4.10.0.10/1/Lib/D11/DADesign.dcu new file mode 100644 index 0000000..ada4cbf Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/DADesign.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/DADesign.res b/internal/4.10.0.10/1/Lib/D11/DADesign.res new file mode 100644 index 0000000..8a83ab0 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/DADesign.res differ diff --git a/internal/4.10.0.10/1/Lib/D11/DADesign10p.res b/internal/4.10.0.10/1/Lib/D11/DADesign10p.res new file mode 100644 index 0000000..8688e5c Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/DADesign10p.res differ diff --git a/internal/4.10.0.10/1/Lib/D11/DADesign9.res b/internal/4.10.0.10/1/Lib/D11/DADesign9.res new file mode 100644 index 0000000..a995cfb Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/DADesign9.res differ diff --git a/internal/4.10.0.10/1/Lib/D11/DADesignUtils.dcu b/internal/4.10.0.10/1/Lib/D11/DADesignUtils.dcu new file mode 100644 index 0000000..bb9c214 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/DADesignUtils.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/DADualListEditor.dcu b/internal/4.10.0.10/1/Lib/D11/DADualListEditor.dcu new file mode 100644 index 0000000..a70496d Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/DADualListEditor.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/DADump.dcu b/internal/4.10.0.10/1/Lib/D11/DADump.dcu new file mode 100644 index 0000000..ecdf589 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/DADump.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/DADumpEditor.dcu b/internal/4.10.0.10/1/Lib/D11/DADumpEditor.dcu new file mode 100644 index 0000000..5fb08d0 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/DADumpEditor.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/DADumpProgress.dcu b/internal/4.10.0.10/1/Lib/D11/DADumpProgress.dcu new file mode 100644 index 0000000..3a5deb3 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/DADumpProgress.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/DALoader.dcu b/internal/4.10.0.10/1/Lib/D11/DALoader.dcu new file mode 100644 index 0000000..e9d2efe Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/DALoader.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/DAMacrosFrame.dcu b/internal/4.10.0.10/1/Lib/D11/DAMacrosFrame.dcu new file mode 100644 index 0000000..7e32db4 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/DAMacrosFrame.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/DAMenu.dcu b/internal/4.10.0.10/1/Lib/D11/DAMenu.dcu new file mode 100644 index 0000000..f3bbd85 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/DAMenu.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/DAParamValueEditor.dcu b/internal/4.10.0.10/1/Lib/D11/DAParamValueEditor.dcu new file mode 100644 index 0000000..b5db20c Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/DAParamValueEditor.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/DAParamsFrame.dcu b/internal/4.10.0.10/1/Lib/D11/DAParamsFrame.dcu new file mode 100644 index 0000000..7605620 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/DAParamsFrame.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/DAQueryEditor.dcu b/internal/4.10.0.10/1/Lib/D11/DAQueryEditor.dcu new file mode 100644 index 0000000..a0c219b Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/DAQueryEditor.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/DASPCallFrame.dcu b/internal/4.10.0.10/1/Lib/D11/DASPCallFrame.dcu new file mode 100644 index 0000000..4aab314 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/DASPCallFrame.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/DASQLEditor.dcu b/internal/4.10.0.10/1/Lib/D11/DASQLEditor.dcu new file mode 100644 index 0000000..26cd6a4 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/DASQLEditor.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/DASQLFrame.dcu b/internal/4.10.0.10/1/Lib/D11/DASQLFrame.dcu new file mode 100644 index 0000000..6aa5df3 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/DASQLFrame.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/DASQLGeneratorFrame.dcu b/internal/4.10.0.10/1/Lib/D11/DASQLGeneratorFrame.dcu new file mode 100644 index 0000000..32afc8f Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/DASQLGeneratorFrame.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/DASQLMonitor.dcu b/internal/4.10.0.10/1/Lib/D11/DASQLMonitor.dcu new file mode 100644 index 0000000..4ae728e Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/DASQLMonitor.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/DAScript.dcu b/internal/4.10.0.10/1/Lib/D11/DAScript.dcu new file mode 100644 index 0000000..509766c Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/DAScript.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/DAScriptEditor.dcu b/internal/4.10.0.10/1/Lib/D11/DAScriptEditor.dcu new file mode 100644 index 0000000..ed0009d Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/DAScriptEditor.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/DAStoredProcEditor.dcu b/internal/4.10.0.10/1/Lib/D11/DAStoredProcEditor.dcu new file mode 100644 index 0000000..ba1eb75 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/DAStoredProcEditor.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/DATableEditor.dcu b/internal/4.10.0.10/1/Lib/D11/DATableEditor.dcu new file mode 100644 index 0000000..e38e876 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/DATableEditor.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/DAUpdateSQLEditor.dcu b/internal/4.10.0.10/1/Lib/D11/DAUpdateSQLEditor.dcu new file mode 100644 index 0000000..33da456 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/DAUpdateSQLEditor.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/DAUpdateSQLFrame.dcu b/internal/4.10.0.10/1/Lib/D11/DAUpdateSQLFrame.dcu new file mode 100644 index 0000000..dfcdaf8 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/DAUpdateSQLFrame.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/DAVersionInfo.dcu b/internal/4.10.0.10/1/Lib/D11/DAVersionInfo.dcu new file mode 100644 index 0000000..a310f5f Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/DAVersionInfo.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/DBAccess.dcu b/internal/4.10.0.10/1/Lib/D11/DBAccess.dcu new file mode 100644 index 0000000..3c5b5fa Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/DBAccess.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/DBAccess.res b/internal/4.10.0.10/1/Lib/D11/DBAccess.res new file mode 100644 index 0000000..c4d628d Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/DBAccess.res differ diff --git a/internal/4.10.0.10/1/Lib/D11/DBMonitorClient.dcu b/internal/4.10.0.10/1/Lib/D11/DBMonitorClient.dcu new file mode 100644 index 0000000..c960d17 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/DBMonitorClient.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/DBMonitorIntf.dcu b/internal/4.10.0.10/1/Lib/D11/DBMonitorIntf.dcu new file mode 100644 index 0000000..0c06844 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/DBMonitorIntf.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/DBToolsClient.dcu b/internal/4.10.0.10/1/Lib/D11/DBToolsClient.dcu new file mode 100644 index 0000000..f8bd490 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/DBToolsClient.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/DBToolsClient.res b/internal/4.10.0.10/1/Lib/D11/DBToolsClient.res new file mode 100644 index 0000000..54d2e5f Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/DBToolsClient.res differ diff --git a/internal/4.10.0.10/1/Lib/D11/DBToolsIntf.dcu b/internal/4.10.0.10/1/Lib/D11/DBToolsIntf.dcu new file mode 100644 index 0000000..5d1b6d0 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/DBToolsIntf.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/DacReg.dcu b/internal/4.10.0.10/1/Lib/D11/DacReg.dcu new file mode 100644 index 0000000..30dc74b Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/DacReg.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/DacVcl.dcu b/internal/4.10.0.10/1/Lib/D11/DacVcl.dcu new file mode 100644 index 0000000..9607ce6 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/DacVcl.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/Download.dcu b/internal/4.10.0.10/1/Lib/D11/Download.dcu new file mode 100644 index 0000000..58e741f Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/Download.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/HelpUtils.dcu b/internal/4.10.0.10/1/Lib/D11/HelpUtils.dcu new file mode 100644 index 0000000..b9ff578 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/HelpUtils.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/MSAccess.dcu b/internal/4.10.0.10/1/Lib/D11/MSAccess.dcu new file mode 100644 index 0000000..c06bba0 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/MSAccess.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/MSConnectForm.dcu b/internal/4.10.0.10/1/Lib/D11/MSConnectForm.dcu new file mode 100644 index 0000000..303d6b7 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/MSConnectForm.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/MSConnectionEditor.dcu b/internal/4.10.0.10/1/Lib/D11/MSConnectionEditor.dcu new file mode 100644 index 0000000..3d706fe Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/MSConnectionEditor.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/MSConnectionPool.dcu b/internal/4.10.0.10/1/Lib/D11/MSConnectionPool.dcu new file mode 100644 index 0000000..e36d338 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/MSConnectionPool.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/MSConsts.dcu b/internal/4.10.0.10/1/Lib/D11/MSConsts.dcu new file mode 100644 index 0000000..63e9883 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/MSConsts.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/MSDesign.dcu b/internal/4.10.0.10/1/Lib/D11/MSDesign.dcu new file mode 100644 index 0000000..200d107 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/MSDesign.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/MSDesign.res b/internal/4.10.0.10/1/Lib/D11/MSDesign.res new file mode 100644 index 0000000..acad9b3 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/MSDesign.res differ diff --git a/internal/4.10.0.10/1/Lib/D11/MSDesign10p.res b/internal/4.10.0.10/1/Lib/D11/MSDesign10p.res new file mode 100644 index 0000000..465cc6e Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/MSDesign10p.res differ diff --git a/internal/4.10.0.10/1/Lib/D11/MSDesign9.res b/internal/4.10.0.10/1/Lib/D11/MSDesign9.res new file mode 100644 index 0000000..d6732b5 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/MSDesign9.res differ diff --git a/internal/4.10.0.10/1/Lib/D11/MSDesignUtils.dcu b/internal/4.10.0.10/1/Lib/D11/MSDesignUtils.dcu new file mode 100644 index 0000000..f0f9059 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/MSDesignUtils.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/MSDump.dcu b/internal/4.10.0.10/1/Lib/D11/MSDump.dcu new file mode 100644 index 0000000..de53004 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/MSDump.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/MSDumpEditor.dcu b/internal/4.10.0.10/1/Lib/D11/MSDumpEditor.dcu new file mode 100644 index 0000000..01a0586 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/MSDumpEditor.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/MSLoader.dcu b/internal/4.10.0.10/1/Lib/D11/MSLoader.dcu new file mode 100644 index 0000000..8a9cb5a Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/MSLoader.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/MSMenu.dcu b/internal/4.10.0.10/1/Lib/D11/MSMenu.dcu new file mode 100644 index 0000000..c1bc648 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/MSMenu.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/MSNamesEditor.dcu b/internal/4.10.0.10/1/Lib/D11/MSNamesEditor.dcu new file mode 100644 index 0000000..19e2fbe Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/MSNamesEditor.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/MSParamsFrame.dcu b/internal/4.10.0.10/1/Lib/D11/MSParamsFrame.dcu new file mode 100644 index 0000000..218b9de Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/MSParamsFrame.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/MSParser.dcu b/internal/4.10.0.10/1/Lib/D11/MSParser.dcu new file mode 100644 index 0000000..62f4cdf Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/MSParser.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/MSQueryEditor.dcu b/internal/4.10.0.10/1/Lib/D11/MSQueryEditor.dcu new file mode 100644 index 0000000..1779223 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/MSQueryEditor.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/MSReg.dcu b/internal/4.10.0.10/1/Lib/D11/MSReg.dcu new file mode 100644 index 0000000..adfaed6 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/MSReg.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/MSSPCallFrame.dcu b/internal/4.10.0.10/1/Lib/D11/MSSPCallFrame.dcu new file mode 100644 index 0000000..710d0a0 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/MSSPCallFrame.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/MSSQLEditor.dcu b/internal/4.10.0.10/1/Lib/D11/MSSQLEditor.dcu new file mode 100644 index 0000000..9c9eb8d Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/MSSQLEditor.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/MSSQLMonitor.dcu b/internal/4.10.0.10/1/Lib/D11/MSSQLMonitor.dcu new file mode 100644 index 0000000..69fc5b0 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/MSSQLMonitor.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/MSScript.dcu b/internal/4.10.0.10/1/Lib/D11/MSScript.dcu new file mode 100644 index 0000000..607b854 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/MSScript.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/MSServiceBroker.dcu b/internal/4.10.0.10/1/Lib/D11/MSServiceBroker.dcu new file mode 100644 index 0000000..d07df44 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/MSServiceBroker.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/MSStoredProcEditor.dcu b/internal/4.10.0.10/1/Lib/D11/MSStoredProcEditor.dcu new file mode 100644 index 0000000..e02f47c Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/MSStoredProcEditor.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/MSUpdateSQLEditor.dcu b/internal/4.10.0.10/1/Lib/D11/MSUpdateSQLEditor.dcu new file mode 100644 index 0000000..827d8c1 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/MSUpdateSQLEditor.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/MemDS.dcu b/internal/4.10.0.10/1/Lib/D11/MemDS.dcu new file mode 100644 index 0000000..216e054 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/MemDS.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/MemData.dcu b/internal/4.10.0.10/1/Lib/D11/MemData.dcu new file mode 100644 index 0000000..84a247c Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/MemData.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/MemUtils.dcu b/internal/4.10.0.10/1/Lib/D11/MemUtils.dcu new file mode 100644 index 0000000..41778f5 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/MemUtils.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/OLEDBAccess.dcu b/internal/4.10.0.10/1/Lib/D11/OLEDBAccess.dcu new file mode 100644 index 0000000..e3edacb Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/OLEDBAccess.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/OLEDBC.dcu b/internal/4.10.0.10/1/Lib/D11/OLEDBC.dcu new file mode 100644 index 0000000..53f6165 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/OLEDBC.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/OLEDBIntf.dcu b/internal/4.10.0.10/1/Lib/D11/OLEDBIntf.dcu new file mode 100644 index 0000000..6d43d7c Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/OLEDBIntf.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/SdacAbout.dcu b/internal/4.10.0.10/1/Lib/D11/SdacAbout.dcu new file mode 100644 index 0000000..73f8dd0 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/SdacAbout.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/VTDataEditor.dcu b/internal/4.10.0.10/1/Lib/D11/VTDataEditor.dcu new file mode 100644 index 0000000..a1cbe9b Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/VTDataEditor.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/VTDesign.dcu b/internal/4.10.0.10/1/Lib/D11/VTDesign.dcu new file mode 100644 index 0000000..baf1b4c Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/VTDesign.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/VirtualTable.dcu b/internal/4.10.0.10/1/Lib/D11/VirtualTable.dcu new file mode 100644 index 0000000..f8988ef Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/VirtualTable.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/Win32Timer.dcu b/internal/4.10.0.10/1/Lib/D11/Win32Timer.dcu new file mode 100644 index 0000000..52da5e2 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/Win32Timer.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/dac105.bpl b/internal/4.10.0.10/1/Lib/D11/dac105.bpl new file mode 100644 index 0000000..4070eab Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/dac105.bpl differ diff --git a/internal/4.10.0.10/1/Lib/D11/dac105.dcp b/internal/4.10.0.10/1/Lib/D11/dac105.dcp new file mode 100644 index 0000000..4844ab7 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/dac105.dcp differ diff --git a/internal/4.10.0.10/1/Lib/D11/dac105.dcu b/internal/4.10.0.10/1/Lib/D11/dac105.dcu new file mode 100644 index 0000000..1e62df2 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/dac105.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/dac105.res b/internal/4.10.0.10/1/Lib/D11/dac105.res new file mode 100644 index 0000000..1fbafc1 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/dac105.res differ diff --git a/internal/4.10.0.10/1/Lib/D11/dacvcl105.bpl b/internal/4.10.0.10/1/Lib/D11/dacvcl105.bpl new file mode 100644 index 0000000..d0e4561 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/dacvcl105.bpl differ diff --git a/internal/4.10.0.10/1/Lib/D11/dacvcl105.dcp b/internal/4.10.0.10/1/Lib/D11/dacvcl105.dcp new file mode 100644 index 0000000..3cecfc9 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/dacvcl105.dcp differ diff --git a/internal/4.10.0.10/1/Lib/D11/dacvcl105.dcu b/internal/4.10.0.10/1/Lib/D11/dacvcl105.dcu new file mode 100644 index 0000000..a27c002 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/dacvcl105.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/dacvcl105.res b/internal/4.10.0.10/1/Lib/D11/dacvcl105.res new file mode 100644 index 0000000..d50d7f1 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/dacvcl105.res differ diff --git a/internal/4.10.0.10/1/Lib/D11/dcldac105.bpl b/internal/4.10.0.10/1/Lib/D11/dcldac105.bpl new file mode 100644 index 0000000..2464b23 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/dcldac105.bpl differ diff --git a/internal/4.10.0.10/1/Lib/D11/dcldac105.dcp b/internal/4.10.0.10/1/Lib/D11/dcldac105.dcp new file mode 100644 index 0000000..701f4f8 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/dcldac105.dcp differ diff --git a/internal/4.10.0.10/1/Lib/D11/dcldac105.dcu b/internal/4.10.0.10/1/Lib/D11/dcldac105.dcu new file mode 100644 index 0000000..2d6237c Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/dcldac105.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/dcldac105.res b/internal/4.10.0.10/1/Lib/D11/dcldac105.res new file mode 100644 index 0000000..d50d7f1 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/dcldac105.res differ diff --git a/internal/4.10.0.10/1/Lib/D11/dclsdac105.bpl b/internal/4.10.0.10/1/Lib/D11/dclsdac105.bpl new file mode 100644 index 0000000..292f5af Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/dclsdac105.bpl differ diff --git a/internal/4.10.0.10/1/Lib/D11/dclsdac105.dcp b/internal/4.10.0.10/1/Lib/D11/dclsdac105.dcp new file mode 100644 index 0000000..476e61e Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/dclsdac105.dcp differ diff --git a/internal/4.10.0.10/1/Lib/D11/dclsdac105.dcu b/internal/4.10.0.10/1/Lib/D11/dclsdac105.dcu new file mode 100644 index 0000000..91f752a Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/dclsdac105.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/dclsdac105.res b/internal/4.10.0.10/1/Lib/D11/dclsdac105.res new file mode 100644 index 0000000..1c23367 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/dclsdac105.res differ diff --git a/internal/4.10.0.10/1/Lib/D11/sdac105.bpl b/internal/4.10.0.10/1/Lib/D11/sdac105.bpl new file mode 100644 index 0000000..f97196e Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/sdac105.bpl differ diff --git a/internal/4.10.0.10/1/Lib/D11/sdac105.dcp b/internal/4.10.0.10/1/Lib/D11/sdac105.dcp new file mode 100644 index 0000000..965e35a Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/sdac105.dcp differ diff --git a/internal/4.10.0.10/1/Lib/D11/sdac105.dcu b/internal/4.10.0.10/1/Lib/D11/sdac105.dcu new file mode 100644 index 0000000..c708814 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/sdac105.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/sdac105.res b/internal/4.10.0.10/1/Lib/D11/sdac105.res new file mode 100644 index 0000000..1c23367 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/sdac105.res differ diff --git a/internal/4.10.0.10/1/Lib/D11/sdacVcl.dcu b/internal/4.10.0.10/1/Lib/D11/sdacVcl.dcu new file mode 100644 index 0000000..46e6fda Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/sdacVcl.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/sdacvcl105.bpl b/internal/4.10.0.10/1/Lib/D11/sdacvcl105.bpl new file mode 100644 index 0000000..ec28ec5 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/sdacvcl105.bpl differ diff --git a/internal/4.10.0.10/1/Lib/D11/sdacvcl105.dcp b/internal/4.10.0.10/1/Lib/D11/sdacvcl105.dcp new file mode 100644 index 0000000..1ba73bb Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/sdacvcl105.dcp differ diff --git a/internal/4.10.0.10/1/Lib/D11/sdacvcl105.dcu b/internal/4.10.0.10/1/Lib/D11/sdacvcl105.dcu new file mode 100644 index 0000000..b8ba0bc Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/sdacvcl105.dcu differ diff --git a/internal/4.10.0.10/1/Lib/D11/sdacvcl105.res b/internal/4.10.0.10/1/Lib/D11/sdacvcl105.res new file mode 100644 index 0000000..1c23367 Binary files /dev/null and b/internal/4.10.0.10/1/Lib/D11/sdacvcl105.res differ diff --git a/internal/4.10.0.10/1/License.rtf b/internal/4.10.0.10/1/License.rtf new file mode 100644 index 0000000..40b871b Binary files /dev/null and b/internal/4.10.0.10/1/License.rtf differ diff --git a/internal/4.10.0.10/1/ReadMeSrc.txt b/internal/4.10.0.10/1/ReadMeSrc.txt new file mode 100644 index 0000000..ab0f678 --- /dev/null +++ b/internal/4.10.0.10/1/ReadMeSrc.txt @@ -0,0 +1,128 @@ +SQL Server Data Access Components Source Code +Copyright 1997-2007, Core Lab. All Rights Reserved + +There are two ways to compile and install SDAC for Windows manually. + +I. Using IDE + +Delphi and C++Builder for Win32 +-------------------------------- + +Run your IDE and walk through the folowing steps: + 1) Compile DAC run-time package (dacXX.dpk) + 2) For Delphi 6,7 or C++Builder 6 compile DAC GUI related package dacvclXX.dpk + 3) Compile DAC design-time package (dcldacXX.dpk) + 4) Compile SDAC run-time package (sdacXX.dpk) + 5) For Delphi 6,7 or C++Builder 6 compile SDAC GUI related package sdacvclXX.dpk + 6) Compile and install SDAC design-time package (dclsdacXX.dpk) + +You can find these packages in + Source\Delphi5\*.dpk - for Delphi 5 + Source\Delphi6\*.dpk - for Delphi 6 + Source\Delphi7\*.dpk - for Delphi 7 + Source\Delphi9\*.dpk - for Delphi 2005 + Source\Delphi10\*.dpk - for Delphi 2006 + Source\Delphi11\*.dpk - for Delphi 2007 + Source\CBuilder5\*.bpk - for C++Builder 5 + Source\CBuilder6\*.bpk - for C++Builder 6 + +To compile SDAC based applications, add SDAC Source directory path +to the "Library Path". + +Delphi for .NET +----------------- + +Run your IDE and walk through the folowing steps: + 1) Compile DAC run-time package (CoreLab.Dac.dpk) + 2) Compile DAC design-time package (CoreLab.Dac.Design.dpk) + 3) Compile SDAC run-time package (CoreLab.Sdac.dpk) + 4) Compile SDAC run-time package (CoreLab.Sdac.AdoNet.dpk) + 5) Compile and install SDAC design-time package (CoreLab.Sdac.Design.dpk) + 6) Specify the path to compiled assembles in "Assembly Search Paths" + 7) To register the MSDataAdapter component in Delphi for .Net Tool Palette, follow + these steps: + - Open Delphi for .Net and go to the "Tool Palette" window; + - Add "SDAC" category using popup menu; + - Select "Installed .NET Components..." from popup menu; + - Go to the "Installed .NET Components" tab within opened dialog; + - Check the MSDataAdapter component; + - Press the OK button. + +You can find these packages in + Source\Delphi8\*.dpk - for Delphi 8 + Source\Delphi9\*.dpk - for Delphi 2005 + Source\Delphi10\*.dpk - for Delphi 2006 + +To compile SDAC based applications, add CoreLab.Dac and CoreLab.Sdac to +Namespace prefixes, add SDAC Source directory path to the "Library Path" list. + +II. Using make-files + +Delphi and C++Builder for Win32 +-------------------------------- + + 1) Go to one of the following folders (let's denote this folder %MakePath%): + Source\Delphi5 - for Delphi 5 + Source\Delphi6 - for Delphi 6 + Source\Delphi7 - for Delphi 7 + Source\Delphi9 - for Delphi 2005 + Source\Delphi10 - for Delphi 2006 + Source\Delphi11 - for Delphi 2007 + Source\CBuilder5 - for C++Builder 5 + Source\CBuilder6 - for C++Builder 6 + + 2) Find in the 'make.bat' line containing + + set IdeDir="D:\Program Files\Borland\Delphi7 + + and make sure that correct path to IDE is set (always include forward + quote and do not include ending quote) + + 3) Run 'Make.bat'. Binaries will be copied to the %MakePath%\Sdac subfolder + 4) Copy %MakePath%\Sdac\*.bpl files to a folder that is included in the + PATH environment variable + 5) Run IDE and add dclsdacXX.bpl via Component->Install Packages... menu + 6) To compile SDAC based applications, add SDAC Source directory path + to the "Library Path" list + +Delphi for .NET +----------------- + + 1) Go to the following folders (let's denote this folder %MakePath%): + Source\Delphi8 - for Delphi 8 + Source\Delphi9 - for Delphi 2005 + Source\Delphi10 - for Delphi 2006 + + 2) Find in the 'Make.bat' line containing + + For Delphi 8: + set IdeDir="D:\Program Files\Borland\BDS\2.0 + + For Delphi 2005: + set IdeDir="D:\Program Files\Borland\BDS\3.0 + + For Delphi 2006: + set IdeDir="D:\Program Files\Borland\BDS\4.0 + + and make sure that correct path to IDE is set (always include forward + quote and do not include ending quote) + + 3) Run 'Make.bat'. Binaries will be copied to the %MakePath%\Sdac subfolder + 4) Run IDE and add CoreLab.Sdac.Design.dll via Component->Installed + .NET Components->.NET VCL Components->Add... menu. Specify the path to compiled assembles + in Component->Assembly Search Paths->Add... menu + 5) To register the MSDataAdapter component in Delphi for .Net Tool Palette, follow + these steps: + - Open Delphi for .Net and go to the "Tool Palette" window; + - Add "SDAC" category using popup menu; + - Select "Installed .NET Components..." from popup menu; + - Go to the "Installed .NET Components" tab within opened dialog; + - Press "Select an Assembly" and choose CoreLab.Sdac.AdoNet.dll + - Check MSDataAdapter component; + - Press the OK button. + 6) To compile SDAC based applications, add CoreLab.Dac and CoreLab.Sdac to + Tools->Options->Environment Options->Delphi Options->Library-> + Namespace prefixes + +If you need SDAC 1.30 source code for Delphi 4 or C++Builder 4 +please contact us. \ No newline at end of file diff --git a/internal/4.10.0.10/1/Readme.html b/internal/4.10.0.10/1/Readme.html new file mode 100644 index 0000000..f71c66c --- /dev/null +++ b/internal/4.10.0.10/1/Readme.html @@ -0,0 +1,304 @@ + + + + SQL Server Data Access Components Readme + + + + + + + + + + +
+ + + + + + + + + +
SQL Server Data Access Componentssdac@crlab.com
Readme 
+
+ +
+ + +

Product Description

+ +

+SQL Server Data Access Components (SDAC) is a library of components that provides access to the Microsoft SQL Server databases. SDAC connects to SQL Server directly through OLE DB, which is a native SQL Server interface. The SDAC library is designed to help programmers develop faster and cleaner SQL Server database applications. SDAC is a complete replacement for standard SQL Server connectivity solutions and presents an efficient alternative to the Borland Database Engine for access to SQL Server. +

+ +

Requirements

+ +

+In most cases the only OLE DB is reqired to be installed on the workstation. In the current versions of Microsoft Windows, as Windows 2000, OLE DB is already included as a standard package. But it is highly recommended to download the latest version (newer than 2.5) of Microsoft Data Access Components (MDAC) that include OLE DB at http://www.microsoft.com/data. +

+ +

Installation

+ +

+Compiled versions of SDAC are installed automatically by the SDAC Installer for all supported IDEs. Versions of SDAC with Source Code must be installed manually. For more information, see the Installation topic of the SDAC Help documentation. +

+ +

+It is important to know that ODAC, SDAC, MyDAC, and IBDAC components use the +common base packages, so product compatibility is provided for the current build only. +In the other words, if you upgrade one of the installed products, it +may conflict with older builds of other products. In order to continue using +the products simultaneously, you should upgrade all of them at the same time. +

+ +

Documentation and informational resources

+ +

+ +SDAC comes with full documentation, which includes a detailed reference for all the SDAC components and classes and set of articles +that highlight SDAC advanced functionality. +The SDAC documentation is integrated into your IDE at install time. +It can be invoked from the SQL Server menu added to the Menu Bar, or by pressing F1 in an object inspector or on a selected code segment. + +

+ +

+If you have a question regarding SDAC, look at the list of +Frequently Asked Questions or visit the SDAC forum online at +http://crlab.com/forums/viewforum.php?f=6. +

+ +

+If your problem is not covered in the documentation, FAQ, or forum, refer to the Getting Support topic in SDAC help +for information on how to contact the SDAC support team. +

+ + + +

 

 


+

© 1997-2007 Core Lab. All rights reserved.

+ +
+ + + + \ No newline at end of file diff --git a/internal/4.10.0.10/1/Sdac.GID b/internal/4.10.0.10/1/Sdac.GID new file mode 100644 index 0000000..a6ef951 Binary files /dev/null and b/internal/4.10.0.10/1/Sdac.GID differ diff --git a/internal/4.10.0.10/1/Sdac.cnt b/internal/4.10.0.10/1/Sdac.cnt new file mode 100644 index 0000000..07df52d --- /dev/null +++ b/internal/4.10.0.10/1/Sdac.cnt @@ -0,0 +1,655 @@ +:TITLE SQL Server Data Access Components +:BASE Sdac.hlp +1 SQL Server Data Access Components +2 Overview=Overview_Sdac@Sdac.hlp>Main +2 Getting Started=Getting_started@Sdac.hlp>Main +2 Features=Key_Features@Sdac.hlp>Main +2 What's New=Whatsnew@Sdac.hlp>Main +2 Demo Projects=Demos_Sdac@Sdac.hlp>Main +2 Component List=Components_Sdac@Sdac.hlp>Main +2 Hierarchy Chart=Hierarchy_Chart@Sdac.hlp>Main +2 Requirements=Requirements@Sdac.hlp>Main +2 Compatibility=Compatibility_Sdac@Sdac.hlp>Main +2 Installation=Installation_Sdac@Sdac.hlp>Main +2 Deployment=Deployment@Sdac.hlp>Main +2 Licensing and Subscriptions=Ordering@Sdac.hlp>Main +2 Getting Support=Support@Sdac.hlp>Main +2 FAQ=FAQ@Sdac.hlp>Main +2 Using SDAC +3 Updating data with SDAC dataset components=Updating_Dataset@Sdac.hlp>Main +3 Working with master/detail relationships=Work_MD@Sdac.hlp>Main +3 Migration from BDE=MigrationfromBDE@Sdac.hlp>Main +3 Migration from ADO=MigrationfromADO@Sdac.hlp>Main +3 Working with SQL Server 2005 Compact Edition=SQL_Server_Compact@Sdac.hlp>Main +3 Performance of obtaining data=Performance_SDAC@Sdac.hlp>Main +3 Working in an unstable network=Unstable_Network@Sdac.hlp>Main +3 Working with Disconnected Mode=Work_DisconnectMode@Sdac.hlp>Main +3 Increasing performance=Increasing_performance@Sdac.hlp>Main +3 Using connection pooling=Work_Pooling@Sdac.hlp>Main +3 Working with macros=Work_Macros@Sdac.hlp>Main +3 Using several DAC products in one IDE=Several_DAC_products@Sdac.hlp>Main +3 Working with DataSet Manager=Work_DataSet_Manager@Sdac.hlp>Main +3 Using DBMonitor=Using_DBMonitor@Sdac.hlp>Main +3 Using Migration Wizard=Migration_Wizard@Sdac.hlp>Main +3 Writing GUI applications with SDAC=_Runtime_Packages_Division@Sdac.hlp>Main +2 SDAC Alphabetical Object and Component Listing +3 EDAError +4 Description=EDAError@Sdac.hlp>Main +4 Properties +5 ErrorCode=EDAError_ErrorCode@Sdac.hlp>Main +3 TBlob +4 Description=TBlob@Sdac.hlp>Main +4 Properties +5 AsString=TBlob_AsString@Sdac.hlp>Main +5 AsWideString=TBlob_AsWideString@Sdac.hlp>Main +5 IsUnicode=TBlob_IsUnicode@Sdac.hlp>Main +5 Size=TBlob_Size@Sdac.hlp>Main +4 Methods +5 Assign=TBlob_Assign@Sdac.hlp>Main +5 Clear=TBlob_Clear@Sdac.hlp>Main +5 LoadFromFile=TBlob_LoadFromFile@Sdac.hlp>Main +5 LoadFromSream=TBlob_LoadFromStream@Sdac.hlp>Main +5 Read=TBlob_Read@Sdac.hlp>Main +5 SaveToFile=TBlob_SaveToFile@Sdac.hlp>Main +5 SaveToStream=TBlob_SaveToStream@Sdac.hlp>Main +5 Truncate=TBlob_Truncate@Sdac.hlp>Main +5 Write=TBlob_Write@Sdac.hlp>Main +3 TCompressedBlob +4 Description=TCompressedBlob@Sdac.hlp>Main +4 Properties +5 Compressed=TCompressedBlob_Compressed@Sdac.hlp>Main +5 CompressedSize=TCompressedBlob_CompressedSize@Sdac.hlp>Main +3 TCRBatchMove +4 Description=TCRBatchMove@Sdac.hlp>Main +4 Properties +5 AbortOnKeyViol=TCRBatchMove_AbortOnKeyViol@Sdac.hlp>Main +5 AbortOnProblem=TCRBatchMove_AbortOnProblem@Sdac.hlp>Main +5 ChangedCount=TCRBatchMove_ChangedCount@Sdac.hlp>Main +5 CommitCount=TCRBatchMove_CommitCount@Sdac.hlp>Main +5 Destination=TCRBatchMove_Destination@Sdac.hlp>Main +5 KeyViolCount=TCRBatchMove_KeyViolCount@Sdac.hlp>Main +5 Mappings=TCRBatchMove_Mappings@Sdac.hlp>Main +5 Mode=TCRBatchMove_Mode@Sdac.hlp>Main +5 MovedCount=TCRBatchMove_MovedCount@Sdac.hlp>Main +5 ProblemCount=TCRBatchMove_ProblemCount@Sdac.hlp>Main +5 RecordCount=TCRBatchMove_RecordCount@Sdac.hlp>Main +5 Source=TCRBatchMove_Source@Sdac.hlp>Main +4 Methods +5 Execute=TCRBatchMove_Execute@Sdac.hlp>Main +4 Events +5 OnBatchMoveProgress=TCRBatchMove_OnBatchMoveProgress@Sdac.hlp>Main +3 TCRDataSource +4 Description=TCRDataSource@Sdac.hlp>Main +3 TCustomConnectDialog +4 Description=TCustomConnectDialog@Sdac.hlp>Main +4 Properties +5 CancelButton=TCustomConnectDialog_Cancel@Sdac.hlp>Main +5 Caption=TCustomConnectDialog_Caption@Sdac.hlp>Main +5 ConnectButton=TCustomConnectDialog_Connect@Sdac.hlp>Main +5 DialogClass=TCustomConnectDialog_DialogCla@Sdac.hlp>Main +5 LabelSet=TCustomConnectDialog_LabelSet@Sdac.hlp>Main +5 PasswordLabel=TCustomConnectDialog_Password@Sdac.hlp>Main +5 Retries=TCustomConnectDialog_Retries@Sdac.hlp>Main +5 SavePassword=TCustomConnectDialog_SavePassw@Sdac.hlp>Main +5 ServerLabel=TCustomConnectDialog_Server@Sdac.hlp>Main +5 StoreLogInfo=TCustomConnectDialog_StoreLogI@Sdac.hlp>Main +5 UsernameLabel=TCustomConnectDialog_User@Sdac.hlp>Main +4 Methods +5 Execute=TCustomConnectDialog_Execute@Sdac.hlp>Main +5 GetServerList=TCustomConnectDialog_GetServer@Sdac.hlp>Main +3 TCustomDAConnection +4 Description=TCustomDAConnection@Sdac.hlp>Main +4 Properties +5 ConnectDialog=TCustomDAConnection_ConnectDia@Sdac.hlp>Main +5 InTransaction=TCustomDAConnection_InTransact@Sdac.hlp>Main +5 Options=TCustomDAConnection_Options@Sdac.hlp>Main +5 Password=TCustomDAConnection_Password@Sdac.hlp>Main +5 Pooling=TCustomDAConnection_Pooling@Sdac.hlp>Main +5 PoolingOptions=TCustomDAConnection_PoolingOpt@Sdac.hlp>Main +5 Server=TCustomDAConnection_Server@Sdac.hlp>Main +5 Username=TCustomDAConnection_Username@Sdac.hlp>Main +4 Methods +5 ApplyUpdates=TCustomDAConnection_ApplyUpdat@Sdac.hlp>Main +5 Commit=TCustomDAConnection_Commit@Sdac.hlp>Main +5 Connect=TCustomDAConnection_Connect@Sdac.hlp>Main +5 CreateDataSet=TCustomDAConnection_CreateData@Sdac.hlp>Main +5 CreateSQL=TCustomDAConnection_CreateSQL@Sdac.hlp>Main +5 Disconnect=TCustomDAConnection_Disconnect@Sdac.hlp>Main +5 ExecSQL=TCustomDAConnection_ExecSQL@Sdac.hlp>Main +5 GetDatabaseNames=TCustomDAConnection_GetDbNames@Sdac.hlp>Main +5 GetTableNames=TCustomDAConnection_GetTNames@Sdac.hlp>Main +5 GetStoredProcNames=TCustomDAConnection_GetSPNames@Sdac.hlp>Main +5 MonitorMessage=TCustomDAConnection_MonitorMessage@Sdac.hlp>Main +5 RemoveFromPool=TCustomDAConnection_RemoveFromPool@Sdac.hlp>Main +5 Rollback=TCustomDAConnection_Rollback@Sdac.hlp>Main +5 StartTransaction=TCustomDAConnection_StartTrans@Sdac.hlp>Main +4 Events +5 OnError=TCustomDAConnection_OnError@Sdac.hlp>Main +5 OnConnectionLost=TCustomDAConnection_OnConnectionLost@Sdac.hlp>Main +3 DADataAdapter +4 Description=DADataAdapter@Sdac.hlp>Main +4 Properties +5 DataSet=DADataAdapter_DataSet@Sdac.hlp>Main +4 Methods +5 Fill=DADataAdapter_Fill@Sdac.hlp>Main +5 Update=DADataAdapter_Update@Sdac.hlp>Main +3 TCustomDADataSet +4 Description=TCustomDADataSet@Sdac.hlp>Main +4 Properties +5 AutoCommit=TCustomDADataSet_AutoCommit@Sdac.hlp>Main +5 BaseSQL=TCustomDADataSet_BaseSQL@Sdac.hlp>Main +5 Connection=TCustomDADataSet_Connection@Sdac.hlp>Main +5 Debug=TCustomDADataSet_Debug@Sdac.hlp>Main +5 DetailFields=TCustomDADataSet_DetailFields@Sdac.hlp>Main +5 FetchAll=TCustomDADataSet_FetchAll@Sdac.hlp>Main +5 FetchRows=TCustomDADataSet_FetchRows@Sdac.hlp>Main +5 FilterSQL=TCustomDADataSet_FilterSQL@Sdac.hlp>Main +5 FinalSQL=TCustomDADataSet_FinalSQL@Sdac.hlp>Main +5 IsQuery=TCustomDADataSet_IsQuery@Sdac.hlp>Main +5 MacroCount=TCustomDADataSet_MacroCount@Sdac.hlp>Main +5 Macros=TCustomDADataSet_Macros@Sdac.hlp>Main +5 MasterFields=TCustomDADataSet_MasterFields@Sdac.hlp>Main +5 MasterSource=TCustomDADataSet_MasterSource@Sdac.hlp>Main +5 Options=TCustomDADataSet_Options@Sdac.hlp>Main +5 ParamCheck=TCustomDADataSet_ParamCheck@Sdac.hlp>Main +5 ParamCount=TCustomDADataSet_ParamCount@Sdac.hlp>Main +5 Params=TCustomDADataSet_Params@Sdac.hlp>Main +5 ReadOnly=TCustomDADataSet_ReadOnly@Sdac.hlp>Main +5 RefreshOptions=TCustomDADataSet_RefreshOption@Sdac.hlp>Main +5 RowsAffected=TCustomDADataSet_RowsAffected@Sdac.hlp>Main +5 SQL=TCustomDADataSet_SQL@Sdac.hlp>Main +5 SQLDelete=TCustomDADataSet_SQLDelete@Sdac.hlp>Main +5 SQLInsert=TCustomDADataSet_SQLInsert@Sdac.hlp>Main +5 SQLRefresh=TCustomDADataSet_SQLRefresh@Sdac.hlp>Main +5 SQLUpdate=TCustomDADataSet_SQLUpdate@Sdac.hlp>Main +5 UniDirectional=TCustomDADataSet_UniDirectiona@Sdac.hlp>Main +5 UpdateObject=TCustomDADataSet_UpdateObject@Sdac.hlp>Main +4 Methods +5 AddWhere=TCustomDADataSet_AddWhere@Sdac.hlp>Main +5 DeleteWhere=TCustomDADataSet_DeleteWhere@Sdac.hlp>Main +5 Execute=TCustomDADataSet_Execute@Sdac.hlp>Main +5 Executing=TCustomDADataSet_Executing@Sdac.hlp>Main +5 Fetched=TCustomDADataSet_Fetched@Sdac.hlp>Main +5 Fetching=TCustomDADataSet_Fetching@Sdac.hlp>Main +5 FetchingAll=TCustomDADataSet_FetchingAll@Sdac.hlp>Main +5 FindKey=TCustomDADataSet_FindKey@Sdac.hlp>Main +5 FindMacro=TCustomDADataSet_FindMacro@Sdac.hlp>Main +5 FindNearest=TCustomDADataSet_FindNearest@Sdac.hlp>Main +5 FindParam=TCustomDADataSet_FindParam@Sdac.hlp>Main +5 GetDataType=TCustomDADataSet_GetDataType@Sdac.hlp>Main +5 GetFieldObject=TCustomDADataSet_GetFieldObjec@Sdac.hlp>Main +5 GetFieldPrecision=TCustomDADataSet_GetFieldPreci@Sdac.hlp>Main +5 GetFieldScale=TCustomDADataSet_GetFieldScale@Sdac.hlp>Main +5 GetOrderBy=TCustomDADataSet_GetOrderBy@Sdac.hlp>Main +5 GotoCurrent=TCustomDADataSet_GotoCurrent@Sdac.hlp>Main +5 MacroByName=TCustomDADataSet_MacroByName@Sdac.hlp>Main +5 ParamByName=TCustomDADataSet_ParamByName@Sdac.hlp>Main +5 Prepare=TCustomDADataSet_Prepare@Sdac.hlp>Main +5 RefreshRecord=TCustomDADataSet_RefreshRecord@Sdac.hlp>Main +5 RestoreSQL=TCustomDADataSet_RestoreSQL@Sdac.hlp>Main +5 SaveSQL=TCustomDADataSet_SaveSQL@Sdac.hlp>Main +5 SetOrderBy=TCustomDADataSet_SetOrderBy@Sdac.hlp>Main +5 SQLSaved=TCustomDADataSet_SQLSaved@Sdac.hlp>Main +4 Events +5 AfterExecute=TCustomDADataSet_AfterExecute@Sdac.hlp>Main +5 AfterFetch=TCustomDADataSet_AfterFetch@Sdac.hlp>Main +5 AfterUpdateExecute=TCustomDADataSet_AfterUpdateEx@Sdac.hlp>Main +5 BeforeFetch=TCustomDADataSet_BeforeFetch@Sdac.hlp>Main +5 BeforeUpdateExecute=TCustomDADataSet_BeforeUpdateE@Sdac.hlp>Main +3 TCustomDASQL +4 Description=TCustomDASQL@Sdac.hlp>Main +4 Properties +5 AutoCommit=TCustomDASQL_AutoCommit@Sdac.hlp>Main +5 Connection=TcustomDASQL_Connection@Sdac.hlp>Main +5 Debug=TCustomDASQL_Debug@Sdac.hlp>Main +5 FinalSQL=TCustomDASQL_FinalSQL@Sdac.hlp>Main +5 MacroCount=TCustomDASQL_MacroCount@Sdac.hlp>Main +5 Macros=TCustomDASQL_Macros@Sdac.hlp>Main +5 ParamCheck=TCustomDASQL_ParamCheck@Sdac.hlp>Main +5 ParamCount=TCustomDASQL_ParamCount@Sdac.hlp>Main +5 Params=TCustomDASQL_Params@Sdac.hlp>Main +5 ParamValues=TCustomDASQL_ParamValues@Sdac.hlp>Main +5 Prepared=TCustomDASQL_Prepared@Sdac.hlp>Main +5 RowsAffected=TCustomDASQL_RowsAffected@Sdac.hlp>Main +5 SQL=TCustomDASQL_SQL@Sdac.hlp>Main +4 Methods +5 Execute=TCustomDASQL_Execute@Sdac.hlp>Main +5 Executing=TCustomDASQL_Executing@Sdac.hlp>Main +5 FindMacro=TCustomDASQL_FindMacro@Sdac.hlp>Main +5 FindParam=TCustomDASQL_FindParam@Sdac.hlp>Main +5 MacroByName=TCustomDASQL_MacroByName@Sdac.hlp>Main +5 ParamByName=TCustomDASQL_ParamByName@Sdac.hlp>Main +5 Prepare=TCustomDASQL_Prepare@Sdac.hlp>Main +5 UnPrepare=TCustomDASQL_UnPrepare@Sdac.hlp>Main +5 WaitExecuting=TCustomDASQL_WaitExecuting@Sdac.hlp>Main +4 Events +5 AfterExecute=TCustomDASQL_AfterExecute@Sdac.hlp>Main +3 TCustomDASQLMonitor +4 Description=TCustomDASQLMonitor@Sdac.hlp>Main +4 Properties +5 Active=TCustomDASQLMonitor_Active@Sdac.hlp>Main +5 Options=TCustomDASQLMonitor_Options@Sdac.hlp>Main +5 TraceFlags=TCustomDASQLMonitor_TraceFlags@Sdac.hlp>Main +4 Events +5 OnSQL=TCustomDASQLMonitor_OnSQL@Sdac.hlp>Main +3 TCustomDAUpdateSQL +4 Description=TCustomDAUpdateSQL@Sdac.hlp>Main +4 Properties +5 Dataset=TCustomDAUpdateSQL_Dataset@Sdac.hlp>Main +5 DeleteObject=TCustomDAUpdateSQL_DeleteObject@Sdac.hlp>Main +5 DeleteSQL=TCustomDAUpdateSQL_DeleteSQL@Sdac.hlp>Main +5 InsertObject=TCustomDAUpdateSQL_InsertObject@Sdac.hlp>Main +5 InsertSQL=TCustomDAUpdateSQL_InsertSQL@Sdac.hlp>Main +5 ModifyObject=TCustomDAUpdateSQL_ModifyObject@Sdac.hlp>Main +5 ModifySQL=TCustomDAUpdateSQL_ModifySQL@Sdac.hlp>Main +5 RefreshObject=TCustomDAUpdateSQL_RefreshObject@Sdac.hlp>Main +5 RefreshSQL=TCustomDAUpdateSQL_RefreshSQL@Sdac.hlp>Main +5 SQL=TCustomDAUpdateSQL_SQL@Sdac.hlp>Main +4 Methods +5 Apply=TCustomDAUpdateSQL_Apply@Sdac.hlp>Main +5 ExecSQL=TCustomDAUpdateSQL_ExecSQL@Sdac.hlp>Main +3 TDAColumn +4 Description=TDAColumn@Sdac.hlp>Main +4 Properties +5 DataType=TDAColumn_DataType@Sdac.hlp>Main +5 FieldType=TDAColumn_FieldType@Sdac.hlp>Main +5 Name=TDAColumn_Name@Sdac.hlp>Main +3 TDAColumns +4 Description=TDAColumns@Sdac.hlp>Main +4 Properties +5 Items=TDAColumns_Items@Sdac.hlp>Main +3 TDADump +4 Description=TDADump@Sdac.hlp>Main +4 Properties +5 Connection=TDADump_Connection@Sdac.hlp>Main +5 Debug=TDADump_Debug@Sdac.hlp>Main +5 Options=TDADump_Options@Sdac.hlp>Main +5 SQL=TDADump_SQL@Sdac.hlp>Main +5 TableNames=TDADump_TableNames@Sdac.hlp>Main +4 Methods +5 Backup=TDADump_Backup@Sdac.hlp>Main +5 BackupQuery=TDADump_BackupQuery@Sdac.hlp>Main +5 BackupToFile=TDADump_BackupToFile@Sdac.hlp>Main +5 BackupToStream=TDADump_BackupToStream@Sdac.hlp>Main +5 Restore=TDADump_Restore@Sdac.hlp>Main +5 RestoreFromFile=TDADump_RestoreFromFile@Sdac.hlp>Main +5 RestoreFromStream=TDADump_RestoreFromStream@Sdac.hlp>Main +4 Events +5 OnBackupProgress=TDADump_OnBackupProgress@Sdac.hlp>Main +5 OnRestoreProgress=TDADump_OnRestoreProgress@Sdac.hlp>Main +3 TDALoader +4 Description=TDALoader@Sdac.hlp>Main +4 Properties +5 Columns=TDALoader_Columns@Sdac.hlp>Main +5 Connection=TDALoader_Connection@Sdac.hlp>Main +5 TableName=TDALoader_TableName@Sdac.hlp>Main +4 Methods +5 CreateColumns=TDALoader_CreateColumns@Sdac.hlp>Main +5 Load=TDALoader_Load@Sdac.hlp>Main +5 LoadFromDataSet=TDALoader_LoadFromDataSet@Sdac.hlp>Main +5 PutColumnData=TDALoader_PutColumnData@Sdac.hlp>Main +4 Events +5 OnGetColumnData=TDALoader_OnGetColumnData@Sdac.hlp>Main +5 OnPutData=TDALoader_OnPutData@Sdac.hlp>Main +3 TDAParam +4 Description=TDAParam@Sdac.hlp>Main +4 Properties +5 AsBlob=TDAParam_AsBlob@Sdac.hlp>Main +5 AsBlobRef=TDAParam_AsBlobRef@Sdac.hlp>Main +5 AsFloat=TDAParam_AsFloat@Sdac.hlp>Main +5 AsInteger=TDAParam_AsInteger@Sdac.hlp>Main +5 AsMemo=TDAParam_AsMemo@Sdac.hlp>Main +5 AsMemoRef=TDAParam_AsMemoRef@Sdac.hlp>Main +5 AsString=TDAParam_AsString@Sdac.hlp>Main +5 AsWideString=TDAParam_AsWideString@Sdac.hlp>Main +5 DataType=TDAParam_DataType@Sdac.hlp>Main +5 IsNull=TDAParam_IsNull@Sdac.hlp>Main +5 ParamType=TDAParam_ParamType@Sdac.hlp>Main +5 Size=TDAParam_Size@Sdac.hlp>Main +5 Value=TDAParam_Value@Sdac.hlp>Main +4 Methods +5 LoadFromFile=TDAParam_LoadFromFile@Sdac.hlp>Main +5 LoadFromStream=TDAParam_LoadFromStream@Sdac.hlp>Main +3 TDAParams +4 Description=TDAParams@Sdac.hlp>Main +4 Properties +5 Items=TDAParams_Items@Sdac.hlp>Main +4 Methods +5 FindParam=TDAParams_FindParam@Sdac.hlp>Main +5 ParamByName=TDAParams_ParamByName@Sdac.hlp>Main +3 TDAScript +4 Description=TDAScript@Sdac.hlp>Main +4 Properties +5 Debug=TDAScript_Debug@Sdac.hlp>Main +5 Delimiter=TDAScript_Delimiter@Sdac.hlp>Main +5 EndLine=TDAScript_EndLine@Sdac.hlp>Main +5 EndOffset=TDAScript_EndOffset@Sdac.hlp>Main +5 EndPos=TDAScript_EndPos@Sdac.hlp>Main +5 Macros=TDAScript_Macros@Sdac.hlp>Main +5 SQL=TDAScript_SQL@Sdac.hlp>Main +5 StartLine=TDAScript_StartLine@Sdac.hlp>Main +5 StartOffset=TDAScript_StartOffset@Sdac.hlp>Main +5 StartPos=TDAScript_StartPos@Sdac.hlp>Main +5 Statements=TDAScript_Statements@Sdac.hlp>Main +4 Methods +5 BreakExec=TDAScript_BreakExec@Sdac.hlp>Main +5 ErrorOffset=TDAScript_ErrorOffset@Sdac.hlp>Main +5 Execute=TDAScript_Execute@Sdac.hlp>Main +5 ExecuteFile=TDAScript_ExecuteFile@Sdac.hlp>Main +5 ExecuteNext=TDAScript_ExecuteNext@Sdac.hlp>Main +5 ExecuteStream=TDAScript_ExecuteStream@Sdac.hlp>Main +5 FindMacro=TDAScript_FindMacro@Sdac.hlp>Main +5 MacroByName=TDAScript_MacroByName@Sdac.hlp>Main +4 Events +5 AfterExecute=TDAScript_AfterExecute@Sdac.hlp>Main +5 BeforeExecute=TDAScript_BeforeExecute@Sdac.hlp>Main +5 OnError=TDAScript_OnError@Sdac.hlp>Main +3 TDAStatement +4 Description=TDAStatement@Sdac.hlp>Main +4 Properties +5 EndOffset=TDAStatement_EndOffset@Sdac.hlp>Main +5 EndPos=TDAStatement_EndPos@Sdac.hlp>Main +5 Omit=TDAStatement_Omit@Sdac.hlp>Main +5 Params=TDAStatement_Params@Sdac.hlp>Main +5 SQL=TDAStatement_SQL@Sdac.hlp>Main +5 StartOffset=TDAStatement_StartOffset@Sdac.hlp>Main +5 StartPos=TDAStatement_StartPos@Sdac.hlp>Main +4 Methods +5 Execute=TDAStatement_Execute@Sdac.hlp>Main +3 TDAStatements +4 Description=TDAStatements@Sdac.hlp>Main +4 Properties +5 Items=TDAStatements_Items@Sdac.hlp>Main +3 TMacro +4 Description=TMacro@Sdac.hlp>Main +4 Properties +5 Active=TMacro_Active@Sdac.hlp>Main +5 AsDateTime=TMacro_AsDateTime@Sdac.hlp>Main +5 AsFloat=TMacro_AsFloat@Sdac.hlp>Main +5 AsInteger=TMacro_AsInteger@Sdac.hlp>Main +5 AsString=TMacro_AsString@Sdac.hlp>Main +5 Name=TMacro_Name@Sdac.hlp>Main +5 Value=TMacro_Value@Sdac.hlp>Main +3 TMacros +4 Description=TMacros@Sdac.hlp>Main +4 Properties +5 Count=TMacros_Count@Sdac.hlp>Main +5 Items=TMacros_Items@Sdac.hlp>Main +4 Methods +5 FindMacro=TMacros_FindMacro@Sdac.hlp>Main +5 MacroByName=TMacros_MacroByName@Sdac.hlp>Main +3 TMemDataSet +4 Description=TMemDataSet@Sdac.hlp>Main +4 Properties +5 CachedUpdates=TMemDataSet_CachedUpdates@Sdac.hlp>Main +5 IndexFieldNames=TMemDataSet_IndexFieldNames@Sdac.hlp>Main +5 LocalConstraints=TMemDataSet_LocalConstraints@Sdac.hlp>Main +5 LocalUpdate=TMemDataSet_LocalUpdate@Sdac.hlp>Main +5 Prepared=TMemDataSet_Prepared@Sdac.hlp>Main +5 UpdateRecordTypes=TMemDataSet_UpdateRecordTypes@Sdac.hlp>Main +5 UpdatesPending=TMemDataSet_UpdatesPending@Sdac.hlp>Main +4 Methods +5 ApplyUpdates=TMemDataSet_ApplyUpdates@Sdac.hlp>Main +5 CancelUpdates=TMemDataSet_CancelUpdates@Sdac.hlp>Main +5 CommitUpdates=TMemDataSet_CommitUpdates@Sdac.hlp>Main +5 DeferredPost=TMemDataSet_DeferredPost@Sdac.hlp>Main +5 GetBlob=TMemDataSet_GetBlob@Sdac.hlp>Main +5 Locate=TMemDataSet_Locate@Sdac.hlp>Main +5 LocateEx=TMemDataSet_LocateEx@Sdac.hlp>Main +5 Prepare=TMemDataSet_Prepare@Sdac.hlp>Main +5 RestoreUpdates=TMemDataSet_RestoreUpdates@Sdac.hlp>Main +5 RevertRecord=TMemDataSet_RevertRecord@Sdac.hlp>Main +5 SaveToXML=TMemDataSet_SaveToXML@Sdac.hlp>Main +5 UnPrepare=TMemDataSet_UnPrepare@Sdac.hlp>Main +5 UpdateResult=TMemDataSet_UpdateResult@Sdac.hlp>Main +5 UpdateStatus=TMemDataSet_UpdateStatus@Sdac.hlp>Main +4 Events +5 OnUpdateError=TMemDataSet_OnUpdateError@Sdac.hlp>Main +5 OnUpdateRecord=TMemDataSet_OnUpdateRecord@Sdac.hlp>Main +3 TSharedObject +4 Description=TSharedObject@Sdac.hlp>Main +4 Properties +5 RefCount=TSharedObject_RefCount@Sdac.hlp>Main +4 Methods +5 AddRef=TSharedObject_AddRef@Sdac.hlp>Main +5 Release=TSharedObject_Release@Sdac.hlp>Main +3 TVirtualTable +4 Description=TVirtualTable@Sdac.hlp>Main +4 Properties +5 Options=TVirtualTable_Options@Sdac.hlp>Main +4 Methods +5 AddField=TVirtualTable_AddField@Sdac.hlp>Main +5 Assign=TVirtualTable_Assign@Sdac.hlp>Main +5 Clear=TVirtualTable_Clear@Sdac.hlp>Main +5 DeleteField=TVirtualTable_DeleteField@Sdac.hlp>Main +5 DeleteFields=TVirtualTable_DeleteFields@Sdac.hlp>Main +5 LoadFromFile=TVirtualTable_LoadFromFile@Sdac.hlp>Main +5 LoadFromStream=TVirtualTable_LoadFromStream@Sdac.hlp>Main +5 SaveToFile=TVirtualTable_SaveToFile@Sdac.hlp>Main +5 SaveToStream=TVirtualTable_SaveToStream@Sdac.hlp>Main +3 EMSError +4 Description=EMSError@Sdac.hlp>Main +4 Properties +5 ErrorCode=EMSError_ErrorCode@Sdac.hlp>Main +5 LastMessage=EMSError_LastMessage@Sdac.hlp>Main +5 LineNumber=EMSError_LineNumber@Sdac.hlp>Main +5 MSSQLErrorCode=EMSError_MSSQLErrorCode@Sdac.hlp>Main +5 ProcName=EMSError_ProcName@Sdac.hlp>Main +5 ServerName=EMSError_ServerName@Sdac.hlp>Main +5 SeverityClass=EMSError_SeverityClass@Sdac.hlp>Main +5 State=EMSError_State@Sdac.hlp>Main +3 EOLEDBError +4 Description=EOLEDBError@Sdac.hlp>Main +4 Properties +5 ErrorCode=EOLEDBError_ErrorCode@Sdac.hlp>Main +5 ErrorCount=EOLEDBError_ErrorCount@Sdac.hlp>Main +5 Errors=EOLEDBError_Errors@Sdac.hlp>Main +5 MessageWide=EOLEDBError_MessageWide@Sdac.hlp>Main +5 OLEDBErrorCode=EOLEDBError_OLEDBErrorCode@Sdac.hlp>Main +3 TCustomMSDataSet +4 Description=TCustomMSDataSet@Sdac.hlp>Main +4 Properties +5 CommandTimeout=TCustomMSDataSet_CommandTimeou@Sdac.hlp>Main +5 Connection=TCustomMSDataSet_Connection@Sdac.hlp>Main +5 CursorType=TCustomMSDataset_CursorType@Sdac.hlp>Main +5 Options=TCustomMSDataSet_Options@Sdac.hlp>Main +5 Params=TCustomMSDataSet_Params@Sdac.hlp>Main +5 PermitPrepare=TCustomMSDataSet_PermitPrepare@Sdac.hlp>Main +5 SQLDelete=TCustomMSDataSet_SQLDelete@Sdac.hlp>Main +5 SQLInsert=TCustomMSDataSet_SQLInsert@Sdac.hlp>Main +5 SQLRefresh=TCustomMSDataSet_SQLRefresh@Sdac.hlp>Main +5 SQLUpdate=TCustomMSDataSet_SQLUpdate@Sdac.hlp>Main +4 Methods +5 BreakExec=TCustomMSDataSet_BreakExec@Sdac.hlp>Main +5 FindParam=TCustomMSDataSet_FindParam@Sdac.hlp>Main +5 LockRecord=TCustomMSDataSet_LockRecord@Sdac.hlp>Main +5 LockTable=TCustomMSDataSet_LockTable@Sdac.hlp>Main +5 OpenNext=TCustomMSDataSet_OpenNext@Sdac.hlp>Main +5 ParamByName=TCustomMSDataSet_ParamByName@Sdac.hlp>Main +5 Prepare=TCustomMSDataSet_Prepare@Sdac.hlp>Main +5 RefreshQuick=TCustomMSDataSet_RefreshQuick@Sdac.hlp>Main +3 TCustomMSStoredProc +4 Description=TCustomMSStoredProc@Sdac.hlp>Main +4 Properties +5 StoredProcName=TCustomMSStoredProc_StoredProc@Sdac.hlp>Main +5 UpdatingTable=TCustomMSStoredProc_UpdatingTa@Sdac.hlp>Main +4 Methods +5 ExecProc=TCustomMSStoredProc_ExecProc@Sdac.hlp>Main +5 PrepareSQL=TCustomMSStoredProc_PrepareSQL@Sdac.hlp>Main +3 TCustomMSTable +4 Description=TCustomMSTable@Sdac.hlp>Main +4 Properties +5 OrderFields=TCustomMSTable_OrderFields@Sdac.hlp>Main +5 TableName=TCustomMSTable_TableName@Sdac.hlp>Main +4 Methods +5 PrepareSQL=TCustomMSTable_PrepareSQL@Sdac.hlp>Main +3 TMSColumn +4 Description=TMSColumn@Sdac.hlp>Main +4 Properties +5 Precision=TMSColumn_Precision@Sdac.hlp>Main +5 Scale=TMSColumn_Scale@Sdac.hlp>Main +5 Size=TMSColumn_Size@Sdac.hlp>Main +3 TMSConnectDialog +4 Description=TMSConnectDialog@Sdac.hlp>Main +4 Properties +5 Connection=TMSConnectDialog_Connection@Sdac.hlp>Main +4 Methods +5 GetServerList=TMSConnectDialog_GetServerList@Sdac.hlp>Main +3 TMSConnection +4 Description=TMSConnection@Sdac.hlp>Main +4 Properties +5 Authentication=TMSConnection_Authentication@Sdac.hlp>Main +5 ClientVersion=TMSConnection_ClientVersion@Sdac.hlp>Main +5 ConnectionTimeout=TMSConnection_ConnectionTimeou@Sdac.hlp>Main +5 ConnectString=TMSConnection_ConnectString@Sdac.hlp>Main +5 Database=TMSConnection_Database@Sdac.hlp>Main +5 IsolationLevel=TMSConnection_IsolationLevel@Sdac.hlp>Main +5 Options=TMSConnection_Options@Sdac.hlp>Main +5 QuotedIdentifier=TMSConnection_QuotedIdentifier@Sdac.hlp>Main +5 ServerVersion=TMSConnection_ServerVersion@Sdac.hlp>Main +4 Methods +5 CreateDataSet=TMSConnection_CreateDataSet@Sdac.hlp>Main +5 CreateSQL=TMSConnection_CreateSQL@Sdac.hlp>Main +5 ExecSQL=TMSConnection_ExecSQL@Sdac.hlp>Main +4 Events +5 OnInfoMessage=TMSConnection_OnInfoMessageE@Sdac.hlp>Main +3 TMSConnectionPoolManager +4 Description=TMSConnectionPoolManager@Sdac.hlp>Main +4 Methods +5 AsyncClear=TMSConnectionPoolManager_AsyncClear@Sdac.hlp>Main +5 Clear=TMSConnectionPoolManager_Clear@Sdac.hlp>Main +3 MSDataAdapter +4 Description=MSDataAdapter@Sdac.hlp>Main +3 TMSConversation +4 Description=TMSConversation@Sdac.hlp>Main +4 Properties +5 ContractName=TMSConversation_ContractName@Sdac.hlp>Main +5 FarService=TMSConversation_FarService@Sdac.hlp>Main +5 GroupId=TMSConversation_GroupId@Sdac.hlp>Main +5 Handle=TMSConversation_Handle@Sdac.hlp>Main +5 IsInitiator=TMSConversation_IsInitiator@Sdac.hlp>Main +5 ServiceBroker=TMSConversation_ServiceBroker@Sdac.hlp>Main +4 Methods +5 BeginTimer=TMSConversation_BeginTimer@Sdac.hlp>Main +5 EndConversation=TMSConversation__EndConversation@Sdac.hlp>Main +5 EndConversationWithError=TMSConversation_EndConvWError@Sdac.hlp>Main +5 GetTransmissionStatus=TMSConversation_GetTransmissionStatus@Sdac.hlp>Main +5 Send=TMSConversation_Send@Sdac.hlp>Main +5 SendEmpty=TMSConversation_SendEmpty@Sdac.hlp>Main +3 TMSDataSource +4 Description=TMSDataSource@Sdac.hlp>Main +3 TMSDump +4 Description=TMSDump@Sdac.hlp>Main +4 Properties +5 Connection=TMSDump_Connection@Sdac.hlp>Main +5 Options=TMSDump_Options@Sdac.hlp>Main +3 TMSMessage +4 Description=TMSMessage@Sdac.hlp>Main +4 Properties +5 AsBytes=TMSMessage_AsBytes@Sdac.hlp>Main +5 AsString=TMSMessage_AsString@Sdac.hlp>Main +5 AsWideString=TMSMessage_AsWideString@Sdac.hlp>Main +5 Conversation=TMSMessage_Conversation@Sdac.hlp>Main +5 IsEmpty=TMSMessage_IsEmpty@Sdac.hlp>Main +5 MessageId=TMSMessage_MessageId@Sdac.hlp>Main +5 MessageSequenceNumber=TMSMessage_MessageSequenceNumber@Sdac.hlp>Main +5 MessageType=TMSMessage_MessageType@Sdac.hlp>Main +5 QueuingOrder=TMSMessage_QueuingOrder@Sdac.hlp>Main +5 Validation=TMSMessage_Validation@Sdac.hlp>Main +3 TMSLoader +4 Description=TMSLoader@Sdac.hlp>Main +4 Properties +5 Connection=TMSLoader_Connection@Sdac.hlp>Main +5 KeepIdentity=TMSLoader_KeepIdentity@Sdac.hlp>Main +5 KeepNulls=TMSLoader_KeepNulls@Sdac.hlp>Main +5 Options=TMSLoader_Options@Sdac.hlp>Main +4 Events +5 OnGetColumnData=TMSLoader_OnGetColumnData@Sdac.hlp>Main +5 OnPutData=TMSLoader_OnPutData@Sdac.hlp>Main +3 TMSMetadata +4 Description=TMSMetadata@Sdac.hlp>Main +4 Properties +5 AssemblyID=TMSMetadata_AssemblyID@Sdac.hlp>Main +5 AssemblyName=TMSMetadata_AssemblyName@Sdac.hlp>Main +5 ColumnName=TMSMetadata_ColumnName@Sdac.hlp>Main +5 ConstraintName=TMSMetadata_ConstraintName@Sdac.hlp>Main +5 DatabaseName=TMSMetadata_DatabaseName@Sdac.hlp>Main +5 IndexName=TMSMetadata_IndexName@Sdac.hlp>Main +5 LinkedServer=TMSMetadata_LinkedServer@Sdac.hlp>Main +5 ObjectType=TMSMetadata_ObjectType@Sdac.hlp>Main +5 ReferencedAssemblyID=TMSMetadata_ReferencedAssemblyID@Sdac.hlp>Main +5 SchemaCollectionName=TMSMetadata_SchemaCollectionName@Sdac.hlp>Main +5 SchemaName=TMSMetadata_SchemaName@Sdac.hlp>Main +5 StoredProcName=TMSMetadata_StoredProcName@Sdac.hlp>Main +5 TableName=TMSMetadata_TableName@Sdac.hlp>Main +5 TargetNamespaceURI=TMSMetadata_TargetNamespaceURI@Sdac.hlp>Main +5 UDTName=TMSMetadata_UDTName@Sdac.hlp>Main +3 TMSParam +4 Description=TMSParam@Sdac.hlp>Main +4 Properties +5 Size=TMSParam_Size@Sdac.hlp>Main +3 TMSParams +4 Description=TMSParams@Sdac.hlp>Main +3 TMSServiceBroker +4 Description=TMSServiceBroker@Sdac.hlp>Main +4 Properties +5 AsyncNotification=TMSServiceBroker_AsyncNotification@Sdac.hlp>Main +5 Connection=TMSServiceBroker_Connection@Sdac.hlp>Main +5 ConversationCount=TMSServiceBroker_ConversationCount@Sdac.hlp>Main +5 Conversations=TMSServiceBroker_Conversations@Sdac.hlp>Main +5 CurrentMessage=TMSServiceBroker_CurrentMess@Sdac.hlp>Main +5 FetchRows=TMSServiceBroker_FetchRows@Sdac.hlp>Main +5 Queue=TMSServiceBroker_Queue@Sdac.hlp>Main +5 Service=TMSServiceBroker_Service@Sdac.hlp>Main +5 WaitTimeout=TMSServiceBroker_WaitTimeout@Sdac.hlp>Main +4 Methods +5 BeginDialog=TMSServiceBroker_BeginDialog@Sdac.hlp>Main +5 CreateServerObjects=TMSServiceBroker_CreateServerObjects@Sdac.hlp>Main +5 DropServerObjects=TMSServiceBroker_DropServerObjects@Sdac.hlp>Main +5 GetContractNames=TMSServiceBroker_GetContractNames@Sdac.hlp>Main +5 GetMessageTypeNames=TMSServiceBroker_GetMessageTypeNames@Sdac.hlp>Main +5 GetQueueNames=TMSServiceBroker_GetQueueNames@Sdac.hlp>Main +5 GetServiceNames=TMSServiceBroker_GetServiceNames@Sdac.hlp>Main +5 Receive=TMSServiceBroker_Receive@Sdac.hlp>Main +4 Events +5 OnBeginConversation=TMSServiceBroker_OnBeginConversation@Sdac.hlp>Main +5 OnEndConversation=TMSServiceBroker_OnEndConversation@Sdac.hlp>Main +5 OnMessage=TMSServiceBroker_OnMessage@Sdac.hlp>Main +3 TMSQuery +4 Description=TMSQuery@Sdac.hlp>Main +4 Properties +5 UpdatingTable=TMSQuery_UpdatingTable@Sdac.hlp>Main +3 TMSScript +4 Description=TMSScript@Sdac.hlp>Main +4 Properties +5 Connection=TMSScript_Connection@Sdac.hlp>Main +5 DataSet=TMSScript_DataSet@Sdac.hlp>Main +5 UseOptimisation=TMSScript_UseOptimization@Sdac.hlp>Main +3 TMSSQL +4 Description=TMSSQL@Sdac.hlp>Main +4 Properties +5 CommandTimeout=TMSSQL_CommandTimeout@Sdac.hlp>Main +5 Connection=TMSSQL_Connection@Sdac.hlp>Main +5 NonBlocking=TMSSQL_NonBlocking@Sdac.hlp>Main +5 Params=TMSSQL_Params@Sdac.hlp>Main +5 PermitPrepare=TMSSQL_PermitPrepare@Sdac.hlp>Main +4 Methods +5 BreakExec=TMSSQL_BreakExec@Sdac.hlp>Main +5 ExecuteForXML=TMSSQL_ExecuteForXML@Sdac.hlp>Main +5 FindParam=TMSSQL_FindParam@Sdac.hlp>Main +5 ParamByName=TMSSQL_ParamByName@Sdac.hlp>Main +5 Prepare=TMSSQL_Prepare@Sdac.hlp>Main +3 TMSSQLMonitor +4 Description=TMSSQLMonitor@Sdac.hlp>Main +3 TMSStoredProc +4 Description=TMSStoredProc@Sdac.hlp>Main +3 TMSTable +4 Description=TMSTable@Sdac.hlp>Main +3 TMSUpdateSQL +4 Description=TMSUpdateSQL@Sdac.hlp>Main +3 TMSXMLField +4 Description=TMSXMLField@Sdac.hlp>Main +4 Properties +5 SchemaCollection=TMSXMLField_SchemaCollection@Sdac.hlp>Main +5 Typed=TMSXMLField_Typed@Sdac.hlp>Main +5 XML=TMSXMLField_XML@Sdac.hlp>Main diff --git a/internal/4.10.0.10/1/Sdac.hlp b/internal/4.10.0.10/1/Sdac.hlp new file mode 100644 index 0000000..8e167ce Binary files /dev/null and b/internal/4.10.0.10/1/Sdac.hlp differ diff --git a/internal/4.10.0.10/1/Source/CBuilder5/Make.bat b/internal/4.10.0.10/1/Source/CBuilder5/Make.bat new file mode 100644 index 0000000..d9e6825 --- /dev/null +++ b/internal/4.10.0.10/1/Source/CBuilder5/Make.bat @@ -0,0 +1,10 @@ +@echo off +rem ********************************************************************** +rem * +rem * Sdac for CBuilder 5 +rem * +rem ********************************************************************** + +set IdeDir="D:\Program Files\Borland\CBuilder5 +del /Q/S SDAC\*.* +call ..\Make.bat CBuilder 5 diff --git a/internal/4.10.0.10/1/Source/CBuilder5/dac50.bpk b/internal/4.10.0.10/1/Source/CBuilder5/dac50.bpk new file mode 100644 index 0000000..bb0de70 --- /dev/null +++ b/internal/4.10.0.10/1/Source/CBuilder5/dac50.bpk @@ -0,0 +1,139 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=6 +MinorVer=10 +Release=1 +Build=10 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName=Core Lab +FileDescription= +FileVersion=6.10.1.10 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName=DAC +ProductVersion=6.10.1.10 +Comments= + + + + + + + +[HistoryLists\hlDebugSourcePath] +Count=1 +Item0=$(BCB)\source\vcl + +[HistoryLists\hlConditionals] +Count=1 +Item0=_DEBUG + +[HistoryLists\hlIntOutputDir] +Count=1 +Item0=. + +[HistoryLists\hIBPIOutputDir] +Count=1 +Item0=. + +[Debugging] +DebugSourceDirs= + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +ShowInfoMsgs=0 +LinkDebugVcl=0 +LinkCGLIB=0 + +[CORBA] +AddServerUnit=1 +AddClientUnit=1 +PrecompiledHeaders=1 + +[Language] +ActiveLang= +RootDir= + + diff --git a/internal/4.10.0.10/1/Source/CBuilder5/dac50.cpp b/internal/4.10.0.10/1/Source/CBuilder5/dac50.cpp new file mode 100644 index 0000000..6e259d8 --- /dev/null +++ b/internal/4.10.0.10/1/Source/CBuilder5/dac50.cpp @@ -0,0 +1,42 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("dac50.res"); +USEPACKAGE("vcl50.bpi"); +USEUNIT("..\DBAccess.pas"); +USEUNIT("..\CRAccess.pas"); +USEUNIT("..\DALoader.pas"); +USEUNIT("..\DADump.pas"); +USEUNIT("..\CRParser.pas"); +USEUNIT("..\DAConsts.pas"); +USEUNIT("..\DBMonitorIntf.pas"); +USEUNIT("..\DBMonitorClient.pas"); +USEUNIT("..\DASQLMonitor.pas"); +USEUNIT("..\MemData.pas"); +USEUNIT("..\MemDS.pas"); +USEUNIT("..\VirtualTable.pas"); +USEUNIT("..\DacVcl.pas"); +USEUNIT("..\DAVersionInfo.pas"); +USEUNIT("..\CLRClasses.pas"); +USEUNIT("..\MemUtils.pas"); +USEUNIT("..\DAScript.pas"); +USEUNIT("..\CRBatchMove.pas"); +USEUNIT("..\Win32Timer.pas"); +USEUNIT("..\CRConnectionPool.pas"); +USEUNIT("..\CRXml.pas"); +USEPACKAGE("Vcldb50.bpi"); +USEPACKAGE("VCLBDE50.bpi"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/internal/4.10.0.10/1/Source/CBuilder5/dac50.res b/internal/4.10.0.10/1/Source/CBuilder5/dac50.res new file mode 100644 index 0000000..d50d7f1 Binary files /dev/null and b/internal/4.10.0.10/1/Source/CBuilder5/dac50.res differ diff --git a/internal/4.10.0.10/1/Source/CBuilder5/dcldac50.bpk b/internal/4.10.0.10/1/Source/CBuilder5/dcldac50.bpk new file mode 100644 index 0000000..92441bd --- /dev/null +++ b/internal/4.10.0.10/1/Source/CBuilder5/dcldac50.bpk @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=6 +MinorVer=10 +Release=1 +Build=10 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName=Core Lab +FileDescription= +FileVersion=6.10.1.10 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName=DAC +ProductVersion=6.10.1.10 +Comments= + + + + +[HistoryLists\hlDebugSourcePath] +Count=1 +Item0=$(BCB)\source\vcl + +[HistoryLists\hlConditionals] +Count=1 +Item0=_DEBUG + +[HistoryLists\hlIntOutputDir] +Count=1 +Item0=. + +[HistoryLists\hIBPIOutputDir] +Count=1 +Item0=. + +[Debugging] +DebugSourceDirs= + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +ShowInfoMsgs=0 +LinkDebugVcl=0 + +[Language] +ActiveLang= +RootDir= + + diff --git a/internal/4.10.0.10/1/Source/CBuilder5/dcldac50.cpp b/internal/4.10.0.10/1/Source/CBuilder5/dcldac50.cpp new file mode 100644 index 0000000..81eb534 --- /dev/null +++ b/internal/4.10.0.10/1/Source/CBuilder5/dcldac50.cpp @@ -0,0 +1,27 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +USERES("dcldac50.res"); +USEPACKAGE("vcl50.bpi"); +USEUNIT("..\Design\DacReg.pas"); +USEUNIT("..\Design\DAMenu.pas"); +USEUNIT("..\Design\Download.pas"); +USEPACKAGE("dac50.bpi"); +USEPACKAGE("Vcldb50.bpi"); +USEPACKAGE("vclbde50.bpi"); +USEUNIT("..\Design\DADesign.pas"); +USEUNIT("..\Design\VTDesign.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/internal/4.10.0.10/1/Source/CBuilder5/dcldac50.res b/internal/4.10.0.10/1/Source/CBuilder5/dcldac50.res new file mode 100644 index 0000000..d50d7f1 Binary files /dev/null and b/internal/4.10.0.10/1/Source/CBuilder5/dcldac50.res differ diff --git a/internal/4.10.0.10/1/Source/CBuilder5/dclsdac50.bpk b/internal/4.10.0.10/1/Source/CBuilder5/dclsdac50.bpk new file mode 100644 index 0000000..c12629b --- /dev/null +++ b/internal/4.10.0.10/1/Source/CBuilder5/dclsdac50.bpk @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=4 +MinorVer=10 +Release=0 +Build=10 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName=Core Lab +FileDescription= +FileVersion=4.10.0.10 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName=Sdac +ProductVersion=4.10.0.10 +Comments= + +[Debugging] +DebugSourceDirs= + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +ShowInfoMsgs=0 +LinkDebugVcl=0 +LinkCGLIB=0 + +[CORBA] +AddServerUnit=1 +AddClientUnit=1 +PrecompiledHeaders=1 + +[Language] +ActiveLang= +RootDir= + + diff --git a/internal/4.10.0.10/1/Source/CBuilder5/dclsdac50.cpp b/internal/4.10.0.10/1/Source/CBuilder5/dclsdac50.cpp new file mode 100644 index 0000000..09f4b2e --- /dev/null +++ b/internal/4.10.0.10/1/Source/CBuilder5/dclsdac50.cpp @@ -0,0 +1,31 @@ + +////////////////////////////////////////////////// +// SQLServer Data Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +// SDAC Package for C++ Builder 5 +////////////////////////////////////////////////// + +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USEPACKAGE("dcldb50.bpi"); +USEUNIT("..\Design\MSReg.pas"); +USEUNIT("..\Design\MSDesign.pas"); +USERES("dclsdac50.res"); +USEPACKAGE("sdac50.bpi"); +USEPACKAGE("VCL50.bpi"); +USEPACKAGE("VCLDB50.bpi"); +USEPACKAGE("dcldac50.bpi"); +USEPACKAGE("DAC50.bpi"); +USEPACKAGE("VclJpg50.bpi"); +USEUNIT("..\Design\MSMenu.pas"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/internal/4.10.0.10/1/Source/CBuilder5/dclsdac50.res b/internal/4.10.0.10/1/Source/CBuilder5/dclsdac50.res new file mode 100644 index 0000000..1c23367 Binary files /dev/null and b/internal/4.10.0.10/1/Source/CBuilder5/dclsdac50.res differ diff --git a/internal/4.10.0.10/1/Source/CBuilder5/default.bpr b/internal/4.10.0.10/1/Source/CBuilder5/default.bpr new file mode 100644 index 0000000..51631cb --- /dev/null +++ b/internal/4.10.0.10/1/Source/CBuilder5/default.bpr @@ -0,0 +1,134 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[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= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +ShowInfoMsgs=0 +LinkDebugVcl=0 +LinkCGLIB=0 + +[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= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +ShowInfoMsgs=0 +LinkDebugVcl=0 +LinkCGLIB=0 + +[CORBA] +AddServerUnit=1 +AddClientUnit=1 +PrecompiledHeaders=1 + + \ No newline at end of file diff --git a/internal/4.10.0.10/1/Source/CBuilder5/sdac50.bpk b/internal/4.10.0.10/1/Source/CBuilder5/sdac50.bpk new file mode 100644 index 0000000..3012d93 --- /dev/null +++ b/internal/4.10.0.10/1/Source/CBuilder5/sdac50.bpk @@ -0,0 +1,107 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=4 +MinorVer=10 +Release=0 +Build=10 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName=Core Lab +FileDescription= +FileVersion=4.10.0.10 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName=SDAC +ProductVersion=4.10.0.10 +Comments= + +[Debugging] +DebugSourceDirs= + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +ShowInfoMsgs=0 +LinkDebugVcl=0 +LinkCGLIB=0 + +[CORBA] +AddServerUnit=1 +AddClientUnit=1 +PrecompiledHeaders=1 + +[Language] +ActiveLang= +RootDir= + + diff --git a/internal/4.10.0.10/1/Source/CBuilder5/sdac50.cpp b/internal/4.10.0.10/1/Source/CBuilder5/sdac50.cpp new file mode 100644 index 0000000..a25a8bf --- /dev/null +++ b/internal/4.10.0.10/1/Source/CBuilder5/sdac50.cpp @@ -0,0 +1,35 @@ + +////////////////////////////////////////////////// +// SQLServer Data Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +// sdac Package for C++ Builder 5 +////////////////////////////////////////////////// + +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("sdac50.res"); + +USEUNIT("..\SdacVcl.pas"); +USEUNIT("..\OLEDBAccess.pas"); +USEUNIT("..\MSAccess.pas"); +USEUNIT("..\OLEDBC.pas"); +USEUNIT("..\MSSQLMonitor.pas"); +USEUNIT("..\MSParser.pas"); +USEUNIT("..\OLEDBIntf.pas"); +USEUNIT("..\MSConsts.pas"); +USEUNIT("..\MSScript.pas"); + +USEPACKAGE("dac50.bpi"); +USEPACKAGE("VCL50.bpi"); +USEPACKAGE("VCLDB50.bpi"); +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//--------------------------------------------------------------------------- +// Package source. +//--------------------------------------------------------------------------- +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/internal/4.10.0.10/1/Source/CBuilder5/sdac50.res b/internal/4.10.0.10/1/Source/CBuilder5/sdac50.res new file mode 100644 index 0000000..1c23367 Binary files /dev/null and b/internal/4.10.0.10/1/Source/CBuilder5/sdac50.res differ diff --git a/internal/4.10.0.10/1/Source/CBuilder6/Make.bat b/internal/4.10.0.10/1/Source/CBuilder6/Make.bat new file mode 100644 index 0000000..3d6aa11 --- /dev/null +++ b/internal/4.10.0.10/1/Source/CBuilder6/Make.bat @@ -0,0 +1,10 @@ +@echo off +rem ********************************************************************** +rem * +rem * Sdac for CBuilder 6 +rem * +rem ********************************************************************** + +set IdeDir="D:\Program Files\Borland\CBuilder6 +del /Q/S SDAC\*.* +call ..\Make.bat CBuilder 6 diff --git a/internal/4.10.0.10/1/Source/CBuilder6/dac60.bpk b/internal/4.10.0.10/1/Source/CBuilder6/dac60.bpk new file mode 100644 index 0000000..8afd56f --- /dev/null +++ b/internal/4.10.0.10/1/Source/CBuilder6/dac60.bpk @@ -0,0 +1,159 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=6 +MinorVer=10 +Release=1 +Build=10 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName=Core Lab +FileDescription= +FileVersion=6.10.1.10 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName=DAC +ProductVersion=6.10.1.10 +Comments= + + +[Debugging] +DebugSourceDirs= + +[Parameters] +RunParams= +Launcher= +UseLauncher=0 +DebugCWD= +HostApplication= +RemoteHost= +RemotePath= +RemoteLauncher= +RemoteCWD= +RemoteDebug=0 + +[Compiler] +ShowInfoMsgs=0 +LinkDebugVcl=0 +LinkCGLIB=0 + +[CORBA] +AddServerUnit=1 +AddClientUnit=1 +PrecompiledHeaders=1 + +[Language] +ActiveLang= +RootDir= + +[Linker] +LibPrefix= +LibSuffix= +LibVersion= + + diff --git a/internal/4.10.0.10/1/Source/CBuilder6/dac60.cpp b/internal/4.10.0.10/1/Source/CBuilder6/dac60.cpp new file mode 100644 index 0000000..f9d8a01 --- /dev/null +++ b/internal/4.10.0.10/1/Source/CBuilder6/dac60.cpp @@ -0,0 +1,17 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- + \ No newline at end of file diff --git a/internal/4.10.0.10/1/Source/CBuilder6/dac60.res b/internal/4.10.0.10/1/Source/CBuilder6/dac60.res new file mode 100644 index 0000000..d50d7f1 Binary files /dev/null and b/internal/4.10.0.10/1/Source/CBuilder6/dac60.res differ diff --git a/internal/4.10.0.10/1/Source/CBuilder6/dacvcl60.bpk b/internal/4.10.0.10/1/Source/CBuilder6/dacvcl60.bpk new file mode 100644 index 0000000..dec8018 --- /dev/null +++ b/internal/4.10.0.10/1/Source/CBuilder6/dacvcl60.bpk @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=6 +MinorVer=10 +Release=1 +Build=10 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName=Core Lab +FileDescription= +FileVersion=6.10.1.10 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName=DAC +ProductVersion=6.10.1.10 +Comments= + + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +Launcher= +UseLauncher=0 +DebugCWD= +HostApplication= +RemoteHost= +RemotePath= +RemoteLauncher= +RemoteCWD= +RemoteDebug=0 + +[Compiler] +ShowInfoMsgs=0 +LinkDebugVcl=0 +LinkCGLIB=0 + +[CORBA] +AddServerUnit=1 +AddClientUnit=1 +PrecompiledHeaders=1 + +[Language] +ActiveLang= +RootDir= + +[Linker] +LibPrefix= +LibSuffix= +LibVersion= + + diff --git a/internal/4.10.0.10/1/Source/CBuilder6/dacvcl60.cpp b/internal/4.10.0.10/1/Source/CBuilder6/dacvcl60.cpp new file mode 100644 index 0000000..de90459 --- /dev/null +++ b/internal/4.10.0.10/1/Source/CBuilder6/dacvcl60.cpp @@ -0,0 +1,19 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- + + + diff --git a/internal/4.10.0.10/1/Source/CBuilder6/dacvcl60.res b/internal/4.10.0.10/1/Source/CBuilder6/dacvcl60.res new file mode 100644 index 0000000..d50d7f1 Binary files /dev/null and b/internal/4.10.0.10/1/Source/CBuilder6/dacvcl60.res differ diff --git a/internal/4.10.0.10/1/Source/CBuilder6/dcldac60.bpk b/internal/4.10.0.10/1/Source/CBuilder6/dcldac60.bpk new file mode 100644 index 0000000..e82a4cf --- /dev/null +++ b/internal/4.10.0.10/1/Source/CBuilder6/dcldac60.bpk @@ -0,0 +1,151 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=6 +MinorVer=10 +Release=1 +Build=10 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName=Core Lab +FileDescription= +FileVersion=6.10.1.10 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName=DAC +ProductVersion=6.10.1.10 + + +[HistoryLists\hlIncludePath] +Count=2 +Item0=..\Design;..;$(BCB)\include;$(BCB)\include\vcl;$(BCB)\source\toolsapi +Item1=..\Design;..\;..;$(BCB)\include;$(BCB)\include\vcl;$(BCB)\source\toolsapi + +[HistoryLists\hlLibraryPath] +Count=2 +Item0=..\Design;..;d:\program files\borland\cbuilder6\lib\release;$(BCB)\projects\lib;$(BCB)\lib\obj;$(BCB)\lib;$(BCB)\source\toolsapi +Item1=..\Design;..\;..;d:\program files\borland\cbuilder6\lib\release;$(BCB)\projects\lib;$(BCB)\lib\obj;$(BCB)\lib;$(BCB)\source\toolsapi + +[HistoryLists\hlIntOutputDir] +Count=1 +Item0=. + +[HistoryLists\hIBPIOutputDir] +Count=1 +Item0=. + +[Debugging] +DebugSourceDirs= + +[Parameters] +RunParams= +Launcher= +UseLauncher=0 +DebugCWD= +HostApplication= +RemoteHost= +RemotePath= +RemoteLauncher= +RemoteCWD= +RemoteDebug=0 + +[Compiler] +ShowInfoMsgs=0 +LinkDebugVcl=0 +LinkCGLIB=0 + +[CORBA] +AddServerUnit=1 +AddClientUnit=1 +PrecompiledHeaders=1 + +[Linker] +LibPrefix= +LibSuffix= +LibVersion= + + diff --git a/internal/4.10.0.10/1/Source/CBuilder6/dcldac60.cpp b/internal/4.10.0.10/1/Source/CBuilder6/dcldac60.cpp new file mode 100644 index 0000000..bcffbe9 --- /dev/null +++ b/internal/4.10.0.10/1/Source/CBuilder6/dcldac60.cpp @@ -0,0 +1,16 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/internal/4.10.0.10/1/Source/CBuilder6/dcldac60.res b/internal/4.10.0.10/1/Source/CBuilder6/dcldac60.res new file mode 100644 index 0000000..d50d7f1 Binary files /dev/null and b/internal/4.10.0.10/1/Source/CBuilder6/dcldac60.res differ diff --git a/internal/4.10.0.10/1/Source/CBuilder6/dclsdac60.bpk b/internal/4.10.0.10/1/Source/CBuilder6/dclsdac60.bpk new file mode 100644 index 0000000..c276dea --- /dev/null +++ b/internal/4.10.0.10/1/Source/CBuilder6/dclsdac60.bpk @@ -0,0 +1,177 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=4 +MinorVer=10 +Release=0 +Build=10 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName=Core Lab +FileDescription= +FileVersion=4.10.0.10 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName=Sdac +ProductVersion=4.10.0.10 + + +[HistoryLists\hlIncludePath] +Count=8 +Item0=..\;..\Design;..;$(BCB)\include;$(BCB)\include\vcl;..\..\..\Dac\Source;..\..\..\Dac\Source\Design;$(BCB)\source\toolsapi +Item1=..\Design;..\;..;$(BCB)\include;$(BCB)\include\vcl;..\..\..\Dac\Source;..\..\..\Dac\Source\Design;$(BCB)\source\toolsapi +Item2=..\Design;..\;..;$(BCB)\include;$(BCB)\include\vcl;..\..\..\Dac\Source;$(BCB)\source\toolsapi +Item3=..\;..;$(BCB)\include;$(BCB)\include\vcl;..\..\..\Dac\Source;$(BCB)\source\toolsapi +Item4=..;$(BCB)\include;$(BCB)\include\vcl;..\..\..\Dac\Source +Item5=..\;..\..\Source;$(BCB)\include;$(BCB)\include\vcl;..\..\..\Dac\Source +Item6=..\;..;..\..\..\Dac\Source;..\Net;$(BCB)\include;$(BCB)\include\vcl;$(BCB)\source\toolsapi +Item7=..\;D:\Program Files\Borland\CBuilder6\Projects;$(BCB)\include;$(BCB)\include\vcl + +[HistoryLists\hlLibraryPath] +Count=11 +Item0=..\;..\Design;..;$(BCB)\Projects\Lib;..\..\..\Dac\Source\CBuilder6;$(BCB)\lib\obj;$(BCB)\lib;..\..\..\Dac\Source;..\..\..\Dac\Source\Design;$(BCB)\source\toolsapi +Item1=..\;..\Design;..;$(BCB)\Projects\Lib;..\..\..\Dac\Source\CBuilder6;$(BCB)\lib\obj;$(BCB)\lib;..\..\..\Dac\Source;$(BCB)\source\toolsapi +Item2=..\Design;..\;..;$(BCB)\Projects\Lib;..\..\..\Dac\Source\CBuilder6;$(BCB)\lib\obj;$(BCB)\lib;..\..\..\Dac\Source;$(BCB)\source\toolsapi +Item3=..\;$(BCB)\Projects\Lib;..;..\..\..\Dac\Source\CBuilder6;$(BCB)\lib\obj;$(BCB)\lib;..\..\..\Dac\Source;$(BCB)\source\toolsapi +Item4=$(BCB)\Projects\Lib;..\;..;..\..\..\Dac\Source\CBuilder6;$(BCB)\lib\obj;$(BCB)\lib;..\..\..\Dac\Source;$(BCB)\source\toolsapi +Item5=..;..\..\..\Dac\Source\CBuilder6;$(BCB)\lib\obj;$(BCB)\lib;..\..\..\Dac\Source +Item6=..\;..\..\Source;..\..\..\Dac\Source\CBuilder6;$(BCB)\lib\obj;$(BCB)\lib;..\..\..\Dac\Source +Item7=..\;..;..\..\..\Dac\source\cbuilder6;..\..\..\Dac\Source;..\..\..\Dac\Source\CBuilder6;..\Net;$(BCB)\lib;$(BCB)\lib\obj;$(BCB)\source\toolsapi;$(BCB)\projects\lib +Item8=;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;..\;..\..\..\Dac\source\cbuilder6;;;;..;..\..\..\Dac\Source;..\..\..\Dac\Source\CBuilder6;..\Net;$(BCB)\lib;$(BCB)\lib\obj;$(BCB)\source\toolsapi;$(BCB)\projects\lib +Item9=..\;..;..\..\..\Dac\Source;..\..\..\Dac\Source\CBuilder6;..\Net;$(BCB)\lib;$(BCB)\lib\obj;$(BCB)\source\toolsapi;$(BCB)\projects\lib +Item10=..\;D:\Program Files\Borland\CBuilder6\Projects;$(BCB)\lib\obj;$(BCB)\lib + +[HistoryLists\hlDebugSourcePath] +Count=1 +Item0=$(BCB)\source\vcl + +[HistoryLists\hlConditionals] +Count=3 +Item0=SDAC +Item1=ODAC +Item2=_DEBUG + +[HistoryLists\hlIntOutputDir] +Count=1 +Item0=. + +[HistoryLists\hIBPIOutputDir] +Count=1 +Item0=. + +[Debugging] +DebugSourceDirs= + +[Parameters] +RunParams= +Launcher= +UseLauncher=0 +DebugCWD= +HostApplication= +RemoteHost= +RemotePath= +RemoteLauncher= +RemoteCWD= +RemoteDebug=0 + +[Compiler] +ShowInfoMsgs=0 +LinkDebugVcl=0 +LinkCGLIB=0 + +[CORBA] +AddServerUnit=1 +AddClientUnit=1 +PrecompiledHeaders=1 + +[Language] +ActiveLang= +RootDir= + +[Linker] +LibPrefix= +LibSuffix= +LibVersion= + + diff --git a/internal/4.10.0.10/1/Source/CBuilder6/dclsdac60.cpp b/internal/4.10.0.10/1/Source/CBuilder6/dclsdac60.cpp new file mode 100644 index 0000000..e1c47bb --- /dev/null +++ b/internal/4.10.0.10/1/Source/CBuilder6/dclsdac60.cpp @@ -0,0 +1,16 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} + \ No newline at end of file diff --git a/internal/4.10.0.10/1/Source/CBuilder6/dclsdac60.res b/internal/4.10.0.10/1/Source/CBuilder6/dclsdac60.res new file mode 100644 index 0000000..1c23367 Binary files /dev/null and b/internal/4.10.0.10/1/Source/CBuilder6/dclsdac60.res differ diff --git a/internal/4.10.0.10/1/Source/CBuilder6/default.bpr b/internal/4.10.0.10/1/Source/CBuilder6/default.bpr new file mode 100644 index 0000000..3a5d950 --- /dev/null +++ b/internal/4.10.0.10/1/Source/CBuilder6/default.bpr @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[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= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +Launcher= +UseLauncher=0 +DebugCWD= +HostApplication= +RemoteHost= +RemotePath= +RemoteLauncher= +RemoteCWD= +RemoteDebug=0 + +[Compiler] +ShowInfoMsgs=0 +LinkDebugVcl=0 +LinkCGLIB=0 + +[CORBA] +AddServerUnit=1 +AddClientUnit=1 +PrecompiledHeaders=1 + + diff --git a/internal/4.10.0.10/1/Source/CBuilder6/sdac60.bpk b/internal/4.10.0.10/1/Source/CBuilder6/sdac60.bpk new file mode 100644 index 0000000..e17be84 --- /dev/null +++ b/internal/4.10.0.10/1/Source/CBuilder6/sdac60.bpk @@ -0,0 +1,175 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=4 +MinorVer=10 +Release=0 +Build=10 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName=Core Lab +FileDescription= +FileVersion=4.10.0.10 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName=SDAC +ProductVersion=4.10.0.10 +Comments= + +[HistoryLists\hlIncludePath] +Count=6 +Item0=..\;..;..\..\..\Dac\Source;$(BCB)\include;$(BCB)\include\vcl +Item1=..\;..;..\Net;$(BCB)\include;$(BCB)\include\vcl +Item2=..;..\Net;$(BCB)\include;$(BCB)\include\vcl +Item3=..\;..;$(BCB)\include;$(BCB)\include\vcl;..\..\..\Dac\Source +Item4=..\;..;..\..\..\Dac\Source;..\Net;$(BCB)\include;$(BCB)\include\vcl +Item5=..\;D:\Program Files\Borland\CBuilder6\Projects;$(BCB)\include;$(BCB)\include\vcl + +[HistoryLists\hlLibraryPath] +Count=10 +Item0=..\;..;..\..\..\Dac\Source;..\..\..\Dac\Source\CBuilder6;$(BCB)\lib;$(BCB)\lib\obj;$(BCB)\projects\lib +Item1=..;..\..\..\Dac\Source;..\..\..\Dac\Source\CBuilder6;$(BCB)\lib;$(BCB)\lib\obj;$(BCB)\projects\lib +Item2=$(BCB)\Projects\Lib;..\;..\..\..\Dac\source\cbuilder6;..;$(BCB)\lib\obj;$(BCB)\lib;..\..\..\Dac\Source +Item3=..\..\..\Dac\source\cbuilder6;..\;..;$(BCB)\lib\obj;$(BCB)\lib;..\..\..\Dac\Source; ..\..\..\Dac\Source\CBuilder6 +Item4=..\..\..\Dac\source\cbuilder6;..\;..;$(BCB)\lib\obj;$(BCB)\lib;..\..\..\Dac\Source;..\..\..\Dac\Source\CBuilder6 +Item5=..\;..;$(BCB)\lib\obj;$(BCB)\lib;..\..\..\Dac\Source;..\..\..\Dac\Source\CBuilder6 +Item6=..\;..;..\..\..\Dac\Source;..\..\..\Dac\Source\CBuilder6;..\Net;$(BCB)\lib;$(BCB)\lib\obj;$(BCB)\projects\lib +Item7=;;;;;;;;;;;..\;..;..\..\..\Dac\Source;..\..\..\Dac\Source\CBuilder6;..\Net;$(BCB)\lib;$(BCB)\lib\obj;$(BCB)\projects\lib +Item8=..\;..;..\..\..\Dac\Source;..\..\..\Dac\Source\CBuilder6;..\Net;$(BCB)\lib;$(BCB)\lib\obj;$(BCB)\projects\lib;..\..\..\Dac\Source\CBuilder6 +Item9=..\;D:\Program Files\Borland\CBuilder6\Projects;$(BCB)\lib\obj;$(BCB)\lib + +[HistoryLists\hlDebugSourcePath] +Count=1 +Item0=$(BCB)\source\vcl + +[HistoryLists\hlConditionals] +Count=2 +Item0=SDAC +Item1=ODAC + +[HistoryLists\hlIntOutputDir] +Count=1 +Item0=. + +[HistoryLists\hIBPIOutputDir] +Count=1 +Item0=. + +[Debugging] +DebugSourceDirs= + +[Parameters] +RunParams= +Launcher= +UseLauncher=0 +DebugCWD= +HostApplication= +RemoteHost= +RemotePath= +RemoteLauncher= +RemoteCWD= +RemoteDebug=0 + +[Compiler] +ShowInfoMsgs=0 +LinkDebugVcl=0 +LinkCGLIB=0 + +[CORBA] +AddServerUnit=1 +AddClientUnit=1 +PrecompiledHeaders=1 + +[Language] +ActiveLang= +RootDir= + +[Linker] +LibPrefix= +LibSuffix= +LibVersion= + + diff --git a/internal/4.10.0.10/1/Source/CBuilder6/sdac60.cpp b/internal/4.10.0.10/1/Source/CBuilder6/sdac60.cpp new file mode 100644 index 0000000..bcffbe9 --- /dev/null +++ b/internal/4.10.0.10/1/Source/CBuilder6/sdac60.cpp @@ -0,0 +1,16 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- diff --git a/internal/4.10.0.10/1/Source/CBuilder6/sdac60.res b/internal/4.10.0.10/1/Source/CBuilder6/sdac60.res new file mode 100644 index 0000000..1c23367 Binary files /dev/null and b/internal/4.10.0.10/1/Source/CBuilder6/sdac60.res differ diff --git a/internal/4.10.0.10/1/Source/CBuilder6/sdacvcl60.bpk b/internal/4.10.0.10/1/Source/CBuilder6/sdacvcl60.bpk new file mode 100644 index 0000000..a467ffd --- /dev/null +++ b/internal/4.10.0.10/1/Source/CBuilder6/sdacvcl60.bpk @@ -0,0 +1,152 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=4 +MinorVer=10 +Release=0 +Build=10 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName=Core Lab +FileDescription= +FileVersion=4.10.0.10 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName=SDAC +ProductVersion=4.10.0.10 +Comments= + + +[HistoryLists\hlIncludePath] +Count=2 +Item0=..\;..;..\..\..\Dac\Source;..\Net;$(BCB)\include;$(BCB)\include\vcl +Item1=..\;D:\Program Files\Borland\CBuilder6\Projects;$(BCB)\include;$(BCB)\include\vcl + +[HistoryLists\hlLibraryPath] +Count=3 +Item0=..\;..;..\Net\cb6;..\Net;..\..\..\Dac\Source;..\..\..\Dac\Source\CBuilder6;$(BCB)\lib;$(BCB)\lib\obj;$(BCB)\projects\lib +Item1=..\;$(BCB)\Projects\Lib;..;D:\Program Files\Borland\CBuilder6\Projects;$(BCB)\lib\obj;$(BCB)\lib +Item2=$(BCB)\Projects\Lib;..\;D:\Program Files\Borland\CBuilder6\Projects;$(BCB)\lib\obj;$(BCB)\lib + +[HistoryLists\hlDebugSourcePath] +Count=1 +Item0=$(BCB)\source\vcl + +[HistoryLists\hlConditionals] +Count=2 +Item0=SDAC +Item1=_DEBUG + +[HistoryLists\hlIntOutputDir] +Count=1 +Item0=. + +[HistoryLists\hIBPIOutputDir] +Count=1 +Item0=. + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +Launcher= +UseLauncher=0 +DebugCWD= +HostApplication= +RemoteHost= +RemotePath= +RemoteLauncher= +RemoteCWD= +RemoteDebug=0 + +[Compiler] +ShowInfoMsgs=0 +LinkDebugVcl=0 +LinkCGLIB=0 + +[CORBA] +AddServerUnit=1 +AddClientUnit=1 +PrecompiledHeaders=1 + +[Language] +ActiveLang= +RootDir= + +[Linker] +LibPrefix= +LibSuffix= +LibVersion= + + diff --git a/internal/4.10.0.10/1/Source/CBuilder6/sdacvcl60.cpp b/internal/4.10.0.10/1/Source/CBuilder6/sdacvcl60.cpp new file mode 100644 index 0000000..f8b49e2 --- /dev/null +++ b/internal/4.10.0.10/1/Source/CBuilder6/sdacvcl60.cpp @@ -0,0 +1,17 @@ +//--------------------------------------------------------------------------- + +#include +#pragma hdrstop +#pragma package(smart_init) +//--------------------------------------------------------------------------- + +// Package source. +//--------------------------------------------------------------------------- + +#pragma argsused +int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*) +{ + return 1; +} +//--------------------------------------------------------------------------- + diff --git a/internal/4.10.0.10/1/Source/CBuilder6/sdacvcl60.res b/internal/4.10.0.10/1/Source/CBuilder6/sdacvcl60.res new file mode 100644 index 0000000..1c23367 Binary files /dev/null and b/internal/4.10.0.10/1/Source/CBuilder6/sdacvcl60.res differ diff --git a/internal/4.10.0.10/1/Source/CLRClasses.pas b/internal/4.10.0.10/1/Source/CLRClasses.pas new file mode 100644 index 0000000..52e7f5c --- /dev/null +++ b/internal/4.10.0.10/1/Source/CLRClasses.pas @@ -0,0 +1,1172 @@ + +////////////////////////////////////////////////// +// DB Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +// CLRClasses +////////////////////////////////////////////////// + +unit CLRClasses; + +interface + +{$I Dac.inc} + +uses + Classes, SysUtils; + +type + Int = Integer; + Int16 = SmallInt; + Int32 = Integer; + UInt16 = Word; + UInt32 = LongWord; + sbyte = ShortInt; + + IntPtr = pointer; + MulticastDelegate = pointer; +{$IFNDEF VER11} + TBytes = array of byte; +{$ENDIF} + + BitConverter = class + public + class function GetBytes(value: word): TBytes; overload; + class function GetBytes(value: cardinal): TBytes; overload; + class function GetBytes(value: int64): TBytes; overload; + class function GetBytes(value: double): TBytes; overload; + class function GetBytes(value: single): TBytes; overload; + class function Int64BitsToDouble(Value: int64): double; + class function DoubleToInt64Bits(Value: double): int64; + class function ToDouble(const value: TBytes; startIndex: integer): Double; overload; + class function ToDouble(value: PChar; startIndex: integer): Double; overload; + class function ToSingle(const value: TBytes; startIndex: integer): Single; + class function ToInt64(const value: TBytes; startIndex: integer): Int64; overload; + class function ToInt64(value: PChar; startIndex: integer): Int64; overload; + class function ToInt32(const value: TBytes; startIndex: integer): integer; overload; + class function ToInt32(value: PChar; startIndex: integer): integer; overload; + class function ToInt16(const value: TBytes; startIndex: integer): smallint; + class function ToUInt32(const value: TBytes; startIndex: integer): UInt32; + class function ToUInt16(const value: TBytes; startIndex: integer): UInt16; overload; + class function ToUInt16(value: PChar; startIndex: integer): UInt16; overload; + end; + + Marshal = class + public + class function AllocHGlobal(cb: integer): pointer; + class function ReallocHGlobal(pv: pointer; cb: pointer): pointer; + class procedure FreeHGlobal(hglobal: pointer); + class procedure FreeCoTaskMem(ptr: pointer); + + class function ReadByte(ptr: pointer; ofs: integer = 0): byte; + class procedure WriteByte(ptr: pointer; val: byte); overload; + class procedure WriteByte(ptr: pointer; ofs: integer; val: byte); overload; + + class function ReadInt16(ptr: pointer; ofs: integer = 0): smallint; + class procedure WriteInt16(ptr: pointer; val: smallint); overload; + class procedure WriteInt16(ptr: pointer; ofs: integer; val: smallint); overload; + + class function ReadInt32(ptr: pointer; ofs: integer = 0): integer; + class procedure WriteInt32(ptr: pointer; val: integer); overload; + class procedure WriteInt32(ptr: pointer; ofs, val: integer); overload; + + class function ReadInt64(ptr: pointer; ofs: integer = 0): int64; + class procedure WriteInt64(ptr: pointer; val: int64); overload; + class procedure WriteInt64(ptr: pointer; val: double); overload; + class procedure WriteInt64(ptr: pointer; ofs: integer; val: int64); overload; + + class function ReadIntPtr(ptr: pointer; ofs: integer = 0): pointer; + class procedure WriteIntPtr(ptr: pointer; val: pointer); overload; + class procedure WriteIntPtr(ptr: pointer; ofs: integer; val: pointer); overload; + + class function PtrToStringAnsi(ptr: pointer; len: integer = 0): string; + class function PtrToStringUni(ptr: pointer; len: integer = 0): WideString; + class function StringToHGlobalAnsi(const s: string): pointer; + class function StringToHGlobalUni(const s: WideString): pointer; + + class procedure Copy(const source: TBytes; startIndex: integer; destination: pointer; length: integer); overload; + class procedure Copy(source: pointer; var destination: TBytes; startIndex: integer; length: integer); overload; + + class function GetIUnknownForObject(o: TInterfacedObject): IntPtr; + class function AddRef(pUnk: IntPtr): integer; + class function Release(pUnk: IntPtr): integer; + end; + + EncodingClass = class of Encoding; + Encoding = class + public + class function Default: EncodingClass; + class function Unicode: EncodingClass; + class function UTF8: EncodingClass; + + class function GetBytes(const chars: string): TBytes; overload; virtual; + class function GetBytes(const chars: string; charIndex, charCount: int; var bytes: TBytes; byteIndex: int): int; overload; virtual; + class function {$IFNDEF VER5}GetBytes{$ELSE}GetBytesWide{$ENDIF}(const chars: WideString): TBytes; overload; virtual; + class function {$IFNDEF VER5}GetBytes{$ELSE}GetBytesWide{$ENDIF}(const chars: WideString; charIndex, charCount: int; var bytes: TBytes; byteIndex: int): int; overload; virtual; + + class function GetString(const bytes: TBytes): string; overload; virtual; + class function GetString(const bytes: TBytes; index: integer; count: integer): string; overload; virtual; + class function GetWideString(const bytes: TBytes): WideString; overload; virtual; + class function GetWideString(const bytes: TBytes; index: integer; count: integer): WideString; overload; virtual; + end; + + UnicodeEncoding = class(Encoding) + public + class function GetString(const bytes: TBytes): string; overload; override; + class function GetString(const bytes: TBytes; index: integer; count: integer): string; overload; override; + class function GetWideString(const bytes: TBytes): WideString; overload; override; + class function GetWideString(const bytes: TBytes; index: integer; count: integer): WideString; overload; override; + end; + + UTF8Encoding = class(Encoding) + public + {$IFDEF BCB} + {Added to avoid C++ Builder 6 bug} + class function GetBytes(const chars: string; charIndex, charCount: int; var bytes: TBytes; byteIndex: int): int; overload; override; + class function {$IFNDEF VER5}GetBytes{$ELSE}GetBytesWide{$ENDIF}(const chars: WideString; charIndex, charCount: int; var bytes: TBytes; byteIndex: int): int; overload; override; + class function GetString(const bytes: TBytes): string; overload; override; + {$ENDIF} + class function GetBytes(const chars: string): TBytes; override; + class function {$IFNDEF VER5}GetBytes{$ELSE}GetBytesWide{$ENDIF}(const chars: WideString): TBytes; override; + + class function GetString(const bytes: TBytes; index: integer; count: integer): string; overload; override; + class function GetWideString(const bytes: TBytes): WideString; overload; override; + class function GetWideString(const bytes: TBytes; index: integer; count: integer): WideString; overload; override; + end; + + StringBuilder = class + protected + FString: string; + FActualLength: integer; + + procedure SetActualLength(Value: integer); + public + constructor Create(capacity: integer); overload; + constructor Create(const value: string; capacity: integer); overload; + procedure Append(const value: string); overload; + procedure Append(const value: string; const startIndex: integer; const count: integer); overload; + procedure Append(const value: char); overload; + procedure Append(const value: char; repeatCount: integer); overload; + procedure Append(value: StringBuilder); overload; + procedure Insert(index: integer; const value: string); overload; + procedure Replace(const OldValue: string; const NewValue: string); + function ToString: string; + + property Length: integer read FActualLength write SetActualLength; + end; + + Buffer = class + public + class procedure BlockCopy(const src: TBytes; srcOffset: integer; const dst: TBytes; dstOffset: integer; count: integer); + end; + +{ MemoryStream } + + MemoryStream = class + private + FData: TBytes; + FPosition: Integer; + FLength: Integer; + + protected + procedure SetPosition(const Pos: Integer); + + public + constructor Create(capacity: int); + function Seek(Offset: Longint; Origin: Word): Longint; + function Read(var Buffer: TBytes; Offset: int; Count: int): int; overload; + function Read(Buffer: PChar; Offset: int; Count: int): int; overload; + procedure Write(const Buffer: TBytes; Offset: int; Count: int); overload; + procedure Write(Buffer: PChar; Offset: int; Count: int); overload; + procedure WriteByte(value: Byte); + function ReadByte: Byte; + function GetBuffer: PChar; + + procedure Close; + procedure SetLength(Value: Integer); + + property Length: Integer read FLength write SetLength; + property Position: integer read FPosition write SetPosition; + end; + + ArgumentException = class(Exception) + public + constructor Create; overload; + constructor Create(const Msg: string); overload; + end; + + NotSupportedException = class(Exception) + public + constructor Create; overload; + constructor Create(const Msg: string); overload; + end; + +{$IFDEF UTF8} +type + UTF8String = type string; + +function UnicodeToUtf8(Dest: PChar; Source: PWideChar; MaxBytes: Integer): Integer; overload; +function UnicodeToUtf8(Dest: PChar; MaxDestBytes: Cardinal; Source: PWideChar; SourceChars: Cardinal): Cardinal; overload; +function Utf8ToUnicode(Dest: PWideChar; Source: PChar; MaxChars: Integer): Integer; overload; +function Utf8ToUnicode(Dest: PWideChar; MaxDestChars: Cardinal; Source: PChar; SourceBytes: Cardinal): Cardinal; overload; +function Utf8Encode(const WS: WideString): UTF8String; +function Utf8Decode(const S: UTF8String): WideString; +function AnsiToUtf8(const S: string): UTF8String; +function Utf8ToAnsi(const S: UTF8String): string; +{$ENDIF} + +implementation +uses +{$IFDEF VER7P} + StrUtils, +{$ELSE} + CRParser, +{$ENDIF} + Math; + +{ BitConverter } + +class function BitConverter.GetBytes(value: word): TBytes; +begin + SetLength(Result, SizeOf(Word)); + Word(Pointer(Result)^) := value; +end; + +class function BitConverter.GetBytes(value: cardinal): TBytes; +begin + SetLength(Result, SizeOf(Cardinal)); + Cardinal(Pointer(Result)^) := value; +end; + +class function BitConverter.GetBytes(value: int64): TBytes; +begin + SetLength(Result, SizeOf(int64)); + Int64(Pointer(Result)^) := value; +end; + +class function BitConverter.GetBytes(value: double): TBytes; +begin + SetLength(Result, SizeOf(Double)); + Double(Pointer(Result)^) := value; +end; + +class function BitConverter.GetBytes(value: Single): TBytes; +begin + SetLength(Result, SizeOf(Single)); + Single(Pointer(Result)^) := value; +end; + +class function BitConverter.Int64BitsToDouble(value: int64): double; +begin + Result := Double(Pointer(@value)^); +end; + +class function BitConverter.DoubleToInt64Bits(value: double): int64; +begin + Result := PInt64(@value)^; +end; + +class function BitConverter.ToDouble(const value: TBytes; startIndex: integer): Double; +begin + Result := Double(Pointer(PChar(value) + startIndex)^); +end; + +class function BitConverter.ToDouble(value: PChar; startIndex: integer): Double; +begin + Result := Double(Pointer(PChar(value) + startIndex)^); +end; + +class function BitConverter.ToSingle(const value: TBytes; startIndex: integer): Single; +begin + Result := Single(Pointer(PChar(value) + startIndex)^); +end; + +class function BitConverter.ToInt64(const value: TBytes; startIndex: integer): Int64; +begin + Result := Int64(Pointer(PChar(value) + startIndex)^); +end; + +class function BitConverter.ToInt64(value: PChar; startIndex: integer): Int64; +begin + Result := Int64(Pointer(value + startIndex)^); +end; + +class function BitConverter.ToInt32(const value: TBytes; startIndex: integer): integer; +begin + Result := Integer(Pointer(PChar(value) + startIndex)^); +end; + +class function BitConverter.ToInt32(value: PChar; startIndex: integer): integer; +begin + Result := Integer(Pointer(PChar(value) + startIndex)^); +end; + +class function BitConverter.ToInt16(const value: TBytes; startIndex: integer): smallint; +begin + Result := SmallInt(Pointer(PChar(value) + startIndex)^); +end; + +class function BitConverter.ToUInt32(const value: TBytes; startIndex: integer): UInt32; +begin + Result := UInt32(Pointer(PChar(value) + startIndex)^); +end; + +class function BitConverter.ToUInt16(const value: TBytes; startIndex: integer): UInt16; +begin + Result := UInt16(Pointer(PChar(value) + startIndex)^); +end; + +class function BitConverter.ToUInt16(value: PChar; startIndex: integer): UInt16; +begin + Result := UInt16(Pointer(PChar(value) + startIndex)^); +end; + + +{ Marshal } + +class function Marshal.AllocHGlobal(cb: integer): pointer; +begin + GetMem(Result, cb); +end; + +class function Marshal.ReallocHGlobal(pv: pointer; cb: pointer): pointer; +begin + Result := pv; + ReallocMem(Result, Integer(cb)); +end; + +class procedure Marshal.FreeHGlobal(hglobal: pointer); +begin + FreeMem(hglobal); +end; + +class procedure Marshal.FreeCoTaskMem(ptr: pointer); +begin +end; + +class function Marshal.ReadByte(ptr: pointer; ofs: integer): byte; +begin + Result := Byte(Pointer(Integer(ptr) + ofs)^); +end; + +class procedure Marshal.WriteByte(ptr: pointer; val: byte); +begin + Byte(ptr^) := val; +end; + +class procedure Marshal.WriteByte(ptr: pointer; ofs: integer; val: byte); +begin + Byte(Pointer(Integer(ptr) + ofs)^) := val; +end; + +class function Marshal.ReadInt16(ptr: pointer; ofs: integer): smallint; +begin + Result := SmallInt(Pointer(Integer(ptr) + ofs)^); +end; + +class procedure Marshal.WriteInt16(ptr: pointer; val: smallint); +begin + SmallInt(ptr^) := val; +end; + +class procedure Marshal.WriteInt16(ptr: pointer; ofs: integer; val: smallint); +begin + SmallInt(Pointer(Integer(ptr) + ofs)^) := val; +end; + +class function Marshal.ReadInt32(ptr: pointer; ofs: integer): integer; +begin + Result := Integer(Pointer(Integer(ptr) + ofs)^); +end; + +class procedure Marshal.WriteInt32(ptr: pointer; val: integer); +begin + Integer(ptr^) := val; +end; + +class procedure Marshal.WriteInt32(ptr: pointer; ofs, val: integer); +begin + Integer(Pointer(Integer(ptr) + ofs)^) := val; +end; + +class function Marshal.ReadInt64(ptr: pointer; ofs: integer): int64; +begin + Result := Int64(Pointer(Integer(ptr) + ofs)^); +end; + +class procedure Marshal.WriteInt64(ptr: pointer; val: int64); +begin + Int64(ptr^) := val; +end; + +class procedure Marshal.WriteInt64(ptr: pointer; val: double); +begin + Double(ptr^) := val; +end; + +class procedure Marshal.WriteInt64(ptr: pointer; ofs: integer; val: int64); +begin + Int64(Pointer(Integer(ptr) + ofs)^) := val; +end; + +class function Marshal.ReadIntPtr(ptr: pointer; ofs: integer): pointer; +begin + Result := Pointer(Pointer(Integer(ptr) + ofs)^); +end; + +class procedure Marshal.WriteIntPtr(ptr, val: pointer); +begin + Pointer(ptr^) := val; +end; + +class procedure Marshal.WriteIntPtr(ptr: pointer; ofs: integer; val: pointer); +begin + Pointer(Pointer(Integer(ptr) + ofs)^) := val; +end; + +class function Marshal.PtrToStringAnsi(ptr: pointer; len: integer = 0): string; +begin + if len > 0 then begin + SetLength(Result, len); + Move(ptr^, PChar(Result)^, len); + end + else + Result := PChar(ptr); +end; + +class function Marshal.PtrToStringUni(ptr: pointer; len: integer = 0): WideString; +begin + if len > 0 then begin + SetLength(Result, len); + Move(ptr^, PWideChar(Result)^, len shl 1); + end + else + Result := PWideChar(ptr); +end; + +class function Marshal.StringToHGlobalAnsi(const s: string): pointer; +begin + Result := PChar(s); +end; + +class function Marshal.StringToHGlobalUni(const s: WideString): pointer; +begin + Result := PWideChar(s); +end; + +class procedure Marshal.Copy(const source: TBytes; startIndex: integer; + destination: pointer; length: integer); +begin + if length = 0 then + Exit; + Move(Source[StartIndex], destination^, length); +end; + +class procedure Marshal.Copy(Source: pointer; var destination: TBytes; + startIndex, length: integer); +begin + if length = 0 then + Exit; + Move(source^, destination[startIndex], length); +end; + +class function Marshal.GetIUnknownForObject(o: TInterfacedObject): IntPtr; +var + iu: IUnknown; +begin + iu := IUnknown(o); + iu._AddRef; + Result := IntPtr(iu); +end; + +class function Marshal.AddRef(pUnk: IntPtr): integer; +begin + Result := IUnknown(pUnk)._AddRef; +end; + +class function Marshal.Release(pUnk: IntPtr): integer; +begin + Result := IUnknown(pUnk)._Release; +end; + +{ Encoding } + +class function Encoding.Default: EncodingClass; +begin + Result := Encoding; +end; + +class function Encoding.Unicode: EncodingClass; +begin + Result := UnicodeEncoding; +end; + +class function Encoding.UTF8: EncodingClass; +begin + Result := UTF8Encoding; +end; + +class function Encoding.GetBytes(const chars: string): TBytes; +begin + SetLength(Result, Length(chars)); + Move(PChar(chars)^, Pointer(Result)^, Length(chars)); +end; + +class function Encoding.GetBytes(const chars: string; charIndex, charCount: int; var bytes: TBytes; byteIndex: int): int; +begin + if charCount > 0 then + Move((PChar(chars) + charIndex)^, bytes[byteIndex], charCount); + Result := charCount; +end; + +class function Encoding.{$IFNDEF VER5}GetBytes{$ELSE}GetBytesWide{$ENDIF}(const chars: WideString): TBytes; +begin + SetLength(Result, Length(chars) shl 1); + Move(PWideChar(chars)^, Pointer(Result)^, Length(chars) shl 1); +end; + +class function Encoding.{$IFNDEF VER5}GetBytes{$ELSE}GetBytesWide{$ENDIF}(const chars: WideString; charIndex, charCount: int; var bytes: TBytes; byteIndex: int): int; +begin + Move((PWideChar(chars) + charIndex)^, bytes[byteIndex], charCount shl 1); + Result := charCount shl 1; +end; + +class function Encoding.GetString(const bytes: TBytes): string; +begin + Result := GetString(bytes, 0, Length(bytes)); +end; + +class function Encoding.GetString(const bytes: TBytes; index: integer; count: integer): string; +begin + if count = 0 then begin + Result := ''; + Exit; + end; + SetLength(Result, count); + Move(Pointer(@Bytes[index])^, PChar(Result)^, Length(Result)); +end; + +class function Encoding.GetWideString(const bytes: TBytes): WideString; +begin + Result := GetString(bytes); +end; + +class function Encoding.GetWideString(const bytes: TBytes; index: integer; count: integer): WideString; +begin + Result := GetString(bytes, index, count); +end; + +{ UnicodeEncoding } + +class function UnicodeEncoding.GetString(const bytes: TBytes): string; +begin + Result := GetWideString(bytes); +end; + +class function UnicodeEncoding.GetString(const bytes: TBytes; index: integer; count: integer): string; +begin + Result := GetWideString(bytes, index, count); +end; + +class function UnicodeEncoding.GetWideString(const bytes: TBytes): WideString; +begin + Result := GetWideString(bytes, 0, Length(bytes)); +end; + +class function UnicodeEncoding.GetWideString(const bytes: TBytes; index: integer; count: integer): WideString; +begin + if count = 0 then begin + Result := ''; + Exit; + end; + SetLength(Result, count shr 1); + Move(Pointer(@bytes[index])^, PWideChar(Result)^, count); +end; + +{ UTF8Encoding } + +{$IFDEF UTF8} + +// UnicodeToUTF8(3): +// Scans the source data to find the null terminator, up to MaxBytes +// Dest must have MaxBytes available in Dest. + +function UnicodeToUtf8(Dest: PChar; Source: PWideChar; MaxBytes: Integer): Integer; +var + len: Cardinal; +begin + len := 0; + if Source <> nil then + while Source[len] <> #0 do + Inc(len); + Result := CLRClasses.UnicodeToUtf8(Dest, MaxBytes, Source, len); +end; + +// UnicodeToUtf8(4): +// MaxDestBytes includes the null terminator (last char in the buffer will be set to null) +// Function result includes the null terminator. +// Nulls in the source data are not considered terminators - SourceChars must be accurate + +function UnicodeToUtf8(Dest: PChar; MaxDestBytes: Cardinal; Source: PWideChar; SourceChars: Cardinal): Cardinal; +var + i, count: Cardinal; + c: Cardinal; +begin + Result := 0; + if Source = nil then Exit; + count := 0; + i := 0; + if Dest <> nil then + begin + while (i < SourceChars) and (count < MaxDestBytes) do + begin + c := Cardinal(Source[i]); + Inc(i); + if c <= $7F then + begin + Dest[count] := Char(c); + Inc(count); + end + else if c > $7FF then + begin + if count + 3 > MaxDestBytes then + break; + Dest[count] := Char($E0 or (c shr 12)); + Dest[count+1] := Char($80 or ((c shr 6) and $3F)); + Dest[count+2] := Char($80 or (c and $3F)); + Inc(count,3); + end + else // $7F < Source[i] <= $7FF + begin + if count + 2 > MaxDestBytes then + break; + Dest[count] := Char($C0 or (c shr 6)); + Dest[count+1] := Char($80 or (c and $3F)); + Inc(count,2); + end; + end; + if count >= MaxDestBytes then count := MaxDestBytes-1; + Dest[count] := #0; + end + else + begin + while i < SourceChars do + begin + c := Integer(Source[i]); + Inc(i); + if c > $7F then + begin + if c > $7FF then + Inc(count); + Inc(count); + end; + Inc(count); + end; + end; + Result := count+1; // convert zero based index to byte count +end; + +function Utf8ToUnicode(Dest: PWideChar; Source: PChar; MaxChars: Integer): Integer; +var + len: Cardinal; +begin + len := 0; + if Source <> nil then + while Source[len] <> #0 do + Inc(len); + Result := CLRClasses.Utf8ToUnicode(Dest, MaxChars, Source, len); +end; + +function Utf8ToUnicode(Dest: PWideChar; MaxDestChars: Cardinal; Source: PChar; SourceBytes: Cardinal): Cardinal; +var + i, count: Cardinal; + c: Byte; + wc: Cardinal; +begin + if Source = nil then + begin + Result := 0; + Exit; + end; + Result := Cardinal(-1); + count := 0; + i := 0; + if Dest <> nil then + begin + while (i < SourceBytes) and (count < MaxDestChars) do + begin + wc := Cardinal(Source[i]); + Inc(i); + if (wc and $80) <> 0 then + begin + if i >= SourceBytes then Exit; // incomplete multibyte char + wc := wc and $3F; + if (wc and $20) <> 0 then + begin + c := Byte(Source[i]); + Inc(i); + if (c and $C0) <> $80 then Exit; // malformed trail byte or out of range char + if i >= SourceBytes then Exit; // incomplete multibyte char + wc := (wc shl 6) or (c and $3F); + end; + c := Byte(Source[i]); + Inc(i); + if (c and $C0) <> $80 then Exit; // malformed trail byte + + Dest[count] := WideChar((wc shl 6) or (c and $3F)); + end + else + Dest[count] := WideChar(wc); + Inc(count); + end; + if count >= MaxDestChars then count := MaxDestChars-1; + Dest[count] := #0; + end + else + begin + while (i < SourceBytes) do + begin + c := Byte(Source[i]); + Inc(i); + if (c and $80) <> 0 then + begin + if i >= SourceBytes then Exit; // incomplete multibyte char + c := c and $3F; + if (c and $20) <> 0 then + begin + c := Byte(Source[i]); + Inc(i); + if (c and $C0) <> $80 then Exit; // malformed trail byte or out of range char + if i >= SourceBytes then Exit; // incomplete multibyte char + end; + c := Byte(Source[i]); + Inc(i); + if (c and $C0) <> $80 then Exit; // malformed trail byte + end; + Inc(count); + end; + end; + Result := count+1; +end; + +function Utf8Encode(const WS: WideString): UTF8String; +var + L: Integer; + Temp: UTF8String; +begin + Result := ''; + if WS = '' then Exit; + SetLength(Temp, Length(WS) * 3); // SetLength includes space for null terminator + + L := CLRClasses.UnicodeToUtf8(PChar(Temp), Length(Temp)+1, PWideChar(WS), Length(WS)); + if L > 0 then + SetLength(Temp, L-1) + else + Temp := ''; + Result := Temp; +end; + +function Utf8Decode(const S: UTF8String): WideString; +var + L: Integer; + Temp: WideString; +begin + Result := ''; + if S = '' then Exit; + SetLength(Temp, Length(S)); + + L := CLRClasses.Utf8ToUnicode(PWideChar(Temp), Length(Temp)+1, PChar(S), Length(S)); + if L > 0 then + SetLength(Temp, L-1) + else + Temp := ''; + Result := Temp; +end; + +function AnsiToUtf8(const S: string): UTF8String; +begin + Result := Utf8Encode(S); +end; + +function Utf8ToAnsi(const S: UTF8String): string; +begin + Result := Utf8Decode(S); +end; + +{$ENDIF} + +class function UTF8Encoding.GetBytes(const chars: string): TBytes; +var + UTF8: UTF8String; +begin + UTF8 := AnsiToUtf8(chars); + SetLength(Result, Length(UTF8)); + Move(PChar(UTF8)^, Pointer(Result)^, Length(UTF8)); +end; + +class function UTF8Encoding.{$IFNDEF VER5}GetBytes{$ELSE}GetBytesWide{$ENDIF}(const chars: WideString): TBytes; +var + UTF8: UTF8String; +begin + UTF8 := UTF8Encode(chars); + SetLength(Result, Length(UTF8)); + Move(PChar(UTF8)^, Pointer(Result)^, Length(UTF8)); +end; + +class function UTF8Encoding.GetString(const bytes: TBytes; index: integer; count: integer): string; +var + UTF8: UTF8String; +begin + if count = 0 then begin + Result := ''; + Exit; + end; + SetLength(UTF8, count); + + Move(Pointer(@bytes[index])^, PChar(UTF8)^, Length(UTF8)); + Result := Utf8ToAnsi(UTF8); +end; + +class function UTF8Encoding.GetWideString(const bytes: TBytes): WideString; +begin + Result := GetWideString(bytes, 0, Length(bytes)); +end; + +class function UTF8Encoding.GetWideString(const bytes: TBytes; index: integer; count: integer): WideString; +var + UTF8: UTF8String; +begin + if count = 0 then begin + Result := ''; + Exit; + end; + SetLength(UTF8, count); + + Move(Pointer(@bytes[index])^, PChar(UTF8)^, Length(UTF8)); + Result := UTF8Decode(UTF8); +end; + +{$IFDEF BCB} +{Added to avoid C++ Builder 6 bug} + +class function UTF8Encoding.GetBytes(const chars: string; charIndex, charCount: int; var bytes: TBytes; byteIndex: int): int; +begin + Result := inherited GetBytes(chars, charIndex, charCount, bytes, byteIndex); +end; + +class function UTF8Encoding.{$IFNDEF VER5}GetBytes{$ELSE}GetBytesWide{$ENDIF}(const chars: WideString; charIndex, charCount: int; var bytes: TBytes; byteIndex: int): int; +begin + Result := inherited GetBytes(chars, charIndex, charCount, bytes, byteIndex); +end; + +class function UTF8Encoding.GetString(const bytes: TBytes): string; +begin + Result := inherited GetString(bytes); +end; + +{$ENDIF} + + +{ StringBuilder } + +constructor StringBuilder.Create(capacity: integer); +begin + FActualLength := 0; + SetLength(FString, capacity); +end; + +constructor StringBuilder.Create(const value: string; capacity: integer); +begin + Create(capacity); + Append(value); +end; + +procedure StringBuilder.SetActualLength(Value: integer); +var + l: integer; +begin + l := System.Length(FString); + if l - FActualLength < Value then + SetLength(FString, FActualLength + Value + l shr 1); + FActualLength := Value; +end; + +procedure StringBuilder.Append(const value: string); +var + l, ls: integer; + +begin + ls := System.Length(value); + if ls = 0 then + Exit; + + l := System.Length(FString); + if l - FActualLength < ls then + SetLength(FString, FActualLength + ls + l shr 1); + Move(PChar(value)^, PChar(@FString[FActualLength + 1])^, ls); + Inc(FActualLength, ls); +end; + +procedure StringBuilder.Append(const value: string; const startIndex: integer; const count: integer); +var + l: integer; + +begin + if count = 0 then + Exit; + + l := System.Length(FString); + if l - FActualLength < count then + SetLength(FString, FActualLength + count + l shr 1); + Move((PChar(value) + startIndex)^, PChar(@FString[FActualLength + 1])^, count); + Inc(FActualLength, count); +end; + +procedure StringBuilder.Append(const value: char); +var + l: integer; + +begin + l := System.Length(FString); + if l - FActualLength < 1 then + SetLength(FString, FActualLength + 1 + l shr 1); + FString[FActualLength + 1] := value; + Inc(FActualLength); +end; + +procedure StringBuilder.Append(const value: char; repeatCount: integer); +var + s: string; +begin + s := StringOfChar(value, repeatCount); + Append(s); +end; + +procedure StringBuilder.Append(value: StringBuilder); +var + l: integer; + +begin + if (value = nil) or (value.Length = 0) then + Exit; + + l := System.Length(FString); + if l - FActualLength < value.Length then + SetLength(FString, FActualLength + value.Length + l shr 1); + Move(PChar(value.FString)^, PChar(@FString[FActualLength + 1])^, value.Length); + Inc(FActualLength, value.Length); +end; + +procedure StringBuilder.Insert(index: integer; const value: string); +var + l, ls: integer; + +begin + l := System.Length(FString); + ls := System.Length(value); + if l - FActualLength < ls then + SetLength(FString, FActualLength + ls + l shr 1); + + Move(PChar(@FString[Index + 1])^, PChar(@FString[Index + ls + 1])^, FActualLength - Index); + Move(PChar(value)^, PChar(@FString[Index + 1])^, ls); + + Inc(FActualLength, ls); +end; + +procedure StringBuilder.Replace(const OldValue: string; const NewValue: string); + + function PosEx(const SubStr, S: string; Offset, Len: integer): Integer; + var + I,X: Integer; + LenSubStr: Integer; + begin + I := Offset; + LenSubStr := System.Length(SubStr); + Len := Len - LenSubStr + 1; + while I <= Len do begin + if S[I] = SubStr[1] then begin + X := 1; + while (X < LenSubStr) and (S[I + X] = SubStr[X + 1]) do + Inc(X); + if (X = LenSubStr) then + begin + Result := I; + exit; + end; + end; + Inc(I); + end; + Result := 0; + end; + + procedure Insert(index: integer; const value: string; offset: integer); + var + l, ls: integer; + begin + l := System.Length(FString); + ls := System.Length(value) - offset + 1; + if l - FActualLength < ls then + SetLength(FString, FActualLength + ls + l shr 1); + + if FActualLength > Index then + Move(PChar(@FString[Index + 1])^, PChar(@FString[Index + ls + 1])^, FActualLength - Index); + Move(PChar(@value[offset])^, PChar(@FString[Index + 1])^, ls); + end; + +var + lOld, lNew: integer; + Index: integer; + +begin + lOld := System.Length(OldValue); + lNew := System.Length(NewValue); + Index := PosEx(OldValue, FString, 1, FActualLength); + + while Index > 0 do begin + if lOld > lNew then begin + Move(PChar(NewValue)^, PChar(@FString[Index])^, lNew); + Move(PChar(@FString[Index + lOld])^, PChar(@FString[Index + lNew])^, FActualLength - Index - lOld + 1); + end else + if lOld < lNew then begin + Move(PChar(NewValue)^, PChar(@FString[Index])^, lOld); + Insert(Index + lOld - 1, NewValue, lOld + 1); + end else + Move(PChar(NewValue)^, PChar(@FString[Index])^, lNew); + + Inc(FActualLength, lNew - lOld); + Index := PosEx(OldValue, FString, Index + lNew, FActualLength); + end; +end; + +function StringBuilder.ToString: string; +begin + Result := Copy(FString, 1, FActualLength); +end; + +{ Buffer } + +class procedure Buffer.BlockCopy(const src: TBytes; srcOffset: integer; const dst: TBytes; dstOffset: integer; count: integer); +begin + Move((PChar(src) + srcOffset)^, (PChar(dst) + dstOffset)^, count); +end; + +{ MemoryStream } +constructor MemoryStream.Create(capacity: int); +begin + inherited Create; + System.SetLength(FData, capacity); +end; + +procedure MemoryStream.Close; +begin + System.SetLength(FData, 0); +end; + +procedure MemoryStream.SetLength(Value: Integer); +const + MinCapacity = $FFFF; +var + l: integer; +begin + l := System.Length(FData); // Performance opt + if (Value > l) or (l > MinCapacity) then + System.SetLength(FData, Value); + + FLength := Value; +end; + +procedure MemoryStream.SetPosition(const Pos: Integer); +begin + if Pos > Length then + Length := Pos; + FPosition := Pos; +end; + +function MemoryStream.Read(var Buffer: TBytes; Offset: int; Count: int): int; +begin + Result := Read(PChar(@Buffer[0]), Offset, Count); +end; + +function MemoryStream.Read(Buffer: PChar; Offset: int; Count: int): int; +begin + Result := System.Length(FData) - FPosition; + if Result > Count then + Result := Count; + Move(PChar(@FData[FPosition])^, Buffer[Offset], Result); + Inc(FPosition, Result); +end; + +function MemoryStream.ReadByte: Byte; +begin + Result := FData[FPosition]; + Inc(FPosition); +end; + +function MemoryStream.GetBuffer: PChar; +begin + Result := @FData[0]; +end; + +procedure MemoryStream.Write(const Buffer: TBytes; Offset: int; Count: int); +begin + Write(PChar(@Buffer[0]), Offset, Count); +end; + +procedure MemoryStream.Write(Buffer: PChar; Offset: int; Count: int); +var + l: integer; +begin + l := FPosition + Count; + if l > Length then + Length := l; + Move(Buffer[Offset], PChar(@FData[FPosition])^, Count); + Inc(FPosition, Count); +end; + +procedure MemoryStream.WriteByte(value: Byte); +var + l: integer; +begin + l := FPosition + 1; + if l > Length then + Length := l; + FData[FPosition] := Value; + Inc(FPosition); +end; + +function MemoryStream.Seek(Offset: Longint; Origin: Word): Longint; +begin + case Origin of + soFromBeginning: FPosition := Offset; + soFromCurrent: FPosition := FPosition + Offset; + soFromEnd: FPosition := System.Length(FData) - Offset; + end; + if FPosition > System.Length(FData) then + FPosition := System.Length(FData) + else if FPosition < 0 then FPosition := 0; + Result := FPosition; +end; + +{ ArgumentException } +constructor ArgumentException.Create; +begin + inherited Create(''); +end; + +constructor ArgumentException.Create(const Msg: string); +begin + inherited Create(Msg); +end; + +constructor NotSupportedException.Create; +begin + inherited Create(''); +end; + +constructor NotSupportedException.Create(const Msg: string); +begin + inherited Create(Msg); +end; + +initialization + +end. diff --git a/internal/4.10.0.10/1/Source/CRAccess.pas b/internal/4.10.0.10/1/Source/CRAccess.pas new file mode 100644 index 0000000..4c62071 --- /dev/null +++ b/internal/4.10.0.10/1/Source/CRAccess.pas @@ -0,0 +1,1696 @@ + +////////////////////////////////////////////////// +// DB Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +// Core Access +// Created: 01.07.00 +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I Dac.inc} + +unit CRAccess; +{$ENDIF} +interface +uses +{$IFDEF VER6P} + Variants, +{$ENDIF} +{$IFDEF CLR} + System.Runtime.InteropServices, Borland.Vcl.TypInfo, +{$ELSE} + CLRClasses, +{$ENDIF} + SysUtils, Classes, MemData, MemUtils; + +const +// Props + prUsername = 1; // char* + prPassword = 2; // char* + prServer = 4; // char* + prAutoCommit = 5; // bool + prSQL = 10; // char* + prScanParams = 11; // bool + prSQLType = 12; // integer + prRowsProcessed = 13; // integer + + prUniDirectional = 20; // bool + prFetchRows = 21; // integer + prFetchAll = 22; // bool + prRowsFetched = 23; // integer + prExecuting = 24; // bool + prLongStrings = 25; // bool + +/// if False then PutField set Null for string fields with empty value ('') + prEnableEmptyStrings = 26; // bool + + prFlatBuffers = 27; // bool + prConvertEOL = 28; // bool + prIndexFieldNames = 29; // char* +{$IFDEF HAVE_COMPRESS} + prCompressBlobMode = 30; // TCompressBlobMode +{$ENDIF} + prDisconnectedMode = 31; + prDisableParamScan = 32; // Used for ODAC + +// Sub data types +const + dtSingle = 1; + dtUInt8 = 2; + +type + TCRConnection = class; + TCRCommand = class; + TCRRecordSet = class; + TParamDesc = class; + TParamDescs = class; + + TParamDescClass = class of TParamDesc; + + TCommandType = (ctUnknown, ctStatement, ctCursor); + + TCursorState = ( + csInactive, // default state (TCRRecordSet.InternalOpen, TCustomDASQL.SQLChanged) + csOpen, // ODAC only: OCI73 TOCICommand.InternalOpen + csParsed, // ODAC only: OCI73 - statement parsed + csPrepared, // statement prepared + csBound, // ODAC only: parameters bound + csExecuteFetchAll, // ODAC only: + csExecuting, // ODAC only(?): statement is executing (TCRCommand.Execute) + csExecuted, // statement successfully executed + csFetching, // setted on first TCRRecordSet.Fetch + csFetchingAll, // ODAC, IbDAC specific. Setted on the FetchAll start + csFetched // fetch finished or canceled + ); + + TErrorProc = procedure (E: Exception; var Fail, Reconnect: boolean {$IFNDEF LITE}; var Reexecute: boolean; ReconnectAttempt: integer; + var ConnLostCause: TConnLostCause{$ENDIF}) of object; + TReconnectProc = procedure of object; + TBoolProc = procedure (Value: boolean) of object; + TBeforeFetchProc = procedure (out Cancel: boolean) of object; + TAfterFetchProc = procedure of object; + TDataChangeProc = procedure of object; + + EFailOver = class(Exception) + public + FConnLostCause: TConnLostCause; + + constructor Create(ConnLostCause: TConnLostCause); + end; + +{ TCRConnection } + + TCRConnection = class + private + FOnError: TErrorProc; + FOnReconnectError: TReconnectProc; + FOnReconnectSuccess: TReconnectProc; + FConnectionTime: Longword; + + protected + FConnected: boolean; + FUsername: string; + FPassword: string; + FServer: string; + FAutoCommit: boolean; + FConvertEOL: boolean; + FIsValid: boolean; + FPool: TObject; + FPoolVersion: integer; + FComponent: TObject; + FDisconnectedMode: boolean; + + FInProcessError: boolean; + FReconnected: boolean; + procedure DoError(E: Exception; var Fail: boolean); virtual; + + property AutoCommit: boolean read FAutoCommit write FAutoCommit; + + public + constructor Create; virtual; + destructor Destroy; override; + + procedure Connect(const ConnectString: string); virtual; + procedure Disconnect; virtual; abstract; + + procedure StartTransaction; virtual; abstract; + procedure Commit; virtual; abstract; + procedure Rollback; virtual; abstract; + + function GetConnected: boolean; + procedure SetConnected(Value: boolean); + + procedure SetUsername(const Value: string); virtual; + procedure SetPassword(const Value: string); virtual; + procedure SetServer(const Value: string); + + function CheckIsValid: boolean; virtual; abstract; + {$IFNDEF LITE} + procedure ReturnToPool; virtual; + {$ENDIF} + + function SetProp(Prop: integer; const Value: variant): boolean; virtual; + function GetProp(Prop: integer; var Value: variant): boolean; virtual; + + property OnError: TErrorProc read FOnError write FOnError; + property OnReconnectError: TReconnectProc read FOnReconnectError write FOnReconnectError; + property OnReconnectSuccess: TReconnectProc read FOnReconnectSuccess write FOnReconnectSuccess; + + property ConnectionTime: Longword read FConnectionTime; + property IsValid: boolean read FIsValid write FIsValid; + property Pool: TObject read FPool write FPool; + property PoolVersion: integer read FPoolVersion write FPoolVersion; + property Component: TObject read FComponent write FComponent; // Is needed for failover + property DisconnectedMode: boolean read FDisconnectedMode write FDisconnectedMode; + end; + +{ TCRCommand } + + TCRCommand = class + private + protected + FComponent: TObject; + FConnection: TCRConnection; + FSQL: string; + FParams: TParamDescs; + FAutoCommit: boolean; + FAfterExecute: TBoolProc; + FExecuting: boolean; + {$IFDEF HAVE_COMPRESS} + FCompressBlob: TCompressBlobMode; + {$ENDIF} + + property Params: TParamDescs read FParams write FParams; + property Executing: boolean read FExecuting write FExecuting; + + public + constructor Create; virtual; + destructor Destroy; override; + + procedure Prepare; virtual; + procedure Unprepare; virtual; + function GetPrepared: boolean; virtual; abstract; + + procedure Execute(Iters: integer = 1); virtual; abstract; + + procedure SetConnection(Value: TCRConnection); virtual; + procedure SetSQL(const Value: string); virtual; + function GetCursorState: TCursorState; virtual; abstract; + procedure SetCursorState(Value: TCursorState); virtual; abstract; + + { Params } + function GetParamDescType: TParamDescClass; virtual; + procedure ClearParams; + function AddParam: TParamDesc; virtual; + procedure DeleteParam(Index: integer); + function GetParamCount: integer; + function GetParam(Index: integer): TParamDesc; + function FindParam(Name: string): TParamDesc; + + function SetProp(Prop: integer; const Value: variant): boolean; virtual; + function GetProp(Prop: integer; var Value: variant): boolean; virtual; + + property SQL: string read FSQL write SetSQL; + property Component: TObject read FComponent write FComponent; // Is needed for failover + property AfterExecute: TBoolProc read FAfterExecute write FAfterExecute; + end; + +{ $IFNDEF LITE} +{ TCRTableInfo } + + TCRTablesInfo = class; + + TCRTableInfo = class(TObject) + protected + FOwner: TCRTablesInfo; + FIndex: Integer; + FTableName: string; + FTableAlias: string; + FIsView: boolean; + procedure SetTableName(Value: string); + procedure SetTableAlias(Value: string); + function GetTableNameFull: string; virtual; + procedure SetTableNameFull(Value: string); virtual; + public + constructor Create(Owner: TCRTablesInfo); virtual; + + class function NormalizeName(Value: string; const QuoteNames: boolean = False): string; overload; virtual; + class function NormalizeName(Value: string; const LeftQ: char; const RightQ: char; const QuoteNames: boolean = False): string; overload; virtual; + + class function LeftQuote: Char; virtual; + class function RightQuote: Char; virtual; + + class function Quote(const Value: string; const LeftQ: char; const RightQ: char): string; + class function UnQuote(const Value: string): string; + class function IsQuoted(const Value: string): boolean; virtual; + class function QuotesNeeded(Value: string): boolean; virtual; + + property TableName: string read FTableName write SetTableName; + property TableAlias: string read FTableAlias write SetTableAlias; + property TableNameFull: string read GetTableNameFull write SetTableNameFull; + property IsView: boolean read FIsView write FIsView; + property Index: Integer read FIndex write FIndex; + end; + + TTableInfoClass = class of TCRTableInfo; + + TCRTablesInfo = class + private + function GetItem(Index: Integer): TCRTableInfo; + procedure SetItem(Index: Integer; const Value: TCRTableInfo); + protected + FList: array of TCRTableInfo; + FUpdateCount: Integer; + FTableInfoClass: TTableInfoClass; + FTableNameList: TStringList; + FTableAliasList: TStringList; + FIsNormalized: Boolean; + procedure InternalAdd(TableInfo: TCRTableInfo); + procedure Changed; + procedure TableNameChanged; + procedure TableAliasChanged; + function GetCount: Integer; + public + constructor Create(TableInfoClass: TTableInfoClass); + destructor Destroy; override; + function Add: TCRTableInfo; + procedure Clear; + procedure BeginUpdate; virtual; + procedure EndUpdate; virtual; + procedure Normalize; + function FindByName(TableName: string): TCRTableInfo; + function IndexOf(TableInfo: TCRTableInfo): Integer; + function IndexByName(TableName: string): Integer; + function IndexByAlias(TableAlias: string): Integer; + property Items[Index: Integer]: TCRTableInfo read GetItem write SetItem; default; + property Count: Integer read GetCount; + property TableInfoClass: TTableInfoClass read FTableInfoClass; + end; +{ $ENDIF} + +{ TCRFieldDesc} + + TCRFieldDesc = class (TFieldDesc) + { $IFNDEF LITE} + protected + FTableInfo: TCRTableInfo; + FActualNameQuoted: array[boolean] of string; // cache for [QuoteNames] + public + function ActualNameQuoted(RecordSet: TCRRecordSet; const QuoteNames: boolean): string; virtual; + + property TableInfo: TCRTableInfo read FTableInfo write FTableInfo; + { $ENDIF} + end; + +{ TCRRecordSet } + + TCRRecordSet = class (TMemData) + private + protected + FCommand: TCRCommand; + FUniDirectional: boolean; + FFetchRows: integer; + FFetchAll: boolean; + FLongStrings: boolean; + FFlatBuffers: boolean; + + FAfterExecFetch: TBoolProc; + FAfterFetchAll: TBoolProc; + FOnBeforeFetch: TBeforeFetchProc; + FOnAfterFetch: TAfterFetchProc; + FOnDataChanged: TDataChangeProc; + FWaitForFetchBreak: boolean; + FCommandType: TCommandType; + + { $IFNDEF LITE} + FTablesInfo: TCRTablesInfo; + { $ENDIF} + + procedure CreateCommand; virtual; abstract; + procedure FreeCommand; + procedure SetCommand(Value: TCRCommand); virtual; + + function CanFetchBack: boolean; virtual; // Return True, if BlockMan is store only one block of records + + { Open/Close } + procedure InternalPrepare; override; + procedure InternalUnPrepare; override; + procedure InternalOpen; override; + + function NeedInitFields: boolean; virtual; + procedure ExecFetch; virtual; + procedure DoBeforeFetch(out Cancel: boolean); virtual; + procedure DoAfterFetch; virtual; + + { Items/Data } + // procedure PrepareData; override; + + { Fields } + function NeedConvertEOL: boolean; override; + + { TablesInfo } + class function GetTableInfoClass: TTableInfoClass; virtual; + + function GetComponent: TObject; + procedure SetComponent(Value: TObject); + public + constructor Create; virtual; + destructor Destroy; override; + + { Fields} + function GetFieldDescType: TFieldDescClass; override; + + { Open/Close } + procedure Prepare; override; + procedure UnPrepare; override; + procedure Disconnect; virtual; + + procedure Open; override; + procedure Close; override; + procedure ExecCommand; virtual; // Execute command + + { Records } + procedure GetNextRecord(RecBuf: IntPtr); override; + procedure GetPriorRecord(RecBuf: IntPtr); override; + + { Fetch } + procedure FetchAll; virtual; + procedure BreakFetch; virtual;// Breaks fetch. Can be called from other thread or in non-blocking mode + function CanDisconnect: boolean; virtual; + + function RowsReturn: boolean; virtual; + + function GetCommand: TCRCommand; + procedure SetConnection(Value: TCRConnection); virtual; + procedure SetSQL(const Value: string); virtual; + + function SetProp(Prop: integer; const Value: variant): boolean; virtual; + function GetProp(Prop: integer; var Value: variant): boolean; virtual; + + { Filter } + procedure FilterUpdated; override; + + property CommandType: TCommandType read FCommandType write FCommandType; + property AfterExecFetch: TBoolProc read FAfterExecFetch write FAfterExecFetch; + property AfterFetchAll: TBoolProc read FAfterFetchAll write FAfterFetchAll; + property OnBeforeFetch: TBeforeFetchProc read FOnBeforeFetch write FOnBeforeFetch; + property OnAfterFetch: TAfterFetchProc read FOnAfterFetch write FOnAfterFetch; + property OnDataChanged: TDataChangeProc read FOnDataChanged write FOnDataChanged; + + { Sorting } + procedure SortItems; override; + + { $IFNDEF LITE} + { TablesInfo } + property TablesInfo: TCRTablesInfo read FTablesInfo; + { $ENDIF} + property Component: TObject read GetComponent write SetComponent; + end; + +{ TParamDesc } + + TParamDirection = (pdUnknown, pdInput, pdOutput, pdInputOutput, pdResult); + + TParamDesc = class + private + protected + FName: string; + FDataType: word; + FParamType: TParamDirection; + + FSize: integer; + FData: variant; // pointer; + FIsNull: boolean; + FConvertEOL: boolean; + + property Name: string read FName write FName; + property DataType: word read FDataType write FDataType; + property ParamType: TParamDirection read FParamType write FParamType; + property Size: integer read FSize write FSize; + + public + constructor Create; virtual; + destructor Destroy; override; + + procedure Clear; + + function GetName: string; + procedure SetName(Value: string); + + function GetDataType: word; + procedure SetDataType(Value: word); virtual; + + function GetParamType: TParamDirection; + procedure SetParamType(Value: TParamDirection); + + function GetSize: integer; + procedure SetSize(Value: integer); virtual; + + function GetValue: variant; virtual; + procedure SetValue(const Value: variant); virtual; + + function GetObject: TSharedObject; virtual; + procedure SetObject(Value: TSharedObject); virtual; + + function GetNull: boolean; virtual; + procedure SetNull(const Value: boolean); virtual; + + procedure SetConvertEOL(const Value: boolean); + + property Value: variant read FData write SetValue; + end; + +{ TParamDescs } + + TParamDescs = class (TDAList) + private + function GetItems(Index: integer): TParamDesc; + + public + destructor Destroy; override; + + procedure Clear; override; + + function FindParam(Name: string): TParamDesc; + function ParamByName(Name: string): TParamDesc; + + property Items[Index: integer]: TParamDesc read GetItems; default; + end; + +{$IFDEF LINUX} +function GetTickCount: Cardinal; +{$ENDIF} +function GenerateTableName(const FieldDesc: TFieldDesc): string; + + +implementation + +uses +{$IFNDEF LITE} + CRConnectionPool, +{$ENDIF} +{$IFDEF VER6P} + RTLConsts, +{$ELSE} + Consts, +{$ENDIF} +{$IFDEF LINUX} + Libc; +{$ELSE} + Windows; +{$ENDIF} + +{ TCRAccess } + +{$IFDEF LINUX} +function GetTickCount: Cardinal; +var + tv: timeval; +begin + gettimeofday(tv, nil); + {$RANGECHECKS OFF} + Result := int64(tv.tv_sec) * 1000 + tv.tv_usec div 1000; +end; +{$ENDIF} + +function GenerateTableName(const FieldDesc: TFieldDesc): string; +begin + if TCRFieldDesc(FieldDesc).TableInfo <> nil then + Result := TCRFieldDesc(FieldDesc).TableInfo.TableName + else + Result := ''; +end; + +{ EFailOver } + +constructor EFailOver.Create(ConnLostCause: TConnLostCause); +begin + FConnLostCause := ConnLostCause; + inherited Create(''); +end; + +{ TCRConnection } + +constructor TCRConnection.Create; +begin + inherited; + + FConnected:= False; + FIsValid := True; +end; + +destructor TCRConnection.Destroy; +begin + Disconnect; + inherited; +end; + +procedure TCRConnection.Connect(const ConnectString: string); +begin + FConnectionTime := GetTickCount; + FIsValid := True; +end; + +procedure TCRConnection.DoError(E: Exception; var Fail: boolean); +var + Reconnect: boolean; + Attempt: Integer; +{$IFNDEF LITE} + Reexecute: boolean; + ConnLostCause: TConnLostCause; +{$ENDIF} +begin + Attempt := 0; + while not FInProcessError do begin + Reconnect := Attempt > 0; + {$IFNDEF LITE} + Reexecute := False; + {$ENDIF} + if Assigned(OnError) then begin + FInProcessError := True; + try + OnError(E, Fail, Reconnect{$IFNDEF LITE}, Reexecute, Attempt, ConnLostCause{$ENDIF}); + finally + FInProcessError := False; + end; + end; + + if Reconnect then begin + FReconnected := False; + try + FInProcessError := True; + if Attempt = 0 then + Disconnect; + except // don't raise exception + end; + try + Connect(''); + FReconnected := True; + OnReconnectSuccess; + except // don't raise exception + end; + FInProcessError := False; + + {$IFNDEF LITE} + if FReconnected and Reexecute then + raise EFailOver.Create(ConnLostCause); //Failover + {$ENDIF} + + inc(Attempt); + end; + + if not Reconnect and (Attempt > 0) then + if not FReconnected and Assigned(OnReconnectError) then begin + FInProcessError := True; + FConnected := True; // to bypass "Value <> GetConnected" check in TCustomDAConnection.SetConnected + try + OnReconnectError; + except // don't raise exception + end; + FConnected := False; + FInProcessError := False; + end; + + if not Reconnect or FReconnected then + break; + end; +end; + +function TCRConnection.GetConnected: boolean; +begin + Result := FConnected; +end; + +procedure TCRConnection.SetConnected(Value: boolean); +begin + if Value then + Connect('') + else + Disconnect; +end; + +procedure TCRConnection.SetUsername(const Value: string); +begin + FUsername := Value; +end; + +procedure TCRConnection.SetPassword(const Value: string); +begin + FPassword := Value; +end; + +procedure TCRConnection.SetServer(const Value: string); +begin + FServer := Value; +end; + +{$IFNDEF LITE} +procedure TCRConnection.ReturnToPool; +begin + Assert(FPool <> nil); + FOnError := nil; + Component := nil; + TCRConnectionPool(FPool).PutConnection(Self); +end; +{$ENDIF} + +function TCRConnection.SetProp(Prop: integer; const Value: variant): boolean; +begin + Result := True; + case Prop of + prAutoCommit: + FAutoCommit := Value; + prConvertEOL: + FConvertEOL := Value; + prDisconnectedMode: + FDisconnectedMode := Boolean(Value); + else + Assert(False, IntToStr(Prop)); + Result := False; + end; +end; + +function TCRConnection.GetProp(Prop: integer; var Value: variant): boolean; +begin + Result := True; + case Prop of + prUsername: // used in Oracle dbExpress driver (TOraSQLMetaData.getProcedureParams) + // to detect if schema name need to be included in procedure name + Value := FUsername; + else + Assert(False, IntToStr(Prop)); + Result := False; + end; +end; + +{ TCRCommand } + +constructor TCRCommand.Create; +begin + inherited; + + FParams:= TParamDescs.Create; +end; + +destructor TCRCommand.Destroy; +begin + FParams.Free; +end; + +procedure TCRCommand.Prepare; +begin + SetCursorState(csPrepared); +end; + +procedure TCRCommand.Unprepare; +begin + SetCursorState(csInactive); +end; + +procedure TCRCommand.SetConnection(Value: TCRConnection); +begin + FConnection := Value; +end; + +procedure TCRCommand.SetSQL(const Value: string); +begin + FSQL := Value; +end; + +{function TCRCommand.GetSQL: PChar; +begin + Result := PChar(FSQL); +end;} + +{ Params } + +function TCRCommand.GetParamDescType: TParamDescClass; +begin + Result := TParamDesc; +end; + +procedure TCRCommand.ClearParams; +begin + FParams.Clear; +end; + +function TCRCommand.AddParam: TParamDesc; +begin + Result := TParamDesc.Create; + FParams.Add(Result); +end; + +procedure TCRCommand.DeleteParam(Index: integer); +begin + TParamDesc(FParams[Index]).Free; + FParams.Delete(Index); +end; + +function TCRCommand.GetParamCount: integer; +begin + Result := FParams.Count; +end; + +function TCRCommand.GetParam(Index: integer): TParamDesc; +begin + Result := FParams[Index]; +end; + +function TCRCommand.FindParam(Name: string): TParamDesc; +begin + Result := FParams.FindParam(Name); +end; + +function TCRCommand.SetProp(Prop: integer; const Value: variant): boolean; +begin + Result := True; + case Prop of + prAutoCommit: + FAutoCommit := Value; + prDisableParamScan:; // Used for ODAC + else + Assert(False, IntToStr(Prop)); + Result := False; + end; +end; + +function TCRCommand.GetProp(Prop: integer; var Value: variant): boolean; +begin + Result := True; + case Prop of + prScanParams: + Value := False; + prExecuting: + Value := FExecuting; + else + Assert(False, IntToStr(Prop)); + Result := False; + end; +end; + +{ $IFNDEF LITE} +{ TCRTableInfo } + +constructor TCRTableInfo.Create(Owner: TCRTablesInfo); +begin + inherited Create; + FOwner := Owner; + FIndex := -1; +end; + +procedure TCRTableInfo.SetTableName(Value: string); +begin + FTableName := Value; + if FOwner <> nil then + FOwner.TableNameChanged; +end; + +procedure TCRTableInfo.SetTableAlias(Value: string); +begin + FTableAlias := Value; + if FOwner <> nil then + FOwner.TableAliasChanged; +end; + +function TCRTableInfo.GetTableNameFull: string; +begin + Result := FTableName; +end; + +procedure TCRTableInfo.SetTableNameFull(Value: string); +begin +end; + +class function TCRTableInfo.IsQuoted(const Value: string): boolean; +var + l: integer; +begin + l := Length(Value); + if (l <= 1) then + Result := False + else + Result := (Value[1] = LeftQuote) and (Value[l] = RightQuote); +end; + +class function TCRTableInfo.Quote(const Value: string; const LeftQ: char; const RightQ: char): string; +begin + if not IsQuoted(Value) then + Result := LeftQ + Value + RightQ + else + Result := Value; +end; + +class function TCRTableInfo.UnQuote(const Value: string): string; +begin + if IsQuoted(Value) then + Result := Copy(Value, 2, length(Value) - 2) + else + Result := Value; +end; + +class function TCRTableInfo.QuotesNeeded(Value: string): boolean; +var + i: integer; +begin + Value := UnQuote(Value); + Result := False; + for i := 1 to Length(Value) do + case Value[i] of + 'a'..'z', 'A'..'Z', '_', '0'..'9':; + else + begin + Result := True; + Exit; + end; + end; +end; + +class function TCRTableInfo.LeftQuote: Char; +begin + Result := Char('"'); +end; + +class function TCRTableInfo.RightQuote: Char; +begin + Result := Char('"'); +end; + +class function TCRTableInfo.NormalizeName(Value: string; const QuoteNames: boolean = False): string; +begin + Result := NormalizeName(Value, LeftQuote, RightQuote, QuoteNames); +end; + +class function TCRTableInfo.NormalizeName(Value: string; const LeftQ: char; const RightQ: char; const QuoteNames: boolean = False): string; +var + i: integer; +begin + if Value = '' then begin + Result := ''; + Exit; + end; + + i := Pos('.', Value); + if i <> 0 then + Result := NormalizeName(Copy(Value, 1, i - 1), QuoteNames) + '.' + NormalizeName(Copy(Value, i + 1, Length(Value) - i), QuoteNames) + else + if QuoteNames or QuotesNeeded(Value) then + Result := Quote(Value, LeftQ, RightQ) + else + Result := UnQuote(Value); +end; + +{ TCRTablesInfo } + +constructor TCRTablesInfo.Create(TableInfoClass: TTableInfoClass); +begin + inherited Create; + FTableInfoClass := TableInfoClass; + FTableNameList := TStringList.Create; + FTableAliasList := TStringList.Create; +{$IFDEF VER6P} + // Just in case + FTableNameList.CaseSensitive := False; + FTableAliasList.CaseSensitive := False; +{$ENDIF} + FUpdateCount := 0; +end; + +destructor TCRTablesInfo.Destroy; +begin + Clear; + FTableNameList.Free; + FTableAliasList.Free; + inherited Destroy; +end; + +procedure TCRTablesInfo.InternalAdd(TableInfo: TCRTableInfo); +var + c: integer; +begin + c := Count; + SetLength(FList, c + 1); + FList[c] := TableInfo; + TableInfo.Index := c; +end; + +function TCRTablesInfo.Add: TCRTableInfo; +begin + Result := FTableInfoClass.Create(Self); + InternalAdd(Result); +end; + +procedure TCRTablesInfo.Clear; +var + i: Integer; +begin + if Count > 0 then begin + for i := 0 to Count - 1 do + FList[i].Free; + SetLength(FList, 0); + Changed; + FIsNormalized := False; + end; +end; + +procedure TCRTablesInfo.Changed; +begin + TableNameChanged; + TableAliasChanged; +end; + +procedure TCRTablesInfo.TableNameChanged; +var + i: Integer; +begin + if FUpdateCount = 0 then begin + FTableNameList.Clear; + for i := 0 to Count - 1 do + FTableNameList.AddObject(FList[i].TableName, FList[i]); + FTableNameList.Sort; + end; +end; + +procedure TCRTablesInfo.TableAliasChanged; +var + i: Integer; +begin + if FUpdateCount = 0 then begin + FTableAliasList.Clear; + for i := 0 to Count - 1 do + FTableAliasList.AddObject(FList[i].TableAlias, FList[i]); + FTableAliasList.Sort; + end; +end; + +function TCRTablesInfo.GetCount: Integer; +begin + Result := Length(FList); +end; + +procedure TCRTablesInfo.BeginUpdate; +begin + Inc(FUpdateCount); +end; + +procedure TCRTablesInfo.EndUpdate; +begin + Dec(FUpdateCount); + Changed; +end; + +procedure TCRTablesInfo.Normalize; +var + i: integer; +begin + BeginUpdate; + try + for i := 0 to Count - 1 do begin + FList[i].TableName := TableInfoClass.NormalizeName(FList[i].TableName); + FList[i].TableAlias := TableInfoClass.NormalizeName(FList[i].TableAlias); + FList[i].TableNameFull := TableInfoClass.NormalizeName(FList[i].TableNameFull); + end; + FIsNormalized := True; + finally + EndUpdate; + end; +end; + +function TCRTablesInfo.FindByName(TableName: string): TCRTableInfo; +var + Index: integer; +begin + Index := IndexByName(TableName); + if Index = -1 then + Result := nil + else + Result := FList[Index]; +end; + +function TCRTablesInfo.IndexOf(TableInfo: TCRTableInfo): Integer; +begin + Result := 0; + while (Result < Count) and (FList[Result] <> TableInfo) do + Inc(Result); + if Result = Count then + Result := -1; +end; + +function TCRTablesInfo.IndexByName(TableName: string): Integer; +var + i: integer; +begin + if FIsNormalized then + TableName := TableInfoClass.NormalizeName(TableName); + if FUpdateCount = 0 then begin + Result := FTableNameList.IndexOf(TableName); + if Result <> -1 then + Result := TCRTableInfo(FTableNameList.Objects[Result]).Index; + end + else + begin + Result := -1; + for i := 0 to Count - 1 do + if AnsiSameText(FList[i].TableName, TableName) then begin + Result := i; + Break; + end; + end; +end; + +function TCRTablesInfo.IndexByAlias(TableAlias: string): Integer; +var + i: integer; +begin + if FIsNormalized then + TableAlias := TableInfoClass.NormalizeName(TableAlias); + if FUpdateCount = 0 then begin + Result := FTableAliasList.IndexOf(TableAlias); + if Result <> -1 then + Result := TCRTableInfo(FTableAliasList.Objects[Result]).Index; + end + else + begin + Result := -1; + for i := 0 to Count - 1 do + if AnsiSameText(FList[i].TableAlias, TableAlias) then begin + Result := i; + Break; + end; + end; +end; + +function TCRTablesInfo.GetItem(Index: Integer): TCRTableInfo; +begin + if (Index < 0) or (Index >= Count) then + raise Exception.CreateFmt(SListIndexError, [Index]); + + Result := FList[Index]; +end; + +procedure TCRTablesInfo.SetItem(Index: Integer; const Value: TCRTableInfo); +begin + if (Index >= 0) and (Index < Count) then + if Value <> FList[Index] then + FList[Index] := Value; +end; + +{ TCRFieldDesc } + +function TCRFieldDesc.ActualNameQuoted(RecordSet: TCRRecordSet; const QuoteNames: boolean): string; +begin + if FActualNameQuoted[QuoteNames] <> '' then + Result := FActualNameQuoted[QuoteNames] + else + begin + if FTableInfo <> nil then begin + Result := FTableInfo.NormalizeName(ActualName, QuoteNames); + FActualNameQuoted[QuoteNames] := Result; + end + else begin + Result := RecordSet.GetTableInfoClass.NormalizeName(ActualName, QuoteNames); + FActualNameQuoted[QuoteNames] := Result; + end; + end; +end; +{ $ENDIF} + +{ TCRRecordSet } + +constructor TCRRecordSet.Create; +begin + inherited; + + FAfterExecFetch := nil; + FAfterFetchAll := nil; + + FTablesInfo := TCRTablesInfo.Create(GetTableInfoClass); + CreateCommand; + + FLongStrings := True; + FFlatBuffers := True; +end; + +destructor TCRRecordSet.Destroy; +begin + FreeCommand; + +{ $IFNDEF LITE} + FTablesInfo.Free; +{ $ENDIF} + + inherited; +end; + +{procedure TCRRecordSet.CreateCommand; +begin + SetCommand(nil); +end;} + +procedure TCRRecordSet.FreeCommand; +begin + FCommand.Free; + SetCommand(nil); +end; + +procedure TCRRecordSet.SetCommand(Value: TCRCommand); +begin + FCommand := Value; +end; + +function TCRRecordSet.CanFetchBack: boolean; +begin + Result := False; +end; + +{ Open/Close } + +procedure TCRRecordSet.InternalPrepare; +begin + FCommand.Prepare; +end; + +procedure TCRRecordSet.InternalUnPrepare; +begin + FCommand.UnPrepare; +end; + +procedure TCRRecordSet.InternalOpen; +begin + try + inherited; + + FEOF := False; + + ExecFetch; + except + if not Prepared then + InternalUnprepare; + + if FCommand.GetCursorState = csExecuted then + FCommand.SetCursorState(csInactive); + + raise; + end +end; + +procedure TCRRecordSet.Prepare; +begin + if not Prepared then begin + + inherited; + + if CommandType = ctCursor then + try + InitFields; + Prepared := True; + except + Prepared := False; + InternalUnPrepare; + raise; + end; + end; +end; + +procedure TCRRecordSet.Unprepare; +begin + try + inherited; + finally + { $IFNDEF LITE} + FTablesInfo.Clear; + { $ENDIF} + end; +end; + +procedure TCRRecordSet.Disconnect; +begin + InternalUnprepare; //Remove all links to DB but not close Data + Prepared := False; //Set recordset unprepared in case of disconnect mode and + //explicit disconnection this will prevent from wrong Prepare state +end; + +procedure TCRRecordSet.Open; +begin + inherited; +end; + +procedure TCRRecordSet.Close; +begin + inherited; +end; + +procedure TCRRecordSet.ExecCommand; +begin + FCommand.Execute; + FWaitForFetchBreak := False; +end; + +function TCRRecordSet.NeedInitFields: boolean; +begin + Result := False; +end; + +procedure TCRRecordSet.ExecFetch; +var + OldCommandType: TCommandType; +begin + OldCommandType := CommandType; + + ExecCommand; + + if (OldCommandType <> ctCursor) or NeedInitFields then + InitFields; + + if FFetchAll then + FetchAll + else + Fetch; +end; + +procedure TCRRecordSet.BreakFetch; // Breaks fetch. Can be called from other thread or in non-blocking mode +begin + FWaitForFetchBreak := True; +end; + +procedure TCRRecordSet.DoBeforeFetch(out Cancel: boolean); +begin + Cancel := FWaitForFetchBreak; + + if Assigned(FOnBeforeFetch) then + FOnBeforeFetch(Cancel); + + if Cancel then begin + // reset cursor state for FetchAll + if (FCommand.GetCursorState = csFetchingAll) then + FCommand.SetCursorState(csFetching); + end; +end; + +procedure TCRRecordSet.DoAfterFetch; +begin + if Assigned(FOnAfterFetch) then + FOnAfterFetch; +end; + +procedure TCRRecordSet.SortItems; +begin + if IndexFields.Count = 0 then + Exit; + FetchAll; + + inherited SortItems; +end; + +{ Fields } +function TCRRecordSet.GetFieldDescType: TFieldDescClass; +begin + Result := TCRFieldDesc; +end; + +function TCRRecordSet.NeedConvertEOL: boolean; +begin + if (FCommand = nil) or (FCommand.FConnection = nil) then + Result := False + else + Result := FCommand.FConnection.FConvertEOL; +end; + +{ Records } + +procedure TCRRecordSet.GetNextRecord(RecBuf: IntPtr); +var + Found: boolean; + Item: PItemHeader; +begin + if not EOF then begin + if IntPtr(FirstItem) = nil then begin + if not Fetch then begin + FEOF := True; + Exit; + end + else + CurrentItem := FirstItem; + end + else + if IntPtr(CurrentItem) = nil then + CurrentItem := FirstItem + else + CurrentItem := CurrentItem.Next; + + repeat + if IntPtr(CurrentItem) = nil then begin + Item := LastItem; + + if not Fetch then begin + FEOF := True; + Exit; + end + else begin + if FUniDirectional or CanFetchBack then begin + FirstItem.Prev := nil; // remove cycle link + LastItem.Next := nil; + end; + if (IntPtr(Item.Next) = nil) or FUniDirectional then + CurrentItem := FirstItem + else + CurrentItem := Item.Next; + end + end; + + Found := not OmitRecord(CurrentItem); + if not Found then + CurrentItem := CurrentItem.Next; + until Found; + + FBOF := False; + FEOF := False; + if RecBuf <> nil then + GetRecord(RecBuf); + end; +end; + +procedure TCRRecordSet.GetPriorRecord(RecBuf: IntPtr); +var + Found: boolean; + Item: PItemHeader; +begin + if FUniDirectional then begin + FBOF := True; + CurrentItem := nil; + end + else + if not CanFetchBack then + inherited + else + if not BOF then begin + if IntPtr(LastItem) = nil then begin + if not Fetch(True){FetchBack!} then begin + FBOF := True; + Exit; + end + else + CurrentItem := LastItem; + end + else + if IntPtr(CurrentItem) = nil then + CurrentItem := LastItem + else + CurrentItem := CurrentItem.Prev; + + repeat + if IntPtr(CurrentItem) = nil then begin + Item := FirstItem; + + if not Fetch(True){FetchBack!} then begin + FBOF := True; + Exit; + end + else begin + FirstItem.Prev := nil; // remove cycle link + LastItem.Next := nil; + if IntPtr(Item.Prev) = nil then + CurrentItem := LastItem + else + CurrentItem := Item.Prev; + end; + end; + + Found := not OmitRecord(CurrentItem); + if not Found then + CurrentItem := CurrentItem.Prev; + until Found; + + FBOF := False; + FEOF := False; + if RecBuf <> nil then + GetRecord(RecBuf); + end; +end; + +{ Fetch } + +procedure TCRRecordSet.FetchAll; +begin + while Fetch do; +end; + +function TCRRecordSet.CanDisconnect: boolean; +var + CursorState: TCursorState; +begin + Assert(FCommand <> nil); + CursorState := FCommand.GetCursorState; + Result := (CursorState = csInactive) or (CursorState = csFetched); +end; + +function TCRRecordSet.RowsReturn: boolean; +begin + Result := (CommandType = ctCursor); +end; + +function TCRRecordSet.GetCommand: TCRCommand; +begin + Result := FCommand; +end; + +procedure TCRRecordSet.SetConnection(Value: TCRConnection); +begin + FCommand.SetConnection(Value); +end; + +procedure TCRRecordSet.SetSQL(const Value: string); +begin + FCommand.SetSQL(Value); +end; + +function TCRRecordSet.SetProp(Prop: integer; const Value: variant): boolean; +begin + Result := True; + case Prop of + prUniDirectional: + FUniDirectional := Value; + prFetchRows: + FFetchRows := Value; + prFetchAll: + FFetchAll := Value; + prLongStrings: + FLongStrings := Value; + prFlatBuffers: + FFlatBuffers := Value; + prEnableEmptyStrings: + EnableEmptyStrings := Value; + prIndexFieldNames: + SetIndexFieldNames(Value); + {$IFDEF HAVE_COMPRESS} + prCompressBlobMode: + FCommand.FCompressBlob := TCompressBlobMode(Integer(Value)); + {$ENDIF} + else + Assert(False, IntToStr(Prop)); + Result := False; + end; +end; + +procedure TCRRecordSet.SetComponent(Value: TObject); +begin + FCommand.Component := Value; +end; + +function TCRRecordSet.GetComponent: TObject; +begin + Result := FCommand.Component; +end; + +function TCRRecordSet.GetProp(Prop: integer; var Value: variant): boolean; +begin + Result := True; + case Prop of + prFetchAll: + Value := FFetchAll; + else + Assert(False, IntToStr(Prop)); + Result := False; + end; +end; + +procedure TCRRecordSet.FilterUpdated; +var + NotFetched: boolean; +begin + NotFetched := (RecordCount = 0) and not FEOF; + inherited FilterUpdated; + FEOF := FEOF and not NotFetched; +end; + +class function TCRRecordSet.GetTableInfoClass: TTableInfoClass; +begin + Result := TCRTableInfo; +end; + +{ TParamDesc } + +constructor TParamDesc.Create; +begin + inherited; + + FDataType := dtUnknown; +end; + +destructor TParamDesc.Destroy; +begin +end; + +procedure TParamDesc.Clear; +begin + FDataType := dtUnknown; +end; + +function TParamDesc.GetName: string; +begin + Result := FName; +end; + +procedure TParamDesc.SetName(Value: string); +begin + FName := Value; +end; + +function TParamDesc.GetDataType: word; +begin + Result := FDataType; +end; + +procedure TParamDesc.SetDataType(Value: word); +begin + FDataType := Value; +end; + +function TParamDesc.GetParamType: TParamDirection; +begin + Result := FParamType; +end; + +procedure TParamDesc.SetParamType(Value: TParamDirection); +begin + FParamType := Value; +end; + +function TParamDesc.GetSize: integer; +begin + Result := FSize; +end; + +procedure TParamDesc.SetSize(Value: integer); +begin + FSize := Value; +end; + +function TParamDesc.GetValue: variant; +begin + Result := FData; +end; + +procedure TParamDesc.SetValue(const Value: variant); +begin +{$IFNDEF VER6P} + if TVarData(Value).VType = varByRef then + SetObject(TVarData(Value).VPointer) + else +{$ENDIF} + FData := Value; + FIsNull := VarIsEmpty(FData) or VarIsNull(FData); +end; + +function TParamDesc.GetNull: boolean; +begin + Result := FIsNull; +end; + +function TParamDesc.GetObject: TSharedObject; +begin + if VarIsEmpty(FData) or VarIsNull(FData) then + Result := nil + else + begin + {$IFDEF CLR} + Assert(FData is TSharedObject); + Result := TSharedObject(FData); + {$ELSE} + Assert(TVarData(FData).VType = varByRef); + Result := TVarData(FData).VPointer; + {$ENDIF} + end; +end; + +procedure TParamDesc.SetObject(Value: TSharedObject); +begin +{$IFDEF CLR} + FData := Variant(Value); +{$ELSE} + FData := Unassigned; + TVarData(FData).VType := varByRef; + TVarData(FData).VPointer := Value; +{$ENDIF} +end; + +procedure TParamDesc.SetNull(const Value: boolean); +begin + FIsNull := Value; + FData := Unassigned; +end; + +procedure TParamDesc.SetConvertEOL(const Value: boolean); +begin + FConvertEOL := Value; +end; + +{ TParamDescs } + +destructor TParamDescs.Destroy; +begin + Clear; + + inherited; +end; + +procedure TParamDescs.Clear; +var + i:integer; +begin + for i:= 0 to Count - 1 do + if Items[i] <> nil then + TParamDesc(Items[i]).Free; + + inherited Clear; +end; + +function TParamDescs.FindParam(Name: string): TParamDesc; +var + i: integer; +begin + Result := nil; + + for i := 0 to Count - 1 do + if (Items[i] <> nil) then + if AnsiCompareText(TParamDesc(Items[i]).FName, Name) = 0 then begin + Result := Items[i]; + break; + end; +end; + +function TParamDescs.ParamByName(Name: string): TParamDesc; +begin + Result := FindParam(Name); + + if Result = nil then + Assert(False); + //raise Exception.Create(Format(SParamNotFound, [Name])); +end; + +function TParamDescs.GetItems(Index: integer): TParamDesc; +begin + Result := TParamDesc(inherited Items[Index]); +end; + +end. diff --git a/internal/4.10.0.10/1/Source/CRBatchMove.pas b/internal/4.10.0.10/1/Source/CRBatchMove.pas new file mode 100644 index 0000000..7054b96 --- /dev/null +++ b/internal/4.10.0.10/1/Source/CRBatchMove.pas @@ -0,0 +1,695 @@ +////////////////////////////////////////////////// +// DB Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +// DB Access +////////////////////////////////////////////////// +{$IFNDEF CLR} + +{$I Dac.inc} + +unit CRBatchMove; +{$ENDIF} + +interface + +uses +{$IFDEF VER6P} + Variants, +{$ENDIF} + Classes, DB, DBAccess, SysUtils; + +type + TCRBatchMode = (bmAppend, bmUpdate, bmAppendUpdate, bmDelete); + + TCRBatchMoveProgressEvent = procedure (Sender: TObject; Percent: integer) of object; + TDALocate = function: boolean of object; + + TCRFieldMappingMode = (mmFieldIndex, mmFieldName); + + TCRBatchMove = class(TComponent) + private + FFldDestKeys: TFieldArray; + FStrDestKeys: string; + FSrcKeyFields: array of TField; + FDestKeyFields: array of boolean; + FKeyValues: array of Variant; + FFieldMap: array of word; + FPSDestination: IProviderSupport; + Locate: TDALocate; + procedure SetMappings(Value: TStrings); + procedure SetSource(Value: TDataSet); + procedure SetDestination(Value: TDataSet); + function GetProviderSupport(DataSet: TDataSet): IProviderSupport; + function LocateForCustomDaDataSet: boolean; + function LocateForDataSet: boolean; + + protected + FDestination: TDataSet; + FSource: TDataSet; + FMode: TCRBatchMode; + FAbortOnKeyViol: boolean; + FAbortOnProblem: boolean; + FRecordCount: Longint; + FMovedCount: Longint; + FKeyViolCount: Longint; + FProblemCount: Longint; + FChangedCount: Longint; + FMappings: TStrings; + FFieldMappingMode: TCRFieldMappingMode; + FCommitCount: integer; + FOnBatchMoveProgress: TCRBatchMoveProgressEvent; + FTransactionNeeds: boolean; + FAppliedCount: Longint; + FDestCountKeys: word; + + procedure DoBatchMoveProgress(Percent: integer); + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + function GetKeyValues: Variant; + procedure SetFieldsValues(SetKeyFields: boolean); + procedure Append; + procedure Update; + procedure AppendUpdate; + procedure Delete; + + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + procedure Execute; + + property ChangedCount: Longint read FChangedCount; + property KeyViolCount: Longint read FKeyViolCount; + property MovedCount: Longint read FMovedCount; + property ProblemCount: Longint read FProblemCount; + published + property AbortOnKeyViol: boolean read FAbortOnKeyViol write FAbortOnKeyViol default True; + property AbortOnProblem: boolean read FAbortOnProblem write FAbortOnProblem default True; + property CommitCount: integer read FCommitCount write FCommitCount default 0; + property Destination: TDataSet read FDestination write SetDestination; + property Mappings: TStrings read FMappings write SetMappings; + property FieldMappingMode: TCRFieldMappingMode read FFieldMappingMode write FFieldMappingMode default mmFieldIndex; + property Mode: TCRBatchMode read FMode write FMode default bmAppend; + property RecordCount: Longint read FRecordCount write FRecordCount default 0; + property Source: TDataSet read FSource write SetSource; + property OnBatchMoveProgress: TCRBatchMoveProgressEvent read FOnBatchMoveProgress write FOnBatchMoveProgress; + end; + +implementation + +uses +{$IFDEF VER6P} + StrUtils, +{$ENDIF} +{$IFDEF CLR} + System.Xml, System.Runtime.InteropServices, +{$ELSE} + CLRClasses, +{$ENDIF} + CRParser, DAConsts, MemData, MemDS; + +{ TCRBatchMove } + +constructor TCRBatchMove.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + + FAbortOnKeyViol := True; + FAbortOnProblem := True; + FCommitCount := 0; + FMode := bmAppend; + FMappings := TStringList.Create; + FFieldMappingMode := mmFieldIndex; +end; + +destructor TCRBatchMove.Destroy; +begin + Source := nil; + Destination := nil; + FMappings.Free; + + inherited; +end; + +procedure TCRBatchMove.SetSource(Value: TDataSet); +begin + if FSource <> Value then begin + if FSource <> nil then + FSource.RemoveFreeNotification(Self); + FSource := Value; + if FSource <> nil then + FSource.FreeNotification(Self); + end; +end; + +procedure TCRBatchMove.SetDestination(Value: TDataSet); +begin + if FDestination <> Value then begin + if FDestination <> nil then + FDestination.RemoveFreeNotification(Self); + FDestination := Value; + if FDestination <> nil then + FDestination.FreeNotification(Self); + end; +end; + +procedure TCRBatchMove.SetMappings(Value: TStrings); +begin + FMappings.Assign(Value); +end; + +procedure TCRBatchMove.Notification(AComponent: TComponent; Operation: TOperation); +begin + inherited Notification(AComponent, Operation); + + if Operation = opRemove then + begin + if Destination = AComponent then + Destination := nil; + if Source = AComponent then + Source := nil; + end; +end; + +procedure TCRBatchMove.DoBatchMoveProgress(Percent: integer); +begin + if Assigned(FOnBatchMoveProgress) then + FOnBatchMoveProgress(Self, Percent); +end; + +function TCRBatchMove.GetProviderSupport(DataSet: TDataSet): IProviderSupport; +begin + Result := nil; + if DataSet <> nil then + Result := IProviderSupport(DataSet); +end; + +function TCRBatchMove.GetKeyValues: Variant; +var + i: integer; +begin + for i := 0 to FDestCountKeys - 1 do begin + if FSrcKeyFields[i] <> nil then + FKeyValues[i] := FSrcKeyFields[i].AsVariant + else + FKeyValues[i] := '' + end; + + if FDestCountKeys > 1 then + Result := VarArrayOf(FKeyValues) + else + if FDestCountKeys > 0 then + Result := FKeyValues[0] + else + Result := Null; +end; + +procedure TCRBatchMove.SetFieldsValues(SetKeyFields: boolean); +var + fn: integer; + SrcField, DestField: TField; + SrcFieldDesc, DestFieldDesc: TFieldDesc; + SrcBlob, DestBlob: TBlob; + SkipNulls: boolean; + bs: TStringStream; + SrcStream, DestStream: TStream; + SrcPtr: IntPtr; + Optimization: Boolean; +{$IFDEF CLR} + Data: TBytes; +{$ENDIF} +begin + SkipNulls := (Mode = bmAppend) or (Mode = bmAppend) and SetKeyFields; + for fn := 0 to Destination.FieldCount - 1 do begin + if (FFieldMap[fn] = 0) or (not Destination.Fields[fn].CanModify) or + (FDestKeyFields[fn] and (not SetkeyFields)) or + Source.Fields[FFieldMap[fn] - 1].IsNull and SkipNulls then + Continue; + + SrcField := Source.Fields[FFieldMap[fn] - 1]; + Assert(SrcField <> nil); + DestField := Destination.Fields[fn]; + Assert(DestField <> nil); + + try + if SrcField.IsNull then + DestField.Clear + else + case DestField.DataType of + ftString, ftFixedChar: + case SrcField.DataType of + ftMemo, ftFmtMemo{$IFDEF VER10P}, ftWideMemo{$ENDIF}: begin + Assert(SrcField is TBlobField); + bs := TStringStream.Create(''); + try + TBlobField(SrcField).SaveToStream(bs); + DestField.AsString := bs.DataString; + finally + bs.Free; + end; + end; + else + DestField.AsString := SrcField.AsString; + end; + ftWideString{$IFDEF VER10P}, ftFixedWideChar{$ENDIF}: + case SrcField.DataType of + ftMemo, ftFmtMemo{$IFDEF VER10P}, ftWideMemo{$ENDIF}: begin + Assert(SrcField is TBlobField); + bs := TStringStream.Create(''); + try + TBlobField(SrcField).SaveToStream(bs); + Assert(DestField is TWideStringField); + TWideStringField(DestField).Value := bs.DataString; + finally + bs.Free; + end; + end; + ftWideString{$IFDEF VER10P}, ftFixedWideChar{$ENDIF}: begin + Assert(SrcField is TWideStringField); + Assert(DestField is TWideStringField); + TWideStringField(DestField).Value := TWideStringField(SrcField).Value; + end + else + DestField.AsString := SrcField.AsString; + end; + ftSmallint, ftInteger, ftWord, ftAutoInc: + DestField.AsInteger := SrcField.AsInteger; + ftLargeint: begin + Assert(DestField is TLargeIntField); + case SrcField.DataType of + ftLargeInt: + TLargeIntField(DestField).AsLargeInt := TLargeIntField(SrcField).AsLargeInt; + else + {$IFDEF VER6P} + TLargeIntField(DestField).AsLargeInt := SrcField.AsVariant; + {$ELSE} + DestField.AsString := SrcField.AsString; + {$ENDIF} + end; + end; + ftBoolean: + DestField.AsBoolean := SrcField.AsBoolean; + ftFloat: + DestField.AsFloat := SrcField.AsFloat; + ftCurrency, ftBCD: + DestField.AsCurrency := SrcField.AsCurrency; + {$IFDEF VER6P} + ftTimeStamp: + DestField.AsSQLTimeStamp := SrcField.AsSQLTimeStamp; + ftFMTBCD: + DestField.AsCurrency := SrcField.AsCurrency; + {$ENDIF} + ftDate, ftTime, ftDateTime: + DestField.AsDateTime := SrcField.AsDateTime; + ftBytes, ftVarBytes: + DestField.AsVariant := SrcField.AsVariant; + ftBlob, ftOraBlob, ftOraClob: begin + DestStream := nil; + try + if SrcField is TBlobField then begin + Optimization := False; + if (SrcField.DataSet is TMemDataSet) and (DestField.DataSet is TMemDataSet) then begin + // TCustomDADataSet optimization + SrcFieldDesc := TMemDataSet(SrcField.DataSet).GetFieldDesc(SrcField); + DestFieldDesc := TMemDataSet(SrcField.DataSet).GetFieldDesc(SrcField); + if SrcFieldDesc.DataType = DestFieldDesc.DataType then begin + SrcBlob := TMemDataSet(SrcField.DataSet).GetBlob(SrcField); + DestBlob := TMemDataSet(DestField.DataSet).GetBlob(DestField); + if SrcBlob.ClassType = DestBlob.ClassType then begin + {$IFDEF HAVE_COMPRESS} + if (SrcField.DataSet is TCustomDADataSet) and (DestField.DataSet is TCustomDADataSet) then + Optimization := TCustomDADataSet(SrcField.DataSet).Options.CompressBlobMode = TCustomDADataSet(DestField.DataSet).Options.CompressBlobMode + else + Optimization := True; + {$ENDIF} + if Optimization then begin + TBlobUtils.SetModified(SrcBlob, True); + TMemDSUtils.SetBlob(TMemDataSet(DestField.DataSet), DestField, SrcBlob); + end; + end; + end; + end; + if not Optimization then begin + DestStream := DestField.DataSet.CreateBlobStream(DestField, bmWrite); + SrcStream := SrcField.DataSet.CreateBlobStream(SrcField, bmRead); + try + DestStream.CopyFrom(SrcStream, 0); + finally + SrcStream.Free; + end; + end; + end + else + if SrcField.DataSize > 0 then begin + DestStream := DestField.DataSet.CreateBlobStream(DestField, bmWrite); + SrcPtr := Marshal.AllocHGlobal(SrcField.DataSize); + try + SrcField.GetData(SrcPtr); + {$IFDEF CLR} + SetLength(Data, SrcField.DataSize); + Marshal.Copy(SrcPtr, Data, 0, SrcField.DataSize); + DestStream.ReadBuffer(Data, SrcField.DataSize); + {$ELSE} + DestStream.ReadBuffer(SrcPtr^, SrcField.DataSize); + {$ENDIF} + finally + Marshal.FreeHGlobal(SrcPtr); + end; + end + else + DestField.AsVariant := SrcField.AsVariant; + finally + DestStream.Free; + end; + end; + ftMemo{$IFDEF VER10P}, ftWideMemo{$ENDIF}: + DestField.AsString := SrcField.AsString; + else + DestField.AsVariant := SrcField.AsVariant; + end; + except + on Exception do begin + Inc(FProblemCount); + if FAbortOnProblem then + raise; + end; + end; + + end; +end; + +function TCRBatchMove.LocateForCustomDaDataSet: boolean; +begin + Result := TCustomDADataSet(Destination).Locate(FFldDestKeys, GetKeyValues, []); +end; + +function TCRBatchMove.LocateForDataSet: boolean; +begin + Result := Destination.Locate(FStrDestKeys, GetKeyValues, []); +end; + +procedure TCRBatchMove.Append; +begin + if FTransactionNeeds and ((FAppliedCount mod FCommitCount) = 0) then + FPSDestination.PSStartTransaction; + + Destination.Append; + SetFieldsValues(True); + Destination.Post; + + Inc(FAppliedCount); + if FTransactionNeeds and ((FAppliedCount mod FCommitCount) = 0) then + FPSDestination.PSEndTransaction(True); +end; + +procedure TCRBatchMove.Update; +begin + if Locate then begin + if FTransactionNeeds and ((FAppliedCount mod FCommitCount) = 0) then + FPSDestination.PSStartTransaction; + + Destination.Edit; + SetFieldsValues(False); + Destination.Post; + Inc(FChangedCount); + + Inc(FAppliedCount); + if FTransactionNeeds and ((FAppliedCount mod FCommitCount) = 0) then + FPSDestination.PSEndTransaction(True); + end; +end; + +procedure TCRBatchMove.AppendUpdate; +begin + if FTransactionNeeds and ((FAppliedCount mod FCommitCount) = 0) then + FPSDestination.PSStartTransaction; + + if Locate then begin + Destination.Edit; + SetFieldsValues(False); + Destination.Post; + Inc(FChangedCount); + end + else begin + Destination.Append; + SetFieldsValues(True); + Destination.Post; + end; + + Inc(FAppliedCount); + if FTransactionNeeds and ((FAppliedCount mod FCommitCount) = 0) then + FPSDestination.PSEndTransaction(True); +end; + +procedure TCRBatchMove.Delete; +begin + if Locate then begin + if FTransactionNeeds and ((FAppliedCount mod FCommitCount) = 0) then + FPSDestination.PSStartTransaction; + + Destination.Delete; + Inc(FChangedCount); + + Inc(FAppliedCount); + if FTransactionNeeds and ((FAppliedCount mod FCommitCount) = 0) then + FPSDestination.PSEndTransaction(True); + end; +end; + +procedure TCRBatchMove.Execute; +type + TAction = procedure of object; +var + OldSourceActive, OldDestinationActive: Boolean; + bookmark: TBookmarkStr; + DestName, SourceName: string; + SrcRecCount: integer; + DestFieldCount: word; + Action: TAction; + row: Integer; + + procedure GetKeyFields; + var + i, p1, p2: integer; + fieldNo: integer; + KeyFields: TKeyAndDataFields; + + procedure SetKeyField; + begin + FDestKeyFields[fieldNo - 1] := True; + if FFieldMap[fieldNo - 1] > 0 then + FSrcKeyFields[FDestCountKeys] := Source.Fields[FFieldMap[fieldNo - 1] - 1] + else + FSrcKeyFields[FDestCountKeys] := nil; + end; + + begin + DestFieldCount := Destination.FieldCount; + SetLength(FSrcKeyFields, DestFieldCount); + SetLength(FDestKeyFields, DestFieldCount); + for i := 0 to DestFieldCount - 1 do + FDestKeyFields[i] := False; + + FDestCountKeys := 0; + if Destination is TCustomDADataSet then begin + TDBAccessUtils.GetKeyAndDataFields(TCustomDADataSet(Destination), KeyFields, True); + + SetLength(FFldDestKeys, Length(KeyFields.KeyFieldDescs)); + for i := 0 to Length(FFldDestKeys) - 1 do begin + FFldDestKeys[i] := TCustomDADataSet(Destination).GetField(KeyFields.KeyFieldDescs[i]); + fieldNo := KeyFields.KeyFieldDescs[i].FieldNo; + SetKeyField; + Inc(FDestCountKeys); + end; + end + else begin + FStrDestKeys := FPSDestination.PSGetKeyFields; + p1 := 1; + p2 := Pos(';', FStrDestKeys); + while p2 > 0 do begin + fieldNo := Destination.FieldByName(Copy(FStrDestKeys, p1, p2 - 1)).FieldNo; + SetKeyField; + Inc(FDestCountKeys); + p1 := p2 + 1; + p2 := PosEx(';', FStrDestKeys, p1); + end; + + if Length(FStrDestKeys) > 0 then begin + fieldNo := Destination.FieldByName(Copy(FStrDestKeys, p1, Length(FStrDestKeys))).FieldNo; + SetKeyField; + Inc(FDestCountKeys); + end; + end; + + SetLength(FSrcKeyFields, FDestCountKeys); + SetLength(FKeyValues, FDestCountKeys); + end; + + procedure GetMappingNames(num: integer); + var + p: Integer; + Mapping: string; + begin + Mapping := FMappings[num]; + p := Pos('=', Mapping); + if p > 0 then begin + DestName := Copy(Mapping, 1, p - 1); + SourceName := Copy(Mapping, p + 1, 255); + end + else begin + DestName := Mapping; + SourceName := Mapping; + end; + end; + + procedure SetMapping; + var + i: integer; + SrcField, DestField: TField; + begin + DestFieldCount := Destination.FieldCount; + SetLength(FFieldMap, DestFieldCount); + // SetLength(FFieldComp, DestFieldCount); + + if FMappings.Count <> 0 then + begin + for i := 0 to DestFieldCount - 1 do + FFieldMap[i] := 0; + + for i := 0 to FMappings.Count - 1 do begin + GetMappingNames(i); + SrcField := Source.FindField(SourceName); + if SrcField = nil then + raise Exception.Create(SCannotFindField + ' ' + SourceName); + DestField := Destination.FindField(DestName); + if DestField = nil then + raise Exception.Create(SCannotFindField + ' ' + DestName); + FFieldMap[DestField.Index] := SrcField.Index + 1; + end; + end + else + case FFieldMappingMode of + mmFieldIndex: + for i := 0 to DestFieldCount - 1 do + if i < Source.FieldCount then + FFieldMap[i] := i + 1 + else + FFieldMap[i] := 0; + mmFieldName: + for i := 0 to DestFieldCount - 1 do begin + SrcField := Source.FindField(Destination.Fields[i].FieldName); + if SrcField <> nil then + FFieldMap[i] := SrcField.Index + 1 + else + FFieldMap[i] := 0; + end; + end; + end; + +var + IsKeyViolation: boolean; + +begin + if (Destination = nil) or (Source = nil) or (Destination = Source) then + DatabaseError(SInvalidBatchMove, Self); + OldSourceActive := Source.Active; + OldDestinationActive := Destination.Active; + try + Source.DisableControls; + Destination.DisableControls; + Source.Open; + Source.CheckBrowseMode; + Source.UpdateCursorPos; + Destination.Open; + Destination.CheckBrowseMode; + Source.CursorPosChanged; + FChangedCount := 0; + FKeyViolCount := 0; + FProblemCount := 0; + FMovedCount := 0; + FAppliedCount := 0; + + FPSDestination := GetProviderSupport(Destination); + if Destination is TCustomDADataSet then + Locate := LocateForCustomDaDataSet + else + Locate := LocateForDataSet; + + SetMapping; + GetKeyFields; + SrcRecCount := Source.RecordCount; + + FTransactionNeeds := (not FPSDestination.PSInTransaction) and (FCommitCount > 0); + if FRecordCount = 0 then begin + bookmark := Source.Bookmark; + Source.First; + end; + + Action := nil; + case FMode of + bmAppend: + Action := Append; + bmUpdate: + Action := Update; + bmAppendUpdate: + Action := AppendUpdate; + bmDelete: + Action := Delete; + else + Assert(False); + end; + + try + for row := 0 to SrcRecCount - 1 do begin + try + if (FRecordCount >= FAppliedCount) and (FRecordCount > 0) then + Exit; + Inc(FMovedCount); + + Action; + except + on E: EDatabaseError do begin + Destination.Cancel; + + if not (Destination is TCustomDADataSet) then + IsKeyViolation := True + else + if E is EDAError then + IsKeyViolation := TDBAccessUtils.IsKeyViolation(TCustomDADataSet(Destination).Connection, EDAError(E)) + else + IsKeyViolation := False; + + if IsKeyViolation then begin + Inc(FKeyViolCount); + if FAbortOnKeyViol or (FMode = bmDelete) then begin + if FTransactionNeeds then + FPSDestination.PSEndTransaction(False); + raise; + end; + end + else + raise; + end; + end; + + DoBatchMoveProgress(Round((row * 100) / SrcRecCount)); + Source.Next; + end; + + finally + if FTransactionNeeds and FPSDestination.PSInTransaction then + FPSDestination.PSEndTransaction(True); + end; + + finally + if FRecordCount = 0 then + Source.Bookmark := bookmark; + if OldDestinationActive then + Destination.First; + Destination.Active := OldDestinationActive; + Source.Active := OldSourceActive; + Destination.EnableControls; + Source.EnableControls; + end; +end; + +end. diff --git a/internal/4.10.0.10/1/Source/CRConnectionPool.pas b/internal/4.10.0.10/1/Source/CRConnectionPool.pas new file mode 100644 index 0000000..589f8be --- /dev/null +++ b/internal/4.10.0.10/1/Source/CRConnectionPool.pas @@ -0,0 +1,725 @@ + +////////////////////////////////////////////////// +// DB Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +// Connection Pooling supports +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I Dac.inc} + +unit CRConnectionPool; +{$ENDIF} + +interface + +uses +{$IFDEF CLR} + ExtCtrls, +{$ELSE} + CLRClasses, +{$ENDIF} + Classes, CRAccess, SyncObjs, MemUtils; + +const + StatisticsCount = 8; + +type + TCRConnectionParametersClass = class of TCRConnectionParameters; + + TCRConnectionPool = class; + TCRConnectionPoolManager = class; + + { TCRConnectionParameters } + + TCRConnectionParameters = class(TPersistent) + protected + procedure AssignTo(Dest: TPersistent); override; + + public + MinPoolSize: integer; + MaxPoolSize: integer; + Username: string; + Server: string; + Password: string; + ConnectionLifeTime: integer; + Validate: boolean; + + constructor Create; virtual; + function Equals(ConnectionParameters: TCRConnectionParameters): boolean; virtual; + end; + + { TCRConnectionPool } + + TCRConnectionPool = class + private + FConnectionParameters: TCRConnectionParameters; + FManager: TCRConnectionPoolManager; + protected + FTakenConnectionsCount: integer; + + procedure Validate; virtual; + procedure Clear; virtual; + procedure AsyncClear; virtual; + function GetTotalConnectionsCount: integer; virtual; + procedure InternalPutConnection(CRConnection: TCRConnection); virtual; abstract; + + property ConnectionParameters: TCRConnectionParameters read FConnectionParameters; + public + constructor Create(Manager: TCRConnectionPoolManager; ConnectionParameters: TCRConnectionParameters); virtual; + destructor Destroy; override; + + function GetConnection: TCRConnection; virtual; abstract; + procedure PutConnection(CRConnection: TCRConnection); + procedure Invalidate; virtual; + + property TotalConnectionsCount: integer read GetTotalConnectionsCount; + end; + + TCRConnectionsArray = array of TCRConnection; + TIntegerArray = array of integer; + TStatisticsArray = array [0..StatisticsCount-1] of integer; + + { TCRLocalConnectionPool } + + TCRLocalConnectionPool = class(TCRConnectionPool) + private + //private ConnectMode connectMode = ConnectMode.Default; + FPooledConnections: TCRConnectionsArray; + FPooledConnectionsCount, FHead, FTail: integer; + FVersions: TIntegerArray; + FVersion: integer; + FStatistics: TStatisticsArray; + FDoomedConnectionsCount: integer; + FInvalidateVersion, FClearVersion: integer; + + hBusy: TEvent; + FLockPooled, FLockTaken, FLockVersion, FLockGet: TCriticalSection; + + function IsLive(CRConnection: TCRConnection): boolean; + function CheckIsValid(Connection: TCRConnection): boolean; + procedure ReserveConnection; + function InternalGetConnection(var Connection: TCRConnection; var Version: integer; + Reserve: boolean = True): boolean; + procedure InternalReturnConnection(Connection: TCRConnection; Version: integer); + procedure InternalFreeConnection(Connection: TCRConnection; Reserved: boolean = False); + + protected + function CreateNewConnector: TCRConnection; virtual; abstract; + + procedure Validate; override; + procedure Clear; override; + procedure AsyncClear; override; + function GetTotalConnectionsCount: integer; override; + procedure InternalPutConnection(CRConnection: TCRConnection); override; + public + // TODO: Add transaction context parameter + constructor Create(Manager: TCRConnectionPoolManager; ConnectionParameters: TCRConnectionParameters); override; + destructor Destroy; override; + + function GetConnection: TCRConnection; override; + procedure Invalidate; override; + end; + + { TValidateThread } + + TValidateThread = class(TThread) + private + FManager: TCRConnectionPoolManager; + {$IFNDEF LINUX} + FEvent: TEvent; + {$ENDIF} + protected + procedure Execute; override; + public + constructor Create(Manager: TCRConnectionPoolManager); + {$IFNDEF LINUX} + destructor Destroy; override; + procedure Terminate; + {$ENDIF} + end; + + { TCRConnectionPoolManager } + + TCRConnectionPoolManager = class + private + FPools: TDAList; + FValidateThread: TValidateThread; + + protected + FLockGet, FLockList: TCriticalSection; + protected + function CreateCRConnectionPool(ConnectionParameters: TCRConnectionParameters): TCRConnectionPool; virtual; abstract; + procedure InternalClear; + procedure InternalAsyncClear; + function GetConnectionPool(ConnectionParameters: TCRConnectionParameters): TCRConnectionPool; + function InternalGetConnection(ConnectionParameters: TCRConnectionParameters): TCRConnection; virtual; + function InternalCheckConnection(Connection: TCRConnection): TCRConnection; virtual; + public + constructor Create; + destructor Destroy; override; + end; + +implementation + +uses +{$IFDEF MSWINDOWS} + Windows, +{$ENDIF} + SysUtils, DAConsts; + +{ TCRConnectionParameters } + +constructor TCRConnectionParameters.Create; +begin + inherited Create; + + MaxPoolSize := 100; +end; + +function TCRConnectionParameters.Equals(ConnectionParameters: TCRConnectionParameters): boolean; +begin + Result := False; + if ConnectionParameters <> nil then + Result := + (MinPoolSize = ConnectionParameters.MinPoolSize) and + (MaxPoolSize = ConnectionParameters.MaxPoolSize) and + (ConnectionLifeTime = ConnectionParameters.ConnectionLifeTime) and + (AnsiCompareText(Username, ConnectionParameters.Username) = 0) and + (AnsiCompareText(Server, ConnectionParameters.Server) = 0) and + (Password = ConnectionParameters.Password) and + (Validate = ConnectionParameters.Validate); +end; + +procedure TCRConnectionParameters.AssignTo(Dest: TPersistent); +begin + if Dest is TCRConnectionParameters then begin + TCRConnectionParameters(Dest).MinPoolSize := MinPoolSize; + TCRConnectionParameters(Dest).MaxPoolSize := MaxPoolSize; + TCRConnectionParameters(Dest).Username := Username; + TCRConnectionParameters(Dest).Password := Password; + TCRConnectionParameters(Dest).Server := Server; + TCRConnectionParameters(Dest).ConnectionLifeTime := ConnectionLifeTime; + TCRConnectionParameters(Dest).Validate := Validate; + end + else + inherited; +end; + +{ TCRConnectionPool } + +constructor TCRConnectionPool.Create(Manager: TCRConnectionPoolManager; ConnectionParameters: TCRConnectionParameters); +begin + inherited Create; + + FConnectionParameters := TCRConnectionParametersClass(ConnectionParameters.ClassType).Create; + FConnectionParameters.Assign(ConnectionParameters); + FManager := Manager; +end; + +destructor TCRConnectionPool.Destroy; +begin + FConnectionParameters.Free; + + inherited; +end; + +function TCRConnectionPool.GetTotalConnectionsCount: integer; +begin + Result := FTakenConnectionsCount; +end; + +procedure TCRConnectionPool.Invalidate; +begin +end; + +procedure TCRConnectionPool.Validate; +begin +end; + +procedure TCRConnectionPool.Clear; +begin +end; + +procedure TCRConnectionPool.AsyncClear; +begin +end; + +procedure TCRConnectionPool.PutConnection(CRConnection: TCRConnection); +begin + InternalPutConnection(FManager.InternalCheckConnection(CRConnection)); +end; + +{ TCRLocalConnectionPool } + +constructor TCRLocalConnectionPool.Create(Manager: TCRConnectionPoolManager; ConnectionParameters: TCRConnectionParameters); +begin + inherited; + + SetLength(FPooledConnections, Self.ConnectionParameters.MaxPoolSize); + SetLength(FVersions, Self.ConnectionParameters.MaxPoolSize); + hBusy := TEvent.Create(nil, True, True, ''); + FLockPooled := TCriticalSection.Create; + FLockTaken := TCriticalSection.Create; + FLockVersion := TCriticalSection.Create; + FLockGet := TCriticalSection.Create; +end; + +destructor TCRLocalConnectionPool.Destroy; +begin + Clear; + FLockPooled.Free; + FLockTaken.Free; + FLockVersion.Free; + FLockGet.Free; + hBusy.Free; + + inherited; +end; + +function TCRLocalConnectionPool.IsLive(CRConnection: TCRConnection): boolean; +var + CurrentTickCount, LifeTime: longword; +begin + Result := FConnectionParameters.ConnectionLifeTime = 0; + if Result then // If connector life time is zero then does not remove connector + Exit; + + CurrentTickCount := GetTickCount; + if CurrentTickCount >= CRConnection.ConnectionTime then + LifeTime := CurrentTickCount - CRConnection.ConnectionTime + else + LifeTime := longword($ffffffff) - CRConnection.ConnectionTime + CurrentTickCount + 1; + Result := LifeTime <= Longword(FConnectionParameters.ConnectionLifeTime); +end; + +function TCRLocalConnectionPool.CheckIsValid(Connection: TCRConnection): boolean; +begin + Result := Connection.CheckIsValid; + Connection.PoolVersion := FInvalidateVersion; +end; + +procedure TCRLocalConnectionPool.ReserveConnection; +begin + Inc(FTakenConnectionsCount); + if FTakenConnectionsCount >= ConnectionParameters.MaxPoolSize then + hBusy.ResetEvent; +end; + +function TCRLocalConnectionPool.InternalGetConnection(var Connection: TCRConnection; + var Version: integer; Reserve: boolean = True): boolean; +begin + if Reserve then begin + FLockGet.Enter; // must be first + FLockTaken.Enter; + end; + try + FLockPooled.Enter; + try + Result := False; + if not Reserve or (FTakenConnectionsCount < ConnectionParameters.MaxPoolSize) then + if FPooledConnectionsCount > 0 then begin + Connection := FPooledConnections[FHead]; + Version := FVersions[FHead]; + Inc(FHead); + if FHead = ConnectionParameters.MaxPoolSize then + FHead := 0; + Dec(FPooledConnectionsCount); + if Reserve then + ReserveConnection; + Result := True; + end; + finally + FLockPooled.Leave; + end; + finally + if Reserve then begin + FLockTaken.Leave; + FLockGet.Leave; + end; + end; +end; + +procedure TCRLocalConnectionPool.InternalReturnConnection(Connection: TCRConnection; + Version: integer); +begin + FLockPooled.Enter; + try + FPooledConnections[FTail] := Connection; + FVersions[FTail] := Version; + Inc(FTail); + if FTail = ConnectionParameters.MaxPoolSize then + FTail := 0; + Inc(FPooledConnectionsCount); + {if FDoomedConnectionsCount > FPooledConnectionsCount - ConnectionParameters.MinPoolSize then + FDoomedConnectionsCount := FPooledConnectionsCount - ConnectionParameters.MinPoolSize;} + + FLockTaken.Enter; + try + Dec(FTakenConnectionsCount); + hBusy.SetEvent; + finally + FLockTaken.Leave; + end; + finally + FLockPooled.Leave; + end; +end; + +procedure TCRLocalConnectionPool.InternalFreeConnection(Connection: TCRConnection; + Reserved: boolean = False); +begin + // TODO: May be this try-except unnecessary + try + Connection.Free; + except + end; + + if not Reserved then begin + FLockTaken.Enter; + try + Dec(FTakenConnectionsCount); + hBusy.SetEvent; + finally + FLockTaken.Leave; + end; + end; +end; + +function TCRLocalConnectionPool.GetConnection: TCRConnection; +const +{$IFDEF LINUX} + Timeout: Longword = $FFFFFFFF; +{$ELSE} + Timeout: Longword = 30000; +{$ENDIF} +var + Version: integer; +{$IFNDEF LINUX} + Ticks, BeginTickCount: cardinal; +{$ENDIF} +begin +{$IFNDEF LINUX} + BeginTickCount := GetTickCount; +{$ENDIF} + FLockGet.Enter; + try + {$IFNDEF LINUX} + Ticks := GetTickCount - BeginTickCount; + {$ENDIF} + if hBusy.WaitFor({$IFDEF LINUX}Timeout{$ELSE}Timeout - Ticks{$ENDIF}) = wrTimeout then + raise Exception.Create(SMaxConnectionsReached); + + FLockTaken.Enter; + try + if FTakenConnectionsCount < ConnectionParameters.MaxPoolSize then + ReserveConnection + else + raise Exception.Create(SMaxConnectionsReached); + finally + FLockTaken.Leave; + end; + + finally + FLockGet.Leave; + end; + + if InternalGetConnection(Result, Version, False) then begin + if (Result.PoolVersion < FClearVersion) or + (ConnectionParameters.Validate or (Result.PoolVersion < FInvalidateVersion)) + and not CheckIsValid(Result) + then begin + InternalFreeConnection(Result, True); + Result := nil; + end; + end + else + Result := nil; + + if Result = nil then + Result := CreateNewConnector; + Result.Pool := Self; + Result.PoolVersion := FInvalidateVersion; +end; + +procedure TCRLocalConnectionPool.InternalPutConnection(CRConnection: TCRConnection); +var + Version: integer; +begin + Assert(CRConnection.Pool = Self); + if not IsLive(CRConnection) or not CRConnection.IsValid or + (CRConnection.PoolVersion < FClearVersion) or + (CRConnection.PoolVersion < FInvalidateVersion) and not CheckIsValid(CRConnection) + then + InternalFreeConnection(CRConnection) + else begin + FLockVersion.Enter; + try + Inc(FVersion); + Version := FVersion; + finally + FLockVersion.Leave; + end; + CRConnection.Pool := nil; // protection from PutConnection call on already pooled connection + InternalReturnConnection(CRConnection, Version); + end; +end; + +procedure TCRLocalConnectionPool.Validate; +var + Connection: TCRConnection; + i, FirstVersion, LastVersion, Doomed, Removed, Version: integer; +begin + FirstVersion := FStatistics[0]; + LastVersion := FStatistics[StatisticsCount - 1]; + for i := StatisticsCount - 1 downto 1 do + FStatistics[i] := FStatistics[i - 1]; + FStatistics[0] := FVersion; + Doomed := (FDoomedConnectionsCount + StatisticsCount - 2) div StatisticsCount; + FDoomedConnectionsCount := FPooledConnectionsCount - ConnectionParameters.MinPoolSize - Doomed; + + i := FTail; + Removed := 0; + while (FHead <> i) and InternalGetConnection(Connection, Version) do begin + if (Version <= LastVersion) or not IsLive(Connection) or + (Connection.PoolVersion < FClearVersion) or + ((Version <= FirstVersion) or (Connection.PoolVersion < FInvalidateVersion)) + and not CheckIsValid(Connection) + then begin + InternalFreeConnection(Connection); + Inc(Removed); + end + else + InternalReturnConnection(Connection, Version); + end; + + if Removed < Doomed then begin + Doomed := Doomed - Removed; + for i := 0 to Doomed - 1 do + if InternalGetConnection(Connection, Version) then + InternalFreeConnection(Connection) + else + break; + end; +end; + +procedure TCRLocalConnectionPool.Invalidate; +begin + Inc(FInvalidateVersion); +end; + +procedure TCRLocalConnectionPool.Clear; +var + Connection: TCRConnection; + Version: integer; +begin + while InternalGetConnection(Connection, Version) do + InternalFreeConnection(Connection); +end; + +procedure TCRLocalConnectionPool.AsyncClear; +begin + Inc(FInvalidateVersion); + Inc(FClearVersion); +end; + +function TCRLocalConnectionPool.GetTotalConnectionsCount: integer; +begin + FLockPooled.Enter; + try + FLockTaken.Enter; + try + Result := FTakenConnectionsCount + FPooledConnectionsCount; + finally + FLockTaken.Leave; + end; + finally + FLockPooled.Leave; + end; +end; + +{ TCRConnectionPoolManager } + +constructor TCRConnectionPoolManager.Create; +begin + inherited; + + FPools := TDAList.Create; + FLockGet := TCriticalSection.Create; + FLockList := TCriticalSection.Create; + FValidateThread := TValidateThread.Create(Self); +end; + +destructor TCRConnectionPoolManager.Destroy; +begin + if FValidateThread <> nil then begin + FValidateThread.Terminate; + {$IFDEF WIN32} + // infinite wait can hang in DLL + WaitForSingleObject(FValidateThread.Handle, 5000); + {$ELSE} + FValidateThread.WaitFor; + {$ENDIF} + FValidateThread.Free; + end; + + if (FPools <> nil) and (FLockGet <> nil) and (FLockList <> nil) then + InternalClear; + FPools.Free; + FLockGet.Free; + FLockList.Free; + + inherited; +end; + +// Conn parameters used for creating new pool with initial parameters +function TCRConnectionPoolManager.GetConnectionPool(ConnectionParameters: TCRConnectionParameters): TCRConnectionPool; +var + i: integer; + Pool: TCRConnectionPool; +begin + Result := nil; + + // Search if pool with same connection string exist + for i := 0 to FPools.Count - 1 do begin + Pool := TCRConnectionPool(FPools.Items[i]); + if Pool.FConnectionParameters.Equals(ConnectionParameters) then begin + Result := Pool; + break; + end; + end; + + // Create new pool object if existing not found + if Result = nil then begin + Result := CreateCRConnectionPool(ConnectionParameters); + FPools.Add(Result); + end; +end; + +procedure TCRConnectionPoolManager.InternalClear; +begin + FLockList.Enter; + try + while FPools.Count <> 0 do begin + TCRConnectionPool(FPools.Items[0]).Free; + FPools.Delete(0); + end; + finally + FLockList.Leave; + end; +end; + +procedure TCRConnectionPoolManager.InternalAsyncClear; +var + i: integer; +begin + FLockList.Enter; + try + for i := 0 to FPools.Count - 1 do + TCRConnectionPool(FPools[i]).AsyncClear; + finally + FLockList.Leave; + end; +end; + +function TCRConnectionPoolManager.InternalGetConnection(ConnectionParameters: TCRConnectionParameters): TCRConnection; +begin + FLockGet.Enter; + try + Result := GetConnectionPool(ConnectionParameters).GetConnection; + finally + FLockGet.Leave; + end; +end; + +function TCRConnectionPoolManager.InternalCheckConnection( + Connection: TCRConnection): TCRConnection; +begin + Result := Connection; +end; + +{ TValidateThread } + +constructor TValidateThread.Create(Manager: TCRConnectionPoolManager); +begin + FManager := Manager; +{$IFNDEF LINUX} + FEvent := TEvent.Create(nil, True, False, ''); +{$ENDIF} +{$IFDEF CLR} + inherited Create(True); // to prevent Application hanging on + Handle.IsBackGround := True; // close + Resume; +{$ELSE} + inherited Create(False); +{$ENDIF} +end; + +{$IFNDEF LINUX} +destructor TValidateThread.Destroy; +begin + FEvent.Free; +end; + +procedure TValidateThread.Terminate; +begin + inherited; + FEvent.SetEvent; +end; +{$ENDIF} + +procedure TValidateThread.Execute; +const + Timeout = 30000; +var + i, Count: integer; + Pool: TCRConnectionPool; + Ticks, BeginTickCount: cardinal; +begin + Ticks := 0; + while True do begin + if Terminated then + Exit; + {$IFNDEF LINUX} + if (Ticks < Timeout) and (FEvent.WaitFor(Timeout - Ticks) = wrSignaled) then + Exit; + {$ELSE} + while Ticks < Timeout do begin + Sleep(200); + if Terminated then + Exit; + Ticks := Ticks + 200; + end; + {$ENDIF} + + BeginTickCount := GetTickCount; + + FManager.FLockList.Enter; + try + for i := FManager.FPools.Count - 1 downto 0 do begin + if Terminated then + Exit; + Pool := TCRConnectionPool(FManager.FPools[i]); + Pool.Validate; + + FManager.FLockGet.Enter; + try + Count := Pool.TotalConnectionsCount; + if Count = 0 then + FManager.FPools.Delete(i); + finally + FManager.FLockGet.Leave; + end; + if Count = 0 then + Pool.Free; + end; + finally + FManager.FLockList.Leave; + end; + + Ticks := GetTickCount - BeginTickCount; + end; +end; + +end. diff --git a/internal/4.10.0.10/1/Source/CRParser.pas b/internal/4.10.0.10/1/Source/CRParser.pas new file mode 100644 index 0000000..f9f1d46 --- /dev/null +++ b/internal/4.10.0.10/1/Source/CRParser.pas @@ -0,0 +1,1054 @@ + +////////////////////////////////////////////////// +// Copyright © 1998-2007 Core Lab. All right reserved. +// CRParser +// Created: 27.03.98 +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I Dac.inc} + +unit CRParser; +{$ENDIF} +interface + +uses + Classes; + +const + lcEnd = 0; + lcLexem = -100; + lcSymbol = -102; + lcIdent = -103; // identificator + lcNumber = -105; + lcString = -106; + lcBlank = -107; + lcComment = -108; + + BlockSize = 64 * 1024; + +type + TParserClass = class of TParser; + TClausesArr = array of integer; + + TParser = class + protected + OldPos: integer; + OldOldPos: integer; + FOmitBlank: boolean; + FOmitComment: boolean; + FUppered: boolean; + FCurrLine: integer; + FPrevLine: integer; + FCurrBegLine: integer; + FPrevBegLine: integer; + FQuotedString: boolean; + FAdvancedStringParsing: boolean; + + FSavedPos: integer; // local var buf in previous version + FLexemPos: integer; // start Lexem pos in Text + FLexemLength: integer; // actual length of FLexemArray; + + FStream: TStream; + FStoredBlocks: TStringList; + FCurrentBlock: string; + FFirstBlockOffset: integer; + FBlockOffset: integer; + FBlockSize: integer; + FAlternativeQuoting: boolean; // supported in Oracle 10 + + procedure ReadNextBlock; + function GetChar(Index: integer): Char; + function GetStoredChar(Index: integer): Char; + protected + TextLength: integer; + Pos: integer; + + FSymbolLexems, FKeywordLexems: TStringList; + FClauses: TClausesArr; // lxWHERE, lxLIMIT, lxORDER etc. Must be filled on Create + FOmitKeywords: boolean; + FDesiredLexem: string; + FDesiredLexemFound: boolean; + FLexem: string; + + procedure InitParser; virtual; + + function IsBlank(Ch: char): boolean; virtual; + function IsSymbol(Ch: char): boolean; virtual; + function IsAlpha(Ch: char): boolean; virtual; + function IsNumber(Ch: char): boolean; virtual; + function IsStringQuote(Ch: char): boolean; virtual; + procedure ToRightQuoteP(RightQuote: Char); virtual; + {$IFNDEF CLR} + procedure ToRightQuoteA(RightQuote: Char); virtual; + {$ENDIF} + procedure ToRightQuote(RightQuote: Char); virtual; // Search right quote of quoted string value or quoted identifier + function IsIdentQuote(Ch: char): boolean; virtual; + function IsInlineComment(Pos: integer): boolean; virtual; + function FindLexemIndex(const LexemPos, LexemLength: integer; Lexems: TStringList): integer; + function InternalGetNext: integer; + + function CopyText(const Pos, Count: integer): string; + procedure AddToLexemArray(Index: integer; const Len: integer); + + property Text[Index: integer]: Char read GetChar; + property AlternativeQuoting: boolean read FAlternativeQuoting write FAlternativeQuoting; + + public + CommentBegin: string; + CommentEnd: string; + DecSeparator: string; + + constructor Create(const Text: string); overload; virtual; + constructor Create(const Stream: TStream); overload; virtual; + destructor Destroy; override; + + procedure SetText(const Text: string); + + procedure ToBegin; virtual; + procedure Back; + function GetNext(out Lexem: string): integer; virtual; + function GetNextCode: integer; + + function ToLexem(const Code: integer): integer; overload; + function ToLexem(const Lexem: string): boolean; overload; + //function ToSymbol(const Symbol: Char): integer; + function IsClauseLexem(Code: integer): boolean; // Is SELECT statement clause + function PosClauseLexem(Code: integer): integer; // Code position in list of SELECT statement clauses. -1 if not found + function IsMacroAllowed(Code: integer): boolean; virtual; + function IsNumericMacroNameAllowed: boolean; virtual; + function IsSemicolon(Code: integer): boolean; virtual; + + function CurrPos: integer; + function PrevPos: integer; + function PrevPrevPos: integer; + function CurrLine: integer; + function PrevLine: integer; + function CurrCol: integer; + function PrevCol: integer; + + property OmitBlank: boolean read FOmitBlank write FOmitBlank; + property OmitComment: boolean read FOmitComment write FOmitComment; + property Uppered: boolean read FUppered write FUppered; + property QuotedString: boolean read FQuotedString write FQuotedString; + property AdvancedStringParsing: boolean read FAdvancedStringParsing write FAdvancedStringParsing; + + property SymbolLexems: TStringList read FSymbolLexems; + property KeywordLexems: TStringList read FKeywordLexems; + end; + + function CRCmpStrings(List: TStringList; Index1, Index2: Integer): Integer; +{$IFNDEF VER7P} +function PosEx(const SubStr, S: string; Offset: Cardinal = 1): Integer; +{$ENDIF} + +implementation +uses +{$IFDEF VER7P} + StrUtils, +{$ENDIF} +{$IFDEF PERF_COUNTER} + Debug, +{$ENDIF} +{$IFDEF CLR} + System.Text, +{$ELSE} + CLRClasses, +{$ENDIF} + SysUtils, MemUtils; + +var + CommonSymbolLexems, CommonKeywordLexems: TStringList; + +{ TParser } + +constructor TParser.Create(const Text: string); +begin + inherited Create; + + Self.FCurrentBlock := Text; + TextLength := Length(Text); + FBlockSize := TextLength; + + InitParser; +end; + +constructor TParser.Create(const Stream: TStream); +begin + inherited Create; + + FStoredBlocks := TStringList.Create; + FStream := Stream; + TextLength := Stream.Size; + + InitParser; +end; + +destructor TParser.Destroy; +begin + FStoredBlocks.Free; + + inherited; +end; + +procedure TParser.InitParser; +begin + FSymbolLexems := CommonSymbolLexems; + FKeywordLexems := CommonKeywordLexems; + CommentBegin := '/*'; + CommentEnd := '*/'; + DecSeparator := DecimalSeparator; + + FOmitBlank := True; + FUppered := True; + FQuotedString := False; + ToBegin; +end; + + +procedure TParser.SetText(const Text: string); +begin + Self.FCurrentBlock := Text; + TextLength := Length(Text); + FBlockSize := TextLength; + + ToBegin; +end; + +function TParser.IsBlank(Ch: char): boolean; +begin + Result := False; + case Ch of + #9, #10, #13, #32: + Result := True; + end; +end; + +function TParser.IsSymbol(Ch: char): boolean; +begin + Result := False; + case Ch of + '!'..'/', ':'..'@', '['..'^', '`', '{'..'~': + Result := True; + end; +end; + +function TParser.IsAlpha(Ch: char): boolean; +begin + Result := False; + case Ch of + 'A'..'Z', 'a'..'z', #128..#255: + Result := True; + end; +end; + +function TParser.IsNumber(Ch: char): boolean; +begin + Result := False; + case Ch of + '0'..'9': + Result := True; + end; +end; + +function TParser.IsStringQuote(Ch: char): boolean; +begin + Result := False; + case Ch of + '''', '"': + Result := True; + end; +end; + +procedure TParser.ToRightQuote(RightQuote: Char); +begin + if FAdvancedStringParsing or (FStream <> nil) then + ToRightQuoteP(RightQuote) + else +{$IFDEF CLR} + while (Pos <= TextLength) and (Text[Pos] <> RightQuote) do + Inc(Pos); +{$ELSE} + ToRightQuoteA(RightQuote); +{$ENDIF} +end; + +procedure TParser.ToRightQuoteP(RightQuote: Char); +var + c: Char; +begin + while (Pos <= TextLength) do begin + c := Text[Pos]; + if (c = #13) or (c = #10) then begin + if (Pos < TextLength) and (Text[Pos + 1] = #10) then + inc(Pos); + Inc(FCurrLine); + FCurrBegLine := Pos + 1; + end + else + if c = RightQuote then + Break; + inc(Pos); + end; +end; + +{$IFNDEF CLR} +procedure TParser.ToRightQuoteA(RightQuote: Char); +var + i: integer; +begin + i := TextLength - Pos + 1 {Pos is counted from 1} + 1 {#0}; + asm + PUSHAD + + MOV EAX, Self + MOV EDI, EAX + + ADD EAX, Pos + MOV EAX, [EAX] // EAX := Pos + + ADD EDI, FCurrentBlock + MOV EDI, [EDI] + ADD EDI, EAX + DEC EDI // EDI := PChar(Text) + Pos {Pos is counted from 1}; + + MOV ECX, i + MOV AL, RightQuote + REPNE SCASB + MOV i, ECX + POPAD + end; + Pos := TextLength - i + 1; +end; +{$ENDIF} + +function TParser.IsIdentQuote(Ch: char): boolean; +begin + Result := False; +end; + +function TParser.IsInlineComment(Pos: integer): boolean; +begin + Result := (TextLength >= Pos + 2) and (Text[Pos] = '/') and (Text[Pos + 1] = '/'); +end; + +function TParser.IsMacroAllowed(Code: integer): boolean; +begin + Result := Code <> lcString; +end; + +function TParser.IsNumericMacroNameAllowed: boolean; +begin + Result := False; +end; + +function TParser.IsSemicolon(Code: integer): boolean; +begin + Result := False; +end; + +function TParser.FindLexemIndex(const LexemPos, LexemLength: integer; Lexems: TStringList): integer; + function CompareWithLexem(const S: string): integer; + var + i, l, ls: integer; + Ch: Char; + begin + Result := 0; + ls := Length(S); + if ls > LexemLength then + l := LexemLength + else + l := ls; + + for i := 1 to l do begin + Ch := Text[LexemPos + i - 1]; + if (Ch >= 'a') and (Ch <= 'z') then Dec(Ch, 32); + Result := integer(S[i]) - integer(Ch); + if Result <> 0 then + Exit; + end; + + if ls > LexemLength then + Result := 1 + else + if ls < LexemLength then + Result := -1; + end; + + +var + L, H, I, C: integer; +begin +{$IFDEF PERF_COUNTER} + PerfCounters[9].Start; +{$ENDIF} + Result := -1; + L := 0; + H := Lexems.Count - 1; + while L <= H do + begin + I := (L + H) shr 1; + C := CompareWithLexem(Lexems[I]); + + if C < 0 then + L := I + 1 + else begin + H := I - 1; + if C = 0 then + Result := I; + end; + end; + +{$IFDEF PERF_COUNTER} + PerfCounters[9].Stop; +{$ENDIF} +end; + +procedure TParser.ToBegin; +begin + Pos := 1; + OldPos := Pos; + OldOldPos := OldPos; + FCurrLine := 0; + FPrevLine := 0; + FCurrBegLine := Pos; + FPrevBegLine := Pos; + + FFirstBlockOffset := 1; + FBlockOffset := 1; +end; + +procedure TParser.Back; +begin + Pos := OldPos; +end; + +{$IFNDEF VER7P} +{ PosEx searches for SubStr in S and returns the index position of + SubStr if found and 0 otherwise. If Offset is not given then the result is + the same as calling Pos. If Offset is specified and > 1 then the search + starts at position Offset within S. If Offset is larger than Length(S) + then PosEx returns 0. By default, Offset equals 1. } + +function PosEx(const SubStr, S: string; Offset: Cardinal = 1): Integer; +var + I,X: Integer; + Len, LenSubStr: Integer; +begin + if Offset = 1 then + Result := Pos(SubStr, S) + else + begin + I := Offset; + LenSubStr := Length(SubStr); + Len := Length(S) - LenSubStr + 1; + while I <= Len do + begin + if S[I] = SubStr[1] then + begin + X := 1; + while (X < LenSubStr) and (S[I + X] = SubStr[X + 1]) do + Inc(X); + if (X = LenSubStr) then + begin + Result := I; + exit; + end; + end; + Inc(I); + end; + Result := 0; + end; +end; +{$ENDIF} + +function TParser.InternalGetNext: integer; + function IsCommentBegin: boolean; + var + i, l: integer; + begin + l := Length(CommentBegin); + Result := Pos <= TextLength - l + 1; + if not Result then + Exit; + + for i := 1 to l do + if Text[Pos + i - 1] <> CommentBegin[i] then begin + Result := False; + Exit; + end; + end; + +var + j, CommentLen: integer; + IsComment: boolean; + Quote: Char; + c: Char; + DL: boolean; + i: integer; + St, StLength: integer; + SymbolPos: integer; + QuoteDelimiter: char; + QuoteDelimiterFound: boolean; +begin + DL := FDesiredLexem <> ''; + OldOldPos := OldPos; + OldPos := Pos; + FPrevLine := FCurrLine; + FPrevBegLine := FCurrBegLine; + + FSavedPos := -1; + FLexemPos := -1; + FLexemLength := 0; + + repeat + if Pos > TextLength then begin + Result := lcEnd; + Exit; + c := #0; // To Prevent compiler warning + end + else + if FStream = nil then // Performance optimization + c := FCurrentBlock[Pos] + else + c := Text[Pos]; + + // Blanks + while IsBlank(c) do begin + AddToLexemArray(Pos, 1); + if (c = #13) or (c = #10) then begin + if (c = #13) and (Text[Pos + 1] = #10) then begin + Inc(Pos); /// CR-M12015 + AddToLexemArray(Pos, 1); + end; + Inc(FCurrLine); + FCurrBegLine := Pos + 1; + end; + Inc(Pos); + c := Text[Pos]; + end; + + if not OmitBlank and (FLexemLength <> 0) then begin + Result := lcBlank; + Exit; + end; + + // End + if Pos > TextLength then begin + Result := lcEnd; + Exit; + end; + + // Comment + IsComment := False; + if IsInlineComment(Pos) then begin + IsComment := True; + FSavedPos := Pos; + while not((Pos > TextLength) or (c = #13) or (c = #10)) do begin + Inc(Pos); + c := Text[Pos]; + end; + // optimize expression StrLexem := StrLexem + Copy(Buf, 1, Pos - Buf); + AddToLexemArray(FSavedPos, Pos - FSavedPos); + end; + + if IsCommentBegin then begin + IsComment := True; + if Pos <= TextLength then begin + FSavedPos := Pos; + while Pos <= TextLength do begin + if (c = #13) or (c = #10) then begin + if (Pos < TextLength) and (Text[Pos + 1] = #10) then begin + inc(Pos); + end; + Inc(FCurrLine); + FCurrBegLine := Pos + 1; + end + else begin + j := 0; + CommentLen := Length(CommentEnd); + while (j < CommentLen) and (Text[Pos + j] = CommentEnd[j + 1]) do + inc(j); + if j = CommentLen then begin + Inc(Pos, CommentLen); + Break; + end; + end; + inc(Pos); + c := Text[Pos]; + end; + // optimize expression StrLexem := StrLexem + Copy(Buf, 1, Pos - Buf); + AddToLexemArray(FSavedPos, Pos - FSavedPos); + end; + end; + + if not OmitComment and IsComment then begin + Result := lcComment; + Exit; + end; + until not IsComment; + + FLexemPos := -1; + FLexemLength := 0; + if IsSymbol(c) then + if IsStringQuote(c) then begin + Result := lcString; + Quote := c; + if FQuotedString then + AddToLexemArray(Pos, 1); + Inc(Pos); + FSavedPos := Pos; + ToRightQuote(Quote); + // optimize expression StrLexem := StrLexem + Copy(Buf, 1, Pos - Buf); + if Pos > FSavedPos then + AddToLexemArray(FSavedPos, Pos - FSavedPos); + if Pos <= TextLength then begin + if FQuotedString then + AddToLexemArray(Pos, 1); + Inc(Pos); + end; + end + else + if IsIdentQuote(c) then begin + Result := lcIdent; + Quote := c; + AddToLexemArray(Pos, 1); + Inc(Pos); + FSavedPos := Pos; + ToRightQuote(Quote); + if Pos > FSavedPos then + AddToLexemArray(FSavedPos, Pos - FSavedPos); + if Pos <= TextLength then begin + AddToLexemArray(Pos, 1); + Inc(Pos); + end; + end + else begin + Result := lcSymbol; + SymbolPos := Pos + 1; // WAR + FLexemPos := Pos; + FLexemLength := 0; + St := Pos; + StLength := 1; + + repeat + AddToLexemArray(Pos, 1); + Inc(Pos); + c := Text[Pos]; + // Find + i := FindLexemIndex(FLexemPos, FLexemLength, FSymbolLexems); + if i <> - 1 then begin + FLexem := FSymbolLexems[i]; + + SymbolPos := Pos; + Result := integer(FSymbolLexems.Objects[i]); + Assert(Result > 0); + end + else + Dec(FLexemLength); + until not IsSymbol(c); + + if Result = lcSymbol then begin + FLexemPos := St; + FLexemLength := StLength; + if DL then begin + Assert(Length(FDesiredLexem) <= 1); + FDesiredLexemFound := (FDesiredLexem[1] = Text[FLexemPos]); + end; + end + else + if DL then + FDesiredLexemFound := (FDesiredLexem = FLexem); + + Pos := SymbolPos; + end + else + if IsAlpha(c) or (c = '_') then begin + Result := lcIdent; + FSavedPos := Pos; + QuoteDelimiter := c; + repeat + if DL then begin + if (c >= 'a') and (c <= 'z') then + Dec(c, 32); + DL := (Pos - FSavedPos + 1 <= Length(FDesiredLexem)) and (FDesiredLexem[Pos - FSavedPos + 1] = c); + end; + + Inc(Pos); + c := Text[Pos]; + until not IsAlpha(c) and not IsNumber(c) and (c <> '_'); + + if FAlternativeQuoting and (Pos - FSavedPos = 1) and + ((QuoteDelimiter = 'q') or (QuoteDelimiter = 'Q')) and IsStringQuote(c) + then begin + Result := lcString; + Quote := c; + Inc(Pos); + if Pos <= TextLength then begin + QuoteDelimiter := Text[Pos]; + case QuoteDelimiter of + '[': QuoteDelimiter := ']'; + '{': QuoteDelimiter := '}'; + '<': QuoteDelimiter := '>'; + '(': QuoteDelimiter := ')'; + end; + QuoteDelimiterFound := False; + Inc(Pos); + while Pos <= TextLength do begin + c := Text[Pos]; + Inc(Pos); + + if QuoteDelimiterFound and (c = Quote) then + break; + + QuoteDelimiterFound := (c = QuoteDelimiter); + end; + end; + if FQuotedString then + AddToLexemArray(FSavedPos, Pos - FSavedPos) + else + if Pos - FSavedPos > 5 then + AddToLexemArray(FSavedPos + 3, Pos - FSavedPos - 5) + end + else begin + FDesiredLexemFound := DL; + AddToLexemArray(FSavedPos, Pos - FSavedPos); + end; + end + else + if IsNumber(c) then begin + Result := lcNumber; + SymbolPos := Pos; + repeat + AddToLexemArray(Pos, 1); + if DL then + DL := (Pos - SymbolPos + 1 <= Length(FDesiredLexem)) and (FDesiredLexem[Pos - SymbolPos + 1] = c); + + Inc(Pos); + c := Text[Pos]; + until not IsNumber(c); + FDesiredLexemFound := DL; + if (c = DecSeparator) and (Pos + 1 <= TextLength) and IsNumber(Text[Pos + 1]) then begin + AddToLexemArray(Pos, 1); + Inc(Pos); + c := Text[Pos]; + while IsNumber(c) do begin + AddToLexemArray(Pos, 1); + Inc(Pos); + c := Text[Pos]; + end; + end; + end + else + raise Exception.Create('Parser: The unknown symbol ''' + Text[Pos] + ''' $' + IntToHex(Word(Text[Pos]), 4)); + + Assert(Result <> - MaxInt); +end; + +function TParser.GetNext(out Lexem: string): integer; +var + i: integer; +begin +{$IFDEF PERF_COUNTER} + PerfCounters[2].Start;//} + try +{$ENDIF} + Result := InternalGetNext; // Result is not in KeywordLexems + if Result > 0 then begin + Assert(FLexem <> ''); + Lexem := FLexem + end + else begin + if FLexemLength = 0 then + Lexem := '' + else + begin + Assert(FLexemPos > 0); + Lexem := CopyText(FLexemPos, FLexemLength); + end; + end; + + if not FOmitKeywords and (Result = lcIdent) then begin + Assert(FLexemPos > 0); + Assert(FLexemLength > 0); + i := FindLexemIndex(FLexemPos, FLexemLength, FKeywordLexems); + if i <> -1 then begin + Result := integer(FKeywordLexems.Objects[i]); + Assert(Result > 0); + if Uppered then + Lexem := AnsiUpperCase(Lexem); //WAR problem with macros as key words + end; + end; + + Assert(Result <> - MaxInt); +{$IFDEF PERF_COUNTER} + finally + PerfCounters[2].Stop; + end; +{$ENDIF} +end; + +function TParser.GetNextCode: integer; +var + St: string; +begin + Result := GetNext(St); +end; + +function TParser.ToLexem(const Code: integer): integer; +var + St: string; +begin + repeat + Result := GetNext(St); + until (Result = Code) or (Result = lcEnd); +end; + +function TParser.ToLexem(const Lexem: string): boolean; +begin + try + FDesiredLexem := UpperCase(Lexem); + FDesiredLexemFound := False; + + while (InternalGetNext <> lcEnd) and not FDesiredLexemFound do; + + Result := FDesiredLexemFound; + finally + FDesiredLexem := ''; + FDesiredLexemFound := False; + end; +end; + +{function TParser.ToSymbol(const Symbol: Char): integer; +var + St: string; +begin + FOmitKeywords := True; + try + repeat + Result := GetNext(St); + until (Result = lcEnd) or ((Length(St) = 1) and (St[1] = Symbol)); + finally + FOmitKeywords := False; + end; +end;} + +function TParser.IsClauseLexem(Code: integer): boolean; +begin + Result := PosClauseLexem(Code) <> -1; +end; + +function TParser.PosClauseLexem(Code: integer): integer; +var + i: integer; +begin + Assert(Length(FClauses) > 0); + Result := -1; + for i := Low(FClauses) to High(FClauses) do + if Code = FClauses[i] then begin + Result := i; + Exit; + end; +end; + +function TParser.CurrPos: integer; +begin + Result := Pos - 1; +end; + +function TParser.PrevPos: integer; +begin + Result := OldPos - 1; +end; + +function TParser.PrevPrevPos: integer; +begin + Result := OldOldPos - 1; +end; + +function TParser.CurrLine: integer; +begin + Result := FCurrLine; +end; + +function TParser.PrevLine: integer; +begin + Result := FPrevLine; +end; + +function TParser.CurrCol: integer; +begin + Result := Pos - FCurrBegLine; +end; + +function TParser.PrevCol: integer; +begin + Result := OldPos - FPrevBegLine; +end; + +function CRCmpStrings(List: TStringList; Index1, Index2: Integer): Integer; +begin +{$IFDEF CLR} + Result := System.String.CompareOrdinal(List[Index1], List[Index2]); +{$ELSE} + Result := CompareStr(List[Index1], + List[Index2]); +{$ENDIF} +end; + +procedure TParser.ReadNextBlock; +var + i: integer; + UsedBlocks: integer; + SavedPos: integer; +{$IFDEF CLR} + Buffer: TBytes; +{$ENDIF} +begin + if (FSavedPos > -1) and ((FSavedPos < FLexemPos) or (FLexemPos = -1)) then + SavedPos := FSavedPos + else + SavedPos := FLexemPos; + + if ((SavedPos > Pos) or (SavedPos = -1)) and not (FCurrentBlock = '') then + SavedPos := Pos; + + UsedBlocks := FStoredBlocks.Count; + for i := 0 to FStoredBlocks.Count - 1 do + if (SavedPos >= FFirstBlockOffset + i * BlockSize) or (SavedPos = -1) then + Dec(UsedBlocks); + + while FStoredBlocks.Count > UsedBlocks do + FStoredBlocks.Delete(0); + + if ((SavedPos > -1) and (SavedPos < FBlockOffset + BlockSize)) then + FStoredBlocks.Add(FCurrentBlock); + + if FCurrentBlock = '' then + SetLength(FCurrentBlock, BlockSize); + + if FStoredBlocks.Count = 0 then + FFirstBlockOffset := FStream.Position + 1 + else + if FStoredBlocks.Count = 1 then + FFirstBlockOffset := FBlockOffset; + + FBlockOffset := FStream.Position + 1; + +{$IFDEF CLR} + SetLength(Buffer, BlockSize); + FBlockSize := FStream.Read(Buffer, BlockSize); + FCurrentBlock := Encoding.Default.GetString(Buffer, 0, FBlockSize); +{$ELSE} + FBlockSize := FStream.Read(FCurrentBlock[1], BlockSize); +{$ENDIF} +end; + +function TParser.GetStoredChar(Index: integer): Char; +begin + if Index >= FFirstBlockOffset then + Result := FStoredBlocks[(Index - FFirstBlockOffset) div BlockSize][(Index - FFirstBlockOffset) mod BlockSize + 1] + else begin + Result := #0; + Assert(False); + end; +end; + +function TParser.GetChar(Index: integer): Char; +begin + if Index > TextLength then + Result := #0 + else begin + if Index >= FBlockOffset + FBlockSize then + ReadNextBlock; + + if Index >= FBlockOffset then + Result := FCurrentBlock[Index - FBlockOffset + 1] + else + Result := GetStoredChar(Index); + end; +end; + +procedure TParser.AddToLexemArray(Index: integer; const Len: integer); +begin + FSavedPos := -1; + if FLexemPos = -1 then + FLexemPos := Index; + Inc(FLexemLength, Len); +end; + +function TParser.CopyText(const Pos, Count: integer): string; +var + sb: StringBuilder; + i: integer; +begin + if Pos < FBlockOffset then begin + sb := StringBuilder.Create(Count); + try + for i := 0 to FStoredBlocks.Count - 1 do + if i = 0 then + sb.Append(Copy(FStoredBlocks[i], Pos - FFirstBlockOffset + 1, Count)) + else + sb.Append(FStoredBlocks[i]); + + sb.Append(Copy(FCurrentBlock, 1, Count - FBlockOffset + Pos)); + Result := sb.ToString; + finally + sb.Free; + end; + end + else + Result := Copy(FCurrentBlock, FLexemPos - FBlockOffset + 1, FLexemLength); +end; + +initialization + CommonSymbolLexems := TStringList.Create; + CommonKeywordLexems := TStringList.Create; + + CommonSymbolLexems.AddObject('!', TObject(integer(1))); + CommonSymbolLexems.AddObject('"', TObject(integer(2))); + CommonSymbolLexems.AddObject('#', TObject(integer(3))); + CommonSymbolLexems.AddObject('$', TObject(integer(4))); + CommonSymbolLexems.AddObject('%', TObject(integer(5))); + CommonSymbolLexems.AddObject('&', TObject(integer(6))); + CommonSymbolLexems.AddObject('''', TObject(integer(7))); + CommonSymbolLexems.AddObject('(', TObject(integer(8))); + CommonSymbolLexems.AddObject(')', TObject(integer(9))); + CommonSymbolLexems.AddObject('*', TObject(integer(10))); + CommonSymbolLexems.AddObject('+', TObject(integer(11))); + CommonSymbolLexems.AddObject(',', TObject(integer(12))); + CommonSymbolLexems.AddObject('-', TObject(integer(13))); + CommonSymbolLexems.AddObject('.', TObject(integer(14))); + CommonSymbolLexems.AddObject('/', TObject(integer(15))); + CommonSymbolLexems.AddObject(':', TObject(integer(16))); + CommonSymbolLexems.AddObject(';', TObject(integer(17))); + CommonSymbolLexems.AddObject('<', TObject(integer(18))); + CommonSymbolLexems.AddObject('=', TObject(integer(19))); + CommonSymbolLexems.AddObject('>', TObject(integer(20))); + CommonSymbolLexems.AddObject('?', TObject(integer(21))); + CommonSymbolLexems.AddObject('@', TObject(integer(22))); + CommonSymbolLexems.AddObject('[', TObject(integer(23))); + CommonSymbolLexems.AddObject('\', TObject(integer(24))); + CommonSymbolLexems.AddObject(']', TObject(integer(25))); + CommonSymbolLexems.AddObject('^', TObject(integer(26))); + CommonSymbolLexems.AddObject('_', TObject(integer(27))); + CommonSymbolLexems.AddObject('`', TObject(integer(28))); + CommonSymbolLexems.CustomSort(CRCmpStrings); + + CommonKeywordLexems.AddObject('AND', TObject(integer(29))); + CommonKeywordLexems.AddObject('NOT', TObject(integer(30))); + CommonKeywordLexems.AddObject('OR', TObject(integer(31))); + CommonKeywordLexems.CustomSort(CRCmpStrings); + +{$IFDEF PERF_COUNTER} + PerfCounters[2].Name := 'Parser.Next'; + PerfCounters[8].Name := 'Parser.Code'; + PerfCounters[9].Name := 'Parser.FindLexemIndex'; +{$ENDIF} + +finalization + CommonSymbolLexems.Free; + CommonKeywordLexems.Free; + +end. diff --git a/internal/4.10.0.10/1/Source/CRThread.pas b/internal/4.10.0.10/1/Source/CRThread.pas new file mode 100644 index 0000000..ab46ed6 --- /dev/null +++ b/internal/4.10.0.10/1/Source/CRThread.pas @@ -0,0 +1,371 @@ + +////////////////////////////////////////////////// +// DB Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I Dac.inc} + +unit CRThread; +{$ENDIF} +interface +uses + Classes, SysUtils, SyncObjs, +{$IFDEF LINUX} +{$ELSE} + Windows, +{$ENDIF} +{$IFDEF CLR} + System.Runtime.InteropServices; +{$ELSE} + CLRClasses; +{$ENDIF} + +type + TCRThread = class; + TCRThreadWrapper = class; + + TCRThreadTerminateEvent = procedure(Sender: TObject) of object; + TCRThreadExceptionEvent = procedure(Sender: TObject; E: Exception; var Fail: boolean) of object; + TCRThreadEvent = procedure(Sender: TObject; Event: TObject) of object; + TCRThreadClass = class of TCRThread; + + TCRThread = class(TThread) + protected + FOwner: TCRThreadWrapper; + FStartEvent: TEvent; + + procedure InternalExecute; virtual; + procedure Execute; override; + public + procedure PostEvent(Event: TObject); + procedure SendEvent(Event: TObject); + + constructor Create(Owner: TCRThreadWrapper); virtual; + destructor Destroy; override; + end; + + TCRThreadWrapper = class + protected + FTimerID: UInt; + FThread: TCRThread; + + FOnPostEvent: TCRThreadEvent; + FOnSendEvent: TCRThreadEvent; + FOnException: TCRThreadExceptionEvent; + FOnTerminate: TCRThreadTerminateEvent; + + FEvents: TThreadList; + FException: Exception; + FTerminated: boolean; + FFreeOnTerminate: boolean; + FDoTimerProcessing, FLockDestroy: boolean; + FDestroyAfterTimer: boolean; + FSendEvent: TObject; + FSendEventProcessed: TEvent; + + procedure SetTimer; + procedure KillTimer; + procedure DoTimer; + + procedure DoPostEvent(Event: TObject); virtual; // In FThread context + procedure DoSendEvent(Event: TObject); virtual; // In FThread context + + procedure DoException(E: Exception); virtual; // In FThread context + procedure DoTerminate; // In FThread context + + public + constructor Create(ThreadClass: TCRThreadClass; CreateSuspended: Boolean); + destructor Destroy; override; + + procedure Resume; + procedure Suspend; + procedure Terminate; + + property Thread: TCRThread read FThread; + property FreeOnTerminate: boolean read FFreeOnTerminate write FFreeOnTerminate; + property Terminated: boolean read FTerminated; + + property OnPostEvent: TCRThreadEvent read FOnPostEvent write FOnPostEvent; + property OnSendEvent: TCRThreadEvent read FOnSendEvent write FOnSendEvent; + property OnException: TCRThreadExceptionEvent read FOnException write FOnException; + property OnTerminate: TCRThreadTerminateEvent read FOnTerminate write FOnTerminate; + end; + +implementation + +uses + MemData{$IFDEF VER6P}, StrUtils{$ENDIF}; + +var + ThreadList: TThreadList; + +{ TCRThread } + +constructor TCRThread.Create(Owner: TCRThreadWrapper); +begin + inherited Create(True); + Assert(Owner <> nil); + FOwner := Owner; + FStartEvent := TEvent.Create(nil, True, False, ''); +end; + +destructor TCRThread.Destroy; +begin + inherited; + FStartEvent.Free; +end; + +procedure TCRThread.InternalExecute; +begin + // Empty +end; + +procedure TCRThread.Execute; +begin + try + FStartEvent.SetEvent; + InternalExecute; + except + on E: Exception do + if not (E is EAbort) then + FOwner.DoException(E); + end; + FOwner.DoTerminate; +end; + +procedure TCRThread.PostEvent(Event: TObject); +begin + FOwner.DoPostEvent(Event); +end; + +procedure TCRThread.SendEvent(Event: TObject); +begin + if not Terminated then + FOwner.DoSendEvent(Event); +end; + +{ TCRThreadWrapper } + +procedure TimerCallBack(hWnd: HWND; Message: UInt; +{$IFDEF CLR} + {$IFDEF VER11P} + TimerID: UINT_PTR; + {$ELSE} + TimerID: UInt; + {$ENDIF} +{$ELSE} + TimerID: UInt; +{$ENDIF} + SysTime: DWORD); {$IFNDEF CLR} stdcall; {$ENDIF} +var + List: TList; + p: TCRThreadWrapper; + ThreadWrapper: TCRThreadWrapper; + i: integer; +begin + List := ThreadList.LockList; + try + ThreadWrapper := nil; + for i := 0 to List.Count - 1 do begin + p := TCRThreadWrapper(List[i]); + if TCRThreadWrapper(p).FTimerID = TimerID then begin + ThreadWrapper := TCRThreadWrapper(p); + Break; + end; + end; + finally + ThreadList.UnlockList; + end; + + if ThreadWrapper <> nil then + ThreadWrapper.DoTimer; + end; + +constructor TCRThreadWrapper.Create(ThreadClass: TCRThreadClass; CreateSuspended: Boolean); +begin + inherited Create; + + FEvents := TThreadList.Create; + FSendEventProcessed := TEvent.Create(nil, True, False, ''); + + SetTimer; + ThreadList.Add(Self); + + FThread := ThreadClass.Create(Self); + if not CreateSuspended then + FThread.Resume; +end; + +destructor TCRThreadWrapper.Destroy; +begin + if FLockDestroy then + Exit; + + if FDoTimerProcessing then begin + FDestroyAfterTimer := True; + Exit; + end; + + if not FFreeOnTerminate then begin + FLockDestroy := True; + Terminate; + end; + FThread.Free; + FEvents.Free; + + if FTimerID <> 0 then + KillTimer; + ThreadList.Remove(Self); + + inherited; + FSendEventProcessed.Free; +end; + +procedure TCRThreadWrapper.Resume; +begin + Thread.Resume; +end; + +procedure TCRThreadWrapper.Suspend; +begin + Thread.Suspend; +end; + +procedure TCRThreadWrapper.Terminate; +begin + WaitForSingleObject(Thread.FStartEvent.Handle, INFINITE); + Thread.Terminate; + FSendEventProcessed.SetEvent; +{$IFNDEF CLR} + WaitForSingleObject(Thread.Handle, INFINITE); +{$ELSE} + Thread.WaitFor; +{$ENDIF} + DoTimer; +end; + +procedure TCRThreadWrapper.DoPostEvent(Event: TObject); // In FThread context +begin + Assert(FEvents <> nil); + FEvents.Add(Event); +end; + +procedure TCRThreadWrapper.DoSendEvent(Event: TObject); // In FThread context +begin + FSendEvent := Event; + WaitForSingleObject(FSendEventProcessed.Handle, INFINITE); + FSendEventProcessed.ResetEvent; +end; + +procedure TCRThreadWrapper.DoException(E: Exception); // In FThread context +begin + Assert(FException = nil); + FException := Exception.Create(E.Message); +end; + +procedure TCRThreadWrapper.DoTerminate; // In FThread context +begin + Assert(not FTerminated); + FTerminated := True; +end; + +procedure TCRThreadWrapper.SetTimer; +const + USER_TIMER_MINIMUM = $A; +var + TimerFunc: TFNTimerProc; +begin + Assert(FTimerID = 0); + TimerFunc := {$IFNDEF CLR}@{$ENDIF}TimerCallBack; + FTimerID := Windows.SetTimer(0, 0, USER_TIMER_MINIMUM, TimerFunc); + Win32Check(FTimerID <> 0); +end; + +procedure TCRThreadWrapper.KillTimer; +begin + Assert(FTimerID <> 0); + Windows.KillTimer(0, FTimerID); + FTimerID := 0; +end; + +procedure TCRThreadWrapper.DoTimer; // In main thread context +var + Fail: boolean; + List: TList; + FreeThread: boolean; +begin + if FDoTimerProcessing then + Exit; // For example - on showing error message + FDoTimerProcessing := True; + + KillTimer; // To prevent multiple calls to DoTimer if any event handler call ProcessMessage + try + if (FSendEvent <> nil) then begin + if Assigned(FOnSendEvent) then + FOnSendEvent(Self, FSendEvent); + FSendEvent := nil; + FSendEventProcessed.SetEvent; + end; + + if FEvents <> nil then begin + List := FEvents.LockList; + try + while List.Count > 0 do begin + try + if Assigned(FOnPostEvent) then + FOnPostEvent(Self, TObject(List[0])); + finally + List.Delete(0); + end; + end; + finally + FEvents.UnlockList; + end; + end; + + if FException <> nil then begin + try + Fail := True; + if Assigned(FOnException) then + FOnException(Self, FException, Fail); + if Fail then begin + try + raise FException; + except + if Assigned(ApplicationHandleException) then + ApplicationHandleException(FException) + else + ShowException(FException, ExceptAddr); + end; + end + else + FException.Free; + finally + FException := nil; + end; + end; + + if FTerminated and Assigned(FOnTerminate) then + FOnTerminate(Self); + finally + FDoTimerProcessing := False; + FreeThread := (FTerminated and FFreeOnTerminate) or FDestroyAfterTimer; + if FreeThread then + Free + else begin + FTerminated := False; + SetTimer; + end; + end; +end; + +initialization + ThreadList := TThreadList.Create; + +finalization + ThreadList.Free; + +end. diff --git a/internal/4.10.0.10/1/Source/CRXml.pas b/internal/4.10.0.10/1/Source/CRXml.pas new file mode 100644 index 0000000..47c2a29 --- /dev/null +++ b/internal/4.10.0.10/1/Source/CRXml.pas @@ -0,0 +1,1018 @@ + +////////////////////////////////////////////////// +// DB Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +// CRXml +////////////////////////////////////////////////// + +unit CRXml; + +interface + +{$I Dac.inc} +uses + Classes, SysUtils, Contnrs, CLRClasses; + +type + + TChars = array of char; + + TextReader = class + end; + + StreamReader = class(TextReader) + private + FReader: TStream; + FCapacity: Integer; + FReleaseReader: Boolean; + function Eof: Boolean; + public + constructor Create(const path: string; detectEncodingFromByteOrderMarks: Boolean); overload; + constructor Create(input: TStream); overload; + destructor Destroy; override; + procedure Close; + function Read(buffer: TChars; Index, Count: Integer):Integer; + function ReadLine:string; + function ReadToEnd:string; + + property BaseStream: TStream read FReader; + end; + + StringReader = class(TextReader) + private + FText: string; + public + constructor Create(Text: string); + end; + + StreamWriter = class + private + FWriter: TStream; + FReleaseWriter: Boolean; + FEncodingClass: EncodingClass; + public + constructor Create(const path: string; Append: Boolean); overload; + constructor Create(output: TStream; Encoding: EncodingClass); overload; + destructor Destroy; override; + + procedure Close; + procedure Flush; + procedure Write(value: string); + procedure WriteLine(const value: string); + end; + + XmlException = class(Exception); + + XmlNodeType = (ntNone, ntElement, ntAttribute, ntEndElement, ntComment, ntDeclaration, ntDocumentType, ntText); + XmlReadState = (Initial, Interactive, Error, EndOfFile, Closed); + + XmlTextReader = class + private + FText: string; + FTextlc: string; + FPrefix: string; + FValue: string; + FName: string; + FNodeType: XmlNodeType; + FAttrNames: TStringList; + FAttrPrefix: TStringList; + FAttrValues: TStringList; + FOffset: Integer; + FTextLen: Integer; + FState: XmlReadState; + FCurrElementName: string; + FReader: StreamReader; + FEof: Boolean; + function GetHasAttributes: Boolean; + function GetDepth: integer; + function GetAttributeCount: integer; + procedure GetXMLNodeAttributes(const Node: string; AttrNames: TStrings; + AttrValues: TStrings); + procedure ReadFromStream; + procedure InitInstance; + function GetEof:Boolean; + protected + function ScanLine(Lexem: array of string; Offset: Integer = -1):Boolean; + public + constructor Create(Reader: TextReader); + destructor Destroy; override; + + procedure MoveToAttribute(i: integer); overload; + function MoveToAttribute(name: string):Boolean; overload; + function Read: boolean; + function MoveToElement: boolean; + function Items(const Index: Integer): string; overload; + function Items(const AttrName: string): string; overload; + + property Name: string read FName; + property Prefix: string read FPrefix; + property Value: string read FValue; + property NodeType: XmlNodeType read FNodeType; + property AttributeCount: integer read GetAttributeCount; + property Depth: integer read GetDepth; + property ReadState: XmlReadState read FState; + property Eof: Boolean read FEof; + property HasAttributes: Boolean read GetHasAttributes; + end; + + XmlFormatting = (fmtNone, fmtIndented); + XmlWriteState = (wsAttribute, wsClosed, wsContent, wsElement, wsStart); + + XmlTextWriter = class + private + FText: string; + FFormatting: XmlFormatting; + FIndentation: Integer; + FIndentChar: Char; + FQuoteChar: Char; + FWriteState: XmlWriteState; + FDepth: Integer; + FPrefix: TStringList; + FPosStack: TStack; + FTagStack: TStringList; + FWriter: StreamWriter; + function IndentStr: string; + function PopTagName: string; + procedure PushTagName(const TagName: string); + procedure InternalCloseStartTag; + protected + procedure InternalWriteStartElement(const Prefix, LocalName, ns: string); + procedure InternalWriteElementString(const LocalName, ns, Value: string); + procedure InternalWriteAttributeString(const Prefix, LocalName, ns, Value: string); + procedure InternalWriteEndElement; + procedure FlushData; + public + constructor Create(w: StreamWriter); + destructor Destroy; override; + + procedure WriteStartElement(const LocalName: string); overload; + procedure WriteStartElement(const Prefix, LocalName, ns: string); overload; + procedure WriteStartElement(const LocalName, ns: string); overload; + procedure WriteEndElement; + procedure WriteFullEndElement; + procedure WriteString(const Text: string); + procedure WriteElementString(const LocalName, ns, value: string); overload; + procedure WriteElementString(const LocalName, Value: string); overload; + + procedure WriteAttributeString(const LocalName, Value: string); overload; + procedure WriteAttributeString(const Prefix, LocalName, ns, Value: string); overload; + procedure Close; + + property Formatting: XmlFormatting read FFormatting write FFormatting; + property Indentation: Integer read FIndentation write FIndentation; + property IndentChar: Char read FIndentChar write FIndentChar; + property QuoteChar: Char read FQuoteChar write FQuoteChar; + property WriteState: XmlWriteState read FWriteState; + end; + +implementation +uses +{$IFDEF VER7P} + StrUtils, +{$ENDIF} + MemUtils, CRParser; + +const + LineSeparator = #13#10; + SInvalidXML = 'Invalid XML'; + SClassNotSupported = 'Class %s is not supported'; + + procedure DeleteInvisibleSymbol(var s: string); forward; + function XMLDecode(const AStr: String): String; forward; + function CompareLexem(const s, Substr: string; Index: Integer):Boolean; forward; + +type + TXmlParser = class(TParser) + public + constructor Create(const Text: string); override; + end; + +var + XmlSymbolLexems, XmlKeywordLexems: TStringList; + + { XmlTextReader } + +constructor XmlTextReader.Create(Reader: TextReader); +begin + inherited Create; + + + if Reader.InheritsFrom(StreamReader) then begin + FTextLen := -1; + FReader := StreamReader(Reader); + ReadFromStream; + end + else + if Reader.InheritsFrom(StringReader) then begin + FReader := nil; + FText := StringReader(Reader).FText; + FTextLen := Length(FText); + FTextlc := LowerCase(FText); + end + else + raise Exception.CreateFmt(SClassNotSupported, [Reader.ClassName]); + InitInstance; +end; + +destructor XmlTextReader.Destroy; +begin + FAttrNames.Free; + FAttrPrefix.Free; + FAttrValues.Free; + + inherited; +end; + +procedure XmlTextReader.ReadFromStream; +begin + if Assigned(FReader) then begin + if (FOffset >= FTextLen) then begin + if not FReader.Eof then begin + FText := ''; + repeat + FText := FText + ' ' + TrimRight(FReader.ReadLine); + until (Pos('>', FText) <> 0) or FReader.Eof; + FTextlc := LowerCase(FText); + FTextLen := Length(FText); + FOffset := 1; + end + else + FEof := True; + end; + end; +end; + +function XmlTextReader.MoveToElement: boolean; +begin + Result := False; +end; + +function XmlTextReader.ScanLine(Lexem: array of string; Offset: Integer = -1):Boolean; +var + i: Integer; + Str: string; +begin + ReadFromStream; + Result := False; // Make compiler happy; + if Offset <> -1 then + FOffset := Offset; + while (FOffset <= FTextLen) do begin + Result := False; + for i := Low(Lexem) to High(Lexem) do begin + Str := Copy(FTextlc, FOffset, Length(Lexem[i])); + if Str = Lexem[i] then begin + Result := True; + inc(FOffset, Length(Lexem[i])); + break; + end; + end; + if Result then + break; + inc(FOffset); + end; + + if (not Result) and (not GetEof) then + Result := ScanLine(Lexem); +end; + +function XmlTextReader.Read: boolean; +var + Node: string; + NextLexem: Integer; + OldOffset: Integer; + EndTagName: string; + ChildTag: Integer; + k: Integer; + IsTextFound: Boolean; +begin + Result := False; + ReadFromStream; + + if (FState in [Initial, Interactive]) then begin + IsTextFound := False; + if NodeType = ntElement then begin + k := FOffset; + while (FTextlc[k] <> '<') and (k <= Length(FTextlc)) do begin + if FTextlc[k] in ['a'..'z', '0'..'9', '.', ':'] then begin + IsTextFound := True; + break; + end; + inc(k); + end; + if IsTextFound then begin + FNodeType := ntText; + inc(FOffset); + end; + end; + + if not IsTextFound then begin + if not ScanLine(['<']) then begin + if Eof then + exit; + FState := Error; + XmlException.Create('Root element missing'); + end; + if FTextlc[FOffset] = '?' then + FNodeType := ntDeclaration + else if CompareLexem(FTextlc, '!--', FOffset) then + FNodeType := ntComment + else if CompareLexem(FTextlc, '!DOCTYPE', FOffset) then + FNodeType := ntDocumentType + else if FTextlc[FOffset] = '/' then begin + FNodeType := ntEndElement; + end + else if (FTextlc[FOffset-1] = '<') then + FNodeType := ntElement + else + Assert(False); + end; + FState := Interactive; + end; + + FName := ''; + FValue := ''; + FPrefix := ''; + + case FNodeType of + ntDeclaration: begin + inc(FOffset); + NextLexem := PosEx(' ', FTextlc, FOffset); + if NextLexem <> -1 then begin + FName := Trim(Copy(FText, FOffset, NextLexem-FOffset)); + inc(FOffset, NextLexem-FOffset); + end; + if ScanLine(['?>']) then + FValue := Trim(Copy(FText, NextLexem, FOffset-NextLexem-2)) + else begin + FState := Error; + raise XmlException.Create('Invalid declaration tag'); + end; + Result := True; + end; + + ntComment: begin + inc(FOffset, 3); + NextLexem := FOffset; + if ScanLine(['-->']) then + FValue := Trim(Copy(FText, NextLexem, FOffset - NextLexem - 3)) + else begin + FState := Error; + raise XmlException.Create('Invalid comment tag'); + end; + Result := True; + end; + + ntDocumentType: begin + inc(FOffset, 8); + NextLexem := FOffset; + if ScanLine(['[<']) then begin + FName := Trim(Copy(FText, NextLexem, FOffset - NextLexem - 2)); + NextLexem := PosEx('>]', FTextlc, FOffset); + FValue := Trim(Copy(FText, FOffset, NextLexem - FOffset)); + inc(FOffset, NextLexem - FOffset) + end + else begin + FState := Error; + raise XmlException.Create('Invalid Document type tag'); + end; + + Result := True; + end; + + ntEndElement: begin + inc(FOffset); + NextLexem := PosEx('>', FTextlc, FOffset); + FName := Trim(Copy(FText, FOffset, NextLexem - FOffset)); + FOffset := NextLexem; + Result := True; + end; + + ntElement: begin + if FTextlc[FOffset-1] = '<' then begin + NextLexem := PosEx('>', FTextlc, FOffset); + Node := Copy(FText, FOffset, NextLexem - FOffset+1); + + OldOffset := FOffset; + ScanLine([' ','>']); + FName := Trim(Copy(FText, OldOffset, FOffset - OldOffset - 1)); + Delete(Node, 1, Length(FName)); + GetXMLNodeAttributes(Node, FAttrNames, FAttrValues); + + FCurrElementName := FName; + if FName[Length(FName)] = '/'then + Delete(FName, Length(FName), 1); + + FOffset := NextLexem; + Result := True; + end; + end; + + ntText: begin + EndTagName := LowerCase(FCurrElementName); + DeleteInvisibleSymbol(EndTagName); + EndTagname := ''; + + if FCurrElementName[Length(FCurrElementName)] = '/' then + NextLexem := FOffset + Length(FCurrElementName) + else + NextLexem := PosEx(EndTagName, FTextlc, FOffset); + FValue := Trim(Copy(FText,FOffset, NextLexem - FOffset)); + ChildTag := PosEx('<', FValue); + if (ChildTag <> 0) and (not CompareLexem(FValue, '' + break; + lcIdent: begin + WithColon := False; + AttrName := Lexem; + AttrPrefix := ''; + Code := Parser.GetNext(Lexem); + if Code = lcIdent then begin + AttrName := Lexem; + Code := Parser.GetNext(Lexem); + end; + if Code in [16, 19] then begin + if Code = 16 then begin // ':' + Code := Parser.GetNext(Lexem); + if Code <> lcIdent then + raise XmlException.Create(SInvalidXML); + AttrPrefix := AttrName; + AttrName := AttrPrefix + ':' + Lexem; + Code := Parser.GetNext(Lexem); + WithColon := True; + end; + + if Code = 19 then begin // '=' + Code := Parser.GetNext(Lexem); + if (Code <> lcIdent) and (Code <> lcString) then + raise XmlException.Create(SInvalidXML); + AttrValue := XMLDecode({UTF8Decode}(Lexem)); + if WithColon and (LowerCase(AttrName) = 'name') then + AttrName := ':' + AttrName; + AttrNames.Add(AttrName); + AttrValues.Add(AttrValue); + FAttrPrefix.Add(AttrPrefix); + end; + end; + end; + end; + end; + finally + Parser.Free; + end; + Assert(AttrNames.Count = AttrValues.Count); +end; + +function XMLDecode(const AStr: String): String; +var + sb: StringBuilder; +begin + sb := StringBuilder.Create(AStr, Length(AStr)); + try + sb.Replace(''', ''''); + sb.Replace('"', '"'); + sb.Replace('<', '<'); + sb.Replace('>', '>'); + sb.Replace('&', '&'); + Result := sb.ToString; + finally + sb.Free; + end; +end; + + +function XmlTextReader.Items(const Index: Integer): string; +begin + Result := FAttrValues[Index]; +end; + +function XmlTextReader.Items(const AttrName: string): string; +begin + Result := Items(FAttrNames.IndexOf(AttrName)); +end; + +function XmlTextReader.GetAttributeCount: integer; +begin + Result := FAttrNames.Count; +end; + +procedure XmlTextReader.MoveToAttribute(i: integer); +begin + try + FName := FAttrNames[i]; + FValue := FAttrValues[i]; + FPrefix := FAttrPrefix[i]; + except + raise XmlException.Create(Format('Attribute not found (%d)', [i])); + end; +end; + +function XmlTextReader.MoveToAttribute(name: string):Boolean; +begin + try + MoveToAttribute(FAttrNames.IndexOf(name)); + Result := True; + except + Result := False; + end; +end; + +function XmlTextReader.GetDepth: integer; +begin + Result := 0; +end; + +function XmlTextReader.GetHasAttributes: Boolean; +begin + Result := FAttrNames.Count > 0; +end; + +procedure DeleteInvisibleSymbol(var s: string); +var + i: Integer; +begin + for i := Length(s) downto 1 do + if not ((s[i] in ['a'..'z']) or (s[i] <> '.') or (s[i] <> ':')) then + Delete(s, i, 1); +end; + +function CompareLexem(const s, Substr: string; Index: Integer):Boolean; +var + tmp: string; + Len: Integer; +begin + Len := Length(Substr); + tmp := Copy(s, Index, Len); + Result := CompareText(tmp, Substr) = 0; +end; + +procedure XmlTextReader.InitInstance; +begin + if FTextLen > 0 then + FEof := False + else + FEof := True; + FState := Initial; + FNodeType := ntNone; + FOffset := 1; + FAttrNames := TStringList.Create; + FAttrPrefix := TStringList.Create; + FAttrValues := TStringList.Create; + FCurrElementName := ''; +end; + +function XmlTextReader.GetEof: Boolean; +begin + if Assigned(FReader) then + Result := FReader.Eof + else begin + Result := FOffset >= FTextLen; + FEof := Result; + end; +end; + +{ XmlTextWriter } + +constructor XmlTextWriter.Create(w: StreamWriter); +begin + FFormatting := fmtNone; + FIndentation := 2; + FIndentChar := ' '; + FQuoteChar := '"'; + FWriteState := wsStart; + FDepth := 0; + FPrefix := TStringList.Create; + FPosStack := TStack.Create; + FTagStack := TStringList.Create; + FWriter := w; +end; + +destructor XmlTextWriter.Destroy; +begin + FPrefix.Free; + FPosStack.Free; + FTagStack.Free; + + inherited; +end; + +procedure XmlTextWriter.InternalWriteStartElement(const Prefix, LocalName, ns: string); +var + EndTagPos: Integer; +begin + InternalCloseStartTag; + if FWriteState = wsContent then + FlushData; + + if FDepth > 0 then + FText := FText + LineSeparator; + + if Prefix <> '' then + FText := FText + IndentStr + '<' + Prefix + ':' + LocalName + else + FText := FText + IndentStr + '<' + LocalName; + + if ns <> '' then + if Prefix <> '' then + FText := FText + ' ' + 'xmlns:' + Prefix + '=' + FQuoteChar + ns + FQuoteChar + else + FText := FText + ' ' + 'xmlns=' + FQuoteChar + ns + FQuoteChar; + + EndTagPos := Length(FText); + + inc(FDepth); + + FPosStack.Push(Pointer(EndTagPos)); + if Prefix <> '' then + PushTagName(Prefix + ':' + LocalName) + else + PushTagName(LocalName); + + FWriteState := wsElement; +end; + +procedure XmlTextWriter.InternalWriteElementString(const LocalName, ns, Value: string); +begin + InternalCloseStartTag; + if FWriteState = wsElement then + inc(FDepth); + FText := FText + LineSeparator; + FText := FText + IndentStr + '<' + LocalName; + + if ns <> '' then + FText := FText + ' xmlns=' + FQuoteChar + ns + FQuoteChar + '>' + else + FText := FText + '>'; + + if Value <> '' then + FText := FText + Value; + FText := FText + ''; + if FWriteState = wsElement then + dec(FDepth); + FlushData; + FWriteState := wsContent; +end; + +procedure XmlTextWriter.InternalWriteAttributeString(const Prefix, LocalName, ns, Value: string); +var + AttrPos: Integer; + AttrStr: string; +begin + if FWriteState in [wsElement, wsAttribute] then + AttrPos := Integer(FPosStack.Pop) + 1 + else + raise XmlException.Create('Token WriteAttributeString in state Content would result in an invalid XML document.'); + + if Prefix <> '' then + AttrStr := ' ' + Prefix + ':' + else + AttrStr := ' '; + AttrStr := AttrStr + LocalName + '=' + FQuoteChar + Value + FQuoteChar;// + ' '; + + Insert(AttrStr, FText, AttrPos); + + AttrPos := AttrPos + Length(AttrStr); + + if ns <> '' then begin + AttrStr := 'xmlns:' + Prefix + '=' + FQuoteChar + ns + FQuoteChar;// + ' '; + Insert(AttrStr, FText, AttrPos); + AttrPos := AttrPos + Length(AttrStr); + end; + + FPosStack.Push(Pointer(AttrPos-1)); + FWriteState := wsAttribute; +end; + +procedure XmlTextWriter.FlushData; +begin + FWriter.Write(FText); + FText := ''; +end; + +procedure XmlTextWriter.Close; +begin + FlushData; +end; + +procedure XmlTextWriter.WriteStartElement(const LocalName: string); +begin + InternalWriteStartElement('', LocalName, ''); +end; + +procedure XmlTextWriter.WriteStartElement(const Prefix, LocalName, ns: string); +begin + if (Prefix <> '') and (ns = '') then + raise XmlException.Create('Cannot use a prefix with an empty namespace.'); + + InternalWriteStartElement(Prefix, LocalName, ns); +end; + +procedure XmlTextWriter.WriteStartElement(const LocalName, ns: string); +begin + InternalWriteStartElement('', LocalName, ns); +end; + +procedure XmlTextWriter.WriteEndElement; +begin + dec(FDepth); + if (FWriteState = wsAttribute) then begin + FText := FText + ' />'; + PopTagName; + FWriteState := wsContent; + end + else + InternalWriteEndElement; + FlushData; +end; + +procedure XmlTextWriter.InternalWriteEndElement; +var + Len: Integer; +begin + InternalCloseStartTag; + Len := Length(FText); + if (FText = '') or ((Len >= 2) and (FText[Len] <> #10) and (FText[Len-1] <> #13)) then + FText := FText + LineSeparator + IndentStr + '' + else + FText := FText + ''; + FWriteState := wsContent; +end; + +procedure XmlTextWriter.WriteFullEndElement; +begin + dec(FDepth); + InternalWriteEndElement; + FlushData; +end; + +procedure XmlTextWriter.WriteString(const Text: string); +begin + InternalCloseStartTag; + FText := FText + Text; + FWriteState := wsContent; +end; + +procedure XmlTextWriter.WriteElementString(const LocalName, ns, value: string); +begin + InternalWriteElementString(LocalName, ns, Value); +end; + +procedure XmlTextWriter.WriteElementString(const LocalName, Value: string); +begin + InternalWriteElementString(LocalName, '', Value); +end; + +procedure XmlTextWriter.WriteAttributeString(const LocalName, Value: string); +begin + InternalWriteAttributeString('', LocalName, '', Value); +end; + +procedure XmlTextWriter.WriteAttributeString(const Prefix, LocalName, ns, Value: string); +begin + if (Prefix <> '') and (ns = '') then + raise XmlException.Create('Cannot use a prefix with an empty namespace.'); + + InternalWriteAttributeString(Prefix, LocalName, ns, Value); +end; + +function XmlTextWriter.IndentStr: string; +var + i: Integer; +begin + Result := ''; + if (FFormatting = fmtIndented) and (FDepth <> 0) then + for i := 1 to FDepth * FIndentation do + Result := Result + FIndentChar; +end; + +function XmlTextWriter.PopTagName: string; +begin + if FTagStack.Count = 0 then + raise XmlException.Create('There was no XML start tag open.'); + Result := FTagStack[FTagStack.Count-1]; + FTagStack.Delete(FTagStack.Count-1); +end; + +procedure XmlTextWriter.PushTagName(const TagName: string); +begin + FTagStack.Add(TagName); +end; + +procedure XmlTextWriter.InternalCloseStartTag; +begin + if FWriteState in [wsElement, wsAttribute] then begin + FPosStack.Pop; + FText := TrimRight(FText); + FText := FText + '>'; + end; +end; + +{ StreamWriter } + +constructor StreamWriter.Create(const path: string; Append: Boolean); +begin + inherited Create; + + if FileExists(path) and Append then begin + FWriter := TFileStream.Create(path, fmOpenReadWrite); + FWriter.Seek(0, soFromEnd); + end + else + FWriter := TFileStream.Create(path, fmCreate); + FReleaseWriter := True; +end; + +constructor StreamWriter.Create(output: TStream; Encoding: EncodingClass); +begin + inherited Create; + + FWriter := output; + FReleaseWriter := False; + FEncodingClass := Encoding; +end; + +destructor StreamWriter.Destroy; +begin + if FReleaseWriter then + FWriter.Free; + + inherited; +end; + +procedure StreamWriter.Close; +begin +end; + +procedure StreamWriter.Flush; +begin +end; + +procedure StreamWriter.Write(value: string); +var + Str: string; +begin + if FEncodingClass <> nil then begin + Str := FEncodingClass.GetString(TBytes(value)); + FWriter.Write(PChar(Str)^, Length(Str)); + end + else + FWriter.Write(PChar(value)^, Length(value)); +end; + +procedure StreamWriter.WriteLine(const value: string); +begin + Write(value + LineSeparator); +end; + + { StreamReader } + +constructor StreamReader.Create(const path: string; detectEncodingFromByteOrderMarks: Boolean); +begin + FCapacity := 512; + FReader := TFileStream.Create(path, fmOpenRead); + FReleaseReader := True; +end; + +constructor StreamReader.Create(input: TStream); +begin + FCapacity := 512; + FReader := input; + FReleaseReader := False; +end; + +destructor StreamReader.Destroy; +begin + if FReleaseReader then + FReader.Free; +end; + +function StreamReader.Eof: Boolean; +begin + Result := FReader.Position = FReader.Size; +end; + +procedure StreamReader.Close; +begin + +end; + +function StreamReader.ReadToEnd:string; +var + Len: Int64; +begin + Len := FReader.Size - FReader.Position; + SetLength(Result, Len); + Read(TChars(Result), 0, Len); +end; + +function StreamReader.Read(buffer: TChars; Index, Count: Integer):Integer; +begin + Result := FReader.Read((PChar(buffer) + Index)^, Count); +end; + +function StreamReader.ReadLine:string; +var + SeparatorPos: Integer; + Count, BeginPos: Integer; + Position, NextPosition: Int64; +begin + if Eof then begin + Result := ''; + exit; + end; + + SetLength(Result, FCapacity); + System.FillChar(Result[1], Length(Result), ' '); + Position := FReader.Position; + + Count := 1; + SeparatorPos := -1; + BeginPos := 1; + while True do begin + Count := FReader.Read(Result[BeginPos], Length(Result) - BeginPos + 1); + SeparatorPos := PosEx(LineSeparator, Result, BeginPos-1); + + if Eof or (SeparatorPos <> 0) then + break; + BeginPos := Length(Result)+1; + SetLength(Result, BeginPos + Round(BeginPos * 0.3)); + System.FillChar(Result[BeginPos], Length(Result) - BeginPos + 1, ' '); + end; + + if SeparatorPos <> 0 then + SetLength(Result, SeparatorPos + 1) + else + SetLength(Result, Count); + + FCapacity := Length(Result); + NextPosition := Position + FCapacity; + if (Count <> 0) and (NextPosition + 1 <> FReader.Size) then + FReader.Seek(Position - FReader.Position + FCapacity, soFromCurrent); +end; + +{ TXmlParser } + +constructor TXmlParser.Create(const Text: string); +begin + inherited; + + FSymbolLexems := XmlSymbolLexems; + FKeywordLexems := XmlKeywordLexems; +end; + +{ StringReader } + +constructor StringReader.Create(Text: string); +begin + FText := Text; +end; + +initialization + XmlSymbolLexems := TStringList.Create; + XmlKeywordLexems := TStringList.Create; + + XmlSymbolLexems.AddObject(':', TObject(integer(16))); + XmlSymbolLexems.AddObject('=', TObject(integer(19))); + XmlSymbolLexems.CustomSort(CRCmpStrings); + +finalization + XmlSymbolLexems.Free; + XmlKeywordLexems.Free; + +end. diff --git a/internal/4.10.0.10/1/Source/CoreLab.snk b/internal/4.10.0.10/1/Source/CoreLab.snk new file mode 100644 index 0000000..a57bc46 Binary files /dev/null and b/internal/4.10.0.10/1/Source/CoreLab.snk differ diff --git a/internal/4.10.0.10/1/Source/DAConsts.pas b/internal/4.10.0.10/1/Source/DAConsts.pas new file mode 100644 index 0000000..dc7771f --- /dev/null +++ b/internal/4.10.0.10/1/Source/DAConsts.pas @@ -0,0 +1,115 @@ + +////////////////////////////////////////////////// +// DB Access Components +// Copyright (c) 1998-2007 Core Lab. All right reserved. +// DB Access constants +////////////////////////////////////////////////// + +{$IFNDEF CLR} +unit DAConsts; +{$ENDIF} +interface + +const +{$IFDEF CLR} + LineSeparator = #$D#$A; +{$ELSE} + LineSeparator = #$D; +{$ENDIF} + + // TStringList line separator +{$IFDEF LINUX} + SLLineSeparator = #$A; +{$ELSE} + SLLineSeparator = #$D#$A; +{$ENDIF} + Tabulation = #9; + MaxUTF8CharLen = 3; + +resourcestring + SUnknownDataType = 'Unknown data type'; + SDataTypeNotSupported = 'Data type is not supported'; + SFieldNotFound = 'Field %s not found'; + SAttributeNotFount = 'Attribute %s not found'; + SCannotConvertType = 'Cannot convert type'; + SIllegalFilter = 'Illegal filter expression'; + SNeedBlobType = 'Field is not BLOB'; + SInvalidSharedObject = 'Invalid SharedObject'; + SInvalidBlob = 'Invalid BLOB'; + SBlobMustBeCached = 'Blob must be in cached mode'; + SCachedAlreadyEnabled = 'Cached is already enabled'; + SKeyFieldsRequired = 'Key fields required to call FindKey or FindNearest'; + SKeyFieldsReq = 'Unique keyfields required'; + SNoKeyFields = 'Key fields not found'; + SBadTableInfoName = 'TableInfo name must be provided'; + SBadStatementType = 'Bad statement type'; + SBadUpdatingTable = 'Wrong UpdatingTable value - table %s is unknown'; + + SInvalidUnComprBlobSize = 'Invalid uncompressed blob size'; + SInvalidComprBlobSize = 'Invalid compressed blob size'; + SInvalidComprBlobHeader = 'Invalid compressed blob header'; + SInvalidComprBlobData = 'Invalid compressed blob data'; + + SDataSetIsNotPrepared = 'DataSet is not prepared'; + SInvalidKeyField = 'Error in KeyFields string'; + SNotCachedUpdate = 'Not in cached update mode'; + SUpdateWrongDB = 'Cannot update, %s is not owned by %s'; + + SConnectionNotDefined = 'Connection is not defined'; + SCannotConnect = 'Cannot connect to database'; + SMacroNotFound = 'Macro %s not found'; + STransactionInProgress = 'User transaction is already in progress'; + SUpdateFailed = 'Update failed. Found %d records'; + SRefreshFailed = 'Refresh failed. Found %d records'; + SInvalidFetchRows = 'FetchRows must be 1..10000'; + SNoCorrespondParam = 'Not found field corresponding parameter %s'; + SUnknownParamDataType = 'Unknown type of parameter %s'; + SRecordChanged = 'Record was changed by another user'; + STableNameNotDefined = 'TableName must be defined'; + SStoredProcNotDefined = 'StoredProcName must be defined'; + SConnectionIsClosed = 'Operation is not allowed when the connection is closed'; + SCannotPerformIfPooling = 'Operation is not allowed when Pooling is True'; + SMaxConnectionsReached = 'Maximum connections reached in pool'; + SDataSetNotDefined = 'DataSet must be defined'; + + SCannotChangeIsUnicode = 'Cannot change IsUnicode if Size > 0'; + SColumnNotFound = 'Column %s not found'; + SNoTimers = 'Not enough timers available'; + + sBlobNotCompressed = 'Blob is not compressed'; + SCompressorNotLinked = 'Compressor function is not linked'; + SUncompressorNotLinked = 'Uncompressor function is not linked'; + + SUpdateComponentCircularReferences = 'Circular references are not allowed between TCustomDADataset and TCustomDAUpdateSQL objects'; + SUpdateComponentInvalidType = 'Only %s and %s objects are allowed in update properties'; + SUpdateObjectEmptySQL = 'SQL property of InsertObject, ModifyObject, DeleteObject or RefreshObject cannot be empty'; + + SDateEncodeError = 'Invalid argument to date encode'; + SInvalidXML = 'Invalid XML document'; + + SWrongTblCount = 'To execute BackupQuery TableNames must have not more than one table'; + SBHCaption = '-- %s version: %s'#$D#$A + + '-- %s server version: %s'#$D#$A + + '-- %s client version: %s'#$D#$A + + '-- Script date %s'#$D#$A + + '-- ---------------------------------------------------------------------- '#$D#$A + + '-- Server: %s'#$D#$A + + '-- Database: %s'#$D#$A#$D#$A; + SBHTableData = '-- '#$D#$A + + '-- Dumping data for table %s'#$D#$A + + '-- '#$D#$A#$D#$A; + + SAreYouSureRestore = 'Are you sure to restore data?'; + + SInvalidBatchMove = 'Invalid batch move parameters'; + SCannotFindField = 'Cannot find field'; + + SInvalidLexem = 'Invalid lexem "%s" at position %d in statement:'#$D#$A'%s'; + + SEmptySQLStatement = 'No SQL statement provided'; + + SInvalidBlobPosition = 'Invalid BLOB position'; + +implementation + +end. diff --git a/internal/4.10.0.10/1/Source/DADump.pas b/internal/4.10.0.10/1/Source/DADump.pas new file mode 100644 index 0000000..77166e7 --- /dev/null +++ b/internal/4.10.0.10/1/Source/DADump.pas @@ -0,0 +1,416 @@ + +////////////////////////////////////////////////// +// DB Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I Dac.inc} + +unit DADump; +{$ENDIF} + +interface + +uses + SysUtils, Classes, DB, CRAccess, DBAccess, DAScript; + +type + TDADump = class; + + TDABackupProgressEvent = procedure (Sender: TObject; ObjectName: string; ObjectNum, ObjectCount, Percent: integer) of object; + TDARestoreProgressEvent = procedure (Sender: TObject; Percent: integer) of object; + + TDADumpOptions = class(TPersistent) + protected + FOwner: TDADump; + FGenerateHeader: boolean; + FAddDrop: boolean; + FQuoteNames: boolean; + procedure AssignTo(Dest: TPersistent); override; + public + constructor Create(Owner: TDADump); + published + property GenerateHeader: boolean read FGenerateHeader write FGenerateHeader default True; + property AddDrop: boolean read FAddDrop write FAddDrop default True; + property QuoteNames: boolean read FQuoteNames write FQuoteNames default False; + end; + + TDADump = class(TComponent) + protected + FConnection: TCustomDAConnection; + FSQL: TStrings; + FStream: TStream; + FOptions: TDADumpOptions; + FDebug: boolean; + FDesignCreate: boolean; + FTables: TStringList; + + FLeftQuote: char; + FRightQuote: char; + + FOnBackupProgress: TDABackupProgressEvent; + FOnRestoreProgress: TDARestoreProgressEvent; + + procedure AssignTo(Dest: TPersistent); override; + function GetTableNames: string; virtual; + procedure SetTableNames(Value: string); virtual; + + function CreateOptions: TDADumpOptions; virtual; + function CreateScript: TDAScript; virtual; + + procedure Notification(Component: TComponent; Operation: TOperation); override; + procedure SetConnection(Value: TCustomDAConnection); + procedure BeginConnection; + procedure EndConnection; + + procedure SetSQL(Value: TStrings); + + procedure SetOptions(Value: TDADumpOptions); + + procedure Loaded; override; + + procedure InternalBackup(Query: string); virtual; abstract; + procedure Add(const Line: string); overload; // Line must be w/o #$D#$A + procedure Add(const sl: TStringList); overload; + procedure AddLineToSQL(const Line: string); overload; // Line may contains #$D#$A + procedure AddLineToSQL(const Line: string; const Args: array of const); overload; + function GetTableInfoClass: TTableInfoClass; virtual; + function QuoteName(const AName: string): string; virtual; + public + constructor Create(Owner: TComponent); override; + destructor Destroy; override; + + procedure Backup; + procedure BackupToStream(Stream: TStream); + procedure BackupToFile(const FileName: string); + procedure BackupQuery(Query: string); + procedure Restore; + procedure RestoreFromStream(Stream: TStream); + procedure RestoreFromFile(const FileName: string); + + property Connection: TCustomDAConnection read FConnection write SetConnection; + property Options: TDADumpOptions read FOptions write SetOptions; + published + property TableNames: string read GetTableNames write SetTableNames; + property SQL: TStrings read FSQL write SetSQL; + property Debug: boolean read FDebug write FDebug default False; + + property OnBackupProgress: TDABackupProgressEvent read FOnBackupProgress write FOnBackupProgress; + property OnRestoreProgress: TDARestoreProgressEvent read FOnRestoreProgress write FOnRestoreProgress; + end; + + TDADumpUtils = class + public + class procedure SetDesignCreate(Obj: TDADump; Value: boolean); + class function GetDesignCreate(Obj: TDADump): boolean; + end; + +implementation + +uses + DAConsts; + +{ TDADumpOptions } + +constructor TDADumpOptions.Create(Owner: TDADump); +begin + inherited Create; + + FOwner := Owner; + FGenerateHeader := True; + FAddDrop := True; + FQuoteNames := False; +end; + +procedure TDADumpOptions.AssignTo(Dest: TPersistent); +begin + if Dest is TDADumpOptions then begin + TDADumpOptions(Dest).GenerateHeader := GenerateHeader; + TDADumpOptions(Dest).AddDrop := AddDrop; + TDADumpOptions(Dest).QuoteNames := QuoteNames; + end + else + inherited; +end; + +{ TDADump } + +constructor TDADump.Create(Owner: TComponent); +begin + inherited Create(Owner); + + FDesignCreate := csDesigning in ComponentState; + FOptions := CreateOptions; + FSQL := TStringList.Create; + FTables := TStringList.Create; + + FLeftQuote := '"'; + FRightQuote := '"'; +end; + +destructor TDADump.Destroy; +begin + FTables.Free; + FSQL.Free; + FOptions.Free; + + inherited; +end; + +procedure TDADump.AssignTo(Dest: TPersistent); +begin + if Dest is TDADump then begin + TDADump(Dest).TableNames := TableNames; + TDADump(Dest).Connection := Connection; + TDADump(Dest).SQL.Text := SQL.Text; + TDADump(Dest).Debug := Debug; + TDADump(Dest).Options := Options; + end + else + inherited; +end; + +function TDADump.GetTableNames: string; +begin + Result := ''; + Assert(False); +end; + +procedure TDADump.SetTableNames(Value: string); +begin + Assert(False); +end; + +function TDADump.CreateOptions: TDADumpOptions; +begin + Result := TDADumpOptions.Create(Self); +end; + +function TDADump.CreateScript: TDAScript; +begin + Result := TDAScript.Create(nil); +end; + +procedure TDADump.Notification(Component: TComponent; Operation: TOperation); +begin + if (Component = FConnection) and (Operation = opRemove) then + Connection := nil; + + inherited; +end; + +procedure TDADump.SetConnection(Value: TCustomDAConnection); +begin + if Value <> FConnection then begin + if FConnection <> nil then + RemoveFreeNotification(FConnection); + + FConnection := Value; + + if FConnection <> nil then + FreeNotification(FConnection); + end; +end; + +procedure TDADump.BeginConnection; +begin + if FConnection = nil then + raise Exception.Create(SConnectionNotDefined); + TDBAccessUtils.InternalConnect(FConnection); +end; + +procedure TDADump.EndConnection; +begin + TDBAccessUtils.InternalDisconnect(FConnection); +end; + +procedure TDADump.SetSQL(Value: TStrings); +begin + if FSQL.Text <> Value.Text then begin + FSQL.BeginUpdate; + try + FSQL.Assign(Value); + finally + FSQL.EndUpdate; + end; + end; +end; + +procedure TDADump.SetOptions(Value: TDADumpOptions); +begin + FOptions.Assign(Value); +end; + +procedure TDADump.Loaded; +begin + inherited; + + FDesignCreate := False; +end; + +procedure TDADump.Backup; +begin + InternalBackup(''); +end; + +procedure TDADump.BackupToStream(Stream: TStream); +begin + FStream := Stream; + try + InternalBackup(''); + finally + FStream := nil; + end; +end; + +procedure TDADump.BackupToFile(const FileName: string); +var + Stream: TStream; +begin + Stream := TFileStream.Create(FileName, fmCreate); + try + BackupToStream(Stream); + finally + Stream.Free; + end; +end; + +procedure TDADump.BackupQuery(Query: string); +var + OldTables: TStringList; +begin + if Trim(Query) = '' then + raise EDatabaseError.Create(SEmptySQLStatement); + + OldTables := TStringList.Create; + OldTables.Assign(FTables); + FTables.Clear; + try + InternalBackup(Query); + finally + FTables.Assign(OldTables); + OldTables.Free; + end; +end; + +procedure TDADump.Restore; +var + Script: TDAScript; + Len: integer; +begin + Script := CreateScript; + try + Script.Connection := Connection; + Script.Debug := Debug; + Script.SQL := SQL; + Len := Length(SQL.Text); + + while Script.ExecuteNext do + if Assigned(FOnRestoreProgress) and (Len > 0) then + FOnRestoreProgress(Self, Trunc((Script.StartPos / Len) * 100{"*" after "/" to prevent IntOverflow})); + finally + Script.Free; + end; +end; + +procedure TDADump.RestoreFromStream(Stream: TStream); +const + BlockSize = 64 * 1024; +var + Script: TDAScript; + TotalCount: Int64; +begin + Script := CreateScript; + try + TotalCount := Stream.Size; + Script.Connection := Connection; + Script.Debug := Debug; + TDAScriptUtils.Open(Script, Stream); + try + while Script.ExecuteNext do + if Assigned(FOnRestoreProgress) and (TotalCount > 0) then + FOnRestoreProgress(Self, Trunc((Script.StartPos / TotalCount) * 100{"*" after "/" to prevent IntOverflow})); + finally + TDAScriptUtils.Close(Script); + end; + finally + Script.Free; + end; +end; + +procedure TDADump.RestoreFromFile(const FileName: string); +var + FileStream: TFileStream; +begin + FileStream := TFileStream.Create(FileName, fmOpenRead or fmShareDenyWrite); + try + RestoreFromStream(FileStream); + finally + FileStream.Free; + end; +end; + +procedure TDADump.Add(const Line: string); // Line must be w/o #$D#$A +var + s: string; +begin + if FStream = nil then + FSQL.Add(Line) + else + begin + s := Line + #$D#$A; + FStream.WriteBuffer(s[1], Length(s)); + end; +end; + +procedure TDADump.Add(const sl: TStringList); +var + i: integer; +begin + for i := 0 to sl.Count - 1 do + Add(sl[i]); +end; + +procedure TDADump.AddLineToSQL(const Line: string); // Line may contains #$D#$A +var + sl: TStringList; +begin + sl := TStringList.Create; + try + sl.Text := Line; + Add(sl); + finally + sl.Free; + end; +end; + +procedure TDADump.AddLineToSQL(const Line: string; const Args: array of const); +begin + AddLineToSQL(Format(Line, Args)); +end; + +function TDADump.GetTableInfoClass: TTableInfoClass; +begin + Result := TCRTableInfo; +end; + +function TDADump.QuoteName(const AName: string): string; +begin + Result := GetTableInfoClass.NormalizeName(AName, FLeftQuote, FRightQuote, FOptions.QuoteNames); +end; + +{ TDADumpUtils } + +class procedure TDADumpUtils.SetDesignCreate(Obj: TDADump; Value: boolean); +begin + Obj.FDesignCreate := Value; +end; + +class function TDADumpUtils.GetDesignCreate(Obj: TDADump): boolean; +begin + Result := Obj.FDesignCreate; +end; + +end. diff --git a/internal/4.10.0.10/1/Source/DALoader.pas b/internal/4.10.0.10/1/Source/DALoader.pas new file mode 100644 index 0000000..7262308 --- /dev/null +++ b/internal/4.10.0.10/1/Source/DALoader.pas @@ -0,0 +1,605 @@ + +////////////////////////////////////////////////// +// DB Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +// TDALoader +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I Dac.inc} + +unit DALoader; +{$ENDIF} + +interface + +uses +{$IFDEF CLR} + Variants, +{$ENDIF} + Classes, SysUtils, DBAccess, DB, MemData; + +type + TDAColumnDataType = (ctString, ctDate, ctInteger, ctUInteger, ctFloat); + + TDAColumnClass = class of TDAColumn; + + TDAColumn = class (TCollectionItem) + private + FName: string; + FFieldType: TFieldType; + + protected + function GetDataType: TDAColumnDataType; virtual; + procedure SetDataType(Value: TDAColumnDataType); virtual; + procedure SetFieldType(Value: TFieldType); virtual; + function GetDisplayName: string; override; + property DataType: TDAColumnDataType read GetDataType write SetDataType; + + public + constructor Create(Collection: TCollection); override; + + published + property Name: string read FName write FName; + property FieldType: TFieldType read FFieldType write SetFieldType default ftString; + end; + + TDAColumns = class (TOwnedCollection) + private + function GetColumn(Index: integer): TDAColumn; + procedure SetColumn(Index: integer; Value: TDAColumn); + + public + property Items[Index: integer]: TDAColumn read GetColumn write SetColumn; default; + end; + + TDALoader = class; + + TDAPutDataEvent = procedure (Sender: TDALoader) of object; + TGetColumnDataEvent = procedure (Sender: TObject; Column: TDAColumn; Row: integer; + var Value: variant; var IsEOF: boolean) of object; + + TDALoader = class (TComponent) + private + FTableName: string; + + FOnPutData: TDAPutDataEvent; + FOnGetColumnData: TGetColumnDataEvent; + + procedure SetConnection(Value: TCustomDAConnection); + procedure SetColumns(Value: TDAColumns); + + function IsColumnsStored: boolean; + procedure CreateColumnsByFields(Fields: TFields); + protected + FColumns: TDAColumns; + FConnection: TCustomDAConnection; + + FLastRow: integer; + FDesignCreate: boolean; + + FSkipReadOnlyFieldDescs: boolean; + + procedure Loaded; override; + + procedure Notification(Component: TComponent; Operation: TOperation); override; + procedure BeginConnection; virtual; + procedure EndConnection; virtual; + + procedure CheckTableName; + + procedure Prepare; virtual; + procedure Reset; virtual; + procedure InternalPutData; virtual; + procedure PutData; virtual; + procedure DoLoad; virtual; + procedure Finish; virtual; + procedure SetTableName(Value: string); virtual; + + class function DAColumnClass: TDAColumnClass; virtual; + + function UsedConnection: TCustomDAConnection; virtual; + + function ConvertDataTypeToColumnType( const DataType: word): TDAColumnDataType; virtual; + procedure FillColumn(Column: TDAColumn; FieldDesc: TFieldDesc); virtual; + public + constructor Create(Owner: TComponent); override; + destructor Destroy; override; + + procedure PutColumnData(Col: integer; Row: integer; const Value: variant); overload; virtual; + procedure PutColumnData(const ColName: string; Row: integer; const Value: variant); overload; + + procedure Load; virtual; + + procedure CreateColumns; + procedure LoadFromDataSet(DataSet: TDataSet); + + property Connection: TCustomDAConnection read FConnection write SetConnection; + property TableName: string read FTableName write SetTableName; + property Columns: TDAColumns read FColumns write SetColumns stored IsColumnsStored; + + property OnPutData: TDAPutDataEvent read FOnPutData write FOnPutData; + property OnGetColumnData: TGetColumnDataEvent read FOnGetColumnData write FOnGetColumnData; + end; + + TDALoaderUtils = class + public + class procedure SetDesignCreate(Obj: TDALoader; Value: boolean); + class function GetDesignCreate(Obj: TDALoader): boolean; + class function UsedConnection(Obj: TDALoader): TCustomDAConnection; + end; + +implementation + +uses +{$IFDEF LINUX} +{$ELSE} + Windows, +{$ENDIF} + CRAccess, DAConsts {$IFNDEF CLR}{$IFDEF VER6P}, Variants{$ENDIF}{$ENDIF}, MemUtils; + +{ TDAColumn } + +constructor TDAColumn.Create(Collection: TCollection); +begin + inherited; + + FFieldType := ftString; +end; + +function TDAColumn.GetDataType: TDAColumnDataType; +begin + case FieldType of + ftString, ftMemo, ftFmtMemo, ftFixedChar, ftWideString, ftGuid {$IFDEF VER6P}, ftTimeStamp{$ENDIF}{$IFDEF VER10P}, ftWideMemo{$ENDIF}: + Result := ctString; + ftSmallint, ftInteger, ftWord, ftAutoInc: + Result := ctInteger; + ftLargeint: + Result := ctUInteger; + ftFloat, ftCurrency, ftBCD{$IFDEF VER6P}, ftFMTBcd{$ENDIF}: + Result := ctFloat; + ftDate, ftTime, ftDateTime: + Result := ctDate; + else + Result := ctString; + end; +end; + +procedure TDAColumn.SetDataType(Value: TDAColumnDataType); +begin + case Value of + ctString: + FieldType := ftString; + ctDate: + FieldType := ftDateTime; + ctInteger: + FieldType := ftInteger; + ctUInteger: + FieldType := ftLargeint; + ctFloat: + FieldType := ftFloat; + end; +end; + +procedure TDAColumn.SetFieldType(Value: TFieldType); +begin + FFieldType := Value; +end; + +function TDAColumn.GetDisplayName: string; +begin + Result := FName; +end; + +{ TDAColumns } + +function TDAColumns.GetColumn(Index: integer): TDAColumn; +begin + Result := TDAColumn(inherited Items[Index]); +end; + +procedure TDAColumns.SetColumn(Index: integer; Value: TDAColumn); +begin + Items[Index].Assign(Value); +end; + +{ TDALoader } + +constructor TDALoader.Create(Owner: TComponent); +begin + inherited Create(Owner); + + FColumns := TDAColumns.Create(Self, DAColumnClass); + + FDesignCreate := csDesigning in ComponentState; + FSkipReadOnlyFieldDescs := True; +end; + +destructor TDALoader.Destroy; +begin + FColumns.Free; + + inherited; +end; + +procedure TDALoader.Loaded; +begin + inherited; + + FDesignCreate := False; +end; + +procedure TDALoader.BeginConnection; +begin + if UsedConnection = nil then + raise Exception.Create(SConnectionNotDefined); + TDBAccessUtils.InternalConnect(UsedConnection); +end; + +procedure TDALoader.EndConnection; +begin + TDBAccessUtils.InternalDisconnect(UsedConnection); +end; + +procedure TDALoader.CheckTableName; +begin + if Trim(FTableName) = '' then + raise Exception.Create(STableNameNotDefined); +end; + +procedure TDALoader.Prepare; +begin + BeginConnection; + CheckTableName; + Reset; +end; + +procedure TDALoader.Finish; +begin + EndConnection; +end; + +procedure TDALoader.Reset; +begin + FLastRow := -1; +end; + +procedure TDALoader.PutColumnData(Col: integer; Row: integer; const Value: variant); +begin + if Col >= FColumns.Count then + DatabaseError('Invalid column number'); + + if (Row < FLastRow) or (Row < 1) then + DatabaseError('Invalid row number'); + + FLastRow := Row - 1; +end; + +procedure TDALoader.PutColumnData(const ColName: string; Row: integer; const Value: variant); +var + i: integer; +begin + for i := 0 to FColumns.Count - 1 do + if AnsiSameText(ColName, FColumns[i].Name) then begin + PutColumnData(i, Row, Value); + Exit; + end; + raise Exception.Create(Format(SColumnNotFound, [ColName])); +end; + +procedure TDALoader.InternalPutData; +var + Value: variant; + EOF: boolean; + i,Row: integer; +begin + if Assigned(FOnGetColumnData) then begin + Row := 1; + EOF := False; + while not EOF do begin + for i := 0 to FColumns.Count - 1 do begin + FOnGetColumnData(Self, FColumns[i], Row, Value, EOF); + if not EOF then + PutColumnData(i, Row, Value) + else begin + if i <> 0 then + FLastRow := -1; // to prevent insertion of incomplete row. If EOF is set to True on getting value 1..last field, all values of this record is ignored. + break; // stop loading immediately after getting EOF + end; + end; + if not EOF then + Inc(Row); + end; + end; +end; + +procedure TDALoader.PutData; +begin + if Assigned(FOnPutData) then + FOnPutData(Self) + else + InternalPutData; +end; + +procedure TDALoader.DoLoad; +begin +end; + +procedure TDALoader.Load; +begin + BeginConnection; + try + if Columns.Count = 0 then + CreateColumns; + try + Prepare; + StartWait; + PutData; + finally + Finish; + StopWait; + end; + finally + EndConnection; + end; +end; + +function TDALoader.ConvertDataTypeToColumnType(const DataType: word): TDAColumnDataType; +begin + Result := ctString; // To disable warning + + case DataType of + dtUnknown, dtString, dtBoolean, dtBlob, dtMemo, dtWideMemo, dtExtString, dtWideString, dtExtWideString: + Result := ctString; + dtInt8, dtInt16, dtInt32, dtInt64: + Result := ctInteger; + dtUInt16, dtUInt32: + Result := ctUInteger; + dtFloat, dtCurrency: + Result := ctFloat; + dtDate, dtTime, dtDateTime: + Result := ctDate; + else + //Assert(False, 'Unknown datatype (' + IntToStr(DataType) + ')'); + end; +end; + +procedure TDALoader.FillColumn(Column: TDAColumn; FieldDesc: TFieldDesc); +begin + Column.Name := FieldDesc.Name; + Column.DataType := ConvertDataTypeToColumnType(FieldDesc.DataType); + // Needs to override to fill ColumnType +end; + +procedure TDALoader.CreateColumns; +var + RecordSet: TCustomDADataSet; + FieldDesc: TFieldDesc; + i: integer; +begin + BeginConnection; + try + CheckTableName; + FColumns.Clear; + RecordSet := UsedConnection.CreateDataSet; + RecordSet.SQL.Text := 'SELECT * FROM ' + FTableName + ' WHERE 1=0'; // CR-M15322 + FColumns.BeginUpdate; + try + RecordSet.Execute; + for i := 0 to RecordSet.FieldCount - 1 do begin + FieldDesc := RecordSet.GetFieldDesc(RecordSet.Fields[i]); + if not (FieldDesc.ReadOnly and FSkipReadOnlyFieldDescs) then + FillColumn(TDAColumn(FColumns.Add), FieldDesc); + end; + finally + FColumns.EndUpdate; + RecordSet.Free; + end; + + finally + EndConnection; + end; +end; + +procedure TDALoader.CreateColumnsByFields(Fields: TFields); +var + i: word; + Field: TField; +begin + FColumns.Clear; + try + FColumns.BeginUpdate; + + for i := 0 to Fields.Count - 1 do begin + Field := Fields[i]; + if not Field.ReadOnly then + with TDAColumn(FColumns.Add) do begin + Name := Field.FieldName; + FieldType := Field.DataType; + end; + end; + + finally + FColumns.EndUpdate; + end; +end; + +procedure TDALoader.Notification(Component: TComponent; Operation: TOperation); +begin + if (Component = FConnection) and (Operation = opRemove) then + Connection := nil; + + inherited; +end; + +procedure TDALoader.SetConnection(Value: TCustomDAConnection); +begin + if Value <> FConnection then begin + if FConnection <> nil then + RemoveFreeNotification(FConnection); + + FConnection := Value; + + if FConnection <> nil then + FreeNotification(FConnection); + end; +end; + +procedure TDALoader.SetColumns(Value: TDAColumns); +begin + FColumns.Assign(Value); +end; + +function TDALoader.IsColumnsStored: boolean; +begin + Result := FColumns.Count > 0; +end; + +procedure TDALoader.SetTableName(Value: string); +begin + if Value <> FTableName then begin + FTableName := Value; + if not (csLoading in ComponentState) and (UsedConnection <> nil) and UsedConnection.Connected and (FColumns.Count = 0) then + CreateColumns; + end; +end; + +class function TDALoader.DAColumnClass: TDAColumnClass; +begin + Result := TDAColumn; +end; + +function TDALoader.UsedConnection: TCustomDAConnection; +begin + Result := FConnection; +end; + +procedure TDALoader.LoadFromDataSet(DataSet: TDataSet); +var + row, col: integer; + ColNo: array of integer; + OldActive: boolean; + + Field: TField; + FieldDesc: TFieldDesc; + RecordSet: TCRRecordSet; + ObjRef: TSharedObject; + IsBlank: boolean; + AValue: variant; + Bookmark: TBookmark; + + procedure FillColumsNumber; + var + i, j: integer; + fname: string; + begin + for i := 0 to DataSet.FieldCount - 1 do begin + ColNo[i] := -1; + fname := DataSet.Fields[i].FieldName; + + for j := 0 to FColumns.Count - 1 do + if AnsiSameText(fname, FColumns[j].Name) then begin + ColNo[i] := j; + break; + end; + end; + end; + +begin + if DataSet = nil then + raise Exception.Create(SDataSetNotDefined); + + OldActive := DataSet.Active; + Bookmark := nil; + try + DataSet.DisableControls; + Bookmark := DataSet.GetBookmark; + + DataSet.Open; + DataSet.First; + + SetLength(ColNo, DataSet.FieldCount); + + if Columns.Count = 0 then begin + CreateColumnsByFields(DataSet.Fields); + + for col := 0 to DataSet.FieldCount - 1 do + ColNo[col] := col; + end + else + FillColumsNumber; + + Prepare; + StartWait; + try + DataSet.First; + for row := 1 to DataSet.RecordCount do begin + for col := 0 to DataSet.FieldCount - 1 do + if ColNo[col] >= 0 then begin + Field := DataSet.Fields[col]; + if DataSet is TCustomDADataSet then + with TCustomDADataSet(DataSet) do begin + FieldDesc := GetFieldDesc(Field); + if FieldDesc <> nil then begin + RecordSet := TDBAccessUtils.GetIRecordSet(TCustomDADataSet(DataSet)); + if RecordSet.IsComplexFieldType(FieldDesc.DataType) + and not((FieldDesc.DataType = dtExtString) + or (FieldDesc.DataType = dtExtWideString) + or (FieldDesc.DataType = dtExtVarBytes) + {$IFDEF VER5P}or (FieldDesc.DataType = dtVariant){$ENDIF}) then begin + IsBlank := RecordSet.GetNull(FieldDesc.FieldNo, ActiveBuffer); + ObjRef := RecordSet.GetObject(FieldDesc.FieldNo, ActiveBuffer); + if IsBlank then + AValue := Null + else begin + {$IFDEF CLR} + AValue := Variant(ObjRef); + {$ELSE} + AValue := Unassigned; + TVarData(AValue).VType := varByRef; + TVarData(AValue).VPointer := ObjRef; + {$ENDIF} + end; + PutColumnData(ColNo[col], row, AValue); + Continue; + end; + end; + end; + // To avoid memory leak + AValue := Unassigned; + AValue := Field.Value; + PutColumnData(ColNo[col], row, AValue); + end; + DataSet.Next; + end; + DoLoad; + finally + Finish; + StopWait; + end; + finally + DataSet.Active := OldActive; + DataSet.GotoBookmark(Bookmark); + DataSet.EnableControls; + end; +end; + +{ TDALoaderUtils } + +class procedure TDALoaderUtils.SetDesignCreate(Obj: TDALoader; Value: boolean); +begin + Obj.FDesignCreate := Value; +end; + +class function TDALoaderUtils.GetDesignCreate(Obj: TDALoader): boolean; +begin + Result := Obj.FDesignCreate; +end; + +class function TDALoaderUtils.UsedConnection(Obj: TDALoader): TCustomDAConnection; +begin + Result := Obj.UsedConnection; +end; + +end. diff --git a/internal/4.10.0.10/1/Source/DASQLMonitor.pas b/internal/4.10.0.10/1/Source/DASQLMonitor.pas new file mode 100644 index 0000000..8c7c076 --- /dev/null +++ b/internal/4.10.0.10/1/Source/DASQLMonitor.pas @@ -0,0 +1,1141 @@ + +////////////////////////////////////////////////// +// DB Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +// SQLMonitor supports +// Created: 17.11.99 +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I Dac.inc} + +unit DASQLMonitor; +{$ENDIF} +interface +uses +{$IFDEF LINUX} + Types, +{$ELSE} +{$ENDIF} + SysUtils, Classes, DB, MemData, DBAccess, DBMonitorClient, DBMonitorIntf; + +const + teStart = 1; + teCommit = 2; + teRollback = 3; + +type + TDATraceFlag = (tfQPrepare, tfQExecute, tfQFetch, tfError, tfStmt, tfConnect, + tfTransact, tfBlob, tfService, tfMisc, tfParams); + TDATraceFlags = set of TDATraceFlag; + + TMonitorOption = (moDialog, moSQLMonitor, moDBMonitor, moCustom, moHandled); + TMonitorOptions = set of TMonitorOption; + + TOnSQLEvent = procedure (Sender: TObject; Text: string; Flag: TDATraceFlag) of object; + +{ TCustomDASQLMonitor } + + TDASQLMonitorClass = class of TCustomDASQLMonitor; + + TCustomDASQLMonitor = class(TComponent) + private + FActive: boolean; + FTraceFlags: TDATraceFlags; + FOptions: TMonitorOptions; + FStreamedActive: boolean; + {$IFDEF WIN32} + FRegistered: boolean; + FSMClient: IUnknown; + NeedUninitialize :boolean; + {$ENDIF} + {$IFNDEF LINUX} + FDBMonitor: IDBMonitor; + {$ENDIF} + + procedure SetActive(Value: boolean); + procedure SetOptions(Value: TMonitorOptions); + + protected + FOnSQLEvent: TOnSQLEvent; + + { component routines } + procedure Loaded; override; + procedure CheckActive; + { Borland's SQL Monitor support } + procedure RegisterClient; virtual; + procedure UnRegisterClient; virtual; + procedure AddStatement(const St: string); + procedure SMClientSignal(Sender: TObject; Data: Integer); + + { DBMonitor support } + procedure OnConnect(const Username, Server, St: string; Component: TComponent; ATracePoint: TTracePoint; var AMessageID: Cardinal); + procedure OnDisconnect(const Username, Server, St: string; Component: TComponent; ATracePoint: TTracePoint; var AMessageID: Cardinal); + procedure OnTransact(const St: string; Component: TComponent; TransactEvent: integer; ATracePoint: TTracePoint; var AMessageID: Cardinal); + procedure OnPrepare(const SQL: string; var Params: TSQLParams; const St: string; Component: TComponent; ATracePoint: TTracePoint; var AMessageID: Cardinal); + procedure OnUnprepare(const SQL: string; var Params: TSQLParams; const St: string; Component: TComponent; ATracePoint: TTracePoint; var AMessageID: Cardinal); + procedure OnExecute(const SQL: string; var Params: TSQLParams; const St: string; Component: TComponent; ATracePoint: TTracePoint; var AMessageID: Cardinal); + procedure OnError(ErrorStr: string); + procedure OnCustomMessage(const St: string; Component: TComponent; ATracePoint: TTracePoint; var AMessageID: Cardinal); + procedure PrepareExecuteMessage(const SQL: string; var Params: TSQLParams; const St: string; + Component: TComponent; ATracePoint: TTracePoint; EventType: TEventType; var AMessageID: Cardinal); + + function GetCompHandle(Comp: TComponent): string; + function GetParent(Component: TComponent; Index: integer): TComponent; virtual; + function GetParentCount(Component: TComponent): integer; virtual; + + procedure InternalSQLPrepare(Component: TComponent; const SQL: string; Params: TDAParams; ATracePoint: TTracePoint; var MessageID: Cardinal); + procedure InternalSQLUnprepare(Component: TComponent; const SQL: string; Params: TDAParams; ATracePoint: TTracePoint; var MessageID: Cardinal); + procedure InternalSQLExecute(Component: TComponent; const SQL: string; Params: TDAParams; const Caption: string; ATracePoint: TTracePoint; var MessageID: Cardinal); virtual; + procedure InternalDBConnect(Connection: TCustomDAConnection; ATracePoint: TTracePoint; var MessageID: Cardinal); + procedure InternalDBDisconnect(Connection: TCustomDAConnection; ATracePoint: TTracePoint; var MessageID: Cardinal); + procedure InternalTRStart(Connection: TCustomDAConnection; ATracePoint: TTracePoint; var MessageID: Cardinal); virtual; + procedure InternalTRCommit(Connection: TCustomDAConnection; ATracePoint: TTracePoint; var MessageID: Cardinal); virtual; + procedure InternalTRRollback(Connection: TCustomDAConnection; ATracePoint: TTracePoint; var MessageID: Cardinal); virtual; + procedure InternalDBError(Exception: EDAError); + procedure InternalCustomMessage(Connection: TCustomDAConnection; const Msg: string; var AMessageID: Cardinal); + + class function GetMonitor: TCustomDASQLMonitor; virtual; + + public + class procedure SQLPrepare(Component: TComponent; const SQL: string; Params: TDAParams; var MessageID: Cardinal; BeforeEvent: boolean); + class procedure SQLUnprepare(Component: TComponent; const SQL: string; Params: TDAParams; var MessageID: Cardinal; BeforeEvent: boolean); + class procedure SQLExecute(Component: TComponent; const SQL: string; Params: TDAParams; const Caption: string; var MessageID: Cardinal; BeforeEvent: boolean); + class procedure DBConnect(Connection: TCustomDAConnection; var MessageID: Cardinal; BeforeEvent: boolean); + class procedure DBDisconnect(Connection: TCustomDAConnection; var MessageID: Cardinal; BeforeEvent: boolean); + class procedure TRStart(Connection: TCustomDAConnection; var MessageID: Cardinal; BeforeEvent: boolean); virtual; + class procedure TRCommit(Connection: TCustomDAConnection; var MessageID: Cardinal; BeforeEvent: boolean); virtual; + class procedure TRRollback(Connection: TCustomDAConnection; var MessageID: Cardinal; BeforeEvent: boolean); virtual; + class procedure DBError(Exception: EDAError); + class procedure CustomMessage(Connection: TCustomDAConnection; const Msg: string; var MessageID: Cardinal); + class function HasMonitor: boolean; + + class function GetParamDataType(Param: TDAParam): string; virtual; + class function GetParamParamType(Param: TDAParam): string; virtual; + class function GetParamValue(Param: TDAParam): string; virtual; + class function GetParam(Param: TDAParam; var SQLParam: TSQLParam): string; + class function GetParams(Params: TDAParams; var SQLParams: TSQLParams): string; overload; + class function GetParams(Params: TDAParams): string; overload; + class function GetCaption: string; virtual; + class procedure ShowDebug(Component: TComponent; const SQL: string; Params: TDAParams; const Caption: string); + + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + property Active: boolean read FActive write SetActive default True; + property TraceFlags: TDATraceFlags read FTraceFlags write FTraceFlags default [tfQPrepare, tfQExecute, tfError, tfConnect, tfTransact, tfParams, tfMisc]; + property Options: TMonitorOptions read FOptions write SetOptions default [moDialog, moSQLMonitor, moDBMonitor, moCustom]; + + property OnSQL: TOnSQLEvent read FOnSQLEvent write FOnSQLEvent; + end; + +var + ShowDebugFormProc: procedure (DASQLMonitorClass: TDASQLMonitorClass; + Component: TComponent; SQL: string; Params: TDAParams; Caption: string); + + function GetComponentID(Component: TComponent): cardinal; + function GetComponentName(Component: TComponent): string; + +implementation + +uses + MemUtils +{$IFNDEF WIN32} + ; +{$ELSE} + , ActiveX; + +const + Class_SMClient: TGUID = '{CB9879E2-4395-11D0-9FFC-00A0248E4B9A}'; + +type + ISMClient = interface(IUnknown) + ['{CB9879E1-4395-11D0-9FFC-00A0248E4B9A}'] + function RegisterClient(ID: Integer; Name: PChar; + Instance, SignalProc: Pointer): WordBool; stdcall; + function AddStatement(Statement: PChar; Len: Integer): WordBool; stdcall; + end; +{$ENDIF} + + +function GetComponentID(Component: TComponent): cardinal; +begin +{$IFDEF CLR} + if Component = nil then + Result := 0 + else +{$ENDIF} + Result := Cardinal(Component{$IFDEF CLR}.GetHashCode{$ENDIF}); + + if Result <> 0 then + if (Component is TCustomDADataSet) then + Result := Result xor Reverse4(GetComponentID(TCustomDADataSet(Component).Connection)) + else + if (Component is TCustomDASQL) then + Result := Result xor Reverse4(GetComponentID(TCustomDASQL(Component).Connection)); +end; + +function GetComponentName(Component: TComponent): string; +begin + if Component.Name <> '' then + Result := Component.Name + else + Result := Component.ClassName + ' ($' + IntToHex(GetComponentID(Component), 8) + ')'; +end; + +{ TCustomDASQLMonitor } + +const + fmtConnectInfo = 'Username=%s'#13#10'Server=%s'; + +constructor TCustomDASQLMonitor.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + + FActive := False; + FOptions := [moDialog, moSQLMonitor, moDBMonitor, moCustom]; + FTraceFlags := [tfQPrepare, tfQExecute, tfError, tfConnect, tfTransact, tfParams, tfMisc]; + FStreamedActive := True; + if (csDesigning in ComponentState) or (AOwner = nil) or not (csReading in AOwner.ComponentState) then + Active := True +end; + +destructor TCustomDASQLMonitor.Destroy; +begin + Active := False; + {$IFDEF WIN32} + if NeedUninitialize then + CoUninitialize; + {$ENDIF} + + inherited; +end; + +class procedure TCustomDASQLMonitor.SQLPrepare(Component: TComponent; + const SQL: string; Params: TDAParams; var MessageID: Cardinal; + BeforeEvent: boolean); +var + Monitor: TCustomDASQLMonitor; +begin + Monitor := GetMonitor; + if Assigned(Monitor) then + if BeforeEvent then + Monitor.InternalSQLPrepare(Component, TrimRight(SQL), Params, tpBeforeEvent, MessageID) + else + Monitor.InternalSQLPrepare(Component, TrimRight(SQL), Params, tpAfterEvent, MessageID) + else + if BeforeEvent then + ShowDebug(Component, TrimRight(SQL), Params, 'Prepare'); +end; + +class procedure TCustomDASQLMonitor.SQLUnprepare(Component: TComponent; + const SQL: string; Params: TDAParams; var MessageID: Cardinal; + BeforeEvent: boolean); +var + Monitor: TCustomDASQLMonitor; +begin + Monitor := GetMonitor; + if Assigned(Monitor) then + if BeforeEvent then + Monitor.InternalSQLUnprepare(Component, TrimRight(SQL), Params, tpBeforeEvent, MessageID) + else + Monitor.InternalSQLUnprepare(Component, TrimRight(SQL), Params, tpAfterEvent, MessageID) + else + if BeforeEvent then + ShowDebug(Component, TrimRight(SQL), Params, 'Unprepare'); +end; + +class procedure TCustomDASQLMonitor.SQLExecute(Component: TComponent; + const SQL: string; Params: TDAParams; const Caption: string; + var MessageID: Cardinal; BeforeEvent: boolean); +var + Monitor: TCustomDASQLMonitor; + ACaption: string; +begin + Monitor := GetMonitor; + if Assigned(Monitor) then + if BeforeEvent then + Monitor.InternalSQLExecute(Component, SQL, Params, Caption, tpBeforeEvent, MessageID) + else + Monitor.InternalSQLExecute(Component, SQL, Params, Caption, tpAfterEvent, MessageID) + else + begin + if Caption = '' then + ACaption := 'Execute' + else + ACaption := Caption; + + if BeforeEvent then + ShowDebug(Component, SQL, Params, ACaption); + end; +end; + +class procedure TCustomDASQLMonitor.DBConnect(Connection: TCustomDAConnection; + var MessageID: Cardinal; BeforeEvent: boolean); +var + Monitor: TCustomDASQLMonitor; +begin + Monitor := GetMonitor; + if Assigned(Monitor) then + if BeforeEvent then + Monitor.InternalDBConnect(Connection, tpBeforeEvent, MessageID) + else + Monitor.InternalDBConnect(Connection, tpAfterEvent, MessageID) +end; + +class procedure TCustomDASQLMonitor.DBDisconnect(Connection: TCustomDAConnection; + var MessageID: Cardinal; BeforeEvent: boolean); +var + Monitor: TCustomDASQLMonitor; +begin + Monitor := GetMonitor; + if Assigned(Monitor) then + if BeforeEvent then + Monitor.InternalDBDisconnect(Connection, tpBeforeEvent, MessageId) + else + Monitor.InternalDBDisconnect(Connection, tpAfterEvent, MessageId); +end; + +class procedure TCustomDASQLMonitor.TRStart(Connection: TCustomDAConnection; + var MessageID: Cardinal; BeforeEvent: boolean); +var + Monitor: TCustomDASQLMonitor; +begin + Monitor := GetMonitor; + if Assigned(Monitor) then + if BeforeEvent then + Monitor.InternalTRStart(Connection, tpBeforeEvent, MessageID) + else + Monitor.InternalTRStart(Connection, tpAfterEvent, MessageID); +end; + +class procedure TCustomDASQLMonitor.TRCommit(Connection: TCustomDAConnection; + var MessageID: Cardinal; BeforeEvent: boolean); +var + Monitor: TCustomDASQLMonitor; +begin + Monitor := GetMonitor; + if Assigned(Monitor) then + if BeforeEvent then + Monitor.InternalTRCommit(Connection, tpBeforeEvent, MessageID) + else + Monitor.InternalTRCommit(Connection, tpAfterEvent, MessageID); +end; + +class procedure TCustomDASQLMonitor.TRRollback(Connection: TCustomDAConnection; + var MessageID: Cardinal; BeforeEvent: boolean); +var + Monitor: TCustomDASQLMonitor; +begin + Monitor := GetMonitor; + if Assigned(Monitor) then + if BeforeEvent then + Monitor.InternalTRRollback(Connection, tpBeforeEvent, MessageID) + else + Monitor.InternalTRRollback(Connection, tpAfterEvent, MessageID); +end; + +class procedure TCustomDASQLMonitor.DBError(Exception: EDAError); +var + Monitor: TCustomDASQLMonitor; +begin + Monitor := GetMonitor; + if Assigned(Monitor) then + Monitor.InternalDBError(Exception); +end; + +class procedure TCustomDASQLMonitor.CustomMessage(Connection: TCustomDAConnection; + const Msg: string; var MessageID: Cardinal); +var + Monitor: TCustomDASQLMonitor; +begin + Monitor := GetMonitor; + if Assigned(Monitor) then + Monitor.InternalCustomMessage(Connection, Msg, MessageID); +end; + +class function TCustomDASQLMonitor.GetParamDataType(Param: TDAParam): string; +begin + Result := FieldTypeNames[Param.DataType]; + if Param.DataType in [ftString,ftFixedChar,ftWideString] then + Result := Result + '[' + IntToStr(Length(Param.AsString)) + ']'; +end; + +class function TCustomDASQLMonitor.GetParamParamType(Param: TDAParam): string; +begin + case Param.ParamType of + ptInput: + Result := 'IN'; + ptOutput: + Result := 'OUT'; + ptInputOutput: + Result := 'IN/OUT'; + ptResult: + Result := 'RESULT'; + else + Result := ''; + end; +end; + +class function TCustomDASQLMonitor.GetParamValue(Param: TDAParam): string; +begin + Result := ''; + if Param.IsNull then + Result := '' + else + case Param.DataType of + ftDate: + Result := DateToStr(Param.AsDate); + ftDateTime: + Result := Param.AsString; + ftBlob, ftMemo{$IFDEF VER10P}, ftWideMemo{$ENDIF}: begin + Result := ''; + end; + ftCursor: + Result := ''; + ftString, ftFixedChar, ftWideString: + Result := '''' + Param.AsString + ''''; + ftBytes, ftVarBytes: + Result := '' + else + Result := Param.AsString; + end; +end; + +function ConcatWith(const Args: array of string; const AConcatWith: string): string; +var + i: integer; +begin + Result := ''; + for i := 0 to Length(Args)-1 do begin + if Args[i] <> '' then + if Result <> '' then + Result := Result + AConcatWith + Args[i] + else + Result := Args[i]; + end; +end; + +class function TCustomDASQLMonitor.GetParam(Param: TDAParam; var SQLParam: TSQLParam): string; +begin + SQLParam.Name := Param.Name; + SQLParam.DataType := GetParamDataType(Param); + SQLParam.ParamType := GetParamParamType(Param); + SQLParam.Value := GetParamValue(Param); + Result := ':' + Param.Name + '(' + ConcatWith([SQLParam.DataType, + SQLParam.ParamType],',') + ConcatWith([')', SQLParam.Value], '='); +end; + +class function TCustomDASQLMonitor.GetParams(Params: TDAParams; var SQLParams: TSQLParams): string; +var + i: integer; +begin + Result := ''; + if Params <> nil then begin + SetLength(SQLParams, Params.Count); + for i := 0 to Params.Count - 1 do + Result := Result + GetParam(Params[i], SQLParams[i]) + ' '#13#10; + end; +end; + +class function TCustomDASQLMonitor.GetParams(Params: TDAParams): string; +var + SQLParams: TSQLParams; +begin + Result := GetParams(Params, SQLParams); +end; + +class procedure TCustomDASQLMonitor.ShowDebug(Component: TComponent; + const SQL: string; Params: TDAParams; const Caption: string); +begin + if Assigned(ShowDebugFormProc) then + ShowDebugFormProc(Self, Component, SQL, Params, Caption); +end; + +class function TCustomDASQLMonitor.GetMonitor: TCustomDASQLMonitor; +begin + Result := nil; +end; + +class function TCustomDASQLMonitor.GetCaption: string; +begin + Result := 'DataAccess'; +end; + +function TCustomDASQLMonitor.GetCompHandle(Comp: TComponent): string; +var + Conn: TCustomDAConnection; +begin + if moHandled in Options then begin + Result := ' [' + Comp.Name + '$' + IntToHex(GetComponentID(Comp), 8); + + if Comp is TCustomDADataSet then + Conn := TCustomDADataSet(Comp).Connection + else + if Comp is TCustomDASQL then + Conn := TCustomDASQL(Comp).Connection + else + Conn := nil; + + if Conn <> nil then + Result := Result + '; ' + Conn.Name + '$' + IntToHex(GetComponentID(Conn), 8); + + Result := Result + '] '; + end + else + Result := ''; +end; + +function TCustomDASQLMonitor.GetParent(Component: TComponent; Index: integer): TComponent; +begin + if (Component is TCustomDASQL) then + Result := TCustomDASQL(Component).Connection + else + if (Component is TCustomDADataSet) then + Result := TCustomDADataSet(Component).Connection + else + Result := nil; +end; + +function TCustomDASQLMonitor.GetParentCount(Component: TComponent): integer; +begin + Result := 1; +end; + +procedure TCustomDASQLMonitor.InternalSQLPrepare(Component: TComponent; const SQL: string; Params: TDAParams; ATracePoint: TTracePoint; var MessageID: Cardinal); +var + ParamSt: string; + SQLParams: TSQLParams; + ASQL: string; +begin + CheckActive; + + if Active and (tfQPrepare in TraceFlags) then begin + if ((moDialog in Options) and (not((moCustom in Options) or (csDesigning in ComponentState)) or + ((Component is TCustomDADataSet) and TCustomDADataSet(Component).Debug or + (Component is TCustomDASQL) and TCustomDASQL(Component).Debug))) and + (ATracePoint = tpBeforeEvent) + then + ShowDebug(Component, SQL, Params, 'Prepare'); + + ParamSt := TrimRight(GetParams(Params, SQLParams)); + + if (moSQLMonitor in Options) and (ATracePoint <> tpAfterEvent) then begin + AddStatement('SQL Prepare' + GetCompHandle(Component) + ': ' + SQL); + if (ParamSt <> '') and (tfParams in TraceFlags) then + AddStatement(ParamSt); + end; + + OnPrepare(SQL, SQLParams, 'SQL Prepare' + GetCompHandle(Component) + ': ' + SQL + #13#10 + ParamSt, Component, ATracePoint, MessageID); + + if Assigned(FOnSQLEvent) and (ATracePoint <> tpAfterEvent) then begin + if ParamSt <> '' then + ASQL := SQL + #13#10 + ParamSt + else + ASQL := SQL; + FOnSQLEvent(Component, 'Prepare: ' + ASQL, tfQPrepare); + end; + end; +end; + +procedure TCustomDASQLMonitor.InternalSQLUnprepare(Component: TComponent; const SQL: string; Params: TDAParams; ATracePoint: TTracePoint; var MessageID: Cardinal); +var + ParamSt: string; + SQLParams: TSQLParams; + ASQL: string; +begin + CheckActive; + + if Active and (tfQPrepare in TraceFlags) then begin + if ((moDialog in Options) and (not ((moCustom in Options) or (csDesigning in ComponentState)) or + ((Component is TCustomDADataSet) and TCustomDADataSet(Component).Debug or + (Component is TCustomDASQL) and TCustomDASQL(Component).Debug))) and + (ATracePoint = tpBeforeEvent) + then + ShowDebug(Component, SQL, Params, 'Unprepare'); + + ParamSt := TrimRight(GetParams(Params, SQLParams)); + + if (moSQLMonitor in Options) then begin + AddStatement('SQL Unprepare' + GetCompHandle(Component) + ': ' + SQL); + if (ParamSt <> '') and (tfParams in TraceFlags) then + AddStatement(ParamSt); + end; + + OnUnprepare(SQL, SQLParams, 'SQL Unprepare' + GetCompHandle(Component) + ': ' + SQL + #13#10 + ParamSt, Component, ATracePoint, MessageID); + + if Assigned(FOnSQLEvent) and (ATracePoint <> tpAfterEvent) then begin + if ParamSt <> '' then + ASQL := SQL + #13#10 + ParamSt + else + ASQL := SQL; + FOnSQLEvent(Component, 'Unprepare: ' + ASQL, tfQPrepare); + end; + end; +end; + +procedure TCustomDASQLMonitor.InternalSQLExecute(Component:TComponent; const SQL: string; Params: TDAParams; const Caption: string; ATracePoint: TTracePoint; var MessageID: Cardinal); +var + ParamSt: string; + St: string; + SQLParams: TSQLParams; + ASQL: string; +begin + CheckActive; + + if Active and (tfQExecute in TraceFlags) then begin + if (moDialog in Options) and (not ((moCustom in Options) or (csDesigning in ComponentState)) or + ((Component is TCustomDADataSet) and TCustomDADataSet(Component).Debug or + (Component is TCustomDASQL) and TCustomDASQL(Component).Debug)) and + (ATracePoint = tpBeforeEvent) + then begin + if Caption = '' then + St := 'Execute' + else + St := Caption; + + ShowDebug(Component, SQL, Params, St); + end; + + ParamSt := TrimRight(GetParams(Params, SQLParams)); + + if (moSQLMonitor in Options) and (ATracePoint <> tpAfterEvent) then begin + St := 'SQL Execute'; + if Caption <> '' then + St := St + ' [' + Caption + ']'; + + AddStatement(St + GetCompHandle(Component) + ': '{#13#10} + SQL); + if (ParamSt <> '') and (tfParams in TraceFlags) then + AddStatement(ParamSt); + end; + + OnExecute(SQL, SQLParams, 'SQL Execute' + GetCompHandle(Component) + ': ' + SQL + #13#10 + ParamSt, Component, ATracePoint, MessageID); + + if Assigned(FOnSQLEvent) and (ATracePoint <> tpAfterEvent) then begin + if ParamSt <> '' then + ASQL := SQL + #13#10 + ParamSt + else + ASQL := SQL; + FOnSQLEvent(Component, ASQL, tfQExecute); + end; + end; +end; + +procedure TCustomDASQLMonitor.InternalDBConnect(Connection: TCustomDAConnection; ATracePoint: TTracePoint; var MessageID: Cardinal); +var + St: string; +begin + CheckActive; + + if Active and (tfConnect in TraceFlags) then begin + St := 'Connect: ' + Connection.Username + '@' + Connection.Server + GetCompHandle(Connection); + + if (moSQLMonitor in Options) and (ATracePoint <> tpAfterEvent) then + AddStatement(St); + + OnConnect(Connection.Username, Connection.Server, St, Connection, ATracePoint, MessageID); + + if Assigned(FOnSQLEvent) and (ATracePoint <> tpAfterEvent) then + FOnSQLEvent(Connection, St, tfConnect); + end; +end; + +procedure TCustomDASQLMonitor.InternalDBDisconnect(Connection: TCustomDAConnection; ATracePoint: TTracePoint; var MessageID: Cardinal); +var + St: string; +begin + CheckActive; + + if Active and (tfConnect in TraceFlags) then begin + St := 'Disconnect: ' + Connection.Username + '@' + Connection.Server + GetCompHandle(Connection); + + if (moSQLMonitor in Options) and (ATracePoint <> tpAfterEvent) then + AddStatement(St); + + OnDisconnect(Connection.Username, Connection.Server, St, Connection, ATracePoint, MessageID); + + if Assigned(FOnSQLEvent) and (ATracePoint <> tpAfterEvent) then + FOnSQLEvent(Connection, St, tfConnect); + end; +end; + +procedure TCustomDASQLMonitor.InternalTRStart(Connection: TCustomDAConnection; ATracePoint: TTracePoint; var MessageID: Cardinal); +var + St: string; +begin + CheckActive; + + if Active and (tfTransact in TraceFlags) then begin + St := 'Start: ' + Connection.Username + '@' + Connection.Server + GetCompHandle(Connection); + + if (moSQLMonitor in Options) and (ATracePoint <> tpAfterEvent) then + AddStatement(St); + + OnTransact(St, Connection, teStart, ATracePoint, MessageID); + + if Assigned(FOnSQLEvent) and (ATracePoint <> tpAfterEvent) then + FOnSQLEvent(Connection, St, tfTransact); + end; +end; + +procedure TCustomDASQLMonitor.InternalTRCommit(Connection: TCustomDAConnection; ATracePoint: TTracePoint; var MessageID: Cardinal); +var + St: string; +begin + CheckActive; + + if Active and (tfTransact in TraceFlags) then begin + St := 'Commit: ' + Connection.Username + '@' + Connection.Server + GetCompHandle(Connection); + + if (moSQLMonitor in Options) and (ATracePoint <> tpAfterEvent) then + AddStatement(St); + + OnTransact(St, Connection, teCommit, ATracePoint, MessageID); + + if Assigned(FOnSQLEvent) and (ATracePoint <> tpAfterEvent) then + FOnSQLEvent(Connection, St, tfTransact); + end; +end; + +procedure TCustomDASQLMonitor.InternalTRRollback(Connection: TCustomDAConnection; ATracePoint: TTracePoint; var MessageID: Cardinal); +var + St: string; +begin + CheckActive; + + if Active and (tfTransact in TraceFlags) then begin + St := 'Rollback: ' + Connection.Username + '@' + Connection.Server + GetCompHandle(Connection); + + if (moSQLMonitor in Options) and (ATracePoint <> tpAfterEvent) then + AddStatement(St); + + OnTransact(St, Connection, teRollback, ATracePoint, MessageID); + + if Assigned(FOnSQLEvent) and (ATracePoint <> tpAfterEvent) then + FOnSQLEvent(Connection, St, tfTransact); + end; +end; + +procedure TCustomDASQLMonitor.InternalDBError(Exception: EDAError); +var + St: string; +begin + CheckActive; + + if Active and (tfError in TraceFlags) then begin + St := 'Error: ' + Exception.Message; + + if (moSQLMonitor in Options) then + AddStatement(St); + + OnError(Exception.Message); + + if Assigned(FOnSQLEvent) then + FOnSQLEvent(Exception, St, tfError); + end; +end; + +procedure TCustomDASQLMonitor.InternalCustomMessage(Connection: TCustomDAConnection; + const Msg: string; var AMessageID: Cardinal); +begin + CheckActive; + + if Active and (tfMisc in TraceFlags) then begin + if (moSQLMonitor in Options) then + AddStatement(Msg); + + OnCustomMessage(Msg, Connection, tpBeforeEvent, AMessageID); + OnCustomMessage(Msg, Connection, tpAfterEvent, AMessageID); + + if Assigned(FOnSQLEvent) then + FOnSQLEvent(Connection, Msg, tfMisc); + end; +end; + +{ Borland's SQL Monitor support } + +procedure TCustomDASQLMonitor.RegisterClient; +{$IFDEF WIN32} +var + Title: string; +{$ENDIF} +begin +{$IFDEF WIN32} + if not FRegistered and (GetMonitor = Self) then + if Succeeded(CoInitialize(nil)) then begin + if not Succeeded(CoCreateInstance(Class_SMClient, nil, CLSCTX_INPROC_SERVER or + CLSCTX_LOCAL_SERVER, IUnknown, FSMClient)) + then begin + CoUninitialize; + Exit; + end; + + Title := ApplicationTitle; + if csDesigning in ComponentState then + Title := Title + ': ' + GetCaption; + try + (FSMClient as ISMClient).RegisterClient(Integer(Self), PChar(Title), Self, + @TCustomDASQLMonitor.SMClientSignal); + FRegistered := True; + except + end; + end; +{$ENDIF} +end; + +procedure TCustomDASQLMonitor.UnRegisterClient; +begin +{$IFDEF WIN32} + FSMClient := nil; + if FRegistered then begin + FRegistered := False; + CoUninitialize; + end; +{$ENDIF} +end; + +procedure TCustomDASQLMonitor.AddStatement(const St: string); +begin +{$IFDEF WIN32} + if Assigned(FSMClient) then + (FSMClient as ISMClient).AddStatement(PChar(St), Length(St)); +{$ENDIF} +end; + +{ 0 none + 1 Prepare + 2 Execute + 4 Error + 8 Statement + 16 Connect/Disconnect + 32 Transaction + 64 Blob + 128 Misc + 256 Vendor call + 512 Input params + 1024 Fetch} + +procedure TCustomDASQLMonitor.SMClientSignal(Sender: TObject; Data: Integer); +begin + FTraceFlags := TDATraceFlags(Word(Data)); +end; + +procedure TCustomDASQLMonitor.SetActive(Value: boolean); +begin + FStreamedActive := Value; + if not (csReading in ComponentState) and (Value <> FActive) then begin + FActive := Value; + + if moSQLMonitor in Options then + if FActive then + RegisterClient + else + UnRegisterClient; + {$IFDEF MSWINDOWS} + if moDBMonitor in Options then + if FActive then begin + {$IFDEF CLR} + FDBMonitor := GetDBMonitor; + if FDBMonitor <> nil then + FDBMonitor.SetCaption(GetCaption); + {$ELSE} + if not NeedUninitialize then + NeedUninitialize := Succeeded(CoInitialize(nil)); + FDBMonitor := GetDBMonitor; + if FDBMonitor <> nil then + FDBMonitor.SetCaption(PChar(GetCaption)); + {$ENDIF} + end + else begin + FDBMonitor := nil; + end; + {$ENDIF} + end; +end; + +procedure TCustomDASQLMonitor.SetOptions(Value: TMonitorOptions); +begin + FOptions := Value; + if FActive then begin + if moSQLMonitor in FOptions then + RegisterClient + else + UnRegisterClient; + +{$IFDEF WIN32} + if moDBMonitor in FOptions then begin + if not NeedUninitialize then + NeedUninitialize := Succeeded(CoInitialize(nil)); + FDBMonitor := GetDBMonitor; + if FDBMonitor <> nil then + FDBMonitor.SetCaption(PChar(GetCaption)); + end + else begin + FDBMonitor := nil; + end; +{$ENDIF} + end; +end; + +procedure TCustomDASQLMonitor.OnConnect(const Username, Server, St: string; + Component: TComponent; ATracePoint: TTracePoint; var AMessageID: Cardinal); +{$IFDEF MSWINDOWS} +var + Msg: TMonitorMessage; + ParamStr: string; +{$ENDIF} +begin +{$IFDEF MSWINDOWS} + if FDBMonitor <> nil then begin + with Msg do begin + MessageID := AMessageID; + EventType := Integer(etConnect); + TracePoint := Integer(ATracePoint); + ObjectID := GetComponentID(Component); + OwnerID := 0; + OwnerName := ''; + ParamStr := Format(fmtConnectInfo, [Username, Server]); + {$IFDEF CLR} + ObjectName := GetComponentName(Component); + Description := St; + FDBMonitor.OnEvent(Msg, ParamStr); + {$ELSE} + ObjectName := PChar(GetComponentName(Component)); + Description := PChar(St); + FDBMonitor.OnEvent(Msg, PChar(ParamStr)); + {$ENDIF} + end; + if ATracePoint = tpBeforeEvent then + AMessageID := Msg.MessageID; + end; +{$ENDIF} +end; + +procedure TCustomDASQLMonitor.OnDisconnect(const Username, Server, + St: string; Component: TComponent; ATracePoint: TTracePoint; var AMessageID: Cardinal); +{$IFDEF MSWINDOWS} +var + Msg: TMonitorMessage; +{$ENDIF} +begin +{$IFDEF MSWINDOWS} + if FDBMonitor <> nil then begin + with Msg do begin + MessageID := AMessageID; + EventType := Integer(etDisconnect); + TracePoint := Integer(ATracePoint); + ObjectID := GetComponentID(Component); + OwnerID := 0; + OwnerName := ''; + {$IFDEF CLR} + ObjectName := GetComponentName(Component); + Description := St; + FDBMonitor.OnEvent(Msg, ''); + {$ELSE} + ObjectName := PChar(GetComponentName(Component)); + Description := PChar(St); + FDBMonitor.OnEvent(Msg, nil); + {$ENDIF} + end; + if ATracePoint = tpBeforeEvent then + AMessageID := Msg.MessageID; + end; +{$ENDIF} +end; + +procedure TCustomDASQLMonitor.OnError(ErrorStr: string); +{$IFDEF MSWINDOWS} +var + Msg: TMonitorMessage; +{$ENDIF} +begin +{$IFDEF MSWINDOWS} + if FDBMonitor <> nil then begin + with Msg do begin + TracePoint := Integer(tpAfterEvent); + EventType := Integer(etError); + Description := ''; + end; + {$IFDEF CLR} + FDBMonitor.OnEvent(Msg, ErrorStr); + {$ELSE} + FDBMonitor.OnEvent(Msg, PChar(ErrorStr)); + {$ENDIF} + end; +{$ENDIF} +end; + +procedure TCustomDASQLMonitor.OnCustomMessage(const St: string; Component: TComponent; + ATracePoint: TTracePoint; var AMessageID: Cardinal); +{$IFDEF MSWINDOWS} +var + Msg: TMonitorMessage; +{$ENDIF} +begin +{$IFDEF MSWINDOWS} + if FDBMonitor <> nil then begin + with Msg do begin + MessageID := AMessageID; + EventType := Integer(etConnect); + TracePoint := Integer(ATracePoint); + ObjectID := GetComponentID(Component); + OwnerID := 0; + OwnerName := ''; + {$IFDEF CLR} + ObjectName := GetComponentName(Component); + Description := St; + FDBMonitor.OnEvent(Msg, ''); + {$ELSE} + ObjectName := PChar(GetComponentName(Component)); + Description := PChar(St); + FDBMonitor.OnEvent(Msg, nil); + {$ENDIF} + end; + if ATracePoint = tpBeforeEvent then + AMessageID := Msg.MessageID; + end; +{$ENDIF} +end; + +procedure TCustomDASQLMonitor.PrepareExecuteMessage(const SQL: string; var Params: TSQLParams; const St: string; + Component: TComponent; ATracePoint: TTracePoint; EventType: TEventType; var AMessageID: Cardinal); +{$IFDEF MSWINDOWS} +var + RowsAffected: integer; + Connection: TComponent; + Msg: TMonitorMessage; +{$IFNDEF CLR} + PParam: PSQLParam; +{$ENDIF} +{$ENDIF} +begin +{$IFDEF MSWINDOWS} + if FDBMonitor <> nil then begin + RowsAffected := 0; + if (Component is TCustomDASQL) then + RowsAffected := TCustomDASQL(Component).RowsAffected + else + if (Component is TCustomDADataSet) then + RowsAffected := TCustomDADataSet(Component).RowsAffected; + Connection := GetParent(Component, 0); + with Msg do begin + MessageID := AMessageID; + EventType := Integer(etExecute); + TracePoint := Integer(ATracePoint); + ObjectID := GetComponentID(Component); + OwnerID := GetComponentID(Connection); + {$IFDEF CLR} + ObjectName := GetComponentName(Component); + if Connection <> nil then + OwnerName := GetComponentName(Connection) + else + OwnerName := ''; + Description := St; + FDBMonitor.OnExecute(Msg, SQL, Params, Length(Params), RowsAffected); + {$ELSE} + ObjectName := PChar(GetComponentName(Component)); + if Connection <> nil then + OwnerName := PChar(GetComponentName(Connection)) + else + OwnerName := ''; + Description := PChar(St); + PParam := nil; + if Length(Params) > 0 then + PParam := @Params[0]; + FDBMonitor.OnExecute(Msg, PChar(SQL), PParam, Length(Params), RowsAffected); + {$ENDIF} + end; + if ATracePoint = tpBeforeEvent then + AMessageID := Msg.MessageID; + end; +{$ENDIF} +end; + +procedure TCustomDASQLMonitor.OnExecute(const SQL: string; var Params: TSQLParams; + const St: string; Component: TComponent; ATracePoint: TTracePoint; var AMessageID: Cardinal); +begin + PrepareExecuteMessage(SQL, Params, St, Component, ATracePoint, etExecute, AMessageID); +end; + +procedure TCustomDASQLMonitor.OnPrepare(const SQL: string; var Params: TSQLParams; + const St: string; Component: TComponent; ATracePoint: TTracePoint; var AMessageID: Cardinal); +begin + PrepareExecuteMessage(SQL, Params, St, Component, ATracePoint, etPrepare, AMessageID); +end; + +procedure TCustomDASQLMonitor.OnUnprepare(const SQL: string; var Params: TSQLParams; const St: string; Component: TComponent; ATracePoint: TTracePoint; var AMessageID: Cardinal); +begin + PrepareExecuteMessage(SQL, Params, St, Component, ATracePoint, etPrepare, AMessageID); +end; + +procedure TCustomDASQLMonitor.OnTransact(const St: string; + Component: TComponent; TransactEvent: integer; ATracePoint: TTracePoint; var AMessageID: Cardinal); +{$IFDEF MSWINDOWS} +var + Msg: TMonitorMessage; + i: integer; + Parent: TComponent; +{$ENDIF} +begin +{$IFDEF MSWINDOWS} + if FDBMonitor <> nil then begin + with Msg do begin + MessageID := AMessageID; + case TransactEvent of + teCommit: + EventType := Integer(etCommit); + teRollback: + EventType := Integer(etRollback); + else + EventType := Integer(etMisc); + end; + TracePoint := Integer(ATracePoint); + ObjectID := GetComponentID(Component); + {$IFDEF CLR} + ObjectName := GetComponentName(Component); + Description := St; + {$ELSE} + ObjectName := PChar(GetComponentName(Component)); + Description := PChar(St); + {$ENDIF} + for i := 0 to GetParentCount(Component) - 1 do begin + Parent := GetParent(Component, i); + OwnerID := GetComponentID(Parent); + if Parent <> nil then + OwnerName := {$IFNDEF CLR}PChar{$ENDIF}(GetComponentName(Parent)) + else + OwnerName := ''; + {$IFDEF CLR} + FDBMonitor.OnEvent(Msg, ''); + {$ELSE} + FDBMonitor.OnEvent(Msg, nil) + {$ENDIF} + end; + end; + if ATracePoint = tpBeforeEvent then + AMessageID := Msg.MessageID; + end; +{$ENDIF} +end; + +class function TCustomDASQLMonitor.HasMonitor: boolean; +begin + Result := GetMonitor <> nil; +end; + +procedure TCustomDASQLMonitor.Loaded; +begin + inherited Loaded; + CheckActive; +end; + +procedure TCustomDASQLMonitor.CheckActive; +begin + Active := FStreamedActive; +end; + +initialization + ShowDebugFormProc := nil; +end. diff --git a/internal/4.10.0.10/1/Source/DAScript.pas b/internal/4.10.0.10/1/Source/DAScript.pas new file mode 100644 index 0000000..8121d2f --- /dev/null +++ b/internal/4.10.0.10/1/Source/DAScript.pas @@ -0,0 +1,961 @@ +////////////////////////////////////////////////// +// DB Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +// DB Access +////////////////////////////////////////////////// +{$IFNDEF CLR} + +{$I Dac.inc} + +unit DAScript; +{$ENDIF} + +interface + +uses + Classes, SysUtils, +{$IFDEF CLR} + System.Text, +{$ELSE} + CLRClasses, +{$ENDIF} + DB, CRParser, DBAccess; + +const + ST_UNKNOWN = 0; + ST_DELIMETER = 1; + ST_COMMENT = 2; + ST_SPECIFIC_SQL = $8000; + +type + TDAScript = class; + + TDAStatement = class(TCollectionItem) + protected + FOmit: boolean; + FStatementType: integer; + FStartPos: integer; + FEndPos: integer; + FStartLine: integer; + FEndLine: integer; + FStartOffset: integer; + FEndOffset: integer; + FParams: TDAParams; + + function GetSQL: string; + function GetScript: TDAScript; + function GetParams: TDAParams; + function CreateParams: TDAParams; + public + destructor Destroy; override; + property Script: TDAScript read GetScript; + property SQL: string read GetSQL; + property Omit: boolean read FOmit write FOmit; + + property StartPos: integer read FStartPos; + property EndPos: integer read FEndPos; + property StartLine: integer read FStartLine; + property EndLine: integer read FEndLine; + property StartOffset: integer read FStartOffset; + property EndOffset: integer read FEndOffset; + + property Params: TDAParams read GetParams; + + procedure Excecute; + end; + + TDAStatementClass = class of TDAStatement; + + TDAStatements = class(TCollection) + protected + FScript: TDAScript; + function GetItem(Index: Integer): TDAStatement; + function CreateStatement(StatementType: integer; Omit: boolean; StartPos, + EndPos, StartLine, EndLine, StartOffset, EndOffset: integer): TDAStatement; + public + constructor Create(ItemClass: TCollectionItemClass; Script: TDAScript); + property Items[Index: Integer]: TDAStatement read GetItem; default; + end; + + TDAStatementsClass = class of TDAStatements; + + TBeforeStatementExecuteEvent = procedure (Sender: TObject; var SQL: string; var Omit: boolean) of object; + TAfterStatementExecuteEvent = procedure (Sender: TObject; SQL: string) of object; + TErrorAction = (eaAbort, eaFail, eaException, eaContinue); + TOnErrorEvent = procedure (Sender: TObject; E: Exception; SQL: string; var Action: TErrorAction) of object; + + TDelimiterState = (dsNone, dsDelimiter, dsBlank, dsValue, dsSet); + + TDAScript = class (TComponent) + protected + FSQL: TStrings; + FSQLActual: boolean; + FStream: TStream; + FCommand: TCustomDASQL; + FMacros: TMacros; + FErrorOffset: integer; + FStartPos: integer; + FEndPos: integer; + FStartLine: integer; + FEndLine: integer; + FStartOffset: integer; + FEndOffset: integer; + FDataSource: TDataSource; + FBeforeExecute: TBeforeStatementExecuteEvent; + FAfterExecute: TAfterStatementExecuteEvent; + FOnError: TOnErrorEvent; + FParser: TParser; + FSQLParser: TParser; + FStmtOffset: integer; + FDesignCreate: boolean; + FCurrDelimiter: string; + FDelimiter: string; + FDelimiterState: TDelimiterState; + FSt: string; + FStatements: TDAStatements; + FCurrentStatementIdx: integer; + FStatementsPopulating: boolean; + + FUseOptimization: boolean; + FAllowOptimization: boolean; + FBuffer: StringBuilder; + + function GetConnection: TCustomDAConnection; + procedure SetConnection(Value: TCustomDAConnection); + procedure ValidateConnection(Value: TCustomDAConnection); virtual; + function GetParserClass: TParserClass; virtual; + function UsedConnection: TCustomDAConnection; virtual; + function GetSQLText(StartLine, EndLine, StartOffset, EndOffset, Length: integer): string; + procedure SetSQL(Value: TStrings); + procedure SQLChanged(Sender: TObject); + function GetDebug: boolean; + procedure SetDebug(Value: boolean); + procedure SetMacros(Value: TMacros); + function GetDataSet: TCustomDADataSet; + procedure SetDataSet(Value: TCustomDADataSet); + function GetParams: TDAParams; + procedure SetDelimiter(const Value: string); + function IsDelimiterStored: boolean; + function IsBlankEndsDelimeter: boolean; virtual; + procedure Loaded; override; + procedure DefineProperties(Filer: TFiler); override; + procedure ReadMacroData(Reader: TReader); + procedure WriteMacroData(Writer: TWriter); + procedure CheckLexem(Code: integer; var StatementType: integer; var Omit: boolean); virtual; + function GetReady(Code: integer): boolean; virtual; + procedure AssignTo(Dest: TPersistent); override; + function CreateParser(const Text: string): TParser; overload; virtual; + function CreateParser(Stream: TStream): TParser; overload; virtual; + function GetSQLParser(const Text: string): TParser; virtual; + function CreateCommand: TCustomDASQL; virtual; + procedure DoBeforeStatementExecute(var SQL: string; StatementType: integer; var Omit: boolean); virtual; + procedure DoAfterStatementExecute(var SQL: string; StatementType: integer); virtual; + procedure ExecuteStatement(SQL: string; StatementType: integer; var Omit: Boolean; out BreakExec: boolean; Params: TDAParams = nil); virtual; + procedure CreateStatement(StatementType: integer; Omit: boolean; StartPos, EndPos, + StartLine, EndLine, StartOffset, EndOffset: integer); virtual; + procedure CalculateErrorOffset(E: Exception); virtual; + + function CreateStatementsObject: TDAStatements; virtual; + function GetStatements: TDAStatements; + procedure Open(Stream: TStream); + procedure Close; + + function IsSpecificSQL(StatementType: integer): boolean; virtual; + function CanOptimize(const SQL: string; const StatementType: integer): boolean; virtual; // Must return True if statement may be concatenated with previous + procedure InternalExecute(const SQL: string; out BreakExec: boolean; Params: TDAParams = nil); // Sends SQL to server + procedure Flush(out BreakExec: boolean); + + property Params: TDAParams read GetParams; + property UseOptimization: boolean read FUseOptimization write FUseOptimization default False; + public + constructor Create(Owner: TComponent); override; + destructor Destroy; override; + procedure Execute; virtual; + procedure ExecuteStream(Stream: TStream); + procedure ExecuteFile(const FileName: string); + function ExecuteNext: boolean; virtual; + procedure BreakExec; virtual; + function FindMacro(Name: string): TMacro; + function MacroByName(Name: string): TMacro; + function ErrorOffset: integer; + + property Connection: TCustomDAConnection read GetConnection write SetConnection; + property DataSet: TCustomDADataSet read GetDataSet write SetDataSet; + property StartPos: integer read FStartPos; + property EndPos: integer read FEndPos; + property StartLine: integer read FStartLine; + property EndLine: integer read FEndLine; + property StartOffset: integer read FStartOffset; + property EndOffset: integer read FEndOffset; + property Statements: TDAStatements read GetStatements; + published + property SQL: TStrings read FSQL write SetSQL; + property Debug: boolean read GetDebug write SetDebug default False; + property Delimiter: string read FDelimiter write FDelimiter stored IsDelimiterStored; + property Macros: TMacros read FMacros write SetMacros stored False; + property BeforeExecute: TBeforeStatementExecuteEvent read FBeforeExecute write FBeforeExecute; + property AfterExecute: TAfterStatementExecuteEvent read FAfterExecute write FAfterExecute; + property OnError: TOnErrorEvent read FOnError write FOnError; + end; + + TDAScriptUtils = class + public + class procedure SetDesignCreate(Obj: TDAScript; Value: boolean); + class function GetDesignCreate(Obj: TDAScript): boolean; + class procedure SetCommand(Obj: TDAScript; Command: TCustomDASQL); + class function GetCommand(Obj: TDAScript): TCustomDASQL; + class procedure Open(Obj: TDAScript; Stream: TStream); + class procedure Close(Obj: TDAScript); + class function UsedConnection(Obj: TDAScript): TCustomDAConnection; + end; + +implementation + +uses +{$IFNDEF VER6P} + MemData, +{$ENDIF} + DAConsts; + +{ TDAStatement } +destructor TDAStatement.Destroy; +begin + FParams.Free; + + inherited; +end; + +function TDAStatement.GetScript: TDAScript; +begin + Result := TDAStatements(Collection).FScript; +end; + +function TDAStatement.GetSQL: string; +begin + Result := Script.GetSQLText(FStartLine, FEndLine, FStartOffset, FEndOffset, FEndPos - FStartPos); +end; + +function TDAStatement.GetParams: TDAParams; +begin + if FParams = nil then begin + FParams := CreateParams; + TDBAccessUtils.ParseSQL(Script.FCommand, SQL, FParams); + end; + Result := FParams; +end; + +function TDAStatement.CreateParams: TDAParams; +begin + Result := TDBAccessUtils.CreateParamsObject(Script.FCommand); +end; + +procedure TDAStatement.Excecute; +var + BreakExec: boolean; +begin + Script.ExecuteStatement(GetSQL, FStatementType, FOmit, BreakExec, FParams); +end; + +{ TDAStatements } + +constructor TDAStatements.Create(ItemClass: TCollectionItemClass; Script: TDAScript); +begin + inherited Create(ItemClass); + + FScript := Script; +end; + +function TDAStatements.GetItem(Index: Integer): TDAStatement; +begin + Result := TDAStatement(inherited Items[Index]); +end; + +function TDAStatements.CreateStatement(StatementType: integer; Omit: boolean; StartPos, + EndPos, StartLine, EndLine, StartOffset, EndOffset: integer): TDAStatement; +begin + Result := Add as TDAStatement; + + Result.FOmit := Omit; + Result.FStartLine := StartLine; + Result.FEndLine := EndLine; + Result.FStartPos := StartPos; + Result.FEndPos := EndPos; + Result.FStartOffset := StartOffset; + Result.FEndOffset := EndOffset; + Result.FStatementType := StatementType; +end; + +{ TDAScript } + +constructor TDAScript.Create(Owner: TComponent); +begin + inherited Create(Owner); + FDataSource := TDataSource.Create(nil); + FSQL := TStringList.Create; + TStringList(FSQL).OnChange := SQLChanged; + FCommand := CreateCommand; + FMacros := TMacros.Create(nil); + FOnError := nil; + FErrorOffset := 0; + FDelimiter := ';'; + FCurrDelimiter := FDelimiter; + FCurrentStatementIdx := -1; + FSQLActual := True; + FBuffer := StringBuilder.Create; + FDesignCreate := csDesigning in ComponentState; +end; + +destructor TDAScript.Destroy; +begin + FParser.Free; + FMacros.Free; + FCommand.Free; + FSQL.Free; + FDataSource.Free; + FBuffer.Free; + FSQLParser.Free; + FStatements.Free; + + inherited; +end; + +procedure TDAScript.Loaded; +begin + inherited; + FDesignCreate := False; +end; + +procedure TDAScript.DefineProperties(Filer: TFiler); + function WriteMacros: boolean; + begin + if Filer.Ancestor <> nil then + Result := not FMacros.IsEqual(TDAScript(Filer.Ancestor).FMacros) + else + Result := FMacros.Count > 0; + end; +begin + inherited DefineProperties(Filer); + Filer.DefineProperty('MacroData', ReadMacroData, WriteMacroData, WriteMacros); +end; + +procedure TDAScript.ReadMacroData(Reader: TReader); +begin + Reader.ReadValue; + Reader.ReadCollection(FMacros); +end; + +procedure TDAScript.WriteMacroData(Writer: TWriter); +begin + Writer.WriteCollection(FMacros); +end; + +procedure TDAScript.Execute; +var + BreakExec: boolean; +begin + if not FStatementsPopulating then begin + if Assigned(DataSet) then begin + if TDBAccessUtils.UsedConnection(DataSet) = nil then + raise EDatabaseError.Create(SConnectionNotDefined); + DataSet.DisableControls; + TDBAccessUtils.InternalConnect(TDBAccessUtils.UsedConnection(DataSet)); + end + else begin + if TDBAccessUtils.UsedConnection(FCommand) = nil then + raise EDatabaseError.Create(SConnectionNotDefined); + TDBAccessUtils.InternalConnect(TDBAccessUtils.UsedConnection(FCommand)); + end; + end; + try + FAllowOptimization := True; + try + FCurrDelimiter := FDelimiter; + while ExecuteNext do; + Flush(BreakExec); + finally + FAllowOptimization := False; + end; + finally + if not FStatementsPopulating then begin + if Assigned(DataSet) then begin + DataSet.EnableControls; + TDBAccessUtils.InternalDisconnect(TDBAccessUtils.UsedConnection(DataSet)); + end + else + TDBAccessUtils.InternalDisconnect(TDBAccessUtils.UsedConnection(FCommand)); + end; + end; +end; + +procedure TDAScript.Open(Stream: TStream); +begin + Assert(FStream = nil); + FStream := Stream; +end; + +procedure TDAScript.Close; +begin + FStream := nil; +end; + +function TDAScript.CanOptimize(const SQL: string; const StatementType: integer): boolean; +begin + Result := FBuffer.Length + Length(SQL) < $FFFF; +end; + +function TDAScript.IsSpecificSQL(StatementType: integer): boolean; +begin + Result := StatementType = ST_SPECIFIC_SQL; +end; + +procedure TDAScript.InternalExecute(const SQL: string; out BreakExec: boolean; + Params: TDAParams = nil); // Sends SQL to server +var + i: Integer; + Action: TErrorAction; + MacrosDest: TMacros; + ParamsDest: TDAParams; +begin + if Assigned(DataSet) then begin + DataSet.SQL.Text := SQL; + ParamsDest := DataSet.Params; + MacrosDest := DataSet.Macros; + end + else begin + FCommand.SQL.Text := SQL; + ParamsDest := FCommand.Params; + MacrosDest := FCommand.Macros; + end; + + Assert(ParamsDest <> nil); + if Params <> nil then + ParamsDest.AssignValues(Params); + + Assert(MacrosDest <> nil); + for i := 0 to MacrosDest.Count - 1 do + MacrosDest[i].Assign(MacroByName(MacrosDest[i].Name)); + + try + if Assigned(DataSet) then + DataSet.Execute + else + FCommand.Execute; + + except + on EAbort do + raise; + on E: Exception do begin + CalculateErrorOffset(E); + Action := eaException; + if Assigned(FOnError) then + FOnError(Self, E, Trim(SQL), Action); + case Action of + eaAbort: + BreakExec := True; + eaFail: + raise; + eaException: + ApplicationHandleException(E); + end; + end; + end; +end; + +procedure TDAScript.Flush(out BreakExec: boolean); +begin + if FBuffer.Length <> 0 then // Flush + InternalExecute(FBuffer.ToString, BreakExec); + FBuffer.Length := 0; +end; + +procedure TDAScript.ExecuteStream(Stream: TStream); +begin + Open(Stream); + try + Execute; + finally + Close; + end; +end; + +procedure TDAScript.ExecuteFile(const FileName: string); +var + FileStream: TFileStream; +begin + FileStream := TFileStream.Create(FileName, fmOpenRead); + try + ExecuteStream(FileStream); + finally + FileStream.Free; + end; +end; + +function TDAScript.FindMacro(Name: string): TMacro; +begin + Result := FMacros.FindMacro(Name); +end; + +function TDAScript.MacroByName(Name: string): TMacro; +begin + Result := FMacros.MacroByName(Name); +end; + +function TDAScript.ErrorOffset: integer; +begin + Result := FErrorOffset; +end; + +function TDAScript.GetReady(Code: integer): boolean; +begin + Result := False; +end; + +procedure TDAScript.AssignTo(Dest: TPersistent); +begin + if Dest is TDAScript then begin + TDAScript(Dest).SetConnection(GetConnection); + TDAScript(Dest).SQL.Text := SQL.Text; + TDAScript(Dest).Debug := Debug; + TDAScript(Dest).Macros := Macros; + end + else + inherited; +end; + +function TDAScript.GetConnection: TCustomDAConnection; +begin + Result := FCommand.Connection; +end; + +procedure TDAScript.SetConnection(Value: TCustomDAConnection); +begin + FCommand.Connection := Value; + ValidateConnection(Value); +end; + +procedure TDAScript.ValidateConnection(Value: TCustomDAConnection); +begin +end; + +function TDAScript.UsedConnection: TCustomDAConnection; +begin + Result := TDBAccessUtils.UsedConnection(FCommand); +end; + +function TDAScript.GetSQLText(StartLine, EndLine, StartOffset, EndOffset, Length: integer): string; +var + SQL: StringBuilder; + i: integer; + SPos, EPos: integer; +begin + SQL := StringBuilder.Create(Length); + try + for i := StartLine to EndLine do begin + if i = StartLine then + SPos := StartOffset + 1 + else + SPos := 1; + if i = EndLine then + EPos := EndOffset + 1 + else + EPos := {$IFDEF CLR}Borland.Delphi.{$ENDIF}System.Length(FSQL[i]); + SQL.Append(Copy(FSQL[i], SPos, EPos - SPos + 1)); + if i <> EndLine then + SQL.Append(#$D#$A); + Result := SQL.ToString; + end; + finally + SQL.Free; + end; +end; + +procedure TDAScript.SetSQL(Value: TStrings); +begin + if FSQL.Text <> Value.Text then begin + FSQL.BeginUpdate; + try + FSQL.Assign(Value); + finally + FSQL.EndUpdate; + end; + end; +end; + +procedure TDAScript.SQLChanged(Sender: TObject); +begin + FMacros.Scan(FSQL.Text); + BreakExec; + FStatements.Free; + FStatements := nil; + FSQLActual := True; +end; + +function TDAScript.GetDebug: boolean; +begin + Result := FCommand.Debug; +end; + +procedure TDAScript.SetDebug(Value: boolean); +begin + FCommand.Debug := Value; +end; + +procedure TDAScript.SetMacros(Value: TMacros); +begin + FMacros.Assign(Value); +end; + +function TDAScript.GetDataSet: TCustomDADataSet; +begin + Result := FDataSource.DataSet as TCustomDADataSet; +end; + +procedure TDAScript.SetDataSet(Value: TCustomDADataSet); +begin + FDataSource.DataSet := Value; +end; + +procedure TDAScript.BreakExec; +begin + FParser.Free; + FParser := nil; + FStmtOffset := 0; + FStartPos := 0; + FStartLine := 0; + FEndPos := 0; + FEndLine := 0; +end; + +function TDAScript.CreateParser(const Text: string): TParser; +begin + Result := GetParserClass.Create(Text); +end; + +function TDAScript.CreateParser(Stream: TStream): TParser; +begin + Result := GetParserClass.Create(Stream); +end; + +function TDAScript.GetSQLParser(const Text: string): TParser; +begin + if FSQLParser = nil then begin + FSQLParser := TParser(CreateParser(Text)); + FSQLParser.OmitBlank := False; + FSQLParser.Uppered := False; + end + else + FSQLParser.SetText(Text); + Result := FSQLParser; +end; + +function TDAScript.CreateCommand: TCustomDASQL; +begin + Result := TCustomDASQL.Create(nil); +end; + +procedure TDAScript.CalculateErrorOffset(E: Exception); +begin + FErrorOffset := FStmtOffset; +end; + +function TDAScript.CreateStatementsObject: TDAStatements; +begin + Result := TDAStatements.Create(TDAStatement, Self); +end; + +function TDAScript.GetStatements: TDAStatements; +begin + if FStatements = nil then begin + FStatements := CreateStatementsObject; + FStatementsPopulating := True; + try + Execute; + finally + FStatementsPopulating := False; + end; + end; + Result := FStatements; +end; + +procedure TDAScript.DoBeforeStatementExecute(var SQL: string; StatementType: integer; var Omit: boolean); +begin +end; + +procedure TDAScript.DoAfterStatementExecute(var SQL: string; StatementType: integer); +begin +end; + +procedure TDAScript.CreateStatement(StatementType: integer; Omit: boolean; StartPos, + EndPos, StartLine, EndLine, StartOffset, EndOffset: integer); +begin + FStatements.CreateStatement(StatementType, Omit, StartPos, EndPos, + StartLine, EndLine, StartOffset, EndOffset); +end; + +procedure TDAScript.ExecuteStatement(SQL: string; StatementType: integer; + var Omit: Boolean; out BreakExec: boolean; Params: TDAParams = nil); +begin + BreakExec := False; + if FStatementsPopulating then + CreateStatement(StatementType, False, StartPos, EndPos, StartLine, + EndLine, StartOffset, EndOffset) + else + begin + if SQL = '' then + Exit; + if Assigned(FBeforeExecute) then + FBeforeExecute(Self, SQL, Omit); + DoBeforeStatementExecute(SQL, StatementType, Omit); + if not Omit then begin + try + if not (UseOptimization and FAllowOptimization) then + InternalExecute(SQL, BreakExec, Params) + else + begin + if not CanOptimize(SQL, StatementType) then + Flush(BreakExec); + if FBuffer.Length <> 0 then begin + FBuffer.Append(Delimiter); + FBuffer.Append(#$D#$A); + end; + FBuffer.Append(SQL); + end; + finally + DoAfterStatementExecute(SQL, StatementType); + end; + if Assigned(FAfterExecute) then + FAfterExecute(Self, SQL); + end; + end; +end; + +function TDAScript.ExecuteNext: boolean; +var + SQL: StringBuilder; + PrevSt, s: string; + Code: integer; + Ready: boolean; + NewDelimiter: string; + BreakExecution: boolean; + StatementType: integer; + Omit: boolean; + OldDebug: boolean; + CurrentStatement: TDAStatement; +begin + Result := False; + + if not FStatementsPopulating and (FStatements <> nil) and (FStream = nil) then begin + if (FStatements.Count > 0) then begin + if FCurrentStatementIdx = -1 then + FCurrentStatementIdx := 0; + if FCurrentStatementIdx <= FStatements.Count - 1 then begin + try + CurrentStatement := FStatements[FCurrentStatementIdx]; + Omit := CurrentStatement.Omit; + ExecuteStatement(CurrentStatement.SQL, CurrentStatement.FStatementType, Omit, BreakExecution, CurrentStatement.FParams); + Result := not BreakExecution; + finally + Inc(FCurrentStatementIdx); + end; + end + else + FCurrentStatementIdx := -1; + end; + end + else begin + if FParser = nil then begin + if FStream <> nil then + FParser := CreateParser(FStream) + else + FParser := CreateParser(TrimRight(FSQL.Text)); + + FParser.OmitBlank := False; + FParser.Uppered := False; + FParser.QuotedString := True; + FParser.AdvancedStringParsing := True; + end; + + SQL := nil; + StatementType := ST_UNKNOWN; + Omit := False; + FDelimiterState := dsNone; + NewDelimiter := ''; + PrevSt := ''; + FErrorOffset := 0; + Code := 0; + FStartPos := FParser.CurrPos; + FStartLine := FParser.CurrLine; + FStartOffset := FParser.CurrCol; + OldDebug := False; + if Assigned(DataSet) then begin + OldDebug := DataSet.Debug; + DataSet.Debug := Debug; + end; + try + SQL := StringBuilder.Create; + repeat + if (Code <> lcBlank) and (Code <> lcComment) then + PrevSt := FSt; + Code := FParser.GetNext(FSt); + if (FDelimiterState = dsBlank) and (Code <> lcBlank) then + FDelimiterState := dsValue; + if FDelimiterState = dsValue then begin + if (FSt <> FCurrDelimiter) then begin + if (Code <> lcBlank) and (Code <> lcEnd) then + NewDelimiter := NewDelimiter + FSt + else + if IsBlankEndsDelimeter then + FDelimiterState := dsSet; + end + else + FDelimiterState := dsSet; + end; + if (FDelimiterState = dsDelimiter) and (Code = lcBlank) then + FDelimiterState := dsBlank; + Ready := (FDelimiterState = dsSet) or (Code = lcEnd) or GetReady(Code); + if not Ready and (Code <> lcString) then + if FCurrDelimiter = FDelimiter{';'} {old mode} then + Ready := ((FSt = FDelimiter) and not IsSpecificSQL(StatementType)) or + ((FSt = '/') and (FParser.PrevCol = 0)) + else begin + Ready := (FSt = FCurrDelimiter) or ((FCurrDelimiter = '//') and (FSt = '/') and (PrevSt = '/')); + if not Ready and (Length(FCurrDelimiter) = 2) then + Ready := ((PrevSt = FCurrDelimiter[1]) and (FSt = FCurrDelimiter[2])); + end; + if Ready then begin + s := SQL.ToString; + if (Code <> lcEnd) and (Length(FCurrDelimiter) > 1) then + s := Copy(s, 1, Length(s) - Length(FCurrDelimiter) + 1); + + Ready := (Trim(s) <> '') or GetReady(Code); + end; + if Ready then begin + // Execution + Omit := (FDelimiterState = dsSet) or Omit; + if FDelimiterState = dsSet then begin + // DelimiterState := dsNone; + FCurrDelimiter := NewDelimiter; + end; + ExecuteStatement(s, StatementType, Omit, BreakExecution); + if not Omit and BreakExecution then + break; + FStmtOffset := FParser.CurrPos; + FStartPos := FParser.CurrPos; + FStartLine := FParser.CurrLine; + FStartOffset := FParser.CurrCol; + Result := True; + break; + end + else begin + CheckLexem(Code, StatementType, Omit); + if not ((FSt = '/') and (FParser.PrevCol = 0)) or (FCurrDelimiter <> FDelimiter{';'}) then + if (Code = lcString) or (Code <> lcBlank) or (SQL.Length <> 0) then begin + SQL.Append(FSt); + + FEndPos := FParser.CurrPos - 1; + FEndLine := FParser.CurrLine; + FEndOffset := FParser.CurrCol - 1; + end + else begin + Inc(FStmtOffset, Length(FSt)); + //to correct start position + FStartLine := FParser.CurrLine; + FStartPos := FParser.CurrPos; + FStartOffset := FParser.CurrCol; + end; + end; + until Code = lcEnd; + if not Result then begin + FParser.Free; + FParser := nil; + end; + finally + SQL.Free; + if Assigned(DataSet) then begin + DataSet.Debug := OldDebug; + end; + end; + end; +end; + +procedure TDAScript.SetDelimiter(const Value: string); +begin + FDelimiter := Value; + FCurrDelimiter := FDelimiter; + FDelimiterState := dsNone; +end; + +procedure TDAScript.CheckLexem(Code: integer; var StatementType: integer; var Omit: boolean); +begin + if (Code = lcComment) and (StatementType = ST_UNKNOWN) then + StatementType := ST_COMMENT + else + if (StatementType = ST_COMMENT) and (Code <> lcComment) and + (Code <> lcBlank) then + StatementType := ST_UNKNOWN; +end; + +function TDAScript.GetParams: TDAParams; +begin + if Assigned(DataSet) then + Result := DataSet.Params + else + Result := FCommand.Params; +end; + +function TDAScript.IsDelimiterStored: boolean; +begin + Result := FDelimiter <> ';'; +end; + +function TDAScript.IsBlankEndsDelimeter: boolean; +begin + //This function determine if lxBlank ends delimeter settings + Result := False; +end; + +function TDAScript.GetParserClass: TParserClass; +begin + Result := nil; + Assert(False, 'Should be overriden'); +end; + +{ TDAScriptUtils } + +class procedure TDAScriptUtils.SetDesignCreate(Obj: TDAScript; Value: boolean); +begin + Obj.FDesignCreate := Value; +end; + +class function TDAScriptUtils.GetDesignCreate(Obj: TDAScript): boolean; +begin + Result := Obj.FDesignCreate; +end; + +class procedure TDAScriptUtils.SetCommand(Obj: TDAScript; Command: TCustomDASQL); +begin + Obj.FCommand := Command; +end; + +class function TDAScriptUtils.GetCommand(Obj: TDAScript): TCustomDASQL; +begin + Result := Obj.FCommand; +end; + +class procedure TDAScriptUtils.Open(Obj: TDAScript; Stream: TStream); +begin + Obj.Open(Stream); +end; + +class procedure TDAScriptUtils.Close(Obj: TDAScript); +begin + Obj.Close; +end; + +class function TDAScriptUtils.UsedConnection(Obj: TDAScript): TCustomDAConnection; +begin + Result := Obj.UsedConnection; +end; + +end. + diff --git a/internal/4.10.0.10/1/Source/DAVersionInfo.pas b/internal/4.10.0.10/1/Source/DAVersionInfo.pas new file mode 100644 index 0000000..c176f8a --- /dev/null +++ b/internal/4.10.0.10/1/Source/DAVersionInfo.pas @@ -0,0 +1,44 @@ +unit DAVersionInfo; + +interface + +uses Windows; + +{$I DacVer.inc} + +type + custvalget = function ( Name: PChar; Value: PChar ): PChar; stdcall; + custvalset = procedure ( Name: PChar; Value: PChar ); stdcall; + + pscustparam = ^scustparam; + scustparam = packed record + valget: custvalget; // Function getting value of macros + valset: custvalset; // Function changing value of macros + hinst: THandle; // HINSTANCE setuo executable file + hwnd: THandle; // Handle of the current opened window + result: byte; // You must assign result value. See below + end; + +const + crCustomExit = 0; // Exit from setup + crCustomOK = 1; // Continue next command + crCustomNext = 2; // Next command or open next Dialog Window + crCustomPrev = 3; // Previous Dialog Window + + procedure GetVersion(Param: Pscustparam); stdcall; export; + +implementation + +procedure GetVersion(Param: Pscustparam); stdcall; export; +var + Version: string; +begin + Version := '[' + DACVersion + ']'; + Param.valset('#DACVERSION#', PChar(Version)); + Param.result := crCustomOK; +end; + +exports + GetVersion name 'GetVersion'; + +end. diff --git a/internal/4.10.0.10/1/Source/DBAccess.pas b/internal/4.10.0.10/1/Source/DBAccess.pas new file mode 100644 index 0000000..909be3f --- /dev/null +++ b/internal/4.10.0.10/1/Source/DBAccess.pas @@ -0,0 +1,11171 @@ + +////////////////////////////////////////////////// +// DB Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +// DB Access +// Created: 01.07.00 +////////////////////////////////////////////////// + +{$J+} +{$IFNDEF CLR} + +{$I Dac.inc} + +unit DBAccess; +{$ENDIF} +interface +uses + SysUtils, Classes, DB, MemData, MemDS, CRAccess, CRParser, TypInfo, MemUtils, +{$IFDEF VER6P}Variants, SqlTimSt,{$ENDIF} +{$IFDEF MSWINDOWS} + Windows, Registry, +{$IFDEF CLR} + ExtCtrls, System.XML, +{$ELSE} + Win32Timer, +{$ENDIF} +{$ENDIF} +{$IFDEF CLR} + System.Runtime.InteropServices, System.Text, Contnrs, +{$ELSE} + CLRClasses, CRXml, +{$ENDIF} + SyncObjs; + +const + OperationsStackDelta = 50; + +type + TCustomDAConnection = class; + TCustomDASQL = class; + TCustomDADataSet = class; + TCustomDASQLClass = class of TCustomDASQL; + TCustomDADataSetClass = class of TCustomDADataSet; + TCustomDAUpdateSQL = class; + TMacro = class; + TMacros = class; + TCustomConnectDialog = class; + TConnectDialogClass = class of TCustomConnectDialog; + + TCRConnectionClass = class of TCRConnection; + TCRCommandClass = class of TCRCommand; + TCRRecordSetClass = class of TCRRecordSet; + +{ EDAError } + + EDAError = class (EDatabaseError) + protected + FErrorCode: integer; + FComponent: TObject; + public + constructor Create(ErrorCode: integer; Msg: string); + + property ErrorCode: integer read FErrorCode; + property Component: TObject read FComponent write FComponent; + end; + +{ TCustomDAConnection } + TRetryMode = (rmRaise, rmReconnect, rmReconnectExecute); + + TFailOverOperation = record + Operation: TConnLostCause; + AllowFailOver: boolean; + end; + TOperationsStack = array of TFailOverOperation;// executed operations stack used to track dowm connection lost cause + + TDAConnectionErrorEvent = procedure (Sender: TObject; E: EDAError; var Fail: boolean) of object; + TConnectionLostEvent = procedure (Sender: TObject; Component: TComponent; ConnLostCause: TConnLostCause; + var RetryMode: TRetryMode) of object; + + TDAConnectionOptions = class (TPersistent) + protected + FKeepDesignConnected: boolean; + FOwner: TCustomDAConnection; + FDisconnectedMode: boolean; + FLocalFailover: boolean; + + procedure SetDisconnectedMode(Value: boolean); virtual; + procedure AssignTo(Dest: TPersistent); override; + + public + constructor Create(Owner: TCustomDAConnection); + + property DisconnectedMode: boolean read FDisconnectedMode write SetDisconnectedMode default False; + property KeepDesignConnected: boolean read FKeepDesignConnected write FKeepDesignConnected default True; + property LocalFailover: boolean read FLocalFailover write FLocalFailover default False; + end; + + TPoolingOptions = class(TPersistent) + protected + FOwner: TCustomDAConnection; + FMaxPoolSize: integer; + FMinPoolSize: integer; + FConnectionLifetime: integer; + FValidate: boolean; + + procedure AssignTo(Dest: TPersistent); override; + + public + constructor Create(Owner: TCustomDAConnection); virtual; + + published + property MaxPoolSize: integer read FMaxPoolSize write FMaxPoolSize default 100; + property MinPoolSize: integer read FMinPoolSize write FMinPoolSize default 0; + property ConnectionLifetime: integer read FConnectionLifetime write FConnectionLifetime default 0; + property Validate: boolean read FValidate write FValidate default False; + end; + + TCustomDAConnection = class (TCustomConnection) + private + FUsername: string; + FAutoCommit: boolean; + FInProcessError: boolean; + FConnectDialog: TCustomConnectDialog; + + FOnError: TDAConnectionErrorEvent; + FConvertEOL: boolean; + + FOptions: TDAConnectionOptions; + FPoolingOptions: TPoolingOptions; + FPooling: boolean; + FOnConnectionLost: TConnectionLostEvent; + hRegisterClient: TCriticalSection; + + procedure ClearRefs; + + procedure SetUsername(const Value: string); + procedure SetPassword(const Value: string); + procedure SetAutoCommit(Value: boolean); + procedure SetConnectDialog(Value: TCustomConnectDialog); + procedure SetPooling(Value: boolean); + + procedure DoAfterConnect; + protected + FConnectCount: integer; + FSQLs: TDAList; + FIConnection: TCRConnection; + FStreamedConnected: boolean; + FServer: string; + FPassword: string; + FTransactionID: string; + FShouldShowPrompt: boolean; //Disconnect mode flag that allow to avoid unnecessary Login porompt showing + FOperationsStack: TOperationsStack ; //FailOver support + FOperationsStackLen: integer; + + function GetTransactionID: string; virtual; + + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + + function GetIConnectionClass: TCRConnectionClass; virtual; + function GetICommandClass: TCRCommandClass; virtual; + function GetIRecordSetClass: TCRRecordSetClass; virtual; + + procedure CreateIConnection; virtual; + function CreateICommand: TCRCommand; + function CreateIRecordSet: TCRRecordSet; + procedure FreeIConnection; + procedure SetIConnection(Value: TCRConnection); virtual; + + procedure Loaded; override; + + procedure RegisterClient(Client: TObject; Event: TConnectChangeEvent = nil); override; + procedure UnRegisterClient(Client: TObject); override; + + function SQLMonitorClass: TClass; virtual; // TDASQLMonitorClass + function ConnectDialogClass: TConnectDialogClass; virtual; + + procedure DoConnect; override; + procedure DoDisconnect; override; + function CommitOnDisconnect: boolean; virtual; + procedure InternalConnect; virtual; + procedure InternalDisconnect; virtual; + + function IsConnectedStored: boolean; virtual; + function NeedPrompt: boolean; virtual; + //Operations stack functionality + function PushOperation(Operation: TConnLostCause; AllowFailOver: boolean = true): integer; virtual; + function PopOperation: TConnLostCause; virtual; + + function IsFatalError(E: EDAError): boolean; virtual; + procedure ResetOnFatalError; virtual; + procedure RestoreAfterFailOver; virtual; + function DetectConnLostCause(Component: TObject): TConnLostCause; virtual; + procedure DoError(E: Exception; var Fail, Reconnect, Reexecute: boolean; ReconnectAttempt: integer; + var ConnLostCause: TConnLostCause); virtual; + function IsKeyViolation(E: EDAError): boolean; virtual; + + procedure AssignTo(Dest: TPersistent); override; + + function GetConnected: boolean; override; + procedure SetConnected(Value: boolean); override; + function GetConnectString: string; virtual; + procedure SetConnectString(Value: string); virtual; + procedure SetServer(const Value: string); virtual; + + procedure SuppressAutoCommit; + procedure RestoreAutoCommit; + function GetInTransaction: boolean; virtual; + procedure SetConvertEOL(Value: boolean); + + { Transaction control } + procedure InternalStartTransaction; virtual; + + function CreateOptions: TDAConnectionOptions; virtual; + procedure SetOptions(Value: TDAConnectionOptions); + function CreatePoolingOptions: TPoolingOptions; virtual; + procedure SetPoolingOptions(Value: TPoolingOptions); + + function IsCaseSensitive: boolean; virtual; + + property AutoCommit: boolean read FAutoCommit write SetAutoCommit default True; + property ConnectString: string read GetConnectString write SetConnectString stored False; + public + constructor Create(Owner: TComponent); override; + destructor Destroy; override; + + procedure Connect; + procedure Disconnect; + procedure PerformConnect(Retry: boolean = False); + + function ExecSQL(Text: string; const Params: array of variant): variant; virtual; abstract; + + procedure GetTableNames(List: TStrings); virtual; + procedure GetDatabaseNames(List: TStrings); virtual; + procedure GetStoredProcNames(List: TStrings); virtual; + + { Transaction control } + procedure StartTransaction; virtual; + procedure Commit; virtual; + procedure Rollback; virtual; + + procedure ApplyUpdates; overload; virtual; + procedure ApplyUpdates(DataSets: array of TCustomDADataSet); overload; virtual; + + function CreateDataSet: TCustomDADataSet; virtual; + function CreateSQL: TCustomDASQL; virtual; + + procedure RemoveFromPool; + procedure MonitorMessage(const Msg: string); + + property Username: string read FUsername write SetUsername; + property Password: string read FPassword write SetPassword; + property Server: string read FServer write SetServer; + property InTransaction: boolean read GetInTransaction; + property ConnectDialog: TCustomConnectDialog read FConnectDialog write SetConnectDialog; + + property OnError: TDAConnectionErrorEvent read FOnError write FOnError; + property OnConnectionLost: TConnectionLostEvent read FOnConnectionLost write FOnConnectionLost; + + property LoginPrompt default True; + property ConvertEOL: boolean read FConvertEOL write SetConvertEOL default False; + + property Options: TDAConnectionOptions read FOptions write SetOptions; + property PoolingOptions: TPoolingOptions read FPoolingOptions write SetPoolingOptions; + property Pooling: boolean read FPooling write SetPooling default False; + + end; + +{ TDAParam } + TDAParams = class; + + TDAParamInfoClass = class of TDAParamInfo; + TDAParamInfo = class(TCollectionItem) + protected + FField: TField; + FOld: boolean; + FParamIndex: integer; + public + property Field: TField read FField write FField; + property Old: boolean read FOld write FOld; + property ParamIndex: integer read FParamIndex write FParamIndex; + end; + + TDAParamsInfo = class(TCollection) + protected + function GetItem(Index: Integer): TDAParamInfo; + procedure SetItem(Index: Integer; Value: TDAParamInfo); + public + property Items[Index: Integer]: TDAParamInfo read GetItem write SetItem; default; + end; + + TDAParam = class (TParam) + private + FSize: integer; + + function IsDataTypeStored: boolean; + function IsValueStored: boolean; + + procedure SetParamObject(Value: TSharedObject); + + protected + FParamObject: TSharedObject; + + function IsObjectDataType(DataType: TFieldType): boolean; overload; virtual; + function IsObjectDataType: boolean; overload; + function IsBlobDataType: boolean; virtual; + function GetDataType: TFieldType; virtual; + procedure SetDataType(Value: TFieldType); virtual; + + function GetSize: integer; virtual; + procedure SetSize(Value: integer); virtual; + + function GetAsString: string; virtual; + procedure SetAsString(Value: string); virtual; + + function GetAsWideString: WideString; virtual; + procedure SetAsWideString(Value: WideString); virtual; + + function GetAsInteger: integer; virtual; + procedure SetAsInteger(Value: integer); virtual; + + function GetAsFloat: double; virtual; + procedure SetAsFloat(Value: double); virtual; + + procedure SetAsBlob(Value: TBlobData); virtual; + + procedure SetAsMemo(Value: string); virtual; + + function GetAsBlobRef: TBlob; virtual; + procedure SetAsBlobRef(const Value: TBlob); virtual; + + function GetAsMemoRef: TBlob; virtual; + procedure SetAsMemoRef(const Value: TBlob); virtual; + + function GetAsVariant: variant; virtual; + procedure SetAsVariant(const Value: variant); virtual; + + {$IFDEF VER6P} + function GetAsSQLTimeStamp: TSQLTimeStamp; virtual; + procedure SetAsSQLTimeStamp(const Value: TSQLTimeStamp); virtual; + {$ENDIF} + + procedure SetText(const Value: string); virtual; + + function GetIsNull: boolean; virtual; + + procedure DefineProperties(Filer: TFiler); override; + procedure ReadExtDataType(Reader: TReader); + procedure WriteExtDataType(Writer: TWriter); + + procedure CreateObject; virtual; + procedure FreeObject; virtual; + + procedure AssignParam(Param: TParam); + procedure AssignTo(Dest: TPersistent); override; + + property ParamObject: TSharedObject read FParamObject write SetParamObject; + + public + destructor Destroy; override; + + procedure Clear; virtual; + + procedure Assign(Source: TPersistent); override; + procedure AssignField(Field: TField); + procedure AssignFieldValue(Field: TField; const Value: Variant); virtual; + + procedure LoadFromFile(const FileName: string; BlobType: TBlobType); + procedure LoadFromStream(Stream: TStream; BlobType: TBlobType); virtual; + procedure SetBlobData(Buffer: TBytes; Size: Integer); overload; + procedure SetBlobData(Buffer: TValueBuffer); overload; + + property AsString: TBlobData read GetAsString write SetAsString; + property AsWideString: WideString read GetAsWideString write SetAsWideString; + property AsInteger: integer read GetAsInteger write SetAsInteger; + property AsFloat: double read GetAsFloat write SetAsFloat; + property AsBlob: TBlobData read GetAsString write SetAsBlob; + property AsMemo: string read GetAsString write SetAsMemo; + property AsBlobRef: TBlob read GetAsBlobRef write SetAsBlobRef; + property AsMemoRef: TBlob read GetAsMemoRef write SetAsMemoRef; + {$IFDEF VER6P} + property AsSQLTimeStamp: TSQLTimeStamp read GetAsSQLTimeStamp write SetAsSQLTimeStamp; + {$ENDIF} + property IsNull: boolean read GetIsNull; + property Text: string read GetAsString write SetText; + + published + property DataType: TFieldType read GetDataType write SetDataType stored IsDataTypeStored; + property ParamType default DB.ptUnknown; + property Size: integer read GetSize write SetSize default 0; + property Value: variant read GetAsVariant write SetAsVariant stored IsValueStored; + end; + +{ TDAParams } + + TDAParams = class (TParams) + private + function GetItem(Index: integer): TDAParam; + procedure SetItem(Index: integer; Value: TDAParam); + + protected + FOwner: TPersistent; + FNeedsUpdateItem: boolean; + procedure Update(Item: TCollectionItem); override; + + public + constructor Create(Owner: TPersistent); overload; + + function ParamByName(const Value: string): TDAParam; + function FindParam(const Value: string): TDAParam; + function CreateParam(FldType: TFieldType; const ParamName: string; + ParamType: TParamType): TDAParam; + property Items[Index: integer]: TDAParam read GetItem write SetItem; default; + end; + +{ TDADetailDataLink } + + TDADetailDataLink = class (TDetailDataLink) + private + FDataSet: TCustomDADataSet; + + protected + procedure ActiveChanged; override; + procedure RecordChanged(Field: TField); override; + procedure CheckBrowseMode; override; + + function GetDetailDataSet: TDataSet; override; + + public + constructor Create(DataSet: TCustomDADataSet); + end; + +{ TDASQLGenerator } + + TFieldArray = array of TField; + TFieldDescArray = array of TCRFieldDesc; + TKeyAndDataFields = record + KeyFieldDescs: TFieldDescArray; + DataFieldDescs: TFieldDescArray; + end; + + TStatementType = (stQuery, stInsert, stUpdate, stDelete, stLock, stRefresh, + stCheck, stCustom, stRefreshQuick, stRefreshCheckDeleted, stBatchUpdate); + TStatementTypes = set of TStatementType; + + TDASQLGenerator = class + protected + FOwner: TCustomDADataSet; + + // stInsert stUpdate stDelete stRefresh + FHeaderSB, // INSERT INTO Tbl( UPDATE Tbl SET DELETE FROM Tbl WHERE SELECT + FFldSB, // f1, f2, f3, ... f1 = :p1, f2 = :p2, ... f1, f2, f3, ... + FMiddleSB, // ) VALUES ( WHERE FROM Tbl WHERE + FFldParamSB, // :p1, :p2, :p3, ... + FCondSB, // f0 = :p0 f0 = :p0 f0 = :p0 + FFooterSB: StringBuilder; // ) + FOldRecBuf, FNewRecBuf: IntPtr; + FParams: TDAParams; + FParamsInfo: TDAParamsInfo; + FTableInfo: TCRTableInfo; + + procedure Clear; virtual; + function AssembleSB(const StatementType: TStatementType): string; virtual; + function Data: TData; + function OldRecBuf: IntPtr; + function NewRecBuf: IntPtr; + + function IsBlobDataType(DataType: word): boolean; virtual; + function IsObjectDataType(DataType: word): boolean; virtual; + + function FieldIsNull(FieldDesc: TCRFieldDesc; OldValue: boolean; Data: TData; OldRecBuf, NewRecBuf: IntPtr): boolean; overload; virtual; + function FieldIsNull(FieldDesc: TCRFieldDesc; OldValue: boolean): boolean; overload; virtual; + + function FieldModified(FieldDesc: TCRFieldDesc; Data: TData; OldRecBuf, NewRecBuf: IntPtr): boolean; overload; virtual; + function FieldModified(FieldDesc: TCRFieldDesc): boolean; overload; virtual; + + function GetActualFieldNameEx(FieldDesc: TCRFieldDesc; TableInfo: TCRTableInfo): string; virtual; + function GetActualFieldName(FieldDesc: TCRFieldDesc; IsRefresh: boolean): string; virtual; + + function IndexedPrefix: string; + + function GenerateIndexName(Name: string): string; virtual; + function DecodeFieldIndex(FieldName: string): integer; virtual; + + function QuoteName(const AName: string): string; + function UnQuoteName(AName: string): string; + + function IsSubstituteParamName: boolean; virtual; + procedure AddParam(SB: StringBuilder; FieldDesc: TFieldDesc; + const StatementType: TStatementType; + const ParamType: TParamType; + Index: integer = -1; + Old: boolean = False); virtual; + + procedure AddFieldToInsertSQL(FieldDesc: TCRFieldDesc; const Index: integer = -1); virtual; + procedure AddFieldToUpdateSQL(FieldDesc: TCRFieldDesc; + const ModifiedFieldsOnly: boolean; + const Index: integer = -1); virtual; + procedure AddFieldToRefreshSQL(FieldDesc: TCRFieldDesc); virtual; + procedure AddFieldToCondition(SB: StringBuilder; + FieldDesc: TCRFieldDesc; + const StatementType: TStatementType; + const ModifiedFieldsOnly: boolean; + const Index: integer = -1); virtual; + + procedure GenerateInsertSQL( + const KeyAndDataFields: TKeyAndDataFields; + const ModifiedFieldsOnly: boolean; + const Index: integer = -1); virtual; + procedure GenerateUpdateSQL( + const KeyAndDataFields: TKeyAndDataFields; + const ModifiedFieldsOnly: boolean; + const Index: integer = -1); virtual; + procedure GenerateDeleteSQL( + const KeyAndDataFields: TKeyAndDataFields; + const ModifiedFieldsOnly: boolean; + const Index: integer = -1); virtual; + procedure GenerateLockSQL( + const KeyAndDataFields: TKeyAndDataFields; + const Index: integer = -1); virtual; + procedure GenerateRefreshSQLSelectPart(const KeyAndDataFields: TKeyAndDataFields); virtual; + procedure GenerateRefreshSQLFromPart; virtual; + procedure GenerateRefreshSQL( + const KeyAndDataFields: TKeyAndDataFields; + const ModifiedFieldsOnly: boolean); virtual; + procedure GenerateRefreshQuickSQL(const KeyAndDataFields: TKeyAndDataFields); virtual; + procedure GenerateRefreshCheckDeletedSQL(const KeyAndDataFields: TKeyAndDataFields); virtual; + + procedure GenerateConditions(SB: StringBuilder; const StatementType: TStatementType; + const ModifiedFieldsOnly: boolean; + const KeyAndDataFields: TKeyAndDataFields; + const Index: integer = -1); virtual;// Generate WHERE part for UPDATE, DELETE, REFRESH SQLs + + function GetParamInfoClass: TDAParamInfoClass; virtual; + public + constructor Create(Owner: TCustomDADataSet); + destructor Destroy; override; + + // Generate insert, update, delete or refresh SQL statements + function GenerateSQLforUpdTable(TableInfo: TCRTableInfo; + const KeyAndDataFields: TKeyAndDataFields; + const StatementType: TStatementType; + const ModifiedFieldsOnly: boolean; + Params: TDAParams; + const Index: integer = -1): string; virtual; + + function GenerateSQL(const StatementType: TStatementType; + const ModifiedFieldsOnly: boolean; + Params: TDAParams; + const Index: Integer = -1): string; virtual; + + property ParamsInfo: TDAParamsInfo read FParamsInfo; + end; + +{ TCustomDADataSet } + + TRefreshOption = (roAfterInsert, roAfterUpdate, roBeforeEdit); + TRefreshOptions = set of TRefreshOption; + + TAfterExecuteEvent = procedure (Sender: TObject; Result: boolean) of object; + TUpdateExecuteEvent = procedure (Sender: TDataSet; StatementTypes: TStatementTypes; + Params: TDAParams) of object; + TBeforeFetchEvent = procedure (DataSet: TCustomDADataSet; var Cancel: boolean) of object; + TAfterFetchEvent = procedure (DataSet: TCustomDADataSet) of object; + + TLocalMDLink = record + IsNull: boolean; + Buffer: IntPtr; + BufferType: integer; + NativeBuffer: boolean; + FieldNo: integer; + end; + + TLocalMDLinks = array of TLocalMDLink; + + TDADataSetOptions = class (TPersistent) + private + FSetFieldsReadOnly: boolean; + FRequiredFields: boolean; + FStrictUpdate: boolean; + FNumberRange: boolean; + FQueryRecCount: boolean; + FAutoPrepare: boolean; + FReturnParams: boolean; + FTrimFixedChar: boolean; + FTrimVarChar: boolean; + FLongStrings: boolean; + FRemoveOnRefresh: boolean; + FFlatBuffers: boolean; + FQuoteNames: boolean; + FDetailDelay: integer; + {$IFDEF HAVE_COMPRESS} + FCompressBlobMode: TCompressBlobMode; + {$ENDIF} + FFullRefresh: boolean; + FLocalMasterDetail: boolean; + FFieldsOrigin: boolean; + FUpdateBatchSize: integer; + FUpdateAllFields: boolean; + + procedure SetRequiredFields(Value: boolean); + procedure SetNumberRange(Value: boolean); + procedure SetTrimFixedChar(Value: boolean); + procedure SetTrimVarChar(Value: boolean); + procedure SetLongStrings(Value: boolean); + procedure SetAutoPrepare(Value: boolean); + procedure SetFlatBuffers(const Value: boolean); + procedure SetDetailDelay(Value: integer); + {$IFDEF HAVE_COMPRESS} + procedure SetCompressBlobMode(Value: TCompressBlobMode); + {$ENDIF} + procedure SetLocalMasterDetail(Value: boolean); + function GetCacheCalcFields: boolean; + procedure SetCacheCalcFields(Value: boolean); + protected + FOwner: TCustomDADataSet; + + procedure AssignTo(Dest: TPersistent); override; + + property FullRefresh: boolean read FFullRefresh write FFullRefresh default False; + property TrimVarChar: boolean read FTrimVarChar write SetTrimVarChar default False; + public + constructor Create(Owner: TCustomDADataSet); + + property SetFieldsReadOnly: boolean read FSetFieldsReadOnly write FSetFieldsReadOnly default False; + property RequiredFields: boolean read FRequiredFields write SetRequiredFields default True; + property StrictUpdate: boolean read FStrictUpdate write FStrictUpdate default True; + property NumberRange: boolean read FNumberRange write SetNumberRange default False; + property QueryRecCount: boolean read FQueryRecCount write FQueryRecCount default False; + property AutoPrepare: boolean read FAutoPrepare write SetAutoPrepare default False; + property ReturnParams: boolean read FReturnParams write FReturnParams default False; + property TrimFixedChar: boolean read FTrimFixedChar write SetTrimFixedChar default True; + property LongStrings: boolean read FLongStrings write SetLongStrings default True; + property FlatBuffers: boolean read FFlatBuffers write SetFlatBuffers default False; + property RemoveOnRefresh: boolean read FRemoveOnRefresh write FRemoveOnRefresh default True; + property QuoteNames: boolean read FQuoteNames write FQuoteNames default False; + property DetailDelay: integer read FDetailDelay write SetDetailDelay default 0; + {$IFDEF HAVE_COMPRESS} + property CompressBlobMode: TCompressBlobMode read FCompressBlobMode write SetCompressBlobMode default cbNone; + {$ENDIF} + property LocalMasterDetail: boolean read FLocalMasterDetail write SetLocalMasterDetail default False; + property CacheCalcFields: boolean read GetCacheCalcFields write SetCacheCalcFields default False; + property FieldsOrigin: boolean read FFieldsOrigin write FFieldsOrigin stored False default False; + property UpdateBatchSize: Integer read FUpdateBatchSize write FUpdateBatchSize default 1; + property UpdateAllFields: boolean read FUpdateAllFields write FUpdateAllFields default False; + end; + + TCustomDADataSet = class (TMemDataSet) + private + FConnection: TCustomDAConnection; + FParams: TDAParams; // for easy reference of FCommand.Params + FMacros: TMacros; // for easy reference of FCommand.Macros + FFetchRows: integer; + FDataLink: TDADetailDataLink; + FDebug: boolean; + FReadOnly: boolean; + FUniDirectional: boolean; + FAutoCommit: boolean; + FUpdateObject: TCustomDAUpdateSQL; + FRefreshOptions: TRefreshOptions; + FOptions: TDADataSetOptions; + FActiveRecRefresh: boolean; // ActiveBufLevelRecordRefresh + FBaseSQL: string; + {$IFDEF MSWINDOWS} + FDetailRefreshTimer: {$IFDEF CLR}TTimer{$ELSE}TWin32Timer{$ENDIF}; + {$ENDIF} + FLocalMDLinks: TLocalMDLinks; + FAfterExecute: TAfterExecuteEvent; + + FBeforeFetch: TBeforeFetchEvent; + FAfterFetch: TAfterFetchEvent; + FBeforeUpdateExecute: TUpdateExecuteEvent; + FAfterUpdateExecute: TUpdateExecuteEvent; + + FFindKeyOptions: TLocateExOptions; + + function GetSQL: TStrings; + procedure SetSQL(Value: TStrings); + procedure SetFetchRows(Value: integer); + procedure SetMasterSource(Value: TDataSource); + function GetParams: TDAParams; + procedure SetParams(Value: TDAParams); + function GetParamCount: word; + function GetParamCheck: boolean; + procedure SetParamCheck(Value: boolean); + function GetMacros: TMacros; + procedure SetMacros(Value: TMacros); + function GetMacroCount: word; + function GetRowsAffected: integer; + procedure SetUniDirectional(Value: boolean); + procedure SetAutoCommit(Value: boolean); + //procedure SetUpdateMode(const Value: TUpdateMode); + procedure SetUpdateObject(Value: TCustomDAUpdateSQL); + procedure SetOptions(Value: TDADataSetOptions); + procedure SetMasterFields(Value: string); + procedure SetForeignKeyFields(Value: string); + procedure SaveModifiedSQL(NewSQL: string); + function GetBaseSQL: string; + {$IFDEF MSWINDOWS} + procedure CheckRefreshDetailTimer; + {$ENDIF} + + {$IFDEF VER5P} + protected + { IProviderSupport } + FOldKeyFields: string; // To PSGetKeyFields after closing table (see SDAC 3034) + FOldTableName: string; // PSGetTableName must return right value even after DataSet.Close + procedure PSEndTransaction(Commit: Boolean); override; + procedure PSExecute; override; + function PSExecuteStatement(const ASQL: string; AParams: TParams; + {$IFDEF CLR}var ResultSet: TObject{$ELSE}ResultSet: Pointer = nil{$ENDIF}): Integer; override; + function PSGetParams: DB.TParams; override; + function PSGetQuoteChar: string; override; + function PSGetTableName: string; override; + function PSInTransaction: Boolean; override; + function PSIsSQLBased: Boolean; override; + function PSIsSQLSupported: Boolean; override; + procedure PSReset; override; + procedure PSSetParams(AParams: DB.TParams); override; + procedure PSSetCommandText(const CommandText: string); override; + procedure PSStartTransaction; override; + function PSUpdateRecord(UpdateKind: TUpdateKind; Delta: TDataSet): Boolean; override; + function PSGetDefaultOrder: TIndexDef; override; + function PreventPSKeyFields(var PSKeyFields: string): boolean; virtual; + function PSGetKeyFields: string; override; + {$ENDIF} + + protected + FRowsAffected: integer; + + FIRecordSet: TCRRecordSet; + FICommand: TCRCommand; // for perf + FCommand: TCustomDASQL; + + FFilterSQL: string; //CR ODAC (8387) vs (8751) + + FCachedKeyAndDataFields: array [boolean] of TKeyAndDataFields; + FSQLGenerator: TDASQLGenerator; + + FIdentityField: TField; + FUpdatingTableInfoIdx: integer; + FUpdatingTable: string;//Can not delete because FTablesInfo created only on ~open + + FMasterFields: string; + FDetailFields: string; + + FDesignCreate: boolean; + FNonBlocking: boolean; + FLockDebug: boolean; // locking trans debug info + FUpdateQuery: TComponent; + FUpdateComponents: array [TStatementType] of TComponent; + FUpdateSQL: array [TStatementType] of TStrings; // SQLInsert, SQLUpdate etc + + FRecordCount: integer; + + FFetchAll: boolean; + FFetchCanceled: boolean; + + FLeftQuote: char; + FRightQuote: char; + + FStreamedOpen: Boolean; + + FBatchSQLs: StringBuilder; + FBatchParams: TDAParams; + FBatchStatements: integer; + + function GetFieldObject(Field: TField): TSharedObject; overload; + function GetFieldObject(FieldDesc: TFieldDesc): TSharedObject; overload; + + function BatchUpdate: boolean; override; + function CanFlushBatch: boolean; override; + function PrepareBatch(SQL: string): string; virtual; + procedure FlushBatch; override; + procedure ClearBatch; + + function QuoteName(const AName: string): string; virtual; + function UnQuoteName(AName: string): string; virtual; + + procedure CheckInactive; override; + procedure CreateIRecordSet; override; + procedure FreeIRecordSet; + procedure SetIRecordSet(Value: TData{TRecordSet}); override; + procedure CheckIRecordSet; + + procedure CreateCommand; virtual; + procedure FreeCommand; + procedure SetCommand(Value: TCustomDASQL); + + function CreateOptions: TDADataSetOptions; virtual; + + procedure Loaded; override; + + procedure SetConnection(Value: TCustomDAConnection); + function UsedConnection: TCustomDAConnection; virtual; + procedure CheckConnection; virtual; + procedure BeginConnection(NoConnectCheck: boolean = True); virtual; + procedure EndConnection; virtual; + procedure Disconnect; virtual; + procedure ConnectChange(Sender: TObject; Connecting: boolean); virtual; + + { TablesInfo } + function GetTablesInfo: TCRTablesInfo; + procedure SetUpdatingTable(Value: string); virtual; + procedure InitUpdatingTable; + procedure DetectIdentityField; virtual; + function ReadOnlyFieldsEnabled: boolean; virtual; + + { Open/Close } + procedure SetActive(Value: Boolean); override; + procedure BeforeOpenCursor(InfoQuery: boolean); virtual; + procedure OpenCursor(InfoQuery: boolean); override; + procedure AfterOpenCursor(InfoQuery: boolean); virtual; + procedure CloseCursor; override; + function OpenCursorAllowFailOver: boolean; virtual; + + function GetActualFieldName(FieldDesc: TFieldDesc): string; overload; + function GetActualFieldName(Field: TField): string; overload; + procedure GetCurrentKeys(out KeyFields: TFieldArray; out Values: variant); + procedure DataReopen; override; + procedure InternalRefresh; override; + procedure InternalRefreshQuick(const CheckDeleted: boolean); virtual; + procedure InternalExecute; virtual; + procedure InternalClose; override; + + function GetRecCount: longint; virtual; + procedure SetRefreshOptions(Value: TRefreshOptions); virtual; + procedure SetFetchAll(Value: boolean); virtual; + + procedure BeforeExecute; virtual; + { Edit } + function IsNeedEditPreconnect: boolean; virtual; + function IsNeedInsertPreconnect: boolean; virtual; + + procedure SetReadOnly(Value: boolean); virtual; + + function IsPreconnected : boolean; virtual; + procedure InternalBeforeEdit; virtual; + procedure InternalEdit; override; + procedure InternalInsert; override; + procedure InternalCancel; override; + procedure InternalPost; override; + procedure InternalDeferredPost; override; + procedure InternalApplyUpdates(AllowFailOver: boolean); + + procedure CreateSQLGenerator; virtual; + procedure FreeSQLGenerator; + procedure SetSQLGenerator(Value: TDASQLGenerator); + + function GetUpdateStatement(const StatementType: TStatementType): string; virtual; + + function GetUpdateSQLStatementTypes: TStatementTypes; virtual; + function GetUpdateSQLIndex(Index: integer): TStrings; + procedure SetUpdateSQLIndex(Index: integer; Value: TStrings); + + procedure SetFilterSQL(Value: string); virtual; //CR ODAC (8387) vs (8751) + procedure SetFiltered(Value: boolean); override; + + function PerformAppend: boolean; override; + function PerformDelete: boolean; override; + function PerformUpdate: boolean; override; + procedure InternalRefreshRecord; virtual; + + procedure CheckUpdateQuery(const StatementType: TStatementType); virtual; + procedure UpdateExecute(const StatementTypes: TStatementTypes); virtual; + procedure CheckUpdateSQL(const SQL: string; const StatementTypes: TStatementTypes; out ParamsInfo: TDAParamsInfo); virtual; + function UseParamType: boolean; virtual; //This function indicates ParamType using in PerformSQL + function FieldByParamName(var ParamName: string; var Old: boolean; var AFieldNo: integer): TField; virtual; + function PerformSQL(const SQL: string; const StatementTypes: TStatementTypes): boolean; virtual; + function RefreshAfterInsertAllowed: boolean; virtual; + + { RefreshQuick } + function IsRefreshQuickField(FieldDesc: TFieldDesc): boolean; virtual; + procedure SaveMaxRefreshQuickValue(FieldDesc: TFieldDesc; const Value: variant); virtual; + + function IsAutoCommit: boolean; virtual; + function ShouldPrepareUpdateSQL: boolean; virtual; + function GetCanModify: boolean; override; + + procedure SetStateFieldValue(State: TDataSetState; Field: TField; const Value: Variant); override; // Need to support int64 fields on PerformSQL in RefreshRecord + function CanRefreshField(Field: TField): boolean; virtual; + function NeedReturnParams: boolean; virtual; + procedure AssignFieldValue(Param: TDAParam; Field: TField; Old: boolean); overload; virtual; + procedure AssignFieldValue(Param: TDAParam; FieldDesc: TFieldDesc; Old: boolean); overload; virtual; + procedure GetIdentityField; virtual; + procedure GetKeyAndDataFields(out KeyAndDataFields: TKeyAndDataFields; + const ForceUseAllKeyFields: boolean); virtual; + procedure ClearCachedKeyAndDataFields; + + { Master/Detail } + procedure RefreshParams; + function NeedDetailRefresh(Param: TDAParam; FieldValue: TSharedObject): boolean; virtual; + procedure RefreshDetail(Sender: TObject); + function SetMasterParams(AParams: TDAParams): boolean; + function IsConnectedToMaster: boolean; + procedure RefreshDetailSQL; + function LocalDetailFilter(RecBuf: IntPtr): boolean; + + procedure AssembleSQL; + procedure ScanMacros(Sender: TObject = nil); virtual; + + procedure DefineProperties(Filer: TFiler); override; + + procedure AssignTo(Dest: TPersistent); override; + + procedure DoAfterExecute(Result: boolean); virtual; + procedure DoAfterExecFetch(Result: boolean); + procedure DoAfterFetchAll(Result: boolean); + procedure DoAfterScroll; override; + procedure DoOnBeforeFetch(out Cancel: boolean); virtual; + procedure DoOnAfterFetch; virtual; + procedure DoOnDataChanged; + procedure DoOnNewRecord; override; + + function GetDataSource: TDataSource; override; + function GetRecordCount: integer; override; + function GetIsQuery: boolean; virtual; + + { Before / After UpdateExecute } + function AssignedBeforeUpdateExecute: boolean; virtual; + procedure DoBeforeUpdateExecute(Sender: TDataSet; StatementTypes: TStatementTypes; + Params: TDAParams); virtual; + function AssignedAfterUpdateExecute: boolean; virtual; + procedure DoAfterUpdateExecute(Sender: TDataSet; StatementTypes: TStatementTypes; + Params: TDAParams); virtual; + + { KeySequence } + procedure InternalOpen; override; + + { SQL Modifications } + function SQLAddWhere(SQLText, Condition: string): string; virtual; + function SQLDeleteWhere(SQLText: string): string; virtual; + function SQLGetWhere(SQLText: string): string; virtual; + function SQLSetOrderBy(SQLText: string; Fields: string): string; virtual; + function SQLGetOrderBy(SQLText: string): string; virtual; + + function GetFinalSQL: string; virtual; + + { TablesInfo } + property TablesInfo: TCRTablesInfo read GetTablesInfo; + property IdentityField: TField read FIdentityField; + property UpdatingTableInfoIdx: integer read FUpdatingTableInfoIdx; + property UpdatingTable: string read FUpdatingTable write SetUpdatingTable; // Does not need for public use + + { XML } + procedure WriteFieldXMLAttributeType(Field: TField; FieldDesc: TFieldDesc; const FieldAlias: string; + XMLWriter: XMLTextWriter); override; + + property AutoCommit: boolean read FAutoCommit write SetAutoCommit default True; + + property UpdateObject: TCustomDAUpdateSQL read FUpdateObject write SetUpdateObject; + public + constructor Create(Owner: TComponent); override; + destructor Destroy; override; + + { Open/Close } + procedure Prepare; override; + procedure UnPrepare; override; + + procedure Execute; virtual; + function Executing: boolean; + function Fetching: boolean; + function FetchingAll: boolean; + function Fetched: boolean; virtual; + + procedure Resync(Mode: TResyncMode); override; + + procedure GetDetailLinkFields(MasterFields, DetailFields: {$IFDEF CLR}TObjectList{$ELSE}TList{$ENDIF}); override; + + {for BDE compatibility} + function FindKey(const KeyValues: array of const): Boolean; + procedure FindNearest(const KeyValues: array of const); + procedure GotoCurrent(DataSet: TCustomDADataSet); + + function CreateBlobStream(Field: TField; Mode: TBlobStreamMode): TStream; override; + + { Edit } + procedure ApplyUpdates; override; + + property SQLInsert: TStrings index stInsert read GetUpdateSQLIndex write SetUpdateSQLIndex; + property SQLDelete: TStrings index stDelete read GetUpdateSQLIndex write SetUpdateSQLIndex; + property SQLUpdate: TStrings index stUpdate read GetUpdateSQLIndex write SetUpdateSQLIndex; + property SQLRefresh: TStrings index stRefresh read GetUpdateSQLIndex write SetUpdateSQLIndex; + + procedure RefreshRecord; + //procedure Lock; + //procedure Unlock; + + function FindParam(const Value: string): TDAParam; + function ParamByName(const Value: string): TDAParam; + + function FindMacro(const Value: string): TMacro; + function MacroByName(const Value: string): TMacro; + + { SQL Modifications } + procedure SaveSQL; + procedure RestoreSQL; + function SQLSaved: boolean; + + procedure AddWhere(Condition: string); + procedure DeleteWhere; + procedure SetOrderBy(Fields: string); + function GetOrderBy: string; + + { Additional data types } + function GetField(FieldDesc: TFieldDesc): TField; + function GetDataType(const FieldName: string): integer; virtual; + function GetFieldDesc(const FieldName: string): TFieldDesc; overload; + function GetFieldDesc(const FieldNo: integer): TFieldDesc; overload; virtual; + function GetFieldPrecision(const FieldName: string): integer; + function GetFieldScale(const FieldName: string): integer; + function GetFieldObject(const FieldName: string): TSharedObject; overload; + + property Connection: TCustomDAConnection read FConnection write SetConnection; + property ParamCheck: boolean read GetParamCheck write SetParamCheck default True; // before SQL + property SQL: TStrings read GetSQL write SetSQL; + property FetchRows: integer read FFetchRows write SetFetchRows default 25; + property FetchAll: boolean read FFetchAll write SetFetchAll default False; + property Debug: boolean read FDebug write FDebug default False; + property MasterSource: TDataSource read GetDataSource write SetMasterSource; + property Params: TDAParams read GetParams write SetParams stored False; + property ParamCount: word read GetParamCount; + property Macros: TMacros read GetMacros write SetMacros stored False; + property MacroCount: word read GetMacroCount; + property UniDirectional: boolean read FUniDirectional write SetUniDirectional default False; + property ReadOnly: boolean read FReadOnly write SetReadOnly default False; + property RowsAffected: integer read GetRowsAffected; + property IsQuery: boolean read GetIsQuery; + property RefreshOptions: TRefreshOptions read FRefreshOptions write SetRefreshOptions default []; + property Options: TDADataSetOptions read FOptions write SetOptions; + property BaseSQL: string read GetBaseSQL; + property FinalSQL: string read GetFinalSQL; + property FilterSQL: string read FFilterSQL write SetFilterSQL; + property MasterFields: string read FMasterFields write SetMasterFields; + property DetailFields: string read FDetailFields write SetForeignKeyFields; // ForeignKeyFields + + property AfterExecute: TAfterExecuteEvent read FAfterExecute write FAfterExecute; + property BeforeUpdateExecute: TUpdateExecuteEvent read FBeforeUpdateExecute write FBeforeUpdateExecute; + property AfterUpdateExecute: TUpdateExecuteEvent read FAfterUpdateExecute write FAfterUpdateExecute; + property BeforeFetch: TBeforeFetchEvent read FBeforeFetch write FBeforeFetch; + property AfterFetch: TAfterFetchEvent read FAfterFetch write FAfterFetch; + end; + +{ TCustomDASQL } + + TCustomDASQL = class (TComponent) + private + FConnection: TCustomDAConnection; + FSQL: TStrings; + FParams: TDAParams; + FParamCheck: boolean; + FMacros: TMacros; + FDebug: boolean; + FChangeCursor: boolean; + + FAfterExecute: TAfterExecuteEvent; + {FOnDisconnect: TNotifyEvent; + FGetFinalSQL: TGetFinalSQLEvent; + FOnScanMacros: TNotifyEvent;} + + procedure SetSQL(Value: TStrings); + function GetPrepared: boolean; + procedure SetPrepared(Value: boolean); + procedure SetParams(Value: TDAParams); + function GetParamCount: word; + procedure SetParamCheck(Value: boolean); + function GetParamValues(ParamName: string): variant; + procedure SetParamValues(ParamName: string; Value: variant); + procedure SetMacros(Value: TMacros); + function GetMacroCount: word; + function GetRowsAffected: integer; + + protected + FAutoCommit: boolean; + FICommand: TCRCommand; + FDataSet: TCustomDADataSet; // dataset that owns + FDesignCreate: boolean; // for design-time only + FNonBlocking: boolean; + FLockDebug, FLockAssembleSQL, FLockMacros: boolean; // locking trans debug info + FNativeSQL: string; + + procedure CreateICommand; virtual; + procedure FreeICommand; + procedure SetICommand(Value: TCRCommand); virtual; + procedure CheckICommand; + + function CreateParamsObject: TDAParams; virtual; + + procedure Loaded; override; + + procedure SetAutoCommit(Value: boolean); + procedure SetConnection(Value: TCustomDAConnection); + function UsedConnection: TCustomDAConnection; virtual; + procedure CheckConnection; virtual; + procedure BeginConnection(NoConnectCheck: boolean = True); virtual; + procedure EndConnection; virtual; + procedure Disconnect; virtual; + procedure ConnectChange(Sender: TObject; Connecting: boolean); virtual; + + procedure InternalPrepare; virtual; + procedure InternalUnPrepare; virtual; + procedure InternalExecute(Iters: integer); virtual; + + procedure DoAfterExecute(Result: boolean); + + /// Parse SQL and replace ':ParamName' by '?' + /// Params may be nil + function ParseSQL(const SQL: string; Params: TDAParams; RenamePrefix: string = ''): string; overload; virtual; + function ParseSQL(Params: TDAParams): string; overload; + procedure ParseSQLParam(ParsedSQL: StringBuilder; Parser: TParser; Params: TDAParams; const LeftQuote, RightQuote: char; RenamePrefix: string); virtual; + function CreateParser(const Text: string): TParser; virtual; + + procedure SQLChanged(Sender: TObject); virtual; + procedure ScanMacros; virtual; + function GetFinalSQL: string; virtual; + procedure AssembleSQL; virtual; + + procedure CreateParams; virtual; + procedure WriteParams(WriteValue: boolean = True); virtual; + procedure ReadParams; virtual; + + procedure DefineProperties(Filer: TFiler); override; + procedure ReadParamData(Reader: TReader); + procedure WriteParamData(Writer: TWriter); + procedure ReadMacroData(Reader: TReader); + procedure WriteMacroData(Writer: TWriter); + + procedure AssignTo(Dest: TPersistent); override; + + property AutoCommit: boolean read FAutoCommit write SetAutoCommit default False; + + public + constructor Create(Owner: TComponent); override; + destructor Destroy; override; + + procedure Prepare; virtual; + procedure UnPrepare; virtual; + + procedure Execute; overload; virtual; + procedure Execute(Iters: integer); overload; virtual; + + function Executing: boolean; + function WaitExecuting(TimeOut: integer = 0): boolean; + + function FindParam(const Value: string): TDAParam; + function ParamByName(const Value: string): TDAParam; + + function FindMacro(const Value: string): TMacro; + function MacroByName(const Value: string): TMacro; + + property Connection: TCustomDAConnection read FConnection write SetConnection; + property ParamCheck: boolean read FParamCheck write SetParamCheck default True; // before SQL + property SQL: TStrings read FSQL write SetSQL; + property Prepared: boolean read GetPrepared write SetPrepared; + property Params: TDAParams read FParams write SetParams stored False; + property ParamCount: word read GetParamCount; + property ParamValues[ParamName: string]: variant read GetParamValues write SetParamValues; default; + property Macros: TMacros read FMacros write SetMacros stored False; + property MacroCount: word read GetMacroCount; + property Debug: boolean read FDebug write FDebug default False; + property ChangeCursor: boolean read FChangeCursor write FChangeCursor; + property RowsAffected: integer read GetRowsAffected; + property FinalSQL: string read GetFinalSQL; + + property AfterExecute: TAfterExecuteEvent read FAfterExecute write FAfterExecute; + end; + +{ TCustomDAUpdateSQL } + + TCustomDAUpdateSQL = class (TComponent) + private + FDataSet: TCustomDADataSet; + FSQLText: array [TStatementType] of TStrings; + + FUpdateObject: array [TStatementType] of TComponent; + + protected + FDesignCreate: boolean; // for design-time only + + // get/set FSQLText by TStatementType + function GetSQLIndex(Index: integer): TStrings; + procedure SetSQLIndex(Index: integer; Value: TStrings); + + // get/set FSQLText by TUpdateKind + function GetSQL(UpdateKind: TUpdateKind): TStrings; virtual; + procedure SetSQL(UpdateKind: TUpdateKind; Value: TStrings); + + // get/set FUpdateObject by TStatementType + function GetObjectIndex(Index: integer): TComponent; + procedure SetObjectIndex(Index: integer; Value: TComponent); + + function GetDataSet: TCustomDADataSet; virtual; + procedure SetDataSet(DataSet: TCustomDADataSet); virtual; + procedure Loaded; override; + procedure AssignTo(Dest: TPersistent); override; + + function DataSetClass: TCustomDADataSetClass; virtual; + function SQLClass: TCustomDASQLClass; virtual; + procedure CheckUpdateComponent(Component: TComponent); overload; + procedure CheckUpdateComponent(Component: TComponent; NewDataset: TCustomDADataset); overload; + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + public + constructor Create(Owner: TComponent); override; + destructor Destroy; override; + procedure Apply(UpdateKind: TUpdateKind); virtual; + procedure ExecSQL(UpdateKind: TUpdateKind); + property DataSet: TCustomDADataSet read GetDataSet write SetDataSet; + property SQL[UpdateKind: TUpdateKind]: TStrings read GetSQL write SetSQL; + + published + property InsertSQL: TStrings index stInsert read GetSQLIndex write SetSQLIndex; + property DeleteSQL: TStrings index stDelete read GetSQLIndex write SetSQLIndex; + property ModifySQL: TStrings index stUpdate read GetSQLIndex write SetSQLIndex; + property RefreshSQL: TStrings index stRefresh read GetSQLIndex write SetSQLIndex; + + property InsertObject: TComponent index stInsert read GetObjectIndex write SetObjectIndex; + property DeleteObject: TComponent index stDelete read GetObjectIndex write SetObjectIndex; + property ModifyObject: TComponent index stUpdate read GetObjectIndex write SetObjectIndex; + property RefreshObject: TComponent index stRefresh read GetObjectIndex write SetObjectIndex; + end; + +{ TMacro } + + TMacro = class (TCollectionItem) + private + FName: string; + FValue: string; + FActive: boolean; + //FOwner: TComponent; + + procedure SetValue(Value: string); + procedure SetActive(Value: boolean); + + function GetAsDateTime: TDateTime; + procedure SetAsDateTime(Value: TDateTime); + function GetAsFloat: double; + procedure SetAsFloat(Value: double); + function GetAsInteger: integer; + procedure SetAsInteger(Value: integer); + function GetAsString: string; + procedure SetAsString(Value: string); + + protected + procedure AssignTo(Dest: TPersistent); override; + + function IsEqual(Value: TMacro): boolean; + + function GetDisplayName: string; override; + + public + constructor Create(Collection: TCollection); override; + + property AsDateTime: TDateTime read GetAsDateTime write SetAsDateTime; + property AsFloat: double read GetAsFloat write SetAsFloat; + property AsInteger: integer read GetAsInteger write SetAsInteger; + property AsString: string read GetAsString write SetAsString; + + published + property Name: string read FName write FName; + property Value: string read FValue write SetValue; + property Active: boolean read FActive write SetActive default True; + end; + +{ TMacros } + + TMacros = class (TCollection) + private + FOwner: TPersistent; + + procedure ReadBinaryData(Stream: TStream); + //procedure WriteBinaryData(Stream: TStream); + + function GetItem(Index: integer): TMacro; + procedure SetItem(Index: integer; Value: TMacro); + function GetUpdateCount: integer; + + protected + FParserClass: TParserClass; + + procedure AssignTo(Dest: TPersistent); override; + + procedure DefineProperties(Filer: TFiler); override; + + function GetOwner: TPersistent; override; + procedure Update(Item: TCollectionItem); override; + + function GetMacroValue(Macro: TMacro): string; virtual; + + property UpdateCount: integer read GetUpdateCount; + + public + constructor Create(Owner: TPersistent); + + procedure Scan(SQL: string); // ParseSQL + procedure AssignValues(Value: TMacros); + function IsEqual(Value: TMacros): boolean; + + function FindMacro(const Value: string): TMacro; + function MacroByName(const Value: string): TMacro; + + procedure Expand(var SQL: string); + + procedure SetParserClass(Value: TParserClass); + + property Items[Index: integer]: TMacro read GetItem write SetItem; default; + end; + +{ TCustomConnectDialog } + + TLabelSet = (lsCustom, lsEnglish, lsFrench, lsGerman, lsItalian, lsPolish, + lsPortuguese, lsRussian, lsSpanish); + + TCustomConnectDialog = class(TComponent) + private + FConnection: TCustomDAConnection; + FRetries: word; + FDialogClass: string; + FSavePassword: boolean; + FStoreLogInfo: boolean; + + FLabelSet: TLabelSet; + FCaption: string; + FUsernameLabel: string; + FPasswordLabel: string; + FServerLabel: string; + FConnectButton: string; + FCancelButton: string; + + procedure SetCaption(Value: string); + procedure SetUsernameLabel(Value: string); + procedure SetPasswordLabel(Value: string); + procedure SetServerLabel(Value: string); + procedure SetConnectButton(Value: string); + procedure SetCancelButton(Value: string); + + protected + {$IFDEF WIN32} + function GetString(Id: integer): string; + {$ENDIF} + procedure SetLabelSet(Value: TLabelSet); virtual; + + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + + function DefDialogClass: TClass; virtual; + function GetKeyPath: string; virtual; + function GetServerStoreName: string; virtual; + {$IFDEF MSWINDOWS} + procedure SaveInfoToRegistry(Registry: TRegistry); virtual; + procedure LoadInfoFromRegistry(Registry: TRegistry); virtual; + {$ENDIF} + //class function AcceptBlankPassword: boolean; virtual; + + public + constructor Create(Owner: TComponent); override; + + function Execute: boolean; virtual; + + procedure GetServerList(List: TStrings); virtual; + + property Connection: TCustomDAConnection read FConnection; + + property Retries: word read FRetries write FRetries default 3; + property SavePassword: boolean read FSavePassword write FSavePassword default False; + property StoreLogInfo: boolean read FStoreLogInfo write FStoreLogInfo default True; + + property DialogClass: string read FDialogClass write FDialogClass; + + property Caption: string read FCaption write SetCaption; + property UsernameLabel: string read FUsernameLabel write SetUsernameLabel; + property PasswordLabel: string read FPasswordLabel write SetPasswordLabel; + property ServerLabel: string read FServerLabel write SetServerLabel; + property ConnectButton: string read FConnectButton write SetConnectButton; + property CancelButton: string read FCancelButton write SetCancelButton; + + property LabelSet: TLabelSet read FLabelSet write SetLabelSet default lsEnglish; + end; + + TTableInfo = record + Name: string; + Alias: string; + end; + TTablesInfo = array of TTableInfo; + +{$IFDEF MSWINDOWS} + +{ TCRNetManager } + + TCRServiceStatus = (ssStopped, ssStartPending, ssStopPending, ssRunning, ssContinuePending, ssPausePending, ssPaused); // equal to TCurrentStatus from SvcMgr + + TCRServiceInfo = record + ServiceName, DisplayName: string; + Status: TCRServiceStatus; + end; + + TCRServicesInfo = array of TCRServiceInfo; + TCRServiceNamesThread = class; + TCRServicesThread = class(TThread) + private + FList: TStrings; + FKeywords: string; + protected + property Terminated; + procedure Execute; override; + public + constructor Create(List: TStrings; const Keywords: string); + end; + + TCRServiceNamesThread = class(TThread) + protected + FKeywords: string; + FServices: TCRServicesThread; + FServer: string; + FServiceNames: TCRServicesInfo; + procedure Execute; override; + public + constructor Create(const Server: string; Services: TCRServicesThread; const Keywords: string); + end; + + SC_HANDLE = THandle; + + TCRNetManager = class + protected + FServicesCS: TCriticalSection; + FCachedServerList: TStringList; + FLastTickCount: LongWord; + + class procedure ServiceManagerOpen(const Server: string; const ReadOnly: boolean; out sch: SC_HANDLE); + class procedure ServiceManagerClose(const sch: SC_HANDLE); + class procedure ServiceOpen(const Server: string; const ServiceName: string; const ReadOnly: boolean; out sch: SC_HANDLE; out sh: SC_HANDLE); + class procedure ServiceClose(const sch: SC_HANDLE; const sh: SC_HANDLE); + + procedure ClearCachedServerList; + procedure AddToCachedServerList(const Keywords: string; const Server: string); + public + constructor Create; + destructor Destroy; override; + + // Service Control + class function GetServiceNames(const Server: string): TCRServicesInfo; + class function GetServiceStatus(const Server: string; const ServiceName: string): TCRServiceStatus; + class procedure ServiceStart(const Server: string; const ServiceName: string; ParamStr: string = ''); + class procedure ServiceStop(const Server: string; const ServiceName: string); + + // Net control + class procedure GetServerList(List: TStrings); overload; + procedure GetServerList(List: TStrings; const Keywords: string; const Timeout: Longword = 1; const CacheTimeout: Longword = 120); overload; + end; + +var + CRNetManager: TCRNetManager; + +type +{$ENDIF} + + TDADataSetUtils = class + protected + FCount: integer; + FDataSet: TCustomDADataSet; + + FOldActive: boolean; + FOldDebug: boolean; + FOldFetchAll: boolean; + FOldFetchRows: integer; + + public + procedure QuickOpen(DataSet: TCustomDADataSet; Refresh: boolean = False); virtual; + procedure Restore(RestoreActive: boolean = True); virtual; + procedure QuickOpenAndRestore(DataSet: TCustomDADataSet; Refresh: boolean = False); + end; + +{ TCRDataSource } + + TCRDataSource = class (TDataSource) + protected + FDesignCreate: boolean; + + procedure Loaded; override; + procedure AssignTo(Dest: TPersistent); override; + + public + constructor Create(Owner: TComponent); override; + end; + + TDBAccessUtils = class + public + class function IsKeyViolation(Obj: TCustomDAConnection; E: EDAError): boolean; + class function IsObjectDataType(Obj: TDAParam; DataType: TFieldType): boolean; + + class procedure CheckConnection(Obj: TCustomDADataSet); overload; + class procedure CheckConnection(Obj: TCustomDASQL); overload; + class function UsedConnection(Obj: TCustomDADataSet): TCustomDAConnection; overload; + class function UsedConnection(Obj: TCustomDASQL): TCustomDAConnection; overload; + class procedure SetAutoCommit(Obj: TComponent; Value: boolean); + class function GetAutoCommit(Obj: TComponent): boolean; + class procedure SetDesignCreate(Obj: TCustomDADataSet; Value: boolean); overload; + class function GetDesignCreate(Obj: TCustomDADataSet): boolean; overload; + class procedure SetDesignCreate(Obj: TCustomDASQL; Value: boolean); overload; + class function GetDesignCreate(Obj: TCustomDASQL): boolean; overload; + class procedure SetDesignCreate(Obj: TCustomDAUpdateSQL; Value: boolean); overload; + class function GetDesignCreate(Obj: TCustomDAUpdateSQL): boolean; overload; + class procedure SetDesignCreate(Obj: TCRDataSource; Value: boolean); overload; + class function GetDesignCreate(Obj: TCRDataSource): boolean; overload; + class function CreateIRecordSet(Obj: TCustomDAConnection): TCRRecordSet; + class function GetIConnection(Obj: TCustomDAConnection): TCRConnection; + class function GetUpdateQuery(Obj: TCustomDADataSet): TComponent; + class function GetTablesInfo(Obj: TCustomDADataSet): TCRTablesInfo; + class function GetUpdatingTable(Obj: TCustomDADataSet): string; + class procedure SetUpdatingTable(Obj: TCustomDADataSet; Value: string); + class function GetUpdatingTableIdx(Obj: TCustomDADataSet): integer; + class procedure SetUpdatingTableIdx(Obj: TCustomDADataSet; Value: integer); + class procedure InternalConnect(Obj: TCustomDAConnection); + class procedure InternalDisconnect(Obj: TCustomDAConnection); + class procedure SuppressAutoCommit(Obj: TCustomDAConnection); + class procedure RestoreAutoCommit(Obj: TCustomDAConnection); + + class procedure Disconnect(Obj: TCustomDASQL); + + class function SQLGenerator(Obj: TCustomDADataSet): TDASQLGenerator; + class function GetSQLs(Obj: TCustomDAConnection): TDAList; + + class procedure GetKeyAndDataFields( + Obj: TCustomDADataSet; + out KeyAndDataFields: TKeyAndDataFields; + const ForceUseAllKeyFields: boolean); + + class function GetLockDebug(Obj: TComponent): boolean; + class procedure SetLockDebug(Obj: TComponent; Value: boolean); + class function FOwner(Obj: TDAConnectionOptions): TCustomDAConnection; overload; + class function FOwner(Obj: TDADataSetOptions): TCustomDADataSet; overload; + class function SQLMonitorClass(Obj: TCustomDAConnection): TClass; + + class function QuoteName(Obj: TCustomDADataSet; const AName: string): string; + class function UnQuoteName(Obj: TCustomDADataSet; AName: string): string; + + class procedure RegisterClient(Obj: TCustomDAConnection; Client: TObject; Event: TConnectChangeEvent = nil); + class procedure UnRegisterClient(Obj: TCustomDAConnection; Client: TObject); + + class function GetIdentityField(Obj: TCustomDADataSet): TField; + + class function GetSQL(Obj: TComponent): TStrings; + class procedure SetSQL(Obj: TComponent; Value: TStrings); + class procedure SetSQLText(Obj: TComponent; const SQLText: string; const LockAssembleSQL, LockMacros: boolean; const DisableScanParams: boolean = True); + + class function GetParams(Obj: TComponent): TDAParams; + class procedure Execute(Obj: TComponent); + class procedure Open(Obj: TComponent); + class function GetRowsAffected(Obj: TComponent): integer; + class function GetUpdateSQLStatementTypes(Obj: TCustomDADataSet): TStatementTypes; + class function GetUpdateSQLIndex(Obj: TCustomDADataSet; StatementType: TStatementType): TStrings; + class function ParseSQL(Obj: TCustomDASQL; const SQL: string; Params: TDAParams; RenamePrefix: string = ''): string; + class function CreateParamsObject(Obj: TCustomDASQL): TDAParams; + + class procedure SetDesigning(Obj: TComponent; Value: Boolean; SetChildren: Boolean = True); + class function GetIRecordSet(Obj: TCustomDADataSet): TCRRecordSet; + + class function GetDataSetClass(Obj: TCustomDAUpdateSQL): TCustomDADataSetClass; + class function GetSQLClass(Obj: TCustomDAUpdateSQL): TCustomDASQLClass; + + class function GetParserClass(Obj: TMacros): TParserClass; + end; + +const + crSQLArrow = -30; + + procedure SetCursor(Value: integer); + +var + ChangeCursor: boolean; + MacroChar: char; + SetCursorProc: procedure(Value: integer); + ShowConnectFormProc: function(ConnectDialog: TCustomConnectDialog): boolean; + BaseSQLOldBehavior: boolean; + SQLGeneratorCompatibility: boolean; + + function _AddWhere( + const SQL: string; Condition: string; + ParserClass: TParserClass; // TOraParser, TMSparser, TMyParser + OmitComment: boolean; + SelectCode, WhereCode: integer + ): string; + function _SetWhere( + const SQL: string; Condition: string; + ParserClass: TParserClass; // TOraParser, TMSparser, TMyParser + OmitComment: boolean; + SelectCode, WhereCode: integer + ): string; + function _GetWhere( + const SQL: string; + ParserClass: TParserClass; // TOraParser, TMSparser, TMyParser + OmitComment: boolean; + SelectCode, WhereCode: integer + ): string; + function _SetOrderBy( + const SQL: string; Fields: string; + ParserClass: TParserClass; // TOraParser, TMSparser, TMyParser + SelectCode, OrderCode, ByCode: Integer + ): string; + function _GetOrderBy( + const SQL: string; + ParserClass: TParserClass; // TOraParser, TMSparser, TMyParser + SelectCode, OrderCode, ByCode: Integer + ): string; + + + function UpdateKindToStatementType(const UpdateKind: TUpdateKind): TStatementType; + function StatementTypeToUpdateKind(const StatementType: TStatementType): TUpdateKind; + +implementation +uses +{$IFDEF PERF_COUNTER} + Debug, +{$ENDIF} +{$IFDEF CLR} + System.Security, +{$ENDIF} +{$IFNDEF LINUX} + Messages, +{$ENDIF} + DBCommon, DBConsts, DAConsts, DASQLMonitor, CRConnectionPool; + +{$IFDEF WIN32} +{$R *.res} +{$ENDIF} + +procedure SetCursor(Value: integer); +begin + if Assigned(SetCursorProc) then + SetCursorProc(Value); +end; + +function _AddWhere( + const SQL: string; Condition: string; + ParserClass: TParserClass; // TOraParser, TMSparser, TMyParser + OmitComment: boolean; + SelectCode, WhereCode: integer +): string; +var + Parser: TParser; + IsWhere: boolean; + Code: integer; + PrevCode: integer; + St: string; + StLex: string; + BracketCount: integer; + WherePos: integer; + NeedBracket: boolean; + Bracket: string; + IsMacro: boolean; + MacroSt: string; + +begin + Result := SQL; + + if Trim(Condition) = '' then + Exit; + + Parser := ParserClass.Create(PChar(SQL)); + Parser.OmitComment := OmitComment; + WherePos := 0; + IsMacro := False; + MacroSt := MacroChar; + + try + if Parser.ToLexem(SelectCode) <> lcEnd then begin + IsWhere := False; + NeedBracket := False; + Code := 0; + BracketCount := 0; + repeat + PrevCode := Code; + Code := Parser.GetNext(StLex); //+++ char instead of string + if (Code = WhereCode) and (not IsMacro) and (BracketCount = 0) then begin + IsWhere := True; + WherePos := Parser.CurrPos + 2; + NeedBracket := True; + end + else + if Code = lcSymbol then + if StLex = '(' then + Inc(BracketCount) + else + if StLex = ')' then + Dec(BracketCount); + + IsMacro := (Code <> lcString) and (StLex = MacroSt); + if (BracketCount = 0) and Parser.IsClauseLexem(Code) and (Code <> WhereCode) then + Break; + until Code = lcEnd; + + if NeedBracket then begin + if PrevCode = lcComment then + Bracket := LineSeparator + ')' + else + Bracket := ')'; + end; + + if not IsWhere then + St := LineSeparator + 'WHERE ' + Condition + ' ' + else + if (PrevCode = lcComment) and not NeedBracket then + St := LineSeparator +'AND ' + Condition + ' ' + else + St := ' AND ' + Condition + ' '; + + if Code = lcEnd then begin + if NeedBracket then begin + Insert('(', Result, WherePos); + Result := Trim(Result) + Bracket + St; + end + else + if not Parser.IsSemicolon(PrevCode) then + Result := Trim(Result) + St + else + Insert(St, Result, Parser.PrevPos); + end + else + if NeedBracket then begin + Insert(Bracket + St, Result, Parser.PrevPos + 1); + Insert('(', Result, WherePos); + end + else + Insert(St, Result, Parser.PrevPos + 1); + end; + finally + Parser.Free; + end; +end; + +//++ Must be merged with _AddWhere +function _SetWhere( + const SQL: string; Condition: string; + ParserClass: TParserClass; // TOraParser, TMSparser, TMyParser + OmitComment: boolean; + SelectCode, WhereCode: integer +): string; +var + Parser: TParser; + FirstPos: integer; + LastPos: integer; + Code: integer; + StLex: string; + BracketCount: integer; +begin + Result := SQL; + Parser := ParserClass.Create(PChar(SQL)); + Parser.OmitBlank := False; + Parser.OmitComment := True; + try + if Parser.ToLexem(SelectCode) <> lcEnd then begin + FirstPos := 0; + LastPos := 0; + BracketCount := 0; + Code := Parser.GetNext(StLex); //+++ char instead of string + repeat + if Code = lcBlank then begin + if LastPos = 0 then + LastPos := Parser.PrevPos; + end + else begin + LastPos := 0; + + if Code = WhereCode then begin + if BracketCount = 0 then begin + if Condition = '' then + FirstPos := Parser.PrevPrevPos + 1 + else begin + Parser.GetNext(StLex); // blank + FirstPos := Parser.CurrPos + 1; + end; + end; + end + else + if Code = lcSymbol then begin + if StLex = '(' then + Inc(BracketCount) + else + if StLex = ')' then + Dec(BracketCount); + end; + end; + + Code := Parser.GetNext(StLex); + until (Code = lcEnd) or (Parser.IsClauseLexem(Code) and (Code <> WhereCode)) and (BracketCount = 0); + + if LastPos = 0 then + LastPos := Length(Result); + + if FirstPos > 0 then + Delete(Result, FirstPos, LastPos - FirstPos + 1); + + if Condition <> '' then begin + if FirstPos = 0 then begin + FirstPos := LastPos + 1; + Condition := ' WHERE ' + Condition; + if Pos(#13, Copy(Result, 1, FirstPos)) > 0 then + Condition := LineSeparator + ' ' + Condition; + end; + Insert(Condition, Result, FirstPos); + end; + end; + finally + Parser.Free; + end; +end; + +function _GetWhere( + const SQL: string; + ParserClass: TParserClass; // TOraParser, TMSparser, TMyParser + OmitComment: boolean; + SelectCode, WhereCode: integer + ): string; +var + Parser: TParser; + IsWhere: boolean; + Code: integer; + StLex: string; + BracketCount: integer; + WherePos: integer; + IsMacro: boolean; + MacroSt: string; +begin + Result := ''; + Parser := ParserClass.Create(PChar(SQL)); + Parser.OmitComment := OmitComment; + WherePos := 0; + IsMacro := False; + MacroSt := MacroChar; + try + if Parser.ToLexem(SelectCode) <> lcEnd then begin + IsWhere := False; + BracketCount := 0; + repeat + Code := Parser.GetNext(StLex); //+++ char instead of string + if (Code = WhereCode) and (not IsMacro) and (BracketCount = 0) then begin + IsWhere := True; + WherePos := Parser.CurrPos + 2; + end + else + if Code = lcSymbol then + if StLex = '(' then + Inc(BracketCount) + else + if StLex = ')' then + Dec(BracketCount); + + IsMacro := (Code <> lcString) and (StLex = MacroSt); + if (BracketCount = 0) and Parser.IsClauseLexem(Code) and (Code <> WhereCode) then begin + Parser.Back; + Break; + end; + until Code = lcEnd; + + if IsWhere then + Result := Copy(SQL, WherePos, Parser.CurrPos - WherePos + 1); + end; + finally + Parser.Free; + end; +end; + +function _SetOrderBy( + const SQL: string; Fields: string; + ParserClass: TParserClass; + SelectCode, OrderCode, ByCode: Integer + ): string; +var + Parser: TParser; + FirstPos: integer; + LastPos: integer; + Code: integer; + i, p, pOrder: integer; +begin + for i := 1 to Length(Fields) do + if Fields[i] = ';' then + Fields[i] := ','; + + Result := SQL; + Parser := ParserClass.Create(PChar(Result)); + Parser.OmitBlank := False; + Parser.OmitComment := True; + try + if Parser.ToLexem(SelectCode) <> lcEnd then begin + FirstPos := 0; + LastPos := 0; + Code := Parser.GetNextCode; + pOrder := Parser.PosClauseLexem(OrderCode); + repeat + if Code = OrderCode then begin + if Fields = '' then + FirstPos := Parser.PrevPrevPos + 1; + Parser.GetNextCode; // blank + if Parser.GetNextCode = ByCode then begin + if Fields <> '' then begin + Parser.GetNextCode; // blank + FirstPos := Parser.CurrPos + 1; + end; + end + else + FirstPos := 0; + end; + + if (Code = lcBlank) or (Code = lcComment) then begin + if LastPos = 0 then + LastPos := Parser.PrevPos; + end + else + LastPos := 0; + + Code := Parser.GetNextCode; + p := Parser.PosClauseLexem(Code); + if p > pOrder then + Break; + until (Code = lcEnd); + + if LastPos = 0 then + LastPos := Length(Result); + + if FirstPos > 0 then + Delete(Result, FirstPos, LastPos - FirstPos + 1); + + if Fields <> '' then begin + if FirstPos = 0 then begin + FirstPos := LastPos + 1; + Fields := ' ORDER BY ' + Fields; + if Pos(#13, Copy(Result, 1, FirstPos)) > 0 then + Fields := LineSeparator + ' ' + Fields; + end; + Insert(Fields, Result, FirstPos); + end; + end; + finally + Parser.Free; + end; +end; + +function _GetOrderBy( + const SQL: string; + ParserClass: TParserClass; + SelectCode, OrderCode, ByCode: Integer +): string; +var + Parser: TParser; + FirstPos: integer; + LastPos: integer; + Code: integer; +begin + Result := ''; + Parser := ParserClass.Create(PChar(SQL)); + try + FirstPos := 0; + LastPos := Length(SQL); + if Parser.ToLexem(SelectCode) <> lcEnd then begin + if Parser.ToLexem(OrderCode) <> lcEnd then + if Parser.GetNextCode = ByCode then + FirstPos := Parser.CurrPos + 1 + else + FirstPos := 0; + + if FirstPos <> 0 then begin + Result := Copy(SQL, FirstPos, LastPos - FirstPos + 1); + + Parser.SetText(Result); + repeat + Code := Parser.GetNextCode; + if Parser.IsClauseLexem(Code) then + Result := Copy(Result, 0, Parser.PrevPos); + until Code = lcEnd; + end; + end; + finally + Parser.Free; + end; +end; + +function UpdateKindToStatementType(const UpdateKind: TUpdateKind): TStatementType; +begin + case UpdateKind of + DB.ukModify: + Result := stUpdate; + DB.ukInsert: + Result := stInsert; + DB.ukDelete: + Result := stDelete; + else + begin + Result := stCustom; // To prevent compiler warning + Assert(False); + end; + end; +end; + +function StatementTypeToUpdateKind(const StatementType: TStatementType): TUpdateKind; +begin + case StatementType of + stUpdate: + Result := DB.ukModify; + stInsert: + Result := DB.ukInsert; + stDelete: + Result := DB.ukDelete; + else + begin + Result := DB.ukInsert; // To prevent compiler warning + Assert(False); + end; + end; +end; +{ EDAError } + +constructor EDAError.Create(ErrorCode: integer; Msg: string); +begin + inherited Create(Msg); + + FErrorCode := ErrorCode; +end; + +{ TDAConnectionOptions } + +constructor TDAConnectionOptions.Create(Owner: TCustomDAConnection); +begin + inherited Create; + + FOwner := Owner; + KeepDesignConnected := True; +end; + +procedure TDAConnectionOptions.AssignTo(Dest: TPersistent); +begin + if Dest is TDAConnectionOptions then begin + TDAConnectionOptions(Dest).KeepDesignConnected := KeepDesignConnected; + TDAConnectionOptions(Dest).DisconnectedMode := DisconnectedMode; + end + else + inherited; +end; + +procedure TDAConnectionOptions.SetDisconnectedMode(Value: boolean); +begin + if Value <> DisconnectedMode then begin + FOwner.Disconnect; + FDisconnectedMode := Value; + if FOwner.FIConnection <> nil then + FOwner.FIConnection.SetProp(prDisconnectedMode, Value); + end; +end; + +{ TPoolingOptions } + +constructor TPoolingOptions.Create(Owner: TCustomDAConnection); +begin + inherited Create; + + FOwner := Owner; + FMaxPoolSize := 100; +end; + +procedure TPoolingOptions.AssignTo(Dest: TPersistent); +begin + if Dest is TPoolingOptions then begin + TPoolingOptions(Dest).FMaxPoolSize := FMaxPoolSize; + TPoolingOptions(Dest).FMinPoolSize := FMinPoolSize; + TPoolingOptions(Dest).FConnectionLifetime := FConnectionLifetime; + TPoolingOptions(Dest).FValidate := FValidate; + end + else + inherited; +end; + +{ TCustomDAConnection } + +constructor TCustomDAConnection.Create(Owner: TComponent); +begin + inherited Create(Owner); + + FSQLs := TDAList.Create; + FAutoCommit := True; + LoginPrompt := True; + + FOptions := CreateOptions; + FPoolingOptions := CreatePoolingOptions; + FShouldShowPrompt := True; + + hRegisterClient := TCriticalSection.Create; +end; + +destructor TCustomDAConnection.Destroy; +begin + try + Disconnect; + finally + ClearRefs; + + inherited; + + FSQLs.Free; // placed after inherited for successful UnregisterClient on destroy + FreeIConnection; + FPoolingOptions.Free; + FOptions.Free; + hRegisterClient.Free; + end; +end; + +procedure TCustomDAConnection.Notification(AComponent: TComponent; + Operation: TOperation); +begin + inherited; + + if (Operation = opRemove) and (FConnectDialog = AComponent) then + FConnectDialog := nil; +end; + +function TCustomDAConnection.GetIConnectionClass: TCRConnectionClass; +begin + Assert(False, 'Must be overrided'); + Result := TCRConnection; +end; + +function TCustomDAConnection.GetICommandClass: TCRCommandClass; +begin + Assert(False, 'Must be overrided'); + Result := TCRCommand; +end; + +function TCustomDAConnection.GetIRecordSetClass: TCRRecordSetClass; +begin + Assert(False, 'Must be overrided'); + Result := TCRRecordSet; +end; + +procedure TCustomDAConnection.CreateIConnection; +begin + SetIConnection(nil); +end; + +function TCustomDAConnection.CreateICommand: TCRCommand; +begin + Result := GetICommandClass.Create; + Result.SetConnection(nil); +end; + +function TCustomDAConnection.CreateIRecordSet: TCRRecordSet; +begin + Result := GetIRecordSetClass.Create; + Result.SetConnection(FIConnection); +end; + +procedure TCustomDAConnection.FreeIConnection; +begin + if FIConnection = nil then + exit; + + if FIConnection.Pool <> nil then + FIConnection.ReturnToPool + else + FIConnection.Free; + SetIConnection(nil); +end; + +procedure TCustomDAConnection.SetIConnection(Value: TCRConnection); +var + i: integer; +begin + if Value <> nil then begin + FIConnection := Value; + FIConnection.OnError := DoError; + FIConnection.OnReconnectError := Disconnect; + FIConnection.OnReconnectSuccess := DoAfterConnect; + FIConnection.Component := Self; + + for i := 0 to FSQLs.Count - 1 do begin + TCustomDASQL(FSQLs[i]).CheckICommand; + TCustomDASQL(FSQLs[i]).FICommand.SetConnection(FIConnection); + end; + for i := 0 to DataSetCount - 1 do begin + (DataSets[i] as TCustomDADataSet).CheckIRecordSet; + (DataSets[i] as TCustomDADataSet).FIRecordSet.SetConnection(FIConnection); + end; + end + else begin + if (FIConnection <> nil) and not (csDestroying in ComponentState) then begin + for i := 0 to FSQLs.Count - 1 do + if TCustomDASQL(FSQLs[i]).FICommand <> nil then + TCustomDASQL(FSQLs[i]).FICommand.SetConnection(Value {nil}); + for i := 0 to DataSetCount - 1 do + if (DataSets[i] as TCustomDADataSet).FIRecordSet <> nil then + TCustomDADataSet(DataSets[i]).FIRecordSet.SetConnection(Value {nil}); + end; + FIConnection := Value; + end; +end; + +function TCustomDAConnection.CreateDataSet: TCustomDADataSet; +begin + Result := TCustomDADataSet.Create(nil); // Self ??? + Result.Connection := Self; +end; + +function TCustomDAConnection.CreateSQL: TCustomDASQL; +begin + Result := TCustomDASQL.Create(nil); + Result.Connection := Self; +end; + +procedure TCustomDAConnection.RemoveFromPool; +begin + if FIConnection <> nil then + FIConnection.IsValid := False; +end; + +procedure TCustomDAConnection.MonitorMessage(const Msg: string); +var + MessageID: cardinal; +begin + TDASQLMonitorClass(SQLMonitorClass).CustomMessage(Self, Msg, MessageID); +end; + +procedure TCustomDAConnection.Loaded; +begin + inherited; + + try + try + if FStreamedConnected then + SetConnected(True); + except + on E: Exception do + if csDesigning in ComponentState then + ShowException(E, ExceptAddr) + else + raise; + end; + finally + FStreamedConnected := False; + end; +end; + +procedure TCustomDAConnection.ClearRefs; +begin + while FSQLs.Count > 0 do + TCustomDASQL(FSQLs[0]).Connection := nil; + while DataSetCount > 0 do + (DataSets[0] as TCustomDADataSet).Connection := nil; +end; + +procedure TCustomDAConnection.RegisterClient(Client: TObject; Event: TConnectChangeEvent = nil); +begin + hRegisterClient.Enter; + try + inherited; + + if Client is TCustomDASQL then + FSQLs.Add(Client); + finally + hRegisterClient.Leave; + end; +end; + +procedure TCustomDAConnection.UnRegisterClient(Client: TObject); +begin + hRegisterClient.Enter; + try + inherited; + + if Client is TCustomDASQL then + FSQLs.Remove(Client); + finally + hRegisterClient.Leave; + end; +end; + +function TCustomDAConnection.SQLMonitorClass: TClass; +begin + Result := TCustomDASQLMonitor; +end; + +function TCustomDAConnection.ConnectDialogClass: TConnectDialogClass; +begin + Result := TCustomConnectDialog; +end; + +function TCustomDAConnection.NeedPrompt: boolean; +begin + Result := (LoginPrompt or (csDesigning in ComponentState) and + ((Username = '') or (Password = ''))) and + not ((csDesigning in ComponentState) and ((csReading in ComponentState) or FStreamedConnected)); +end; + +function TCustomDAConnection.IsConnectedStored: boolean; +begin + Result := Connected and not Options.DisconnectedMode; //In disconnect mode Design-time connection disabled +end; + +procedure TCustomDAConnection.DoConnect; +var + MessageID: cardinal; +begin + TDASQLMonitorClass(SQLMonitorClass).DBConnect(Self, MessageID, True); + + CreateIConnection; + PushOperation(clConnect); + StartWait; + try + FIConnection.SetUsername(FUsername); + FIConnection.SetPassword(FPassword); + FIConnection.SetServer(FServer); + + FIConnection.Connect(''); + finally + StopWait; + PopOperation; + end; + + TDASQLMonitorClass(SQLMonitorClass).DBConnect(Self, MessageID, False); +end; + +procedure TCustomDAConnection.DoDisconnect; +var + MessageID: cardinal; +begin + try + try + if InTransaction and not FInProcessError {to prevent call Commit(Rollback) on fatal error} then + if CommitOnDisconnect then + Commit + else + Rollback; + finally + if Connected then begin //disconnect was done in Commit or Rollback + TDASQLMonitorClass(SQLMonitorClass).DBDisconnect(Self, MessageID, True); + + if (FIConnection.Pool <> nil) and FIConnection.IsValid then begin + FIConnection.ReturnToPool; + SetIConnection(nil); + end + else + FIConnection.Disconnect; + + TDASQLMonitorClass(SQLMonitorClass).DBDisconnect(Self, MessageID, False); + end; + end; + except + on E: EDAError do begin + if not((csDestroying in ComponentState) and IsFatalError(E)) then + raise; + end + else + raise; + end; +end; + +function TCustomDAConnection.CommitOnDisconnect: boolean; +begin + Result := True; +end; + +procedure TCustomDAConnection.InternalConnect; +var + StoredConnectCount: integer; + StoredLoginPrompt: boolean; +begin + Inc(FConnectCount); + StoredConnectCount := FConnectCount; + StoredLoginPrompt := LoginPrompt; + LoginPrompt := LoginPrompt and FShouldShowPrompt; + try + try + Connect; + except + on EFailOver do; + else begin + if not Connected then + Dec(StoredConnectCount);//Restore ConnectCount in case of Connection Failure + raise; + end; + end; + finally + FConnectCount := StoredConnectCount; + LoginPrompt := StoredLoginPrompt; + FShouldShowPrompt := not Connected; //in case of Connect Exception LogPrompt appears again + end; +end; + +procedure TCustomDAConnection.InternalDisconnect; +begin + Dec(FConnectCount); + if FConnectCount < 0 then //This could happen in case of Commit/RollBack after Execute with AutoCommit = False + FConnectCount := 0; + if (FConnectCount = 0) and Options.DisconnectedMode then + if not InTransaction then //Execute with AutoCommit = False, after execute InTransaction = True, so wait for Commit/RollBack or for + //execute with AutoCommit = True + Disconnect; + FShouldShowPrompt := False; +end; + +procedure TCustomDAConnection.Connect; +begin + SetConnected(True); +end; + +procedure TCustomDAConnection.Disconnect; +begin + SetConnected(False); +end; + +procedure TCustomDAConnection.PerformConnect(Retry: boolean); +begin + if csReading in ComponentState then + FStreamedConnected := True + else begin + if GetConnected then + Exit; + if not Retry and Assigned(BeforeConnect) then + BeforeConnect(Self); + DoConnect; + Inc(FConnectCount); + SendConnectEvent(True); + if Assigned(AfterConnect) then + AfterConnect(Self); + end; +end; + +procedure TCustomDAConnection.GetTableNames(List: TStrings); +begin + List.Clear; +end; + +procedure TCustomDAConnection.GetDatabaseNames(List: TStrings); +begin + List.Clear; +end; + +procedure TCustomDAConnection.GetStoredProcNames(List: TStrings); +begin + List.Clear; +end; + +{ Transaction control } + +procedure TCustomDAConnection.SuppressAutoCommit; +var + Temp: boolean; +begin + Temp := False; + FIConnection.SetProp(prAutoCommit, Temp); +end; + +procedure TCustomDAConnection.RestoreAutoCommit; +begin + FIConnection.SetProp(prAutoCommit, FAutoCommit); +end; + +procedure TCustomDAConnection.InternalStartTransaction; +begin + FIConnection.StartTransaction; + FTransactionID := 'Local'; +end; + +procedure TCustomDAConnection.StartTransaction; +var + MessageID: cardinal; + ReStart: boolean; +begin + if Options.DisconnectedMode then + InternalConnect; + if not Connected then + DatabaseError(SConnectionIsClosed); + if InTransaction then + DatabaseError(STransactionInProgress); + + TDASQLMonitorClass(SQLMonitorClass).TRStart(Self, MessageID, True); + + PushOperation(clTransStart); + try + repeat + ReStart := False; + try + InternalStartTransaction; + FTransactionID := 'Local'; + SuppressAutoCommit; + except + on E: EFailOver do + ReStart := True; + end + until not ReStart; + finally + PopOperation; + end; + TDASQLMonitorClass(SQLMonitorClass).TRStart(Self, MessageID, False); +end; + +procedure TCustomDAConnection.Commit; +var + MessageID: cardinal; + WasInTransaction: boolean; +begin + if not Connected then + DatabaseError(SConnectionIsClosed); + + WasInTransaction := InTransaction; + TDASQLMonitorClass(SQLMonitorClass).TRCommit(Self, MessageID, True); + + FIConnection.Commit; + FTransactionID := ''; + RestoreAutocommit; + + TDASQLMonitorClass(SQLMonitorClass).TRCommit(Self, MessageID, False); + if WasInTransaction and Options.DisconnectedMode then //Only in case of explicit transaction start + InternalDisconnect; +end; + +procedure TCustomDAConnection.Rollback; +var + MessageID: cardinal; + WasInTransaction: boolean; +begin + if not Connected then + DatabaseError(SConnectionIsClosed); + + WasInTransaction := InTransaction; + TDASQLMonitorClass(SQLMonitorClass).TRRollback(Self, MessageID, True); + + FIConnection.Rollback; + FTransactionID := ''; + RestoreAutoCommit; + + TDASQLMonitorClass(SQLMonitorClass).TRRollback(Self, MessageID, False); + if WasInTransaction and Options.DisconnectedMode then //Only in case of explicit transaction start + InternalDisconnect; +end; + +procedure TCustomDAConnection.ApplyUpdates(DataSets: array of TCustomDADataSet); +var + DataSet: TCustomDADataSet; + i: integer; + ReApply: boolean; +begin + PushOperation(clConnectionApply); + try + repeat + ReApply := False; + for i := 0 to High(DataSets) do begin + DataSet := DataSets[i]; + if DataSet.Connection <> Self then + DatabaseError(Format(SUpdateWrongDB, [DataSet.Name, Name])); + end; + try + StartTransaction; + try + for i := 0 to High(DataSets) do begin + DataSet := DataSets[i]; + if DataSet.Active and DataSet.CachedUpdates then + DataSet.ApplyUpdates; + end; + Commit; + except + on EFailOver do raise; + else begin + Rollback; + raise; + end; + end; + + for i := 0 to High(DataSets) do begin + DataSet := DataSets[i]; + if (DataSet.Connection = Self) and DataSet.Active and DataSet.CachedUpdates then + DataSet.CommitUpdates; + end; + except + on EFailOver do + ReApply := True; + end; + until (not ReApply); + finally + PopOperation; + end; +end; + +procedure TCustomDAConnection.ApplyUpdates; +var + i: integer; + DataSetArray: array of TCustomDADataSet; +begin + SetLength(DataSetArray, DataSetCount); + for i := 0 to DataSetCount - 1 do + DataSetArray[i] := TCustomDADataSet(DataSets[i]); + ApplyUpdates(DataSetArray); +end; + +//Operations stack +function TCustomDAConnection.PushOperation(Operation: TConnLostCause; AllowFailOver: boolean = true): integer; +var + FOOperation: TFailOverOperation; +begin + Result := 0; + if Options.LocalFailover then begin + if FOperationsStackLen = Length(FOperationsStack) then + SetLength(FOperationsStack, FOperationsStackLen + OperationsStackDelta); + + Result := FOperationsStackLen; + FOOperation.Operation := Operation; + FOOperation.AllowFailOver := AllowFailOver; + FOperationsStack[Result] := FOOperation; + Inc(FOperationsStackLen); + end; +end; + +function TCustomDAConnection.PopOperation: TConnLostCause; +begin + Result := clUnknown; + if Options.LocalFailover then begin + Result := FOperationsStack[FOperationsStackLen].Operation; + Dec(FOperationsStackLen); + end; +end; + +function TCustomDAConnection.IsFatalError(E: EDAError): boolean; +begin + Result := False; +end; + +procedure TCustomDAConnection.ResetOnFatalError; +begin + //should be ovveriden on product level +end; + +procedure TCustomDAConnection.RestoreAfterFailOver; +begin + //should be ovveriden on product level +end; + +function TCustomDAConnection.DetectConnLostCause(Component: TObject): TConnLostCause; +var + i: integer; + AllowFailOver: boolean; +begin + Result := clUnknown; + AllowFailOver := True; + for i := FOperationsStackLen - 1 downto 0 do begin + + if Result < FOperationsStack[i].Operation then begin + Result := FOperationsStack[i].Operation; + AllowFailOver := FOperationsStack[i].AllowFailOver; + end; + + case Result of + clConnect: begin + if TCustomDAConnection(Component).FShouldShowPrompt then + Result := clUnknown;// This is the first connect or non DisconnectedMode - so we should raise exception + break; + end; + clOpen, clExecute: begin + if ((Component is TCustomDADataSet) and not TCustomDADataSet(Component).IsQuery) or + (Component is TCustomDASQL) then + Inc(FConnectCount); // Add ConnectCount - > cause of EndConnection in TCustomDADataSet.DoAfterExecute + end; + end; + end; + + if not AllowFailOver then + Result := clUnknown; +end; + +procedure TCustomDAConnection.DoError(E: Exception; var Fail, Reconnect, Reexecute: boolean; + ReconnectAttempt: integer; var ConnLostCause: TConnLostCause); +var + i: integer; + FatalError: boolean; + RetryMode: TRetryMode; +begin + ConnLostCause := clUnknown; + TDASQLMonitorClass(SQLMonitorClass).DBError(EDAError(E)); + + FatalError := IsFatalError(EDAError(E)); + + if FatalError then begin + + with EDAError(E) do begin + ConnLostCause := DetectConnLostCause(Component); + + Reconnect := + (Connected + or ((ReconnectAttempt > 0) and Options.LocalFailover) // After first abortive attempt Connected = False + or (ConnLostCause = clConnect) and Options.DisconnectedMode) // For disconnect mode TODO: + and ((FTransactionID = '') or (ConnLostCause = clConnectionApply)); // and not InTransaction - ODAC specific: InTransaction can raise exception + + if Reconnect then + for i := 0 to DataSetCount - 1 do begin + Assert(DataSets[i] is TCustomDADataSet); + if TCustomDADataSet(DataSets[i]).Prepared or + ((DataSets[i].Active and not TCustomDADataSet(DataSets[i]).FetchAll + and not TCustomDADataSet(DataSets[i]).Fetched) and + not ((ConnLostCause = clRefresh) and (DataSets[i] = Component))) //In case of Refresh and Active dataset with unfetched data. + then begin + Reconnect := False; + Break; + end; + end; + + if Reconnect then + for i := 0 to FSQLs.Count - 1 do begin + Assert(TObject(FSQLs[i]) is TCustomDASQL); + if TCustomDASQL(FSQLs[i]).Prepared and not TCustomDASQL(FSQLs[i]).Executing then begin + Reconnect := False; + Break; + end; + end; + end; + end; + + if Reconnect then + if Options.LocalFailover then begin + if (ConnLostCause = clUnknown) or (ConnLostCause = clExecute) then + RetryMode := rmRaise + else + RetryMode := rmReconnectExecute; + + if Assigned(FOnConnectionLost) then + FOnConnectionLost(Self, TComponent(EDAError(E).Component), ConnLostCause, RetryMode); + Reconnect := RetryMode > rmRaise; + Reexecute := ((RetryMode > rmReconnect) and not (ConnLostCause = clUnknown)) or + ((ConnLostCause = clConnect) and (RetryMode >= rmReconnect)); + Fail := not Reexecute; + end; + + if not Options.LocalFailover or not Reconnect then + if Assigned(FOnError) then + FOnError(Self, EDAError(E), Fail); + + if FatalError and (FIConnection <> nil) then begin + FIConnection.IsValid := False; + if FIConnection.Pool <> nil then + TCRConnectionPool(FIConnection.Pool).Invalidate; + end; + + if FatalError and (ReconnectAttempt = 0) then + ResetOnFatalError; + + if not FInProcessError and not Reconnect and FatalError and + (ReconnectAttempt = 0) // If Attempt > 0 disconnect was called on CRAccess level + then begin + FInProcessError := True; + try + Disconnect; + except // don't raise exception + end; + FInProcessError := False; + end; +end; + +function TCustomDAConnection.IsKeyViolation(E: EDAError): boolean; +begin + Result := False; +end; + +procedure TCustomDAConnection.AssignTo(Dest: TPersistent); +begin + if Dest is TCustomDAConnection then begin + TCustomDAConnection(Dest).Username := Username; + TCustomDAConnection(Dest).Password := Password; + TCustomDAConnection(Dest).Server := Server; + TCustomDAConnection(Dest).LoginPrompt := LoginPrompt; + PoolingOptions.AssignTo(TCustomDAConnection(Dest).PoolingOptions); + TCustomDAConnection(Dest).Pooling := Pooling; + TCustomDAConnection(Dest).ConnectDialog := ConnectDialog; + TCustomDAConnection(Dest).OnError := OnError; + TCustomDAConnection(Dest).ConvertEOL := ConvertEOL; + Options.AssignTo(TCustomDAConnection(Dest).Options); + TCustomDAConnection(Dest).AutoCommit := AutoCommit; + + TCustomDAConnection(Dest).AfterConnect := AfterConnect; + TCustomDAConnection(Dest).BeforeConnect := BeforeConnect; + TCustomDAConnection(Dest).AfterDisconnect := AfterDisconnect; + TCustomDAConnection(Dest).BeforeDisconnect := BeforeDisconnect; + TCustomDAConnection(Dest).OnLogin := OnLogin; + end + else + inherited; +end; + +function TCustomDAConnection.GetConnected: boolean; +begin + Result := (FIConnection <> nil) and FIConnection.GetConnected; +end; + +procedure TCustomDAConnection.SetConnected(Value: boolean); +var + Dialog: TCustomConnectDialog; + DialogResult: boolean; + OldBeforeDisconnect: TNotifyEvent; + StoredConnectCount: integer; +begin + OldBeforeDisconnect := nil; + try + if Value <> GetConnected then begin + try + // ignore exceptions to disconnect all client + if not Value then begin + FConnectCount := 0; //Explicit disconnect + FShouldShowPrompt := True; + if Assigned(BeforeDisconnect) then BeforeDisconnect(Self); + while True do + try + SendConnectEvent(False); + break; + except + on E: EDAError do + if not IsFatalError(E) then + raise + end; + end + else + if not FStreamedConnected then //DFM loading issue + Inc(FConnectCount); + finally + if csReading in ComponentState then begin + if FOptions.KeepDesignConnected or (csDesigning in ComponentState) then + FStreamedConnected := Value; + end + else if not Value then begin + OldBeforeDisconnect := BeforeDisconnect; + if Assigned(BeforeDisconnect) then //Design-time event lose fix + BeforeDisconnect := nil; + + inherited SetConnected(False); //There is no server operations + + FTransactionID := ''; + end; + end; + if not (csReading in ComponentState) and Value then begin + if NeedPrompt and (ConnectDialogClass <> nil) then begin + if FConnectDialog = nil then + Dialog := ConnectDialogClass.Create(nil) + else + Dialog := FConnectDialog; + StoredConnectCount := FConnectCount; + DialogResult := False; + try + Dialog.FConnection := Self; + DialogResult := Dialog.Execute; + finally + if not DialogResult then + Dec(StoredConnectCount); + FConnectCount := StoredConnectCount; + if FConnectDialog = nil then + Dialog.Free; + end; + + if not DialogResult then begin + if FStreamedConnected or (csDesigning in ComponentState) then + DatabaseError(SCannotConnect) + else + Abort; + end; + end + else begin + StoredConnectCount := FConnectCount; + try + try + PerformConnect; + except + if not Connected then + Dec(StoredConnectCount);//Restore ConnectCount in case of Connection Failure + raise; + end; + finally + FConnectCount := StoredConnectCount; + end; + end; + end; + end; + finally + if Assigned(OldBeforeDisconnect) then + BeforeDisconnect := OldBeforeDisconnect; + end; +end; + +procedure TCustomDAConnection.SetUsername(const Value: string); +begin + if Value <> FUsername then begin + Disconnect; + FUsername := Value; + end; +end; + +procedure TCustomDAConnection.SetPassword(const Value: string); +begin + if Value <> FPassword then begin + Disconnect; + FPassword := Value; + end; +end; + +procedure TCustomDAConnection.SetServer(const Value: string); +begin + if Value <> FServer then begin + Disconnect; + FServer := Value; + end; +end; + +function TCustomDAConnection.GetConnectString: string; +begin + Result := ''; +end; + +procedure TCustomDAConnection.SetConnectString(Value: string); +begin +end; + +procedure TCustomDAConnection.SetAutoCommit(Value: boolean); +begin + FAutoCommit := Value; + if FIConnection <> nil then + FIConnection.SetProp(prAutoCommit, FAutoCommit); +end; + +function TCustomDAConnection.GetInTransaction: boolean; +begin + Result := GetTransactionID <> ''; +end; + +function TCustomDAConnection.GetTransactionID: string; +begin + Result := FTransactionID; +end; + +procedure TCustomDAConnection.SetConvertEOL(Value: boolean); +begin + FConvertEOL := Value; + if FIConnection <> nil then + FIConnection.SetProp(prConvertEOL, Value); +end; + +function TCustomDAConnection.CreateOptions: TDAConnectionOptions; +begin + Result := TDAConnectionOptions.Create(Self); +end; + +procedure TCustomDAConnection.SetOptions(Value: TDAConnectionOptions); +begin + FOptions.Assign(Value); +end; + +function TCustomDAConnection.CreatePoolingOptions: TPoolingOptions; +begin + Result := TPoolingOptions.Create(Self); +end; + +procedure TCustomDAConnection.SetPoolingOptions(Value: TPoolingOptions); +begin + FPoolingOptions.Assign(Value); +end; + +function TCustomDAConnection.IsCaseSensitive: boolean; +begin + Result := True; +end; + +procedure TCustomDAConnection.SetConnectDialog(Value: TCustomConnectDialog); +begin + if Value <> FConnectDialog then begin + if FConnectDialog <> nil then begin + RemoveFreeNotification(FConnectDialog); + if FConnectDialog.FConnection = Self then + FConnectDialog.FConnection := nil; + end; + + FConnectDialog := Value; + + if FConnectDialog <> nil then begin + FreeNotification(FConnectDialog); + FConnectDialog.FConnection := Self; + end; + end; +end; + +procedure TCustomDAConnection.SetPooling(Value: boolean); +begin + if FPooling <> Value then begin + SetConnected(False); + FreeIConnection; + end; + FPooling := Value; +end; + +procedure TCustomDAConnection.DoAfterConnect; +begin + if Assigned(AfterConnect) then + AfterConnect(Self); +end; + +{ TDAParamsInfo } + +function TDAParamsInfo.GetItem(Index: Integer): TDAParamInfo; +begin + Result := TDAParamInfo(inherited GetItem(Index)); +end; + +procedure TDAParamsInfo.SetItem(Index: Integer; Value: TDAParamInfo); +begin + inherited SetItem(Index, Value); +end; + +{ TDAParam } + +destructor TDAParam.Destroy; +begin + FreeObject; + + inherited; +end; + +procedure TDAParam.Clear; +begin + if IsBlobDataType then + TBlob(FParamObject).Clear + else + inherited Clear; +end; + +procedure TDAParam.Assign(Source: TPersistent); +{$IFDEF VER6P} +var + StreamPersist: IStreamPersist; +{$ENDIF} + +{$IFDEF VER6P} + procedure Load(const StreamPersist: IStreamPersist); + var + MS: TMemoryStream; + begin + if not (DataType in [ftBlob, ftMemo{$IFDEF VER10P}, ftWideMemo{$ENDIF}, ftOraBlob, ftOraClob]) then + raise Exception.Create(SDataTypeNotSupported); + + MS := TMemoryStream.Create; + try + StreamPersist.SaveToStream(MS); + LoadFromStream(MS, DataType); + finally + MS.Free; + end; + end; +{$ENDIF} + +begin + if Source is TDAParam then begin + AssignParam(TParam(Source)); + {$IFDEF VER6P} + TParam(Self).Size := TParam(Source).Size; // CR11511 + {$ENDIF} + FSize := TDAParam(Source).FSize; // CR11511 + ParamObject := TDAParam(Source).ParamObject; + end + else + if Source is TParam then + AssignParam(TParam(Source)) + else + if Source is TField then + AssignField(TField(Source)) + else + if Source is TStrings then + AsMemo := TStrings(Source).Text + else +{$IFDEF VER6P} + if Supports(Source, IStreamPersist, StreamPersist) then + Load(StreamPersist) + else +{$ENDIF} + inherited Assign(Source); +end; + +procedure TDAParam.AssignParam(Param: TParam); +begin + if Param <> nil then begin + DataType := Param.DataType; + if Param.IsNull then + Clear + else + if IsBlobDataType and not (Param is TDAParam) then + // in MIDAS we need to do such assignment + // as TDAParam.Value = TParam.Value + Value := Param.Value + else + inherited Value := Param.Value; + Name := Param.Name; + if ParamType = ptUnknown then + ParamType := Param.ParamType; + end; +end; + +procedure TDAParam.AssignTo(Dest: TPersistent); +begin + if Dest is TField then + TField(Dest).Value := Value + else + inherited AssignTo(Dest); +end; + +procedure TDAParam.AssignField(Field: TField); +begin + if Field <> nil then begin + AssignFieldValue(Field, Field.Value); + Name := Field.FieldName; + end; +end; + +procedure TDAParam.AssignFieldValue(Field: TField; const Value: Variant); +begin + if Field <> nil then begin + if (Field.DataType = ftString) and TStringField(Field).FixedChar then + DataType := ftFixedChar + else + if (Field.DataType = ftMemo) and (Field.Size > 255) then + DataType := ftString + else + {$IFDEF VER10P} + if (Field.DataType = ftWideMemo) and (Field.Size > 255) then + DataType := ftWideString + else + {$ENDIF} + DataType := Field.DataType; + if + VarIsNull(Value) + {$IFDEF CLR} + or ((Field is TBytesField) and Field.IsNull) // See d7 TField.GetAsByteArray and d8 TVarBytesField(TField).GetAsByteArray for details + {$ENDIF} + then + Clear + else + Self.Value := Value; + end; +end; + +procedure TDAParam.LoadFromFile(const FileName: string; BlobType: TBlobType); +var + Stream: TStream; +begin + Stream := TFileStream.Create(FileName, fmOpenRead); + try + LoadFromStream(Stream, BlobType); + finally + Stream.Free; + end; +end; + +procedure TDAParam.LoadFromStream(Stream: TStream; BlobType: TBlobType); +begin + if not (BlobType in [ftBlob, ftMemo{$IFDEF VER10P}, ftWideMemo{$ENDIF}, ftOraBlob, ftOraClob]) then + raise Exception.Create(SDataTypeNotSupported); + with Stream do begin + DataType := BlobType; + Position := 0; + Assert(FParamObject <> nil, SDataTypeNotSupported); + TBlob(FParamObject).LoadFromStream(Stream); + end; +end; + +procedure TDAParam.SetBlobData(Buffer: TBytes; Size: Integer); +begin + AsBlob := Encoding.Default.GetString(Buffer, 0, Size); +end; + +procedure TDAParam.SetBlobData(Buffer: TValueBuffer); +begin + AsBlob := Marshal.PtrToStringAnsi(Buffer); +end; + +procedure TDAParam.CreateObject; +begin + Assert(FParamObject = nil); + + if DataType in [ftBlob, ftMemo{$IFDEF VER10P}, ftWideMemo{$ENDIF}] then begin + FParamObject := TBlob.Create; + {$IFDEF VER10P} + if DataType = ftWideMemo then + TBlob(FParamObject).IsUnicode := True; + {$ENDIF} + end; +end; + +procedure TDAParam.FreeObject; +begin + if FParamObject <> nil then begin + FParamObject.Free; + FParamObject := nil; + end; +end; + +procedure TDAParam.SetParamObject(Value: TSharedObject); +begin + FreeObject; + + FParamObject := Value; + if FParamObject <> nil then begin + FParamObject.AddRef; + inherited Value := 'Object'; // for IsNull = False + end; +end; + +function TDAParam.IsDataTypeStored: boolean; +begin + Result := Integer(DataType) <= Integer(High(TFieldType)); +end; + +function TDAParam.IsValueStored: boolean; +begin + Result := Bound and not VarIsArray(Value); +end; + +procedure TDAParam.DefineProperties(Filer: TFiler); + + function WriteData: boolean; + begin + Result := not IsDataTypeStored; + end; + +begin + inherited DefineProperties(Filer); + + Filer.DefineProperty('ExtDataType', ReadExtDataType, WriteExtDataType, WriteData); +end; + +procedure TDAParam.ReadExtDataType(Reader: TReader); +begin + DataType := TFieldType(Reader.ReadInteger); +end; + +procedure TDAParam.WriteExtDataType(Writer: TWriter); +begin + Writer.WriteInteger(Integer(DataType)); +end; + +function TDAParam.IsObjectDataType(DataType: TFieldType): boolean; +begin + Result := DataType in [ftMemo{$IFDEF VER10P}, ftWideMemo{$ENDIF}, ftBlob]; +end; + +function TDAParam.IsObjectDataType: boolean; +begin + Result := IsObjectDataType(DataType); +end; + +function TDAParam.IsBlobDataType: boolean; +begin + Result := DataType in [ftMemo{$IFDEF VER10P}, ftWideMemo{$ENDIF}, ftBlob]; +end; + +function TDAParam.GetDataType: TFieldType; +begin + Result := inherited DataType; +end; + +procedure TDAParam.SetDataType(Value: TFieldType); +begin + if Value <> inherited DataType then begin + if IsObjectDataType then + FreeObject; + + inherited DataType := Value; + + if IsObjectDataType then + CreateObject; + end; +end; + +function TDAParam.GetSize: integer; +begin + Result := FSize; +end; + +procedure TDAParam.SetSize(Value: integer); +begin + FSize := Value; +end; + +function TDAParam.GetAsString: string; +begin + if IsNull then + Result := '' + else + if IsBlobDataType then begin + Assert(FParamObject is TBlob); + Result := TBlob(FParamObject).AsString; + end + else + {$IFNDEF CLR} + if DataType in [ftDate, ftDateTime] then + Result := DateToStr(TVarData(Value).VDate) + else + {$ENDIF} + Result := inherited AsString; +end; + +procedure TDAParam.SetAsString(Value: string); +begin + if IsBlobDataType then + TBlob(FParamObject).AsString := Value + else + if DataType = ftWideString then + AsWideString := Value + else + inherited AsString := Value; +end; + +function TDAParam.GetAsWideString: WideString; +begin + if IsNull then + Result := '' + else + if IsBlobDataType then begin + Assert(FParamObject is TBlob); + Result := TBlob(FParamObject).AsWideString; + end + else + Result := inherited Value; +end; + +procedure TDAParam.SetAsWideString(Value: WideString); +begin + if IsBlobDataType then + TBlob(FParamObject).AsWideString := Value + else + inherited Value := Value; +end; + +function TDAParam.GetAsInteger: integer; +begin + Result := inherited AsInteger; +end; + +procedure TDAParam.SetAsInteger(Value: integer); +begin + inherited AsInteger := Value; +end; + +function TDAParam.GetAsFloat: double; +begin + Result := inherited AsFloat; +end; + +procedure TDAParam.SetAsFloat(Value: double); +begin + inherited AsFloat := Value; +end; + +procedure TDAParam.SetAsBlob(Value: TBlobData); +begin + DataType := ftBlob; + TBlob(FParamObject).AsString := Value +end; + +procedure TDAParam.SetAsMemo(Value: string); +begin + DataType := ftMemo; + Assert(FParamObject <> nil); + TBlob(FParamObject).AsString := Value +end; + +function TDAParam.GetAsBlobRef: TBlob; +begin + if DataType = ftUnknown then + DataType := ftBlob; + + if IsBlobDataType then + Result := FParamObject as TBlob + else + Result := nil; +end; + +procedure TDAParam.SetAsBlobRef(const Value: TBlob); +begin + FreeObject; + + inherited DataType := ftBlob; + + ParamObject := Value; +end; + +function TDAParam.GetAsMemoRef: TBlob; +begin + if DataType = ftUnknown then begin + {$IFDEF VER10P} + if IsBlobDataType and (FParamObject is TBlob) and TBlob(FParamObject).IsUnicode then + DataType := ftWideMemo + else + {$ENDIF} + DataType := ftMemo; + end; + + if IsBlobDataType then + Result := FParamObject as TBlob + else + Result := nil; +end; + +procedure TDAParam.SetAsMemoRef(const Value: TBlob); +begin + FreeObject; + +{$IFDEF VER10P} + if Value.IsUnicode then + inherited DataType := ftWideMemo + else +{$ENDIF} + inherited DataType := ftMemo; + + ParamObject := Value; +end; + +function TDAParam.GetAsVariant: variant; +begin + if IsBlobDataType then + Result := TBlob(FParamObject).AsString + else + Result := inherited Value; +end; + +procedure TDAParam.SetAsVariant(const Value: variant); +begin + if IsBlobDataType then + TBlob(FParamObject).AsString := Value + else + inherited Value := Value; +end; + +{$IFDEF VER6P} +function TDAParam.GetAsSQLTimeStamp: TSQLTimeStamp; +begin + Result := inherited AsSQLTimeStamp; +end; + +procedure TDAParam.SetAsSQLTimeStamp(const Value: TSQLTimeStamp); +begin + inherited AsSQLTimeStamp := Value; +end; +{$ENDIF} + +procedure TDAParam.SetText(const Value: string); +begin + if IsBlobDataType then + TBlob(FParamObject).AsString := Value + else + inherited SetText(Value); +end; + +function TDAParam.GetIsNull: boolean; +begin + if IsBlobDataType then + Result := TBlob(FParamObject).Size = 0 + else + Result := inherited IsNull; +end; + +{ TDAParams } + +constructor TDAParams.Create(Owner: TPersistent); +begin + inherited Create(TDAParam); + + FOwner := Owner; + FNeedsUpdateItem := True; +end; + +procedure TDAParams.Update(Item: TCollectionItem); +begin + if FNeedsUpdateItem then + inherited; +end; + +function TDAParams.GetItem(Index: integer): TDAParam; +begin + Result := TDAParam(inherited Items[Index]); +end; + +procedure TDAParams.SetItem(Index: integer; Value: TDAParam); +begin + inherited Items[Index] := Value; +end; + +function TDAParams.ParamByName(const Value: string): TDAParam; +begin + Result := TDAParam(inherited ParamByName(Value)); +end; + +function TDAParams.FindParam(const Value: string): TDAParam; +begin + Result := TDAParam(inherited FindParam(Value)); +end; + +function TDAParams.CreateParam(FldType: TFieldType; const ParamName: string; + ParamType: TParamType): TDAParam; +begin + Result := TDAParam(inherited CreateParam(ftUnknown, ParamName, ParamType)); + Result.DataType := FldType; +end; + +{ TDADetailDataLink } + +constructor TDADetailDataLink.Create(DataSet: TCustomDADataSet); +begin + inherited Create; + + FDataSet := DataSet; +end; + +procedure TDADetailDataLink.ActiveChanged; +begin + if FDataSet.Active and + not (csDestroying in FDataSet.ComponentState) and + Active + then + FDataSet.RefreshParams; +end; + +procedure TDADetailDataLink.RecordChanged(Field: TField); +begin + if ((Field = nil) or (DataSet.Fields.IndexOf(Field) >= 0)) and FDataSet.Active and + not ((Field <> nil) and (FDataSet.State in [dsEdit, dsInsert])) then + FDataSet.RefreshParams; +end; + +procedure TDADetailDataLink.CheckBrowseMode; +begin + if FDataSet.Active and + not((DataSet.State in [dsInsert]) and (FDataSet.State in [dsEdit,dsInsert])) + then // Prevent post detail before post master + FDataSet.CheckBrowseMode; +end; + +function TDADetailDataLink.GetDetailDataSet: TDataSet; +begin + Result := FDataSet; +end; + +{ TCustomDADataSet } + +constructor TCustomDADataSet.Create(Owner: TComponent); +var + stIdx: TStatementType; +begin + inherited Create(Owner); + + FDataLink := TDADetailDataLink.Create(Self); + + for stIdx := Low(TStatementType) to High(TStatementType) do + if stIdx in GetUpdateSQLStatementTypes then begin + Assert(FUpdateSQL[stIdx] = nil); + FUpdateSQL[stIdx] := TStringList.Create; + TStringList(FUpdateSQL[stIdx]).OnChange := ScanMacros; + end; + + FFetchRows := 25; + FAutoCommit := True; + FRowsAffected := -1; + FRefreshOptions := []; + FLeftQuote := '"'; + FRightQuote := '"'; + + FBatchSQLs := StringBuilder.Create(100); + + CreateCommand; + CreateSQLGenerator; + + SetIRecordSet(FIRecordSet); // TODO - SetIRecordSet called twice + + FDesignCreate := csDesigning in ComponentState; + FOptions := CreateOptions; + + FUpdatingTableInfoIdx := -1; +end; + +destructor TCustomDADataSet.Destroy; +var + stIdx: TStatementType; +begin + Close; + UnPrepare; + + if UsedConnection <> nil then + UsedConnection.UnregisterClient(Self); + + FreeCommand; + FreeSQLGenerator; /// CR11636 + + FOptions.Free; + FDataLink.Free; + FBatchParams.Free; + FBatchSQLs.Free; + + for stIdx := Low(FUpdateComponents) to High(FUpdateComponents) do begin + FUpdateComponents[stIdx].Free; + FUpdateComponents[stIdx] := nil; + FUpdateSQL[stIdx].Free; + FUpdateSQL[stIdx] := nil; + end; + +{$IFDEF MSWINDOWS} + FDetailRefreshTimer.Free; +{$ENDIF} + + inherited; + + SetUpdateObject(nil); +end; + +function TCustomDADataSet.QuoteName(const AName: string): string; +begin + if FOptions.FQuoteNames and (AName <> '') then + Result := Concat(FLeftQuote, AName, FRightQuote) + else + Result := AName; +end; + +function TCustomDADataSet.UnQuoteName(AName: string): string; +var + l: integer; +begin + AName := Trim(AName); + l := Length(AName); + if FOptions.FQuoteNames and (l >= 3) and (AName[1] = FLeftQuote) and (AName[l] = FRightQuote) then + Result := Copy(AName, 2, l - 2) + else + Result := AName; +end; + +procedure TCustomDADataSet.CheckInactive; +begin + inherited CheckInactive; +end; + +procedure TCustomDADataSet.CreateIRecordSet; +begin + if UsedConnection <> nil then + SetIRecordSet(UsedConnection.CreateIRecordSet) + else + SetIRecordSet(nil); +end; + +procedure TCustomDADataSet.FreeIRecordSet; +begin + FIRecordSet.Free; + SetIRecordSet(nil); +end; + +procedure TCustomDADataSet.SetIRecordSet(Value: TData); +var + stIdx: TStatementType; +begin + inherited; + + FIRecordSet := TCRRecordSet(Value); // Value as TCRRecordSet; + if FIRecordSet <> nil then begin + FICommand := FIRecordSet.GetCommand; + FIRecordSet.SetProp(prUniDirectional, FUniDirectional); + FIRecordSet.SetProp(prFetchRows, FFetchRows); + FIRecordSet.SetProp(prFetchAll, FFetchAll); + if FOptions <> nil then begin + FIRecordSet.SetProp(prLongStrings, FOptions.FLongStrings); + FIRecordSet.SetProp(prFlatBuffers, FOptions.FFlatBuffers); + FIRecordSet.TrimFixedChar := FOptions.TrimFixedChar; + FIRecordSet.TrimVarChar := FOptions.TrimVarChar; + end; + + FIRecordSet.AfterExecFetch := DoAfterExecFetch; + FIRecordSet.AfterFetchAll := DoAfterFetchAll; + FIRecordSet.OnBeforeFetch := DoOnBeforeFetch; + FIRecordSet.OnAfterFetch := DoOnAfterFetch; + FIRecordSet.OnDataChanged := DoOnDataChanged; + FIRecordSet.Component := Self; + end + else + FICommand := nil; + + if FCommand <> nil then + FCommand.SetICommand(FICommand); + + if FICommand <> nil then begin + FICommand.SetProp(prAutoCommit, FAutoCommit); + FICommand.AfterExecute := DoAfterExecute; + end; + for stIdx := Low(FUpdateComponents) to High(FUpdateComponents) do + FreeAndNil(FUpdateComponents[stIdx]); + FUpdateQuery := nil; +end; + +procedure TCustomDADataSet.CheckIRecordSet; +var + ClassType: TClass; +begin + if (UsedConnection <> nil) then + ClassType := UsedConnection.GetIRecordSetClass + else + ClassType := nil; + + if (ClassType = nil) or not IsClass(FIRecordSet, ClassType) then begin + FreeIRecordSet; + CreateIRecordSet; + end; +end; + +procedure TCustomDADataSet.CreateCommand; +begin + SetCommand(TCustomDASQL.Create(Self)); +end; + +procedure TCustomDADataSet.FreeCommand; +begin + FCommand.Free; + FCommand := nil; +end; + +procedure TCustomDADataSet.SetCommand(Value: TCustomDASQL); +begin + //FreeCommand; + + FCommand := Value; + if FCommand <> nil then begin + FCommand.SetICommand(FICommand); + FCommand.FDataSet := Self; + + FParams := FCommand.Params; + FMacros := FCommand.Macros; + end; +end; + +function TCustomDADataSet.CreateOptions: TDADataSetOptions; +begin + Result := TDADataSetOptions.Create(Self); +end; + +procedure TCustomDADataSet.Loaded; +begin + FStreamedOpen := True; + try + inherited; + FDesignCreate := False; + finally + FStreamedOpen := False; + end; +end; + +function TCustomDADataSet.UsedConnection: TCustomDAConnection; +begin + Result := FConnection +end; + +procedure TCustomDADataSet.CheckConnection; +begin + BeginConnection(False); +end; + +procedure TCustomDADataSet.BeginConnection(NoConnectCheck: boolean); + function HasDataSet(DAConnection: TCustomDAConnection; DataSet: TDataSet): boolean; + var + i: integer; + begin + for i := 0 to DAConnection.DataSetCount - 1 do begin + if DAConnection.DataSets[i] = DataSet then begin + Result := True; + exit; + end; + end; + Result := False; + end; +begin + if UsedConnection = nil then + DatabaseError(SConnectionNotDefined); + + if NoConnectCheck then + UsedConnection.InternalConnect // We should call connect each time to update ConnectCount + else + if not UsedConnection.Connected then + UsedConnection.Connect; + +// use default session + if (FConnection = nil) and not HasDataSet(UsedConnection, Self) // FDataSets + then begin + UsedConnection.RegisterClient(Self, ConnectChange); + + CheckIRecordSet; + FIRecordSet.SetConnection(UsedConnection.FIConnection) + end; +end; + +procedure TCustomDADataSet.EndConnection; +begin + if UsedConnection <> nil then + UsedConnection.InternalDisconnect; +end; + +procedure TCustomDADataSet.Disconnect; +begin + Close; + UnPrepare; + FieldDefs.Updated := False; +end; + +procedure TCustomDADataSet.ConnectChange(Sender: TObject; Connecting: boolean); +begin + if not Connecting then begin + if not TCustomDAConnection(Sender).Options.DisconnectedMode then + Disconnect + else + FIRecordSet.Disconnect; + end + else + if not (Sender is TCustomDAConnection) then begin // Dll call + Assert(FIRecordSet <> nil); + Assert(UsedConnection <> nil); + Assert(UsedConnection.FIConnection <> nil); + FIRecordSet.SetConnection(UsedConnection.FIConnection); + end; +end; + +{ TablesInfo } + +function TCustomDADataSet.GetTablesInfo: TCRTablesInfo; +begin + Result := FIRecordSet.TablesInfo; +end; + +procedure TCustomDADataSet.SetUpdatingTable(Value: string); +var + i, j: integer; + KeyAndDataFields: TKeyAndDataFields; + OldUpdatingTable: string; + FieldDesc: TFieldDesc; + UpdatingTableIsEmpty: boolean; + + function GetRootParent(FieldDesc: TFieldDesc): TFieldDesc; + begin + Result := FieldDesc; + while Result.ParentField <> nil do + Result := Result.ParentField; + end; +begin + Value := TablesInfo.TableInfoClass.NormalizeName(Value); + OldUpdatingTable := FUpdatingTable; + FUpdatingTable := Value; + + // Clear FCachedKeyAndDataFields + if FUpdatingTable <> OldUpdatingTable then + ClearCachedKeyAndDataFields; + +// Count can be equal to 0 in case: select t.a from (select a from table) t +// if TablesInfo.Count = 0 then +// Exit; // TablesInfo is not avaible (DataSet is not open)} + if not FIRecordSet.Active then + Exit; + + //Assert(Length(FSQLObjects) > 0, 'Function TCustomMSDataSet.SetUpdatingTable cannot be called for non-select query!'); + + UpdatingTableIsEmpty := False; + if TablesInfo.Count = 0 then + i := -1 + else + if Value = '' then // Select default updating table + i := 0 + else begin + i := TablesInfo.IndexByName(Value); + if i = -1 then + i := TablesInfo.IndexByAlias(Value); + + if i = - 1 then begin + if FUpdatingTable <> OldUpdatingTable then begin + FUpdatingTable := OldUpdatingTable; + DatabaseErrorFmt(SBadUpdatingTable, [Value]); + end + else + begin + UpdatingTable := ''; + UpdatingTableIsEmpty := True; // All properties must be setted by previous command + end; + end; + end; + + if not UpdatingTableIsEmpty then begin + FUpdatingTableInfoIdx := i; + + DetectIdentityField; + + if not ReadOnly then begin + // Set Fields[i].ReadOnly Values + if Options.SetFieldsReadOnly and ReadOnlyFieldsEnabled then begin + + for i := 0 to Fields.Count - 1 do + if Fields[i].FieldKind = fkData then + Fields[i].ReadOnly := True; + + GetKeyAndDataFields(KeyAndDataFields, False); + + for i := 0 to Fields.Count - 1 do begin + FieldDesc := GetFieldDesc(Fields[i]); + for j := 0 to High(KeyAndDataFields.DataFieldDescs) do + if (FieldDesc = KeyAndDataFields.DataFieldDescs[j]) or (GetRootParent(FieldDesc) = KeyAndDataFields.DataFieldDescs[j]) then begin + Fields[i].ReadOnly := False; + Break; + end; + end; + end; + end; + end; + + if TablesInfo.Count > 0 then + FOldKeyFields := PSGetKeyFields; +end; + +{ Open/Close } + +procedure TCustomDADataSet.Prepare; +var + MessageID: cardinal; +begin + if not Prepared and not Active then begin + BeginConnection; + + // Get param values from master dataset to avoid bug with master/detail and + // Execute method on detail dataset. + if (FDataLink.DataSource <> nil) and (FDataLink.DataSource.DataSet <> nil) + and (FDataLink.DataSource.DataSet.Active) + then + SetMasterParams(Params); + + if not FLockDebug and (TDASQLMonitorClass(UsedConnection.SQLMonitorClass).HasMonitor or Debug) then + TDASQLMonitorClass(UsedConnection.SQLMonitorClass).SQLPrepare(Self, FinalSQL, FParams, MessageID, True); + + StartWait; + + FCommand.WriteParams(False); + + inherited; + + if not FLockDebug and (TDASQLMonitorClass(UsedConnection.SQLMonitorClass).HasMonitor or Debug) then + TDASQLMonitorClass(UsedConnection.SQLMonitorClass).SQLPrepare(Self, FinalSQL, FParams, MessageID, False); + end; +end; + +procedure TCustomDADataSet.UnPrepare; +var + NeedDisconnect: boolean; + MessageID: cardinal; + UnpreparePending: boolean; +begin + NeedDisconnect := Prepared; + UnpreparePending := False; + + if Prepared and (UsedConnection <> nil) then + if not FLockDebug and (TDASQLMonitorClass(UsedConnection.SQLMonitorClass).HasMonitor or Debug) then begin + TDASQLMonitorClass(UsedConnection.SQLMonitorClass).SQLUnprepare(Self, FinalSQL, FParams, MessageID, True); + UnpreparePending := True; + end; + + try + inherited; + finally + if NeedDisconnect then + EndConnection; + end; + FIRecordSet.TablesInfo.Clear; + FUpdatingTableInfoIdx := -1; + + if UnpreparePending and (UsedConnection <> nil) then + if not FLockDebug and (TDASQLMonitorClass(UsedConnection.SQLMonitorClass).HasMonitor or Debug) then + TDASQLMonitorClass(UsedConnection.SQLMonitorClass).SQLUnprepare(Self, FinalSQL, FParams, MessageID, False); +end; + +procedure TCustomDADataSet.SetActive(Value: Boolean); +begin + if not FStreamedOpen or (csDesigning in ComponentState) or (FConnection = nil) or + FConnection.Options.KeepDesignConnected then + inherited; + + if Value then + FOldTableName := PSGetTableName; +end; + +procedure TCustomDADataSet.BeforeOpenCursor(InfoQuery: boolean); +begin +end; + +procedure TCustomDADataSet.AfterOpenCursor(InfoQuery: boolean); +begin +end; + +function TCustomDADataSet.OpenCursorAllowFailOver: boolean; +begin + Result := True; +end; + +procedure TCustomDADataSet.OpenCursor(InfoQuery: boolean); +var + ReOpen: boolean; +begin + if UsedConnection <> nil then + UsedConnection.PushOperation(clOpen, OpenCursorAllowFailOver); + try + FOldKeyFields := ''; + BeginConnection; + if Active then + Exit; // for open OnChangeConnect + repeat + ReOpen := False; + + BeforeOpenCursor(InfoQuery); + // get param values from master dataset + if (FDataLink.DataSource <> nil) + and (FDataLink.DataSource.DataSet <> nil) + and (FDataLink.DataSource.DataSet.Active) + and (not Foptions.LocalMasterDetail) + then + SetMasterParams(Params); + + if FOptions.QueryRecCount then + FRecordCount := GetRecCount + else + FRecordCount := 0; + + if FNonBlocking then begin + if not InfoQuery then begin + SetCursor(crSQLArrow); + DisableControls; + end; + end + else + StartWait; + + try + FCommand.WriteParams; + inherited; + except + on E: TObject do begin + if FNonBlocking then begin + EnableControls; + StopWait; + end; + if E is EFailOver then begin + UsedConnection.RestoreAfterFailOver; + Reopen := True + end + else begin + EndConnection; + raise; + end; + end; + end; + FRowsAffected := -1; + + AfterOpenCursor(InfoQuery); + until (not ReOpen); + finally + if UsedConnection <> nil then + UsedConnection.PopOperation; + end; +end; + +procedure TCustomDADataset.CloseCursor; +var + stIdx: TStatementType; + NeedDisconnect: boolean; +begin + NeedDisconnect := (FICommand.GetCursorState <> csInactive) and (not FIRecordSet.CanDisconnect); // if command is active and we doesn't + //already substract ConnectCount after all data fetch + inherited; + +/// FUpdateQuery may be prepared for optimization purposes + for stIdx := Low(FUpdateComponents) to High(FUpdateComponents) do + if FUpdateComponents[stIdx] is TCustomDADataSet then + TCustomDADataSet(FUpdateComponents[stIdx]).UnPrepare; + + if NeedDisconnect then //If there is opened cursor then we should disconnect + EndConnection; +end; + +procedure TCustomDADataset.InternalExecute; +var + MessageID: cardinal; +begin + if not FLockDebug and (TDASQLMonitorClass(UsedConnection.SQLMonitorClass).HasMonitor or Debug) then + TDASQLMonitorClass(UsedConnection.SQLMonitorClass).SQLExecute(Self, FinalSQL, FParams, '', MessageID, True); + + FIRecordSet.ExecCommand; + + if not FLockDebug and (TDASQLMonitorClass(UsedConnection.SQLMonitorClass).HasMonitor or Debug) then + TDASQLMonitorClass(UsedConnection.SQLMonitorClass).SQLExecute(Self, FinalSQL, FParams, '', MessageID, False); +end; + +procedure TCustomDADataSet.BeforeExecute; +begin + ; //This routine should be used for actions that performed before execute and + //affected by local failover feature (like PrepareSQL in stored proc) +end; + +procedure TCustomDADataSet.Execute; +var + ReExecute: boolean; +begin + if UsedConnection <> nil then + UsedConnection.PushOperation(clExecute); + try + if Executing then + Exit; + BeginConnection; + if Active then + Close; + repeat + ReExecute := False; + + BeforeExecute; + if not FNonBlocking then + StartWait; + try + if Options.AutoPrepare then + Prepare; + if IsQuery then begin + Open; + EndConnection; //Here we decrement UsedConection.FConnectCount that was incremented in InternalExecute and then + //in OpenCursor, also we make disconection in case of all data fetched during Opening (Less or equal to one fetch block) + end + else begin + // get param values from master dataset + if (FDataLink.DataSource <> nil) + and (FDataLink.DataSource.DataSet <> nil) + and (FDataLink.DataSource.DataSet.Active) + then + SetMasterParams(Params); + if FNonBlocking then + SetCursor(crSQLArrow); + FCommand.WriteParams; + InternalExecute; + if IsQuery then begin + Open; + EndConnection; //Here we decrement UsedConection.FConnectCount that was incremented in InternalExecute and then + //in OpenCursor, also we make disconection in case of all data fetched during Opening (Less or equal to one fetch block) + end; + end; + except + on E: TObject do begin + if FNonBlocking then begin + StopWait; + end; + if (E is EFailOver) and (EFailOver(E).FConnLostCause = clExecute) then begin + UsedConnection.RestoreAfterFailOver; //Restore all read transactions + ReExecute := True; //We should pass clConnectionApplyUpdates FailOver + end + else begin + EndConnection; + raise; + end; + end; + end; + until (not ReExecute); + finally + if UsedConnection <> nil then + UsedConnection.PopOperation; + end; +end; + +procedure TCustomDADataSet.DoAfterExecute(Result: boolean); +var + Value: variant; +begin + if Result then begin + FCommand.ReadParams; + + FICommand.GetProp(prRowsProcessed, Value); + FRowsAffected := Value; + end; + + if FNonBlocking then + StopWait; + + if not IsQuery then begin//Leave connection alive in case of SELECT .Execute instead of .Open to perform Fetch + if UsedConnection.Options.DisconnectedMode and Connection.Connected then begin + //AutoCommit control + if not (UsedConnection.AutoCommit and AutoCommit) and + (UsedConnection.FTransactionID = '') then begin //Connection.GetInTransaction are not allowed here since it could be setted to True on + // Product level during Execuion without AutoCommit (ODAC, IBDAC) + //There is uncommitted transaction that was implicitly started by server + UsedConnection.FTransactionID := 'CRImplicitTransaction'; //Set default value + UsedConnection.FTransactionID := UsedConnection.GetTransactionID; //To return product specific TransactionId + //or even reset InTransaction in case of transaction-free server operation + end + else + if UsedConnection.AutoCommit and AutoCommit then begin + UsedConnection.FTransactionID := UsedConnection.GetTransactionID; //To return product specific TransactionId + end; + end; + EndConnection; //we should read all Out parameters before disconnect + //In NonBlocking Mode this event must be called exactly after server execute + end; + if Assigned(FAfterExecute) then + FAfterExecute(Self, Result); +end; + +procedure TCustomDADataSet.DoAfterExecFetch(Result: boolean); +begin + if Result then + FCommand.ReadParams; + + if FNonBlocking then begin + if Result then begin + if State <> dsInactive then + Resync([]) + end + else + Close; + + if not(FetchAll and Result) then + StopWait; + EnableControls; + end; + + if Assigned(FAfterExecute) then + FAfterExecute(Self, Result); +end; + +procedure TCustomDADataSet.DoAfterFetchAll(Result: boolean); +begin + if FNonBlocking then begin + StopWait; + if Trim(IndexFieldNames) <> '' then + Resync([]); + end; +end; + +procedure TCustomDADataSet.DoAfterScroll; +begin + if FFetchCanceled then begin + Resync([]); + FFetchCanceled := False; + end; + + inherited; +end; + +procedure TCustomDADataSet.DoOnBeforeFetch(out Cancel: boolean); +begin + if not FNonBlocking then + StartWait; + + if Assigned(FBeforeFetch) then + FBeforeFetch(Self, Cancel); + FFetchCanceled := Cancel; + +end; + +procedure TCustomDADataSet.DoOnAfterFetch; +begin + if not FFetchAll or (FICommand.GetCursorState = csFetched) then + if Assigned(FAfterFetch) then + FAfterFetch(Self); + + if FIRecordSet.CanDisconnect then + EndConnection; //Close connection after all data was fetched. +end; + +procedure TCustomDADataSet.DoOnDataChanged; +begin + Resync([]); +end; + +function TCustomDADataSet.Executing: boolean; +var + Value: variant; +begin + FICommand.GetProp(prExecuting, Value); + Result := Value; +end; + +function TCustomDADataSet.Fetching: boolean; +begin + Result := FICommand.GetCursorState in [csFetching, csFetchingAll]; +end; + +function TCustomDADataSet.FetchingAll: boolean; +begin + Result := FICommand.GetCursorState = csFetchingAll; +end; + +function TCustomDADataSet.Fetched: boolean; +begin + Result := (FICommand.GetCursorState >= csFetched) or + Active and (FICommand.GetCursorState = csInactive); +end; + +procedure TCustomDADataSet.DoOnNewRecord; +var + DataSet: TDataSet; + MasterField, DetailField: TField; + MasterName: string; + DetailName: string; + MasterPos: integer; + DetailPos: integer; + + procedure LinkMDFields(const MasterName, DetailName: string); + begin + MasterField := DataSet.FindField(MasterName); + if Assigned(MasterField) then begin + DetailField := FindField(DetailName); + if Assigned(DetailField) and not DetailField.ReadOnly then // CR 11917 + DetailField.Assign(MasterField); + end; + end; + +begin + if (DataSource <> nil) then begin + DataSet := DataSource.DataSet; + if (DataSet <> nil) and DataSet.Active then begin + //MD link by MasteFields and DetailFields + if (FMasterFields <> '') and (FDetailFields <> '') then begin + MasterPos := 1; + DetailPos := 1; + while True do begin + MasterName := ExtractFieldName(FMasterFields, MasterPos); + DetailName := ExtractFieldName(FDetailFields, DetailPos); + if (MasterName <> '') and (DetailName <> '') then + LinkMDFields(MasterName, DetailName) + else + break; + end; + end; + //We couldn't link MD fields in case of undefined FMasterFields or FDetailFields + //cause there is could be field names mismatch + end; + end; + + inherited; +end; + +{ Before / After UpdateExecute } + +function TCustomDADataSet.AssignedBeforeUpdateExecute: boolean; +begin + Result := Assigned(FBeforeUpdateExecute); +end; + +procedure TCustomDADataSet.DoBeforeUpdateExecute(Sender: TDataSet; StatementTypes: TStatementTypes; + Params: TDAParams); +begin + if AssignedBeforeUpdateExecute then + FBeforeUpdateExecute(Sender, StatementTypes, Params); +end; + +function TCustomDADataSet.AssignedAfterUpdateExecute: boolean; +begin + Result := Assigned(FAfterUpdateExecute); +end; + +procedure TCustomDADataSet.DoAfterUpdateExecute(Sender: TDataSet; StatementTypes: TStatementTypes; + Params: TDAParams); +begin + if AssignedAfterUpdateExecute then + FAfterUpdateExecute(Sender, StatementTypes, Params); +end; + +function TCustomDADataSet.GetActualFieldName(Field: TField): string; +var + FieldDesc: TFieldDesc; +begin + FieldDesc := GetFieldDesc(Field); + Result := GetActualFieldName(FieldDesc); +end; + +function TCustomDADataSet.GetActualFieldName(FieldDesc: TFieldDesc): string; +begin + Result := FieldDesc.Name; + if Result = '' then + Result := FieldDesc.ActualName; + Result := QuoteName(Result); +end; + +procedure TCustomDADataSet.GetCurrentKeys(out KeyFields: TFieldArray; out Values: variant); +var + KeyAndDataFields: TKeyAndDataFields; + KeyFieldsCount, DataFieldsCount: integer; + i, j: integer; + RecBuf: TRecordBuffer; + TmpVar: variant; + Delta: integer; + EmptyRecBuf: boolean; +begin + GetKeyAndDataFields(KeyAndDataFields, False); + KeyFieldsCount := Length(KeyAndDataFields.KeyFieldDescs); + DataFieldsCount := Length(KeyAndDataFields.DataFieldDescs); + SetLength(KeyFields, KeyFieldsCount); + Values := Unassigned; + + EmptyRecBuf := not GetActiveRecBuf(RecBuf); + + if KeyFieldsCount = 1 then begin + KeyFields[0] := GetField(KeyAndDataFields.KeyFieldDescs[0]); + if not EmptyRecBuf then + Data.GetFieldAsVariant(KeyAndDataFields.KeyFieldDescs[0].FieldNo, RecBuf, Values); + end + else + if KeyFieldsCount > 1 then begin + Values := VarArrayCreate([0, KeyFieldsCount - 1], varVariant); + for i := 0 to KeyFieldsCount - 1 do begin + KeyFields[i] := GetField(KeyAndDataFields.KeyFieldDescs[i]); + Values[i] := Unassigned; + if not EmptyRecBuf then begin + Data.GetFieldAsVariant(KeyAndDataFields.KeyFieldDescs[i].FieldNo, RecBuf, TmpVar); + Values[i] := TmpVar; + end; + end; + end + else + if (KeyFieldsCount = 0) and (DataFieldsCount > 0) then begin + Delta := 0; + Assert(FSQLGenerator <> nil); + for i := DataFieldsCount - 1 downto 0 do + if FSQLGenerator.IsBlobDataType(KeyAndDataFields.DataFieldDescs[i].DataType) or + FSQLGenerator.IsObjectDataType(KeyAndDataFields.DataFieldDescs[i].DataType) + then begin + Inc(Delta); + for j := i to DataFieldsCount - Delta - 1 do + KeyAndDataFields.DataFieldDescs[j] := KeyAndDataFields.DataFieldDescs[j + 1]; + end; + + SetLength(KeyFields, DataFieldsCount - Delta); + Values := VarArrayCreate([0, DataFieldsCount - Delta - 1], varVariant); + for i := 0 to DataFieldsCount - Delta - 1 do begin + KeyFields[i] := GetField(KeyAndDataFields.DataFieldDescs[i]); + Values[i] := Unassigned; + if not EmptyRecBuf then begin + Data.GetFieldAsVariant(KeyAndDataFields.DataFieldDescs[i].FieldNo, RecBuf, TmpVar); + Values[i] := TmpVar; + end; + end; + end; +end; + +procedure TCustomDADataSet.DataReopen; +begin + if Data.IsFullReopen then + ClearCachedKeyAndDataFields; + + Data.Reopen; +end; + +procedure TCustomDADataSet.InternalRefresh; +var + MessageID: cardinal; + KeyFields: TFieldArray; + Values: variant; + + KeyFieldsReaded, Retry: boolean; +begin + if UsedConnection <> nil then + UsedConnection.PushOperation(clRefresh, OpenCursorAllowFailOver); + try + KeyFieldsReaded := False; + BeginConnection; + repeat + Retry := False; + try + if not KeyFieldsReaded then + GetCurrentKeys(KeyFields, Values); + KeyFieldsReaded := True; //this will allow us to restore active record after failover + if FOptions.QueryRecCount then + FRecordCount := GetRecCount + else + FRecordCount := 0; + + if not FLockDebug and (TDASQLMonitorClass(UsedConnection.SQLMonitorClass).HasMonitor or Debug) then + TDASQLMonitorClass(UsedConnection.SQLMonitorClass).SQLExecute(Self, FinalSQL, FParams, 'Refresh', MessageID, True); + + StartWait; + FCommand.WriteParams; + + inherited; + + if not FLockDebug and (TDASQLMonitorClass(UsedConnection.SQLMonitorClass).HasMonitor or Debug) then + TDASQLMonitorClass(UsedConnection.SQLMonitorClass).SQLExecute(Self, FinalSQL, FParams, 'Refresh', MessageID, False); + + FRowsAffected := -1; + + if Length(KeyFields) = 0 then // CR N 11512 + First + else begin + DoBeforeScroll; + if not LocateRecord(KeyFields, Values, [], False) then + First + else begin + Resync([]); + DoAfterScroll; + end; + end; + + except + on E: Exception do begin +{ if FNonBlocking then begin + EnableControls; + StopWait; + end;} + if E is EFailOver then begin + UsedConnection.RestoreAfterFailOver; + Retry := True + end + else + raise; + end; + end; + + until not Retry; + finally + if UsedConnection <> nil then + UsedConnection.PopOperation; + end; +end; + +procedure TCustomDADataSet.InternalRefreshQuick(const CheckDeleted: boolean); +var + KeyAndDataFields: TKeyAndDataFields; + +var + OldStrictUpdate, OldFiltered: boolean; + KeyFields: TFieldArray; + Values: variant; + KeyFieldsCount: integer; + +begin + DoBeforeRefresh; + + BeginConnection; + try + CheckActive; + + GetKeyAndDataFields(KeyAndDataFields, False); + KeyFieldsCount := Length(KeyAndDataFields.KeyFieldDescs); + if KeyFieldsCount = 0 then + DatabaseError(SKeyFieldsReq); + + CheckBrowseMode; + if FUpdatingTableInfoIdx = - 1 then + Exit; + + OldStrictUpdate := Options.StrictUpdate; + OldFiltered := Filtered; + DisableControls; + try + Filtered := False; + Options.StrictUpdate := False; + GetCurrentKeys(KeyFields, Values); + + if CheckDeleted and not IsEmpty then + PerformSQL('', [stRefreshCheckDeleted]); + + PerformSQL('', [stRefreshQuick]); + + if not Locate(KeyFields, Values, []) then + First; + finally + Options.StrictUpdate := OldStrictUpdate; + Filtered := OldFiltered; + EnableControls; + DoAfterRefresh; + end; + + finally + EndConnection; + end; +end; + +procedure TCustomDADataSet.InternalClose; +var + i: integer; +begin + try + try + inherited; + except + on E: EDAError do // Borland's bug in DoInternalClose with FBufferCount + if not(UsedConnection.IsFatalError(E)) then + raise; + else + raise; + end; + finally + FIdentityField := nil; + if not Prepared then begin // In case that User doesn't call Prepare directly + FIRecordSet.TablesInfo.Clear; + FUpdatingTableInfoIdx := -1; + end; + ClearCachedKeyAndDataFields; + + for i := 0 to Length(FLocalMDLinks) - 1 do + if not FLocalMDLinks[i].NativeBuffer then + Marshal.FreeHGlobal(FLocalMDLinks[i].Buffer); + SetLength(FLocalMDLinks, 0); + end; +end; + +function TCustomDADataSet.GetRecCount: longint; +begin + Result := 0; +end; + +procedure TCustomDADataSet.SetRefreshOptions(Value: TRefreshOptions); +begin + FRefreshOptions := Value; +end; + +{ Edit } + +procedure TCustomDADataSet.SetReadOnly(Value: boolean); +begin + FReadOnly := Value; +end; + +function TCustomDADataSet.IsNeedEditPreconnect: boolean; +begin + Result := False; +end; + +function TCustomDADataSet.IsNeedInsertPreconnect: boolean; +begin + Result := False; +end; + +procedure TCustomDADataSet.InternalBeforeEdit; +begin +end; + +procedure TCustomDADataSet.InternalEdit; +begin + if IsNeedEditPreconnect then + BeginConnection; + try + InternalBeforeEdit; + + inherited; + except + if IsNeedEditPreconnect then + EndConnection; + raise; + end; +end; + +procedure TCustomDADataSet.InternalInsert; +begin + if IsNeedInsertPreconnect then + BeginConnection; + try + inherited; + except + if IsNeedInsertPreconnect then + EndConnection; + end; +end; + +function TCustomDADataSet.IsPreconnected : boolean; +begin + Result := ((State = dsEdit) and IsNeedEditPreconnect) or + ((State = dsInsert) and IsNeedInsertPreconnect); +end; + +procedure TCustomDADataSet.InternalCancel; +begin + try + inherited; + finally + if IsPreconnected then + EndConnection; + end; +end; + +procedure TCustomDADataSet.InternalPost; +var + DataSet: TDataSet; + MasterField, DetailField: TField; + MasterName: string; + DetailName: string; + MasterPos: integer; + DetailPos: integer; + RemoveRecord: Boolean; +begin + try + inherited; + + if IsConnectedToMaster then begin + DataSet := DataSource.DataSet; + if (DataSet <> nil) and (DataSet.Active) then begin + MasterPos := 1; + DetailPos := 1; + While True do begin + MasterName := ExtractFieldName(FMasterFields, MasterPos); + DetailName := ExtractFieldName(FDetailFields, DetailPos); + if (MasterName <> '') and (DetailName <> '') then begin + MasterField := DataSet.FindField(MasterName); + if Assigned(MasterField) then begin + DetailField := FindField(DetailName); + if Assigned(DetailField) then begin // Fixed bug with case insensitive master/detail + if (not UsedConnection.IsCaseSensitive) and + (VarType(DetailField.AsVariant) = {$IFDEF CLR} varChar {$ELSE} varString {$ENDIF}) and + (VarType(MasterField.AsVariant) = {$IFDEF CLR} varChar {$ELSE} varString {$ENDIF}) then + RemoveRecord := AnsiCompareTextS(DetailField.AsVariant, MasterField.AsVariant) <> 0 + else + if (not UsedConnection.IsCaseSensitive) and + (VarType(DetailField.AsVariant) = {$IFDEF CLR} varChar {$ELSE} varOleStr {$ENDIF}) and + (VarType(MasterField.AsVariant) = {$IFDEF CLR} varChar {$ELSE} varOleStr {$ENDIF}) then + RemoveRecord := AnsiStrICompWS(DetailField.AsVariant, MasterField.AsVariant) <> 0 + else + RemoveRecord := not VarEqual(DetailField.AsVariant, MasterField.AsVariant); + if RemoveRecord then begin + Assert(not CachedUpdates, 'Can not use Master/Detail with CachedUpdates'); + FIRecordSet.RemoveRecord; + Exit; + end; + end; + end; + end + else + break; + end; + end; + end; + + if (State = dsInsert) and not CachedUpdates and (roAfterInsert in RefreshOptions) and + RefreshAfterInsertAllowed + then + InternalRefreshRecord; + finally + if IsPreconnected then + EndConnection; + end; +end; + +procedure TCustomDADataSet.InternalDeferredPost; +begin + FActiveRecRefresh := True; + try + inherited; + + if (State = dsInsert) and not CachedUpdates and (roAfterInsert in RefreshOptions) and + RefreshAfterInsertAllowed + then + InternalRefreshRecord; + finally + FActiveRecRefresh := False; + end; +end; + +procedure TCustomDADataSet.CreateSQLGenerator; +begin + SetSQLGenerator(TDASQLGenerator.Create(Self)); +end; + +procedure TCustomDADataSet.FreeSQLGenerator; +begin + FSQLGenerator.Free; + FSQLGenerator := nil; +end; + +procedure TCustomDADataSet.SetSQLGenerator(Value: TDASQLGenerator); +begin + FreeSQLGenerator; + FSQLGenerator := Value; +end; + +function TCustomDADataSet.GetUpdateStatement(const StatementType: TStatementType): string; +var + UpdateSQL: TStrings; + SelectSQL: string; +begin + UpdateSQL:= FUpdateSQL[StatementType]; + if UpdateSQL = nil then + Result := '' + else + begin + Result := UpdateSQL.Text; + if StatementType = stRefresh then begin + Result := Trim(Result); + if Pos('WHERE', AnsiUpperCase(Result)) = 1 then begin + if SQLGeneratorCompatibility then + SelectSQL := BaseSQL + else + SelectSQL := Self.SQL.Text; + Result := SQLAddWhere(SelectSQL, Trim(Copy(Result, 6, Length(Result)))); + end; + end; + end; +end; + +function TCustomDADataSet.GetUpdateSQLStatementTypes: TStatementTypes; +begin + Result := [stInsert, stDelete, stUpdate, stRefresh]; +end; + +procedure TCustomDADataSet.SetUpdateSQLIndex(Index: integer; Value: TStrings); +begin + with FUpdateSQL[TStatementType(Index)] do begin + BeginUpdate; + try + Assign(Value); + finally + EndUpdate; + end; + end; +end; + +function TCustomDADataSet.GetUpdateSQLIndex(Index: integer): TStrings; +begin + Result := FUpdateSQL[TStatementType(Index)]; +end; + +procedure TCustomDADataSet.GetIdentityField; +begin +end; + +procedure TCustomDADataSet.GetKeyAndDataFields(out KeyAndDataFields: TKeyAndDataFields; + const ForceUseAllKeyFields: boolean); +begin +end; + +procedure TCustomDADataSet.ClearCachedKeyAndDataFields; +begin + SetLength(FCachedKeyAndDataFields[False].KeyFieldDescs, 0); + SetLength(FCachedKeyAndDataFields[False].DataFieldDescs, 0); + SetLength(FCachedKeyAndDataFields[True].KeyFieldDescs, 0); + SetLength(FCachedKeyAndDataFields[True].DataFieldDescs, 0); +end; + +function TCustomDADataSet.PerformAppend: boolean; +begin + Result := PerformSQL('', [stInsert]); + + if Result then begin + GetIdentityField; + + // Additional InternalRefreshRecord (for CachedUpdates = False) call is + // moved to InternalPost in order to avoid bug with TMemData.PutRecord in + // PerformSQL. + if (roAfterInsert in RefreshOptions) and FInCacheProcessing and + RefreshAfterInsertAllowed + then + InternalRefreshRecord; + end; +end; + +function TCustomDADataSet.PerformDelete: boolean; +begin + Result := PerformSQL('', [stDelete]); +end; + +function TCustomDADataSet.PerformUpdate: boolean; +begin + Result := PerformSQL('', [stUpdate]); + + if Result and (roAfterUpdate in RefreshOptions) then + InternalRefreshRecord; +end; + +procedure TCustomDADataSet.InternalRefreshRecord; +begin + if CachedUpdates and (UpdateStatus = usModified) and (not FInCacheProcessing) then + RevertRecord; {TODO -cMemoryLeak: cause memory leak and DisposeBuf failed} + FreeRefComplexFields(ActiveBuffer); + PerformSQL('', [stRefresh]); +end; + +procedure TCustomDADataSet.Resync(Mode: TResyncMode); +begin + // this need if Resync called for closed dataset (AV BUG !!!) + if Active then + inherited; +end; + +procedure TCustomDADataSet.GetDetailLinkFields(MasterFields, DetailFields: {$IFDEF CLR}TObjectList{$ELSE}TList{$ENDIF}); + + function AddFieldToList(const FieldName: string; DataSet: TDataSet; + List: TList): Boolean; + var + Field: TField; + begin + Field := DataSet.FindField(FieldName); + if (Field <> nil) then + List.Add(Field); + Result := Field <> nil; + end; + +var + i: Integer; + + DataSet: TDataSet; + MasterName: string; + DetailName: string; + MasterPos: integer; + DetailPos: integer; +begin + MasterFields.Clear; + DetailFields.Clear; + if (DataSource <> nil) and (DataSource.DataSet <> nil) then begin + if Params.Count > 0 then + begin + for i := 0 to Params.Count - 1 do + if AddFieldToList(Params[i].Name, DataSource.DataSet, MasterFields) then + AddFieldToList(Params[i].Name, Self, DetailFields) + end + else + if (Self.MasterFields <> '') and (Self.DetailFields <> '') then + begin + DataSet := DataSource.DataSet; + if (DataSet <> nil) and DataSet.Active then begin + MasterPos := 1; + DetailPos := 1; + while True do begin + MasterName := ExtractFieldName(FMasterFields, MasterPos); + DetailName := ExtractFieldName(FDetailFields, DetailPos); + if (MasterName = '') or (DetailName = '') then + Break; + if AddFieldToList(MasterName, DataSource.DataSet, MasterFields) then + AddFieldToList(DetailName, Self, DetailFields); + end; + end; + end; + end; +end; + +function TCustomDADataSet.FindKey(const KeyValues: array of const): Boolean; + function GetKeyValue(Index: integer): variant; // nearly copied from TField.AssignValue + procedure Error; + begin + DatabaseErrorFmt(SFieldValueError, [IntToStr(Index)]); + end; + {$IFDEF CLR} + var + Value: Variant; + {$ENDIF} + begin + Result := Unassigned; + {$IFDEF CLR} + Value := Variant(KeyValues[Index]); + case VarType(Value) of + varInteger, varSmallInt, varShortInt, varByte, varWord, varLongWord, varInt64, varUInt64: + Result := Integer(Value); + varBoolean: + Result := Boolean(Value); + varChar, varString: + Result := String(Value); + varDouble, varSingle: + Result := Double(Value); + varObject: + Result := Value; + varEmpty, varNull: + {Clear}; + varDateTime, varDate: + Result := TDateTime(Value); + {varDecimal: + AsBcd := Value;} + varCurrency: + Result := Currency(Value); + else + Error; + end; + {$ELSE} + with KeyValues[Index] do + case VType of + vtInteger: + Result := Integer(VInteger); + vtInt64: begin /// CR-D12558 + {$IFDEF VER6P} + Result := VInt64^; + {$ELSE} + TVarData(Result).VType := varDecimal; + TVarDataD6(Result).VInt64 := VInt64^; + {$ENDIF} + end; + vtBoolean: + Result := Boolean(VBoolean); + vtChar: + Result := String(VChar); + vtExtended: + Result := Extended(VExtended^); + vtString: + Result := String(VString^); + vtPointer, vtObject: + if VPointer <> nil then Error; + vtPChar: + Result := String(VPChar); + vtAnsiString: + Result := String(VAnsiString); + vtCurrency: + Result := Currency(VCurrency^); + vtVariant: + if not {$IFDEF VER6P}VarIsClear{$ELSE}VarIsEmpty{$ENDIF}(VVariant^) then + Result := Variant(VVariant^); + vtWideString: + Result := WideString(VWideString); + else + Error; + end; + {$ENDIF} + end; + +var + KeyAndDataFields: TKeyAndDataFields; + Values: variant; + KeyFieldsCount: integer; + KeyFields: TFieldArray; + i: integer; +begin + CheckBrowseMode; + GetKeyAndDataFields(KeyAndDataFields, False); + + Values := Unassigned; // To prevent warning + KeyFieldsCount := Length(KeyAndDataFields.KeyFieldDescs); + SetLength(KeyFields, KeyFieldsCount); + case KeyFieldsCount of + 0: + DatabaseError(SKeyFieldsRequired); + 1: begin + KeyFields[0] := GetField(KeyAndDataFields.KeyFieldDescs[0]); + Values := GetKeyValue(0); + end; + else + begin + Values := VarArrayCreate([0, KeyFieldsCount - 1], varVariant); + for i := 0 to KeyFieldsCount - 1 do begin + KeyFields[i] := GetField(KeyAndDataFields.KeyFieldDescs[i]); + + if i <= High(KeyValues) then + Values[i] := GetKeyValue(i) + else + Values[i] := Unassigned; + end; + end; + end; + + Result := LocateEx(KeyFields, Values, FFindKeyOptions); +end; + +procedure TCustomDADataSet.FindNearest(const KeyValues: array of const); +begin + FFindKeyOptions := [lxNearest]; + try + FindKey(KeyValues); + finally + FFindKeyOptions := []; + end; +end; + +procedure TCustomDADataSet.GotoCurrent(DataSet: TCustomDADataSet); +var + KeyFields: TFieldArray; + Values: variant; +begin + DataSet.GetCurrentKeys(KeyFields, Values); + if (Length(KeyFields) = 0) or not Locate(KeyFields, Values, []) then + First; +end; + +procedure TCustomDADataSet.InternalApplyUpdates(AllowFailOver: boolean); +var + ReApply: boolean; +begin + if (UsedConnection <> nil) then + UsedConnection.PushOperation(clApply, AllowFailOver); //Add ApplyUpdates Operation to Operations Stack (FailOver) + try + repeat + ReApply := False; + try + inherited ApplyUpdates; + + except + on E: EFailOver do + if E.FConnLostCause = clApply then begin + UsedConnection.RestoreAfterFailOver; + ReApply := True; + end + else + raise; + end; + until (not ReApply); + finally + if UsedConnection <> nil then + UsedConnection.PopOperation; //Remove ApplyUpdates Operation from Operations Stack + end; +end; + + +procedure TCustomDADataSet.ApplyUpdates; +begin + if UsedConnection = nil then + DatabaseError(SConnectionNotDefined); + + InternalApplyUpdates(not UsedConnection.InTransaction and not AutoCommit); +end; + +procedure TCustomDADataSet.RefreshRecord; +begin + CheckActive; + + case State of + dsInsert: + begin + Cancel; + Exit; + end; + dsEdit: + Cancel; + dsSetKey: + Post; + end; + + if not IsEmpty then begin + UpdateCursorPos; + InternalRefreshRecord; + if FRowsAffected = 0 then begin + // remove deleted record from dataset + if Options.RemoveOnRefresh then + FIRecordSet.RemoveRecord; + Resync([]); + end + else + if FRowsAffected > 0 then + Resync([]); + //DataEvent(deRecordChange, 0); + end; +end; + +procedure TCustomDADataSet.AssignFieldValue(Param: TDAParam; Field: TField; + Old: boolean); +begin + if Param.IsObjectDataType(Field.DataType) then begin + Param.DataType := Field.DataType; + Param.ParamObject := GetFieldObject(Field); + end + else + if Old then + Param.AssignFieldValue(Field, Field.OldValue) + else + Param.AssignFieldValue(Field, Field.NewValue); +end; + +procedure TCustomDADataSet.AssignFieldValue(Param: TDAParam; FieldDesc: TFieldDesc; Old: boolean); +var + FieldType: TFieldType; +begin + FieldType := GetFieldType(FieldDesc.DataType); + if Param.IsObjectDataType(FieldType) then begin + Param.DataType := FieldType; + Param.ParamObject := GetFieldObject(FieldDesc); + end + else + Assert(False, 'This overload should be used only for object fields'); +end; + +procedure TCustomDADataSet.CheckUpdateQuery(const StatementType: TStatementType); +begin + FUpdateQuery := FUpdateComponents[StatementType]; + if FUpdateQuery = nil then begin + Assert(UsedConnection <> nil); + FUpdateQuery := UsedConnection.CreateDataSet; + TCustomDADataSet(FUpdateQuery).FIRecordSet.Component := Self; + end + else + if FUpdateQuery is TCustomDADataSet then + TCustomDADataSet(FUpdateQuery).Connection := UsedConnection + else + if FUpdateQuery is TCustomDASQL then + TCustomDASQL(FUpdateQuery).Connection := UsedConnection + else + Assert(False, 'FUpdateQuery is ' + FUpdateQuery.ClassName); + + TDBAccessUtils.SetLockDebug(FUpdateQuery, True); + + if FUpdateQuery is TCustomDADataSet then begin + TCustomDADataSet(FUpdateQuery).Close; // To prevent exception raising on setting properties + TCustomDADataSet(FUpdateQuery).Options.TrimFixedChar := Options.TrimFixedChar; + TCustomDADataSet(FUpdateQuery).Options.TrimVarChar := Options.TrimVarChar; + TCustomDADataSet(FUpdateQuery).Options.FlatBuffers := True; + TCustomDADataSet(FUpdateQuery).Options.FullRefresh := Options.FullRefresh; + {$IFDEF HAVE_COMPRESS} + TCustomDADataSet(FUpdateQuery).Options.CompressBlobMode := Options.CompressBlobMode; + if StatementType in [stRefresh, stRefreshQuick, stRefreshCheckDeleted] then + TCustomDADataSet(FUpdateQuery).Options.LongStrings := Options.LongStrings; + {$ENDIF} + if StatementType = stBatchUpdate then begin + TCustomDADataSet(FUpdateQuery).ParamCheck := False; + TCustomDADataSet(FUpdateQuery).Params.Clear; + end; + end; + FUpdateComponents[StatementType] := FUpdateQuery; +end; + +/// UpdateExecute performes execute of the UpdateQuery. We need this procedure +/// to get two update models: with and without explicit prepare. +procedure TCustomDADataSet.UpdateExecute; +var + MessageID: cardinal; + i: integer; + St: string; +begin + if not FLockDebug and (TDASQLMonitorClass(UsedConnection.SQLMonitorClass).HasMonitor or Debug) then begin + St := ''; + for i := 0 to Integer(High(TStatementType)) do + if TStatementType(i) in StatementTypes then begin + if St <> '' then + St := St + ','; + St := St + Copy(GetEnumName(TypeInfo(TStatementType), i), 3, + Length(GetEnumName(TypeInfo(TStatementType), i))); + end; + TDASQLMonitorClass(UsedConnection.SQLMonitorClass).SQLExecute(Self, TDBAccessUtils.GetSQL(FUpdateQuery).Text, TDBAccessUtils.GetParams(FUpdateQuery), St, MessageID, True); + end; + + TDBAccessUtils.Execute(FUpdateQuery); + + if not FLockDebug and (TDASQLMonitorClass(UsedConnection.SQLMonitorClass).HasMonitor or Debug) then + TDASQLMonitorClass(UsedConnection.SQLMonitorClass).SQLExecute(Self, TDBAccessUtils.GetSQL(FUpdateQuery).Text, TDBAccessUtils.GetParams(FUpdateQuery), St, MessageID, False); +end; + +function TCustomDADataSet.IsAutoCommit: boolean; +begin + Result := AutoCommit; +end; + +function TCustomDADataSet.ShouldPrepareUpdateSQL: boolean; +begin + //this function must be overriden on the product level if Upate sql preparation is allowed + Result := False; +end; + +procedure TCustomDADataSet.CheckUpdateSQL(const SQL: string; const StatementTypes: TStatementTypes; + out ParamsInfo: TDAParamsInfo); +var + NewSQL, OldSQL: string; + StatementType: TStatementType; + stIdx: TStatementType; + CheckSQLNeeded: boolean; + UpdateObjectSQL: TStrings; + IsSQLAutoGenerated: boolean; + Index: Integer; + LockMacros: boolean; + LockAssembleSQL: boolean; + DisableScanParams: boolean; +begin + IsSQLAutoGenerated := False; + CheckSQLNeeded := True; + StatementType := stCustom; + for stIdx := Low(TStatementType) to High(TStatementType) do + if stIdx in StatementTypes then begin + if StatementType <> stCustom then + StatementType := stCustom + else + StatementType := stIdx; + if StatementType = stCustom then + Break; + end; + + FUpdateQuery := nil; + try + if Assigned(UpdateObject) then begin + FUpdateQuery := UpdateObject.GetObjectIndex(Ord(StatementType)); + if FUpdateQuery <> nil then begin + CheckSQLNeeded := False; + if TDBAccessUtils.GetSQL(FUpdateQuery).Count = 0 then + DatabaseError(SUpdateObjectEmptySQL); + end; + end; + if FUpdateQuery = nil then + CheckUpdateQuery(StatementType); + finally + Assert(FUpdateQuery <> nil, 'FUpdateQuery = nil. StatementTypes = ' + IntToStr(Word(StatementTypes))); + end; + + if CheckSQLNeeded then begin + TDBAccessUtils.SetAutoCommit(FUpdateQuery, + (StatementTypes * [stInsert, stUpdate, stDelete, stBatchUpdate] <> []) and IsAutoCommit); + + NewSQL := SQL; + if StatementType = stBatchUpdate then + NewSQL := PrepareBatch(FBatchSQLs.ToString) + else + if NewSQL = '' then begin + if Assigned(UpdateObject) then + UpdateObjectSQL := UpdateObject.GetSQLIndex(Ord(StatementType)) + else + UpdateObjectSQL := nil; + + if Assigned(UpdateObjectSQL) then + NewSQL := UpdateObjectSQL.Text; + + if NewSQL = '' then begin + NewSQL := GetUpdateStatement(StatementType); + if (NewSQL <> '') and (Macros.Count > 0) then + Macros.Expand(NewSQL); + + if NewSQL = '' then begin + IsSQLAutoGenerated := True; + if BatchUpdate then + Index := FBatchStatements + else + Index := -1; + + NewSQL := FSQLGenerator.GenerateSQL(StatementType, + not (csDesigning in ComponentState) and not Options.UpdateAllFields, + TDBAccessUtils.GetParams(FUpdateQuery), Index); + case StatementType of + stInsert, stUpdate, stDelete: + LockMacros := True; + else + LockMacros := False; + end; + LockAssembleSQL := (StatementType <> stRefreshQuick) and not (((Params.Count > 0) or Options.FullRefresh) and (StatementType = stRefresh)); + DisableScanParams := LockAssembleSQL; + TDBAccessUtils.SetSQLText(FUpdateQuery, NewSQL, + LockAssembleSQL, + LockMacros, + DisableScanParams); + ParamsInfo := FSQLGenerator.ParamsInfo; + end; + end; + end; + + // Check whether SQL text is the same. For multiple update operations. + if BatchUpdate and not ((StatementType = stBatchUpdate) or (StatementType = stLock) or (StatementType = stRefresh)) then begin + if not IsSQLAutoGenerated then + NewSQL := FCommand.ParseSQL(NewSQL, nil, ':' + FSQLGenerator.IndexedPrefix + IntToStr(FBatchStatements) + '_'); + if NewSQL <> '' then begin + if FBatchSQLs.Length <> 0 then + FBatchSQLs.Append(#13#10); + FBatchSQLs.Append(NewSQL); + FBatchSQLs.Append(';'); + inc(FBatchStatements); + end; + end; + + Assert(FUpdateQuery <> nil); + if not IsSQLAutoGenerated then begin + OldSQL := TDBAccessUtils.GetSQL(FUpdateQuery).Text; + NewSQL := NewSQL; + if OldSQL <> NewSQL then begin + TDBAccessUtils.GetParams(FUpdateQuery).Clear; /// Performance optimization - skipping reassigning old params values on changing SQL + TDBAccessUtils.GetSQL(FUpdateQuery).Text := NewSQL; + end; + end; + + //Used user defined SQL and internal update object used so we could prepare Update object to obtain some performance gain + if ShouldPrepareUpdateSQL and not UsedConnection.Options.DisconnectedMode and not BatchUpdate then begin + if FUpdateQuery is TCustomDADataSet then + TCustomDADataSet(FUpdateQuery).Options.AutoPrepare := not IsSQLAutoGenerated and (SQL = '') + else + if FUpdateQuery is TCustomDASQL then + TCustomDASQL(FUpdateQuery).Prepared := not IsSQLAutoGenerated and (SQL = ''); + end; + end; +end; + +function TCustomDADataSet.UseParamType: boolean; +begin + Result := False; +end; + +function TCustomDADataSet.FieldByParamName(var ParamName: string; var Old: boolean; var AFieldNo: integer): TField; +// Returns field that corresponds to ParamName + function FindFieldByFieldNo(FieldNo: integer): TField; + var + i: integer; + begin + for i := 0 to Fields.Count - 1 do begin + Result := Fields[i]; + if Result.FieldNo = FieldNo then + Exit; + end; + Result := nil; + end; + +var + e: integer; +begin + Old := CompareText(Copy(ParamName, 1, 4), 'OLD_') = 0; + Result := nil; + if Old then begin + Result := FindField(ParamName); + if Result <> nil then + Old := False // fieldname is starting with OLD_ + else + ParamName := Copy(ParamName, 5, Length(ParamName) - 4); + end; + + if Result = nil then begin + Val(ParamName, AFieldNo, e); + if e = 0 then + Result := FindFieldByFieldNo(AFieldNo) + else + AFieldNo := -1; + end + else begin + AFieldNo := -1; + end; + + if Result = nil then + Result := FindField(ParamName); +end; + +function TCustomDADataSet.BatchUpdate: boolean; +begin + Result := FInCacheProcessing and (FOptions.UpdateBatchSize > 1) and + not Assigned(UpdateObject); +end; + +function TCustomDADataSet.CanFlushBatch: boolean; +begin + Result := BatchUpdate and (FBatchStatements > 0) and (FBatchStatements >= FOptions.UpdateBatchSize); +end; + +procedure TCustomDADataSet.ClearBatch; +begin + FBatchSQLs.Length := 0; + FBatchParams.Clear; + FBatchStatements := 0; +end; + +procedure TCustomDADataSet.FlushBatch; +begin + if FBatchStatements > 0 then + try + PerformSQL('', [stBatchUpdate]); + finally + ClearBatch; + end; +end; + +function TCustomDADataSet.PrepareBatch(SQL: string): string; +begin + Result := SQL; +end; + +{$IFNDEF CLR} +type + _TParam = class(TCollectionItem) + private + FParamRef: TParam; + end; +{$ENDIF} + +function TCustomDADataSet.PerformSQL(const SQL: string; const StatementTypes: TStatementTypes): boolean; + + function FindFieldByFieldNo(FieldNo: integer): TField; + var + i: integer; + begin + for i := 0 to Fields.Count - 1 do begin + Result := Fields[i]; + if Result.FieldNo = FieldNo then + Exit; + end; + Result := nil; + end; + + function FindFieldDescByFieldNo(FieldNo: integer): TFieldDesc; + var + i: integer; + begin + for i := 0 to FIRecordSet.Fields.Count - 1 do begin + Result := FIRecordSet.Fields[i]; + if Result.FieldNo = FieldNo then + Exit; + end; + Result := nil; + end; + + function SuppressBatchPrefix(Value: string): string; + var + i,e: integer; + begin + Result := Value; + if BatchUpdate then begin + i := Pos(FSQLGenerator.IndexedPrefix, Value); + if i > 0 then begin + e := i + 2; + while (e <= Length(Result)) and (Result[e] <> '_') do + inc(e); + + {$IFDEF CLR}Borland.Delphi.{$ENDIF}System.Delete(Result, i, e - i + 1); + end; + end; + end; + + procedure WriteUQParams(ParamsInfo: TDAParamsInfo); + var + i: integer; + Param, Param1: TDAParam; + ParamName: string; + Old: boolean; + Field: TField; + AFieldNo: integer; + AFieldDesc: TFieldDesc; + Params: TDAParams; + LowIndex: integer; + + procedure AssignFieldValueEx(Param: TDAParam; Field: TField; Old: boolean); + begin + if UseParamType and + ((Param.ParamType = ptOutput) or (Param.ParamType = ptResult)) then begin + Param.DataType := Field.DataType; + Param.Value := Null; + end + else + AssignFieldValue(Param, Field, Old); + end; + + begin + {$IFDEF PERF_COUNTER} + PerfCounters[5].Start; + {$ENDIF} + + // assigning parameter values from fields of the same name + if BatchUpdate then begin + // copy parameters from UpdateQuery to common collection + if FBatchParams = nil then + FBatchParams := FCommand.CreateParamsObject; + + Params := TDBAccessUtils.GetParams(FUpdateQuery); + FBatchParams.BeginUpdate; + try + for i := 0 to Params.Count - 1 do begin + Param := FBatchParams.CreateParam(Params[i].DataType, Params[i].Name, Params[i].ParamType); + //FBatchParams.AddParam(Param); + {$IFNDEF CLR} + _TParam(Param).FParamRef := Param; + {$ENDIF} + end; + finally + FBatchParams.FNeedsUpdateItem := False; + FBatchParams.EndUpdate; + FBatchParams.FNeedsUpdateItem := True; + end; + + Params := FBatchParams; + LowIndex := Params.Count - TDBAccessUtils.GetParams(FUpdateQuery).Count; + end + else begin + Params := TDBAccessUtils.GetParams(FUpdateQuery); + LowIndex := 0; + end; + + for i := LowIndex to Params.Count - 1 do begin + Param := Params[i]; + AFieldNo := -1; + ParamName := ''; + Field := nil; + if (ParamsInfo <> nil) and not (stRefreshQuick in StatementTypes) and not ((Self.Params.Count > 0) and (stRefresh in StatementTypes)) then begin + Old := ParamsInfo.Items[i - LowIndex].Old; + Field := ParamsInfo.Items[i - LowIndex].Field; + end; + + if (ParamsInfo = nil) or (Field = nil) then begin + // should remove additional index before assigning value from field + ParamName := SuppressBatchPrefix(Param.Name); + if (MasterSource <> nil) and (MasterFields = '') and (DetailFields = '') and (Self.Params.Count > 0) and (stRefresh in StatementTypes) then begin + if FindParam(ParamName) = nil then + Field := FieldByParamName(ParamName, Old, AFieldNo) + end + else + Field := FieldByParamName(ParamName, Old, AFieldNo); + end; + + if Field <> nil then + AssignFieldValueEx(Param, Field, Old and (not ((State = dsInsert) and not FInDeferredPost))) // OldValue is Null on Insert + else begin + Assert(ParamName <> ''); + + AFieldDesc := nil; + if AFieldNo >= 0 then + AFieldDesc := FindFieldDescByFieldNo(AFieldNo); + if AFieldDesc = nil then + AFieldDesc := FIRecordSet.FindField(ParamName); + if (AFieldDesc <> nil) and (AFieldDesc.DataType in [dtObject,dtArray]) then // object fields in not objectview + AssignFieldValue(Param, AFieldDesc, False) + else begin + Param1 := FindParam(ParamName); + if (Param1 <> nil) and ((stRefresh in StatementTypes) or (stRefreshQuick in StatementTypes)) then + Param.Assign(Param1) // assign param from param of SQL + else + if not AssignedBeforeUpdateExecute then + DatabaseError(Format(SNoCorrespondParam, [Param.Name])); + end; + end; + if stRefreshQuick in StatementTypes then + SetMasterParams(Params); + if not UseParamType then + Param.ParamType := ptInput; + end; + {$IFDEF PERF_COUNTER} + PerfCounters[5].Stop; + {$ENDIF} + end; + + procedure ReadUQParams(RecordSet: TCRRecordSet; Buffer: TValueBuffer; ParamsInfo: TDAParamsInfo); + var + i: integer; + Param: TDAParam; + ParamName: string; + Old: boolean; + Field: TField; + AFieldNo: integer; + FieldDesc: TFieldDesc; + RecBuf: TRecordBuffer; + IsBlank: boolean; + SharedObject: TSharedObject; + ReadOnly: boolean; + + begin + {$IFDEF PERF_COUNTER} + PerfCounters[5].Start; + {$ENDIF} + for i := 0 to TDBAccessUtils.GetParams(FUpdateQuery).Count - 1 do begin + Param := TDBAccessUtils.GetParams(FUpdateQuery)[i]; + if UseParamType then + if Param.ParamType < ptOutput then + Continue; + + if ParamsInfo <> nil then begin + Old := ParamsInfo.Items[i].Old; + Field := ParamsInfo.Items[i].Field; + end + else + begin + ParamName := Param.Name; + Field := FieldByParamName(ParamName, Old, AFieldNo); + end; + + if Assigned(Field) and not Old and CanRefreshField(Field) + then begin + ReadOnly := Field.ReadOnly; + if Field.ReadOnly then begin + SetTempState(State); // DisableControls + Field.ReadOnly := False; + end; + + FieldDesc := FIRecordSet.Fields[Field.FieldNo - 1]; + + if (Param.ParamObject <> nil) and (RecordSet <> nil) + and (RecordSet.IsComplexFieldType(FieldDesc.DataType) + and not((FieldDesc.DataType = dtExtString) + or (FieldDesc.DataType = dtExtWideString) + or (FieldDesc.DataType = dtExtVarBytes) + {$IFDEF VER5P}or (FieldDesc.DataType = dtVariant){$ENDIF})) + then begin + // pass SharedObject from parameter to recordset + if FInCacheProcessing then + RecBuf := FIRecordSet.NewCacheRecBuf + else + RecBuf := ActiveBuffer; + FIRecordSet.GetField(FieldDesc.FieldNo, RecBuf, Buffer, IsBlank); + SharedObject := TSharedObject(GetGCHandleTarget(Marshal.ReadIntPtr(Buffer))); + if SharedObject <> nil then + SharedObject.Free; + + SharedObject := Param.ParamObject; + SharedObject.AddRef; + + if Param.IsNull then begin + FIRecordSet.PutField(FieldDesc.FieldNo, RecBuf, Buffer); + FIRecordSet.SetNull(FieldDesc.FieldNo, RecBuf, True); + end + else + FIRecordSet.PutField(FieldDesc.FieldNo, RecBuf, Buffer); + + if (FieldDesc.DataType in [dtBlob, dtMemo, dtWideMemo]) and + (State in [dsInsert,dsEdit]) + then + TBlob(SharedObject).EnableRollback; + end + else + if Param.IsNull then + Field.NewValue := Null + else + if not VarEqual(Field.Value, Param.Value) then + Field.NewValue := Param.Value; + + if ReadOnly then begin + Field.ReadOnly := True; + RestoreState(State); + end + end; + end; + {$IFDEF PERF_COUNTER} + PerfCounters[5].Stop; + {$ENDIF} + end; + + procedure CopyRecBuf(SrcRecordSet: TData; SrcRecBuf: TRecordBuffer; Buffer: TValueBuffer); + var + i: integer; + RecBuf: TRecordBuffer; + FieldDesc: TFieldDesc; + FieldName: string; + FieldDescIdx: integer; + AFieldDesc: TFieldDesc; + RecordSetFieldNo: integer; + IsBlank: boolean; + SharedObject: TSharedObject; + Value, NewValue: variant; + Field: TField; + UQFieldDesc: TFieldDesc; + begin + if FInCacheProcessing then + RecBuf := FIRecordSet.NewCacheRecBuf + else + RecBuf := ActiveBuffer; + + for i := 0 to SrcRecordSet.FieldCount - 1 do + if not SrcRecordSet.Fields[i].HasParent then begin + FieldDesc := SrcRecordSet.Fields[i]; + FieldName := FieldDesc.Name; + + // FindField optimization + AFieldDesc := nil; + FieldDescIdx := FSQLGenerator.DecodeFieldIndex(FieldName); + if FieldDescIdx >= 0 then + AFieldDesc := FIRecordSet.Fields[FieldDescIdx]; + + if AFieldDesc = nil then + AFieldDesc := FIRecordSet.FindField(FieldDesc.Name); + if (AFieldDesc <> nil){ and CanRefreshField(Field) and} + then + if SrcRecordSet.IsComplexFieldType(FieldDesc.DataType) + and not((FieldDesc.DataType = dtExtString) + or (FieldDesc.DataType = dtExtWideString) + or (FieldDesc.DataType = dtExtVarBytes) + {$IFDEF VER5P}or (FieldDesc.DataType = dtVariant){$ENDIF}) + then begin + if (stRefresh in StatementTypes) or (stRefreshQuick in StatementTypes) then begin + RecordSetFieldNo := AFieldDesc.FieldNo; + FIRecordSet.GetField(RecordSetFieldNo, RecBuf, Buffer, IsBlank); + SharedObject := TSharedObject(GetGCHandleTarget(Marshal.ReadIntPtr(Buffer))); + if SharedObject <> nil then + SharedObject.Free; + + SrcRecordSet.GetField(FieldDesc.FieldNo, SrcRecBuf, Buffer, IsBlank); + SharedObject := TSharedObject(GetGCHandleTarget(Marshal.ReadIntPtr(Buffer))); + SharedObject.AddRef; + FIRecordSet.PutField(RecordSetFieldNo, RecBuf, Buffer); + + if IsBlank then begin + FIRecordSet.SetNull(RecordSetFieldNo, RecBuf, True); + if IsClass(SharedObject, TBlob) then // After RefreshRecord for Null Blob fields + TBlobUtils.SetModified(TBlob(SharedObject), False); // TBlob.Modified is True + end; + + if (FieldDesc.DataType in [dtBlob, dtMemo, dtWideMemo]) and + (State in [dsInsert,dsEdit]) + then + TBlob(SharedObject).EnableRollback; + end; + end + {$IFDEF VER5P} + else + if FieldDesc.DataType = dtVariant then begin + RecordSetFieldNo := AFieldDesc.FieldNo; + + UQFieldDesc := FIRecordSet.Fields[RecordSetFieldNo - 1]; + CopyBuffer(IntPtr(Integer(RecBuf) + UQFieldDesc.Offset), Buffer, sizeof(TVariantObject)); + + SharedObject := TSharedObject(GetGCHandleTarget(Marshal.ReadIntPtr(Buffer))); + if SharedObject <> nil then + SharedObject.Free; + + IsBlank := SrcRecordSet.GetNull(FieldDesc.FieldNo, SrcRecBuf); + UQFieldDesc := SrcRecordSet.Fields[FieldDesc.FieldNo - 1]; + CopyBuffer(IntPtr(Integer(SrcRecBuf) + UQFieldDesc.Offset), Buffer, sizeof(TVariantObject)); + + SharedObject := TSharedObject(GetGCHandleTarget(Marshal.ReadIntPtr(Buffer))); + SharedObject.AddRef; + + UQFieldDesc := FIRecordSet.Fields[RecordSetFieldNo - 1]; + CopyBuffer(Buffer, IntPtr(Integer(RecBuf) + UQFieldDesc.Offset), sizeof(TVariantObject)); + FIRecordSet.SetNull(RecordSetFieldNo, RecBuf, IsBlank); + end + {$ENDIF} + else begin + SrcRecordSet.GetFieldAsVariant(FieldDesc.FieldNo, + SrcRecBuf, NewValue); + {This code raises AV with disposed ExtStrings + if FieldDesc.DataType in [dtExtString, dtExtWideString, dtExtVarBytes] then + SrcRecordSet.PutFieldData(FieldDesc, SrcRecBuf, nil);} + Field := FindFieldByFieldNo(AFieldDesc.FieldNo); + if Field <> nil then begin + if stCheck in StatementTypes then begin + // check + if State in dsEditModes then + Value := Field.OldValue + else + Value := Field.NewValue; + + if not VarEqual(Value, NewValue) then + DatabaseError(SRecordChanged); + end + else + // refresh + if FActiveRecRefresh or FInCacheProcessing then begin // DeferredPost and CachedUpdates + if Field.ReadOnly then begin + SetTempState(State); // DisableControls + Field.ReadOnly := False; + Field.NewValue := NewValue; + Field.ReadOnly := True; + RestoreState(State); + end + else + Field.NewValue := NewValue; + end + else + FIRecordSet.PutFieldAsVariant(AFieldDesc.FieldNo, RecBuf, NewValue) + end; + end; + end; + if ((stRefresh in StatementTypes) or (stRefreshQuick in StatementTypes)) and + not FActiveRecRefresh and + not FInCacheProcessing + then begin + {if CachedUpdates then + FIRecordSet.RevertRecord; } /// ??? problem with one record + FIRecordSet.PutRecord(RecBuf); + Data.AddRefComplexFields(RecBuf); + PRecInfo(IntPtr(integer(RecBuf) + FRecInfoOfs)).RefComplexFields := True; + end; + end; + + procedure GetUQFields(const KeyFields: TFieldArray; out KeyFieldsUQ: TFieldArray); + var + i: integer; + begin + Assert(FUpdateQuery is TCustomDADataSet); + SetLength(KeyFieldsUQ, Length(KeyFields)); + for i := 0 to Length(KeyFields) - 1 do + KeyFieldsUQ[i] := TCustomDADataSet(FUpdateQuery).Fields.FindField(KeyFields[i].FieldName); + end; + + +var + i: integer; + RecordSet: TCRRecordSet; + RefreshRecBuf: TRecordBuffer; + RecBuf: TRecordBuffer; + Buffer: TValueBuffer; + s, OldIndexFieldNames: string; + KeyFields, KeyFieldsUQ: TFieldArray; + v: variant; + RQFieldDesc: TFieldDesc; + NewValue: variant; + + OldOnAppend: TOnModifyRecord; + ParamsInfo: TDAParamsInfo; + TempParams: TDAParams; + +begin + BeginConnection; + try + CheckUpdateSQL(SQL, StatementTypes, ParamsInfo); + + if TDBAccessUtils.GetSQL(FUpdateQuery).Count = 0 then begin + Result := False; + Exit; + end; + + if FUpdateQuery is TCustomDADataSet then + RecordSet := TCustomDADataSet(FUpdateQuery).FIRecordSet + else + RecordSet := nil; + + + if StatementTypes = [stBatchUpdate] then begin + TempParams := TDBAccessUtils.GetParams(FUpdateQuery); + TempParams.Assign(FBatchParams); + {$IFNDEF CLR} + for i := 0 to TempParams.Count - 1 do + _TParam(TCollection(TempParams).Items[i]).FParamRef := TParam(TCollection(TempParams).Items[i]); + {$ENDIF} + end + else + // assigning parameter values from fields of the same name + WriteUQParams(ParamsInfo); + + // No need to call events and UpdateExecute when collecting statemets + if not BatchUpdate or (StatementTypes = [stBatchUpdate]) then begin + DoBeforeUpdateExecute(Self, StatementTypes, TDBAccessUtils.GetParams(FUpdateQuery)); + if AssignedBeforeUpdateExecute then begin + for i:= 0 to TDBAccessUtils.GetParams(FUpdateQuery).Count - 1 do + if TDBAccessUtils.GetParams(FUpdateQuery)[i].DataType = ftUnknown then + DatabaseError(Format(SUnknownParamDataType, [TDBAccessUtils.GetParams(FUpdateQuery)[i].Name])); + end; + UpdateExecute(StatementTypes); + end; + + Buffer := Marshal.AllocHGlobal(sizeof(integer)); + try + if (StatementTypes = [stRefreshCheckDeleted]) and (FUpdateQuery is TCustomDADataSet) then begin + UpdateCursorPos; + First; + GetCurrentKeys(KeyFields, v); + GetUQFields(KeyFields, KeyFieldsUQ); + s := ''; + for i := Low(KeyFields) to High(KeyFields) do begin + if s <> '' then + s := s + ';' + GetActualFieldName(KeyFields[i]) + else + s := GetActualFieldName(KeyFields[i]); + end; + + OldIndexFieldNames := TCustomDADataSet(FUpdateQuery).IndexFieldNames; + try + TCustomDADataSet(FUpdateQuery).IndexFieldNames := s; + while not Eof do begin + GetCurrentKeys(KeyFields, v); + if not TCustomDADataSet(FUpdateQuery).Locate(KeyFieldsUQ, v, []) then + FIRecordSet.RemoveRecord; + Next; + end; + finally + TCustomDADataSet(FUpdateQuery).Close; + TCustomDADataSet(FUpdateQuery).IndexFieldNames := OldIndexFieldNames; + end; + Resync([]); + end + else + if (StatementTypes = [stRefreshQuick]) and (FUpdateQuery is TCustomDADataSet) then begin + // Refresh from fields and check + + FRowsAffected := TCustomDADataSet(FUpdateQuery).RecordCount; + + UpdateCursorPos; + RecordSet.AllocRecBuf(IntPtr(RefreshRecBuf)); + try + TCustomDADataSet(FUpdateQuery).First; + // Get key fields list from base DataSet + GetCurrentKeys(KeyFields, v); + GetUQFields(KeyFields, KeyFieldsUQ); + while not TCustomDADataSet(FUpdateQuery).Eof do begin + // And get values from FUpdateQuery + v := VarArrayCreate([0, Length(KeyFieldsUQ) - 1], varVariant); + for i := 0 to Length(KeyFieldsUQ) - 1 do + v[i] := KeyFieldsUQ[i].Value; + + if not LocateEx(KeyFields, v, []) then begin + FIRecordSet.AllocRecBuf(IntPtr(RecBuf)); + OldOnAppend := FIRecordSet.OnAppend; + try + FIRecordSet.OnAppend := nil; + FIRecordSet.InitRecord(RecBuf); + FIRecordSet.AppendRecord(RecBuf); + Resync([]); + finally + FIRecordSet.OnAppend := OldOnAppend; + FIRecordSet.FreeRecBuf(RecBuf); + end; + end; + + RecordSet.GetRecord(RefreshRecBuf); + CopyRecBuf(RecordSet, RefreshRecBuf, Buffer); + + for i := 0 to RecordSet.Fields.Count - 1 do begin + RQFieldDesc := RecordSet.Fields[i]; + if IsRefreshQuickField(RQFieldDesc) then begin + RecordSet.GetFieldAsVariant(RQFieldDesc.FieldNo, RefreshRecBuf, NewValue); + SaveMaxRefreshQuickValue(RQFieldDesc, NewValue); + end; + end; + + TCustomDADataSet(FUpdateQuery).Next; + end; + finally + Data.FreeRecBuf(RefreshRecBuf); + end; + FIRecordSet.SortItems; + Resync([]); + end + else + if ([stRefresh, stCheck] * StatementTypes <> []) and (FUpdateQuery is TCustomDADataSet) + and TCustomDADataSet(FUpdateQuery).IsQuery then begin + // Refresh from fields and check + FRowsAffected := TCustomDADataSet(FUpdateQuery).RecordCount; + + if FOptions.StrictUpdate and (FRowsAffected <> 1) then + DatabaseError(Format(SRefreshFailed, [FRowsAffected])); + + RecordSet.AllocRecBuf(IntPtr(RefreshRecBuf)); + try + RecordSet.SetToBegin; // temp + RecordSet.GetNextRecord(RefreshRecBuf); + if not RecordSet.EOF then + CopyRecBuf(RecordSet, RefreshRecBuf, Buffer); + finally + Data.FreeRecBuf(RefreshRecBuf); + end; + end + else + // strict update and DMLRefresh don't work in BatchUpdate mode + if not BatchUpdate then begin + FRowsAffected := TDBAccessUtils.GetRowsAffected(FUpdateQuery); + + if FOptions.StrictUpdate and + //(Command.SQLType in [SQL_INSERT,SQL_UPDATE,SQL_DELETE]) and /// for ODAC + ((FRowsAffected = 0) or (FRowsAffected > 1)) + then + DatabaseError(Format(SUpdateFailed, [FRowsAffected])); + + // Refresh fields from params of the same name + if NeedReturnParams or (stRefresh in StatementTypes) then // DML Refresh + ReadUQParams(RecordSet, Buffer, ParamsInfo); + end; + + // No need to call events and UpdateExecute when collecting statemets + if not BatchUpdate or (StatementTypes = [stBatchUpdate]) then + DoAfterUpdateExecute(Self, StatementTypes, TDBAccessUtils.GetParams(FUpdateQuery)); + + Result := True; + finally + Marshal.FreeHGlobal(Buffer); + if FUpdateQuery is TCustomDADataSet then + TCustomDADataSet(FUpdateQuery).Close; + end; + finally + EndConnection; + end; +end; + +function TCustomDADataSet.RefreshAfterInsertAllowed: boolean; +begin + Result := True; +end; + +function TCustomDADataSet.IsRefreshQuickField(FieldDesc: TFieldDesc): boolean; +begin + Result := False; +end; + +procedure TCustomDADataSet.SaveMaxRefreshQuickValue(FieldDesc: TFieldDesc; const Value: variant); +begin +end; + +function TCustomDADataSet.GetCanModify: boolean; +begin + Result := not (ReadOnly or UniDirectional) and + (LocalUpdate or + CachedUpdates and Assigned(OnUpdateRecord) or + Assigned(UpdateObject)); +end; + +procedure TCustomDADataSet.SetStateFieldValue(State: TDataSetState; Field: TField; const Value: Variant); // Need to support int64 fields on PerformSQL in RefreshRecord +var + SaveState: TDataSetState; +{$IFNDEF VER6P} + i64: int64; +{$ENDIF} +begin + if not (Field is TLargeintField) then + inherited + else + begin + // Nearly copied from inherited + if Field.FieldKind <> fkData then Exit; + {$IFNDEF VER6P} + if not TVarDataD6(Value).VType in [varSmallint, varInteger, varByte, $12{vt_ui2}, $13{vt_ui4}] then begin + inherited; + exit; + end; + + i64 := TVarDataD6(Value).VInt64; + {$ENDIF} + + SaveState := SetTempState(State); + try + {$IFDEF VER6P} + if VarIsNull(Value) then + Field.Clear + else + TLargeintField(Field).AsLargeInt := Value; + {$ELSE} + TLargeintField(Field).AsLargeInt := i64; + {$ENDIF} + finally + RestoreState(SaveState); + end; + end; +end; + +function TCustomDADataSet.CanRefreshField(Field: TField): boolean; +begin + Result := True; +end; + +function TCustomDADataSet.NeedReturnParams: boolean; +begin + Result := FOptions.ReturnParams; +end; + +{ Master/Detail } + +procedure TCustomDADataSet.RefreshParams; +var + DataSet: TDataSet; +begin + FreeRefBuffers; + + if FDataLink.DataSource <> nil then begin + DataSet := FDataLink.DataSource.DataSet; + if DataSet <> nil then + if DataSet.Active and (DataSet.State <> dsSetKey) then begin + if SetMasterParams(Params) then begin // need refresh + {$IFDEF MSWINDOWS} + if (FDetailRefreshTimer = nil) or (FDetailRefreshTimer.Interval = 0) then + RefreshDetail(nil) + else begin + FDetailRefreshTimer.Enabled := False; //reset time period + FDetailRefreshTimer.Enabled := True; + end; + {$ELSE} + RefreshDetail(nil) + {$ENDIF} + end; + end; + end; +end; + +{$IFDEF MSWINDOWS} +procedure TCustomDADataSet.CheckRefreshDetailTimer; +begin + if FDetailRefreshTimer = nil then begin + FDetailRefreshTimer := {$IFDEF CLR}TTimer{$ELSE}TWin32Timer{$ENDIF}.Create(Self); + FDetailRefreshTimer.Enabled := False; + FDetailRefreshTimer.OnTimer := RefreshDetail; + end; +end; +{$ENDIF} + +procedure TCustomDADataSet.RefreshDetail(Sender: TObject); +var + MessageID: cardinal; +begin +{$IFDEF MSWINDOWS} + if FDetailRefreshTimer <> nil then + FDetailRefreshTimer.Enabled := False; +{$ENDIF} + + if FOptions.LocalMasterDetail then begin + FIRecordSet.FilterUpdated; + Resync([]); + First; + end + else begin + if not FLockDebug and (TDASQLMonitorClass(UsedConnection.SQLMonitorClass).HasMonitor or Debug) then + TDASQLMonitorClass(UsedConnection.SQLMonitorClass).SQLExecute(Self, FinalSQL, FParams, 'Refresh', MessageID, True); + + BeginConnection; + + DisableControls; + try + StartWait; + // Refresh + FCommand.WriteParams; + {$IFDEF VER5P} + DoBeforeRefresh; + {$ENDIF} + CheckBrowseMode; + UpdateCursorPos; + try + DataReopen; + if FIRecordSet.IndexFields.Count > 0 then + FIRecordSet.SortItems; + finally + Resync([]); + {$IFDEF VER5P} + DoAfterRefresh; + if not IsEmpty then DoAfterScroll; + {$ENDIF} + end; + finally + EnableControls; + end; + + if not FLockDebug and (TDASQLMonitorClass(UsedConnection.SQLMonitorClass).HasMonitor or Debug) then + TDASQLMonitorClass(UsedConnection.SQLMonitorClass).SQLExecute(Self, FinalSQL, FParams, 'Refresh', MessageID, False); + + if FOptions.QueryRecCount then + FRecordCount := GetRecCount + else + FRecordCount := 0; + + FRowsAffected := -1; + end; +end; + +function TCustomDADataSet.NeedDetailRefresh(Param: TDAParam; FieldValue: TSharedObject): boolean; +begin + Result := False; + Param.ParamObject := FieldValue; +end; + +function TCustomDADataSet.SetMasterParams(AParams: TDAParams): boolean; +var + DataSet: TDataSet; + DADataSet: TCustomDADataSet; + Field: TField; + i: integer; + RecBuf: TRecordBuffer; + Buffer: IntPtr; + SharedObject: TSharedObject; + IsBlank: boolean; + + MasterField: TField; + MasterFieldDesc: TFieldDesc; + DetailField: TField; + DetailFieldDesc: TFieldDesc; + MasterPos: integer; + DetailPos: integer; + MasterName: string; + DetailName: string; + LinksCount: integer; +begin + Result := False; + + if FOptions.LocalMasterDetail then begin + Result := True; + Assert(DataSource.DataSet is TCustomDADataSet); + + if Length(FLocalMDLinks) > 0 then + for i := 0 to Length(FLocalMDLinks) - 1 do + if not FLocalMDLinks[i].NativeBuffer then + Marshal.FreeHGlobal(FLocalMDLinks[i].Buffer); + + LinksCount := 0; + if (DataSource <> nil) and (FMasterFields <> '') and (FDetailFields <> '') + then begin + DADataSet := TCustomDADataSet(DataSource.DataSet); + if (DADataSet <> nil) and DADataSet.Active then begin + MasterPos := 1; + DetailPos := 1; + while True do begin + MasterName := ExtractFieldName(FMasterFields, MasterPos); + DetailName := ExtractFieldName(FDetailFields, DetailPos); + if (MasterName <> '') and (DetailName <> '') then begin + MasterField := DADataSet.FindField(MasterName); + if Assigned(MasterField) then begin + DetailField := FindField(DetailName); + if Assigned(DetailField) then begin + SetLength(FLocalMDLinks, LinksCount + 1); + with FLocalMDLinks[LinksCount] do begin + DetailFieldDesc := Data.FindField(DetailField.FieldName); + MasterFieldDesc := DADataSet.GetFieldDesc(MasterField); + if DetailFieldDesc = nil then + raise Exception.Create(Format(SFieldNotFound, [DetailField.FieldName])); + if MasterFieldDesc = nil then + raise Exception.Create(Format(SFieldNotFound, [MasterField.FieldName])); //TODO: Field : cannot be used for local master/detail link + FieldNo := DetailFieldDesc.FieldNo; + Buffer := nil; + IsNull := MasterField.IsNull; + NativeBuffer := False; + if not IsNull then + if DetailFieldDesc.DataType = MasterFieldDesc.DataType then begin + if DADataSet.GetActiveRecBuf(RecBuf) then + FLocalMDLinks[LinksCount].Buffer := DADataSet.Data.GetFieldBuf(RecBuf, MasterFieldDesc, BufferType, IsNull, NativeBuffer); + end + else + CopyFieldValue(MasterField.Value, Buffer, BufferType, DetailFieldDesc); + end; + Inc(LinksCount); + end; + end; + end + else + break; + end; + end; + end; + end + else + if FDataLink.DataSource <> nil then begin + DataSet := FDataLink.DataSource.DataSet; + if DataSet <> nil then begin + for i := 0 to AParams.Count - 1 do begin + Field := DataSet.FindField(AParams[i].Name); + + if not Assigned(Field) then + Continue; + + AParams[i].DataType := Field.DataType; // set datatype for null Field value + if AParams[i].IsObjectDataType then begin + SharedObject := nil; + if (DataSet is TCustomDADataset) then + with TCustomDADataset(DataSet) do + if Field.FieldNo <> 0 then begin + if GetActiveRecBuf(RecBuf) then begin + Buffer := Marshal.AllocHGlobal(sizeof(IntPtr)); + try + Data.GetField(Field.FieldNo, RecBuf, Buffer, IsBlank); + SharedObject := TSharedObject(GetGCHandleTarget(Marshal.ReadIntPtr(Buffer))); + finally + Marshal.FreeHGlobal(Buffer); + end; + + end; + end + else + SharedObject := GetFieldObject(Field); + + Result := NeedDetailRefresh(AParams[i], SharedObject); + end + else + if (VarIsEmpty(AParams[i].Value) or not VarEqual(AParams[i].Value, Field.Value)) and + not (VarIsEmpty(AParams[i].Value) and Field.IsNull) then begin + AParams[i].AssignField(Field); + Result := True; + end; + AParams[i].ParamType := ptInput; + end; + end; + end; +end; + +function TCustomDADataSet.IsConnectedToMaster: boolean; +begin + Result := (MasterSource <> nil) and (FMasterFields <> '') and (FDetailFields <> ''); +end; + +procedure TCustomDADataSet.RefreshDetailSQL; +var + OldActive: boolean; +begin + OldActive := Active; + + Close; + UnPrepare; + AssembleSQL; + + if OldActive then + Open; +end; + +function TCustomDADataSet.LocalDetailFilter(RecBuf: IntPtr): boolean; +var + i: Integer; +begin + Result := True; + for i := 0 to Length(FLocalMDLinks) - 1 do + with FLocalMDLinks[i] do begin + if not Result then + Break; + if (IsNull) or (TMemData(Data).GetNull(FieldNo, RecBuf)) then + Result := not ((IsNull) or (TMemData(Data).GetNull(FieldNo, RecBuf))) + else + Result := TMemData(Data).CompareFieldValue(Buffer, BufferType, Data.Fields[FieldNo - 1], RecBuf, []) = 0; + end; +end; + +procedure TCustomDADataSet.AssembleSQL; +begin + FCommand.AssembleSQL; + +// close and unprepare to apply new sql + UnPrepare; +end; + +procedure TCustomDADataSet.ScanMacros(Sender: TObject = nil); +var + AllSQL: string; + stIdx: TStatementType; +begin + AllSQL := SQL.Text; + for stIdx := Low(FUpdateSQL) to High(FUpdateSQL) do + if Assigned(FUpdateSQL[stIdx]) then + AllSQL := AllSQL + FUpdateSQL[stIdx].Text; + Macros.Scan(AllSQL); +end; + +{function TCustomDADataSet.DoGetFinalSQL: string; +begin + Result := GetFinalSQL; +end; + +procedure TCustomDADataSet.DoScanMacros(Sender: TObject); +begin + ScanMacros; +end;} + +procedure TCustomDADataSet.DefineProperties(Filer: TFiler); + function WriteParams: boolean; + begin + if Filer.Ancestor <> nil then + Result := not FParams.IsEqual(TCustomDADataSet(Filer.Ancestor).FParams) + else + Result := FParams.Count > 0; + end; + + function WriteMacros: boolean; + begin + if Filer.Ancestor <> nil then + Result := not FMacros.IsEqual(TCustomDADataSet(Filer.Ancestor).FMacros) + else + Result := FMacros.Count > 0; + end; +begin + inherited DefineProperties(Filer); + + Filer.DefineProperty('ParamData', FCommand.ReadParamData, FCommand.WriteParamData, WriteParams); + Filer.DefineProperty('MacroData', FCommand.ReadMacroData, FCommand.WriteMacroData, WriteMacros); +end; + +function TCustomDADataSet.FindParam(const Value: string): TDAParam; +begin + Result := FParams.FindParam(Value); +end; + +function TCustomDADataSet.ParamByName(const Value: string): TDAParam; +begin + Result := FParams.ParamByName(Value); +end; + +function TCustomDADataSet.FindMacro(const Value: string): TMacro; +begin + Result := FMacros.FindMacro(Value); +end; + +function TCustomDADataSet.MacroByName(const Value: string): TMacro; +begin + Result := FMacros.MacroByName(Value); +end; + +{ Additional data types } + +function TCustomDADataSet.GetField(FieldDesc: TFieldDesc): TField; +var + i: integer; +begin + Assert(FieldDesc <> nil); + Result := nil; + for i := 0 to Fields.Count - 1 do + if Fields[i].FieldNo = FieldDesc.FieldNo then begin + Result := Fields[i]; + Break; + end; +end; + +function TCustomDADataSet.GetDataType(const FieldName: string): integer; +begin + Result := FIRecordSet.FieldByName(FieldName).DataType; +end; + +function TCustomDADataSet.GetFieldDesc(const FieldName: string): TFieldDesc; +begin + Result := FIRecordSet.FieldByName(FieldName); +end; + +function TCustomDADataSet.GetFieldDesc(const FieldNo: integer): TFieldDesc; +begin + if FieldNo <= 0 then {fkCalculated, fkLookup} + Result := nil + else + Result := TFieldDesc(FIRecordSet.Fields[FieldNo - 1]) +end; + +function TCustomDADataSet.GetFieldPrecision(const FieldName: string): integer; +var + Field: TFieldDesc; +begin + Field := FIRecordSet.FieldByName(FieldName); + if (Field <> nil) and (Field.DataType in [dtInteger,dtFloat]) then + Result := Field.Length + else + Result := 0; +end; + +function TCustomDADataSet.GetFieldScale(const FieldName: string): integer; +var + Field: TFieldDesc; +begin + Field := FIRecordSet.FieldByName(FieldName); + if (Field <> nil) and (Field.DataType in [dtInteger,dtFloat]) then + Result := Field.Scale + else + Result := 0; +end; + +function TCustomDADataSet.GetFieldObject(FieldDesc: TFieldDesc): TSharedObject; +var + RecBuf: TRecordBuffer; +begin + if GetActiveRecBuf(RecBuf) then begin + if not FIRecordSet.IsComplexFieldType(FieldDesc.DataType) then + DatabaseError(SNeedBlobType); + + Result := TSharedObject(GetGCHandleTarget(Marshal.ReadIntPtr(RecBuf, FieldDesc.Offset))); + end + else + Result := nil; +end; + +function TCustomDADataSet.GetFieldObject(Field: TField): TSharedObject; +var + FieldDesc: TFieldDesc; +begin + FieldDesc := GetFieldDesc(Field); + Result := GetFieldObject(FieldDesc); +end; + +function TCustomDADataSet.GetFieldObject(const FieldName: string): TSharedObject; +var + FieldDesc: TFieldDesc; +begin + FieldDesc := FIRecordSet.FieldByName(FieldName); + Result := GetFieldObject(FieldDesc); +end; + +{$IFDEF VER5P} + +{ IProviderSupport } + +procedure TCustomDADataSet.PSEndTransaction(Commit: Boolean); +begin + if (UsedConnection <> nil) and + AutoCommit and + UsedConnection.AutoCommit + then + if Commit then + UsedConnection.Commit + else + UsedConnection.Rollback; +end; + +procedure TCustomDADataSet.PSExecute; +begin + Execute; +end; + +function TCustomDADataSet.PSExecuteStatement(const ASQL: string; AParams: TParams; + {$IFDEF CLR}var ResultSet: TObject{$ELSE}ResultSet: Pointer = nil{$ENDIF}): Integer; + + procedure SetSQL(SQL: TStrings); + var + St: StringBuilder; + i, j: integer; + begin + // replace parameters in SQL + St := StringBuilder.Create(Length(ASQL) + Length(ASQL) div 2); + try + j := 1; + for i := 1 to Length(ASQL) do + if ASQL[i] = '?' then begin + St.Append(':'); + St.Append(IntToStr(j)); + Inc(j) + end + else + St.Append(ASQL[i]); + SQL.Text := St.ToString; + finally + St.Free; + end; + end; + + procedure SetParams(Params: TDAParams); + var + i: integer; + begin + //FQuery.Params.Assign(AParams); // params doesn't name + for i := 0 to Params.Count - 1 do begin + Params[i].Assign(AParams[i]); + Params[i].Name := IntToStr(i + 1); + if Params[i].ParamType = ptUnknown then + Params[i].ParamType := ptInput; + end; + end; + +var + Command: TCustomDASQL; + Query: TCustomDADataSet; +begin + if Assigned(ResultSet) then begin + Query := UsedConnection.CreateDataSet; + try + Query.Debug := Debug; + SetSQL(Query.SQL); + SetParams(Query.Params); + Query.Execute; + Result := Query.RowsAffected; + {$IFDEF CLR} + ResultSet := Query; + {$ELSE} + TDataSet(ResultSet^) := Query; + {$ENDIF} + except + Query.Free; + raise; + end; + end + else + begin + Command := UsedConnection.CreateSQL; + try + Command.Debug := Debug; + SetSQL(Command.SQL); + SetParams(Command.Params); + Command.Execute; + Result := Command.RowsAffected; + finally + Command.Free; + end; + end; +end; + +function TCustomDADataSet.PSGetParams: DB.TParams; +begin + Result := Params; +end; + +function TCustomDADataSet.PSGetQuoteChar: string; +begin + Result := '"'; +end; + +function TCustomDADataSet.PSGetTableName: string; +begin + if Active then begin + if (FUpdatingTableInfoIdx < 0) or (FUpdatingTableInfoIdx >= TablesInfo.Count) then + Result := FUpdatingTable + else + Result := TablesInfo[FUpdatingTableInfoIdx].TableName; + end + else begin + Result := FOldTableName; + if Result = '' then + Result := TablesInfo.TableInfoClass.NormalizeName(FUpdatingTable); + if Result = '' then + Result := TablesInfo.TableInfoClass.NormalizeName(GetTableNameFromSQL(SQL.Text)); + end; +end; + +function TCustomDADataSet.PSInTransaction: Boolean; +begin + if UsedConnection <> nil then + Result := UsedConnection.InTransaction + else + Result := False; +end; + +function TCustomDADataSet.PSIsSQLBased: Boolean; +begin + Result := True; +end; + +function TCustomDADataSet.PSIsSQLSupported: Boolean; +begin + Result := True; +end; + +procedure TCustomDADataSet.PSReset; +begin + inherited PSReset; + + if Active then begin + Close; + Open; + end; +end; + +procedure TCustomDADataSet.PSSetParams(AParams: DB.TParams); +begin + if AParams.Count <> 0 then + Params.Assign(AParams); +end; + +procedure TCustomDADataSet.PSSetCommandText(const CommandText: string); +begin + if CommandText <> '' then + SQL.Text := CommandText; +end; + +procedure TCustomDADataSet.PSStartTransaction; +begin + if (UsedConnection <> nil) and + AutoCommit and + UsedConnection.AutoCommit + then + UsedConnection.StartTransaction; +end; + +function TCustomDADataSet.PSUpdateRecord(UpdateKind: TUpdateKind; Delta: TDataSet): Boolean; +var + UpdateAction: TUpdateAction; + + I: Integer; + Old: Boolean; + Param: TDAParam; + Params: TDAParams; + PName: string; + Field: TField; + Value: Variant; + +begin + Result := False; + if Assigned(OnUpdateRecord) then + begin + UpdateAction := uaFail; + OnUpdateRecord(Delta, UpdateKind, UpdateAction); + Result := UpdateAction = uaApplied; + end; + + if not Result and Assigned(FUpdateObject) and Assigned(Delta) then begin + CheckUpdateQuery(UpdateKindToStatementType(UpdateKind)); + + TDBAccessUtils.SetAutoCommit(FUpdateQuery, AutoCommit); + Params := TDBAccessUtils.GetParams(FUpdateQuery); + + // Nearly copied from TUpdateSQL.SetParams + with FUpdateQuery do + for I := 0 to Params.Count - 1 do + begin + Param := Params[I]; + PName := Param.Name; + Old := CompareText(Copy(PName, 1, 4), 'OLD_') = 0; + if Old then {$IFDEF CLR}Borland.Delphi.{$ENDIF}System.Delete(PName, 1, 4); + Field := Delta.FindField(PName); + if not Assigned(Field) then Continue; + if Old then Param.AssignFieldValue(Field, Field.OldValue) else + begin + Value := Field.NewValue; + if {$IFNDEF VER6P} VarIsEmpty {$ELSE}VarIsClear{$ENDIF}(Value) then Value := Field.OldValue; + Param.AssignFieldValue(Field, Value); + end; + end; + TDBAccessUtils.Execute(FUpdateQuery); + + Result := True; + end; +end; + +function TCustomDADataSet.PSGetDefaultOrder: TIndexDef; + + function AddField(const Fields, NewField: string): string; + begin + if Fields <> '' then + Result := Fields + ';' + NewField + else + Result := NewField; + end; + +var + S, Token, SaveField: string; + Parser: TBoolParser; + Code, Index: integer; +begin + Result := nil; + S := GetOrderBy; + if S = '' then + Exit; + + Parser := TBoolParser.Create(S); + Parser.DecSeparator := '.'; + try + Result := TIndexDef.Create(nil); + Parser.ToBegin(); + + Code := Parser.GetNext(Token); + while Code <> lcEnd do begin + case Code of + lcIdent, lcString: begin + if 'DESC' = UpperCase(Token) then begin + Result.DescFields := AddField(Result.DescFields, SaveField); + end + else + if Assigned(FindField(Token)) then begin + Result.Fields := AddField(Result.Fields, Token); + SaveField := Token; + end; + end; + lcNumber: begin + try + Index := StrToInt(Token); + SaveField := FieldDefs[Index - 1].Name; + except // float number + Code := Parser.GetNext(Token); //to prevent freezeng on errors. CR + continue; + end; + Result.Fields := AddField(Result.Fields, SaveField); + end; + end; + + Code := Parser.GetNext(Token); + end; + finally + Parser.Free; + end; +end; + +function TCustomDADataSet.PreventPSKeyFields(var PSKeyFields: string): boolean; +begin + Result := False; +end; + + +function TCustomDADataSet.PSGetKeyFields: string; +var + OldDebug: boolean; + OldFetchAll: boolean; + OldFetchRows: integer; + + procedure QuickOpen; + begin + OldDebug := Debug; + OldFetchAll := FetchAll; + OldFetchRows := FetchRows; + + Debug := False; + FetchAll := False; + FetchRows := 1; + Execute; + end; + + procedure Restore; + begin + Close; + Debug := OldDebug; + FetchAll := OldFetchAll; + FetchRows := OldFetchRows; + end; + +var + i: integer; + KeyAndDataFields: TKeyAndDataFields; + QO: boolean; + +begin + Result := inherited PSGetKeyFields; + if Result = '' then + if FOldKeyFields = '' then begin + if not PreventPSKeyFields(Result) then begin //Set product specific KeyField values or omit Server roundtrip on DS opening + QO := not Active and (Connection <> nil) and (FIRecordSet <> nil) and (FIRecordSet.FieldCount = 0); + if QO then + QuickOpen; + try + GetKeyAndDataFields(KeyAndDataFields, False); + + for i := 0 to High(KeyAndDataFields.KeyFieldDescs) do + if Result = '' then + Result := KeyAndDataFields.KeyFieldDescs[i].Name + else + Result := Result + ';' + KeyAndDataFields.KeyFieldDescs[i].Name; + finally + if QO then + Restore; + end; + end; + FOldKeyFields := Result; + end + else + Result := FOldKeyFields; +end; +{$ENDIF} + +procedure TCustomDADataSet.AssignTo(Dest: TPersistent); +var + stIdx: TStatementType; +begin + inherited; + + if Dest is TCustomDADataSet then begin + TCustomDADataSet(Dest).Connection := Connection; + TCustomDADataSet(Dest).MasterSource := MasterSource; + TCustomDADataSet(Dest).MasterFields := MasterFields; + TCustomDADataSet(Dest).DetailFields := DetailFields; + TCustomDADataSet(Dest).ParamCheck := ParamCheck; // before SQL + TCustomDADataSet(Dest).SQL.Text := SQL.Text; + for stIdx := Low(FUpdateSQL) to High(FUpdateSQL) do + if Assigned(TCustomDADataSet(Dest).FUpdateSQL[stIdx]) and Assigned(FUpdateSQL[stIdx]) then + TCustomDADataSet(Dest).FUpdateSQL[stIdx].Text := FUpdateSQL[stIdx].Text; + + TCustomDADataSet(Dest).FilterSQL := FilterSQL; + TCustomDADataSet(Dest).Macros.Assign(Macros); + TCustomDADataSet(Dest).Params.Assign(Params); + TCustomDADataSet(Dest).Debug := Debug; + + TCustomDADataSet(Dest).FetchRows := FetchRows; + TCustomDADataSet(Dest).UniDirectional := UniDirectional; + TCustomDADataSet(Dest).AutoCommit := AutoCommit; + TCustomDADataSet(Dest).RefreshOptions := RefreshOptions; + TCustomDADataSet(Dest).UpdatingTable := UpdatingTable; + TCustomDADataSet(Dest).Options.Assign(Options); + end; +end; + +procedure TCustomDADataSet.SetConnection(Value: TCustomDAConnection); +begin + if (Value <> FConnection) or (Value <> UsedConnection) then begin + + if UsedConnection <> nil then begin + Disconnect; + UsedConnection.UnregisterClient(Self); + end; + + FConnection := Value; + + if FConnection <> nil then begin + Value.RegisterClient(Self, ConnectChange); + + CheckIRecordSet; + FIRecordSet.SetConnection(FConnection.FIConnection) + end + else + FIRecordSet.SetConnection(nil); + {$IFDEF CLR} + DataEvent(dePropertyChange, nil); + {$ELSE} + DataEvent(dePropertyChange, 0); + {$ENDIF} + end; +end; + +function TCustomDADataSet.GetSQL: TStrings; +begin + Result := FCommand.SQL; +end; + +procedure TCustomDADataSet.SetSQL(Value: TStrings); +begin + FCommand.SQL := Value; +end; + +procedure TCustomDADataSet.SetFetchRows(Value: integer); +begin + if FFetchRows <> Value then begin + CheckInactive; + if (Value < 1) or (Value > 10000) then + DatabaseError(SInvalidFetchRows); + + FFetchRows := Value; + FIRecordSet.SetProp(prFetchRows, FetchRows); + end; +end; + +procedure TCustomDADataSet.SetFetchAll(Value: boolean); +begin + FFetchAll := Value; + FIRecordSet.SetProp(prFetchAll, FetchAll); + if FFetchAll then begin + UniDirectional := False; + if Active then begin + FIRecordSet.FetchAll; + Resync([]); + end; + end; +end; + +function TCustomDADataSet.CreateBlobStream(Field: TField; Mode: TBlobStreamMode): TStream; +var + Blob: TBlob; + OldModified: boolean; +begin + if Field.DataSet = Self then + Blob := GetBlob(Field) + else + Blob := GetBlob(Field.FieldName); + if (Blob <> nil) and (Mode <> bmWrite) and UsedConnection.ConvertEOL + and (Field.DataType in [ftMemo{$IFDEF VER10P}, ftWideMemo{$ENDIF}, ftOraClob]) + then begin + OldModified := Blob.Modified; + Blob.AddCR; + TBlobUtils.SetModified(Blob, OldModified); + end; + + Result := inherited CreateBlobStream(Field, Mode); +end; + +function TCustomDADataSet.GetDataSource: TDataSource; +begin + Result := FDataLink.DataSource; +end; + +procedure TCustomDADataSet.SetMasterSource(Value: TDataSource); +var + NeedRefresh: boolean; +begin + if FDataLink.DataSource <> Value then begin + if IsLinkedTo(Value) then + DatabaseError(SCircularDataLink); + NeedRefresh := IsConnectedToMaster; + FDataLink.DataSource := Value; + NeedRefresh := NeedRefresh or IsConnectedToMaster; + + if NeedRefresh then + RefreshDetailSQL; + end; +end; + +function TCustomDADataSet.GetParams: TDAParams; +begin + Result := FCommand.Params; +end; + +procedure TCustomDADataSet.SetParams(Value: TDAParams); +begin + FCommand.Params := Value; +end; + +function TCustomDADataSet.GetParamCount: word; +begin + Result := FParams.Count; +end; + +function TCustomDADataSet.GetParamCheck: boolean; +begin + Result := FCommand.ParamCheck; +end; + +procedure TCustomDADataSet.SetParamCheck(Value: boolean); +begin + FCommand.ParamCheck := Value; +end; + +function TCustomDADataSet.GetMacros: TMacros; +begin + Result := FCommand.Macros; +end; + +procedure TCustomDADataSet.SetMacros(Value: TMacros); +begin + FCommand.Macros := Value; +end; + +function TCustomDADataSet.GetMacroCount: word; +begin + Result := FMacros.Count; +end; + +function TCustomDADataSet.GetRecordCount: integer; +var + RowsFetched: variant; +begin + if not Active or Fetched or not Options.QueryRecCount or (FRecordCount = 0) then + Result := inherited GetRecordCount + else begin + FICommand.GetProp(prRowsProcessed, RowsFetched); + Result := FRecordCount - RowsFetched + Data.RecordCount; + end; +end; + +function TCustomDADataSet.GetRowsAffected: integer; +begin + Result := FRowsAffected; +end; + +procedure TCustomDADataSet.SetUniDirectional(Value: boolean); +begin + if Value <> FUniDirectional then begin + CheckInactive; + FUniDirectional := Value; + FIRecordSet.SetProp(prUniDirectional, FUniDirectional); + if FUniDirectional then + FetchAll := False; + end; +end; + +procedure TCustomDADataSet.SetAutoCommit(Value: boolean); +begin + FAutoCommit := Value; + FICommand.SetProp(prAutoCommit, FAutoCommit); +end; + +function TCustomDADataSet.GetIsQuery: boolean; +begin + Result := TCRRecordSet(Data).RowsReturn; +end; + +//------------------------------------------------------------------------------ +// SQL Modification methods +//------------------------------------------------------------------------------ + +procedure TCustomDADataSet.SaveSQL; +begin + FBaseSQL := SQL.Text; +end; + +procedure TCustomDADataSet.RestoreSQL; +begin + if FBaseSQL <> '' then begin + SQL.Text := FBaseSQL; + FBaseSQL := ''; + end; +end; + +function TCustomDADataSet.SQLSaved: boolean; +begin + Result := FBaseSQL <> ''; +end; + +/// SaveModifiedSQL is used to back up original sql text before modification. +procedure TCustomDADataSet.SaveModifiedSQL(NewSQL: string); +var + BaseSQL: string; +begin + if NewSQL <> Trim(SQL.Text) then begin + if FBaseSQL = '' then + FBaseSQL := SQL.Text; + if not BaseSQLOldbehavior then + BaseSQL := FBaseSQL; + + SQL.Text := NewSQL; + if not BaseSQLOldbehavior then + FBaseSQL := BaseSQL; + end; +end; + +procedure TCustomDADataSet.InitUpdatingTable; +begin + if (FUpdatingTable <> '') and + (TablesInfo.IndexByName(TablesInfo.TableInfoClass.NormalizeName(FUpdatingTable)) = - 1) then + FUpdatingTable := ''; + SetUpdatingTable(FUpdatingTable); +end; + +procedure TCustomDADataSet.DetectIdentityField; +begin + FIdentityField := nil; +end; + +function TCustomDADataSet.ReadOnlyFieldsEnabled: boolean; +begin + Result := True; +end; + +procedure TCustomDADataSet.WriteFieldXMLAttributeType(Field: TField; FieldDesc: TFieldDesc; const FieldAlias: string; XMLWriter: XMLTextWriter); +begin + inherited; + + if (FieldDesc is TCRFieldDesc) + and (TCRFieldDesc(FieldDesc).TableInfo <> nil) + and (TCRFieldDesc(FieldDesc).TableInfo.TableName <> '') then + XmlWriter.WriteAttributeString('rs:basetable', TCRFieldDesc(FieldDesc).TableInfo.TableName); +end; + +procedure TCustomDADataSet.InternalOpen; +var + MessageID: cardinal; +begin + if Options.AutoPrepare then + Prepare; + + if not FLockDebug + and (TDASQLMonitorClass(UsedConnection.SQLMonitorClass).HasMonitor or Debug) + and (FIRecordSet.GetCommand.GetCursorState <> csExecuted) {To prevent multiple calls on DataSet.Execute} + then + TDASQLMonitorClass(UsedConnection.SQLMonitorClass).SQLExecute(Self, FinalSQL, FParams, '', MessageID, True); + + inherited; + + if not FLockDebug and (TDASQLMonitorClass(UsedConnection.SQLMonitorClass).HasMonitor or Debug) then + TDASQLMonitorClass(UsedConnection.SQLMonitorClass).SQLExecute(Self, FinalSQL, FParams, '', MessageID, False); + + ClearCachedKeyAndDataFields; + InitUpdatingTable; + + if (FDataLink.DataSource <> nil) + and (FDataLink.DataSource.DataSet <> nil) + and (FDataLink.DataSource.DataSet.Active) + and (FOptions.LocalMasterDetail) + then begin + SetMasterParams(Params); + Data.FilterUpdated; + end; + +end; + +/// SQLAddWhere, SQLDeleteWhere, SQLSetOrderBy, SQlGetOrderBy are SQL-server +/// specific functions and they should be overriden in descendants. They operate +/// with strings only. Return value is new SQL text or it's part being +/// requested. +function TCustomDADataSet.SQLAddWhere(SQLText, Condition: string): string; +begin + Result := ''; +end; + +function TCustomDADataSet.SQLDeleteWhere(SQLText: string): string; +begin + Result := ''; +end; + +function TCustomDADataSet.SQLGetWhere(SQLText: string): string; +begin + Result := ''; +end; + +function TCustomDADataSet.SQLSetOrderBy(SQLText: string; Fields: string): string; +begin + Result := ''; +end; + +function TCustomDADataSet.SQLGetOrderBy(SQLText: string): string; +begin + Result := ''; +end; + +/// AddWhere, DeleteWhere, SetOrderBy, GetOrderBy are public SQL-server +/// indepedant methods. They can modify SQL property value of the dataset. Each +/// method calls it's internal equivalent with 'SQL' prefix. +procedure TCustomDADataSet.AddWhere(Condition: string); +begin + SaveModifiedSQL(SQLAddWhere(Trim(SQL.Text), Condition)); +end; + +procedure TCustomDADataSet.DeleteWhere; +begin + SaveModifiedSQL(SQLDeleteWhere(Trim(SQL.Text))); +end; + +procedure TCustomDADataSet.SetOrderBy(Fields: string); +begin + SaveModifiedSQL(SQLSetOrderBy(Trim(SQL.Text), Fields)); +end; + +function TCustomDADataSet.GetOrderBy: string; +begin + Result := SQLGetOrderBy(Trim(SQL.Text)); +end; + +/// GetBaseSQL returns original sql text with expanded macros. +function TCustomDADataSet.GetBaseSQL: string; +begin + if FBaseSQL <> '' then + Result := FBaseSQL + else + Result := SQL.Text; + + if Macros.Count > 0 then + Macros.Expand(Result); +end; + +function TCustomDADataSet.GetFinalSQL: string; +var + Str, Where: string; + MasterName: string; + DetailName: string; + MasterPos: integer; + DetailPos: integer; +begin + Str := FCommand.FinalSQL; + + if FFilterSQL <> '' then + Str := SQLAddWhere(Str, FilterSQL); + + if (DataSource <> nil) and (FMasterFields <> '') and (FDetailFields <> '') + and not (FOptions.LocalMasterDetail) + then begin + MasterPos := 1; + DetailPos := 1; + Where := ''; + while True do begin + MasterName := ExtractFieldName(FMasterFields, MasterPos); + DetailName := ExtractFieldName(FDetailFields, DetailPos); + if (MasterName <> '') and (DetailName <> '') then begin + if Where <> '' then + Where := Where + ' and '; + Where := Where + TablesInfo.TableInfoClass.NormalizeName(DetailName, Options.QuoteNames) + ' = :' + TablesInfo.TableInfoClass.NormalizeName(MasterName, Options.QuoteNames); + end + else + break; + end; + if Where <> '' then + Str := SQLAddWhere(Str, Where); + end; + + Result := Str; +end; + +procedure TCustomDADataSet.SetUpdateObject(Value: TCustomDAUpdateSQL); +begin + if Value <> nil then begin + Value.CheckUpdateComponent(Value.ModifyObject, Self); + Value.CheckUpdateComponent(Value.InsertObject, Self); + Value.CheckUpdateComponent(Value.DeleteObject, Self); + Value.CheckUpdateComponent(Value.RefreshObject, Self); + end; + if Value <> FUpdateObject then begin + if Assigned(FUpdateObject) and (FUpdateObject.DataSet = Self) then + FUpdateObject.DataSet := nil; + FUpdateObject := Value; + if Assigned(FUpdateObject) then begin + if Assigned(FUpdateObject.DataSet) and + (FUpdateObject.DataSet <> Self) then + FUpdateObject.DataSet.UpdateObject := nil; + FUpdateObject.DataSet := Self; + end; + end; +end; + +procedure TCustomDADataSet.SetOptions(Value: TDADataSetOptions); +begin + FOptions.Assign(Value); +end; + +procedure TCustomDADataSet.SetFilterSQL(Value: string); +var + OldFilter: string; + OldActive: boolean; +begin + if Value <> FFilterSQL then begin + OldFilter := FFilterSQL; + FFilterSQL := Trim(Value); + + OldActive := Active; + if not (csReading in ComponentState) then begin + Close; + UnPrepare; + end; + + AssembleSQL; + + if OldActive then + try + Open; + if Filtered and (Filter <> '') then begin + Data.FilterUpdated; + Resync([]); + First; + end; + except + FFilterSQL := OldFilter; + AssembleSQL; + raise; + end; + end; +end; + +procedure TCustomDADataSet.SetFiltered(Value: boolean); +var + KeyFields: TFieldArray; + Values: variant; +begin + if Value <> Filtered then begin + if Active then + GetCurrentKeys(KeyFields, Values); + + inherited; + + if Active and (Length(KeyFields) <> 0) then + Locate(KeyFields, Values, []); + end; +end; + +procedure TCustomDADataSet.SetMasterFields(Value: string); +var + NeedRefresh: boolean; +begin + if Value <> FMasterFields then begin + NeedRefresh := IsConnectedToMaster; + FMasterFields := Value; + NeedRefresh := NeedRefresh or IsConnectedToMaster; + + if NeedRefresh then + RefreshDetailSQL; + end; +end; + +procedure TCustomDADataSet.SetForeignKeyFields(Value: string); +var + NeedRefresh: boolean; +begin + if Value <> FDetailFields then begin + NeedRefresh := IsConnectedToMaster; + FDetailFields := Value; + NeedRefresh := NeedRefresh or IsConnectedToMaster; + + if NeedRefresh then + RefreshDetailSQL; + end; +end; + +{ TDADataSetOptions } + +constructor TDADataSetOptions.Create(Owner: TCustomDADataSet); +begin + inherited Create; + + FOwner := Owner; + + RequiredFields := True; + StrictUpdate := True; + TrimFixedChar := True; + LongStrings := True; + FlatBuffers := False; + RemoveOnRefresh := True; + FDetailDelay := 0; + UpdateBatchSize := 1; +end; + +procedure TDADataSetOptions.AssignTo(Dest: TPersistent); +begin + if Dest is TDADataSetOptions then begin + TDADataSetOptions(Dest).RequiredFields := RequiredFields; + TDADataSetOptions(Dest).StrictUpdate := StrictUpdate; + TDADataSetOptions(Dest).NumberRange := NumberRange; + TDADataSetOptions(Dest).QueryRecCount := QueryRecCount; + TDADataSetOptions(Dest).AutoPrepare := AutoPrepare; + TDADataSetOptions(Dest).ReturnParams := ReturnParams; + TDADataSetOptions(Dest).TrimFixedChar := TrimFixedChar; + TDADataSetOptions(Dest).TrimVarChar := TrimVarChar; + TDADataSetOptions(Dest).LongStrings := LongStrings; + TDADataSetOptions(Dest).FlatBuffers := FlatBuffers; + TDADataSetOptions(Dest).DetailDelay := DetailDelay; + TDADataSetOptions(Dest).SetFieldsReadOnly := SetFieldsReadOnly; + TDADataSetOptions(Dest).QuoteNames := QuoteNames; + {$IFDEF HAVE_COMPRESS} + TDADataSetOptions(Dest).CompressBlobMode := CompressBlobMode; + {$ENDIF} + TDADataSetOptions(Dest).LocalMasterDetail := LocalMasterDetail; + TDADataSetOptions(Dest).CacheCalcFields := CacheCalcFields; + TDADataSetOptions(Dest).FullRefresh := FullRefresh; + TDADataSetOptions(Dest).UpdateAllFields := UpdateAllFields; + end + else + inherited; +end; + +procedure TDADataSetOptions.SetRequiredFields(Value: boolean); +begin + if FRequiredFields <> Value then begin + FRequiredFields := Value; + FOwner.FLocalConstraints := FRequiredFields; + FOwner.FieldDefs.Updated := False; + if FOwner.Active then // for change RequiredFields in runtime + FOwner.FieldDefs.Update; + end; +end; + +procedure TDADataSetOptions.SetNumberRange(Value: boolean); +begin + FNumberRange := Value; + FOwner.FNumberRange := FNumberRange; +end; + +procedure TDADataSetOptions.SetTrimFixedChar(Value: boolean); +begin + FTrimFixedChar := Value; + FOwner.Data.TrimFixedChar := FTrimFixedChar; +end; + +procedure TDADataSetOptions.SetTrimVarChar(Value: boolean); +begin + FTrimVarChar := Value; + FOwner.Data.TrimVarChar := FTrimVarChar; +end; + +procedure TDADataSetOptions.SetLongStrings(Value: boolean); +begin + FOwner.CheckInactive; + FLongStrings := Value; + FOwner.FIRecordSet.SetProp(prLongStrings, FLongStrings); + FOwner.FieldDefs.Updated := False; +end; + +procedure TDADataSetOptions.SetAutoPrepare(Value: boolean); +begin + if FAutoPrepare = Value then + Exit; + + FOwner.Unprepare; + FAutoPrepare := Value; +end; + +procedure TDADataSetOptions.SetFlatBuffers(const Value: boolean); +begin + FOwner.CheckInactive; + FFlatBuffers := Value; + FOwner.FIRecordSet.SetProp(prFlatBuffers, Value); +end; + +procedure TDADataSetOptions.SetDetailDelay(Value: integer); +begin + FDetailDelay := Value; +{$IFDEF MSWINDOWS} + FOwner.CheckRefreshDetailTimer; + FOwner.FDetailRefreshTimer.Interval := Value; +{$ENDIF} +end; + +procedure TDADataSetOptions.SetLocalMasterDetail(Value: boolean); +begin + if Value <> FLocalMasterDetail then begin + FOwner.CheckInactive; + FLocalMasterDetail := Value; + if FLocalMasterDetail then + FOwner.FIRecordSet.FilterMDFunc := FOwner.LocalDetailFilter + else + FOwner.FIRecordSet.FilterMDFunc := nil; + + if Value then + FOwner.AssembleSQL; + end; +end; + +function TDADataSetOptions.GetCacheCalcFields: boolean; +begin + Result := FOwner.FCacheCalcFields; +end; + +procedure TDADataSetOptions.SetCacheCalcFields(Value: boolean); +begin + if Value <> CacheCalcFields then begin + FOwner.CheckInactive; + FOwner.FCacheCalcFields := Value; + end; +end; + +{$IFDEF HAVE_COMPRESS} +procedure TDADataSetOptions.SetCompressBlobMode(Value: TCompressBlobMode); +begin + if FCompressBlobMode <> Value then begin + TCustomDADataSet(FOwner).CheckInactive; + FCompressBlobMode := Value; + FOwner.FIRecordSet.SetProp(prCompressBlobMode, Integer(Value)); + FOwner.FieldDefs.Updated := False; + end; +end; +{$ENDIF} + +{ TDASQLGenerator } + +constructor TDASQLGenerator.Create(Owner: TCustomDADataSet); +begin + inherited Create; + + Assert(Owner <> nil); + FOwner := Owner; + + FHeaderSB := StringBuilder.Create(100); + FFldSB := StringBuilder.Create(100); + FMiddleSB := StringBuilder.Create(100); + FFldParamSB := StringBuilder.Create(100); + FCondSB := StringBuilder.Create(100); + FFooterSB := StringBuilder.Create(100); + + FParamsInfo := TDAParamsInfo.Create(GetParamInfoClass); +end; + +destructor TDASQLGenerator.Destroy; +begin + FParamsInfo.Free; + + FHeaderSB.Free; + FFldSB.Free; + FMiddleSB.Free; + FFldParamSB.Free; + FCondSB.Free; + FFooterSB.Free; + inherited; +end; + +function TDASQLGenerator.GetParamInfoClass: TDAParamInfoClass; +begin + Result := TDAParamInfo; +end; + +procedure TDASQLGenerator.Clear; +begin + FHeaderSB.Length := 0; + FFldSB.Length := 0; + FMiddleSB.Length := 0; + FFldParamSB.Length := 0; + FCondSB.Length := 0; + FFooterSB.Length := 0; + + FOldRecBuf := nil; + FNewRecBuf := nil; +end; + +function TDASQLGenerator.AssembleSB(const StatementType: TStatementType): string; +begin + // TODO: may be optimized for Win32 + Result := + FHeaderSB.ToString + + FFldSB.ToString + + FMiddleSB.ToString + + FFldParamSB.ToString + + FCondSB.ToString + + FFooterSB.ToString; +end; + +function TDASQLGenerator.Data: TData; +begin + Result := FOwner.Data; +end; + +function TDASQLGenerator.OldRecBuf: IntPtr; +begin + if FOldRecBuf <> nil then + Result := FOldRecBuf + else + begin + // Old buffer + if FOwner.FInDeferredPost then + Result := FOwner.OldDeferredPostBuf + else + if FOwner.FInCacheProcessing then + Result := FOwner.OldCacheRecBuf + else + Result := FOwner.GetOldRecord; + FOldRecBuf := Result; + end +end; + +function TDASQLGenerator.NewRecBuf: IntPtr; +begin + if FNewRecBuf <> nil then + Result := FNewRecBuf + else + begin + // New buffer + if FOwner.FInCacheProcessing then + Result := FOwner.NewCacheRecBuf + else + Result := FOwner.ActiveBuffer; + FNewRecBuf := Result; + end +end; + +function TDASQLGenerator.IsBlobDataType(DataType: word): boolean; +begin + Result := DataType in [dtBlob, dtMemo, dtWideMemo]; //Data.IsBlobFieldType +end; + +function TDASQLGenerator.IsObjectDataType(DataType: word): boolean; +begin + Result := DataType in [dtObject, dtArray]; +end; + +function TDASQLGenerator.FieldIsNull(FieldDesc: TCRFieldDesc; OldValue: boolean; Data: TData; OldRecBuf, NewRecBuf: IntPtr): boolean; +//This function added for Expand fields support +var + i: integer; +begin + Result := not FOwner.Active; + if Result then + Exit; + + if IsObjectDataType(FieldDesc.DataType) then begin + i := FieldDesc.FieldNo; + while (i < Data.FieldCount) and (Data.Fields[i].ParentField = FieldDesc) do begin + Result := FieldIsNull(TCRFieldDesc(Data.Fields[i]), OldValue); + inc(i); + if not Result then + Break; + end; + end + else + if OldValue then + Result := Data.GetNull(FieldDesc.FieldNo, OldRecBuf) + else + Result := Data.GetNull(FieldDesc.FieldNo, NewRecBuf); +end; + +function TDASQLGenerator.FieldIsNull(FieldDesc: TCRFieldDesc; OldValue: boolean): boolean; +begin + Result := not FOwner.Active; + if Result then + Exit; + + Result := FieldIsNull(FieldDesc, OldValue, Data, OldRecBuf, NewRecBuf); +end; + +function TDASQLGenerator.FieldModified(FieldDesc: TCRFieldDesc; Data: TData; OldRecBuf, NewRecBuf: IntPtr): boolean; +//This function added for Expand fields support +var + i: integer; +begin + if IsBlobDataType(FieldDesc.DataType) then begin + if FOwner.FInCacheProcessing then + Result := Data.GetObject(FieldDesc.FieldNo, NewRecBuf) <> + Data.GetObject(FieldDesc.FieldNo, OldRecBuf) + else + Result := TBlob(Data.GetObject(FieldDesc.FieldNo, NewRecBuf)).Modified + end + else + if IsObjectDataType(FieldDesc.DataType) then begin + Result := False; + i := FieldDesc.FieldNo; + while (i < Data.FieldCount) and (Data.Fields[i].ParentField = FieldDesc) do begin //Child FieldDescs always next to parent FielDescs + Result := FieldModified(TCRFieldDesc(Data.Fields[i])); + inc(i); + if Result then + break; + end; + end + else + Result := TMemData(Data).CompareFields(OldRecBuf, NewRecBuf, FieldDesc) <> 0; +end; + +function TDASQLGenerator.FieldModified(FieldDesc: TCRFieldDesc): boolean; +begin + Result := FieldModified(FieldDesc, Data, OldRecBuf, NewRecBuf); +end; + +function TDASQLGenerator.GetActualFieldName(FieldDesc: TCRFieldDesc; IsRefresh: boolean): string; +begin + Result := QuoteName(GetActualFieldNameEx(FieldDesc, FieldDesc.TableInfo)); + if IsRefresh and FOwner.Options.FullRefresh or FOwner.ReadOnly then begin//Use original Select part, so we could use Field aliasess + if (FieldDesc.TableInfo <> nil) then + if FieldDesc.TableInfo.TableAlias <> '' then + Result := FieldDesc.TableInfo.NormalizeName(FieldDesc.TableInfo.TableAlias, FOwner.FOptions.FQuoteNames) + + '.' + Result + else + Result := FieldDesc.TableInfo.NormalizeName(FieldDesc.TableInfo.TableName, FOwner.FOptions.FQuoteNames) + + '.' + Result; + end; +end; + +function TDASQLGenerator.GetActualFieldNameEx(FieldDesc: TCRFieldDesc; TableInfo: TCRTableInfo): string; +var + p: integer; +begin + Result := FieldDesc.ActualName; + if (FieldDesc.TableInfo = TableInfo) or (FieldDesc.TableInfo.TableName = TableInfo.TableName) then begin + p := Pos('.', Result); + if (p <> 0) and (Pos(FieldDesc.TableInfo.TableName, Result) = 1) then //Here we should detremine that Result is not something like "Dot.FieldName" + Result := Copy(Result, p + 1, MaxInt);{Delete table name from fieldname} + end; +end; + +function TDASQLGenerator.GenerateIndexName(Name: string): string; +begin + Result := '_' + Name; +end; + +function TDASQLGenerator.DecodeFieldIndex(FieldName: string): integer; +var + e: integer; +begin + Result := -1; + if (Length(FieldName) >= 2) and (FieldName[1] = '_') then begin + Val(Copy(FieldName, 2, MaxInt), Result, e); + if e <> 0 then + Result := -1; + end; +end; + +function TDASQLGenerator.IndexedPrefix: string; +begin + Result := 'P_'; +end; + +function TDASQLGenerator.QuoteName(const AName: string): string; +begin + Assert(FOwner <> nil); + Result := FOwner.QuoteName(AName); +end; + +function TDASQLGenerator.UnQuoteName(AName: string): string; +begin + Assert(FOwner <> nil); + Result := FOwner.UnQuoteName(AName); +end; + +function TDASQLGenerator.IsSubstituteParamName: boolean; +begin + Result := True; +end; + +procedure TDASQLGenerator.AddParam(SB: StringBuilder; FieldDesc: TFieldDesc; + const StatementType: TStatementType; + const ParamType: TParamType; + Index: integer = -1; + Old: boolean = False); +var + ParamName: string; + ParamInfo: TDAParamInfo; + Param: TDAParam; +begin + { Nonsense after adding ParamsInfo support + if not (csDesigning in FOwner.ComponentState) and (FieldDesc.FieldNo <> 0) then + ParamName := IntToStr(FieldDesc.FieldNo) + else} + ParamName := FieldDesc.Name; + + if Old then + ParamName := 'Old_' + ParamName; + + if Index > - 1 then + ParamName := IndexedPrefix + IntToStr(Index) + '_' + ParamName; + +// if csDesigning in FOwner.ComponentState then // Don't call QuoteName IntToStr(FieldDesc.FieldNo) + ParamName := QuoteName(ParamName); //TODO:???? QuoteName + + if ((FParams = nil) or not IsSubstituteParamName) or (((FOwner.Params.Count > 0) or FOwner.Options.FullRefresh) and (StatementType = stRefresh)) then begin + SB.Append(':'); + SB.Append(ParamName); + end + else + SB.Append('?'); + + if FParams <> nil then begin + Param := TDAParam(FParams.Add); + Param.Name := ParamName; + Param.ParamType := ParamType; + {$IFNDEF CLR} + _TParam(Param).FParamRef := Param; + {$ENDIF} + ParamInfo := TDAParamInfo(FParamsInfo.Add); + ParamInfo.Field := FOwner.GetField(FieldDesc); + ParamInfo.Old := Old; + ParamInfo.ParamIndex := Index; + end; +end; + +procedure TDASQLGenerator.AddFieldToCondition(SB: StringBuilder; FieldDesc: TCRFieldDesc; const StatementType: TStatementType; + const ModifiedFieldsOnly: boolean; const Index: integer = -1); +var + ActualName: string; +begin + if SB.Length > 0 then + SB.Append(' AND '); + + Assert(FieldDesc <> nil); + ActualName := GetActualFieldName(FieldDesc, StatementType = stRefresh); + SB.Append(ActualName); + + if ModifiedFieldsOnly and FieldIsNull(FieldDesc, StatementType <> stRefresh) then //Refresh generated with current field values + SB.Append(' IS NULL') + else + begin + SB.Append(' = '); + AddParam(SB,FieldDesc, StatementType, ptInput, Index, (StatementType <> stRefresh) or + (FOwner.CachedUpdates and (StatementType = stRefresh))); //Refresh generated with current field values + end; +end; + +procedure TDASQLGenerator.GenerateConditions(SB: StringBuilder; const StatementType: TStatementType; + const ModifiedFieldsOnly: boolean; const KeyAndDataFields: TKeyAndDataFields; + const Index: integer = -1); +var + i: integer; +begin + if Length(KeyAndDataFields.KeyFieldDescs) > 0 then + for i := 0 to High(KeyAndDataFields.KeyFieldDescs) do + AddFieldToCondition(SB, KeyAndDataFields.KeyFieldDescs[i], StatementType, ModifiedFieldsOnly, Index) + else begin + if FOwner.FIdentityField <> nil then + AddFieldToCondition(SB, TCRFieldDesc(FOwner.GetFieldDesc(FOwner.FIdentityField)), + StatementType, ModifiedFieldsOnly, Index) + else begin + if Length(KeyAndDataFields.DataFieldDescs) = 0 then + DatabaseError(SNoKeyFields); + for i := 0 to High(KeyAndDataFields.DataFieldDescs) do + if not IsBlobDataType(KeyAndDataFields.DataFieldDescs[i].DataType) then + AddFieldToCondition(SB, KeyAndDataFields.DataFieldDescs[i], StatementType, ModifiedFieldsOnly, Index); + end; + end; +end; + +procedure TDASQLGenerator.AddFieldToInsertSQL(FieldDesc: TCRFieldDesc; const Index: integer = -1); +begin + if FFldSB.Length > 0 then begin + FFldSB.Append(', '); + FFldParamSB.Append(', '); + end; + + FFldSB.Append(FieldDesc.ActualNameQuoted(TCRRecordSet(FOwner.Data), FOwner.Options.QuoteNames)); + AddParam(FFldParamSB, FieldDesc, stInsert, ptInput, Index); +end; + +procedure TDASQLGenerator.GenerateInsertSQL( + const KeyAndDataFields: TKeyAndDataFields; + const ModifiedFieldsOnly: boolean; + const Index: integer = -1); +var + i: integer; + FieldDesc: TCRFieldDesc; +begin + for i := 0 to High(KeyAndDataFields.DataFieldDescs) do begin + FieldDesc := KeyAndDataFields.DataFieldDescs[i]; + // Insert all(!) field values + if not ModifiedFieldsOnly or not FieldIsNull(FieldDesc, False) then + AddFieldToInsertSQL(FieldDesc, Index); + end; + + FHeaderSB.Append('INSERT INTO '); + FHeaderSB.Append(FTableInfo.NormalizeName(FTableInfo.TableNameFull, FOwner.FOptions.FQuoteNames)); + FHeaderSB.Append(SLLineSeparator); + FHeaderSB.Append(' ('); + // Append FFldSB + FMiddleSB.Append(')'); + FMiddleSB.Append(SLLineSeparator); + FMiddleSB.Append('VALUES'); + FMiddleSB.Append(SLLineSeparator); + FMiddleSB.Append(' ('); + // Append FFldParamSB + FFooterSB.Append(')'); +end; + +procedure TDASQLGenerator.AddFieldToUpdateSQL(FieldDesc: TCRFieldDesc; const ModifiedFieldsOnly: boolean; + const Index: integer = -1); +begin + if FFldSB.Length > 0 then + FFldSB.Append(', '); + + FFldSB.Append(FieldDesc.ActualNameQuoted(TCRRecordSet(FOwner.Data), FOwner.Options.QuoteNames)); + FFldSB.Append(' = '); + AddParam(FFldSB, FieldDesc, stUpdate, ptInput, Index); +end; + +procedure TDASQLGenerator.GenerateUpdateSQL( + const KeyAndDataFields: TKeyAndDataFields; + const ModifiedFieldsOnly: boolean; + const Index: integer = -1); +var + i: integer; + FieldDesc: TCRFieldDesc; +begin + for i := 0 to High(KeyAndDataFields.DataFieldDescs) do begin + FieldDesc := KeyAndDataFields.DataFieldDescs[i]; + + if not ModifiedFieldsOnly or FieldModified(FieldDesc) then + AddFieldToUpdateSQL(FieldDesc, ModifiedFieldsOnly, Index); + end; + + if FFldSB.Length > 0 then begin + FHeaderSB.Append('UPDATE '); + FHeaderSB.Append(FTableInfo.NormalizeName(FTableInfo.TableNameFull, FOwner.FOptions.FQuoteNames)); + FHeaderSB.Append(SLLineSeparator); + FHeaderSB.Append('SET'); + FHeaderSB.Append(SLLineSeparator); + FHeaderSB.Append(' '); + // Append FFldSB + FMiddleSB.Append(SLLineSeparator); + FMiddleSB.Append('WHERE'); + FMiddleSB.Append(SLLineSeparator); + FMiddleSB.Append(' '); + // Append FParamSB + GenerateConditions(FCondSB, stUpdate, ModifiedFieldsOnly, KeyAndDataFields, Index); + end; +end; + +procedure TDASQLGenerator.GenerateDeleteSQL( + const KeyAndDataFields: TKeyAndDataFields; + const ModifiedFieldsOnly: boolean; + const Index: integer = -1); +begin + FHeaderSB.Append('DELETE FROM '); + FHeaderSB.Append(FTableInfo.NormalizeName(FTableInfo.TableNameFull, FOwner.FOptions.FQuoteNames)); + FHeaderSB.Append(SLLineSeparator); + FHeaderSB.Append('WHERE'); + FHeaderSB.Append(SLLineSeparator); + FHeaderSB.Append(' '); + GenerateConditions(FCondSB, stDelete, ModifiedFieldsOnly, KeyAndDataFields, Index); +end; + +procedure TDASQLGenerator.GenerateLockSQL( + const KeyAndDataFields: TKeyAndDataFields; + const Index: integer = -1); +begin + +end; + +procedure TDASQLGenerator.AddFieldToRefreshSQL(FieldDesc: TCRFieldDesc); +begin + if FFldSB.Length > 0 then + FFldSB.Append(', '); + + if FieldDesc.TableInfo = nil then + FFldSB.Append(FieldDesc.ActualNameQuoted(TCRRecordSet(FOwner.Data), FOwner.Options.QuoteNames)) + else + if FieldDesc.TableInfo.TableAlias <> '' then + FFldSB.Append(FieldDesc.TableInfo.NormalizeName(FieldDesc.TableInfo.TableAlias, FOwner.FOptions.FQuoteNames) + + '.' + FieldDesc.ActualNameQuoted(TCRRecordSet(FOwner.Data), FOwner.Options.QuoteNames)) + else + FFldSB.Append(FieldDesc.TableInfo.NormalizeName(FieldDesc.TableInfo.TableName, FOwner.FOptions.FQuoteNames) + + '.' + FieldDesc.ActualNameQuoted(TCRRecordSet(FOwner.Data), FOwner.Options.QuoteNames)); + + if not (csDesigning in FOwner.ComponentState) then + FFldSB.Append(' AS ' + GenerateIndexName(IntToStr(FOwner.FIRecordSet.Fields.IndexOf(FieldDesc)))); +end; + +procedure TDASQLGenerator.GenerateRefreshSQLSelectPart(const KeyAndDataFields: TKeyAndDataFields); +var + i: integer; + FieldArrHigh: integer; + UseDataFields: boolean; + FieldDesc: TCRFieldDesc; +begin + FHeaderSB.Append('SELECT '); + + UseDataFields := Length(KeyAndDataFields.DataFieldDescs) > 0; + if UseDataFields then + FieldArrHigh := Length(KeyAndDataFields.DataFieldDescs) - 1 + else + FieldArrHigh := High(KeyAndDataFields.KeyFieldDescs); + + // SELECT ... FROM .... {WITH NOLOCK} + // Add SELECT section + for i := 0 to FieldArrHigh do begin + if UseDataFields then + FieldDesc := KeyAndDataFields.DataFieldDescs[i] + else + FieldDesc := KeyAndDataFields.KeyFieldDescs[i]; + + AddFieldToRefreshSQL(FieldDesc); + end; +end; + +procedure TDASQLGenerator.GenerateRefreshSQLFromPart; +begin + FMiddleSB.Append(FTableInfo.NormalizeName(FTableInfo.TableName, FOwner.FOptions.FQuoteNames)); + if FTableInfo.TableAlias <> '' then begin + FMiddleSB.Append(' '); + FMiddleSB.Append(FTableInfo.NormalizeName(FTableInfo.TableAlias, FOwner.FOptions.FQuoteNames)); + end; +end; + +procedure TDASQLGenerator.GenerateRefreshSQL( + const KeyAndDataFields: TKeyAndDataFields; + const ModifiedFieldsOnly: boolean); +begin + GenerateConditions(FCondSB, stRefresh, ModifiedFieldsOnly, KeyAndDataFields); + if FOwner.Options.FullRefresh or FOwner.ReadOnly then begin + if FCondSB.Length = 0 then + FHeaderSB.Append(FOwner.SQL.Text) + else begin + FHeaderSB.Append(FOwner.SQLAddWhere(FOwner.SQL.Text, SLLineSeparator + ' ' + FCondSB.ToString)); + FCondSB.Length := 0; // WHERE clause already added to FHeaderSB + end; + end + else begin + GenerateRefreshSQLSelectPart(KeyAndDataFields); + FMiddleSB.Append(' FROM '); + GenerateRefreshSQLFromPart; + FMiddleSB.Append(SLLineSeparator); + FMiddleSB.Append('WHERE'); + FMiddleSB.Append(SLLineSeparator); + FMiddleSB.Append(' '); + end; +end; + +procedure TDASQLGenerator.GenerateRefreshQuickSQL(const KeyAndDataFields: TKeyAndDataFields); +begin + GenerateConditions(FCondSB, stRefreshQuick, False{ignored}, KeyAndDataFields); + FHeaderSB.Append(FOwner.SQLAddWhere(FOwner.FinalSQL, FCondSB.ToString)); + FCondSB.Length := 0; // WHERE clause already added to FHeaderSB +end; + +procedure TDASQLGenerator.GenerateRefreshCheckDeletedSQL(const KeyAndDataFields: TKeyAndDataFields); +var + i: integer; + FieldDesc: TFieldDesc; + ActualFieldName: string; + Condition: string; + + function ForceUnQuoteName(AName: string): string; + var + l: integer; + begin + AName := Trim(AName); + l := Length(AName); + if (l >= 3) and (AName[1] = FOwner.FLeftQuote) and (AName[l] = FOwner.FRightQuote) then + Result := Copy(AName, 2, l - 2) + else + Result := AName; + end; + +begin + FHeaderSB.Append('SELECT '); + + for i:= 0 to Length(KeyAndDataFields.KeyFieldDescs) - 1 do begin + FieldDesc := KeyAndDataFields.KeyFieldDescs[i]; + if i > 0 then begin + FFldSB.Append(', '); + FFooterSB.Append(', '); + end; + ActualFieldName := GetActualFieldName(TCRFieldDesc(FieldDesc), False); + FFldSB.Append(ActualFieldName); + FFooterSB.Append(ActualFieldName); + if UpperCase(ForceUnQuoteName(ActualFieldName)) <> UpperCase(ForceUnQuoteName(FieldDesc.Name)) then + FFldSB.Append(' AS ' + FieldDesc.Name); + end; + + FMiddleSB.Append(' FROM '); + FMiddleSB.Append(FTableInfo.NormalizeName(FTableInfo.TableNameFull, FOwner.FOptions.FQuoteNames)); + Condition := FOwner.SQLGetWhere(FOwner.FinalSQL); + if Condition <> '' then + FMiddleSB.Append(' WHERE ' + Condition); + FMiddleSB.Append(' ORDER BY '); +end; + +function TDASQLGenerator.GenerateSQLforUpdTable(TableInfo: TCRTableInfo; + const KeyAndDataFields: TKeyAndDataFields; + const StatementType: TStatementType; + const ModifiedFieldsOnly: boolean; + Params: TDAParams; + const Index: integer = -1): string; +{$IFNDEF CLR} +var + i: integer; +{$ENDIF} +begin + if TableInfo.TableName = '' then + DatabaseError(SBadTableInfoName); + + Clear; + + FTableInfo := TableInfo; + FParams := Params; + if FParams <> nil then begin + FParams.BeginUpdate; + FParams.Clear; + FParamsInfo.Clear; + end; + try + case StatementType of + stInsert: + GenerateInsertSQL(KeyAndDataFields, ModifiedFieldsOnly, Index); + stUpdate: + GenerateUpdateSQL(KeyAndDataFields, ModifiedFieldsOnly, Index); + stDelete: + GenerateDeleteSQL(KeyAndDataFields, ModifiedFieldsOnly, Index); + stLock: + GenerateLockSQL(KeyAndDataFields, Index); + stRefresh: + GenerateRefreshSQL(KeyAndDataFields, ModifiedFieldsOnly); + stRefreshQuick: + GenerateRefreshQuickSQL(KeyAndDataFields); + stRefreshCheckDeleted: + GenerateRefreshCheckDeletedSQL(KeyAndDataFields); + else + DatabaseError(SBadStatementType); + end; + + Result := AssembleSB(StatementType); + finally + if FParams <> nil then begin + FParams.EndUpdate; + {$IFNDEF CLR} + for i := 0 to FParams.Count - 1 do + _TParam(TCollection(FParams).Items[i]).FParamRef := TParam(TCollection(FParams).Items[i]); + {$ENDIF} + end; + end; +end; + +function TDASQLGenerator.GenerateSQL(const StatementType: TStatementType; + const ModifiedFieldsOnly: boolean; + Params: TDAParams; + const Index: Integer = -1): string; +var + KeyAndDataFields: TKeyAndDataFields; +begin +{$IFDEF PERF_COUNTER} + PerfCounters[4].Start; +{$ENDIF} + if FOwner.FUpdatingTableInfoIdx = -1 then + Result := '' + else + begin + FOwner.GetKeyAndDataFields(KeyAndDataFields, (StatementType = stRefresh) and FOwner.Options.FullRefresh); + Result := GenerateSQLforUpdTable(FOwner.TablesInfo[FOwner.FUpdatingTableInfoIdx], + KeyAndDataFields, StatementType, ModifiedFieldsOnly, Params, Index); + end; +{$IFDEF PERF_COUNTER} + PerfCounters[4].Stop; +{$ENDIF} +end; + +{ TCustomDASQL } + +constructor TCustomDASQL.Create(Owner: TComponent); +begin + inherited Create(Owner); + + FSQL := TStringList.Create; + TStringList(FSQL).OnChange := SQLChanged; + FParams := CreateParamsObject; + FParamCheck := True; + if Owner is TCustomDADataSet then + FMacros := TMacros.Create(Owner) + else + FMacros := TMacros.Create(Self); + FChangeCursor := True; + + FDesignCreate := csDesigning in ComponentState; + + if not (Owner is TCustomDADataSet) then // temp + CreateICommand; +end; + +destructor TCustomDASQL.Destroy; +var + Owner: TComponent; +begin + UnPrepare; + + if UsedConnection <> nil then + UsedConnection.UnregisterClient(Self); + + FMacros.Free; + FParams.Clear; // To prevent SharedObj leak on CLR + FParams.Free; + FSQL.Free; + + Owner := Self.Owner; + + inherited; + + if not (Owner is TCustomDADataSet) then // temp + FreeICommand; +end; + +procedure TCustomDASQL.CreateICommand; +begin + if UsedConnection <> nil then + SetICommand(UsedConnection.CreateICommand) + else + SetICommand(nil); +end; + +procedure TCustomDASQL.FreeICommand; +begin + FICommand.Free; + SetICommand(nil); +end; + +procedure TCustomDASQL.SetICommand(Value: TCRCommand); +var + ScanParams: variant; +begin + FICommand := Value; + + if FICommand <> nil then begin + if FConnection <> nil then + FICommand.SetConnection(FConnection.FIConnection) + else + FICommand.SetConnection(nil); + + FICommand.SetSQL(FNativeSQL); //AssembleSQL; // set FICommand.SQL + FICommand.SetProp(prAutoCommit, FAutoCommit); + FICommand.AfterExecute := DoAfterExecute; + if (Owner is TCustomDADataSet) or (Owner is TCustomDAConnection) then + FICommand.Component := Owner + else + FICommand.Component := Self; + FICommand.GetProp(prScanParams, ScanParams); + + // Write param info + if not boolean(ScanParams) then + WriteParams(False); + end; +end; + +procedure TCustomDASQL.CheckICommand; +var + ClassType: TClass; +begin + if (UsedConnection <> nil) then + ClassType := UsedConnection.GetICommandClass + else + ClassType := nil; + + if (ClassType = nil) or not (FICommand is ClassType) then begin + FreeICommand; + CreateICommand; + end; +end; + +function TCustomDASQL.CreateParamsObject: TDAParams; +begin + Result := TDAParams.Create(Self); +end; + +procedure TCustomDASQL.Loaded; +begin + inherited; + + FDesignCreate := False; +end; + +function TCustomDASQL.UsedConnection: TCustomDAConnection; +begin + Result := FConnection +end; + +procedure TCustomDASQL.CheckConnection; +begin + BeginConnection(False); +end; + +procedure TCustomDASQL.BeginConnection(NoConnectCheck: boolean = True); +begin + if UsedConnection = nil then + DatabaseError(SConnectionNotDefined); + + + if NoConnectCheck then + UsedConnection.InternalConnect // We should call connect each time to update ConnectCount + else + if not UsedConnection.Connected then + UsedConnection.Connect; + +// use default session + if (FConnection = nil) and (UsedConnection.FSQLs.IndexOf(Self) = -1) then begin + UsedConnection.RegisterClient(Self, ConnectChange); + + CheckICommand; + FICommand.SetConnection(UsedConnection.FIConnection) + end; +end; + +procedure TCustomDASQL.EndConnection; +begin + if UsedConnection <> nil then + UsedConnection.InternalDisconnect; +end; + +procedure TCustomDASQL.Disconnect; +begin + if FDataSet = nil then + UnPrepare + else + FDataSet.Disconnect; +end; + +procedure TCustomDASQL.ConnectChange(Sender: TObject; Connecting: boolean); +begin + if not Connecting then + Disconnect; +end; + +procedure TCustomDASQL.InternalPrepare; +begin + FICommand.Prepare; +end; + +procedure TCustomDASQL.Prepare; +var + MessageID: cardinal; +begin + if not Prepared then begin + BeginConnection; + + if not FLockDebug and (TDASQLMonitorClass(UsedConnection.SQLMonitorClass).HasMonitor or Debug) then + TDASQLMonitorClass(UsedConnection.SQLMonitorClass).SQLPrepare(Self, FinalSQL, FParams, MessageID, True); + + InternalPrepare; + + if not FLockDebug and (TDASQLMonitorClass(UsedConnection.SQLMonitorClass).HasMonitor or Debug) then + TDASQLMonitorClass(UsedConnection.SQLMonitorClass).SQLPrepare(Self, FinalSQL, FParams, MessageID, False); + end; +end; + +procedure TCustomDASQL.InternalUnPrepare; +begin + FICommand.Unprepare; +end; + +procedure TCustomDASQL.UnPrepare; +begin + if Prepared then begin + try + InternalUnPrepare; + finally + EndConnection; //Diconnect after no longer prepared + end; + end; +end; + +procedure TCustomDASQL.InternalExecute(Iters: integer); +var + ReExecute: boolean; +begin + if UsedConnection <> nil then + UsedConnection.PushOperation(clExecute); + try + repeat + ReExecute := False; + try + FICommand.Execute(Iters); + except + on E: EFailOver do + if E.FConnLostCause = clExecute then begin + Connection.RestoreAfterFailOver; //Restore all read transactions + ReExecute := True; //We should pass clConnectionApplyUpdates FailOver + end + else + raise; + end; + until (not ReExecute); + finally + if UsedConnection <> nil then + UsedConnection.PopOperation; + end; +end; + +procedure TCustomDASQL.Execute; +begin + Execute(1); +end; + +procedure TCustomDASQL.Execute(Iters: integer); +var + MessageID: cardinal; +begin + if not Executing then begin + BeginConnection; + + if not FLockDebug and (TDASQLMonitorClass(UsedConnection.SQLMonitorClass).HasMonitor or Debug) then + TDASQLMonitorClass(UsedConnection.SQLMonitorClass).SQLExecute(Self, FinalSQL, FParams, '', MessageID, True); + + if FChangeCursor then + if FNonBlocking then + SetCursor(crSQLArrow) + else + StartWait; + + WriteParams; + InternalExecute(Iters); + + if not FLockDebug and (TDASQLMonitorClass(UsedConnection.SQLMonitorClass).HasMonitor or Debug) then + TDASQLMonitorClass(UsedConnection.SQLMonitorClass).SQLExecute(Self, FinalSQL, FParams, '', MessageID, False); + end; +end; + +procedure TCustomDASQL.DoAfterExecute(Result: boolean); +var + Connection: TCustomDAConnection; +begin + if Result then + ReadParams; + + if FChangeCursor and FNonBlocking then + StopWait; + + Connection := UsedConnection; + if Connection.Options.DisconnectedMode and Connection.Connected then begin + //AutoCommit control + if not (Connection.AutoCommit and AutoCommit) and + (Connection.FTransactionID = '') then begin //Connection.GetInTransaction are not allowed here since it could be setted to True on + // Product level during Execuion without AutoCommit (ODAC, IBDAC) + //There is uncommitted transaction that was implicitly started by server + Connection.FTransactionID := 'CRImplicitTransaction'; //Set default value + Connection.FTransactionID := Connection.GetTransactionID; //To return product specific TransactionId + //or even reset InTransaction in case of transaction-free server operation + end + else + if Connection.AutoCommit and AutoCommit then begin + Connection.FTransactionID := Connection.GetTransactionID; //To return product specific TransactionId + end; + end; + EndConnection; //we should read all Out parameters before disconnect, so + //in NonBlocking Mode this event must be called exactly after server execute + if Assigned(FAfterExecute) then + FAfterExecute(Self, Result); +end; + +function TCustomDASQL.Executing: boolean; +var + Value: variant; +begin + FICommand.GetProp(prExecuting, Value); + Result := Value; +end; + +function TCustomDASQL.WaitExecuting(TimeOut: integer): boolean; +{$IFDEF MSWINDOWS} +var + Msg: TMSG; + T: DWORD; +{$ENDIF} +begin +{$IFDEF MSWINDOWS} + T := GetTickCount; + while Executing and ((TimeOut = 0) or (GetTickCount - T < DWORD(TimeOut * 1000))) do + if PeekMessage(Msg, 0, 0, 0, PM_REMOVE) then begin + if Msg.Message <> WM_QUIT then begin + TranslateMessage(Msg); + DispatchMessage(Msg); + end; + end; +{$ELSE} + while Executing do; +{$ENDIF} + + Result := not Executing; +end; + +procedure TCustomDASQL.ScanMacros; +begin + if FDataSet = nil then + FMacros.Scan(FSQL.Text) + else + FDataSet.ScanMacros; +end; + +function TCustomDASQL.GetFinalSQL: string; +var + i: Integer; +begin + Result := FSQL.Text; + + // Copied from SysUtils + i := Length(Result); + while (i > 0) and (Result[i] <= ' ') do + Dec(i); + SetLength(Result, i); + + if FMacros.Count > 0 then + FMacros.Expand(Result); +end; + +function TCustomDASQL.ParseSQL(const SQL: string; Params: TDAParams; RenamePrefix: string = ''): string; +var + ParsedSQL: StringBuilder; + Parser: TParser; + StartPos: integer; + + LeftQuote, RightQuote: char; +begin + if FDataSet <> nil then begin + LeftQuote := FDataSet.FLeftQuote; + RightQuote := FDataSet.FRightQuote; + end + else + begin + LeftQuote := '"'; + RightQuote := '"'; + end; + + ParsedSQL := StringBuilder.Create(Length(SQL) + Length(SQL) div 2); + try + Parser := CreateParser(SQL); + try + if Params <> nil then begin + Params.BeginUpdate; + Params.Clear; + end; + Parser.OmitBlank := False; + Parser.OmitComment := True; + Parser.QuotedString := True; + Parser.ToBegin; + StartPos := Parser.CurrPos; + while Parser.ToLexem(':') do begin + ParsedSQL.Append(Copy(SQL, StartPos + 1, Parser.CurrPos - StartPos - 1)); + ParseSQLParam(ParsedSQL, Parser, Params, LeftQuote, RightQuote, RenamePrefix); + + StartPos := Parser.CurrPos; + end; + ParsedSQL.Append(Copy(SQL, StartPos + 1, Parser.CurrPos - StartPos)); + finally + Parser.Free; + if Params <> nil then + Params.EndUpdate; + end; + + Result := ParsedSQL.ToString; + finally + ParsedSQL.Free; + end; +end; + +function TCustomDASQL.ParseSQL(Params: TDAParams): string; +begin + Result := ParseSQL(FNativeSQL, Params, ''); +end; + +procedure TCustomDASQL.ParseSQLParam(ParsedSQL: StringBuilder; Parser: TParser; Params: TDAParams; const LeftQuote, RightQuote: char; RenamePrefix: string); +var + Code: integer; + St: string; + DogPresent: boolean; + l: integer; + ParamName: string; +begin + Code := Parser.GetNext(St); + DogPresent := St = '@'; + if DogPresent then + Code := Parser.GetNext(St); // Omit '@' in ParamName for BDE compatibility + + if ((Params <> nil) or (RenamePrefix <> '')) and ((Code = lcIdent) or (Code = lcNumber) or (Parser.KeywordLexems.IndexOf(St) <> -1)) // and (St <> '=') + then begin + if DogPresent then + ParamName := '@' + St + else + ParamName := St; + + l := Length(ParamName); + // remove quotes + if (ParamName[1] = LeftQuote) and (ParamName[l] = RightQuote) then + ParamName := Copy(ParamName, 2, l - 2); + if Params <> nil then begin + TDAParam(Params.Add).Name := ParamName; + ParsedSQL.Append('?'); + end + else + ParsedSQL.Append(RenamePrefix + ParamName); + end + else // Labels in SQL Server, MySQL syntax and PL SQL Blocks (a := b). + begin + ParsedSQL.Append(':'); + if DogPresent then + ParsedSQL.Append('@'); + ParsedSQL.Append(St); + end; +end; + +function TCustomDASQL.CreateParser(const Text: string): TParser; +begin + Result := TParser.Create(Text); +end; + +procedure TCustomDASQL.AssembleSQL; +var + InternalScanParams: variant; // scan params by internal layer + List: TDAParams; +begin +{$IFDEF PERF_COUNTER} + //PerfCounters[3].Start; +{$ENDIF} + + if FDataSet = nil then + FNativeSQL := FinalSQL + else + FNativeSQL := FDataSet.FinalSQL; + + FICommand.GetProp(prScanParams, InternalScanParams); + + if ParamCheck or (csDesigning in ComponentState) then begin + List := CreateParamsObject; + try + if boolean(InternalScanParams) then begin + // Internal param parsing + List.Assign(FParams); + + FICommand.SetSQL(FNativeSQL); + + CreateParams; + + FParams.AssignValues(List); + end + else begin + List.BeginUpdate; + try + FNativeSQL := ParseSQL(FNativeSQL, List); + List.AssignValues(FParams); + finally + List.EndUpdate; + end; + + FParams.Clear; + FParams.Assign(List); + + FICommand.SetSQL(FNativeSQL); + + WriteParams(False); + end; + finally + List.Clear; + List.Free; + end; + end + else begin +// if not InternalScanParams then // replace parameters +// FNativeSQL := FParams.ParseSQL(FNativeSQL, False); // needed only in SDAC + + FICommand.SetSQL(FNativeSQL); + end; +{$IFDEF PERF_COUNTER} + //PerfCounters[3].Stop; +{$ENDIF} +end; + +// creates TDAParam objects if parameters was parsed by FICommand +procedure TCustomDASQL.CreateParams; +var + ParamDesc: TParamDesc; + i: integer; +begin + FParams.BeginUpdate; + try + FParams.Clear; + for i := 0 to FICommand.GetParamCount - 1 do begin + ParamDesc := FICommand.GetParam(i); + with FParams.Add as TDAParam do begin + Name := ParamDesc.GetName; + DataType := GetFieldType(ParamDesc.GetDataType); + ParamType := TParamType(ParamDesc.GetParamType); + end; + end; + finally + FParams.EndUpdate; + end; +end; + +// Write values of parameters to FICommand +procedure TCustomDASQL.WriteParams(WriteValue: boolean = True); +var + Param: TDAParam; + ParamDesc: CRAccess.TParamDesc; + Dt: word; + + procedure WriteParamValue; + var + Value: Variant; + {$IFDEF CLR} + Bytes: TBytes; + {$ELSE} + l: integer; + s: string; + {$ENDIF} + {$IFNDEF VER6P} + tmp: int64; + {$ENDIF} + begin + if Param.IsObjectDataType then begin + ParamDesc.SetNull(Param.IsNull); + ParamDesc.SetObject(Param.ParamObject); + Exit; + end; + + Value := Param.Value; + if (Param.DataType = ftDate) and not (VarIsEmpty(Value) or VarIsNull(Value)) then begin + {$IFDEF VER6P} + Value := Trunc(Value); // drop time info /// CR-D16224 + {$ELSE} + tmp := Trunc(Value); + TVarData(Value).VType := varInt64; + TVarDataD6(Value).VInt64 := tmp; + {$ENDIF} + end; + + + // Convert param values if necessary + if ((Dt = dtBytes) or (Dt = dtVarBytes) or (Dt = dtBlob)) + and (VarType(Value) <> varArray + varByte) then + case VarType(Value) of + varString{$IFDEF CLR}, varChar{$ENDIF}: begin + {$IFDEF CLR} + Bytes := Encoding.Default.GetBytes(String(Value)); + Value := Unassigned; + Value := Bytes; + {$ELSE} + s := Value; + l := Length(s); + Value := Unassigned; + Value := VarArrayCreate([0, l - 1], varByte); + if l > 0 then + Move(s[1], TVarData(Value).VArray.Data^, l); + {$ENDIF} + end; + end; + ParamDesc.SetValue(Unassigned); + ParamDesc.SetValue(Value); + end; + +var + ft: TFieldType; + i: integer; +begin + for i := 0 to Params.Count - 1 do begin + Param := Params[i]; + if i < FICommand.GetParamCount then + ParamDesc := FICommand.GetParam(i) + else + ParamDesc := FICommand.AddParam; + ParamDesc.SetName(Param.Name); + + ft := Param.DataType; + dt := GetDataType(ft); + + ParamDesc.SetDataType(dt); + ParamDesc.SetParamType(TParamDirection(Param.ParamType)); + + if WriteValue then begin + {$IFDEF PERF_COUNTER} + PerfCounters[5].Start; + {$ENDIF} + WriteParamValue; + {$IFDEF PERF_COUNTER} + PerfCounters[5].Stop; + {$ENDIF} + end; + end; + while Params.Count < FICommand.GetParamCount do + FICommand.DeleteParam(FICommand.GetParamCount - 1); +end; + +// Read values of parameters from FICommand +procedure TCustomDASQL.ReadParams; +var + i: integer; + Param: TDAParam; + ParamDesc: TParamDesc; +begin + for i := 0 to FParams.Count - 1 do begin + Param := Params[i]; + ParamDesc := FICommand.GetParam(i); + if ParamDesc <> nil then + if (not Param.IsObjectDataType) and (Param.ParamType in [ptUnknown, ptOutput, ptInputOutput, ptResult]) then + Param.Value := ParamDesc.Value; + end; +end; + +procedure TCustomDASQL.DefineProperties(Filer: TFiler); + function WriteParams: boolean; + begin + if Filer.Ancestor <> nil then + Result := not FParams.IsEqual(TCustomDASQL(Filer.Ancestor).FParams) + else + Result := FParams.Count > 0; + end; + + function WriteMacros: boolean; + begin + if Filer.Ancestor <> nil then + Result := not FMacros.IsEqual(TCustomDASQL(Filer.Ancestor).FMacros) + else + Result := FMacros.Count > 0; + end; +begin + inherited DefineProperties(Filer); + + Filer.DefineProperty('ParamData', ReadParamData, WriteParamData, WriteParams); + Filer.DefineProperty('MacroData', ReadMacroData, WriteMacroData, WriteMacros); +end; + +procedure TCustomDASQL.ReadParamData(Reader: TReader); +begin + Reader.ReadValue; + Reader.ReadCollection(FParams); +end; + +procedure TCustomDASQL.WriteParamData(Writer: TWriter); +begin + Writer.WriteCollection(FParams); +end; + +procedure TCustomDASQL.ReadMacroData(Reader: TReader); +begin + Reader.ReadValue; + Reader.ReadCollection(FMacros); +end; + +procedure TCustomDASQL.WriteMacroData(Writer: TWriter); +begin + Writer.WriteCollection(FMacros); +end; + +function TCustomDASQL.FindParam(const Value: string): TDAParam; +begin + Result := FParams.FindParam(Value); +end; + +function TCustomDASQL.ParamByName(const Value: string): TDAParam; +begin + Result := FParams.ParamByName(Value); +end; + +function TCustomDASQL.FindMacro(const Value: string): TMacro; +begin + Result := FMacros.FindMacro(Value); +end; + +function TCustomDASQL.MacroByName(const Value: string): TMacro; +begin + Result := FMacros.MacroByName(Value); +end; + +procedure TCustomDASQL.AssignTo(Dest: TPersistent); +begin + if Dest is TCustomDASQL then begin + TCustomDASQL(Dest).Connection := Connection; + TCustomDASQL(Dest).ParamCheck := ParamCheck; // before SQL + TCustomDASQL(Dest).SQL.Text := SQL.Text; + TCustomDASQL(Dest).Macros.Assign(Macros); + TCustomDASQL(Dest).Params.Assign(Params); + TCustomDASQL(Dest).Debug := Debug; + TCustomDASQL(Dest).AutoCommit := AutoCommit; + end + else + inherited; +end; + +procedure TCustomDASQL.SetConnection(Value: TCustomDAConnection); +begin + if (Value <> FConnection) or (Value <> UsedConnection) then begin + if UsedConnection <> nil then begin + Disconnect; + UsedConnection.UnregisterClient(Self); + end; + + FConnection := Value; + + if FConnection <> nil then begin + Value.RegisterClient(Self, ConnectChange); + + CheckICommand; + FICommand.SetConnection(FConnection.FIConnection) + end + else + FICommand.SetConnection(nil); + end; +end; + +procedure TCustomDASQL.SetSQL(Value: TStrings); +begin + if FSQL.Text <> Value.Text then begin + FSQL.BeginUpdate; + try + FSQL.Assign(Value); + finally + FSQL.EndUpdate; + end; + end; +end; + +procedure TCustomDASQL.SQLChanged(Sender: TObject); +var + Cmd: TCRCommand; +begin + //if not (csReading in ComponentState) then begin + if FDataSet = nil then + UnPrepare + else begin + if not BaseSQLOldBehavior then + FDataSet.FBaseSQL := ''; + FDataSet.Close; + FDataSet.UnPrepare; + FDataSet.FieldDefs.Updated := False; + + if FDataSet.Data is TCRRecordSet then begin + Cmd := TCRRecordSet(FDataSet.Data).GetCommand; + if Cmd <> nil then + Cmd.SetCursorState(csInactive); + TCRRecordSet(FDataSet.Data).CommandType := ctUnknown; + end; + + FDataSet.FOldTableName := ''; + FDataSet.FOldKeyFields := ''; + end; + + if not FLockMacros then + ScanMacros; + + if not FLockAssembleSQL then + AssembleSQL + else + FICommand.SetSQL(FSQL.Text); +end; + +function TCustomDASQL.GetPrepared: boolean; +begin + Result := FICommand.GetPrepared; +end; + +procedure TCustomDASQL.SetPrepared(Value: boolean); +begin + if Value then + Prepare + else + UnPrepare; +end; + +procedure TCustomDASQL.SetParams(Value: TDAParams); +begin + FParams.AssignValues(Value); +end; + +function TCustomDASQL.GetParamCount: word; +begin + Result := FParams.Count; +end; + +procedure TCustomDASQL.SetParamCheck(Value: boolean); +begin + FParamCheck := Value; + + Value := Value or (csDesigning in ComponentState); // set value of ScanParams + FICommand.SetProp(prScanParams, Value); + + if Value then + AssembleSQL; +end; + +function TCustomDASQL.GetParamValues(ParamName: string): variant; +begin + Result := FParams.ParamValues[ParamName]; +end; + +procedure TCustomDASQL.SetParamValues(ParamName: string; Value: variant); +begin + FParams.ParamValues[ParamName] := Value; +end; + +procedure TCustomDASQL.SetMacros(Value: TMacros); +begin + FMacros.Assign(Value); +end; + +function TCustomDASQL.GetMacroCount: word; +begin + Result := FMacros.Count; +end; + +procedure TCustomDASQL.SetAutoCommit(Value: boolean); +begin + FAutoCommit := Value; + Assert(FICommand <> nil); + FICommand.SetProp(prAutoCommit, FAutoCommit); +end; + +function TCustomDASQL.GetRowsAffected: integer; +var + Value: variant; +begin + FICommand.GetProp(prRowsProcessed, Value); + Result := Value; +end; + +{ TCustomDAUpdateSQL } + +constructor TCustomDAUpdateSQL.Create(Owner: TComponent); +var + UpdateKind: TUpdateKind; +begin + inherited; + + for UpdateKind := Low(TUpdateKind) to High(TUpdateKind) do + FSQLText[UpdateKindToStatementType(UpdateKind)] := TStringList.Create; + FSQLText[stRefresh] := TStringList.Create; +end; + +destructor TCustomDAUpdateSQL.Destroy; +var + StatementType: TStatementType; +begin + if Assigned(FDataSet) and (FDataSet.UpdateObject = Self) then + FDataSet.UpdateObject := nil; + for StatementType := Low(TStatementType) to High(TStatementType) do + FSQLText[StatementType].Free; + + inherited; +end; + +procedure TCustomDAUpdateSQL.ExecSQL(UpdateKind: TUpdateKind); +var + StatementType: TStatementType; +begin + StatementType := UpdateKindToStatementType(UpdateKind); + FDataSet.PerformSQL(FSQLText[StatementType].Text, [StatementType]); +end; + +function TCustomDAUpdateSQL.GetSQL(UpdateKind: TUpdateKind): TStrings; +begin + Result := GetSQLIndex(Ord(UpdateKindToStatementType(UpdateKind))); +end; + +procedure TCustomDAUpdateSQL.SetSQL(UpdateKind: TUpdateKind; Value: TStrings); +begin + SetSQLIndex(Ord(UpdateKindToStatementType(UpdateKind)), Value); +end; + +function TCustomDAUpdateSQL.GetSQLIndex(Index: integer): TStrings; +begin + Result := FSQLText[TStatementType(Index)]; +end; + +procedure TCustomDAUpdateSQL.SetSQLIndex(Index: integer; Value: TStrings); +begin + FSQLText[TStatementType(Index)].Assign(Value); +end; + +function TCustomDAUpdateSQL.GetDataSet: TCustomDADataSet; +begin + Result := FDataSet; +end; + +procedure TCustomDAUpdateSQL.SetDataSet(DataSet: TCustomDADataSet); +begin + FDataSet := DataSet; +end; + +procedure TCustomDAUpdateSQL.SetObjectIndex(Index: integer; Value: TComponent); +begin + CheckUpdateComponent(Value); + FUpdateObject[TStatementType(Index)] := Value; +end; + +function TCustomDAUpdateSQL.GetObjectIndex(Index: integer): TComponent; +begin + Result := FUpdateObject[TStatementType(Index)]; +end; + +function TCustomDAUpdateSQL.DataSetClass: TCustomDADataSetClass; +begin + Result := TCustomDADataSet; +end; + +function TCustomDAUpdateSQL.SQLClass: TCustomDASQLClass; +begin + Result := TCustomDASQL; +end; + +procedure TCustomDAUpdateSQL.CheckUpdateComponent(Component: TComponent; NewDataset: TCustomDADataset); +begin + if Component <> nil then begin + if not ((Component is SQLClass) or (Component is DataSetClass)) then + raise Exception.Create(Format(SUpdateComponentInvalidType, [DataSetClass.ClassName, SQLClass.ClassName])); + if NewDataSet = Component then + raise Exception.Create(SUpdateComponentCircularReferences); + end; +end; + +procedure TCustomDAUpdateSQL.CheckUpdateComponent(Component: TComponent); +begin + CheckUpdateComponent(Component, FDataset); +end; + +procedure TCustomDAUpdateSQL.Notification(AComponent: TComponent; Operation: TOperation); +var + stIdx: TStatementType; +begin + inherited; + if Operation = opRemove then + for stIdx := Low(FUpdateObject) to High(FUpdateObject) do + if FUpdateObject[stIdx] = AComponent then + FUpdateObject[stIdx] := nil; +end; + +procedure TCustomDAUpdateSQL.Apply(UpdateKind: TUpdateKind); +begin + ExecSQL(UpdateKind); +end; + +procedure TCustomDAUpdateSQL.Loaded; +begin + inherited; + + FDesignCreate := False; +end; + +procedure TCustomDAUpdateSQL.AssignTo(Dest: TPersistent); +begin + if Dest is TCustomDAUpdateSQL then begin + TCustomDAUpdateSQL(Dest).RefreshSQL := RefreshSQL; + TCustomDAUpdateSQL(Dest).ModifySQL := ModifySQL; + TCustomDAUpdateSQL(Dest).InsertSQL := InsertSQL; + TCustomDAUpdateSQL(Dest).DeleteSQL := DeleteSQL; + TCustomDAUpdateSQL(Dest).DataSet := DataSet; + TCustomDAUpdateSQL(Dest).RefreshObject := RefreshObject; + TCustomDAUpdateSQL(Dest).ModifyObject := ModifyObject; + TCustomDAUpdateSQL(Dest).InsertObject := InsertObject; + TCustomDAUpdateSQL(Dest).DeleteObject := DeleteObject; + end + else + inherited; +end; + +{ TMacro } + +constructor TMacro.Create(Collection: TCollection); +begin + inherited; + + FActive := True; +end; + +procedure TMacro.AssignTo(Dest: TPersistent); +begin + if Dest is TMacro then begin + TMacro(Dest).Name := Name; + TMacro(Dest).Value := Value; + TMacro(Dest).Active := Active; + end + else + inherited; +end; + +function TMacro.IsEqual(Value: TMacro): boolean; +begin + Result := (Name = Value.Name) and + (Self.Value = Value.Value) and + (Active = Value.Active); +end; + +function TMacro.GetDisplayName: string; +begin + if FName = '' then + Result := inherited GetDisplayName + else + Result := FName; +end; + +procedure TMacro.SetValue(Value: string); +var + Owner: TPersistent; + OldBaseSQL: string; +begin + if Value <> FValue then begin + FValue := Value; + Owner := TMacros(Collection).FOwner; + if (TMacros(Collection).UpdateCount = 0) and + (Owner <> nil) + then + if Owner is TCustomDADataSet then + with TCustomDADataSet(Owner) do begin + if not Active or (Pos(MacroChar + Self.Name, SQL.Text) <> 0) then begin + OldBaseSQL := FBaseSQL; + FCommand.SQLChanged(Self); + FBaseSQL := OldBaseSQL; + end; + end + else + TCustomDASQL(Owner).SQLChanged(Self); + end; +end; + +function TMacro.GetAsDateTime: TDateTime; +var + St: string; + iStart: integer; + iEnd: integer; + Len: integer; +begin + St := Trim(FValue); + Len := Length(FValue); + if (Len > 0) and (St[1] = '''') then + iStart := 2 + else + iStart := 1; + + if (Len > 0) and (St[Length(St)] = '''') then + iEnd := Length(St) - 1 + else + iEnd := Length(St); + + Result := StrToDateTime(Copy(St, iStart, iEnd - iStart + 1)); +end; + +procedure TMacro.SetAsDateTime(Value: TDateTime); +begin + Self.Value := '''' + DateTimeToStr(Value) + ''''; +end; + +function TMacro.GetAsFloat: double; +begin + Result := StrToFloat(FValue); +end; + +procedure TMacro.SetAsFloat(Value: double); +begin + Self.Value := FloatToStr(Value); +end; + +function TMacro.GetAsInteger: integer; +begin + Result := StrToInt(FValue); +end; + +procedure TMacro.SetAsInteger(Value: integer); +begin + Self.Value := IntToStr(Value); +end; + +function TMacro.GetAsString: string; +var + St: string; + iStart: integer; + iEnd: integer; + Len: integer; +begin + St := Trim(FValue); + Len := Length(FValue); + if (Len > 0) and (St[1] = '''') then + iStart := 2 + else + iStart := 1; + + if (Len > 0) and (St[Length(St)] = '''') then + iEnd := Length(St) - 1 + else + iEnd := Length(St); + + Result := Copy(St, iStart, iEnd - iStart + 1); +end; + +procedure TMacro.SetAsString(Value: string); +begin + Self.Value := '''' + Value + ''''; +end; + +procedure TMacro.SetActive(Value: boolean); +var + Owner: TPersistent; +begin + if Value <> FActive then begin + FActive := Value; + Owner := TMacros(Collection).FOwner; + if (TMacros(Collection).UpdateCount = 0) and + (Owner <> nil) + then + if Owner is TCustomDADataSet then + with TCustomDADataSet(Owner) do begin + if not Active or (Pos(MacroChar + Self.Name, SQL.Text) <> 0) then + AssembleSQL; + end + else + TCustomDASQL(Owner).AssembleSQL + end; +end; + +{ TMacros } + +constructor TMacros.Create(Owner: TPersistent); +begin + inherited Create(TMacro); + + FOwner := Owner; + FParserClass := TParser; +end; + +procedure TMacros.Scan(SQL: string); +var + Macro: TMacro; + NewMacros: TMacros; + Parser: TParser; + CodeLexem: integer; + St, St2: string; + MacroSt: string; // Delphi problem with compare MacroChar = St + Changed, NeedNext: boolean; + i: integer; + +begin + // performance reason +{$IFDEF CLR} + if SQL.IndexOf(Char(MacroChar)) = -1 then begin +{$ELSE} + if StrScan(PChar(SQL), MacroChar) = nil then begin +{$ENDIF} + Clear; + Exit; + end; + + NewMacros := TMacros.Create(nil); + NewMacros.BeginUpdate; + + Parser := FParserClass.Create(SQL); + MacroSt := MacroChar; + Parser.OmitBlank := False; + Parser.Uppered := False; + try + Parser.ToBegin; + repeat + repeat + CodeLexem := Parser.GetNext(St); //+++ char instead of string + until (CodeLexem = lcEnd) or (St = MacroSt); + repeat + NeedNext := True; + if (St = MacroSt) and Parser.IsMacroAllowed(CodeLexem) then begin + CodeLexem := Parser.GetNext(St); + if (CodeLexem = lcIdent) or Parser.IsNumericMacroNameAllowed and (CodeLexem = lcNumber) or + (CodeLexem > Parser.SymbolLexems.Count) and + (CodeLexem <= Parser.SymbolLexems.Count + Parser.KeywordLexems.Count) + // SQL reserved words are allowed + then begin + St2 := St; + if CodeLexem = lcNumber then begin + CodeLexem := Parser.GetNext(St); + if (CodeLexem = lcIdent) or (CodeLexem > Parser.SymbolLexems.Count) + and (CodeLexem <= Parser.SymbolLexems.Count + Parser.KeywordLexems.Count) + then + St2 := St2 + St + else + NeedNext := False + end; + Macro := NewMacros.FindMacro(St2); + if Macro = nil then begin + Macro := TMacro(NewMacros.Add); + if FindMacro(St2) <> nil then + Macro.Assign(FindMacro(St2)) + else + Macro.Name := St2; + end; + end; + end; + until NeedNext; + until CodeLexem = lcEnd; + + if Count <> NewMacros.Count then + Changed := True + else + begin + Changed := False; + for i := 0 to Count - 1 do + if not Items[i].IsEqual(NewMacros.Items[i]) then begin + Changed := True; + Break; + end; + end; + + if Changed then + Assign(NewMacros); + finally + Parser.Free; + NewMacros.Free; + end; +end; + +function TMacros.GetMacroValue(Macro: TMacro): string; +begin + if Macro.Active then + Result := Macro.Value + else + Result := ''; +end; + +procedure TMacros.Expand(var SQL: string); +var + Parser: TParser; + CodeLexem: integer; + Macro: TMacro; + St, St2: string; + MacroSt: string; // Delphi problem with compare MacroChar = St + Result: string; + NeedNext: boolean; +begin + Parser := FParserClass.Create(SQL); + MacroSt := MacroChar; + Parser.OmitBlank := False; + Parser.Uppered := False; + Parser.QuotedString := True; + try + Result := ''; + St := ''; + NeedNext := True; + CodeLexem := 0; // to prevent warning + Parser.ToBegin; + while True do begin + if NeedNext then + CodeLexem := Parser.GetNext(St); + + if CodeLexem = lcEnd then + Break; + + NeedNext := True; + if (St = MacroSt) and Parser.IsMacroAllowed(CodeLexem) then begin + CodeLexem := Parser.GetNext(St); + if (CodeLexem = lcIdent) or Parser.IsNumericMacroNameAllowed and (CodeLexem = lcNumber) or + (CodeLexem > Parser.SymbolLexems.Count) and + (CodeLexem <= Parser.SymbolLexems.Count + Parser.KeywordLexems.Count) + // SQL reserved words is allowed + then begin + St2 := St; + if CodeLexem = lcNumber then begin + CodeLexem := Parser.GetNext(St); + if (CodeLexem = lcIdent) or (CodeLexem > Parser.SymbolLexems.Count) + and (CodeLexem <= Parser.SymbolLexems.Count + Parser.KeywordLexems.Count) + then + St2 := St2 + St + else + NeedNext := False + end; + Macro := FindMacro(St2); + if Macro <> nil then + Result := Result + GetMacroValue(Macro); + end + else + Result := Result + MacroSt + St; + end + else + Result := Result + St; + end; + finally + Parser.Free; + end; + + SQL:= Result; +end; + +procedure TMacros.AssignTo(Dest: TPersistent); +begin + if Dest is TMacros then + TMacros(Dest).Assign(Self) + else + inherited AssignTo(Dest); +end; + +procedure TMacros.AssignValues(Value: TMacros); +var + i: integer; + Macro: TMacro; +begin + for i := 0 to Value.Count - 1 do begin + Macro := FindMacro(Value[i].Name); + if Macro <> nil then + Macro.Assign(Value[i]); + end; +end; + +procedure TMacros.DefineProperties(Filer: TFiler); +begin + Filer.DefineBinaryProperty('Data', ReadBinaryData, nil, False); +end; + +function TMacros.IsEqual(Value: TMacros): boolean; +var + i: integer; +begin + Result := True; + if Self = Value then + Exit; + if Count = Value.Count then begin + for i := 0 to Count - 1 do + if (Items[i].Name <> Value[i].Name) or + (Items[i].Value <> Value[i].Value) or + (Items[i].Active <> Value[i].Active) + then + Result := False; + end + else + Result := False; +end; + +{ Structure of Data + Version 1 (100) -- !!! Add in 100 + ItemCount 1 + NameLength 1 + Name Length(Name) + ValueLength 2 + Value Length(Value) + Active 1 -- !!! Add in 100 +} + +procedure TMacros.ReadBinaryData(Stream: TStream); +const + BufLen = 1000; +var + i, Len: word; + Version: byte; + B: boolean; + Buf: TBytes; + St: string; +begin + SetLength(Buf, BufLen + 1{??? - array [0..BufLen] of byte}); + + with Stream do begin + ReadBuffer(Version, 1); // Version or Count + + if Version = 100 then begin + Len := 0; + ReadBuffer(Len, 1); + end; + + for i := 0 to Count - 1 do begin + Len := 0; + ReadBuffer(Len, 1); + if Len > BufLen then + Len := BufLen; + ReadBuffer(Buf{$IFNDEF CLR}[0]{$ENDIF}, Len); + Buf[Len] := 0; + St := Encoding.Default.GetString(Buf, 0, Len); + with MacroByName(St) do begin + ReadBuffer(Len, 2); + if Len > BufLen then + Len := BufLen; + ReadBuffer(Buf{$IFNDEF CLR}[0]{$ENDIF}, Len); + Buf[Len] := 0; + St := Encoding.Default.GetString(Buf, 0, Len); + Value := St; + + if Version = 100 then begin + ReadBuffer(B, 1); // Active + Active := B; + end; + end; + end; + end; +end; + +function TMacros.GetOwner: TPersistent; +begin + Result := FOwner; +end; + +procedure TMacros.Update(Item: TCollectionItem); +begin + inherited; + + if FOwner <> nil then + if FOwner is TCustomDADataSet then + TCustomDADataSet(FOwner).AssembleSQL + else + TCustomDASQL(FOwner).AssembleSQL +end; + +function TMacros.GetItem(Index: integer): TMacro; +begin + Result := TMacro(inherited Items[Index]); +end; + +procedure TMacros.SetItem(Index: integer; Value: TMacro); +begin + inherited SetItem(Index, TCollectionItem(Value)); +end; + +function TMacros.GetUpdateCount: integer; +begin + Result := inherited UpdateCount; +end; + +function TMacros.FindMacro(const Value: string): TMacro; +var + i: integer; +begin + for i := 0 to Count - 1 do begin + Result := TMacro(inherited Items[i]); + if AnsiCompareText(Result.Name, Value) = 0 then + Exit; + end; + Result := nil; +end; + +function TMacros.MacroByName(const Value: string): TMacro; +begin + Result := FindMacro(Value); + + if Result = nil then + DatabaseErrorFmt(SMacroNotFound, [Value], FOwner as TComponent); +end; + +procedure TMacros.SetParserClass(Value: TParserClass); +begin + FParserClass := Value; +end; + +{ TCustomConnectDialog } + +constructor TCustomConnectDialog.Create(Owner: TComponent); +begin + inherited; + + FRetries := 3; + LabelSet := lsEnglish; + FStoreLogInfo := True; +end; + +procedure TCustomConnectDialog.Notification(AComponent: TComponent; + Operation: TOperation); +begin + inherited; + + if (Operation = opRemove) and (FConnection = AComponent) then + FConnection := nil; +end; + +function TCustomConnectDialog.DefDialogClass: TClass; +begin + Result := nil; +end; + +procedure TCustomConnectDialog.GetServerList(List: TStrings); +begin +end; + +function TCustomConnectDialog.GetKeyPath: string; +begin + Result := ''; +end; + +function TCustomConnectDialog.GetServerStoreName: string; +begin + Result := 'Server'; +end; + +{$IFDEF MSWINDOWS} +procedure TCustomConnectDialog.SaveInfoToRegistry(Registry: TRegistry); +begin + Registry.WriteString('Username', Connection.Username); + Registry.WriteString(GetServerStoreName, Connection.Server); +end; + +procedure TCustomConnectDialog.LoadInfoFromRegistry(Registry: TRegistry); +var + ServerKey: string; +begin + ServerKey := GetServerStoreName; + if Registry.ValueExists('Username') then + Connection.FUsername := Registry.ReadString('Username'); + if Registry.ValueExists(ServerKey) then + Connection.FServer := Registry.ReadString(ServerKey); +end; +{$ENDIF} + +{class function TCustomConnectDialog.AcceptBlankPassword: boolean; +begin + Result := False; +end;} + +function TCustomConnectDialog.Execute: boolean; +var + Key: string; + OldUsername, OldPassword, OldServer: string; +{$IFDEF MSWINDOWS} + KeyOpened, IDE: boolean; + Registry: TRegistry; + + procedure SaveServerListToRegistry; + var + List: TStrings; + i,j: integer; + begin + List := TStringList.Create; + try + GetServerList(List); + Registry.WriteString(Format('%s %d', [ServerLabel, 1]), Connection.Server); + i := 2; + for j := 0 to List.Count - 1 do + if AnsiCompareText(List[j], Connection.Server) <> 0 then begin + Registry.WriteString(Format('%s %d', [ServerLabel, i]), List[j]); + Inc(i); + end; + finally + List.Free; + end; + end; + +{$ENDIF} +begin + Result := False; + + if Connection = nil then + DatabaseError(SConnectionNotDefined); + + OldUsername := Connection.Username; + OldPassword := Connection.Password; + OldServer := Connection.Server; + + Key := GetKeyPath + 'Connect\' + ApplicationTitle; + +{$IFDEF MSWINDOWS} + Registry := nil; +{$ENDIF} + try + if FStoreLogInfo then begin + {$IFDEF MSWINDOWS} + Registry := TRegistry.Create; + + KeyOpened := Registry.OpenKey(Key, False); + IDE := (Pos('Delphi', ApplicationTitle) = 1) or + (Pos('C++Builder', ApplicationTitle) = 1); + + if KeyOpened and (not IDE or (Connection.Username = '')) then + LoadInfoFromRegistry(Registry); + + if not SavePassword and not IDE or + (AnsiCompareText(Connection.Username, OldUsername) <> 0) + then + Connection.FPassword := ''; + + if KeyOpened then + Registry.CloseKey; + {$ENDIF} + end; + + if Assigned(ShowConnectFormProc) then + Result := ShowConnectFormProc(Self) + else + Result := False; + + if Result then begin + if FStoreLogInfo then begin + {$IFDEF MSWINDOWS} + // StoreLogInfo can be changed by user since previous check + if Registry = nil then + Registry := TRegistry.Create; + + if Registry.OpenKey(Key, True) then begin + SaveInfoToRegistry(Registry); + Registry.CloseKey; + end; + + if Registry.OpenKey(GetKeyPath + 'Connect', False) then begin + SaveServerListToRegistry; + Registry.CloseKey; + end; + {$ENDIF} + end; + end; + finally + if not Result then begin + Connection.FUsername := OldUsername; + Connection.FPassword := OldPassword; + Connection.FServer := OldServer; + end; + {$IFDEF MSWINDOWS} + Registry.Free; + {$ENDIF} + end; +end; + +{$IFDEF WIN32} +function TCustomConnectDialog.GetString(Id: integer): string; +const + BufLen = 50; +var + Buf: array [0..BufLen] of char; + Base: integer; +begin + case FLabelSet of + lsEnglish: + Base := 100; + lsFrench: + Base := 200; + lsGerman: + Base := 300; + lsItalian: + Base := 400; + lsPolish: + Base := 500; + lsPortuguese: + Base := 600; + lsRussian: + Base := 0; + lsSpanish: + Base := 700; + else + Base := 100; + end; + + Buf[0] := #0; + LoadString(hInstance, Id + Base, @Buf, BufLen); + Result := Buf; +end; +{$ENDIF} + +procedure TCustomConnectDialog.SetLabelSet(Value: TLabelSet); +{$IFDEF WIN32} +begin + FLabelSet := Value; + if FLabelSet <> lsCustom then begin + + FCaption := GetString(0); + FUsernameLabel := GetString(1); + FPasswordLabel := GetString(2); + FServerLabel := GetString(3); + FConnectButton := GetString(4); + FCancelButton := GetString(5); + end; +{$ELSE} +begin + FCaption := 'Connect'; + FUsernameLabel := 'Username'; + FPasswordLabel := 'Password'; + FServerLabel := 'Server'; + FConnectButton := 'Connect'; + FCancelButton := 'Cancel'; +{$ENDIF} +end; + +procedure TCustomConnectDialog.SetCaption(Value: string); +begin + if not(csLoading in ComponentState) then + FLabelSet := lsCustom; + + FCaption := Value; +end; + +procedure TCustomConnectDialog.SetUsernameLabel(Value: string); +begin + if not(csLoading in ComponentState) then + FLabelSet := lsCustom; + + FUsernameLabel := Value; +end; + +procedure TCustomConnectDialog.SetPasswordLabel(Value: string); +begin + if not(csLoading in ComponentState) then + FLabelSet := lsCustom; + + FPasswordLabel := Value; +end; + +procedure TCustomConnectDialog.SetServerLabel(Value: string); +begin + if not(csLoading in ComponentState) then + FLabelSet := lsCustom; + + FServerLabel := Value; +end; + +procedure TCustomConnectDialog.SetConnectButton(Value: string); +begin + if not(csLoading in ComponentState) then + FLabelSet := lsCustom; + + FConnectButton := Value; +end; + +procedure TCustomConnectDialog.SetCancelButton(Value: string); +begin + if not(csLoading in ComponentState) then + FLabelSet := lsCustom; + + FCancelButton := Value; +end; + +{$IFDEF MSWINDOWS} +const + advapi32 = 'advapi32.dll'; + netapi32 = 'netapi32.dll'; + + // Service State -- for CurrentState + SERVICE_STOPPED = $00000001; + SERVICE_START_PENDING = $00000002; + SERVICE_STOP_PENDING = $00000003; + SERVICE_RUNNING = $00000004; + SERVICE_CONTINUE_PENDING = $00000005; + SERVICE_PAUSE_PENDING = $00000006; + SERVICE_PAUSED = $00000007; + + // Service object specific access type + SERVICE_QUERY_CONFIG = $0001; + SERVICE_CHANGE_CONFIG = $0002; + SERVICE_QUERY_STATUS = $0004; + SERVICE_ENUMERATE_DEPENDENTS = $0008; + SERVICE_START = $0010; + SERVICE_STOP = $0020; + SERVICE_PAUSE_CONTINUE = $0040; + SERVICE_INTERROGATE = $0080; + SERVICE_USER_DEFINED_CONTROL = $0100; + SERVICE_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED or + SERVICE_QUERY_CONFIG or + SERVICE_CHANGE_CONFIG or + SERVICE_QUERY_STATUS or + SERVICE_ENUMERATE_DEPENDENTS or + SERVICE_START or + SERVICE_STOP or + SERVICE_PAUSE_CONTINUE or + SERVICE_INTERROGATE or + SERVICE_USER_DEFINED_CONTROL); + + // Service Control Manager object specific access types + SC_MANAGER_CONNECT = $0001; + SC_MANAGER_CREATE_SERVICE = $0002; + SC_MANAGER_ENUMERATE_SERVICE = $0004; + SC_MANAGER_LOCK = $0008; + SC_MANAGER_QUERY_LOCK_STATUS = $0010; + SC_MANAGER_MODIFY_BOOT_CONFIG = $0020; + SC_MANAGER_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED or SC_MANAGER_CONNECT or + SC_MANAGER_CREATE_SERVICE or SC_MANAGER_ENUMERATE_SERVICE or SC_MANAGER_LOCK or + SC_MANAGER_QUERY_LOCK_STATUS or SC_MANAGER_MODIFY_BOOT_CONFIG); + + // Service Types + SERVICE_WIN32_OWN_PROCESS = $00000010; + SERVICE_WIN32_SHARE_PROCESS = $00000020; + SERVICE_WIN32 = (SERVICE_WIN32_OWN_PROCESS or + SERVICE_WIN32_SHARE_PROCESS); + + // Service State -- for Enum Requests (Bit Mask) + SERVICE_ACTIVE = $00000001; + SERVICE_INACTIVE = $00000002; + SERVICE_STATE_ALL = (SERVICE_ACTIVE or + SERVICE_INACTIVE); + + // Controls + SERVICE_CONTROL_STOP = $00000001; + +type + // Service Status Enumeration Structure +{$IFDEF CLR} + [StructLayout(LayoutKind.Sequential)] +{$ENDIF} + _SERVICE_STATUS = record + dwServiceType: DWORD; + dwCurrentState: DWORD; + dwControlsAccepted: DWORD; + dwWin32ExitCode: DWORD; + dwServiceSpecificExitCode: DWORD; + dwCheckPoint: DWORD; + dwWaitHint: DWORD; + end; + TServiceStatus = _SERVICE_STATUS; + +{$IFDEF CLR} + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] + _ENUM_SERVICE_STATUS = record + [MarshalAs(UnmanagedType.LPTStr)] + lpServiceName: string; + [MarshalAs(UnmanagedType.LPTStr)] + lpDisplayName: string; + ServiceStatus: TServiceStatus; + end; + TEnumServiceStatus = _ENUM_SERVICE_STATUS; +{$ELSE} + _ENUM_SERVICE_STATUSA = record + lpServiceName: PAnsiChar; + lpDisplayName: PAnsiChar; + ServiceStatus: TServiceStatus; + end; + TEnumServiceStatus = _ENUM_SERVICE_STATUSA; +{$ENDIF} + + TOpenSCManager = function (lpMachineName: {$IFDEF CLR}string{$ELSE}PChar{$ENDIF}; lpDatabaseName: {$IFDEF CLR}IntPtr{$ELSE}PChar{$ENDIF}; dwDesiredAccess: DWORD): SC_HANDLE;{$IFNDEF CLR} stdcall;{$ENDIF} + TCloseServiceHandle = function (hSCObject: SC_HANDLE): BOOL;{$IFNDEF CLR} stdcall;{$ENDIF} + TOpenService = function (hSCManager: SC_HANDLE; lpServiceName: PChar; dwDesiredAccess: DWORD): SC_HANDLE;{$IFNDEF CLR} stdcall;{$ENDIF} + TEnumServicesStatus = function (hSCManager: SC_HANDLE; dwServiceType, dwServiceState: DWORD;{$IFDEF CLR}lpServices: IntPtr{$ELSE}var lpServices: TEnumServiceStatus{$ENDIF}; + cbBufSize: DWORD; {$IFDEF CLR}out{$ELSE}var{$ENDIF} pcbBytesNeeded, lpServicesReturned: DWORD; var lpResumeHandle: DWORD): BOOL;{$IFNDEF CLR} stdcall;{$ENDIF} + TQueryServiceStatus = function (hService: SC_HANDLE; {$IFDEF CLR}out{$ELSE}var{$ENDIF} lpServiceStatus: TServiceStatus): BOOL;{$IFNDEF CLR} stdcall;{$ENDIF} + TStartService = function (hService: SC_HANDLE; dwNumServiceArgs: DWORD; {$IFNDEF CLR}var{$ENDIF} lpServiceArgVectors: {$IFDEF CLR}IntPtr{$ELSE}PChar{$ENDIF}): BOOL;{$IFNDEF CLR} stdcall;{$ENDIF} + TControlService = function (hService: SC_HANDLE; dwControl: DWORD; {$IFDEF CLR}out{$ELSE}var{$ENDIF} lpServiceStatus: TServiceStatus): BOOL;{$IFNDEF CLR} stdcall;{$ENDIF} + TNetServerEnum = function (ServerName: IntPtr; Level: longint; var BufPtr: IntPtr; PrefMaxLen: longint; + var EntriesRead, TotalEntries: longint; ServType: longint; Domain: {$IFDEF CLR}IntPtr{$ELSE}PWideChar{$ENDIF}; var ResumeHandle: integer): longint;{$IFNDEF CLR} stdcall;{$ENDIF} + TNetApiBufferFree = function (BufPtr: IntPtr): longint;{$IFNDEF CLR} stdcall;{$ENDIF} + +{$IFDEF CLR} +[SuppressUnmanagedCodeSecurity, DllImport(advapi32, CharSet = CharSet.Auto, SetLastError = True, EntryPoint = 'OpenSCManager')] +function FnOpenSCManager(lpMachineName: string; lpDatabaseName: IntPtr; dwDesiredAccess: DWORD): SC_HANDLE; external; + +[SuppressUnmanagedCodeSecurity, DllImport(advapi32, CharSet = CharSet.Ansi, SetLastError = True, EntryPoint = 'CloseServiceHandle')] +function FnCloseServiceHandle(hSCObject: SC_HANDLE): BOOL; external; + +[SuppressUnmanagedCodeSecurity, DllImport(advapi32, CharSet = CharSet.Auto, SetLastError = True, EntryPoint = 'OpenService')] +function FnOpenService(hSCManager: SC_HANDLE; lpServiceName: string; dwDesiredAccess: DWORD): SC_HANDLE; external; + +[SuppressUnmanagedCodeSecurity, DllImport(advapi32, CharSet = CharSet.Auto, SetLastError = True, EntryPoint = 'EnumServicesStatus')] +function FnEnumServicesStatus(hSCManager: SC_HANDLE; dwServiceType, + dwServiceState: DWORD; lpServices: IntPtr; cbBufSize: DWORD; + out pcbBytesNeeded, lpServicesReturned: DWORD; var lpResumeHandle: DWORD): BOOL; external; + +[SuppressUnmanagedCodeSecurity, DllImport(advapi32, CharSet = CharSet.Ansi, SetLastError = True, EntryPoint = 'QueryServiceStatus')] +function FnQueryServiceStatus(hService: SC_HANDLE; out lpServiceStatus: TServiceStatus): BOOL; external; + +[SuppressUnmanagedCodeSecurity, DllImport(advapi32, CharSet = CharSet.Auto, SetLastError = True, EntryPoint = 'StartService')] +function FnStartService(hService: SC_HANDLE; dwNumServiceArgs: DWORD; lpServiceArgVectors: IntPtr): BOOL; external; + +[SuppressUnmanagedCodeSecurity, DllImport(advapi32, CharSet = CharSet.Ansi, SetLastError = True, EntryPoint = 'StartServiceA')] +function StartServiceA(hService: SC_HANDLE; dwNumServiceArgs: DWORD; lpServiceArgVectors: IntPtr): BOOL; external; + +[SuppressUnmanagedCodeSecurity, DllImport(advapi32, CharSet = CharSet.Ansi, SetLastError = True, EntryPoint = 'ControlService')] +function FnControlService(hService: SC_HANDLE; dwControl: DWORD; out lpServiceStatus: TServiceStatus): BOOL; external; + +[SuppressUnmanagedCodeSecurity, DllImport(netapi32, CharSet = CharSet.Auto, SetLastError = True, EntryPoint = 'NetServerEnum')] +function FnNetServerEnum(ServerName: IntPtr; Level: longint; var BufPtr: IntPtr; PrefMaxLen: longint; + var EntriesRead, TotalEntries: longint; ServType: longint; Domain: IntPtr; var ResumeHandle: integer): longint; external; + +[SuppressUnmanagedCodeSecurity, DllImport(netapi32, CharSet = CharSet.Auto, SetLastError = True, EntryPoint = 'NetApiBufferFree')] +function FnNetApiBufferFree(BufPtr: IntPtr): longint; external; +{$ENDIF} + +var + hAdvapi32Lib: HMODULE; + hNetapi32Lib: HMODULE; + OpenSCManager: TOpenSCManager; + CloseServiceHandle: TCloseServiceHandle; + OpenService: TOpenService; + EnumServicesStatus: TEnumServicesStatus; + QueryServiceStatus: TQueryServiceStatus; + StartService: TStartService; + ControlService: TControlService; + NetServerEnum: TNetServerEnum; + NetApiBufferFree: TNetApiBufferFree; + +function NotLink: integer; +begin + raise Exception.Create('function is not linked'); + Result := 0; +end; + +procedure LoadNetManagerLib; +{$IFNDEF CLR} + function GetProc(hLib: HMODULE; Name: string): FARPROC; + begin + Result := GetProcAddress(hLib, PChar(Name)); + if Result = nil then + Result := @NotLink; + end; +{$ENDIF} +begin + hAdvapi32Lib := LoadLibrary(PChar(advapi32)); + + if hAdvapi32Lib > 0 then begin + {$IFDEF CLR} + OpenSCManager := FnOpenSCManager; + CloseServiceHandle := FnCloseServiceHandle; + OpenService := FnOpenService; + EnumServicesStatus := FnEnumServicesStatus; + QueryServiceStatus := FnQueryServiceStatus; + StartService := FnStartService; + ControlService := FnControlService; + {$ELSE} + OpenSCManager := GetProc(hAdvapi32Lib, 'OpenSCManagerA'); + CloseServiceHandle := GetProc(hAdvapi32Lib, 'CloseServiceHandle'); + OpenService := GetProc(hAdvapi32Lib, 'OpenServiceA'); + EnumServicesStatus := GetProc(hAdvapi32Lib, 'EnumServicesStatusA'); + QueryServiceStatus := GetProc(hAdvapi32Lib, 'QueryServiceStatus'); + StartService := GetProc(hAdvapi32Lib, 'StartServiceA'); + ControlService := GetProc(hAdvapi32Lib, 'ControlService'); + {$ENDIF} + end; + + hNetapi32Lib := LoadLibrary(PChar(netapi32)); + + if hNetapi32Lib > 0 then begin + {$IFDEF CLR} + if GetProcAddress(hNetapi32Lib, 'NetServerEnum') <> nil then + NetServerEnum := FnNetServerEnum; + if GetProcAddress(hNetapi32Lib, 'NetApiBufferFree') <> nil then + NetApiBufferFree := FnNetApiBufferFree; + {$ELSE} + NetServerEnum := GetProc(hNetapi32Lib, 'NetServerEnum'); + NetApiBufferFree := GetProc(hNetapi32Lib, 'NetApiBufferFree'); + {$ENDIF} + end; +end; + +procedure FreeNetManagerLib; +begin + if hAdvapi32Lib > 0 then begin + FreeLibrary(hAdvapi32Lib); + hAdvapi32Lib := 0; + end; + + if hNetapi32Lib > 0 then begin + FreeLibrary(hNetapi32Lib); + hNetapi32Lib := 0; + end; +end; + +{ TCRServiceNamesThread } + +constructor TCRServiceNamesThread.Create(const Server: string; Services: TCRServicesThread; const Keywords: string); +begin + inherited Create(True); + FServer := Server; + FKeywords := Keywords; + FServices := Services; + Priority := tpHighest; + Resume; +end; + +procedure TCRServiceNamesThread.Execute; +{var + tc: cardinal;} +var + j, k: integer; + sl: TStringList; + b: boolean; +begin + // tc := GetTickCount; + try + FServiceNames := TCRNetManager.GetServiceNames(FServer); + + sl := TStringList.Create; + try + sl.Text := FKeywords; + + b := False; + for j := 0 to Length(FServiceNames) - 1 do begin + for k := 0 to sl.Count - 1 do + if (Pos(sl[k], LowerCase(FServiceNames[j].ServiceName)) > 0) or + (Pos(sl[k], LowerCase(FServiceNames[j].DisplayName)) > 0) then begin + b := True; + CRNetManager.AddToCachedServerList(FKeywords, FServer); + Break; + end; + if b then + Break; + end; + finally + sl.Free; + end; + except + // Silent + end; + {tc := GetTickCount - tc; + OFS(FServer + ' ' + IntToStr(tc) + ' ' + IntToStr(Length(FServices.FServiceNames[FIndex])));} +end; + +constructor TCRServicesThread.Create(List: TStrings; const Keywords: string); +begin + inherited Create(True); + + FList := List; + FKeywords := Keywords; + FreeOnTerminate := True; + + Resume; +end; + +procedure TCRServicesThread.Execute; +var + i: integer; + Threads: array of TCRServiceNamesThread; +begin + SetLength(Threads, FList.Count); + for i := 0 to FList.Count - 1 do + Threads[i] := nil; + try + for i := 0 to FList.Count - 1 do + Threads[i] := TCRServiceNamesThread.Create(FList[i], Self, FKeywords); + + for i := 0 to FList.Count - 1 do + Threads[i].WaitFor; + + finally + for i := 0 to FList.Count - 1 do + Threads[i].Free; + end; +end; + +{ TCRNetManager } + +function ServiceStatusToCurrentStatus(const CurrentState: DWORD): TCRServiceStatus; +begin + case CurrentState of + SERVICE_STOPPED: + Result := ssStopped; + SERVICE_START_PENDING: + Result := ssStartPending; + SERVICE_STOP_PENDING: + Result := ssStopPending; + SERVICE_RUNNING: + Result := ssRunning; + SERVICE_CONTINUE_PENDING: + Result := ssContinuePending; + SERVICE_PAUSE_PENDING: + Result := ssPausePending; + SERVICE_PAUSED: + Result := ssPaused; + else + begin + DatabaseErrorFmt('Unknown service status $%X (%d)', [CurrentState, CurrentState]); + Result := ssStopped; + end; + end; +end; + +constructor TCRNetManager.Create; +begin + inherited; + + FServicesCS := TCriticalSection.Create; +end; + +destructor TCRNetManager.Destroy; +begin + ClearCachedServerList; + FServicesCS.Free; + + inherited; +end; + +class procedure TCRNetManager.ServiceManagerOpen(const Server: string; const ReadOnly: boolean; out sch: SC_HANDLE); +var + s: string; + dwDesiredAccess: DWORD; +begin + sch := 0; + if Trim(LowerCase(Server)) = 'localhost' then + s := '' + else + s := Server; + if ReadOnly then + dwDesiredAccess := GENERIC_READ + else + dwDesiredAccess := SC_MANAGER_ALL_ACCESS; + sch := OpenSCManager({$IFDEF CLR}s{$ELSE}PChar(s){$ENDIF}, nil, dwDesiredAccess); + Win32Check(sch <> 0); +end; + +class procedure TCRNetManager.ServiceManagerClose(const sch: SC_HANDLE); +begin + if sch <> 0 then + CloseServiceHandle(sch); +end; + +class procedure TCRNetManager.ServiceOpen(const Server: string; const ServiceName: string; const ReadOnly: boolean; out sch: SC_HANDLE; out sh: SC_HANDLE); +begin + ServiceManagerOpen(Server, ReadOnly, sch); + try + sh := OpenService(sch, {$IFDEF CLR}ServiceName{$ELSE}PChar(ServiceName){$ENDIF}, SERVICE_ALL_ACCESS); + Win32Check(sh <> 0); + except + ServiceManagerClose(sch); + raise; + end; +end; + +class procedure TCRNetManager.ServiceClose(const sch: SC_HANDLE; const sh: SC_HANDLE); +begin + if sh <> 0 then + CloseServiceHandle(sh); + ServiceManagerClose(sch); +end; + +class function TCRNetManager.GetServiceNames(const Server: string): TCRServicesInfo; +var + sch: SC_HANDLE; +{$IFDEF CLR} + pService: TEnumServiceStatus; +{$ELSE} + pService: ^TEnumServiceStatus; +{$ENDIF} + pServices: IntPtr; + pcbBytesNeeded, lpServicesReturned, lpResumeHandle: DWORD; + i: integer; + SizeOfTEnumServiceStatus: LongWord; + +begin + SetLength(Result, 0); + + pServices := nil; + ServiceManagerOpen(Server, True, sch); + try + //lpServices := nil; + lpResumeHandle := 0; + pcbBytesNeeded := 0; + lpServicesReturned := 0; + EnumServicesStatus(sch, SERVICE_WIN32, SERVICE_STATE_ALL, {$IFDEF CLR}nil{$ELSE}TEnumServiceStatus(pServices^){$ENDIF}, 0, pcbBytesNeeded, lpServicesReturned, lpResumeHandle); + SizeOfTEnumServiceStatus := SizeOf(TEnumServiceStatus); + lpServicesReturned := 0; + pServices := Marshal.AllocHGlobal(pcbBytesNeeded); + Win32Check(EnumServicesStatus(sch, SERVICE_WIN32, SERVICE_STATE_ALL, {$IFDEF CLR}pServices{$ELSE}TEnumServiceStatus(pServices^){$ENDIF}, pcbBytesNeeded, pcbBytesNeeded, lpServicesReturned, lpResumeHandle)); +// Win32Check(EnumServicesStatus(sch, SERVICE_WIN32, SERVICE_STATE_ALL, Services{$IFNDEF CLR}[0]{$ENDIF}, cbBufSize, pcbBytesNeeded, lpServicesReturned, lpResumeHandle)); + SetLength(Result, lpServicesReturned); + + for i := 0 to lpServicesReturned - 1 do begin + {$IFDEF CLR} + pService := TEnumServiceStatus(Marshal.PtrToStructure(IntPtr(Integer(pServices) + Integer(SizeOfTEnumServiceStatus) * i), TypeOf(TEnumServiceStatus))); + {$ELSE} + pService := IntPtr(Integer(pServices) + Integer(SizeOfTEnumServiceStatus) * i); + {$ENDIF} + + Result[i].ServiceName := pService.lpServiceName; + Result[i].DisplayName := pService.lpDisplayName; + Result[i].Status := ServiceStatusToCurrentStatus(pService.ServiceStatus.dwCurrentState); + end; + finally + ServiceManagerClose(sch); + Marshal.FreeHGlobal(pServices); + end; +end; + +class function TCRNetManager.GetServiceStatus(const Server: string; const ServiceName: string): TCRServiceStatus; +var + sch: SC_HANDLE; + sh: SC_HANDLE; + ss: TServiceStatus; +begin + ServiceOpen(Server, ServiceName, True, sch, sh); + try + Win32Check(QueryServiceStatus(sh, ss)); + Result := ServiceStatusToCurrentStatus(ss.dwCurrentState); + finally + ServiceClose(sch, sh); + end; +end; + +class procedure TCRNetManager.ServiceStart(const Server: string; const ServiceName: string; ParamStr: string = ''); + // based on Delphi7 system.pas GetParamStr function + function GetParamStr(Idx: integer; var Param: string): integer; + var + Len: Integer; + StartIdx, SIdx, QIdx: Integer; + begin + while True do + begin + while (ParamStr[Idx] <> #0) and (ParamStr[Idx] <= ' ') do + Inc(Idx); + if (ParamStr[Idx] = '"') and (ParamStr[Idx + 1] = '"') then Inc(Idx, 2) else Break; + end; + Len := 0; + StartIdx := Idx; + while ParamStr[Idx] > ' ' do + begin + if ParamStr[Idx] = '"' then + begin + Inc(Idx); + while (ParamStr[Idx] <> #0) and (ParamStr[Idx] <> '"') do + begin + QIdx := Idx + 1; + Inc(Len, QIdx - Idx); + Idx := QIdx; + end; + if ParamStr[Idx] <> #0 then + Inc(Idx); + end + else + begin + QIdx := Idx + 1; + Inc(Len, QIdx - Idx); + Idx := QIdx; + end; + end; + + SetLength(Param, Len); + + Idx := StartIdx; + SIdx := 1; + while ParamStr[Idx] > ' ' do + begin + if ParamStr[Idx] = '"' then + begin + Inc(Idx); + while (ParamStr[Idx] <> #0) and (ParamStr[Idx] <> '"') do + begin + QIdx := Idx + 1; + while Idx < QIdx do + begin + Param[SIdx] := ParamStr[Idx]; + Inc(Idx); + Inc(SIdx); + end; + end; + if ParamStr[Idx] <> #0 then + Inc(Idx); + end + else + begin + QIdx := Idx + 1; + while Idx < QIdx do + begin + Param[SIdx] := ParamStr[Idx]; + Inc(Idx); + Inc(SIdx); + end; + end; + end; + + Result := Idx; + end; +var + sch: SC_HANDLE; + sh: SC_HANDLE; + i, Idx: integer; + Param: string; + Args: array of string; + pArgs: array of {$IFDEF CLR}IntPtr{$ELSE}PChar{$ENDIF}; + p: {$IFDEF CLR}IntPtr{$ELSE}PChar{$ENDIF}; +{$IFDEF CLR} + b: TBytes; + p1: IntPtr; + Len: integer; +{$ENDIF} + +begin + ServiceOpen(Server, ServiceName, False, sch, sh); + try + ParamStr := Trim(ParamStr); + if ParamStr <> '' then begin + Idx := 1; + SetLength(Args, 0); + + ParamStr := ParamStr + #0; + while True do + begin + Idx := GetParamStr(Idx, Param); + if Param = '' then Break; + + i := Length(Args); + SetLength(Args, i + 1); + Args[i] := Param; + end; + + SetLength(pArgs, Length(Args)); + {$IFDEF CLR} + for i := 0 to Length(Args) - 1 do + pArgs[i] := nil; + p := Marshal.AllocHGlobal(Length(Args) * SizeOf(IntPtr)); + try + for i := 0 to Length(Args) - 1 do begin + Len := Length(Args[i]); + SetLength(b, Len + 1); + Encoding.Default.GetBytes(Args[i], 0, Len, b, 0); + b[Len] := 0; + p1 := Marshal.AllocHGlobal(Len + 1); + Marshal.Copy(b, 0, p1, Len + 1); + pArgs[i] := p1; + Marshal.WriteIntPtr(p, i * SizeOf(IntPtr), p1); + end; + + i := Length(Args); + Win32Check(StartServiceA(sh, i, p)); + finally + for i := 0 to Length(Args) - 1 do + Marshal.FreeHGlobal(pArgs[i]); + Marshal.FreeHGlobal(p); + end; + {$ELSE} + for i := 0 to Length(Args) - 1 do + pArgs[i] := @Args[i][1]; + + i := Length(Args); + Win32Check(StartService(sh, i, pArgs[0])); + {$ENDIF} + end + else + begin + p := nil; + Win32Check(StartService(sh, 0, p)); + end; + finally + ServiceClose(sch, sh); + end; +end; + +class procedure TCRNetManager.ServiceStop(const Server: string; const ServiceName: string); +var + sch: SC_HANDLE; + sh: SC_HANDLE; + ss: TServiceStatus; +begin + ServiceOpen(Server, ServiceName, False, sch, sh); + try + Win32Check(ControlService(sh, SERVICE_CONTROL_STOP, ss)); + finally + ServiceClose(sch, sh); + end; +end; + +procedure TCRNetManager.ClearCachedServerList; +var + i: integer; +begin + if FCachedServerList = nil then + Exit; + + try + for i := 0 to FCachedServerList.Count - 1 do + FCachedServerList.Objects[i].Free; + finally + FreeAndNil(FCachedServerList); + end; +end; + +procedure TCRNetManager.AddToCachedServerList(const Keywords: string; const Server: string); +var +// s: string; + i: integer; + sl: TStringList; +begin +{ s := ''; + for i := Low(Keywords) to High(Keywords) do begin + if s <> '' then + s := s + #$D#$A; + s := s + Keywords[i]; + end;} + + FServicesCS.Acquire; + try + if FCachedServerList = nil then begin + FCachedServerList := TStringList.Create; + {$IFDEF VER6P} + FCachedServerList.CaseSensitive := False; + {$ENDIF} + FCachedServerList.Sorted := True; + end; + i := FCachedServerList.IndexOf(Keywords); + if i = - 1 then begin + sl := TStringList.Create; + {$IFDEF VER6P} + sl.CaseSensitive := False; + {$ENDIF} + sl.Sorted := True; + FCachedServerList.AddObject(Keywords, sl); + end + else + sl := FCachedServerList.Objects[i] as TStringList; + if sl.IndexOf(Server) = -1 then + sl.Add(Server); + finally + FServicesCS.Release; + end; +end; + +class procedure TCRNetManager.GetServerList(List: TStrings); +var + pData, psvr_Name: IntPtr; + EntRead, EntTotal, Resume, i : integer; + s: string; + Info : integer; +begin + List.Clear; + pData := nil; + try + Resume := 0; + Info := NetServerEnum(nil, 100, pData, -1{MAX_PREFERRED_LENGTH}, EntRead, EntTotal, 1{SV_TYPE_WORKSTATION - All LAN Manager workstations}, nil, Resume); + if Info <> 0 then + raise Exception.Create('NetServerEnum error ' + IntToStr(Info)); + + Assert(pData <> nil); + for i := 0 to EntRead - 1 do begin + psvr_Name := Marshal.ReadIntPtr(pData, i * 8 {sizeof(SERVER_INFO_100 )} + 4); + s := Marshal.PtrToStringUni(psvr_Name); + List.Add(s); + end; + finally + if pData <> nil then + NetApiBufferFree(pData); + end; +end; + +procedure TCRNetManager.GetServerList(List: TStrings; const Keywords: string; const Timeout: Longword = 1; const CacheTimeout: Longword = 120); +var + mList, sl: TStringList; + i: integer; + tc: LongWord; + Threads: TCRServicesThread; +{$IFDEF CLR} + ReturnValue: LongWord; +{$ENDIF} +begin + List.Clear; + if Timeout = 0 then + Exit; + + StartWait; + mList := nil; + try + mList := TStringList.Create; + {$IFDEF VER6P} + mList.CaseSensitive := False; + {$ENDIF} + mList.Sorted := True; + + tc := LongWord(Int64(FLastTickCount) + CacheTimeout * 1000); + if (tc < GetTickCount) or (GetTickCount < FLastTickCount) then begin + GetServerList(mList); + mList.Add('localhost'); + Threads := TCRServicesThread.Create(mList, Keywords); + {$IFDEF CLR} + Threads.WaitFor(Timeout * 1000, ReturnValue); + {$ELSE} + WaitForSingleObject(Threads.Handle, Timeout * 1000); + {$ENDIF} + FLastTickCount := GetTickCount; + end; + + if FCachedServerList <> nil then begin + mList.Clear; + FServicesCS.Acquire; + try + i := FCachedServerList.IndexOf(Keywords); + if i <> -1 then begin + sl := FCachedServerList.Objects[i] as TStringList; + for i := 0 to sl.Count - 1 do begin + if mList.IndexOf(sl[i]) = -1 then + mList.Add(sl[i]); + end; + end; + finally + FServicesCS.Release; + end; + end; + + List.Assign(mList); + finally + StopWait; + mList.Free; + end; +end; +{$ENDIF} + +{ TDADataSetUtils } + +procedure TDADataSetUtils.QuickOpen(DataSet: TCustomDADataSet; Refresh: boolean = False); +begin + Inc(FCount); + if FCount > 1 then begin + Assert(FDataSet = DataSet); + Exit; + end; + + Assert(FDataSet = nil, 'TDADataSetUtils.QuickOpen - twice call'); + FDataSet := DataSet; + + FOldActive := DataSet.Active; + FOldDebug := DataSet.Debug; + FOldFetchAll := DataSet.FetchAll; + FOldFetchRows := DataSet.FetchRows; + + if not DataSet.Active or Refresh then begin + DataSet.Debug := False; + DataSet.FetchAll := False; + DataSet.Close; + DataSet.FetchRows := 1; + DataSet.Execute; + end; +end; + +procedure TDADataSetUtils.Restore(RestoreActive: boolean = True); +begin + Assert(FDataSet <> nil, 'TDADataSetUtils.Restore without QuickOpen'); + Dec(FCount); + if FCount > 0 then + Exit; + + FDataSet.Debug := FOldDebug; + FDataSet.FetchAll := FOldFetchAll; + if RestoreActive then begin + if FDataSet.FetchRows <> FOldFetchRows then begin + FDataSet.Active := False; + FDataSet.FetchRows := FOldFetchRows; + end; + FDataSet.Active := FOldActive; + end; + + FDataSet := nil; +end; + +procedure TDADataSetUtils.QuickOpenAndRestore(DataSet: TCustomDADataSet; Refresh: boolean = False); +begin + try + QuickOpen(DataSet, Refresh); + finally + Restore; + end; +end; + +{ TDBAccessUtils } + +class function TDBAccessUtils.IsKeyViolation(Obj: TCustomDAConnection; E: EDAError): boolean; +begin + Result := Obj.IsKeyViolation(E); +end; + +class function TDBAccessUtils.IsObjectDataType(Obj: TDAParam; DataType: TFieldType): boolean; +begin + Result := Obj.IsObjectDataType(DataType); +end; + +class procedure TDBAccessUtils.CheckConnection(Obj: TCustomDADataSet); +begin + Obj.CheckConnection; +end; + +class procedure TDBAccessUtils.CheckConnection(Obj: TCustomDASQL); +begin + Obj.CheckConnection; +end; + +class function TDBAccessUtils.UsedConnection(Obj: TCustomDADataSet): TCustomDAConnection; +begin + Result := Obj.UsedConnection; +end; + +class function TDBAccessUtils.UsedConnection(Obj: TCustomDASQL): TCustomDAConnection; +begin + Result := Obj.UsedConnection; +end; + +class procedure TDBAccessUtils.SetAutoCommit(Obj: TComponent; Value: boolean); +begin + Assert(Obj <> nil); + if Obj is TCustomDASQL then + TCustomDASQL(Obj).AutoCommit := Value + else + if IsClass(Obj, TCustomDADataSet) then + TCustomDADataSet(Obj).AutoCommit := Value + else + Assert(False, Obj.ClassName); +end; + +class function TDBAccessUtils.GetAutoCommit(Obj: TComponent): boolean; +begin + Result := False; + Assert(Obj <> nil); + if Obj is TCustomDASQL then + Result := TCustomDASQL(Obj).AutoCommit + else + if Obj is TCustomDADataSet then + Result := TCustomDADataSet(Obj).AutoCommit + else + Assert(False, Obj.ClassName); +end; + +class procedure TDBAccessUtils.SetDesignCreate(Obj: TCustomDADataSet; Value: boolean); +begin + Obj.FDesignCreate := Value; +end; + +class function TDBAccessUtils.GetDesignCreate(Obj: TCustomDADataSet): boolean; +begin + Result := Obj.FDesignCreate; +end; + +class procedure TDBAccessUtils.SetDesignCreate(Obj: TCustomDASQL; Value: boolean); +begin + Obj.FDesignCreate := Value; +end; + +class function TDBAccessUtils.GetDesignCreate(Obj: TCustomDASQL): boolean; +begin + Result := Obj.FDesignCreate; +end; + +class procedure TDBAccessUtils.SetDesignCreate(Obj: TCustomDAUpdateSQL; Value: boolean); +begin + Obj.FDesignCreate := Value; +end; + +class function TDBAccessUtils.GetDesignCreate(Obj: TCustomDAUpdateSQL): boolean; +begin + Result := Obj.FDesignCreate; +end; + +class procedure TDBAccessUtils.SetDesignCreate(Obj: TCRDataSource; Value: boolean); +begin + Obj.FDesignCreate := Value; +end; + +class function TDBAccessUtils.GetDesignCreate(Obj: TCRDataSource): boolean; +begin + Result := Obj.FDesignCreate; +end; + +class function TDBAccessUtils.CreateIRecordSet(Obj: TCustomDAConnection): TCRRecordSet; +begin + Result := Obj.CreateIRecordSet; +end; + +class function TDBAccessUtils.GetIConnection(Obj: TCustomDAConnection): TCRConnection; +begin + Result := Obj.FIConnection; +end; + +class function TDBAccessUtils.GetUpdateQuery(Obj: TCustomDADataSet): TComponent; +begin + Result := Obj.FUpdateQuery; +end; + +class function TDBAccessUtils.GetTablesInfo(Obj: TCustomDADataSet): TCRTablesInfo; +begin + Result := Obj.TablesInfo; +end; + +class function TDBAccessUtils.GetUpdatingTable(Obj: TCustomDADataSet): string; +begin + Result := Obj.UpdatingTable; +end; + +class procedure TDBAccessUtils.SetUpdatingTable(Obj: TCustomDADataSet; Value: string); +begin + Obj.UpdatingTable := Value; +end; + +class function TDBAccessUtils.GetUpdatingTableIdx(Obj: TCustomDADataSet): integer; +begin + Result := Obj.FUpdatingTableInfoIdx; +end; + +class procedure TDBAccessUtils.SetUpdatingTableIdx(Obj: TCustomDADataSet; Value: integer); +begin + Obj.FUpdatingTableInfoIdx := Value; +end; + +class procedure TDBAccessUtils.InternalConnect(Obj: TCustomDAConnection); +begin + Assert(Obj <> nil); + Obj.InternalConnect; +end; + +class procedure TDBAccessUtils.InternalDisconnect(Obj: TCustomDAConnection); +begin + Assert(Obj <> nil); + Obj.InternalDisconnect; +end; + +class procedure TDBAccessUtils.SuppressAutoCommit(Obj: TCustomDAConnection); +begin + Obj.SuppressAutoCommit; +end; + +class procedure TDBAccessUtils.RestoreAutoCommit(Obj: TCustomDAConnection); +begin + Obj.RestoreAutoCommit; +end; + +class procedure TDBAccessUtils.Disconnect(Obj: TCustomDASQL); +begin + Obj.Disconnect; +end; + +class function TDBAccessUtils.SQLGenerator(Obj: TCustomDADataSet): TDASQLGenerator; +begin + Result := Obj.FSQLGenerator; +end; + +class procedure TDBAccessUtils.GetKeyAndDataFields( + Obj: TCustomDADataSet; + out KeyAndDataFields: TKeyAndDataFields; + const ForceUseAllKeyFields: boolean); +begin + Obj.GetKeyAndDataFields(KeyAndDataFields, ForceUseAllKeyFields); +end; + +class function TDBAccessUtils.GetLockDebug(Obj: TComponent): boolean; +begin + if Obj is TCustomDADataSet then + Result := TCustomDADataSet(Obj).FLockDebug + else + if Obj is TCustomDASQL then + Result := TCustomDASQL(Obj).FLockDebug + else + begin + Result := False; + Assert(False, 'Obj is ' + Obj.ClassName); + end; +end; + +class procedure TDBAccessUtils.SetLockDebug(Obj: TComponent; Value: boolean); +begin + if IsClass(Obj, TCustomDADataSet) then + TCustomDADataSet(Obj).FLockDebug := Value + else + if IsClass(Obj, TCustomDASQL) then + TCustomDASQL(Obj).FLockDebug := Value + else + Assert(False, 'Obj is ' + Obj.ClassName); +end; + +class function TDBAccessUtils.FOwner(Obj: TDAConnectionOptions): TCustomDAConnection; +begin + Result := Obj.FOwner; +end; + +class function TDBAccessUtils.FOwner(Obj: TDADataSetOptions): TCustomDADataSet; +begin + Result := Obj.FOwner; +end; + +class function TDBAccessUtils.SQLMonitorClass(Obj: TCustomDAConnection): TClass; +begin + Result := Obj.SQLMonitorClass; +end; + +class function TDBAccessUtils.QuoteName(Obj: TCustomDADataSet; const AName: string): string; +begin + Result := Obj.QuoteName(AName); +end; + +class function TDBAccessUtils.UnQuoteName(Obj: TCustomDADataSet; AName: string): string; +begin + Result := Obj.UnQuoteName(AName); +end; + +class function TDBAccessUtils.GetSQLs(Obj: TCustomDAConnection): TDAList; +begin + Result := Obj.FSQLs; +end; + +class procedure TDBAccessUtils.RegisterClient(Obj: TCustomDAConnection; Client: TObject; Event: TConnectChangeEvent = nil); +begin + Obj.RegisterClient(Client, Event); +end; + +class procedure TDBAccessUtils.UnRegisterClient(Obj: TCustomDAConnection; Client: TObject); +begin + Obj.UnRegisterClient(Client); +end; + +class function TDBAccessUtils.GetIdentityField(Obj: TCustomDADataSet): TField; +begin + Result := Obj.FIdentityField; +end; + +class function TDBAccessUtils.GetSQL(Obj: TComponent): TStrings; +begin + Result := nil; + Assert(Obj <> nil); + if IsClass(Obj, TCustomDASQL) then + Result := TCustomDASQL(Obj).SQL + else + if IsClass(Obj, TCustomDADataSet) then + Result := TCustomDADataSet(Obj).SQL + else + Assert(False, Obj.ClassName); +end; + +class procedure TDBAccessUtils.SetSQL(Obj: TComponent; Value: TStrings); +begin + Assert(Obj <> nil); + if Obj is TCustomDASQL then + TCustomDASQL(Obj).SQL := Value + else + if Obj is TCustomDADataSet then + TCustomDADataSet(Obj).SQL := Value + else + Assert(False, Obj.ClassName); +end; + +class procedure TDBAccessUtils.SetSQLText(Obj: TComponent; const SQLText: string; const LockAssembleSQL, LockMacros: boolean; const DisableScanParams: boolean = True); +begin + Assert(Obj <> nil); + if IsClass(Obj, TCustomDASQL) then + try + TCustomDASQL(Obj).FLockMacros := LockMacros; + TCustomDASQL(Obj).FLockAssembleSQL := LockAssembleSQL; + TCustomDASQL(Obj).FICommand.SetProp(prDisableParamScan, Variant(True)); + TCustomDASQL(Obj).SQL.Text := SQLText; + finally + TCustomDASQL(Obj).FLockMacros := False; + TCustomDASQL(Obj).FLockAssembleSQL := False; + TCustomDASQL(Obj).FICommand.SetProp(prDisableParamScan, Variant(False)); + end + else + if IsClass(Obj, TCustomDADataSet) then + try + TCustomDADataSet(Obj).FCommand.FLockMacros := LockMacros; + TCustomDADataSet(Obj).FCommand.FLockAssembleSQL := LockAssembleSQL; + TCustomDADataSet(Obj).FCommand.FICommand.SetProp(prDisableParamScan, Variant(DisableScanParams)); + TCustomDADataSet(Obj).SQL.Text := SQLText; + finally + TCustomDADataSet(Obj).FCommand.FLockMacros := False; + TCustomDADataSet(Obj).FCommand.FLockAssembleSQL := False; + TCustomDADataSet(Obj).FCommand.FICommand.SetProp(prDisableParamScan, Variant(False)); + end + else + Assert(False, Obj.ClassName); +end; + +class function TDBAccessUtils.GetParams(Obj: TComponent): TDAParams; +begin + Result := nil; + Assert(Obj <> nil); + if IsClass(Obj, TCustomDASQL) then + Result := TCustomDASQL(Obj).Params + else + if IsClass(Obj, TCustomDADataSet) then + Result := TCustomDADataSet(Obj).Params + else + Assert(False, Obj.ClassName); +end; + +class procedure TDBAccessUtils.Execute(Obj: TComponent); +begin + Assert(Obj <> nil); + if IsClass(Obj, TCustomDASQL) then + TCustomDASQL(Obj).Execute + else + if IsClass(Obj, TCustomDADataSet) then + TCustomDADataSet(Obj).Execute + else + Assert(False, Obj.ClassName); +end; + +class procedure TDBAccessUtils.Open(Obj: TComponent); +begin + Assert(Obj <> nil); + Assert(Obj is TCustomDADataSet); + TCustomDADataSet(Obj).Open; +end; + +class function TDBAccessUtils.GetRowsAffected(Obj: TComponent): integer; +begin + Result := 0; + Assert(Obj <> nil); + if IsClass(Obj, TCustomDASQL) then + Result := TCustomDASQL(Obj).RowsAffected + else + if IsClass(Obj, TCustomDADataSet) then + Result := TCustomDADataSet(Obj).RowsAffected + else + Assert(False, Obj.ClassName); +end; + +class function TDBAccessUtils.GetUpdateSQLStatementTypes(Obj: TCustomDADataSet): TStatementTypes; +begin + Result := Obj.GetUpdateSQLStatementTypes; +end; + +class function TDBAccessUtils.GetUpdateSQLIndex(Obj: TCustomDADataSet; StatementType: TStatementType): TStrings; +begin + Result := nil; + if Assigned(Obj.UpdateObject) then + if Obj.UpdateObject.GetObjectIndex(Ord(StatementType)) = nil then + Result := Obj.UpdateObject.GetSQLIndex(Ord(StatementType)) + else + Exit; + if Result = nil then + Result := Obj.GetUpdateSQLIndex(Ord(StatementType)); +end; + +class function TDBAccessUtils.ParseSQL(Obj: TCustomDASQL; const SQL: string; Params: TDAParams; RenamePrefix: string = ''): string; +begin + Result := Obj.ParseSQL(SQL, Params, RenamePrefix); +end; + +class function TDBAccessUtils.CreateParamsObject(Obj: TCustomDASQL): TDAParams; +begin + Result := Obj.CreateParamsObject; +end; + +class procedure TDBAccessUtils.SetDesigning(Obj: TComponent; Value: Boolean; SetChildren: Boolean = True); +begin + if Obj is TCustomDADataSet then + TCustomDADataSet(Obj).SetDesigning(Value, SetChildren) + else + if Obj is TCustomDASQL then + TCustomDASQL(Obj).SetDesigning(Value, SetChildren) + else + Assert(False, Obj.ClassName); +end; + +class function TDBAccessUtils.GetIRecordSet(Obj: TCustomDADataSet): TCRRecordSet; +begin + Result := Obj.FIRecordSet; +end; + +class function TDBAccessUtils.GetDataSetClass(Obj: TCustomDAUpdateSQL): TCustomDADataSetClass; +begin + Result := Obj.DataSetClass; +end; + +class function TDBAccessUtils.GetSQLClass(Obj: TCustomDAUpdateSQL): TCustomDASQLClass; +begin + Result := Obj.SQLClass; +end; + +class function TDBAccessUtils.GetParserClass(Obj: TMacros): TParserClass; +begin + Result := Obj.FParserClass; +end; + +{ TCRDataSource } + +constructor TCRDataSource.Create(Owner: TComponent); +begin + inherited Create(Owner); + + FDesignCreate := csDesigning in ComponentState; +end; + +procedure TCRDataSource.Loaded; +begin + inherited; + + FDesignCreate := False; +end; + +procedure TCRDataSource.AssignTo(Dest: TPersistent); +begin + if Dest is TDataSource then begin + TDataSource(Dest).DataSet := DataSet; + TDataSource(Dest).AutoEdit := AutoEdit; + TDataSource(Dest).Enabled := Enabled; + end else + inherited; +end; + +initialization + ChangeCursor := True; + MacroChar := '&'; + SetCursorProc := nil; + ShowConnectFormProc := nil; + BaseSQLOldBehavior := False; + SQLGeneratorCompatibility := False; +{$IFDEF MSWINDOWS} +{$IFNDEF CLR} + OpenSCManager := @NotLink; + CloseServiceHandle := @NotLink; + OpenService := @NotLink; + EnumServicesStatus := @NotLink; + QueryServiceStatus := @NotLink; + StartService := @NotLink; + ControlService := @NotLink; + NetServerEnum := @NotLink; + NetApiBufferFree := @NotLink; +{$ENDIF} + LoadNetManagerLib; + CRNetManager := TCRNetManager.Create; +{$ENDIF} + +finalization +{$IFDEF MSWINDOWS} + CRNetManager.Free; + FreeNetManagerLib; +{$ENDIF} + +end. diff --git a/internal/4.10.0.10/1/Source/DBAccess.res b/internal/4.10.0.10/1/Source/DBAccess.res new file mode 100644 index 0000000..c4d628d Binary files /dev/null and b/internal/4.10.0.10/1/Source/DBAccess.res differ diff --git a/internal/4.10.0.10/1/Source/DBMonitorClient.pas b/internal/4.10.0.10/1/Source/DBMonitorClient.pas new file mode 100644 index 0000000..7190757 --- /dev/null +++ b/internal/4.10.0.10/1/Source/DBMonitorClient.pas @@ -0,0 +1,139 @@ + +{$IFNDEF CLR} + +{$I Dac.inc} + +unit DBMonitorClient; +{$ENDIF} +interface + +uses +{$IFDEF MSWINDOWS} + Windows, DBMonitorIntf, +{$ENDIF} + Classes; + +{$IFDEF MSWINDOWS} + function GetDBMonitor: IDBMonitor; + function GetDBMonitorVersion: string; +{$ENDIF} + + function HasMonitor: boolean; + function WhereMonitor: string; + +implementation + +uses + SysUtils +{$IFDEF CLR} + ,System.IO +{$ENDIF} +{$IFDEF MSWINDOWS} + ,ComObj, ActiveX, Registry +{$ENDIF}; + +{$IFDEF MSWINDOWS} +const + sDBMonitorKey = 'Software\CoreLab\DBMonitor'; +{$ENDIF} + +function WhereMonitor: string; +{$IFDEF MSWINDOWS} +var + FRegIniFile: TRegIniFile; +{$ENDIF} +begin +{$IFDEF MSWINDOWS} + FRegIniFile := TRegIniFile.Create(sDBMonitorKey); + try + Result := FRegIniFile.ReadString('', 'Self', ''); + finally + FRegIniFile.Free; + end; +{$ELSE} + Result := ''; +{$ENDIF} +end; + +function HasMonitor: boolean; +begin +{$IFDEF MSWINDOWS} + Result := FileExists(WhereMonitor); +{$ELSE} + Result := False; +{$ENDIF} +end; + +{$IFDEF MSWINDOWS} +function GetDBMonitor: IDBMonitor; +var +{$IFDEF CLR} + Obj: TObject; +{$ELSE} + Obj: IUnknown; +{$ENDIF} +begin + with TRegistry.Create do + try + RootKey := HKEY_CLASSES_ROOT; + {$IFDEF CLR} + if OpenKeyReadOnly('CLSID\{' + GUIDToString(Class_DBMonitor) + '}\InprocServer32') + {$ELSE} + if OpenKeyReadOnly('CLSID\' + GUIDToString(Class_DBMonitor) + '\InprocServer32') // cr-d 21517 + {$ENDIF} + then begin + if FileExists(ReadString('')) then begin + {$IFDEF CLR} + Obj := CreateComObject(Class_DBMonitor); + Result := Obj as IDBMonitor; + {$ELSE} + Obj := CreateComObject(Class_DBMonitor); + Obj.QueryInterface(IDBMonitor, Result); + {$ENDIF} + end; +// else; +// Check download + CloseKey; + end + else + begin + Result := nil; + if HasMonitor then + raise Exception.Create('Current DBMonitor version is out of date. Please update.'); +// Check download + end; + finally + Free; + end; +end; + +function GetDBMonitorVersion: string; +var + DBMonitor: IDBMonitor; +{$IFDEF WIN32} + pVersion: PChar; +{$ENDIF} +begin + result := 'not available'; + try + DBMonitor := GetDBMonitor; + if DBMonitor <> nil then begin + {$IFDEF CLR} + DBMonitor.GetVersion(Result); + {$ELSE} + CoInitialize(nil); + try + DBMonitor.GetVersion(pVersion); + finally + CoUninitialize; + end; + Result := pVersion; + {$ENDIF} + end + except + end; +end; + +{$ENDIF} + +end. diff --git a/internal/4.10.0.10/1/Source/DBMonitorIntf.pas b/internal/4.10.0.10/1/Source/DBMonitorIntf.pas new file mode 100644 index 0000000..ae0e698 --- /dev/null +++ b/internal/4.10.0.10/1/Source/DBMonitorIntf.pas @@ -0,0 +1,117 @@ + +{$IFNDEF CLR} + +{$I Dac.inc} + +unit DBMonitorIntf; +{$ENDIF} +interface + +{$IFDEF CLR} +uses + Windows, System.Runtime.InteropServices; +{$ENDIF} + +{$IFNDEF CLR} +const +// IID_IDBMonitor must be changed if any interface changes are performed + IID_IDBMonitor: TGUID = '{89F49E64-F6E0-11D6-9038-00C02631BDC7}'; +{$ENDIF} + +const + Class_DBMonitor: TGUID = '{89F49E65-F6E0-11D6-9038-00C02631BDC7}'; + +type + TEventType = (etAppStarted, etAppFinished, etConnect, etDisconnect, etCommit, + etRollback, etPrepare, etUnprepare, etExecute, etBlob, etError, etMisc); + + TTracePoint = (tpBeforeEvent, tpAfterEvent); + +{$IFDEF CLR} + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] + TSQLParam = record + [MarshalAs(UnmanagedType.LPStr)] + Name: string; + [MarshalAs(UnmanagedType.LPStr)] + DataType: string; + [MarshalAs(UnmanagedType.LPStr)] + ParamType: string; + [MarshalAs(UnmanagedType.LPStr)] + Value: string; + end; + TSQLParams = array of TSQLParam; + + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] + TMonitorMessage = record + MessageID: cardinal; + EventType: integer; + TracePoint: integer; + ObjectID: cardinal; + OwnerID: cardinal; + [MarshalAs(UnmanagedType.LPStr)] + ObjectName: string; + [MarshalAs(UnmanagedType.LPStr)] + OwnerName: string; + [MarshalAs(UnmanagedType.LPStr)] + Description: string; + end; + + [ComImport, GuidAttribute('89F49E64-F6E0-11D6-9038-00C02631BDC7'), InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] +// [Guid('89F49E64-F6E0-11D6-9038-00C02631BDC7'), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + IDBMonitor = interface + [PreserveSig] + function GetVersion([Out, MarshalAs(UnmanagedType.LPStr)] out Version: string): HRESULT; + [PreserveSig] + function SetCaption([In, MarshalAs(UnmanagedType.LPStr)] Caption: string): HRESULT; + [PreserveSig] + function IsMonitorActive(out Active: integer): HRESULT; + [PreserveSig] + function OnEvent(var Msg: TMonitorMessage; [In, MarshalAs(UnmanagedType.LPStr)] ParamStr: string): HRESULT; + [PreserveSig] + function OnExecute(var Msg: TMonitorMessage; [In, MarshalAs(UnmanagedType.LPStr)] SQL: string; + [In, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.Struct)] Params: array of TSQLParam; + ParamCount: integer; RowsAffected: integer): HRESULT; + end; + +//TODO +//[ComImport, Guid('89F49E65-F6E0-11D6-9038-00C02631BDC7')] + DbMonitorClass = class + end; +{$ELSE} + TSQLParam = record + Name: string; + DataType: string; + ParamType: string; + Value: string; + end; + TSQLParams = array of TSQLParam; + + PSQLParam = ^TSQLParam; + + TMonitorMessage = record + MessageID: cardinal; + EventType: integer; + TracePoint: integer; + ObjectID: cardinal; + OwnerID: cardinal; + ObjectName: PChar; + OwnerName: PChar; + Description: PChar; + end; + + IDBMonitor = interface(IUnknown) + ['{89F49E64-F6E0-11D6-9038-00C02631BDC7}'] + function GetVersion(out pVersion: PChar): HRESULT; stdcall; + function SetCaption(Caption: PChar): HRESULT; stdcall; + function IsMonitorActive(out Active: integer): HRESULT; stdcall; + function OnEvent(var Msg: TMonitorMessage; ParamStr: PChar): HRESULT; stdcall; + function OnExecute(var Msg: TMonitorMessage; SQL: PChar; Params: PSQLParam; + ParamCount: integer; RowsAffected: integer): HRESULT; stdcall; + end; +{$ENDIF} + +implementation + +end. + + diff --git a/internal/4.10.0.10/1/Source/Dac.inc b/internal/4.10.0.10/1/Source/Dac.inc new file mode 100644 index 0000000..d8e0dc2 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Dac.inc @@ -0,0 +1,219 @@ +////////////////////////////////////////////////// +// DB Access Components +// Copyright © 1998-2003 Core Lab. All right reserved. + +{$DEFINE DAC600} + +{$IFNDEF LINUX} + {$DEFINE MSWINDOWS} +{$ENDIF} + +{$IFDEF MSWINDOWS} + {$IFNDEF CLR} + {$DEFINE USE_SYNEDIT} + {$ENDIF} +{$ENDIF} + +{$IFDEF VER120} { Delphi 4 } + {$DEFINE D4} + {$DEFINE VER4} + + {$DEFINE VER34} + {$DEFINE VER4P} +{$ENDIF} + +{$IFDEF VER130} { Delphi 5 } +{$IFNDEF BCB} + {$DEFINE D5} + {$DEFINE VER5} + + {$DEFINE VER5P} +{$ENDIF} +{$ENDIF} + +{$IFDEF VER140} { Delphi 6, Kylix 1, Kylix 2 } +{$IFNDEF BCB} + {$DEFINE D6} + {$DEFINE VER6} + + {$DEFINE VER5P} + {$DEFINE VER6P} +{$ENDIF} +{$ENDIF} + +{$IFDEF VER150} { Delphi 7 } +{$IFNDEF BCB} + {$DEFINE D7} + {$DEFINE VER7} + + {$DEFINE VER5P} + {$DEFINE VER6P} + {$DEFINE VER7P} +{$ENDIF} +{$ENDIF} + +{$IFDEF VER160} { Delphi 8 } + {$DEFINE D8} + {$DEFINE VER8} + + {$DEFINE VER5P} + {$DEFINE VER6P} + {$DEFINE VER7P} + {$DEFINE VER8P} +{$ENDIF} + +{$IFDEF VER170} { Delphi 9 } + {$DEFINE D9} + {$DEFINE VER9} + + {$DEFINE VER5P} + {$DEFINE VER6P} + {$DEFINE VER7P} + {$DEFINE VER8P} + {$DEFINE VER9P} +{$ENDIF} + +{$IFDEF VER180} { Delphi 10 } +{$IFNDEF VER185} { Delphi 11 Spacely} + {$DEFINE D10} + {$DEFINE VER10} + + {$DEFINE VER5P} + {$DEFINE VER6P} + {$DEFINE VER7P} + {$DEFINE VER8P} + {$DEFINE VER9P} + {$DEFINE VER10P} +{$ENDIF} +{$ENDIF} + +{$IFDEF VER185} { Delphi 11 Spacely} + {$DEFINE D11} + {$DEFINE VER11} + + {$DEFINE VER5P} + {$DEFINE VER6P} + {$DEFINE VER7P} + {$DEFINE VER8P} + {$DEFINE VER9P} + {$DEFINE VER10P} + {$DEFINE VER11P} +{$ENDIF} + + +{$IFDEF VER125} { C++ Builder 4 } + {$DEFINE BCB} + {$DEFINE CB4} + {$DEFINE VER4} + + {$DEFINE VER34} + {$DEFINE VER4P} + {$ObjExportAll On} +{$ENDIF} + +{$IFDEF VER130} { C++ Builder 5 } +{$IFDEF BCB} + {$DEFINE CB5} + {$DEFINE VER5} + + {$DEFINE VER5P} + {$ObjExportAll On} +{$ENDIF} +{$ENDIF} + +{$IFDEF VER140} { C++ Builder 6 } +{$IFDEF BCB} + {$DEFINE CB6} + {$DEFINE VER6} + + {$DEFINE VER5P} + {$DEFINE VER6P} + {$ObjExportAll On} +{$ENDIF} +{$ENDIF} + +{$IFDEF INTERNAL} +{$IFDEF BCB} + {$DEFINE BDE_SHARED} // Use TUpdateAction from DBTables +{$ENDIF} +{$ENDIF} + +// old + +{$IFDEF VER100} { Delphi 3 } + {$DEFINE D3} + {$DEFINE D3_CB3} + {$DEFINE VER34} + {$DEFINE VER3+} +{$ENDIF} + +{$IFDEF VER110} { C++ Builder 3 } + {$DEFINE CB} + {$DEFINE CB3} + {$DEFINE D3_CB3} + {$DEFINE VER34} + {$DEFINE VER3+} + {$ObjExportAll On} +{$ENDIF} + +{$IFDEF VER7P} + {$WARN UNSAFE_TYPE OFF} + {$WARN UNSAFE_CODE OFF} + {$WARN UNSAFE_CAST OFF} +{$ENDIF} + +{$IFDEF VER6P} + {$WARN SYMBOL_PLATFORM OFF} + {$WARN SYMBOL_DEPRECATED OFF} + {$WARN UNIT_PLATFORM OFF} + {$WARN UNIT_DEPRECATED OFF} +{$ENDIF} + +{$IFDEF BCB} + {$IFNDEF VER6P} + // CBuilder5 - UTF8 functions is not implemented + {$DEFINE UTF8} + {$ENDIF} +{$ELSE} + // Delphi5, Kylix2 - UTF8 functions is not implemented + // Delphi6, Kylix3 - can't divide K2 and K3 + {$IFDEF MSWINDOWS} + {$IFNDEF VER6P} + {$DEFINE UTF8} + {$ENDIF} + {$ELSE} + {$IFNDEF VER7P} + {$DEFINE UTF8} + {$ENDIF} + {$ENDIF} +{$ENDIF} + +{---------------------------- + MyDAC | other +----------------------|------ + k z | - + d5-d6 z | - + d7 d | d + d8 clr - | - + d9p clr - | - + d9p w32 d | d +----------------------------- + z - ZLib objs + d - Delphi internal} + +{$IFNDEF LITE} + {$IFNDEF CLR} + {$DEFINE HAVE_COMPRESS} // Define TCompressBlob class + {$IFDEF MSWINDOWS} + {$IFDEF VER7P} + {$DEFINE HAVE_COMPRESS_INTERNAL} // ZLib build in Delphi + {$ENDIF} + {$ENDIF} + {$ENDIF} +{$ENDIF} + +{$IFNDEF NODBTOOLS} // for VirtualTable build +{$IFDEF VER9P} + {$DEFINE DBTOOLS} // include DBToolsClient unit and related code +{$ENDIF} +{$ENDIF} diff --git a/internal/4.10.0.10/1/Source/DacClx.pas b/internal/4.10.0.10/1/Source/DacClx.pas new file mode 100644 index 0000000..5568525 --- /dev/null +++ b/internal/4.10.0.10/1/Source/DacClx.pas @@ -0,0 +1,17 @@ + +{$I Dac.inc} +{$J+} + +unit DacClx; + +interface + +uses +{$IFDEF MSWINDOWS} + Windows, Registry, SysUtils, +{$ENDIF} + Classes, DB, DBAccess, DASQLMonitor, TypInfo, MemData, QForms, QControls, + QStdCtrls, QExtCtrls, QGraphics; + +{$I DacGui.inc} + diff --git a/internal/4.10.0.10/1/Source/DacGui.inc b/internal/4.10.0.10/1/Source/DacGui.inc new file mode 100644 index 0000000..1d8155b --- /dev/null +++ b/internal/4.10.0.10/1/Source/DacGui.inc @@ -0,0 +1,458 @@ + +procedure SetCursor(Value: integer); +procedure ShowDebugForm(DASQLMonitorClass: TDASQLMonitorClass; + Component: TComponent; SQL: string; Params: TDAParams; Caption: string); +function ShowConnectForm(ConnectDialog: TCustomConnectDialog): boolean; +procedure StartWait; +procedure StopWait; +function ApplicationTitle: string; + +{$IFDEF MSWINDOWS} +function GetHelpFileName(const ProjectName: string): string; +{$ENDIF} + +implementation + +var + SQLDelay: longword = 30; + +{$IFDEF WIN32} +var + TimerID: word = 0; + StartTime: longword = 0; + +procedure FreeTimer(ForceKill: boolean = False); +begin + if (TimerID <> 0) and (ForceKill or (GetTickCount - StartTime > SQLDelay)) then begin + KillTimer(0, TimerID); + TimerID := 0; + StartTime := 0; + SetCursor(crDefault); + end; +end; + +procedure TimerCallBack(hWnd: HWND; Message: Word; TimerID: word; + SysTime: longint); stdcall; +begin + FreeTimer; +end; +{$ELSE} +type + TCursorTimer = class (TTimer) + private + procedure TimerHandler(Sender: TObject); + + public + constructor Create(AOwner: TComponent); override; + end; + +var + Timer: TTimer; + +{ TCursorTimer } + +constructor TCursorTimer.Create(AOwner: TComponent); +begin + inherited; + + OnTimer := TimerHandler; +end; + +procedure TCursorTimer.TimerHandler(Sender: TObject); +begin + Enabled := False; + SetCursor(crDefault); +end; +{$ENDIF} + +const +{$IFDEF MSWINDOWS} + KeyPath = '\SOFTWARE\CoreLab\DBAccess\'; +{$ENDIF} + SQLArrowCount: integer = 0; + +procedure SetCursor(Value: integer); +begin + if ChangeCursor + {$IFDEF WIN32}and (GetCurrentThreadID = MainThreadID){$ENDIF} + then + case Value of + crDefault: begin + if SQLArrowCount > 0 then begin + if Screen.Cursor <> crSQLWait then + Dec(SQLArrowCount); + if SQLArrowCount > 0 then + Screen.Cursor := crSQLArrow + else + Screen.Cursor := crDefault; + end + else + Screen.Cursor := crDefault; + end; + crSQLWait: begin + {$IFDEF WIN32} + if TimerID = 0 then + TimerID := SetTimer(0, 0, SQLDelay, @TimerCallBack); + + if Screen.Cursor <> crSQLWait then + Screen.Cursor := crSQLWait; + + StartTime := GetTickCount; + {$ELSE} + if Timer = nil then begin + Timer := TCursorTimer.Create(nil); + Timer.Enabled := False; + end; + if not Timer.Enabled then begin + Timer.Interval := SQLDelay; + Timer.Enabled := True; + end; + {$IFNDEF K3} + // strange AV when freeing cursor on exit (perhaps beta problem) + if Screen.Cursor <> crSQLWait then + Screen.Cursor := crSQLWait; + {$ENDIF} + {$ENDIF} + end; + crSQLArrow: begin + Inc(SQLArrowCount); + Screen.Cursor:= crSQLArrow; + end; + end; +end; + +type + TDebugForm = class (TForm) + public + constructor CreateNew(Owner: TComponent; Dummy: integer = 0); override; + + procedure FormKeyPress(Sender: TObject; var Key: char); + procedure ButtonClick(Sender: TObject); + end; + +{ TDebugForm } + +constructor TDebugForm.CreateNew(Owner: TComponent; Dummy: integer = 0); +begin + inherited CreateNew(Owner); + + KeyPreview := True; + OnKeyPress := FormKeyPress; +end; + +procedure TDebugForm.FormKeyPress(Sender: TObject; var Key: char); +begin + if (Key = #13) or (Key = #27) then + Close; +end; + +procedure TDebugForm.ButtonClick(Sender: TObject); +begin + Close; +end; + +procedure ShowDebugForm(DASQLMonitorClass: TDASQLMonitorClass; + Component: TComponent; SQL: string; Params: TDAParams; Caption: string); +var + Form: TDebugForm; + Memo: TMemo; + St: string; + Panel: TPanel; +{$IFDEF MSWINDOWS} + Registry: TRegistry; +{$ENDIF} +begin + Form := TDebugForm.CreateNew(nil); + +{$IFDEF MSWINDOWS} + Registry := TRegistry.Create; +{$ENDIF} + + try + St := DASQLMonitorClass.GetCaption + ' Debug: '; + if Component.Owner <> nil then + St := St + Component.Owner.Name + '.'; + St := St + Component.Name; + if Caption <> '' then + St := St + ' [' + Caption + ']'; + + Form.Caption := St; + + Panel := TPanel.Create(Form); + with Panel do begin + Parent := Form; + Align := alTop; + Height := 24; + BevelInner := bvNone; + BevelOuter := bvNone; + end; + + with TButton.Create(Form) do begin + Parent := Panel; + Caption := 'Close'; + Font.Style := [fsBold]; + Top := 1; + Left := 0; + Height := 22; + Width := 150; + OnClick := Form.ButtonClick; + end; + + with TLabel.Create(Form) do begin + Parent := Panel; + Caption := 'Before execution'; + Font.Style := [fsBold]; + Font.Color := clNavy; + Top := 5; + Left := 175; + end; + + with TPanel.Create(Form) do begin + Parent := Form; + Align := alLeft; + Width := 15; + BevelInner := bvLowered; + BevelOuter := bvNone; + end; + + Memo := TMemo.Create(Form); + with Memo do begin + Parent := Form; + Align := alClient; + ReadOnly := True; + Color := clBtnFace; + Font.Name := 'Courier New'; + {$IFDEF MSWINDOWS} + {$IFNDEF CLX} + Font.Charset := GetDefFontCharSet; + {$ENDIF} + {$ENDIF} + ScrollBars := ssBoth; + WordWrap := False; + end; + + Form.ActiveControl := Memo; + + Memo.Lines.Text := SQL + #13#10 + #13#10 + DASQLMonitorClass.GetParams(Params); + Memo.SelStart := 0; + + {$IFDEF MSWINDOWS} + if Registry.OpenKey(KeyPath + 'Debug', False) then begin + if Registry.ValueExists('Left') then + Form.Left := Registry.ReadInteger('Left'); + if Registry.ValueExists('Top') then + Form.Top := Registry.ReadInteger('Top'); + if Registry.ValueExists('Width') then + Form.Width := Registry.ReadInteger('Width'); + if Registry.ValueExists('Height') then + Form.Height := Registry.ReadInteger('Height'); + + Registry.CloseKey; + end + else + {$ENDIF} + begin + Form.Width := (Screen.Width) div 2; + Form.Left := (Screen.Width - Form.Width) div 2; + Form.Top := (Screen.Height - Form.Height) div 2; + end; + + Form.ShowModal; + + {$IFDEF MSWINDOWS} + if Registry.OpenKey(KeyPath + 'Debug', True) then begin + Registry.WriteInteger('Left', Form.Left); + Registry.WriteInteger('Top', Form.Top); + Registry.WriteInteger('Width', Form.Width); + Registry.WriteInteger('Height', Form.Height); + Registry.CloseKey; + end; + {$ENDIF} + + finally + {$IFDEF MSWINDOWS} + Registry.Free; + {$ENDIF} + Form.Free; + end; +end; + +type + _TCustomConnectDialog = class(TCustomConnectDialog) + end; + +function ShowConnectForm(ConnectDialog: TCustomConnectDialog): boolean; +var + FormClass: TFormClass; + ConnectForm: TForm; + PropInfo: PPropInfo; +begin + if (ConnectDialog.DialogClass = '') + or (csDesigning in ConnectDialog.ComponentState) + then + FormClass := TFormClass(_TCustomConnectDialog(ConnectDialog).DefDialogClass) + else + FormClass := TFormClass(FindClass(ConnectDialog.DialogClass)); + + ConnectForm := FormClass.Create(nil); + try + PropInfo := GetPropInfo(FormClass.ClassInfo, 'ConnectDialog'); + if PropInfo <> nil then + SetObjectProp(ConnectForm, PropInfo, ConnectDialog); + + Result := (ConnectForm.ShowModal = mrOk) and ConnectDialog.Connection.Connected; + finally + ConnectForm.Free; + end; +end; + +procedure StartWait; +begin + SetCursor(crSQLWait); +end; + +procedure StopWait; +begin + SetCursor(crDefault); +end; + +function ApplicationTitle: string; +begin + Result := Application.Title; +end; + +{$IFDEF MSWINDOWS} +{$IFDEF VER7P} +{$IFDEF VER8P} +function GetHelpFileName(const ProjectName: string): string; +var + Path: string; + Ind: integer; + + Registry: TRegistry; + sl: TStringList; + i: integer; + UCProjectName: string; +begin + Result := ''; + Registry := nil; + sl := nil; + try + Registry := TRegistry.Create; + {$IFDEF VER9P} + Registry.RootKey := HKEY_LOCAL_MACHINE; + if Registry.OpenKey('Software\CoreLab\' + ProjectName, False) then begin + try + {$IFDEF VER9} + Path := Registry.ReadString('D9'); + {$ELSE} + {$IFDEF VER10} + Path := Registry.ReadString('D10'); + {$ELSE} + {$IFDEF VER11} + Path := Registry.ReadString('D11'); + {$ELSE} + error + {$ENDIF} + {$ENDIF} + {$ENDIF} + Result := IncludeTrailingPathDelimiter(Path) + 'Doc\' + ProjectName + '.hxs'; + Exit; + except + // silent + Registry.CloseKey; + end; + end; + {$ENDIF} + + Registry.RootKey := HKEY_CURRENT_USER; + sl := TStringList.Create; + if not Registry.OpenKey('Software\Borland\BDS\' + + {$IFDEF VER8}'2.0'{$ENDIF} + {$IFDEF VER9}'3.0'{$ENDIF} + {$IFDEF VER10}'4.0'{$ENDIF} + {$IFDEF VER11}'5.0'{$ENDIF} + + '\Known Assemblies', False) then begin + Result := ProjectName + '.hxs'; + Exit; + end; + + Registry.GetValueNames(sl); + UCProjectName := UpperCase('CoreLab.' + ProjectName + '.Design'); + for i := 0 to sl.Count - 1 do + if (Registry.GetDataType(sl[i]) in [rdString, rdExpandString]) + and (UpperCase(Registry.ReadString(sl[i])) = UCProjectName) then begin + Path := sl[i]; + Break; + end; + + if Path = '' then begin + Result := ProjectName + '.hxs'; + Exit; + end; + + finally + sl.Free; + Registry.Free; + end; + + Ind := LastDelimiter('\', Path); + Path := Copy(Path, 1, Ind - 1); + Ind := LastDelimiter('\', Path); + Path := Copy(Path, 1, Ind); + Result := Path + 'Doc\' + ProjectName + '.hxs'; +end; +{$ELSE} +function GetHelpFileName(const ProjectName: string): string; +begin + Result := ProjectName + '.hlp'; +end; +{$ENDIF} +{$ELSE} +function GetHelpFileName(const ProjectName: string): string; +var + Path: string; + Ind: integer; +begin + Path := Application.ExeName; + Ind := LastDelimiter('\', Path); + Path := Copy(Path, 1, Ind - 1); + Ind := LastDelimiter('\', Path); + Path := Copy(Path, 1, Ind); + Result := Path + 'help\' + ProjectName + '.hlp'; +end; +{$ENDIF} +{$ENDIF} + +initialization +{$IFDEF WIN32} +{$IFNDEF CLX} + Screen.Cursors[crSQLArrow] := LoadCursor(HInstance, 'SQLARROW'); +{$ENDIF} +{$ELSE} + Timer := nil; +{$ENDIF} + + SetCursorProc := SetCursor; + ShowConnectFormProc := ShowConnectForm; + ShowDebugFormProc := ShowDebugForm; + StartWaitProc := StartWait; + StopWaitProc := StopWait; + ApplicationTitleProc := ApplicationTitle; + {$IFNDEF VER6P} + ApplicationHandleException := Application.HandleException; + {$ENDIF}; + +finalization +{$IFDEF WIN32} +{$IFNDEF CLX} + DestroyCursor(Screen.Cursors[crSQLArrow]); +{$ENDIF} + FreeTimer(True); +{$ELSE} + if Timer <> nil then + Timer.Free; +{$ENDIF} + +end. + diff --git a/internal/4.10.0.10/1/Source/DacVcl.pas b/internal/4.10.0.10/1/Source/DacVcl.pas new file mode 100644 index 0000000..82d9c9f --- /dev/null +++ b/internal/4.10.0.10/1/Source/DacVcl.pas @@ -0,0 +1,16 @@ + +{$J+} + +{$IFNDEF CLR} + +{$I Dac.inc} + +unit DacVcl; +{$ENDIF} +interface +uses + Classes, DB, DBAccess, DASQLMonitor, TypInfo, MemData, Windows, Forms, + Controls, StdCtrls, ExtCtrls, Registry, Graphics, SysUtils; + +{$I DacGui.inc} + diff --git a/internal/4.10.0.10/1/Source/DacVer.inc b/internal/4.10.0.10/1/Source/DacVer.inc new file mode 100644 index 0000000..ce3cbab --- /dev/null +++ b/internal/4.10.0.10/1/Source/DacVer.inc @@ -0,0 +1,8 @@ + +////////////////////////////////////////////////// +// Data Access Components +// Copyright © 1998-2005 Core Lab. All right reserved. + +const + DACVersion = '6.10.1.10'; + diff --git a/internal/4.10.0.10/1/Source/Delphi10/CoreLab.Dac.AdoNet.bdsproj b/internal/4.10.0.10/1/Source/Delphi10/CoreLab.Dac.AdoNet.bdsproj new file mode 100644 index 0000000..ff31ae0 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi10/CoreLab.Dac.AdoNet.bdsproj @@ -0,0 +1,187 @@ + + + + + + + + + + + + CoreLab.Dac.AdoNet.dpk + + + 7.0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 0 + 1 + True + True + WinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + Borland.Vcl;CoreLab.Dac;CoreLab.VirtualTable + False + + False + True + False + True + True + False + True + True + True + True + True + True + True + True + True + True + True + True + False + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + + + + 0 + 0 + 1 + True + False + 4096 + 1048576 + 4194304 + Core Lab Data Access Components + False + False + + + + . + + . + .\;..\Net;..\;d:\program files\common files\borland shared\bds\shared assemblies\4.0;d:\winnt\microsoft.net\framework\v1.1.4322;d:\projects\delphi\dac\source\delphi10;D:\Projects\Delphi\Dac\Source\Delphi10 + d:\winnt\microsoft.net\framework\v1.1.4322\System.Data.dll;Borland.VclDbRtl;Borland.Delphi;D:\Projects\Delphi\Dac\Source\Delphi10\CoreLab.Dac.dll + + + False + + + + + + False + + + + + + False + + True False + + + + $00000000 + + + + True + False + 6 + 10 + 1 + 4010 + False + False + False + False + False + 1058 + 1251 + + + + + + + + + + + + + 6.10.1.10 + + + + + + 6.10.1.10 + + + + diff --git a/internal/4.10.0.10/1/Source/Delphi10/CoreLab.Dac.AdoNet.cfg b/internal/4.10.0.10/1/Source/Delphi10/CoreLab.Dac.AdoNet.cfg new file mode 100644 index 0000000..46dcbc4 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi10/CoreLab.Dac.AdoNet.cfg @@ -0,0 +1,45 @@ +-$A- +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-cg +-vn +-AWinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-NSBorland.Vcl;CoreLab.Dac;CoreLab.VirtualTable +-H+ +-W+ +-M +-$M4096,1048576 +-K$00400000 +-N0"." +-LN"." +-U".\;..\Net;..\;d:\program files\common files\borland shared\bds\shared assemblies\4.0;d:\winnt\microsoft.net\framework\v1.1.4322;d:\projects\delphi\dac\source\delphi10;D:\Projects\Delphi\Dac\Source\Delphi10" +-O".\;..\Net;..\;d:\program files\common files\borland shared\bds\shared assemblies\4.0;d:\winnt\microsoft.net\framework\v1.1.4322;d:\projects\delphi\dac\source\delphi10" +-I".\;..\Net;..\;d:\program files\common files\borland shared\bds\shared assemblies\4.0;d:\winnt\microsoft.net\framework\v1.1.4322;d:\projects\delphi\dac\source\delphi10" +-R".\;..\Net;..\;d:\program files\common files\borland shared\bds\shared assemblies\4.0;d:\winnt\microsoft.net\framework\v1.1.4322;d:\projects\delphi\dac\source\delphi10" +-w-SYMBOL_DEPRECATED +-w-SYMBOL_PLATFORM +-w-UNIT_PLATFORM +-w-CASE_LABEL_RANGE diff --git a/internal/4.10.0.10/1/Source/Delphi10/CoreLab.Dac.AdoNet.dpk b/internal/4.10.0.10/1/Source/Delphi10/CoreLab.Dac.AdoNet.dpk new file mode 100644 index 0000000..d48945e --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi10/CoreLab.Dac.AdoNet.dpk @@ -0,0 +1,97 @@ +package CoreLab.Dac.AdoNet; + + +{$ALIGN 0} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Core Lab Data Access Components'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + CoreLab.Dac, + Borland.Delphi, + Borland.VclDbRtl, + System.Data; + +contains + CoreLab.Dac.DataAdapter in '..\Net\CoreLab.Dac.DataAdapter.pas'; + +[assembly: AssemblyTitle('CoreLab.Dac.AdoNet')] +[assembly: AssemblyDescription('')] +[assembly: AssemblyConfiguration('')] +[assembly: AssemblyCompany('Core Lab')] +[assembly: AssemblyProduct('Core Lab Data Access Components')] +[assembly: AssemblyCopyright('')] +[assembly: AssemblyTrademark('')] +[assembly: AssemblyCulture('')] + + +// The Delphi compiler controls the AssemblyTitleAttribute via the ExeDescription. +// You can set this in the IDE via the Project Options. +// Manually setting the AssemblyTitle attribute below will override the IDE +// setting. +// [assembly: AssemblyTitle('')] + + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion('6.10.1.4010')] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile('mykey.snk')], provided your output +// directory is the project directory (the default). +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile('CoreLab.snk')] +[assembly: AssemblyKeyName('')] + +end. diff --git a/internal/4.10.0.10/1/Source/Delphi10/CoreLab.Dac.Design.bdsproj b/internal/4.10.0.10/1/Source/Delphi10/CoreLab.Dac.Design.bdsproj new file mode 100644 index 0000000..7e94138 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi10/CoreLab.Dac.Design.bdsproj @@ -0,0 +1,213 @@ + + + + + + + + + + + + CoreLab.Dac.Design.dpk + + + 7.0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 0 + 1 + True + True + WinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + CoreLab.Dac;CoreLab.Dac.Design + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + + + + 0 + 0 + 1 + False + False + False + 4096 + 1048576 + 4194304 + Data Access Components + False + + + + . + + . + .\;..\Net;..\Design;..\;d:\program files\common files\borland shared\bds\shared assemblies\4.0;d:\program files\borland\bds\4.0\bin;d:\projects\delphi\dac\source\delphi10;D:\Projects\Delphi\Dac\Source\Delphi10 + Borland.VclRtl;Borland.VclDbCtrls;Borland.Vcl.Design.DbRtl;Borland.Vcl;Borland.Studio.Vcl.Design;Borland.Delphi;CoreLab.Dac + + + False + + + + + + False + + + + + + False + + True + False + + + $00000000 + + + + True + False + 6 + 10 + 1 + 4010 + False + False + False + False + False + 1058 + 1251 + + 1.0.0.01.0.0.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/internal/4.10.0.10/1/Source/Delphi10/CoreLab.Dac.Design.cfg b/internal/4.10.0.10/1/Source/Delphi10/CoreLab.Dac.Design.cfg new file mode 100644 index 0000000..30f213a --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi10/CoreLab.Dac.Design.cfg @@ -0,0 +1,41 @@ +-$A- +-$B- +-$C- +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J- +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-cg +-AWinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-NSCoreLab.Dac;CoreLab.Dac.Design +-H+ +-W+ +-M +-$M4096,1048576 +-K$00400000 +-N0"." +-LN"." +-U".\;..\Net;..\;..\Design;..\..\DBToolsInterfaces" +-O".\;..\Net;..\;..\Design" +-I".\;..\Net;..\;..\Design" +-R".\;..\Net;..\;..\Design" +-Z diff --git a/internal/4.10.0.10/1/Source/Delphi10/CoreLab.Dac.Design.dpk b/internal/4.10.0.10/1/Source/Delphi10/CoreLab.Dac.Design.dpk new file mode 100644 index 0000000..ced0dc9 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi10/CoreLab.Dac.Design.dpk @@ -0,0 +1,132 @@ +package CoreLab.Dac.Design; + + +{$ALIGN 0} +{$ASSERTIONS OFF} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Data Access Components'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + CoreLab.DbTools.Interfaces, + CoreLab.Dac, + Borland.Delphi, + Borland.Studio.Vcl.Design, + Borland.Studio.ToolsAPI, + Borland.Vcl, + Borland.Vcl.Design.DbRtl, + Borland.VclDbCtrls, + Borland.VclRtl; + +contains + CoreLab.Dac.Design.DacReg in '..\Net\CoreLab.Dac.Design.DacReg.pas', + CoreLab.Dac.Design.VTDesign in '..\Net\CoreLab.Dac.Design.VTDesign.pas', + CoreLab.Dac.Design.DAMenu in '..\Net\CoreLab.Dac.Design.DAMenu.pas', + CoreLab.Dac.Design.DADesign in '..\Net\CoreLab.Dac.Design.DADesign.pas', + CoreLab.Dac.Design.DAUpdateSQLFrame in '..\Net\CoreLab.Dac.Design.DAUpdateSQLFrame.pas', + CoreLab.Dac.Design.CRFrame in '..\Net\CoreLab.Dac.Design.CRFrame.pas', + CoreLab.Dac.Design.CRColFrame in '..\Net\CoreLab.Dac.Design.CRColFrame.pas', + CoreLab.Dac.Design.CRTabEditor in '..\Net\CoreLab.Dac.Design.CRTabEditor.pas', + CoreLab.Dac.Design.DAConnectionEditor in '..\Net\CoreLab.Dac.Design.DAConnectionEditor.pas', + CoreLab.Dac.Design.CRDataEditor in '..\Net\CoreLab.Dac.Design.CRDataEditor.pas', + CoreLab.Dac.Design.DADataEditor in '..\Net\CoreLab.Dac.Design.DADataEditor.pas', + CoreLab.Dac.Design.DAMacrosFrame in '..\Net\CoreLab.Dac.Design.DAMacrosFrame.pas', + CoreLab.Dac.Design.DAParamsFrame in '..\Net\CoreLab.Dac.Design.DAParamsFrame.pas', + CoreLab.Dac.Design.DAParamValueEditor in '..\Net\CoreLab.Dac.Design.DAParamValueEditor.pas', + CoreLab.Dac.Design.DAQueryEditor in '..\Net\CoreLab.Dac.Design.DAQueryEditor.pas', + CoreLab.Dac.Design.DADualListEditor in '..\Net\CoreLab.Dac.Design.DADualListEditor.pas', + CoreLab.Dac.Design.DADumpProgress in '..\Net\CoreLab.Dac.Design.DADumpProgress.pas', + CoreLab.Dac.Design.DADumpEditor in '..\Net\CoreLab.Dac.Design.DADumpEditor.pas', + CoreLab.Dac.Design.DASPCallFrame in '..\Net\CoreLab.Dac.Design.DASPCallFrame.pas', + CoreLab.Dac.Design.DASQLEditor in '..\Net\CoreLab.Dac.Design.DASQLEditor.pas', + CoreLab.Dac.Design.DASQLFrame in '..\Net\CoreLab.Dac.Design.DASQLFrame.pas', + CoreLab.Dac.Design.DASQLGeneratorFrame in '..\Net\CoreLab.Dac.Design.DASQLGeneratorFrame.pas', + CoreLab.Dac.Design.DATableEditor in '..\Net\CoreLab.Dac.Design.DATableEditor.pas', + CoreLab.Dac.Design.CREditor in '..\Net\CoreLab.Dac.Design.CREditor.pas', + CoreLab.Dac.Design.DADesignUtils in '..\Net\CoreLab.Dac.Design.DADesignUtils.pas', + CoreLab.Dac.Design.DAUpdateSQLEditor in '..\Net\CoreLab.Dac.Design.DAUpdateSQLEditor.pas', + CoreLab.Dac.Design.DAScriptEditor in '..\Net\CoreLab.Dac.Design.DAScriptEditor.pas', + CoreLab.Dac.Design.DAStoredProcEditor in '..\Net\CoreLab.Dac.Design.DAStoredProcEditor.pas', + CoreLab.Dac.Design.VTDataEditor in '..\Net\CoreLab.Dac.Design.VTDataEditor.pas', + CoreLab.Dac.Design.Download in '..\Net\CoreLab.Dac.Design.Download.pas', + CoreLab.Dac.Design.DBToolsClient in '..\Net\CoreLab.Dac.Design.DBToolsClient.pas', + CoreLab.Dac.Design.DBToolsIntf in '..\Net\CoreLab.Dac.Design.DBToolsIntf.pas', + CoreLab.Dac.Design.HelpUtils in '..\Net\CoreLab.Dac.Design.HelpUtils.pas'; + +[assembly: AssemblyTitle('Core Lab Data Access Components')] +[assembly: AssemblyDescription('Core Lab Data Access Components')] +[assembly: AssemblyConfiguration('')] +[assembly: AssemblyCompany('Core Lab')] +[assembly: AssemblyProduct('Core Lab Data Access Components')] +[assembly: AssemblyCopyright('')] +[assembly: AssemblyTrademark('')] +[assembly: AssemblyCulture('')] + +// The Delphi compiler controls the AssemblyTitleAttribute via the ExeDescription. +// You can set this in the IDE via the Project Options. +// Manually setting the AssemblyTitle attribute below will override the IDE +// setting. +// [assembly: AssemblyTitle('')] + + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion('6.10.1.4010')] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile('mykey.snk')], provided your output +// directory is the project directory (the default). +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile('CoreLab.snk')] +[assembly: AssemblyKeyName('')] +end. diff --git a/internal/4.10.0.10/1/Source/Delphi10/CoreLab.Dac.bdsproj b/internal/4.10.0.10/1/Source/Delphi10/CoreLab.Dac.bdsproj new file mode 100644 index 0000000..9f38f4b --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi10/CoreLab.Dac.bdsproj @@ -0,0 +1,208 @@ + + + + + + + + + + + + CoreLab.Dac.dpk + + + 7.0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 0 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + Borland.Vcl;CoreLab.Dac;CoreLab.VirtualTable + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + + True + True + True + + + + 0 + 0 + 1 + False + False + 4096 + 1048576 + 4194304 + Core Lab Data Access Components + False + False + + + + . + + . + ..\Net;..;d:\program files\common files\borland shared\bds\shared assemblies\4.0 + Borland.VclRtl;Borland.VclDbRtl;Borland.Vcl;Borland.Delphi + + + False + + + + + + False + + + + + + False + + True + False + + + True + False + 6 + 10 + 1 + 4010 + False + False + False + False + False + 1058 + 1251 + + + Core Lab + + 6.10.1.10 + + + + + DAC + 6.10.1.10 + + + + + $00000000 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/internal/4.10.0.10/1/Source/Delphi10/CoreLab.Dac.cfg b/internal/4.10.0.10/1/Source/Delphi10/CoreLab.Dac.cfg new file mode 100644 index 0000000..cd38992 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi10/CoreLab.Dac.cfg @@ -0,0 +1,40 @@ +-$A- +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-cg +-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-NSBorland.Vcl;CoreLab.Dac;CoreLab.VirtualTable +-H+ +-W+ +-M +-$M4096,1048576 +-K$00400000 +-N0"." +-LN"." +-U"..\Net;..;d:\program files\common files\borland shared\bds\shared assemblies\4.0" +-O"..\Net;..;d:\program files\common files\borland shared\bds\shared assemblies\4.0" +-I"..\Net;..;d:\program files\common files\borland shared\bds\shared assemblies\4.0" +-R"..\Net;..;d:\program files\common files\borland shared\bds\shared assemblies\4.0" diff --git a/internal/4.10.0.10/1/Source/Delphi10/CoreLab.Dac.dpk b/internal/4.10.0.10/1/Source/Delphi10/CoreLab.Dac.dpk new file mode 100644 index 0000000..ebee31e --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi10/CoreLab.Dac.dpk @@ -0,0 +1,108 @@ +package CoreLab.Dac; + +{$ALIGN 0} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Core Lab Data Access Components'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + Borland.Delphi, + Borland.Vcl, + Borland.VclDbRtl, + Borland.VclRtl; + +contains + CoreLab.Dac.VirtualTable in '..\Net\CoreLab.Dac.VirtualTable.pas', + CoreLab.Dac.CRParser in '..\Net\CoreLab.Dac.CRParser.pas', + CoreLab.Dac.DAConsts in '..\Net\CoreLab.Dac.DAConsts.pas', + CoreLab.Dac.DacVcl in '..\Net\CoreLab.Dac.DacVcl.pas', + CoreLab.Dac.DALoader in '..\Net\CoreLab.Dac.DALoader.pas', + CoreLab.Dac.DADump in '..\Net\CoreLab.Dac.DADump.pas', + CoreLab.Dac.DASQLMonitor in '..\Net\CoreLab.Dac.DASQLMonitor.pas', + CoreLab.Dac.DBAccess in '..\Net\CoreLab.Dac.DBAccess.pas', + CoreLab.Dac.DBMonitorClient in '..\Net\CoreLab.Dac.DBMonitorClient.pas', + CoreLab.Dac.DBMonitorIntf in '..\Net\CoreLab.Dac.DBMonitorIntf.pas', + CoreLab.Dac.MemData in '..\Net\CoreLab.Dac.MemData.pas', + CoreLab.Dac.MemDS in '..\Net\CoreLab.Dac.MemDS.pas', + CoreLab.Dac.MemUtils in '..\Net\CoreLab.Dac.MemUtils.pas', + CoreLab.Dac.CRAccess in '..\Net\CoreLab.Dac.CRAccess.pas', + CoreLab.Dac.CRConnectionPool in '..\Net\CoreLab.Dac.CRConnectionPool.pas', + CoreLab.Dac.DAScript in '..\Net\CoreLab.Dac.DAScript.pas', + CoreLab.Dac.CRBatchMove in '..\Net\CoreLab.Dac.CRBatchMove.pas', + CoreLab.Dac.Win32Timer in '..\Net\CoreLab.Dac.Win32Timer.pas'; + +[assembly: AssemblyTitle('Core Lab Data Access Components')] +[assembly: AssemblyDescription('Core Lab Data Access Components')] +[assembly: AssemblyConfiguration('')] +[assembly: AssemblyCompany('Core Lab')] +[assembly: AssemblyProduct('Core Lab Data Access Components')] +[assembly: AssemblyCopyright('')] +[assembly: AssemblyTrademark('')] +[assembly: AssemblyCulture('')] + +//[assembly: CLSCompliant(true)] + + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion('6.10.1.4010')] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory which is +// %Project Directory%\obj\. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile('CoreLab.snk')] +[assembly: AssemblyKeyName('')] + +end. diff --git a/internal/4.10.0.10/1/Source/Delphi10/CoreLab.Sdac.AdoNet.bdsproj b/internal/4.10.0.10/1/Source/Delphi10/CoreLab.Sdac.AdoNet.bdsproj new file mode 100644 index 0000000..528d68e --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi10/CoreLab.Sdac.AdoNet.bdsproj @@ -0,0 +1,187 @@ + + + + + + + + + + + + CoreLab.Sdac.AdoNet.dpk + + + + + + + + + + + + + + + 7.0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 0 + 1 + True + True + WinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + Borland.Vcl + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + True + False + False + 4096 + 1048576 + 4194304 + SQL Server Data Access Components + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 4 + 10 + 0 + 4010 + False + False + False + False + False + 1049 + 1251 + + + + + 4.10.0.10 + + + + + + 4.10.0.10 + + + + diff --git a/internal/4.10.0.10/1/Source/Delphi10/CoreLab.Sdac.AdoNet.cfg b/internal/4.10.0.10/1/Source/Delphi10/CoreLab.Sdac.AdoNet.cfg new file mode 100644 index 0000000..e048f42 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi10/CoreLab.Sdac.AdoNet.cfg @@ -0,0 +1,39 @@ +-$A- +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-cg +-vn +-AWinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-NSBorland.Vcl;CoreLab.Dac;CoreLab.Sdac +-H+ +-W+ +-M +-$M4096,1048576 +-K$00400000 +-U"..\;..\Net" +-O"..\;..\Net" +-I"..\;..\Net" +-R"..\;..\Net" diff --git a/internal/4.10.0.10/1/Source/Delphi10/CoreLab.Sdac.AdoNet.dpk b/internal/4.10.0.10/1/Source/Delphi10/CoreLab.Sdac.AdoNet.dpk new file mode 100644 index 0000000..c4e2396 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi10/CoreLab.Sdac.AdoNet.dpk @@ -0,0 +1,99 @@ +package CoreLab.Sdac.AdoNet; + + +{$ALIGN 0} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'SQL Server Data Access Components'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + Borland.Delphi, + System.Data, + Borland.VclDbRtl, + CoreLab.Sdac, + System.Drawing; + +contains + CoreLab.Dac.DataAdapter {CoreLab.Dac.DataAdapter.DADataAdapter: System.Data.Common.DbDataAdapter}, + CoreLab.Sdac.DataAdapter in '..\Net\CoreLab.Sdac.DataAdapter.pas' {CoreLab.Sdac.DataAdapter.MyDataAdapter: CoreLab.Dac.DataAdapter.DADataAdapter}; + +[assembly: AssemblyTitle('CoreLab.Sdac.AdoNet')] +[assembly: AssemblyDescription('')] +[assembly: AssemblyConfiguration('')] +[assembly: AssemblyCompany('Core Lab')] +[assembly: AssemblyProduct('SQL Server Data Access Components')] +[assembly: AssemblyCopyright('')] +[assembly: AssemblyTrademark('')] +[assembly: AssemblyCulture('')] + + +// The Delphi compiler controls the AssemblyTitleAttribute via the ExeDescription. +// You can set this in the IDE via the Project Options. +// Manually setting the AssemblyTitle attribute below will override the IDE +// setting. +// [assembly: AssemblyTitle('')] + + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion('4.10.0.4010')] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile('mykey.snk')], provided your output +// directory is the project directory (the default). +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile('CoreLab.snk')] +[assembly: AssemblyKeyName('')] + +end. diff --git a/internal/4.10.0.10/1/Source/Delphi10/CoreLab.Sdac.Design.bdsproj b/internal/4.10.0.10/1/Source/Delphi10/CoreLab.Sdac.Design.bdsproj new file mode 100644 index 0000000..151b6c2 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi10/CoreLab.Sdac.Design.bdsproj @@ -0,0 +1,204 @@ + + + + + + + + + + + + CoreLab.Sdac.Design.dpk + + + 7.0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 0 + 1 + True + True + WinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + Borland.Vcl;CoreLab.Dac;CoreLab.Sdac;CoreLab.Dac.Design;CoreLab.Sdac.Design + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + + + 0 + 0 + 1 + False + False + False + 4096 + 1048576 + 4194304 + SQL Server Data Access Components + + + + . + + . + d:\program files\common files\borland shared\bds\shared assemblies\4.0;d:\program files\borland\bds\4.0\bin;d:\projects\delphi\Dac\source\delphi10;d:\Projects\Delphi\Sdac\Source\Delphi10;d:\winnt\microsoft.net\framework\v1.1.4322;..\Net;..;..\..\..\Dac\Source\Net;..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi10;d:\projects\delphi\Sdac\source\delphi10;d:\projects\delphi\dac\source\delphi10;d:\projects\delphi\sdac\source\delphi10;d:\Projects\Delphi\dac\source\delphi10;d:\Projects\Delphi\Sdac\Source\Delphi10;d:\windows\microsoft.net\framework\v1.1.4322;d:\program files\corelab\mydac for delphi10\bin;D:\Projects\Delphi\Sdac\Source\Delphi10 + D:\Projects\Delphi\Sdac\Source\Delphi10\CoreLab.Sdac.AdoNet.dll;d:\windows\microsoft.net\framework\v1.1.4322\System.Windows.Forms.dll;D:\Projects\Delphi\Sdac\Source\Delphi10\CoreLab.Sdac.dll;d:\program files\corelab\mydac for delphi10\bin\CoreLab.Dac.Design.dll;d:\program files\borland\bds\4.0\bin\Borland.Vcl.Design.Standard.dll;d:\program files\borland\bds\4.0\bin\Borland.Vcl.Design.DbRtl.dll;d:\program files\borland\bds\4.0\bin\Borland.Studio.Vcl.Design.dll;d:\program files\borland\bds\4.0\bin\Borland.Studio.ToolsAPI.dll;d:\program files\common files\borland shared\bds\shared assemblies\4.0\Borland.Delphi.dll + MYBUILDER;SDAC + + False + + + + + + False + + + + + + False + + + + $00000000 + + + + True + False + 4 + 10 + 0 + 4010 + False + False + False + False + False + + + + + + + 4.10.0.10 + + + + + + 4.10.0.10 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/internal/4.10.0.10/1/Source/Delphi10/CoreLab.Sdac.Design.cfg b/internal/4.10.0.10/1/Source/Delphi10/CoreLab.Sdac.Design.cfg new file mode 100644 index 0000000..1f9c419 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi10/CoreLab.Sdac.Design.cfg @@ -0,0 +1,41 @@ +-$A- +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J- +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-cg +-AWinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-NSBorland.Vcl;CoreLab.Dac;CoreLab.Sdac;CoreLab.Dac.Design;CoreLab.Sdac.Design +-H+ +-W+ +-M +-$M4096,1048576 +-K$00400000 +-N"." +-LN"." +-U"..\Design;.\;..\Net;..\;..\..\..\Dac\Source\Net;..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi10;d:\program files\common files\borland shared\bds\shared assemblies\4.0;d:\program files\borland\bds\4.0\bin;d:\projects\dexter\sdac\source\delphi10" +-O"..\Design;.\;..\Net;..\;..\..\..\Dac\Source\Net;..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi10;d:\program files\common files\borland shared\bds\shared assemblies\4.0;d:\program files\borland\bds\4.0\bin;d:\projects\dexter\sdac\source\delphi10" +-I"..\Design;.\;..\Net;..\;..\..\..\Dac\Source\Net;..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi10;d:\program files\common files\borland shared\bds\shared assemblies\4.0;d:\program files\borland\bds\4.0\bin;d:\projects\dexter\sdac\source\delphi10" +-R"..\Design;.\;..\Net;..\;..\..\..\Dac\Source\Net;..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi10;d:\program files\common files\borland shared\bds\shared assemblies\4.0;d:\program files\borland\bds\4.0\bin;d:\projects\dexter\sdac\source\delphi10" +-DSDAC diff --git a/internal/4.10.0.10/1/Source/Delphi10/CoreLab.Sdac.Design.dpk b/internal/4.10.0.10/1/Source/Delphi10/CoreLab.Sdac.Design.dpk new file mode 100644 index 0000000..7292d2c --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi10/CoreLab.Sdac.Design.dpk @@ -0,0 +1,115 @@ +package CoreLab.Sdac.Design; + + +{$ALIGN 0} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'SQL Server Data Access Components'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} +{$DEFINE SDAC} + +requires + Borland.Delphi, + Borland.Studio.ToolsAPI, + Borland.Studio.Vcl.Design, + Borland.Vcl.Design.DbRtl, + Borland.Vcl.Design.Standard, + CoreLab.Dac.Design, + CoreLab.Sdac, + System.Windows.Forms, + CoreLab.Sdac.AdoNet; + +contains + CoreLab.Sdac.Design.SdacAbout in '..\Net\CoreLab.Sdac.Design.SdacAbout.pas', + CoreLab.Sdac.Design.MSConnectionEditor in '..\Net\CoreLab.Sdac.Design.MSConnectionEditor.pas', + CoreLab.Sdac.Design.MSParamsFrame in '..\Net\CoreLab.Sdac.Design.MSParamsFrame.pas', + CoreLab.Sdac.Design.MSQueryEditor in '..\Net\CoreLab.Sdac.Design.MSQueryEditor.pas', + CoreLab.Sdac.Design.MSNamesEditor in '..\Net\CoreLab.Sdac.Design.MSNamesEditor.pas', + CoreLab.Sdac.Design.MSDumpEditor in '..\Net\CoreLab.Sdac.Design.MSDumpEditor.pas', + CoreLab.Sdac.Design.MSSPCallFrame in '..\Net\CoreLab.Sdac.Design.MSSPCallFrame.pas', + CoreLab.Sdac.Design.MSSQLEditor in '..\Net\CoreLab.Sdac.Design.MSSQLEditor.pas', + CoreLab.Sdac.Design.MSStoredProcEditor in '..\Net\CoreLab.Sdac.Design.MSStoredProcEditor.pas', + CoreLab.Sdac.Design.MSUpdateSQLEditor in '..\Net\CoreLab.Sdac.Design.MSUpdateSQLEditor.pas', + CoreLab.Sdac.Design.MSDesign in '..\Net\CoreLab.Sdac.Design.MSDesign.pas', + CoreLab.Sdac.Design.MSDesignUtils in '..\Net\CoreLab.Sdac.Design.MSDesignUtils.pas', + CoreLab.Sdac.Design.MSMenu in '..\Net\CoreLab.Sdac.Design.MSMenu.pas', + CoreLab.Sdac.Design.MSReg in '..\Net\CoreLab.Sdac.Design.MSReg.pas'; + +[assembly: AssemblyTitle('SQL Server Data Access Components')] +[assembly: AssemblyDescription('SQL Server Data Access Components')] +[assembly: AssemblyConfiguration('')] +[assembly: AssemblyCompany('Core Lab')] +[assembly: AssemblyProduct('SQL Server Data Access Components')] +[assembly: AssemblyCopyright('')] +[assembly: AssemblyTrademark('')] +[assembly: AssemblyCulture('')] + + +// The Delphi compiler controls the AssemblyTitleAttribute via the ExeDescription. +// You can set this in the IDE via the Project Options. +// Manually setting the AssemblyTitle attribute below will override the IDE +// setting. +// [assembly: AssemblyTitle('')] + + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion('4.10.0.4010')] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile('mykey.snk')], provided your output +// directory is the project directory (the default). +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile('CoreLab.snk')] +[assembly: AssemblyKeyName('')] +end. diff --git a/internal/4.10.0.10/1/Source/Delphi10/CoreLab.Sdac.bdsproj b/internal/4.10.0.10/1/Source/Delphi10/CoreLab.Sdac.bdsproj new file mode 100644 index 0000000..547476b --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi10/CoreLab.Sdac.bdsproj @@ -0,0 +1,272 @@ + + + + + + + + + + + + CoreLab.Sdac.dpk + + + 7.0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 0 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + CoreLab.Sdac;CoreLab.Dac;Borland.Vcl + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + + True + + + 0 + 0 + 1 + False + False + 4096 + 1048576 + 4194304 + SQL Server Data Access Components + False + + + + . + + . + ..\Net;..;..\..\..\Dac\Source\Net;..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi10;d:\program files\common files\borland shared\bds\shared assemblies\4.0;d:\projects\delphi\dac\source\delphi10 + CoreLab.Dac;Borland.VclRtl;Borland.VclDbRtl;Borland.Vcl;Borland.Delphi + + + False + + + + + + False + + + + + + False + + + True + False + 4 + 10 + 0 + 4010 + False + False + False + False + False + + + + + Core Lab + + 4.10.0.10 + + + + + DAC + 4.10.0.10 + + + + + $00000000 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/internal/4.10.0.10/1/Source/Delphi10/CoreLab.Sdac.cfg b/internal/4.10.0.10/1/Source/Delphi10/CoreLab.Sdac.cfg new file mode 100644 index 0000000..71384c6 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi10/CoreLab.Sdac.cfg @@ -0,0 +1,42 @@ +-$A- +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-cg +-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-NSCoreLab.Sdac;CoreLab.Dac;Borland.Vcl +-H+ +-W+ +-M +-$M4096,1048576 +-K$00400000 +-N"." +-LN"." +-U"..\Net;..;..\..\..\Dac\Source\Net;..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi10;d:\program files\common files\borland shared\bds\shared assemblies\4.0;d:\projects\delphi\dac\source\delphi10" +-O"..\Net;..;..\..\..\Dac\Source\Net;..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi10;d:\program files\common files\borland shared\bds\shared assemblies\4.0;d:\projects\delphi\dac\source\delphi10" +-I"..\Net;..;..\..\..\Dac\Source\Net;..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi10;d:\program files\common files\borland shared\bds\shared assemblies\4.0;d:\projects\delphi\dac\source\delphi10" +-R"..\Net;..;..\..\..\Dac\Source\Net;..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi10;d:\program files\common files\borland shared\bds\shared assemblies\4.0;d:\projects\delphi\dac\source\delphi10" +-DSDAC +-Z diff --git a/internal/4.10.0.10/1/Source/Delphi10/CoreLab.Sdac.dpk b/internal/4.10.0.10/1/Source/Delphi10/CoreLab.Sdac.dpk new file mode 100644 index 0000000..016b218 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi10/CoreLab.Sdac.dpk @@ -0,0 +1,107 @@ +package CoreLab.Sdac; + +{$ALIGN 0} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'SQL Server Data Access Components'} +{$RUNONLY} +{$IMPLICITBUILD OFF} +{$DEFINE SDAC} + +requires + Borland.Delphi, + Borland.Vcl, + Borland.VclDbRtl, + Borland.VclRtl, + CoreLab.Dac; + +contains + CoreLab.Sdac.SdacVcl in '..\Net\CoreLab.Sdac.SdacVcl.pas', + CoreLab.Sdac.OLEDBIntf in '..\Net\CoreLab.Sdac.OLEDBIntf.pas', + CoreLab.Sdac.MSAccess in '..\Net\CoreLab.Sdac.MSAccess.pas', + CoreLab.Sdac.MSConnectForm in '..\Net\CoreLab.Sdac.MSConnectForm.pas', + CoreLab.Sdac.MSConnectionPool in '..\Net\CoreLab.Sdac.MSConnectionPool.pas', + CoreLab.Sdac.MSConsts in '..\Net\CoreLab.Sdac.MSConsts.pas', + CoreLab.Sdac.MSParser in '..\Net\CoreLab.Sdac.MSParser.pas', + CoreLab.Sdac.MSLoader in '..\Net\CoreLab.Sdac.MSLoader.pas', + CoreLab.Sdac.MSDump in '..\Net\CoreLab.Sdac.MSDump.pas', + CoreLab.Sdac.MSScript in '..\Net\CoreLab.Sdac.MSScript.pas', + CoreLab.Sdac.CRThread in '..\Net\CoreLab.Sdac.CRThread.pas', + CoreLab.Sdac.MSServiceBroker in '..\Net\CoreLab.Sdac.MSServiceBroker.pas', + CoreLab.Sdac.MSSQLMonitor in '..\Net\CoreLab.Sdac.MSSQLMonitor.pas', + CoreLab.Sdac.OLEDBAccess in '..\Net\CoreLab.Sdac.OLEDBAccess.pas', + CoreLab.Sdac.OLEDBC in '..\Net\CoreLab.Sdac.OLEDBC.pas'; + +[assembly: AssemblyTitle('SQL Server Data Access Components')] +[assembly: AssemblyDescription('SQL Server Data Access Components')] +[assembly: AssemblyConfiguration('')] +[assembly: AssemblyCompany('Core Lab')] +[assembly: AssemblyProduct('SQL Server Data Access Components')] +[assembly: AssemblyCopyright('')] +[assembly: AssemblyTrademark('')] +[assembly: AssemblyCulture('')] + +//[assembly: CLSCompliant(true)] + + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion('4.10.0.4010')] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory which is +// %Project Directory%\obj\. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile('CoreLab.snk')] +[assembly: AssemblyKeyName('')] + +end. diff --git a/internal/4.10.0.10/1/Source/Delphi10/Make.bat b/internal/4.10.0.10/1/Source/Delphi10/Make.bat new file mode 100644 index 0000000..6515d23 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi10/Make.bat @@ -0,0 +1,11 @@ +@echo off +rem ********************************************************************** +rem * +rem * Sdac for Delphi 10 +rem * +rem ********************************************************************** + +set IdeDir="D:\Program Files\Borland\BDS\4.0 +del /Q/S SDAC\*.* +call ..\Make.bat Delphi 10 WIN32 +call ..\Make.bat Delphi 10 CLR diff --git a/internal/4.10.0.10/1/Source/Delphi10/dac100.bdsproj b/internal/4.10.0.10/1/Source/Delphi10/dac100.bdsproj new file mode 100644 index 0000000..94fbab2 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi10/dac100.bdsproj @@ -0,0 +1,178 @@ + + + + + + + + + + + + dac100.dpk + + + 7.0 + + + 8 + 0 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 0 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + + + + 0 + 44 + 1 + False + False + False + 16384 + 1048576 + 4194304 + Core Lab Data Access Components + False + + + + . + + . + ..\ + + + + False + + + + + + False + + + + + + False + + True False + + + + $00000000 + + + + True + False + 6 + 10 + 1 + 4010 + False + False + False + False + False + 1033 + 1252 + + + 6.10.1.10 + Core Lab + + + + + + DAC + 6.10.1.10 + + + diff --git a/internal/4.10.0.10/1/Source/Delphi10/dac100.cfg b/internal/4.10.0.10/1/Source/Delphi10/dac100.cfg new file mode 100644 index 0000000..777026f --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi10/dac100.cfg @@ -0,0 +1,45 @@ +-$A8 +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-JL +-cg +-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-H+ +-W+ +-M +-$M16384,1048576 +-K$00400000 +-N0"." +-LE"." +-LN"." +-U"..\" +-O"..\" +-I"..\" +-R"..\" +-Z +-w-UNSAFE_TYPE +-w-UNSAFE_CODE +-w-UNSAFE_CAST diff --git a/internal/4.10.0.10/1/Source/Delphi10/dac100.dpk b/internal/4.10.0.10/1/Source/Delphi10/dac100.dpk new file mode 100644 index 0000000..1da0e60 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi10/dac100.dpk @@ -0,0 +1,52 @@ +package dac100; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Core Lab Data Access Components'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl; + +contains + CRAccess in '..\CRAccess.pas', + DALoader in '..\DALoader.pas', + DADump in '..\DADump.pas', + DAScript in '..\DAScript.pas', + CRParser in '..\CRParser.pas', + DAConsts in '..\DAConsts.pas', + DBMonitorIntf in '..\DBMonitorIntf.pas', + DBMonitorClient in '..\DBMonitorClient.pas', + DASQLMonitor in '..\DASQLMonitor.pas', + DBAccess in '..\DBAccess.pas', + MemData in '..\MemData.pas', + MemDS in '..\MemDS.pas', + VirtualTable in '..\VirtualTable.pas', + DAVersionInfo in '..\DAVersionInfo.pas', + CLRClasses in '..\CLRClasses.pas', + MemUtils in '..\MemUtils.pas', + CRBatchMove in '..\CRBatchMove.pas'; + +end. diff --git a/internal/4.10.0.10/1/Source/Delphi10/dac100.res b/internal/4.10.0.10/1/Source/Delphi10/dac100.res new file mode 100644 index 0000000..d50d7f1 Binary files /dev/null and b/internal/4.10.0.10/1/Source/Delphi10/dac100.res differ diff --git a/internal/4.10.0.10/1/Source/Delphi10/dacvcl100.bdsproj b/internal/4.10.0.10/1/Source/Delphi10/dacvcl100.bdsproj new file mode 100644 index 0000000..9acb470 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi10/dacvcl100.bdsproj @@ -0,0 +1,179 @@ + + + + + + + + + + + + dacvcl100.dpk + + + 7.0 + + + 8 + 0 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 0 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + + + + 0 + 44 + 1 + False + False + False + 16384 + 1048576 + 4194304 + Core Lab Data Access GUI related Components + False + + + + . + + . + ..\ + + + + False + + + + + + False + + + + + + False + + True + False + + + + $00000000 + + + + True + False + 6 + 10 + 1 + 4010 + False + False + False + False + False + 1033 + 1252 + + + Core Lab + + 6.10.1.10 + + + + + DAC + 6.10.1.10 + + + diff --git a/internal/4.10.0.10/1/Source/Delphi10/dacvcl100.cfg b/internal/4.10.0.10/1/Source/Delphi10/dacvcl100.cfg new file mode 100644 index 0000000..777026f --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi10/dacvcl100.cfg @@ -0,0 +1,45 @@ +-$A8 +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-JL +-cg +-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-H+ +-W+ +-M +-$M16384,1048576 +-K$00400000 +-N0"." +-LE"." +-LN"." +-U"..\" +-O"..\" +-I"..\" +-R"..\" +-Z +-w-UNSAFE_TYPE +-w-UNSAFE_CODE +-w-UNSAFE_CAST diff --git a/internal/4.10.0.10/1/Source/Delphi10/dacvcl100.dpk b/internal/4.10.0.10/1/Source/Delphi10/dacvcl100.dpk new file mode 100644 index 0000000..bf73414 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi10/dacvcl100.dpk @@ -0,0 +1,36 @@ +package dacvcl100; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Core Lab Data Access GUI related Components'} +{$IMPLICITBUILD OFF} + +requires + rtl, + dac100, + vcl; + +contains + DacVcl in '..\DacVcl.pas'; + +end. diff --git a/internal/4.10.0.10/1/Source/Delphi10/dacvcl100.res b/internal/4.10.0.10/1/Source/Delphi10/dacvcl100.res new file mode 100644 index 0000000..d50d7f1 Binary files /dev/null and b/internal/4.10.0.10/1/Source/Delphi10/dacvcl100.res differ diff --git a/internal/4.10.0.10/1/Source/Delphi10/dcldac100.bdsproj b/internal/4.10.0.10/1/Source/Delphi10/dcldac100.bdsproj new file mode 100644 index 0000000..b245c68 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi10/dcldac100.bdsproj @@ -0,0 +1,179 @@ + + + + + + + + + + + + dcldac100.dpk + + + 7.0 + + + 8 + 0 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 0 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + + + + 0 + 0 + 1 + False + False + False + 16384 + 1048576 + 4194304 + Core Lab Data Access Components + False + + + + . + + . + ..\;..\Design\;D:\Program Files\Borland\BDS\4.0\source\ToolsAPI\ + + + ..\Design\ + False + + + + + + False + + + + + + False + + True + False + + + + $00000000 + + + + True + False + 6 + 10 + 1 + 4010 + False + False + False + False + False + 1049 + 1251 + + + Core Lab + + 6.10.1.10 + + + + + DAC + 6.10.1.10 + + + diff --git a/internal/4.10.0.10/1/Source/Delphi10/dcldac100.cfg b/internal/4.10.0.10/1/Source/Delphi10/dcldac100.cfg new file mode 100644 index 0000000..87fc627 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi10/dcldac100.cfg @@ -0,0 +1,44 @@ +-$A8 +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J- +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-cg +-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-H+ +-W+ +-M +-$M16384,1048576 +-K$00400000 +-N0"." +-LE"." +-LN"." +-U"..\;..\Design\" +-O"..\;..\Design\" +-I"..\;..\Design\" +-R"..\;..\Design\" +-Z +-w-UNSAFE_TYPE +-w-UNSAFE_CODE +-w-UNSAFE_CAST diff --git a/internal/4.10.0.10/1/Source/Delphi10/dcldac100.dpk b/internal/4.10.0.10/1/Source/Delphi10/dcldac100.dpk new file mode 100644 index 0000000..073a252 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi10/dcldac100.dpk @@ -0,0 +1,46 @@ +package dcldac100; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Core Lab Data Access Components'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dac100, + dcldb, + dacvcl100, + vcl, + dbrtl, + vcldb, + vclactnband; + +contains + DacReg in '..\Design\DacReg.pas', + VTDesign in '..\Design\VTDesign.pas', + DAMenu in '..\Design\DAMenu.pas', + DADesign in '..\Design\DADesign.pas', + Download in '..\Design\Download.pas'; + +end. diff --git a/internal/4.10.0.10/1/Source/Delphi10/dcldac100.res b/internal/4.10.0.10/1/Source/Delphi10/dcldac100.res new file mode 100644 index 0000000..d50d7f1 Binary files /dev/null and b/internal/4.10.0.10/1/Source/Delphi10/dcldac100.res differ diff --git a/internal/4.10.0.10/1/Source/Delphi10/dclsdac100.bdsproj b/internal/4.10.0.10/1/Source/Delphi10/dclsdac100.bdsproj new file mode 100644 index 0000000..0379d2a --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi10/dclsdac100.bdsproj @@ -0,0 +1,172 @@ + + + + + + + + + + + + dclsdac100.dpk + + + 7.0 + + + 8 + 0 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 0 + 1 + True + True + WinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + + + 0 + 0 + 1 + False + False + False + 4096 + 1048576 + 4194304 + SQL Server Data Access Components + + + . + . + + + d:\windows\microsoft.net\framework\v1.1.4322;d:\program files\common files\borland shared\bds\shared assemblies\4.0;d:\Projects\Delphi\Dac\Source\;d:\Projects\Delphi\SDac\Source\;d:\Projects\Delphi\Dac\Source\Delphi10 + + sdac;MYBUILDER + + False + + + + + + False + + + + + + False + + + + $00000000 + + + + True + False + 4 + 10 + 0 + 4010 + False + False + False + False + False + + + + + + + 4.10.0.10 + + + + + + 4.10.0.10 + + + diff --git a/internal/4.10.0.10/1/Source/Delphi10/dclsdac100.cfg b/internal/4.10.0.10/1/Source/Delphi10/dclsdac100.cfg new file mode 100644 index 0000000..b8cf74c --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi10/dclsdac100.cfg @@ -0,0 +1,41 @@ +-$A8 +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-cg +-AWinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-H+ +-W+ +-M +-$M4096,1048576 +-K$00400000 +-N"." +-LN"." +-U"..\Design;..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi10;..\;D:\Program Files\Borland\BDS\4.0\source\ToolsAPI\" +-O"..\Design;..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi10;..\;D:\Program Files\Borland\BDS\4.0\source\ToolsAPI\" +-I"..\Design;..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi10;..\;D:\Program Files\Borland\BDS\4.0\source\ToolsAPI\" +-R"..\Design;..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi10;..\;D:\Program Files\Borland\BDS\4.0\source\ToolsAPI\" +-Dsdac +-Z diff --git a/internal/4.10.0.10/1/Source/Delphi10/dclsdac100.dpk b/internal/4.10.0.10/1/Source/Delphi10/dclsdac100.dpk new file mode 100644 index 0000000..ec7bd97 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi10/dclsdac100.dpk @@ -0,0 +1,44 @@ + +package dclsdac100; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'SQL Server Data Access Components'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} +{$DEFINE sdac} + +requires + sdac100, + dcldb, + dcldac100, + vcljpg, + sdacvcl100, + designide; + +contains + MSDesign in '..\Design\MSDesign.pas', + MSReg in '..\Design\MSReg.pas', + MSMenu in '..\Design\MSMenu.pas'; + +end. diff --git a/internal/4.10.0.10/1/Source/Delphi10/dclsdac100.res b/internal/4.10.0.10/1/Source/Delphi10/dclsdac100.res new file mode 100644 index 0000000..1c23367 Binary files /dev/null and b/internal/4.10.0.10/1/Source/Delphi10/dclsdac100.res differ diff --git a/internal/4.10.0.10/1/Source/Delphi10/sdac100.bdsproj b/internal/4.10.0.10/1/Source/Delphi10/sdac100.bdsproj new file mode 100644 index 0000000..009717e --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi10/sdac100.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + sdac100.dpk + + + 7.0 + + + 8 + 0 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 0 + 1 + True + True + WinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True True + True + + + + 0 + 44 + 1 + False + False + False + 4096 + 1048576 + 4194304 + SQL Server Data Access Components False + + + . + . + . + + d:\windows\microsoft.net\framework\v1.1.4322;d:\program files\common files\borland shared\bds\shared assemblies\4.0;d:\Projects\Delphi\Dac\Source\;d:\Projects\Delphi\SDac\Source\ + + SDAC + + False + + + + + + False + + + + + + False + True + False + + + + $00000000 + + + + True + False + 4 + 10 + 0 + 4010 + False + False + False + False + False 1033 + 1252 + + + Core Lab + + 4.10.0.10 + + + + + Sdac + 4.10.0.10 + + + diff --git a/internal/4.10.0.10/1/Source/Delphi10/sdac100.cfg b/internal/4.10.0.10/1/Source/Delphi10/sdac100.cfg new file mode 100644 index 0000000..b48f8c5 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi10/sdac100.cfg @@ -0,0 +1,42 @@ +-$A8 +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-JL +-cg +-AWinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-H+ +-W+ +-M +-$M4096,1048576 +-K$00400000 +-N0"." +-LN"." +-U"..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi10;..\" +-O"..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi10;..\" +-I"..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi10;..\" +-R"..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi10;..\" +-DSDAC +-Z diff --git a/internal/4.10.0.10/1/Source/Delphi10/sdac100.dpk b/internal/4.10.0.10/1/Source/Delphi10/sdac100.dpk new file mode 100644 index 0000000..dc9f910 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi10/sdac100.dpk @@ -0,0 +1,56 @@ + +////////////////////////////////////////////////// +// SQL Server Data Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +// SDAC Package for Delphi 9 +////////////////////////////////////////////////// + +package sdac100; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'SQL Server Data Access Components'} +{$RUNONLY} +{$IMPLICITBUILD OFF} +{$DEFINE SDAC} + +requires + vcl, + vcldb, + dac100, + rtl, + dbrtl; + +contains + MSAccess in '..\MSAccess.pas', + MSConnectionPool in '..\MSConnectionPool.pas', + MSConsts in '..\MSConsts.pas', + MSSQLMonitor in '..\MSSQLMonitor.pas', + OLEDBAccess in '..\OLEDBAccess.pas', + OLEDBC in '..\OLEDBC.pas', + OLEDBIntf in '..\OLEDBIntf.pas', + MSLoader in '..\MSLoader.pas', + MSDump in '..\MSDump.pas', + MSScript in '..\MSScript.pas'; + +end. diff --git a/internal/4.10.0.10/1/Source/Delphi10/sdac100.res b/internal/4.10.0.10/1/Source/Delphi10/sdac100.res new file mode 100644 index 0000000..1c23367 Binary files /dev/null and b/internal/4.10.0.10/1/Source/Delphi10/sdac100.res differ diff --git a/internal/4.10.0.10/1/Source/Delphi10/sdacvcl100.bdsproj b/internal/4.10.0.10/1/Source/Delphi10/sdacvcl100.bdsproj new file mode 100644 index 0000000..a2ccbac --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi10/sdacvcl100.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + sdacvcl100.dpk + + + 7.0 + + + 8 + 0 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 0 + 1 + True + True + WinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True True + True + + + + 0 + 44 + 1 + False + False + False + 4096 + 1048576 + 4194304 + SQL Server Data Access GUI related Components False + + + . + . + + + d:\windows\microsoft.net\framework\v1.1.4322;d:\program files\common files\borland shared\bds\shared assemblies\4.0;d:\Projects\Delphi\Dac\Source\;d:\Projects\Delphi\SDac\Source\ + + SDAC + + False + + + + + + False + + + + + + False + True + False + + + + $00000000 + + + + True + False + 4 + 10 + 0 + 4010 + False + False + False + False + False 1033 + 1252 + + + 4.10.0.10 + Core Lab + + + + + + Sdac + 4.10.0.10 + + + diff --git a/internal/4.10.0.10/1/Source/Delphi10/sdacvcl100.cfg b/internal/4.10.0.10/1/Source/Delphi10/sdacvcl100.cfg new file mode 100644 index 0000000..b48f8c5 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi10/sdacvcl100.cfg @@ -0,0 +1,42 @@ +-$A8 +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-JL +-cg +-AWinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-H+ +-W+ +-M +-$M4096,1048576 +-K$00400000 +-N0"." +-LN"." +-U"..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi10;..\" +-O"..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi10;..\" +-I"..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi10;..\" +-R"..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi10;..\" +-DSDAC +-Z diff --git a/internal/4.10.0.10/1/Source/Delphi10/sdacvcl100.dpk b/internal/4.10.0.10/1/Source/Delphi10/sdacvcl100.dpk new file mode 100644 index 0000000..e76573a --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi10/sdacvcl100.dpk @@ -0,0 +1,37 @@ +package sdacvcl100; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'SQL Server Data Access GUI related Components'} +{$IMPLICITBUILD OFF} +{$DEFINE SDAC} + +requires + rtl, + dacvcl100, + sdac100; + +contains + sdacVcl in '..\sdacVcl.pas'; + +end. diff --git a/internal/4.10.0.10/1/Source/Delphi10/sdacvcl100.res b/internal/4.10.0.10/1/Source/Delphi10/sdacvcl100.res new file mode 100644 index 0000000..1c23367 Binary files /dev/null and b/internal/4.10.0.10/1/Source/Delphi10/sdacvcl100.res differ diff --git a/internal/4.10.0.10/1/Source/Delphi11/Make.bat b/internal/4.10.0.10/1/Source/Delphi11/Make.bat new file mode 100644 index 0000000..f201986 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi11/Make.bat @@ -0,0 +1,10 @@ +@echo off +rem ********************************************************************** +rem * +rem * Sdac for Delphi 11 +rem * +rem ********************************************************************** + +set IdeDir="D:\Program Files\CodeGear\RAD Studio\5.0 +del /Q/S SDAC\*.* +call ..\Make.bat Delphi 11 WIN32 diff --git a/internal/4.10.0.10/1/Source/Delphi11/SDAC105_Group.groupproj b/internal/4.10.0.10/1/Source/Delphi11/SDAC105_Group.groupproj new file mode 100644 index 0000000..9250d51 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi11/SDAC105_Group.groupproj @@ -0,0 +1,84 @@ + + + {aa1a37fc-d9bf-4b89-af0b-484b89d53467} + + + + + + + + + + + + Default.Personality + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/internal/4.10.0.10/1/Source/Delphi11/dac105.bdsproj b/internal/4.10.0.10/1/Source/Delphi11/dac105.bdsproj new file mode 100644 index 0000000..eb90f7e --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi11/dac105.bdsproj @@ -0,0 +1,182 @@ + + + + + + + + + + + + dac105.dpk + + + 7.0 + + + 8 + 0 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 0 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + + + + 0 + 44 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + Core Lab Data Access Components + + + + + . + + + + + + False + + + + + + False + + + True + False + + + False + + + True + False + 6 + 10 + 1 + 5010 + False + False + False + False + False + 1033 + 1252 + + + Core Lab + + 6.10.1.10 + + + + + DAC + 6.10.1.10 + + + + diff --git a/internal/4.10.0.10/1/Source/Delphi11/dac105.bpi b/internal/4.10.0.10/1/Source/Delphi11/dac105.bpi new file mode 100644 index 0000000..a757701 Binary files /dev/null and b/internal/4.10.0.10/1/Source/Delphi11/dac105.bpi differ diff --git a/internal/4.10.0.10/1/Source/Delphi11/dac105.cfg b/internal/4.10.0.10/1/Source/Delphi11/dac105.cfg new file mode 100644 index 0000000..1342a96 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi11/dac105.cfg @@ -0,0 +1,42 @@ +-$A8 +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-JL +-cg +-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-H+ +-W+ +-M +-$M16384,1048576 +-K$00400000 +-N0"." +-LE"." +-LN"." +-U"..\" +-O"..\" +-I"..\" +-R"..\" +-Z diff --git a/internal/4.10.0.10/1/Source/Delphi11/dac105.dpk b/internal/4.10.0.10/1/Source/Delphi11/dac105.dpk new file mode 100644 index 0000000..f26fa9f --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi11/dac105.dpk @@ -0,0 +1,53 @@ +package dac105; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Core Lab Data Access Components'} +{$RUNONLY} +{$IMPLICITBUILD OFF} +{$DEFINE RELEASE} + +requires + rtl, + dbrtl; + +contains + CRAccess in '..\CRAccess.pas', + DALoader in '..\DALoader.pas', + DADump in '..\DADump.pas', + DAScript in '..\DAScript.pas', + CRParser in '..\CRParser.pas', + DAConsts in '..\DAConsts.pas', + DBMonitorIntf in '..\DBMonitorIntf.pas', + DBMonitorClient in '..\DBMonitorClient.pas', + DASQLMonitor in '..\DASQLMonitor.pas', + DBAccess in '..\DBAccess.pas', + MemData in '..\MemData.pas', + MemDS in '..\MemDS.pas', + VirtualTable in '..\VirtualTable.pas', + DAVersionInfo in '..\DAVersionInfo.pas', + CLRClasses in '..\CLRClasses.pas', + MemUtils in '..\MemUtils.pas', + CRBatchMove in '..\CRBatchMove.pas'; + +end. diff --git a/internal/4.10.0.10/1/Source/Delphi11/dac105.dproj b/internal/4.10.0.10/1/Source/Delphi11/dac105.dproj new file mode 100644 index 0000000..5915adf --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi11/dac105.dproj @@ -0,0 +1,558 @@ + + + {3e934519-3666-4902-aa40-eb29eed797ea} + dac105.dpk + Release + AnyCPU + DCC32 + ..\..\Lib\D11\dac105.bpl + + + 7.0 + False + True + False + 0 + ..\..\Lib\D11 + RELEASE + ..\..\Lib\D11 + ..\..\Lib\D11 + ..\..\Lib\D11 + ..\..\Lib\D11 + ..\..\Lib\D11;..\;..\Design + ..\..\Lib\D11;..\;..\Design + ..\..\Lib\D11;..\;..\Design + ..\..\Lib\D11;..\;..\Design + + + 7.0 + False + True + False + 0 + All + ..\..\Lib\D11 + ..\..\Lib\D11 + ..\..\Lib\D11 + ..\..\Lib\D11 + ..\..\Lib\D11 + ..\..\Lib\D11;..\;..\Design + ..\..\Lib\D11;..\;..\Design + ..\..\Lib\D11;..\;..\Design + ..\..\Lib\D11;..\;..\Design + + + Delphi.Personality + Package + +FalseTrueFalseCore Lab Data Access ComponentsFalseFalseTrueTrueFalse610110FalseFalseFalseFalseFalse10331252Core Lab6.10.1.106.10.1.10dac105.dpk + + + + + MainSource + + + + + + + + + + + + + + + + + + + + + + + diff --git a/internal/4.10.0.10/1/Source/Delphi11/dac105.res b/internal/4.10.0.10/1/Source/Delphi11/dac105.res new file mode 100644 index 0000000..1fbafc1 Binary files /dev/null and b/internal/4.10.0.10/1/Source/Delphi11/dac105.res differ diff --git a/internal/4.10.0.10/1/Source/Delphi11/dacvcl105.bdsproj b/internal/4.10.0.10/1/Source/Delphi11/dacvcl105.bdsproj new file mode 100644 index 0000000..d62cc3e --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi11/dacvcl105.bdsproj @@ -0,0 +1,183 @@ + + + + + + + + + + + + dacvcl105.dpk + + + 7.0 + + + 8 + 0 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 0 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + + + + 0 + 44 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + Core Lab Data Access GUI related Components + + + + + + + + + + + False + + + + + + False + + + True + False + + + False + + + True + False + 6 + 10 + 1 + 5010 + False + False + False + False + False + 1033 + 1252 + + + Core Lab + + 6.10.1.10 + + + + + DAC + 6.10.1.10 + + + + + diff --git a/internal/4.10.0.10/1/Source/Delphi11/dacvcl105.bpi b/internal/4.10.0.10/1/Source/Delphi11/dacvcl105.bpi new file mode 100644 index 0000000..a07b8aa Binary files /dev/null and b/internal/4.10.0.10/1/Source/Delphi11/dacvcl105.bpi differ diff --git a/internal/4.10.0.10/1/Source/Delphi11/dacvcl105.cfg b/internal/4.10.0.10/1/Source/Delphi11/dacvcl105.cfg new file mode 100644 index 0000000..1342a96 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi11/dacvcl105.cfg @@ -0,0 +1,42 @@ +-$A8 +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-JL +-cg +-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-H+ +-W+ +-M +-$M16384,1048576 +-K$00400000 +-N0"." +-LE"." +-LN"." +-U"..\" +-O"..\" +-I"..\" +-R"..\" +-Z diff --git a/internal/4.10.0.10/1/Source/Delphi11/dacvcl105.dpk b/internal/4.10.0.10/1/Source/Delphi11/dacvcl105.dpk new file mode 100644 index 0000000..ee4a2a1 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi11/dacvcl105.dpk @@ -0,0 +1,37 @@ +package dacvcl105; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Core Lab Data Access GUI related Components'} +{$IMPLICITBUILD OFF} +{$DEFINE RELEASE} + +requires + rtl, + dac105, + vcl; + +contains + DacVcl in '..\DacVcl.pas'; + +end. diff --git a/internal/4.10.0.10/1/Source/Delphi11/dacvcl105.dproj b/internal/4.10.0.10/1/Source/Delphi11/dacvcl105.dproj new file mode 100644 index 0000000..b9c17d8 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi11/dacvcl105.dproj @@ -0,0 +1,543 @@ + + + {eb9174d8-8eb7-404a-aa40-9087616d6e0b} + dacvcl105.dpk + Release + AnyCPU + DCC32 + ..\..\Lib\D11\dacvcl105.bpl + + + 7.0 + False + True + False + 0 + RELEASE + ..\..\Lib\D11 + ..\..\Lib\D11 + ..\..\Lib\D11 + ..\..\Lib\D11 + ..\..\Lib\D11 + ..\..\Lib\D11;..\ + ..\..\Lib\D11;..\ + ..\..\Lib\D11;..\ + ..\..\Lib\D11;..\ + + + 7.0 + False + True + False + 0 + All + ..\..\Lib\D11 + ..\..\Lib\D11 + ..\..\Lib\D11 + ..\..\Lib\D11 + ..\..\Lib\D11 + ..\..\Lib\D11;..\ + ..\..\Lib\D11;..\ + ..\..\Lib\D11;..\ + ..\..\Lib\D11;..\ + + + Delphi.Personality + Package + +FalseTrueFalseCore Lab Data Access GUI related ComponentsFalseFalseFalseTrueFalse610110FalseFalseFalseFalseFalse10331252Core Lab6.10.1.106.10.1.10dacvcl105.dpk + + + + + MainSource + + + + + + + + diff --git a/internal/4.10.0.10/1/Source/Delphi11/dacvcl105.res b/internal/4.10.0.10/1/Source/Delphi11/dacvcl105.res new file mode 100644 index 0000000..1fbafc1 Binary files /dev/null and b/internal/4.10.0.10/1/Source/Delphi11/dacvcl105.res differ diff --git a/internal/4.10.0.10/1/Source/Delphi11/dcldac105.bdsproj b/internal/4.10.0.10/1/Source/Delphi11/dcldac105.bdsproj new file mode 100644 index 0000000..1680c84 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi11/dcldac105.bdsproj @@ -0,0 +1,183 @@ + + + + + + + + + + + + dcldac105.dpk + + + 7.0 + + + 8 + 0 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 0 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + Core Lab Data Access Components + + + + + + + + + + + False + + + + + + False + + + True + False + + + False + + + True + False + 6 + 10 + 1 + 5010 + False + False + False + False + False + 1049 + 1251 + + + + + 6.10.1.10 + + + + + + 6.10.1.10 + + + + + diff --git a/internal/4.10.0.10/1/Source/Delphi11/dcldac105.cfg b/internal/4.10.0.10/1/Source/Delphi11/dcldac105.cfg new file mode 100644 index 0000000..4865331 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi11/dcldac105.cfg @@ -0,0 +1,41 @@ +-$A8 +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J- +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-cg +-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-H+ +-W+ +-M +-$M16384,1048576 +-K$00400000 +-N0"." +-LE"." +-LN"." +-U"..\;..\Design\" +-O"..\;..\Design\" +-I"..\;..\Design\" +-R"..\;..\Design\" +-Z diff --git a/internal/4.10.0.10/1/Source/Delphi11/dcldac105.dpk b/internal/4.10.0.10/1/Source/Delphi11/dcldac105.dpk new file mode 100644 index 0000000..1c300f5 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi11/dcldac105.dpk @@ -0,0 +1,47 @@ +package dcldac105; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Core Lab Data Access Components'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} +{$DEFINE RELEASE} + +requires + rtl, + dac105, + dcldb, + dacvcl105, + vcl, + dbrtl, + vcldb, + vclactnband; + +contains + DacReg in '..\Design\DacReg.pas', + VTDesign in '..\Design\VTDesign.pas', + DAMenu in '..\Design\DAMenu.pas', + DADesign in '..\Design\DADesign.pas', + Download in '..\Design\Download.pas'; + +end. diff --git a/internal/4.10.0.10/1/Source/Delphi11/dcldac105.dproj b/internal/4.10.0.10/1/Source/Delphi11/dcldac105.dproj new file mode 100644 index 0000000..d9f6922 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi11/dcldac105.dproj @@ -0,0 +1,549 @@ + + + {1ace60bb-2bff-4717-9389-4c2ab1bbb8f6} + dcldac105.dpk + Release + AnyCPU + DCC32 + ..\..\Lib\D11\dcldac105.bpl + + + 7.0 + False + False + 0 + RELEASE + ..\..\Lib\D11 + ..\..\Lib\D11 + ..\..\Lib\D11 + ..\..\Lib\D11 + ..\..\Lib\D11 + ..\..\Lib\D11;..\;..\Design + ..\..\Lib\D11;..\;..\Design + ..\..\Lib\D11;..\;..\Design + ..\..\Lib\D11;..\;..\Design + + + 7.0 + False + False + 0 + ..\..\Lib\D11 + ..\..\Lib\D11 + ..\..\Lib\D11 + ..\..\Lib\D11 + ..\..\Lib\D11 + ..\..\Lib\D11;..\ + ..\..\Lib\D11;..\ + ..\..\Lib\D11;..\ + ..\..\Lib\D11;..\ + + + Delphi.Personality + Package + +FalseTrueFalseCore Lab Data Access ComponentsFalseTrueFalseTrueFalse610110FalseFalseFalseFalseFalse10331252Core Lab6.10.1.106.10.1.10dcldac105.dpk + + + + + MainSource + + + + + + + + + + + + + + + + + diff --git a/internal/4.10.0.10/1/Source/Delphi11/dcldac105.res b/internal/4.10.0.10/1/Source/Delphi11/dcldac105.res new file mode 100644 index 0000000..1fbafc1 Binary files /dev/null and b/internal/4.10.0.10/1/Source/Delphi11/dcldac105.res differ diff --git a/internal/4.10.0.10/1/Source/Delphi11/dclsdac105.bdsproj b/internal/4.10.0.10/1/Source/Delphi11/dclsdac105.bdsproj new file mode 100644 index 0000000..e535a09 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi11/dclsdac105.bdsproj @@ -0,0 +1,172 @@ + + + + + + + + + + + + dclsdac105.dpk + + + 7.0 + + + 8 + 0 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 0 + 1 + True + True + WinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + + + 0 + 0 + 1 + False + False + False + 4096 + 1048576 + 4194304 + SQL Server Data Access Components + + + . + . + + + d:\windows\microsoft.net\framework\v1.1.4322;d:\program files\common files\borland shared\bds\shared assemblies\5.0;d:\Projects\Delphi\Dac\Source\;d:\Projects\Delphi\SDac\Source\;d:\Projects\Delphi\Dac\Source\Delphi10 + + sdac;MYBUILDER + + False + + + + + + False + + + + + + False + + + + $00000000 + + + + True + False + 4 + 10 + 0 + 5010 + False + False + False + False + False + + + + + + + 4.10.0.10 + + + + + + 4.10.0.10 + + + diff --git a/internal/4.10.0.10/1/Source/Delphi11/dclsdac105.cfg b/internal/4.10.0.10/1/Source/Delphi11/dclsdac105.cfg new file mode 100644 index 0000000..94d171b --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi11/dclsdac105.cfg @@ -0,0 +1,43 @@ +-$A8 +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-cg +-AWinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-H+ +-W+ +-M +-$M4096,1048576 +-K$00400000 +-E"." +-N"." +-LE"." +-LN"." +-U"..\Design;.." +-O"..\Design;.." +-I"..\Design;.." +-R"..\Design;.." +-Dsdac +-Z diff --git a/internal/4.10.0.10/1/Source/Delphi11/dclsdac105.dpk b/internal/4.10.0.10/1/Source/Delphi11/dclsdac105.dpk new file mode 100644 index 0000000..37545c6 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi11/dclsdac105.dpk @@ -0,0 +1,56 @@ + +package dclsdac105; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'SQL Server Data Access Components'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} +{$DEFINE sdac} +{$DEFINE MYBUILDER} +{$DEFINE RELEASE} + +requires + sdac105, + dcldb, + dcldac105, + vcljpg, + sdacvcl105, + designide, + xmlrtl, + rtl, + vclactnband, + vclx, + vcl, + dbrtl, + vcldesigner, + dclstd, + vcldb, + dac105, + dacvcl105; + +contains + MSDesign in '..\Design\MSDesign.pas', + MSReg in '..\Design\MSReg.pas'; + +end. diff --git a/internal/4.10.0.10/1/Source/Delphi11/dclsdac105.dproj b/internal/4.10.0.10/1/Source/Delphi11/dclsdac105.dproj new file mode 100644 index 0000000..67eeeef --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi11/dclsdac105.dproj @@ -0,0 +1,612 @@ + + + {b3c5ddcc-9704-4351-ad7b-5d16603319e1} + dclsdac105.dpk + Release + AnyCPU + DCC32 + ..\..\Lib\D11\dclsdac105.bpl + + + 7.0 + False + True + False + 0 + WinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + 4096,1048576 + . + ..\..\Lib\D11 + ..\..\Lib\D11 + ..\..\Lib\D11 + ..\..\Lib\D11;..\;..\Design + ..\..\Lib\D11;..\;..\Design + ..\..\Lib\D11;..\;..\Design + ..\..\Lib\D11;..\;..\Design + sdac;MYBUILDER;RELEASE + True + True + True + ..\..\Lib\D11 + ..\..\Lib\D11 + + + 7.0 + False + True + False + 0 + WinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + 4096,1048576 + . + ..\..\Lib\D11 + ..\..\Lib\D11 + ..\..\Lib\D11 + ..\..\Lib\D11;..\;..\Design + ..\..\Lib\D11;..\;..\Design + ..\..\Lib\D11;..\;..\Design + ..\..\Lib\D11;..\;..\Design + sdac;MYBUILDER + True + True + True + ..\..\Lib\D11 + ..\..\Lib\D11 + + + Delphi.Personality + Package + + + False + True + False + + + SQL Server Data Access Components + False + True + False + + + True + False + 4 + 10 + 0 + 10 + False + False + False + False + False + 1033 + 1252 + + + Core Lab + + 4.10.0.10 + + + + + Sdac + 4.10.0.10 + + + dclsdac105.dpk + + + + + + + MainSource + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/internal/4.10.0.10/1/Source/Delphi11/dclsdac105.res b/internal/4.10.0.10/1/Source/Delphi11/dclsdac105.res new file mode 100644 index 0000000..e554dce Binary files /dev/null and b/internal/4.10.0.10/1/Source/Delphi11/dclsdac105.res differ diff --git a/internal/4.10.0.10/1/Source/Delphi11/sdac105.bdsproj b/internal/4.10.0.10/1/Source/Delphi11/sdac105.bdsproj new file mode 100644 index 0000000..745612b --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi11/sdac105.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + sdac105.dpk + + + 7.0 + + + 8 + 0 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 0 + 1 + True + True + WinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True True + True + + + + 0 + 44 + 1 + False + False + False + 4096 + 1048576 + 4194304 + SQL Server Data Access Components False + + + . + . + . + + d:\windows\microsoft.net\framework\v1.1.4322;d:\program files\common files\borland shared\bds\shared assemblies\5.0;d:\Projects\Delphi\Dac\Source\;d:\Projects\Delphi\SDac\Source\ + + SDAC + + False + + + + + + False + + + + + + False + True + False + + + + $00000000 + + + + True + False + 4 + 10 + 0 + 5010 + False + False + False + False + False 1033 + 1252 + + + Core Lab + + 4.10.0.10 + + + + + Sdac + 4.10.0.10 + + + diff --git a/internal/4.10.0.10/1/Source/Delphi11/sdac105.bpi b/internal/4.10.0.10/1/Source/Delphi11/sdac105.bpi new file mode 100644 index 0000000..8fd214c Binary files /dev/null and b/internal/4.10.0.10/1/Source/Delphi11/sdac105.bpi differ diff --git a/internal/4.10.0.10/1/Source/Delphi11/sdac105.cfg b/internal/4.10.0.10/1/Source/Delphi11/sdac105.cfg new file mode 100644 index 0000000..bb96df5 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi11/sdac105.cfg @@ -0,0 +1,44 @@ +-$A8 +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-JL +-cg +-AWinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-H+ +-W+ +-M +-$M4096,1048576 +-K$00400000 +-E"." +-N0"." +-LE"." +-LN"." +-U".." +-O".." +-I".." +-R".." +-DSDAC +-Z diff --git a/internal/4.10.0.10/1/Source/Delphi11/sdac105.dpk b/internal/4.10.0.10/1/Source/Delphi11/sdac105.dpk new file mode 100644 index 0000000..2f3f19c --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi11/sdac105.dpk @@ -0,0 +1,51 @@ + +package sdac105; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'SQL Server Data Access Components'} +{$RUNONLY} +{$IMPLICITBUILD OFF} +{$DEFINE SDAC} +{$DEFINE RELEASE} + +requires + vcl, + vcldb, + dac105, + rtl, + dbrtl; + +contains + MSAccess in '..\MSAccess.pas', + MSConnectionPool in '..\MSConnectionPool.pas', + MSConsts in '..\MSConsts.pas', + MSSQLMonitor in '..\MSSQLMonitor.pas', + OLEDBAccess in '..\OLEDBAccess.pas', + OLEDBC in '..\OLEDBC.pas', + OLEDBIntf in '..\OLEDBIntf.pas', + MSLoader in '..\MSLoader.pas', + MSDump in '..\MSDump.pas', + MSScript in '..\MSScript.pas'; + +end. diff --git a/internal/4.10.0.10/1/Source/Delphi11/sdac105.dproj b/internal/4.10.0.10/1/Source/Delphi11/sdac105.dproj new file mode 100644 index 0000000..da8c0aa --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi11/sdac105.dproj @@ -0,0 +1,567 @@ + + + {ea9ec1ce-8ace-4bc6-9d70-dfee1626f110} + sdac105.dpk + Release + AnyCPU + DCC32 + ..\..\Lib\D11\sdac105.bpl + + + 7.0 + False + True + False + 0 + WinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + 4096,1048576 + . + ..\..\Lib\D11 + ..\..\Lib\D11 + ..\..\Lib\D11 + ..\..\Lib\D11 + ..\..\Lib\D11;..\ + ..\..\Lib\D11;..\ + ..\..\Lib\D11;..\ + ..\..\Lib\D11;..\ + SDAC;RELEASE + True + True + True + ..\..\Lib\D11 + + + 7.0 + False + True + False + 0 + WinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + All + 4096,1048576 + . + ..\..\Lib\D11 + ..\..\Lib\D11 + ..\..\Lib\D11 + ..\..\Lib\D11 + ..\..\Lib\D11;..\ + ..\..\Lib\D11;..\ + ..\..\Lib\D11;..\ + ..\..\Lib\D11;..\ + SDAC + True + True + True + ..\..\Lib\D11 + + + Delphi.Personality + Package + +FalseTrueFalseSQL Server Data Access ComponentsFalseFalseTrueTrueFalse410010FalseFalseFalseFalseFalse10331252Core Lab4.10.0.10Sdac4.10.0.10sdac105.dpk + + + + + MainSource + + + + + + + + + + + + + + + + + + + diff --git a/internal/4.10.0.10/1/Source/Delphi11/sdac105.res b/internal/4.10.0.10/1/Source/Delphi11/sdac105.res new file mode 100644 index 0000000..e554dce Binary files /dev/null and b/internal/4.10.0.10/1/Source/Delphi11/sdac105.res differ diff --git a/internal/4.10.0.10/1/Source/Delphi11/sdacvcl105.bdsproj b/internal/4.10.0.10/1/Source/Delphi11/sdacvcl105.bdsproj new file mode 100644 index 0000000..b48621e --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi11/sdacvcl105.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + sdacvcl105.dpk + + + 7.0 + + + 8 + 0 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 0 + 1 + True + True + WinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True True + True + + + + 0 + 44 + 1 + False + False + False + 4096 + 1048576 + 4194304 + SQL Server Data Access GUI related Components False + + + . + . + + + d:\windows\microsoft.net\framework\v1.1.4322;d:\program files\common files\borland shared\bds\shared assemblies\5.0;d:\Projects\Delphi\Dac\Source\;d:\Projects\Delphi\SDac\Source\ + + SDAC + + False + + + + + + False + + + + + + False + True + False + + + + $00000000 + + + + True + False + 4 + 10 + 0 + 5010 + False + False + False + False + False 1033 + 1252 + + + 4.10.0.10 + Core Lab + + + + + + Sdac + 4.10.0.10 + + + diff --git a/internal/4.10.0.10/1/Source/Delphi11/sdacvcl105.bpi b/internal/4.10.0.10/1/Source/Delphi11/sdacvcl105.bpi new file mode 100644 index 0000000..398be38 Binary files /dev/null and b/internal/4.10.0.10/1/Source/Delphi11/sdacvcl105.bpi differ diff --git a/internal/4.10.0.10/1/Source/Delphi11/sdacvcl105.cfg b/internal/4.10.0.10/1/Source/Delphi11/sdacvcl105.cfg new file mode 100644 index 0000000..bb96df5 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi11/sdacvcl105.cfg @@ -0,0 +1,44 @@ +-$A8 +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-JL +-cg +-AWinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-H+ +-W+ +-M +-$M4096,1048576 +-K$00400000 +-E"." +-N0"." +-LE"." +-LN"." +-U".." +-O".." +-I".." +-R".." +-DSDAC +-Z diff --git a/internal/4.10.0.10/1/Source/Delphi11/sdacvcl105.dpk b/internal/4.10.0.10/1/Source/Delphi11/sdacvcl105.dpk new file mode 100644 index 0000000..45664a5 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi11/sdacvcl105.dpk @@ -0,0 +1,38 @@ +package sdacvcl105; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'SQL Server Data Access GUI related Components'} +{$IMPLICITBUILD OFF} +{$DEFINE SDAC} +{$DEFINE RELEASE} + +requires + rtl, + dacvcl105, + sdac105; + +contains + sdacVcl in '..\sdacVcl.pas'; + +end. diff --git a/internal/4.10.0.10/1/Source/Delphi11/sdacvcl105.dproj b/internal/4.10.0.10/1/Source/Delphi11/sdacvcl105.dproj new file mode 100644 index 0000000..c495a4e --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi11/sdacvcl105.dproj @@ -0,0 +1,556 @@ + + + {4312a9f0-157d-4479-be7f-2f6686e7dd07} + sdacvcl105.dpk + Release + AnyCPU + DCC32 + ..\..\Lib\D11\sdacvcl105.bpl + + + 7.0 + False + True + False + 0 + WinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + 4096,1048576 + . + ..\..\Lib\D11 + ..\..\Lib\D11 + ..\..\Lib\D11 + ..\..\Lib\D11;..\;..\Design + ..\..\Lib\D11;..\;..\Design + ..\..\Lib\D11;..\;..\Design + ..\..\Lib\D11;..\;..\Design + SDAC;RELEASE + True + True + True + ..\..\Lib\D11 + ..\..\Lib\D11 + + + 7.0 + False + True + False + 0 + WinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + All + 4096,1048576 + . + ..\..\Lib\D11 + ..\..\Lib\D11 + ..\..\Lib\D11 + ..\..\Lib\D11;..\;..\Design + ..\..\Lib\D11;..\;..\Design + ..\..\Lib\D11;..\;..\Design + ..\..\Lib\D11;..\;..\Design + SDAC + True + True + True + ..\..\Lib\D11 + ..\..\Lib\D11 + + + Delphi.Personality + Package + +FalseTrueFalseSQL Server Data Access GUI related ComponentsFalseFalseFalseTrueFalse410010FalseFalseFalseFalseFalse103312524.10.0.10Core LabSdac4.10.0.10sdacvcl105.dpk + + + + + MainSource + + + + + + + + diff --git a/internal/4.10.0.10/1/Source/Delphi11/sdacvcl105.res b/internal/4.10.0.10/1/Source/Delphi11/sdacvcl105.res new file mode 100644 index 0000000..e554dce Binary files /dev/null and b/internal/4.10.0.10/1/Source/Delphi11/sdacvcl105.res differ diff --git a/internal/4.10.0.10/1/Source/Delphi5/Make.bat b/internal/4.10.0.10/1/Source/Delphi5/Make.bat new file mode 100644 index 0000000..2b03bd9 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi5/Make.bat @@ -0,0 +1,10 @@ +@echo off +rem ********************************************************************** +rem * +rem * Sdac for Delphi 5 +rem * +rem ********************************************************************** + +set IdeDir="D:\Program Files\Borland\Delphi5 +del /Q/S SDAC\*.* +call ..\Make.bat Delphi 5 diff --git a/internal/4.10.0.10/1/Source/Delphi5/dac50.cfg b/internal/4.10.0.10/1/Source/Delphi5/dac50.cfg new file mode 100644 index 0000000..8c87186 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi5/dac50.cfg @@ -0,0 +1,41 @@ +-$A+ +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-cg +-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-H+ +-W+ +-M +-$M16384,1048576 +-K$00400000 +-N"." +-LE"." +-LN"." +-U".." +-O".." +-I".." +-R".." +-Z diff --git a/internal/4.10.0.10/1/Source/Delphi5/dac50.dof b/internal/4.10.0.10/1/Source/Delphi5/dac50.dof new file mode 100644 index 0000000..8139f89 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi5/dac50.dof @@ -0,0 +1,94 @@ +[Compiler] +A=1 +B=0 +C=1 +D=0 +E=0 +F=0 +G=1 +H=1 +I=1 +J=1 +K=0 +L=0 +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=0 +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=Core Lab Data Access Components +[Directories] +OutputDir= +UnitOutputDir=. +PackageDLLOutputDir= +PackageDCPOutputDir=. +SearchPath=.. +Packages= +Conditionals= +DebugSourceDirs= +UsePackages=0 +[Parameters] +RunParams= +HostApplication= +[Language] +ActiveLang= +RootDir= +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=6 +MinorVer=10 +Release=1 +Build=10 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +[Version Info Keys] +CompanyName=Core Lab +FileDescription= +FileVersion=6.10.1.10 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName=DAC +ProductVersion=6.10.1.10 +Comments= +[HistoryLists\hlDebugSourcePath] +Count=1 +Item0=$(DELPHI)\MyDac\Bin;$(DELPHI)\MyDac\Lib +[HistoryLists\hlUnitAliases] +Count=1 +Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +[HistoryLists\hlSearchPath] +Count=1 +Item0=$(DELPHI)\Lib\Debug;$(DELPHI)\MyDac\Bin;$(DELPHI)\MyDac\Lib;d:\Projects\Delphi\Dac\Source\Design\;d:\Projects\Delphi\MyDac\Source\Design\ +[HistoryLists\hlUnitOutputDirectory] +Count=1 +Item0=. +[HistoryLists\hlOutputDirectorry] +Count=1 +Item0=. diff --git a/internal/4.10.0.10/1/Source/Delphi5/dac50.dpk b/internal/4.10.0.10/1/Source/Delphi5/dac50.dpk new file mode 100644 index 0000000..518b8e4 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi5/dac50.dpk @@ -0,0 +1,54 @@ +package dac50; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Core Lab Data Access Components'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl50, + Vcldb50, + Vclbde50; + +contains + DBAccess in '..\DBAccess.pas', + CRAccess in '..\CRAccess.pas', + DALoader in '..\DALoader.pas', + DADump in '..\DADump.pas', + CRParser in '..\CRParser.pas', + DAConsts in '..\DAConsts.pas', + DBMonitorIntf in '..\DBMonitorIntf.pas', + DBMonitorClient in '..\DBMonitorClient.pas', + DASQLMonitor in '..\DASQLMonitor.pas', + MemData in '..\MemData.pas', + MemDS in '..\MemDS.pas', + VirtualTable in '..\VirtualTable.pas', + DacVcl in '..\DacVcl.pas', + DAVersionInfo in '..\DAVersionInfo.pas', + CLRClasses in '..\CLRClasses.pas', + MemUtils in '..\MemUtils.pas', + DAScript in '..\DAScript.pas', + CRBatchMove in '..\CRBatchMove.pas'; + +end. diff --git a/internal/4.10.0.10/1/Source/Delphi5/dac50.res b/internal/4.10.0.10/1/Source/Delphi5/dac50.res new file mode 100644 index 0000000..d50d7f1 Binary files /dev/null and b/internal/4.10.0.10/1/Source/Delphi5/dac50.res differ diff --git a/internal/4.10.0.10/1/Source/Delphi5/dcldac50.cfg b/internal/4.10.0.10/1/Source/Delphi5/dcldac50.cfg new file mode 100644 index 0000000..b6bbb6b --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi5/dcldac50.cfg @@ -0,0 +1,41 @@ +-$A+ +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-cg +-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-H+ +-W+ +-M +-$M16384,1048576 +-K$00400000 +-N"." +-LE"." +-LN"." +-U"..;..\Design\" +-O"..;..\Design\" +-I"..;..\Design\" +-R"..;..\Design\" +-Z diff --git a/internal/4.10.0.10/1/Source/Delphi5/dcldac50.dof b/internal/4.10.0.10/1/Source/Delphi5/dcldac50.dof new file mode 100644 index 0000000..b2c47df --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi5/dcldac50.dof @@ -0,0 +1,94 @@ +[Compiler] +A=1 +B=0 +C=1 +D=0 +E=0 +F=0 +G=1 +H=1 +I=1 +J=1 +K=0 +L=0 +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=0 +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=Core Lab Data Access Components +[Directories] +OutputDir= +UnitOutputDir=. +PackageDLLOutputDir= +PackageDCPOutputDir=. +SearchPath=..;..\Design;$(DELPHI)\source\toolsapi +Packages=Vcl50;Vclx50;VclSmp50;Vcldb50;vclado50;ibevnt50;Vclbde50;vcldbx50;Qrpt50;TeeUI50;TeeDB50;Tee50;Dss50;TeeQR50;VCLIB50;Vclmid50;vclie50;Inet50;NMFast50;webmid50;dclocx50;dcctd5;ip50_d5Trial;CRPack50;odac50 +Conditionals= +DebugSourceDirs= +UsePackages=0 +[Parameters] +RunParams= +HostApplication= +[Language] +ActiveLang= +RootDir= +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=6 +MinorVer=10 +Release=1 +Build=10 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +[Version Info Keys] +CompanyName=Core Lab +FileDescription= +FileVersion=6.10.1.10 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName=DAC +ProductVersion=6.10.1.10 +Comments= +[HistoryLists\hlDebugSourcePath] +Count=1 +Item0=$(DELPHI)\MyDac\Bin;$(DELPHI)\MyDac\Lib +[HistoryLists\hlUnitAliases] +Count=1 +Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +[HistoryLists\hlSearchPath] +Count=1 +Item0=$(DELPHI)\Lib\Debug;$(DELPHI)\MyDac\Bin;$(DELPHI)\MyDac\Lib;d:\Projects\Delphi\Dac\Source\Design\;d:\Projects\Delphi\MyDac\Source\Design\ +[HistoryLists\hlUnitOutputDirectory] +Count=1 +Item0=. +[HistoryLists\hlOutputDirectorry] +Count=1 +Item0=. diff --git a/internal/4.10.0.10/1/Source/Delphi5/dcldac50.dpk b/internal/4.10.0.10/1/Source/Delphi5/dcldac50.dpk new file mode 100644 index 0000000..c6fd587 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi5/dcldac50.dpk @@ -0,0 +1,41 @@ +package dcldac50; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Core Lab Data Access Components'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + vcl50, + dac50, + dcldb50; + +contains + DacReg in '..\Design\DacReg.pas', + VTDesign in '..\Design\VTDesign.pas', + DADesign in '..\Design\DADesign.pas', + DAMenu in '..\Design\DAMenu.pas', + Download in '..\Design\Download.pas'; + +end. diff --git a/internal/4.10.0.10/1/Source/Delphi5/dcldac50.res b/internal/4.10.0.10/1/Source/Delphi5/dcldac50.res new file mode 100644 index 0000000..d50d7f1 Binary files /dev/null and b/internal/4.10.0.10/1/Source/Delphi5/dcldac50.res differ diff --git a/internal/4.10.0.10/1/Source/Delphi5/dclsdac50.cfg b/internal/4.10.0.10/1/Source/Delphi5/dclsdac50.cfg new file mode 100644 index 0000000..1713b5e --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi5/dclsdac50.cfg @@ -0,0 +1,41 @@ +-$A+ +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-cg +-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-H+ +-W+ +-M +-$M16384,1048576 +-K$00400000 +-N"." +-LN"." +-U"..\;..\..\..\Dac\Source\Delphi5;..\..\..\Dac\Source..;..\Design" +-O"..\;..\..\..\Dac\Source\Delphi5;..\..\..\Dac\Source..;..\Design" +-I"..\;..\..\..\Dac\Source\Delphi5;..\..\..\Dac\Source..;..\Design" +-R"..\;..\..\..\Dac\Source\Delphi5;..\..\..\Dac\Source..;..\Design" +-Dsdac +-Z diff --git a/internal/4.10.0.10/1/Source/Delphi5/dclsdac50.dof b/internal/4.10.0.10/1/Source/Delphi5/dclsdac50.dof new file mode 100644 index 0000000..8eb4502 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi5/dclsdac50.dof @@ -0,0 +1,92 @@ +[Compiler] +A=1 +B=0 +C=1 +D=0 +E=0 +F=0 +G=1 +H=1 +I=1 +J=1 +K=0 +L=0 +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=0 +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=SQL Server Data Access Components +[Directories] +OutputDir= +UnitOutputDir=. +PackageDLLOutputDir= +PackageDCPOutputDir=. +SearchPath=..\;..\..\..\Dac\Source\Delphi5;..\..\..\Dac\Source;..;..\Design +Packages= +Conditionals=sdac +DebugSourceDirs= +UsePackages=0 +[Parameters] +RunParams= +HostApplication= +[Language] +ActiveLang= +RootDir= +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=4 +MinorVer=10 +Release=0 +Build=10 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +[Version Info Keys] +CompanyName=Core Lab +FileDescription= +FileVersion=4.10.0.10 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName=SDAC +ProductVersion=4.10.0.10 +Comments= +[HistoryLists\hlUnitAliases] +Count=1 +Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +[HistoryLists\hlSearchPath] +Count=2 +Item0=$(DELPHI)\Lib\Debug;d:\Projects\Delphi\SDAC\Source\;d:\Projects\Delphi\DAC\Source\ +Item1=d:\Projects\Delphi\SDAC\Source\;d:\Projects\Delphi\DAC\Source\ +[HistoryLists\hlUnitOutputDirectory] +Count=1 +Item0=. +[HistoryLists\hlOutputDirectorry] +Count=1 +Item0=. diff --git a/internal/4.10.0.10/1/Source/Delphi5/dclsdac50.dpk b/internal/4.10.0.10/1/Source/Delphi5/dclsdac50.dpk new file mode 100644 index 0000000..2f549fb --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi5/dclsdac50.dpk @@ -0,0 +1,49 @@ + +////////////////////////////////////////////////// +// SQL Server Data Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +// SDAC Package for Delphi 5 +////////////////////////////////////////////////// + + +package dclsdac50; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'SQL Server Data Access Components'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} +{$DEFINE sdac} + +requires + dcldb50, + sdac50, + dcldac50, + VCLJPG50; + +contains + MSReg in '..\Design\MSReg.pas', + MSDesign in '..\Design\MSDesign.pas', + MSMenu in '..\Design\MSMenu.pas'; + +end. diff --git a/internal/4.10.0.10/1/Source/Delphi5/dclsdac50.res b/internal/4.10.0.10/1/Source/Delphi5/dclsdac50.res new file mode 100644 index 0000000..1c23367 Binary files /dev/null and b/internal/4.10.0.10/1/Source/Delphi5/dclsdac50.res differ diff --git a/internal/4.10.0.10/1/Source/Delphi5/sdac50.cfg b/internal/4.10.0.10/1/Source/Delphi5/sdac50.cfg new file mode 100644 index 0000000..cbc007b --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi5/sdac50.cfg @@ -0,0 +1,41 @@ +-$A+ +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-cg +-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-H+ +-W+ +-M +-$M16384,1048576 +-K$00400000 +-N"." +-LN"." +-U"..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi5;..\" +-O"..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi5;..\" +-I"..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi5;..\" +-R"..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi5;..\" +-Dsdac +-Z diff --git a/internal/4.10.0.10/1/Source/Delphi5/sdac50.dof b/internal/4.10.0.10/1/Source/Delphi5/sdac50.dof new file mode 100644 index 0000000..f5cb057 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi5/sdac50.dof @@ -0,0 +1,95 @@ +[Compiler] +A=1 +B=0 +C=1 +D=0 +E=0 +F=0 +G=1 +H=1 +I=1 +J=1 +K=0 +L=0 +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=0 +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=SQL Server Data Access Components +[Directories] +OutputDir= +UnitOutputDir=. +PackageDLLOutputDir= +PackageDCPOutputDir=. +SearchPath=..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi5;..\ +Packages= +Conditionals=sdac +DebugSourceDirs= +UsePackages=0 +[Parameters] +RunParams= +HostApplication= +[Language] +ActiveLang= +RootDir= +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=4 +MinorVer=10 +Release=0 +Build=10 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +[Version Info Keys] +CompanyName=Core Lab +FileDescription= +FileVersion=4.10.0.10 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName=SDAC +ProductVersion=4.10.0.10 +Comments= +[HistoryLists\hlDebugSourcePath] +Count=1 +Item0=$(DELPHI)\Sdac\Bin;$(DELPHI)\Sdac\Lib;d:\Projects\Delphi\Sdac\Source\;d:\Projects\Delphi\Dac\Source\ +[HistoryLists\hlUnitAliases] +Count=1 +Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +[HistoryLists\hlSearchPath] +Count=2 +Item0=$(DELPHI)\Lib\Debug;$(DELPHI)\Sdac\Bin;$(DELPHI)\SdDac\Lib;d:\Projects\Delphi\Sdac\Source\;d:\Projects\Delphi\Dac\Source\ +Item1=$(DELPHI)\Sdac\Bin;$(DELPHI)\Sdac\Lib;d:\Projects\Delphi\Sdac\Source\;d:\Projects\Delphi\Dac\Source\ +[HistoryLists\hlUnitOutputDirectory] +Count=1 +Item0=. +[HistoryLists\hlOutputDirectorry] +Count=1 +Item0=. diff --git a/internal/4.10.0.10/1/Source/Delphi5/sdac50.dpk b/internal/4.10.0.10/1/Source/Delphi5/sdac50.dpk new file mode 100644 index 0000000..a273d83 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi5/sdac50.dpk @@ -0,0 +1,54 @@ + +////////////////////////////////////////////////// +// SQL Server Data Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +// SDAC Package for Delphi 5 +////////////////////////////////////////////////// + +package sdac50; + +{$R *.RES} +{$ALIGN ON} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'SQL Server Data Access Components'} +{$RUNONLY} +{$IMPLICITBUILD OFF} +{$DEFINE sdac} + +requires + VCL50, + VCLDB50, + Vclbde50, + dac50; + +contains + SdacVcl in '..\SdacVcl.pas', + OLEDBAccess in '..\OLEDBAccess.pas', + MSAccess in '..\MSAccess.pas', + OLEDBC in '..\oledbc.pas', + MSSQLMonitor in '..\MSSQLMonitor.pas', + MSParser in '..\MSParser.pas', + OLEDBIntf in '..\OLEDBIntf.pas', + MSConsts in '..\MSConsts.pas', + MSScript in '..\MSScript.pas'; + +end. diff --git a/internal/4.10.0.10/1/Source/Delphi5/sdac50.res b/internal/4.10.0.10/1/Source/Delphi5/sdac50.res new file mode 100644 index 0000000..1c23367 Binary files /dev/null and b/internal/4.10.0.10/1/Source/Delphi5/sdac50.res differ diff --git a/internal/4.10.0.10/1/Source/Delphi6/Make.bat b/internal/4.10.0.10/1/Source/Delphi6/Make.bat new file mode 100644 index 0000000..6469054 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi6/Make.bat @@ -0,0 +1,10 @@ +@echo off +rem ********************************************************************** +rem * +rem * Sdac for Delphi 6 +rem * +rem ********************************************************************** + +set IdeDir="D:\Program Files\Borland\Delphi6 +del /Q/S SDAC\*.* +call ..\Make.bat Delphi 6 diff --git a/internal/4.10.0.10/1/Source/Delphi6/dac60.cfg b/internal/4.10.0.10/1/Source/Delphi6/dac60.cfg new file mode 100644 index 0000000..637cad2 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi6/dac60.cfg @@ -0,0 +1,41 @@ +-$A8 +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-cg +-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-H+ +-W+ +-M +-$M16384,1048576 +-K$00400000 +-N"." +-LE"d:\program files\borland\delphi6\Projects\Bpl" +-LN"." +-U"..\" +-O"..\" +-I"..\" +-R"..\" +-Z diff --git a/internal/4.10.0.10/1/Source/Delphi6/dac60.dof b/internal/4.10.0.10/1/Source/Delphi6/dac60.dof new file mode 100644 index 0000000..3709d1f --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi6/dac60.dof @@ -0,0 +1,96 @@ +[FileVersion] +Version=6.0 +[Compiler] +A=8 +B=0 +C=1 +D=0 +E=0 +F=0 +G=1 +H=1 +I=1 +J=1 +K=0 +L=0 +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=0 +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=Core Lab Data Access Components +[Directories] +OutputDir= +UnitOutputDir=. +PackageDLLOutputDir= +PackageDCPOutputDir=. +SearchPath=..\ +Packages= +Conditionals= +DebugSourceDirs= +UsePackages=0 +[Parameters] +RunParams= +HostApplication= +Launcher= +UseLauncher=0 +DebugCWD= +[Language] +ActiveLang= +RootDir= +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=6 +MinorVer=10 +Release=1 +Build=10 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +[Version Info Keys] +CompanyName=Core Lab +FileDescription= +FileVersion=6.10.1.10 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName=DAC +ProductVersion=6.10.1.10 +Comments= +[HistoryLists\hlConditionals] +Count=1 +Item0=ODAC +[HistoryLists\hlUnitAliases] +Count=1 +Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +[HistoryLists\hlUnitOutputDirectory] +Count=1 +Item0=. +[HistoryLists\hlDCPOutput] +Count=1 +Item0=. diff --git a/internal/4.10.0.10/1/Source/Delphi6/dac60.dpk b/internal/4.10.0.10/1/Source/Delphi6/dac60.dpk new file mode 100644 index 0000000..2388304 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi6/dac60.dpk @@ -0,0 +1,52 @@ +package dac60; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Core Lab Data Access Components'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl; + +contains + CRAccess in '..\CRAccess.pas', + CRParser in '..\CRParser.pas', + DAConsts in '..\DAConsts.pas', + DBMonitorIntf in '..\DBMonitorIntf.pas', + DBMonitorClient in '..\DBMonitorClient.pas', + DASQLMonitor in '..\DASQLMonitor.pas', + DBAccess in '..\DBAccess.pas', + MemData in '..\MemData.pas', + MemDS in '..\MemDS.pas', + VirtualTable in '..\VirtualTable.pas', + DAVersionInfo in '..\DAVersionInfo.pas', + MemUtils in '..\MemUtils.pas', + CLRClasses in '..\CLRClasses.pas', + DALoader in '..\DALoader.pas', + DAScript in '..\DAScript.pas', + DADump in '..\DADump.pas', + CRBatchMove in '..\CRBatchMove.pas'; + +end. diff --git a/internal/4.10.0.10/1/Source/Delphi6/dac60.res b/internal/4.10.0.10/1/Source/Delphi6/dac60.res new file mode 100644 index 0000000..d50d7f1 Binary files /dev/null and b/internal/4.10.0.10/1/Source/Delphi6/dac60.res differ diff --git a/internal/4.10.0.10/1/Source/Delphi6/dacvcl60.cfg b/internal/4.10.0.10/1/Source/Delphi6/dacvcl60.cfg new file mode 100644 index 0000000..637cad2 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi6/dacvcl60.cfg @@ -0,0 +1,41 @@ +-$A8 +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-cg +-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-H+ +-W+ +-M +-$M16384,1048576 +-K$00400000 +-N"." +-LE"d:\program files\borland\delphi6\Projects\Bpl" +-LN"." +-U"..\" +-O"..\" +-I"..\" +-R"..\" +-Z diff --git a/internal/4.10.0.10/1/Source/Delphi6/dacvcl60.dof b/internal/4.10.0.10/1/Source/Delphi6/dacvcl60.dof new file mode 100644 index 0000000..5bbc960 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi6/dacvcl60.dof @@ -0,0 +1,96 @@ +[FileVersion] +Version=6.0 +[Compiler] +A=8 +B=0 +C=1 +D=0 +E=0 +F=0 +G=1 +H=1 +I=1 +J=1 +K=0 +L=0 +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=0 +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=Core Lab Data Access GUI related Components +[Directories] +OutputDir= +UnitOutputDir=. +PackageDLLOutputDir= +PackageDCPOutputDir=. +SearchPath=..\ +Packages= +Conditionals= +DebugSourceDirs= +UsePackages=0 +[Parameters] +RunParams= +HostApplication= +Launcher= +UseLauncher=0 +DebugCWD= +[Language] +ActiveLang= +RootDir= +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=6 +MinorVer=10 +Release=1 +Build=10 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +[Version Info Keys] +CompanyName=Core Lab +FileDescription= +FileVersion=6.10.1.10 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName=DAC +ProductVersion=6.10.1.10 +Comments= +[HistoryLists\hlConditionals] +Count=1 +Item0=ODAC +[HistoryLists\hlUnitAliases] +Count=1 +Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +[HistoryLists\hlUnitOutputDirectory] +Count=1 +Item0=. +[HistoryLists\hlDCPOutput] +Count=1 +Item0=. diff --git a/internal/4.10.0.10/1/Source/Delphi6/dacvcl60.dpk b/internal/4.10.0.10/1/Source/Delphi6/dacvcl60.dpk new file mode 100644 index 0000000..5065e96 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi6/dacvcl60.dpk @@ -0,0 +1,36 @@ +package dacvcl60; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Core Lab Data Access GUI related Components'} +{$IMPLICITBUILD OFF} + +requires + rtl, + dac60, + vcl; + +contains + DacVcl in '..\DacVcl.pas'; + +end. diff --git a/internal/4.10.0.10/1/Source/Delphi6/dacvcl60.res b/internal/4.10.0.10/1/Source/Delphi6/dacvcl60.res new file mode 100644 index 0000000..d50d7f1 Binary files /dev/null and b/internal/4.10.0.10/1/Source/Delphi6/dacvcl60.res differ diff --git a/internal/4.10.0.10/1/Source/Delphi6/dcldac60.cfg b/internal/4.10.0.10/1/Source/Delphi6/dcldac60.cfg new file mode 100644 index 0000000..98c7ad7 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi6/dcldac60.cfg @@ -0,0 +1,41 @@ +-$A8 +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J- +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-cg +-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-H+ +-W+ +-M +-$M16384,1048576 +-K$00400000 +-N"." +-LE"d:\program files\borland\delphi6\Projects\Bpl" +-LN"." +-U"..;..\Design;d:\program files\borland\delphi6\Source\ToolsAPI" +-O"..;..\Design;d:\program files\borland\delphi6\Source\ToolsAPI" +-I"..;..\Design;d:\program files\borland\delphi6\Source\ToolsAPI" +-R"..;..\Design;d:\program files\borland\delphi6\Source\ToolsAPI" +-Z diff --git a/internal/4.10.0.10/1/Source/Delphi6/dcldac60.dof b/internal/4.10.0.10/1/Source/Delphi6/dcldac60.dof new file mode 100644 index 0000000..8e7421e --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi6/dcldac60.dof @@ -0,0 +1,96 @@ +[FileVersion] +Version=6.0 +[Compiler] +A=8 +B=0 +C=1 +D=0 +E=0 +F=0 +G=1 +H=1 +I=1 +J=0 +K=0 +L=0 +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=0 +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=Core Lab Data Access Components +[Directories] +OutputDir= +UnitOutputDir=. +PackageDLLOutputDir= +PackageDCPOutputDir=. +SearchPath=..;..\Design;$(DELPHI)\Source\ToolsAPI +Packages= +Conditionals= +DebugSourceDirs= +UsePackages=0 +[Parameters] +RunParams= +HostApplication= +Launcher= +UseLauncher=0 +DebugCWD= +[Language] +ActiveLang= +RootDir= +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=6 +MinorVer=10 +Release=1 +Build=10 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +[Version Info Keys] +CompanyName=Core Lab +FileDescription= +FileVersion=6.10.1.10 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName=DAC +ProductVersion=6.10.1.10 +Comments= +[HistoryLists\hlConditionals] +Count=1 +Item0=ODAC +[HistoryLists\hlUnitAliases] +Count=1 +Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +[HistoryLists\hlUnitOutputDirectory] +Count=1 +Item0=. +[HistoryLists\hlDCPOutput] +Count=1 +Item0=. diff --git a/internal/4.10.0.10/1/Source/Delphi6/dcldac60.dpk b/internal/4.10.0.10/1/Source/Delphi6/dcldac60.dpk new file mode 100644 index 0000000..b05c823 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi6/dcldac60.dpk @@ -0,0 +1,42 @@ +package dcldac60; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Core Lab Data Access Components'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dac60, + dcldb, + dacvcl60; + +contains + DacReg in '..\Design\DacReg.pas', + VTDesign in '..\Design\VTDesign.pas', + DAMenu in '..\Design\DAMenu.pas', + DADesign in '..\Design\DADesign.pas', + Download in '..\Design\Download.pas'; + +end. diff --git a/internal/4.10.0.10/1/Source/Delphi6/dcldac60.res b/internal/4.10.0.10/1/Source/Delphi6/dcldac60.res new file mode 100644 index 0000000..d50d7f1 Binary files /dev/null and b/internal/4.10.0.10/1/Source/Delphi6/dcldac60.res differ diff --git a/internal/4.10.0.10/1/Source/Delphi6/dclsdac60.cfg b/internal/4.10.0.10/1/Source/Delphi6/dclsdac60.cfg new file mode 100644 index 0000000..80c22ff --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi6/dclsdac60.cfg @@ -0,0 +1,41 @@ +-$A8 +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-cg +-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-H+ +-W+ +-M +-$M16384,1048576 +-K$00400000 +-N"." +-LN"." +-U"..\..\..\Dac\Source\delphi6;..\..\..\Dac\Source;..;..\Design" +-O"..\..\..\Dac\Source\delphi6;..\..\..\Dac\Source;..;..\Design" +-I"..\..\..\Dac\Source\delphi6;..\..\..\Dac\Source;..;..\Design" +-R"..\..\..\Dac\Source\delphi6;..\..\..\Dac\Source;..;..\Design" +-Dsdac +-Z diff --git a/internal/4.10.0.10/1/Source/Delphi6/dclsdac60.dof b/internal/4.10.0.10/1/Source/Delphi6/dclsdac60.dof new file mode 100644 index 0000000..b2ae30b --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi6/dclsdac60.dof @@ -0,0 +1,84 @@ +[FileVersion] +Version=6.0 +[Compiler] +A=8 +B=0 +C=1 +D=0 +E=0 +F=0 +G=1 +H=1 +I=1 +J=1 +K=0 +L=0 +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=0 +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=SQL Server Data Access Components +[Directories] +OutputDir= +UnitOutputDir=. +PackageDLLOutputDir= +PackageDCPOutputDir=. +SearchPath=..\..\..\Dac\Source\delphi6;..\..\..\Dac\Source;..;..\Design;$(DELPHI)\Source\ToolsAPI;$(DELPHI)\Source\Property Editors +Packages= +Conditionals=sdac +DebugSourceDirs= +UsePackages=0 +[Parameters] +RunParams= +HostApplication= +Launcher= +UseLauncher=0 +DebugCWD= +[Language] +ActiveLang= +RootDir= +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=4 +MinorVer=10 +Release=0 +Build=10 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +[Version Info Keys] +CompanyName=Core Lab +FileDescription= +FileVersion=4.10.0.10 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName=SDAC +ProductVersion=4.10.0.10 +Comments= diff --git a/internal/4.10.0.10/1/Source/Delphi6/dclsdac60.dpk b/internal/4.10.0.10/1/Source/Delphi6/dclsdac60.dpk new file mode 100644 index 0000000..ffcdf65 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi6/dclsdac60.dpk @@ -0,0 +1,49 @@ + +////////////////////////////////////////////////// +// SQL Server Data Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +// SDAC Package for Delphi 5 +////////////////////////////////////////////////// + +package dclsdac60; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'SQL Server Data Access Components'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} +{$DEFINE sdac} + +requires + sdac60, + dcldb, + dcldac60, + vcljpg, + sdacvcl60; + +contains + MSReg in '..\Design\MSReg.pas', + MSDesign in '..\Design\MSDesign.pas', + MSMenu in '..\Design\MSMenu.pas'; + +end. diff --git a/internal/4.10.0.10/1/Source/Delphi6/dclsdac60.res b/internal/4.10.0.10/1/Source/Delphi6/dclsdac60.res new file mode 100644 index 0000000..1c23367 Binary files /dev/null and b/internal/4.10.0.10/1/Source/Delphi6/dclsdac60.res differ diff --git a/internal/4.10.0.10/1/Source/Delphi6/sdac60.cfg b/internal/4.10.0.10/1/Source/Delphi6/sdac60.cfg new file mode 100644 index 0000000..4906947 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi6/sdac60.cfg @@ -0,0 +1,42 @@ +-$A8 +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-cg +-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-H+ +-W+ +-M +-$M16384,1048576 +-K$00400000 +-N"." +-LE"d:\program files\borland\delphi6\Projects\Bpl" +-LN"." +-U"..\..\..\Dac\Source;..\..\..\Dac\Source\delphi6;..\" +-O"..\..\..\Dac\Source;..\..\..\Dac\Source\delphi6;..\" +-I"..\..\..\Dac\Source;..\..\..\Dac\Source\delphi6;..\" +-R"..\..\..\Dac\Source;..\..\..\Dac\Source\delphi6;..\" +-Dsdac +-Z diff --git a/internal/4.10.0.10/1/Source/Delphi6/sdac60.dof b/internal/4.10.0.10/1/Source/Delphi6/sdac60.dof new file mode 100644 index 0000000..6aad23d --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi6/sdac60.dof @@ -0,0 +1,84 @@ +[FileVersion] +Version=6.0 +[Compiler] +A=8 +B=0 +C=1 +D=0 +E=0 +F=0 +G=1 +H=1 +I=1 +J=1 +K=0 +L=0 +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=0 +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=SQL Server Data Access Components +[Directories] +OutputDir= +UnitOutputDir=. +PackageDLLOutputDir= +PackageDCPOutputDir=. +SearchPath=..\..\..\Dac\Source;..\..\..\Dac\Source\delphi6;..\ +Packages= +Conditionals=sdac +DebugSourceDirs= +UsePackages=0 +[Parameters] +RunParams= +HostApplication= +Launcher= +UseLauncher=0 +DebugCWD= +[Language] +ActiveLang= +RootDir= +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=4 +MinorVer=10 +Release=0 +Build=10 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +[Version Info Keys] +CompanyName=Core Lab +FileDescription= +FileVersion=4.10.0.10 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName=SDAC +ProductVersion=4.10.0.10 +Comments= diff --git a/internal/4.10.0.10/1/Source/Delphi6/sdac60.dpk b/internal/4.10.0.10/1/Source/Delphi6/sdac60.dpk new file mode 100644 index 0000000..c957d5c --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi6/sdac60.dpk @@ -0,0 +1,50 @@ + +////////////////////////////////////////////////// +// SQL Server Data Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +// SDAC Package for Delphi 6 +////////////////////////////////////////////////// + +package sdac60; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'SQL Server Data Access Components'} +{$RUNONLY} +{$IMPLICITBUILD OFF} +{$DEFINE sdac} + +requires + dac60; + +contains + OLEDBAccess in '..\OLEDBAccess.pas', + MSAccess in '..\MSAccess.pas', + OLEDBC in '..\oledbc.pas', + MSSQLMonitor in '..\MSSQLMonitor.pas', + MSParser in '..\MSParser.pas', + OLEDBIntf in '..\OLEDBIntf.pas', + MSConsts in '..\MSConsts.pas', + MSScript in '..\MSScript.pas'; + +end. diff --git a/internal/4.10.0.10/1/Source/Delphi6/sdac60.res b/internal/4.10.0.10/1/Source/Delphi6/sdac60.res new file mode 100644 index 0000000..1c23367 Binary files /dev/null and b/internal/4.10.0.10/1/Source/Delphi6/sdac60.res differ diff --git a/internal/4.10.0.10/1/Source/Delphi6/sdacvcl60.cfg b/internal/4.10.0.10/1/Source/Delphi6/sdacvcl60.cfg new file mode 100644 index 0000000..d3ea2c9 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi6/sdacvcl60.cfg @@ -0,0 +1,42 @@ +-$A8 +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-cg +-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-H+ +-W+ +-M +-$M16384,1048576 +-K$00400000 +-N"." +-LE"d:\program files\borland\delphi6\Projects\Bpl" +-LN"." +-U"..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi6;..\" +-O"..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi6;..\" +-I"..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi6;..\" +-R"..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi6;..\" +-DSDAC +-Z diff --git a/internal/4.10.0.10/1/Source/Delphi6/sdacvcl60.dof b/internal/4.10.0.10/1/Source/Delphi6/sdacvcl60.dof new file mode 100644 index 0000000..e43435b --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi6/sdacvcl60.dof @@ -0,0 +1,103 @@ +[FileVersion] +Version=6.0 +[Compiler] +A=8 +B=0 +C=1 +D=0 +E=0 +F=0 +G=1 +H=1 +I=1 +J=1 +K=0 +L=0 +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=0 +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=SQL Server Data Access GUI related Components +[Directories] +OutputDir= +UnitOutputDir=. +PackageDLLOutputDir= +PackageDCPOutputDir=. +SearchPath=..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi6;..\ +Packages= +Conditionals=SDAC +DebugSourceDirs= +UsePackages=0 +[Parameters] +RunParams= +HostApplication= +Launcher= +UseLauncher=0 +DebugCWD= +[Language] +ActiveLang= +RootDir= +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=4 +MinorVer=10 +Release=0 +Build=10 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +[Version Info Keys] +CompanyName=Core Lab +FileDescription= +FileVersion=4.10.0.10 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName=SDAC +ProductVersion=4.10.0.10 +Comments= +[HistoryLists\hlConditionals] +Count=2 +Item0=SDAC +Item1=SDAC_TEST;DEBUG +[HistoryLists\hlUnitAliases] +Count=1 +Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +[HistoryLists\hlSearchPath] +Count=4 +Item0=..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi6;..\ +Item1=$(DELPHI)\Lib\Debug;D:\Projects\Delphi\Sdac2\Source +Item2=..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi7;..\;..\..\..\ODAC\source;..\..\..\ODAC\source\Delphi7 +Item3=$(DELPHI)\Lib\Debug +[HistoryLists\hlUnitOutputDirectory] +Count=1 +Item0=. +[HistoryLists\hlOutputDirectorry] +Count=1 +Item0=. diff --git a/internal/4.10.0.10/1/Source/Delphi6/sdacvcl60.dpk b/internal/4.10.0.10/1/Source/Delphi6/sdacvcl60.dpk new file mode 100644 index 0000000..85a47b2 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi6/sdacvcl60.dpk @@ -0,0 +1,37 @@ +package sdacvcl60; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'SQL Server Data Access GUI related Components'} +{$IMPLICITBUILD OFF} +{$DEFINE SDAC} + +requires + dac60, + dacvcl60, + sdac60; + +contains + SdacVcl in '..\SdacVcl.pas'; + +end. diff --git a/internal/4.10.0.10/1/Source/Delphi6/sdacvcl60.res b/internal/4.10.0.10/1/Source/Delphi6/sdacvcl60.res new file mode 100644 index 0000000..1c23367 Binary files /dev/null and b/internal/4.10.0.10/1/Source/Delphi6/sdacvcl60.res differ diff --git a/internal/4.10.0.10/1/Source/Delphi7/Make.bat b/internal/4.10.0.10/1/Source/Delphi7/Make.bat new file mode 100644 index 0000000..93ad5bd --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi7/Make.bat @@ -0,0 +1,10 @@ +@echo off +rem ********************************************************************** +rem * +rem * Sdac for Delphi 7 +rem * +rem ********************************************************************** + +set IdeDir="D:\Program Files\Borland\Delphi7 +del /Q/S SDAC\*.* +call ..\Make.bat Delphi 7 diff --git a/internal/4.10.0.10/1/Source/Delphi7/dac70.cfg b/internal/4.10.0.10/1/Source/Delphi7/dac70.cfg new file mode 100644 index 0000000..74e1cf6 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi7/dac70.cfg @@ -0,0 +1,44 @@ +-$A8 +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-cg +-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-H+ +-W+ +-M +-$M16384,1048576 +-K$00400000 +-N"." +-LE"d:\program files\borland\delphi7\Projects\Bpl" +-LN"." +-U"..\" +-O"..\" +-I"..\" +-R"..\" +-Z +-w-UNSAFE_TYPE +-w-UNSAFE_CODE +-w-UNSAFE_CAST diff --git a/internal/4.10.0.10/1/Source/Delphi7/dac70.dof b/internal/4.10.0.10/1/Source/Delphi7/dac70.dof new file mode 100644 index 0000000..4780e49 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi7/dac70.dof @@ -0,0 +1,145 @@ +[FileVersion] +Version=7.0 +[Compiler] +A=8 +B=0 +C=1 +D=0 +E=0 +F=0 +G=1 +H=1 +I=1 +J=1 +K=0 +L=0 +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=0 +Z=1 +ShowHints=1 +ShowWarnings=1 +UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +NamespacePrefix= +SymbolDeprecated=1 +SymbolLibrary=1 +SymbolPlatform=1 +UnitLibrary=1 +UnitPlatform=1 +UnitDeprecated=1 +HResultCompat=1 +HidingMember=1 +HiddenVirtual=1 +Garbage=1 +BoundsError=1 +ZeroNilCompat=1 +StringConstTruncated=1 +ForLoopVarVarPar=1 +TypedConstVarPar=1 +AsgToTypedConst=1 +CaseLabelRange=1 +ForVariable=1 +ConstructingAbstract=1 +ComparisonFalse=1 +ComparisonTrue=1 +ComparingSignedUnsigned=1 +CombiningSignedUnsigned=1 +UnsupportedConstruct=1 +FileOpen=1 +FileOpenUnitSrc=1 +BadGlobalSymbol=1 +DuplicateConstructorDestructor=1 +InvalidDirective=1 +PackageNoLink=1 +PackageThreadVar=1 +ImplicitImport=1 +HPPEMITIgnored=1 +NoRetVal=1 +UseBeforeDef=1 +ForLoopVarUndef=1 +UnitNameMismatch=1 +NoCFGFileFound=1 +MessageDirective=1 +ImplicitVariants=1 +UnicodeToLocale=1 +LocaleToUnicode=1 +ImagebaseMultiple=1 +SuspiciousTypecast=1 +PrivatePropAccessor=1 +UnsafeType=0 +UnsafeCode=0 +UnsafeCast=0 +[Linker] +MapFile=0 +OutputObjs=0 +ConsoleApp=1 +DebugInfo=0 +RemoteSymbols=0 +MinStackSize=16384 +MaxStackSize=1048576 +ImageBase=4194304 +ExeDescription=Core Lab Data Access Components +[Directories] +OutputDir= +UnitOutputDir=. +PackageDLLOutputDir= +PackageDCPOutputDir=. +SearchPath=..\ +Packages= +Conditionals= +DebugSourceDirs= +UsePackages=0 +[Parameters] +RunParams= +HostApplication= +Launcher= +UseLauncher=0 +DebugCWD= +[Language] +ActiveLang= +RootDir= +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=6 +MinorVer=10 +Release=1 +Build=10 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +[Version Info Keys] +CompanyName=Core Lab +FileDescription= +FileVersion=6.10.1.10 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName=DAC +ProductVersion=6.10.1.10 +Comments= +[HistoryLists\hlConditionals] +Count=1 +Item0=ODAC +[HistoryLists\hlUnitAliases] +Count=1 +Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +[HistoryLists\hlUnitOutputDirectory] +Count=1 +Item0=. +[HistoryLists\hlDCPOutput] +Count=1 +Item0=. diff --git a/internal/4.10.0.10/1/Source/Delphi7/dac70.dpk b/internal/4.10.0.10/1/Source/Delphi7/dac70.dpk new file mode 100644 index 0000000..43c5429 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi7/dac70.dpk @@ -0,0 +1,52 @@ +package dac70; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Core Lab Data Access Components'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl; + +contains + CRAccess in '..\CRAccess.pas', + DALoader in '..\DALoader.pas', + CRParser in '..\CRParser.pas', + DAConsts in '..\DAConsts.pas', + DBMonitorIntf in '..\DBMonitorIntf.pas', + DBMonitorClient in '..\DBMonitorClient.pas', + DASQLMonitor in '..\DASQLMonitor.pas', + DBAccess in '..\DBAccess.pas', + MemData in '..\MemData.pas', + MemDS in '..\MemDS.pas', + VirtualTable in '..\VirtualTable.pas', + DAVersionInfo in '..\DAVersionInfo.pas', + CLRClasses in '..\CLRClasses.pas', + MemUtils in '..\MemUtils.pas', + DAScript in '..\DAScript.pas', + DADump in '..\DADump.pas', + CRBatchMove in '..\CRBatchMove.pas'; + +end. diff --git a/internal/4.10.0.10/1/Source/Delphi7/dac70.res b/internal/4.10.0.10/1/Source/Delphi7/dac70.res new file mode 100644 index 0000000..d50d7f1 Binary files /dev/null and b/internal/4.10.0.10/1/Source/Delphi7/dac70.res differ diff --git a/internal/4.10.0.10/1/Source/Delphi7/dacvcl70.cfg b/internal/4.10.0.10/1/Source/Delphi7/dacvcl70.cfg new file mode 100644 index 0000000..6f6cdec --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi7/dacvcl70.cfg @@ -0,0 +1,44 @@ +-$A8 +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-cg +-vn +-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-H+ +-W+ +-M +-$M16384,1048576 +-K$00400000 +-LE"d:\program files\borland\delphi7\Projects\Bpl" +-LN"d:\program files\borland\delphi7\Projects\Bpl" +-U"d:\program files\borland\delphi7\Lib\Debug;D:\Crypto\!SSH_Source;D:\Projects\Delphi\Dac\Source\Design" +-O"d:\program files\borland\delphi7\Lib\Debug;D:\Crypto\!SSH_Source;D:\Projects\Delphi\Dac\Source\Design" +-I"d:\program files\borland\delphi7\Lib\Debug;D:\Crypto\!SSH_Source;D:\Projects\Delphi\Dac\Source\Design" +-R"d:\program files\borland\delphi7\Lib\Debug;D:\Crypto\!SSH_Source;D:\Projects\Delphi\Dac\Source\Design" +-Z +-w-UNSAFE_TYPE +-w-UNSAFE_CODE +-w-UNSAFE_CAST diff --git a/internal/4.10.0.10/1/Source/Delphi7/dacvcl70.dof b/internal/4.10.0.10/1/Source/Delphi7/dacvcl70.dof new file mode 100644 index 0000000..3c9e2f6 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi7/dacvcl70.dof @@ -0,0 +1,145 @@ +[FileVersion] +Version=7.0 +[Compiler] +A=8 +B=0 +C=1 +D=0 +E=0 +F=0 +G=1 +H=1 +I=1 +J=1 +K=0 +L=0 +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=0 +Z=1 +ShowHints=1 +ShowWarnings=1 +UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +NamespacePrefix= +SymbolDeprecated=1 +SymbolLibrary=1 +SymbolPlatform=1 +UnitLibrary=1 +UnitPlatform=1 +UnitDeprecated=1 +HResultCompat=1 +HidingMember=1 +HiddenVirtual=1 +Garbage=1 +BoundsError=1 +ZeroNilCompat=1 +StringConstTruncated=1 +ForLoopVarVarPar=1 +TypedConstVarPar=1 +AsgToTypedConst=1 +CaseLabelRange=1 +ForVariable=1 +ConstructingAbstract=1 +ComparisonFalse=1 +ComparisonTrue=1 +ComparingSignedUnsigned=1 +CombiningSignedUnsigned=1 +UnsupportedConstruct=1 +FileOpen=1 +FileOpenUnitSrc=1 +BadGlobalSymbol=1 +DuplicateConstructorDestructor=1 +InvalidDirective=1 +PackageNoLink=1 +PackageThreadVar=1 +ImplicitImport=1 +HPPEMITIgnored=1 +NoRetVal=1 +UseBeforeDef=1 +ForLoopVarUndef=1 +UnitNameMismatch=1 +NoCFGFileFound=1 +MessageDirective=1 +ImplicitVariants=1 +UnicodeToLocale=1 +LocaleToUnicode=1 +ImagebaseMultiple=1 +SuspiciousTypecast=1 +PrivatePropAccessor=1 +UnsafeType=0 +UnsafeCode=0 +UnsafeCast=0 +[Linker] +MapFile=0 +OutputObjs=0 +ConsoleApp=1 +DebugInfo=0 +RemoteSymbols=0 +MinStackSize=16384 +MaxStackSize=1048576 +ImageBase=4194304 +ExeDescription=Core Lab Data Access GUI related Components +[Directories] +OutputDir= +UnitOutputDir=. +PackageDLLOutputDir= +PackageDCPOutputDir=. +SearchPath=..\ +Packages= +Conditionals= +DebugSourceDirs= +UsePackages=0 +[Parameters] +RunParams= +HostApplication= +Launcher= +UseLauncher=0 +DebugCWD= +[Language] +ActiveLang= +RootDir= +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=6 +MinorVer=10 +Release=1 +Build=10 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +[Version Info Keys] +CompanyName=Core Lab +FileDescription= +FileVersion=6.10.1.10 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName=DAC +ProductVersion=6.10.1.10 +Comments= +[HistoryLists\hlConditionals] +Count=1 +Item0=ODAC +[HistoryLists\hlUnitAliases] +Count=1 +Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +[HistoryLists\hlUnitOutputDirectory] +Count=1 +Item0=. +[HistoryLists\hlDCPOutput] +Count=1 +Item0=. diff --git a/internal/4.10.0.10/1/Source/Delphi7/dacvcl70.dpk b/internal/4.10.0.10/1/Source/Delphi7/dacvcl70.dpk new file mode 100644 index 0000000..c596b09 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi7/dacvcl70.dpk @@ -0,0 +1,36 @@ +package dacvcl70; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Core Lab Data Access GUI related Components'} +{$IMPLICITBUILD OFF} + +requires + rtl, + dac70, + vcl; + +contains + DacVcl in '..\DacVcl.pas'; + +end. diff --git a/internal/4.10.0.10/1/Source/Delphi7/dacvcl70.res b/internal/4.10.0.10/1/Source/Delphi7/dacvcl70.res new file mode 100644 index 0000000..d50d7f1 Binary files /dev/null and b/internal/4.10.0.10/1/Source/Delphi7/dacvcl70.res differ diff --git a/internal/4.10.0.10/1/Source/Delphi7/dcldac70.cfg b/internal/4.10.0.10/1/Source/Delphi7/dcldac70.cfg new file mode 100644 index 0000000..136d63a --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi7/dcldac70.cfg @@ -0,0 +1,44 @@ +-$A8 +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J- +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-cg +-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-H+ +-W+ +-M +-$M16384,1048576 +-K$00400000 +-N"." +-LE"d:\program files\borland\delphi7\Projects\Bpl" +-LN"." +-U"..\;d:\program files\borland\delphi7\Source\ToolsAPI;..\Design" +-O"..\;d:\program files\borland\delphi7\Source\ToolsAPI;..\Design" +-I"..\;d:\program files\borland\delphi7\Source\ToolsAPI;..\Design" +-R"..\;d:\program files\borland\delphi7\Source\ToolsAPI;..\Design" +-Z +-w-UNSAFE_TYPE +-w-UNSAFE_CODE +-w-UNSAFE_CAST diff --git a/internal/4.10.0.10/1/Source/Delphi7/dcldac70.dof b/internal/4.10.0.10/1/Source/Delphi7/dcldac70.dof new file mode 100644 index 0000000..8f9c382 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi7/dcldac70.dof @@ -0,0 +1,148 @@ +[FileVersion] +Version=7.0 +[Compiler] +A=8 +B=0 +C=1 +D=0 +E=0 +F=0 +G=1 +H=1 +I=1 +J=0 +K=0 +L=0 +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=0 +Z=1 +ShowHints=1 +ShowWarnings=1 +UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +NamespacePrefix= +SymbolDeprecated=1 +SymbolLibrary=1 +SymbolPlatform=1 +UnitLibrary=1 +UnitPlatform=1 +UnitDeprecated=1 +HResultCompat=1 +HidingMember=1 +HiddenVirtual=1 +Garbage=1 +BoundsError=1 +ZeroNilCompat=1 +StringConstTruncated=1 +ForLoopVarVarPar=1 +TypedConstVarPar=1 +AsgToTypedConst=1 +CaseLabelRange=1 +ForVariable=1 +ConstructingAbstract=1 +ComparisonFalse=1 +ComparisonTrue=1 +ComparingSignedUnsigned=1 +CombiningSignedUnsigned=1 +UnsupportedConstruct=1 +FileOpen=1 +FileOpenUnitSrc=1 +BadGlobalSymbol=1 +DuplicateConstructorDestructor=1 +InvalidDirective=1 +PackageNoLink=1 +PackageThreadVar=1 +ImplicitImport=1 +HPPEMITIgnored=1 +NoRetVal=1 +UseBeforeDef=1 +ForLoopVarUndef=1 +UnitNameMismatch=1 +NoCFGFileFound=1 +MessageDirective=1 +ImplicitVariants=1 +UnicodeToLocale=1 +LocaleToUnicode=1 +ImagebaseMultiple=1 +SuspiciousTypecast=1 +PrivatePropAccessor=1 +UnsafeType=0 +UnsafeCode=0 +UnsafeCast=0 +[Linker] +MapFile=0 +OutputObjs=0 +ConsoleApp=1 +DebugInfo=0 +RemoteSymbols=0 +MinStackSize=16384 +MaxStackSize=1048576 +ImageBase=4194304 +ExeDescription=Core Lab Data Access Components +[Directories] +OutputDir= +UnitOutputDir=. +PackageDLLOutputDir= +PackageDCPOutputDir=. +SearchPath=..\;$(DELPHI)\Source\ToolsAPI;..\Design +Packages= +Conditionals= +DebugSourceDirs= +UsePackages=0 +[Parameters] +RunParams= +HostApplication= +Launcher= +UseLauncher=0 +DebugCWD= +[Language] +ActiveLang= +RootDir= +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=6 +MinorVer=10 +Release=1 +Build=10 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +[Version Info Keys] +CompanyName=Core Lab +FileDescription= +FileVersion=6.10.1.10 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName=DAC +ProductVersion=6.10.1.10 +[HistoryLists\hlConditionals] +Count=1 +Item0=ODAC +[HistoryLists\hlUnitAliases] +Count=1 +Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +[HistoryLists\hlSearchPath] +Count=2 +Item0=..\;$(DELPHI)\Source\ToolsAPI;..\Design +Item1=..\;.\Design;$(DELPHI)\Source\ToolsAPI +[HistoryLists\hlUnitOutputDirectory] +Count=1 +Item0=. +[HistoryLists\hlDCPOutput] +Count=1 +Item0=. diff --git a/internal/4.10.0.10/1/Source/Delphi7/dcldac70.dpk b/internal/4.10.0.10/1/Source/Delphi7/dcldac70.dpk new file mode 100644 index 0000000..8b33f95 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi7/dcldac70.dpk @@ -0,0 +1,52 @@ +package dcldac70; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Core Lab Data Access Components'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dac70, + dcldb, + dacvcl70, + vcl, + dbrtl, + visualclx, + vcldb, + visualdbclx, + designide, + vclactnband, + vcldesigner, + designdgm, + dclstd; + +contains + DacReg in '..\Design\DacReg.pas', + VTDesign in '..\Design\VTDesign.pas', + DAMenu in '..\Design\DAMenu.pas', + DADesign in '..\Design\DADesign.pas', + Download in '..\Design\Download.pas'; + +end. diff --git a/internal/4.10.0.10/1/Source/Delphi7/dcldac70.res b/internal/4.10.0.10/1/Source/Delphi7/dcldac70.res new file mode 100644 index 0000000..d50d7f1 Binary files /dev/null and b/internal/4.10.0.10/1/Source/Delphi7/dcldac70.res differ diff --git a/internal/4.10.0.10/1/Source/Delphi7/dclsdac70.cfg b/internal/4.10.0.10/1/Source/Delphi7/dclsdac70.cfg new file mode 100644 index 0000000..80861d8 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi7/dclsdac70.cfg @@ -0,0 +1,44 @@ +-$A8 +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-cg +-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-H+ +-W+ +-M +-$M16384,1048576 +-K$00400000 +-N"." +-LN"." +-U"..\..\..\Dac\Source\delphi7;..\..\..\Dac\Source;..;..\Design" +-O"..\..\..\Dac\Source\delphi7;..\..\..\Dac\Source;..;..\Design" +-I"..\..\..\Dac\Source\delphi7;..\..\..\Dac\Source;..;..\Design" +-R"..\..\..\Dac\Source\delphi7;..\..\..\Dac\Source;..;..\Design" +-Dsdac +-Z +-w-UNSAFE_TYPE +-w-UNSAFE_CODE +-w-UNSAFE_CAST diff --git a/internal/4.10.0.10/1/Source/Delphi7/dclsdac70.dof b/internal/4.10.0.10/1/Source/Delphi7/dclsdac70.dof new file mode 100644 index 0000000..cea6d87 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi7/dclsdac70.dof @@ -0,0 +1,142 @@ +[FileVersion] +Version=7.0 +[Compiler] +A=8 +B=0 +C=1 +D=0 +E=0 +F=0 +G=1 +H=1 +I=1 +J=1 +K=0 +L=0 +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=0 +Z=1 +ShowHints=1 +ShowWarnings=1 +UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +NamespacePrefix= +SymbolDeprecated=1 +SymbolLibrary=1 +SymbolPlatform=1 +UnitLibrary=1 +UnitPlatform=1 +UnitDeprecated=1 +HResultCompat=1 +HidingMember=1 +HiddenVirtual=1 +Garbage=1 +BoundsError=1 +ZeroNilCompat=1 +StringConstTruncated=1 +ForLoopVarVarPar=1 +TypedConstVarPar=1 +AsgToTypedConst=1 +CaseLabelRange=1 +ForVariable=1 +ConstructingAbstract=1 +ComparisonFalse=1 +ComparisonTrue=1 +ComparingSignedUnsigned=1 +CombiningSignedUnsigned=1 +UnsupportedConstruct=1 +FileOpen=1 +FileOpenUnitSrc=1 +BadGlobalSymbol=1 +DuplicateConstructorDestructor=1 +InvalidDirective=1 +PackageNoLink=1 +PackageThreadVar=1 +ImplicitImport=1 +HPPEMITIgnored=1 +NoRetVal=1 +UseBeforeDef=1 +ForLoopVarUndef=1 +UnitNameMismatch=1 +NoCFGFileFound=1 +MessageDirective=1 +ImplicitVariants=1 +UnicodeToLocale=1 +LocaleToUnicode=1 +ImagebaseMultiple=1 +SuspiciousTypecast=1 +PrivatePropAccessor=1 +UnsafeType=0 +UnsafeCode=0 +UnsafeCast=0 +[Linker] +MapFile=0 +OutputObjs=0 +ConsoleApp=1 +DebugInfo=0 +RemoteSymbols=0 +MinStackSize=16384 +MaxStackSize=1048576 +ImageBase=4194304 +ExeDescription=SQL Server Data Access Components +[Directories] +OutputDir= +UnitOutputDir=. +PackageDLLOutputDir= +PackageDCPOutputDir=. +SearchPath=..\..\..\Dac\Source\delphi7;..\..\..\Dac\Source;..;..\Design +Packages= +Conditionals=sdac +DebugSourceDirs= +UsePackages=0 +[Parameters] +RunParams= +HostApplication= +Launcher= +UseLauncher=0 +DebugCWD= +[Language] +ActiveLang= +RootDir= +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=4 +MinorVer=10 +Release=0 +Build=10 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +[Version Info Keys] +CompanyName= +FileDescription=Core Lab +FileVersion=4.10.0.10 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName=SDAC +ProductVersion=4.10.0.10 +Comments= +[HistoryLists\hlUnitAliases] +Count=1 +Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +[HistoryLists\hlUnitOutputDirectory] +Count=1 +Item0=. +[HistoryLists\hlOutputDirectorry] +Count=1 +Item0=. diff --git a/internal/4.10.0.10/1/Source/Delphi7/dclsdac70.dpk b/internal/4.10.0.10/1/Source/Delphi7/dclsdac70.dpk new file mode 100644 index 0000000..ab320cc --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi7/dclsdac70.dpk @@ -0,0 +1,50 @@ + +////////////////////////////////////////////////// +// SQL Server Data Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +// SDAC Package for Delphi 7 +////////////////////////////////////////////////// + +package dclsdac70; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'SQL Server Data Access Components'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} +{$DEFINE sdac} + +requires + sdac70, + dcldb, + dcldac70, + vcljpg, + sdacvcl70, + designide; + +contains + MSReg in '..\Design\MSReg.pas', + MSDesign in '..\Design\MSDesign.pas', + MSMenu in '..\Design\MSMenu.pas'; + +end. diff --git a/internal/4.10.0.10/1/Source/Delphi7/dclsdac70.res b/internal/4.10.0.10/1/Source/Delphi7/dclsdac70.res new file mode 100644 index 0000000..1c23367 Binary files /dev/null and b/internal/4.10.0.10/1/Source/Delphi7/dclsdac70.res differ diff --git a/internal/4.10.0.10/1/Source/Delphi7/sdac70.cfg b/internal/4.10.0.10/1/Source/Delphi7/sdac70.cfg new file mode 100644 index 0000000..e4d4ef0 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi7/sdac70.cfg @@ -0,0 +1,44 @@ +-$A8 +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-cg +-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-H+ +-W+ +-M +-$M16384,1048576 +-K$00400000 +-N"." +-LN"." +-U"..\..\..\Dac\Source;..\..\..\Dac\Source\delphi7;..\" +-O"..\..\..\Dac\Source;..\..\..\Dac\Source\delphi7;..\" +-I"..\..\..\Dac\Source;..\..\..\Dac\Source\delphi7;..\" +-R"..\..\..\Dac\Source;..\..\..\Dac\Source\delphi7;..\" +-Dsdac +-Z +-w-UNSAFE_TYPE +-w-UNSAFE_CODE +-w-UNSAFE_CAST diff --git a/internal/4.10.0.10/1/Source/Delphi7/sdac70.dof b/internal/4.10.0.10/1/Source/Delphi7/sdac70.dof new file mode 100644 index 0000000..d11e882 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi7/sdac70.dof @@ -0,0 +1,145 @@ +[FileVersion] +Version=7.0 +[Compiler] +A=8 +B=0 +C=1 +D=0 +E=0 +F=0 +G=1 +H=1 +I=1 +J=1 +K=0 +L=0 +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=0 +Z=1 +ShowHints=1 +ShowWarnings=1 +UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +NamespacePrefix= +SymbolDeprecated=1 +SymbolLibrary=1 +SymbolPlatform=1 +UnitLibrary=1 +UnitPlatform=1 +UnitDeprecated=1 +HResultCompat=1 +HidingMember=1 +HiddenVirtual=1 +Garbage=1 +BoundsError=1 +ZeroNilCompat=1 +StringConstTruncated=1 +ForLoopVarVarPar=1 +TypedConstVarPar=1 +AsgToTypedConst=1 +CaseLabelRange=1 +ForVariable=1 +ConstructingAbstract=1 +ComparisonFalse=1 +ComparisonTrue=1 +ComparingSignedUnsigned=1 +CombiningSignedUnsigned=1 +UnsupportedConstruct=1 +FileOpen=1 +FileOpenUnitSrc=1 +BadGlobalSymbol=1 +DuplicateConstructorDestructor=1 +InvalidDirective=1 +PackageNoLink=1 +PackageThreadVar=1 +ImplicitImport=1 +HPPEMITIgnored=1 +NoRetVal=1 +UseBeforeDef=1 +ForLoopVarUndef=1 +UnitNameMismatch=1 +NoCFGFileFound=1 +MessageDirective=1 +ImplicitVariants=1 +UnicodeToLocale=1 +LocaleToUnicode=1 +ImagebaseMultiple=1 +SuspiciousTypecast=1 +PrivatePropAccessor=1 +UnsafeType=0 +UnsafeCode=0 +UnsafeCast=0 +[Linker] +MapFile=0 +OutputObjs=0 +ConsoleApp=1 +DebugInfo=0 +RemoteSymbols=0 +MinStackSize=16384 +MaxStackSize=1048576 +ImageBase=4194304 +ExeDescription=SQL Server Data Access Components +[Directories] +OutputDir= +UnitOutputDir=. +PackageDLLOutputDir= +PackageDCPOutputDir=. +SearchPath=..\..\..\Dac\Source;..\..\..\Dac\Source\delphi7;..\ +Packages= +Conditionals=sdac +DebugSourceDirs= +UsePackages=0 +[Parameters] +RunParams= +HostApplication= +Launcher= +UseLauncher=0 +DebugCWD= +[Language] +ActiveLang= +RootDir= +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=4 +MinorVer=10 +Release=0 +Build=10 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +[Version Info Keys] +CompanyName=Core Lab +FileDescription= +FileVersion=4.10.0.10 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName=SDAC +ProductVersion=4.10.0.10 +Comments= +[HistoryLists\hlUnitAliases] +Count=1 +Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +[HistoryLists\hlSearchPath] +Count=1 +Item0=$(DELPHI)\Lib\Debug +[HistoryLists\hlUnitOutputDirectory] +Count=1 +Item0=. +[HistoryLists\hlOutputDirectorry] +Count=1 +Item0=. diff --git a/internal/4.10.0.10/1/Source/Delphi7/sdac70.dpk b/internal/4.10.0.10/1/Source/Delphi7/sdac70.dpk new file mode 100644 index 0000000..78e1bb3 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi7/sdac70.dpk @@ -0,0 +1,49 @@ + +////////////////////////////////////////////////// +// SQL Server Data Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +// SDAC Package for Delphi 7 +////////////////////////////////////////////////// + +package sdac70; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'SQL Server Data Access Components'} +{$RUNONLY} +{$IMPLICITBUILD OFF} +{$DEFINE sdac} + +requires + dac70; + +contains + OLEDBAccess in '..\OLEDBAccess.pas', + MSAccess in '..\MSAccess.pas', + OLEDBC in '..\oledbc.pas', + MSSQLMonitor in '..\MSSQLMonitor.pas', + MSParser in '..\MSParser.pas', + MSConsts in '..\MSConsts.pas', + MSScript in '..\MSScript.pas'; + +end. diff --git a/internal/4.10.0.10/1/Source/Delphi7/sdac70.res b/internal/4.10.0.10/1/Source/Delphi7/sdac70.res new file mode 100644 index 0000000..1c23367 Binary files /dev/null and b/internal/4.10.0.10/1/Source/Delphi7/sdac70.res differ diff --git a/internal/4.10.0.10/1/Source/Delphi7/sdacvcl70.cfg b/internal/4.10.0.10/1/Source/Delphi7/sdacvcl70.cfg new file mode 100644 index 0000000..8a65795 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi7/sdacvcl70.cfg @@ -0,0 +1,44 @@ +-$A8 +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-cg +-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-H+ +-W+ +-M +-$M16384,1048576 +-K$00400000 +-N"." +-LN"." +-U"..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi7;..\" +-O"..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi7;..\" +-I"..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi7;..\" +-R"..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi7;..\" +-DSDAC +-Z +-w-UNSAFE_TYPE +-w-UNSAFE_CODE +-w-UNSAFE_CAST diff --git a/internal/4.10.0.10/1/Source/Delphi7/sdacvcl70.dof b/internal/4.10.0.10/1/Source/Delphi7/sdacvcl70.dof new file mode 100644 index 0000000..120220b --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi7/sdacvcl70.dof @@ -0,0 +1,130 @@ +[FileVersion] +Version=7.0 +[Compiler] +A=8 +B=0 +C=1 +D=0 +E=0 +F=0 +G=1 +H=1 +I=1 +J=1 +K=0 +L=0 +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=0 +Z=1 +ShowHints=1 +ShowWarnings=1 +UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +NamespacePrefix= +SymbolDeprecated=1 +SymbolLibrary=1 +SymbolPlatform=1 +UnitLibrary=1 +UnitPlatform=1 +UnitDeprecated=1 +HResultCompat=1 +HidingMember=1 +HiddenVirtual=1 +Garbage=1 +BoundsError=1 +ZeroNilCompat=1 +StringConstTruncated=1 +ForLoopVarVarPar=1 +TypedConstVarPar=1 +AsgToTypedConst=1 +CaseLabelRange=1 +ForVariable=1 +ConstructingAbstract=1 +ComparisonFalse=1 +ComparisonTrue=1 +ComparingSignedUnsigned=1 +CombiningSignedUnsigned=1 +UnsupportedConstruct=1 +FileOpen=1 +FileOpenUnitSrc=1 +BadGlobalSymbol=1 +DuplicateConstructorDestructor=1 +InvalidDirective=1 +PackageNoLink=1 +PackageThreadVar=1 +ImplicitImport=1 +HPPEMITIgnored=1 +NoRetVal=1 +UseBeforeDef=1 +ForLoopVarUndef=1 +UnitNameMismatch=1 +NoCFGFileFound=1 +MessageDirective=1 +ImplicitVariants=1 +UnicodeToLocale=1 +LocaleToUnicode=1 +ImagebaseMultiple=1 +SuspiciousTypecast=1 +PrivatePropAccessor=1 +UnsafeType=0 +UnsafeCode=0 +UnsafeCast=0 +[Linker] +MapFile=0 +OutputObjs=0 +ConsoleApp=1 +DebugInfo=0 +RemoteSymbols=0 +MinStackSize=16384 +MaxStackSize=1048576 +ImageBase=4194304 +ExeDescription=SQL Server Data Access GUI related Components +[Directories] +OutputDir= +UnitOutputDir=. +PackageDLLOutputDir= +PackageDCPOutputDir=. +SearchPath=..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi7;..\ +Packages= +Conditionals=SDAC +DebugSourceDirs= +UsePackages=0 +[Parameters] +RunParams= +HostApplication= +Launcher= +UseLauncher=0 +DebugCWD= +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=4 +MinorVer=10 +Release=0 +Build=10 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +[Version Info Keys] +CompanyName=Core Lab +FileDescription= +FileVersion=4.10.0.10 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName=SDAC +ProductVersion=4.10.0.10 +Comments= diff --git a/internal/4.10.0.10/1/Source/Delphi7/sdacvcl70.dpk b/internal/4.10.0.10/1/Source/Delphi7/sdacvcl70.dpk new file mode 100644 index 0000000..e691fb9 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi7/sdacvcl70.dpk @@ -0,0 +1,38 @@ +package sdacvcl70; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'SQL Server Data Access GUI related Components'} +{$IMPLICITBUILD OFF} +{$DEFINE SDAC} + +requires + dac70, + dacvcl70, + sdac70; + +contains + SdacVcl in '..\SdacVcl.pas', + MSConnectForm in '..\MSConnectForm.pas' {MSConnectForm}; + +end. diff --git a/internal/4.10.0.10/1/Source/Delphi7/sdacvcl70.res b/internal/4.10.0.10/1/Source/Delphi7/sdacvcl70.res new file mode 100644 index 0000000..1c23367 Binary files /dev/null and b/internal/4.10.0.10/1/Source/Delphi7/sdacvcl70.res differ diff --git a/internal/4.10.0.10/1/Source/Delphi8/CoreLab.Dac.AdoNet.bdsproj b/internal/4.10.0.10/1/Source/Delphi8/CoreLab.Dac.AdoNet.bdsproj new file mode 100644 index 0000000..1ddac1e --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi8/CoreLab.Dac.AdoNet.bdsproj @@ -0,0 +1,197 @@ + + + + + + + + + + + + CoreLab.Dac.AdoNet.dpk + + + 7.0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 0 + 1 + True + True + WinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + Borland.Vcl;CoreLab.Dac + False + + False + True + False + True + True + False + True + True + True + True + True + True + True + True + True + True + True + True + False + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + + + 0 + 0 + 1 + True + False + 4096 + 1048576 + 4194304 + Core Lab Data Access Components + False + + + + . + + . + .\;..\Net;..\ + CoreLab.Dac;Borland.VclDbRtl;d:\winnt\microsoft.net\framework\v1.1.4322\System.Data.dll;Borland.Delphi + + + False + + + + + + False + + + + + + False + + + + $00000000 + + + + True + False + 6 + 10 + 1 + 2010 + False + False + False + False + False + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/internal/4.10.0.10/1/Source/Delphi8/CoreLab.Dac.AdoNet.cfg b/internal/4.10.0.10/1/Source/Delphi8/CoreLab.Dac.AdoNet.cfg new file mode 100644 index 0000000..2945e3d --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi8/CoreLab.Dac.AdoNet.cfg @@ -0,0 +1,46 @@ +-$A- +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-cg +-vn +-AWinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-NSBorland.Vcl;CoreLab.Dac +-H+ +-W+ +-M +-$M4096,1048576 +-K$00400000 +-N"." +-LN"." +-U".\;..\Net;..\" +-O".\;..\Net;..\" +-I".\;..\Net;..\" +-R".\;..\Net;..\" +-Z +-w-SYMBOL_DEPRECATED +-w-SYMBOL_PLATFORM +-w-UNIT_PLATFORM +-w-CASE_LABEL_RANGE diff --git a/internal/4.10.0.10/1/Source/Delphi8/CoreLab.Dac.AdoNet.dpk b/internal/4.10.0.10/1/Source/Delphi8/CoreLab.Dac.AdoNet.dpk new file mode 100644 index 0000000..a309f38 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi8/CoreLab.Dac.AdoNet.dpk @@ -0,0 +1,97 @@ +package CoreLab.Dac.AdoNet; + + +{$ALIGN 0} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Core Lab Data Access Components'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + Borland.Delphi, + System.Data, + Borland.VclDbRtl, + CoreLab.Dac; + +contains + CoreLab.Dac.DataAdapter in '..\Net\CoreLab.Dac.DataAdapter.pas'; + +[assembly: AssemblyTitle('CoreLab.Dac.AdoNet')] +[assembly: AssemblyDescription('')] +[assembly: AssemblyConfiguration('')] +[assembly: AssemblyCompany('Core Lab')] +[assembly: AssemblyProduct('Core Lab Data Access Components')] +[assembly: AssemblyCopyright('')] +[assembly: AssemblyTrademark('')] +[assembly: AssemblyCulture('')] + + +// The Delphi compiler controls the AssemblyTitleAttribute via the ExeDescription. +// You can set this in the IDE via the Project Options. +// Manually setting the AssemblyTitle attribute below will override the IDE +// setting. +// [assembly: AssemblyTitle('')] + + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion('6.10.1.2010')] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile('mykey.snk')], provided your output +// directory is the project directory (the default). +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile('CoreLab.snk')] +[assembly: AssemblyKeyName('')] + +end. diff --git a/internal/4.10.0.10/1/Source/Delphi8/CoreLab.Dac.Design.bdsproj b/internal/4.10.0.10/1/Source/Delphi8/CoreLab.Dac.Design.bdsproj new file mode 100644 index 0000000..9779f3d --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi8/CoreLab.Dac.Design.bdsproj @@ -0,0 +1,202 @@ + + + + + + + + + + + + CoreLab.Dac.Design.dpk + + + 7.0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 0 + 1 + True + True + WinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + CoreLab.Dac;CoreLab.Dac.Design + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + + + 0 + 0 + 1 + False + False + False + 4096 + 1048576 + 4194304 + Data Access Components + + + + . + + . + ..\Design;.\;..\Net;..\;d:\program files\common files\borland shared\bds\shared assemblies\2.0;d:\projects\delphi\dac\source\delphi8;d:\program files\borland\bds\2.0\bin;D:\Projects\Delphi\Dac\Source\Delphi8 + Borland.Vcl.Design.DbRtl;Borland.VclDbCtrls;Borland.Studio.Vcl.Design;D:\Projects\Delphi\Dac\Source\Delphi8\CoreLab.Dac.dll;Borland.VclRtl;Borland.Vcl;Borland.Delphi + + + False + + + + + + False + + + + + + False + + + + $00000000 + + + + True + False + 6 + 10 + 1 + 2010 + False + False + False + False + False + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/internal/4.10.0.10/1/Source/Delphi8/CoreLab.Dac.Design.cfg b/internal/4.10.0.10/1/Source/Delphi8/CoreLab.Dac.Design.cfg new file mode 100644 index 0000000..3d69376 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi8/CoreLab.Dac.Design.cfg @@ -0,0 +1,40 @@ +-$A- +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J- +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-cg +-AWinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-NSCoreLab.Dac;CoreLab.Dac.Design +-H+ +-W+ +-M +-$M4096,1048576 +-K$00400000 +-N"." +-LN"." +-U"..\Design;.\;..\Net;..\;d:\program files\common files\borland shared\bds\shared assemblies\2.0;d:\projects\delphi\dac\source\delphi8;d:\program files\borland\bds\2.0\bin;D:\Projects\Delphi\Dac\Source\Delphi8" +-O"..\Design;.\;..\Net;..\;d:\program files\common files\borland shared\bds\shared assemblies\2.0;d:\projects\delphi\dac\source\delphi8;d:\program files\borland\bds\2.0\bin;D:\Projects\Delphi\Dac\Source\Delphi8" +-I"..\Design;.\;..\Net;..\;d:\program files\common files\borland shared\bds\shared assemblies\2.0;d:\projects\delphi\dac\source\delphi8;d:\program files\borland\bds\2.0\bin;D:\Projects\Delphi\Dac\Source\Delphi8" +-R"..\Design;.\;..\Net;..\;d:\program files\common files\borland shared\bds\shared assemblies\2.0;d:\projects\delphi\dac\source\delphi8;d:\program files\borland\bds\2.0\bin;D:\Projects\Delphi\Dac\Source\Delphi8" diff --git a/internal/4.10.0.10/1/Source/Delphi8/CoreLab.Dac.Design.dpk b/internal/4.10.0.10/1/Source/Delphi8/CoreLab.Dac.Design.dpk new file mode 100644 index 0000000..074c0e3 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi8/CoreLab.Dac.Design.dpk @@ -0,0 +1,129 @@ +package CoreLab.Dac.Design; + + +{$ALIGN 0} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Data Access Components'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + Borland.Delphi, + Borland.Vcl, + Borland.VclRtl, + CoreLab.Dac, + Borland.Studio.Vcl.Design, + Borland.Studio.ToolsAPI, + Borland.VclDbCtrls, + Borland.Vcl.Design.DbRtl; + +contains + CoreLab.Dac.Design.DacReg in '..\Net\CoreLab.Dac.Design.DacReg.pas', + CoreLab.Dac.Design.VTDesign in '..\Net\CoreLab.Dac.Design.VTDesign.pas', + CoreLab.Dac.Design.DAMenu in '..\Net\CoreLab.Dac.Design.DAMenu.pas', + CoreLab.Dac.Design.DADesign in '..\Net\CoreLab.Dac.Design.DADesign.pas', + CoreLab.Dac.Design.DAUpdateSQLFrame in '..\Net\CoreLab.Dac.Design.DAUpdateSQLFrame.pas', + CoreLab.Dac.Design.CRFrame in '..\Net\CoreLab.Dac.Design.CRFrame.pas', + CoreLab.Dac.Design.CRColFrame in '..\Net\CoreLab.Dac.Design.CRColFrame.pas', + CoreLab.Dac.Design.CRTabEditor in '..\Net\CoreLab.Dac.Design.CRTabEditor.pas', + CoreLab.Dac.Design.DAConnectionEditor in '..\Net\CoreLab.Dac.Design.DAConnectionEditor.pas', + CoreLab.Dac.Design.CRDataEditor in '..\Net\CoreLab.Dac.Design.CRDataEditor.pas', + CoreLab.Dac.Design.DADataEditor in '..\Net\CoreLab.Dac.Design.DADataEditor.pas', + CoreLab.Dac.Design.DAMacrosFrame in '..\Net\CoreLab.Dac.Design.DAMacrosFrame.pas', + CoreLab.Dac.Design.DAParamsFrame in '..\Net\CoreLab.Dac.Design.DAParamsFrame.pas', + CoreLab.Dac.Design.DAParamValueEditor in '..\Net\CoreLab.Dac.Design.DAParamValueEditor.pas', + CoreLab.Dac.Design.DAQueryEditor in '..\Net\CoreLab.Dac.Design.DAQueryEditor.pas', + CoreLab.Dac.Design.DADualListEditor in '..\Net\CoreLab.Dac.Design.DADualListEditor.pas', + CoreLab.Dac.Design.DADumpProgress in '..\Net\CoreLab.Dac.Design.DADumpProgress.pas', + CoreLab.Dac.Design.DADumpEditor in '..\Net\CoreLab.Dac.Design.DADumpEditor.pas', + CoreLab.Dac.Design.DASPCallFrame in '..\Net\CoreLab.Dac.Design.DASPCallFrame.pas', + CoreLab.Dac.Design.DASQLEditor in '..\Net\CoreLab.Dac.Design.DASQLEditor.pas', + CoreLab.Dac.Design.DASQLFrame in '..\Net\CoreLab.Dac.Design.DASQLFrame.pas', + CoreLab.Dac.Design.DASQLGeneratorFrame in '..\Net\CoreLab.Dac.Design.DASQLGeneratorFrame.pas', + CoreLab.Dac.Design.DATableEditor in '..\Net\CoreLab.Dac.Design.DATableEditor.pas', + CoreLab.Dac.Design.CREditor in '..\Net\CoreLab.Dac.Design.CREditor.pas', + CoreLab.Dac.Design.DADesignUtils in '..\Net\CoreLab.Dac.Design.DADesignUtils.pas', + CoreLab.Dac.Design.DAUpdateSQLEditor in '..\Net\CoreLab.Dac.Design.DAUpdateSQLEditor.pas', + CoreLab.Dac.Design.DAScriptEditor in '..\Net\CoreLab.Dac.Design.DAScriptEditor.pas', + CoreLab.Dac.Design.DAStoredProcEditor in '..\Net\CoreLab.Dac.Design.DAStoredProcEditor.pas', + CoreLab.Dac.Design.VTDataEditor in '..\Net\CoreLab.Dac.Design.VTDataEditor.pas', + CoreLab.Dac.Design.Download in '..\Net\CoreLab.Dac.Design.Download.pas', + CoreLab.Dac.Design.HelpUtils in '..\Net\CoreLab.Dac.Design.HelpUtils.pas'; + +[assembly: AssemblyTitle('Core Lab Data Access Components')] +[assembly: AssemblyDescription('Core Lab Data Access Components')] +[assembly: AssemblyConfiguration('')] +[assembly: AssemblyCompany('Core Lab')] +[assembly: AssemblyProduct('Core Lab Data Access Components')] +[assembly: AssemblyCopyright('')] +[assembly: AssemblyTrademark('')] +[assembly: AssemblyCulture('')] + +// The Delphi compiler controls the AssemblyTitleAttribute via the ExeDescription. +// You can set this in the IDE via the Project Options. +// Manually setting the AssemblyTitle attribute below will override the IDE +// setting. +// [assembly: AssemblyTitle('')] + + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion('6.10.1.2010')] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile('mykey.snk')], provided your output +// directory is the project directory (the default). +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile('CoreLab.snk')] +[assembly: AssemblyKeyName('')] +end. diff --git a/internal/4.10.0.10/1/Source/Delphi8/CoreLab.Dac.bdsproj b/internal/4.10.0.10/1/Source/Delphi8/CoreLab.Dac.bdsproj new file mode 100644 index 0000000..dda35b6 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi8/CoreLab.Dac.bdsproj @@ -0,0 +1,197 @@ + + + + + + + + + + + + CoreLab.Dac.dpk + + + 7.0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 0 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + Borland.Vcl;CoreLab.Dac + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + + True + + + 0 + 0 + 1 + False + False + 4096 + 1048576 + 4194304 + Core Lab Data Access Components + False + + + + . + + . + ..\Net;.. + Borland.VclRtl;Borland.VclDbRtl;Borland.Vcl;Borland.Delphi + + + False + + + + + + False + + + + + + False + + + True + False + 6 + 10 + 1 + 2010 + False + False + False + False + False + + + Core Lab + + 6.10.1.10 + + + + + DAC + 6.10.1.10 + + + + + $00000000 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/internal/4.10.0.10/1/Source/Delphi8/CoreLab.Dac.cfg b/internal/4.10.0.10/1/Source/Delphi8/CoreLab.Dac.cfg new file mode 100644 index 0000000..b5a3f4f --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi8/CoreLab.Dac.cfg @@ -0,0 +1,41 @@ +-$A- +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-cg +-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-NSBorland.Vcl;CoreLab.Dac +-H+ +-W+ +-M +-$M4096,1048576 +-K$00400000 +-N"." +-LN"." +-U"..\Net;.." +-O"..\Net;.." +-I"..\Net;.." +-R"..\Net;.." +-Z diff --git a/internal/4.10.0.10/1/Source/Delphi8/CoreLab.Dac.dpk b/internal/4.10.0.10/1/Source/Delphi8/CoreLab.Dac.dpk new file mode 100644 index 0000000..c013ecd --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi8/CoreLab.Dac.dpk @@ -0,0 +1,108 @@ +package CoreLab.Dac; + +{$ALIGN 0} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Core Lab Data Access Components'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + Borland.Delphi, + Borland.Vcl, + Borland.VclDbRtl, + Borland.VclRtl; + +contains + CoreLab.Dac.VirtualTable in '..\Net\CoreLab.Dac.VirtualTable.pas', + CoreLab.Dac.CRParser in '..\Net\CoreLab.Dac.CRParser.pas', + CoreLab.Dac.DAConsts in '..\Net\CoreLab.Dac.DAConsts.pas', + CoreLab.Dac.DacVcl in '..\Net\CoreLab.Dac.DacVcl.pas', + CoreLab.Dac.DALoader in '..\Net\CoreLab.Dac.DALoader.pas', + CoreLab.Dac.DADump in '..\Net\CoreLab.Dac.DADump.pas', + CoreLab.Dac.DASQLMonitor in '..\Net\CoreLab.Dac.DASQLMonitor.pas', + CoreLab.Dac.DBAccess in '..\Net\CoreLab.Dac.DBAccess.pas', + CoreLab.Dac.DBMonitorClient in '..\Net\CoreLab.Dac.DBMonitorClient.pas', + CoreLab.Dac.DBMonitorIntf in '..\Net\CoreLab.Dac.DBMonitorIntf.pas', + CoreLab.Dac.MemData in '..\Net\CoreLab.Dac.MemData.pas', + CoreLab.Dac.MemDS in '..\Net\CoreLab.Dac.MemDS.pas', + CoreLab.Dac.MemUtils in '..\Net\CoreLab.Dac.MemUtils.pas', + CoreLab.Dac.CRAccess in '..\Net\CoreLab.Dac.CRAccess.pas', + CoreLab.Dac.Win32Timer in '..\Net\CoreLab.Dac.Win32Timer.pas', + CoreLab.Dac.CRConnectionPool in '..\Net\CoreLab.Dac.CRConnectionPool.pas', + CoreLab.Dac.DAScript in '..\Net\CoreLab.Dac.DAScript.pas', + CoreLab.Dac.CRBatchMove in '..\Net\CoreLab.Dac.CRBatchMove.pas'; + +[assembly: AssemblyTitle('Core Lab Data Access Components')] +[assembly: AssemblyDescription('Core Lab Data Access Components')] +[assembly: AssemblyConfiguration('')] +[assembly: AssemblyCompany('Core Lab')] +[assembly: AssemblyProduct('Core Lab Data Access Components')] +[assembly: AssemblyCopyright('')] +[assembly: AssemblyTrademark('')] +[assembly: AssemblyCulture('')] + +//[assembly: CLSCompliant(true)] + + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion('6.10.1.2010')] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory which is +// %Project Directory%\obj\. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile('CoreLab.snk')] +[assembly: AssemblyKeyName('')] + +end. diff --git a/internal/4.10.0.10/1/Source/Delphi8/CoreLab.Sdac.AdoNet.bdsproj b/internal/4.10.0.10/1/Source/Delphi8/CoreLab.Sdac.AdoNet.bdsproj new file mode 100644 index 0000000..39dbe2d --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi8/CoreLab.Sdac.AdoNet.bdsproj @@ -0,0 +1,176 @@ + + + + + + + + + + + + CoreLab.Sdac.AdoNet.dpk + + + + + + + + + + + + + + + + + + 7.0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 0 + 1 + True + True + WinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + Borland.Vcl + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + + + 0 + 0 + 1 + True + False + False + 4096 + 1048576 + 4194304 + SQL Server Data Access Components + + + + + + + d:\program files\common files\borland shared\bds\shared assemblies\2.0;d:\winnt\microsoft.net\framework\v1.1.4322;d:\projects\delphi\sdac\source\delphi8 + d:\winnt\microsoft.net\framework\v1.1.4322\System.Drawing.dll;CoreLab.Sdac;Borland.VclDbRtl;d:\winnt\microsoft.net\framework\v1.1.4322\System.Data.dll;Borland.Delphi + + + False + + + + + + False + + + + + + False + + + + $00000000 + + + + False + False + 4 + 10 + 0 + 2010 + False + False + False + False + False + + + + + diff --git a/internal/4.10.0.10/1/Source/Delphi8/CoreLab.Sdac.AdoNet.cfg b/internal/4.10.0.10/1/Source/Delphi8/CoreLab.Sdac.AdoNet.cfg new file mode 100644 index 0000000..92711a5 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi8/CoreLab.Sdac.AdoNet.cfg @@ -0,0 +1,41 @@ +-$A- +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-cg +-vn +-AWinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-NSBorland.Vcl;CoreLab.Dac;CoreLab.Sdac +-H+ +-W+ +-M +-$M4096,1048576 +-K$00400000 +-N"." +-LN"." +-U"..\;..\Net" +-O"..\;..\Net" +-I"..\;..\Net" +-R"..\;..\Net" diff --git a/internal/4.10.0.10/1/Source/Delphi8/CoreLab.Sdac.AdoNet.dpk b/internal/4.10.0.10/1/Source/Delphi8/CoreLab.Sdac.AdoNet.dpk new file mode 100644 index 0000000..64b6599 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi8/CoreLab.Sdac.AdoNet.dpk @@ -0,0 +1,99 @@ +package CoreLab.Sdac.AdoNet; + + +{$ALIGN 0} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'SQL Server Data Access Components'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + Borland.Delphi, + System.Data, + Borland.VclDbRtl, + CoreLab.Sdac, + CoreLab.Dac.AdoNet; + +contains + CoreLab.Sdac.Design.DataAdapter in '..\Net\CoreLab.Sdac.Design.DataAdapter.pas' {CoreLab.Sdac.Design.DataAdapter.MyDataAdapter: CoreLab.Sdac.Design.DataAdapter.MyDataAdapter}, + CoreLab.Sdac.DataAdapter in '..\Net\CoreLab.Sdac.DataAdapter.pas' {CoreLab.Sdac.AdoNetAdapter.MSDataAdapter: CoreLab.Dac.DataAdapter.DADataAdapter}; + +[assembly: AssemblyTitle('CoreLab.Sdac.AdoNet')] +[assembly: AssemblyDescription('')] +[assembly: AssemblyConfiguration('')] +[assembly: AssemblyCompany('Core Lab')] +[assembly: AssemblyProduct('SQL Server Data Access Components')] +[assembly: AssemblyCopyright('')] +[assembly: AssemblyTrademark('')] +[assembly: AssemblyCulture('')] + + +// The Delphi compiler controls the AssemblyTitleAttribute via the ExeDescription. +// You can set this in the IDE via the Project Options. +// Manually setting the AssemblyTitle attribute below will override the IDE +// setting. +// [assembly: AssemblyTitle('')] + + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion('4.10.0.2010')] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile('mykey.snk')], provided your output +// directory is the project directory (the default). +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile('CoreLab.snk')] +[assembly: AssemblyKeyName('')] + +end. diff --git a/internal/4.10.0.10/1/Source/Delphi8/CoreLab.Sdac.Design.bdsproj b/internal/4.10.0.10/1/Source/Delphi8/CoreLab.Sdac.Design.bdsproj new file mode 100644 index 0000000..d38f5b4 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi8/CoreLab.Sdac.Design.bdsproj @@ -0,0 +1,189 @@ + + + + + + + + + + + + CoreLab.Sdac.Design.dpk + + + 7.0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 0 + 1 + True + True + WinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + Borland.Vcl;CoreLab.Dac;CoreLab.Sdac;CoreLab.Dac.Design;CoreLab.Sdac.Design + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + + + 0 + 0 + 1 + False + False + False + 4096 + 1048576 + 4194304 + SQL Server Data Access Components + + + + . + + . + d:\program files\common files\borland shared\bds\shared assemblies\2.0;d:\program files\borland\bds\2.0\bin;d:\projects\delphi\Dac\source\delphi8;d:\Projects\Delphi\Sdac\Source\Delphi8;d:\winnt\microsoft.net\framework\v1.1.4322;..\Net;..;..\..\..\Dac\Source\Net;..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi8;d:\projects\delphi\Sdac\source\delphi8;d:\projects\delphi\dac\source\delphi8;d:\projects\delphi\sdac\source\delphi8 + CoreLab.Sdac.AdoNet;d:\winnt\microsoft.net\framework\v1.1.4322\System.Windows.Forms.dll;CoreLab.Sdac;CoreLab.Dac.Design;Borland.Vcl.Design.Standard;Borland.Vcl.Design.DbRtl;Borland.Studio.Vcl.Design;d:\program files\borland\bds\2.0\bin\Borland.Studio.ToolsAPI.dll;Borland.Delphi + SDAC + + False + + + + + + False + + + + + + False + + + + $00000000 + + + + True + False + 4 + 10 + 0 + 2010 + False + False + False + False + False + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/internal/4.10.0.10/1/Source/Delphi8/CoreLab.Sdac.Design.cfg b/internal/4.10.0.10/1/Source/Delphi8/CoreLab.Sdac.Design.cfg new file mode 100644 index 0000000..f0e9cef --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi8/CoreLab.Sdac.Design.cfg @@ -0,0 +1,41 @@ +-$A- +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J- +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-cg +-AWinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-NSBorland.Vcl;CoreLab.Dac;CoreLab.Sdac;CoreLab.Dac.Design;CoreLab.Sdac.Design +-H+ +-W+ +-M +-$M4096,1048576 +-K$00400000 +-N"." +-LN"." +-U".\;..\Net;..\Design;..\;..\..\..\Dac\Source\Net;..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi8" +-O".\;..\Net;..\Design;..\;..\..\..\Dac\Source\Net;..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi8" +-I".\;..\Net;..\Design;..\;..\..\..\Dac\Source\Net;..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi8" +-R".\;..\Net;..\Design;..\;..\..\..\Dac\Source\Net;..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi8" +-DSDAC-Z \ No newline at end of file diff --git a/internal/4.10.0.10/1/Source/Delphi8/CoreLab.Sdac.Design.dpk b/internal/4.10.0.10/1/Source/Delphi8/CoreLab.Sdac.Design.dpk new file mode 100644 index 0000000..835635e --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi8/CoreLab.Sdac.Design.dpk @@ -0,0 +1,114 @@ +package CoreLab.Sdac.Design; + +{$ALIGN 0} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'SQL Server Data Access Components'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} +{$DEFINE SDAC} + +requires + Borland.Delphi, + Borland.Studio.ToolsAPI, + Borland.Studio.Vcl.Design, + Borland.Vcl.Design.DbRtl, + Borland.Vcl.Design.Standard, + CoreLab.Dac.Design, + CoreLab.Sdac, + System.Windows.Forms, + CoreLab.Sdac.AdoNet; + +contains + CoreLab.Sdac.Design.SdacAbout in '..\Net\CoreLab.Sdac.Design.SdacAbout.pas', + CoreLab.Sdac.Design.MSConnectionEditor in '..\Net\CoreLab.Sdac.Design.MSConnectionEditor.pas', + CoreLab.Sdac.Design.MSParamsFrame in '..\Net\CoreLab.Sdac.Design.MSParamsFrame.pas', + CoreLab.Sdac.Design.MSQueryEditor in '..\Net\CoreLab.Sdac.Design.MSQueryEditor.pas', + CoreLab.Sdac.Design.MSNamesEditor in '..\Net\CoreLab.Sdac.Design.MSNamesEditor.pas', + CoreLab.Sdac.Design.MSDumpEditor in '..\Net\CoreLab.Sdac.Design.MSDumpEditor.pas', + CoreLab.Sdac.Design.MSSPCallFrame in '..\Net\CoreLab.Sdac.Design.MSSPCallFrame.pas', + CoreLab.Sdac.Design.MSSQLEditor in '..\Net\CoreLab.Sdac.Design.MSSQLEditor.pas', + CoreLab.Sdac.Design.MSStoredProcEditor in '..\Net\CoreLab.Sdac.Design.MSStoredProcEditor.pas', + CoreLab.Sdac.Design.MSUpdateSQLEditor in '..\Net\CoreLab.Sdac.Design.MSUpdateSQLEditor.pas', + CoreLab.Sdac.Design.MSDesign in '..\Net\CoreLab.Sdac.Design.MSDesign.pas', + CoreLab.Sdac.Design.MSDesignUtils in '..\Net\CoreLab.Sdac.Design.MSDesignUtils.pas', + CoreLab.Sdac.Design.MSMenu in '..\Net\CoreLab.Sdac.Design.MSMenu.pas', + CoreLab.Sdac.Design.MSReg in '..\Net\CoreLab.Sdac.Design.MSReg.pas'; + +[assembly: AssemblyTitle('SQL Server Data Access Components')] +[assembly: AssemblyDescription('SQL Server Data Access Components')] +[assembly: AssemblyConfiguration('')] +[assembly: AssemblyCompany('Core Lab')] +[assembly: AssemblyProduct('SQL Server Data Access Components')] +[assembly: AssemblyCopyright('')] +[assembly: AssemblyTrademark('')] +[assembly: AssemblyCulture('')] + + +// The Delphi compiler controls the AssemblyTitleAttribute via the ExeDescription. +// You can set this in the IDE via the Project Options. +// Manually setting the AssemblyTitle attribute below will override the IDE +// setting. +// [assembly: AssemblyTitle('')] + + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion('4.10.0.2010')] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile('mykey.snk')], provided your output +// directory is the project directory (the default). +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile('CoreLab.snk')] +[assembly: AssemblyKeyName('')] +end. diff --git a/internal/4.10.0.10/1/Source/Delphi8/CoreLab.Sdac.bdsproj b/internal/4.10.0.10/1/Source/Delphi8/CoreLab.Sdac.bdsproj new file mode 100644 index 0000000..25e38d4 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi8/CoreLab.Sdac.bdsproj @@ -0,0 +1,181 @@ + + + + + + + + + + + + CoreLab.Sdac.dpk + + + 7.0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 0 + 1 + True + True + WinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + Borland.Vcl + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + + + 0 + 0 + 1 + True + False + False + 4096 + 1048576 + 4194304 + SQL Server Data Access Components + + + + . + . + + .\;..\Net;..\;..\..\..\Dac\Source\Net;..\..\..\Dac\Source;..\..\Net\D8;..\..\..\Dac\Source\Delphi8 + CoreLab.Dac;Borland.VclRtl;Borland.VclDbRtl;Borland.Delphi;Borland.Vcl + SDAC + + False + + + + + + False + + + + + + False + + + + $00000000 + + + + True + False + 4 + 10 + 0 + 2010 + False + False + False + False + False + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/internal/4.10.0.10/1/Source/Delphi8/CoreLab.Sdac.cfg b/internal/4.10.0.10/1/Source/Delphi8/CoreLab.Sdac.cfg new file mode 100644 index 0000000..2021c4e --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi8/CoreLab.Sdac.cfg @@ -0,0 +1,43 @@ +-$A- +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-cg +-vn +-AWinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-NSBorland.Vcl;CoreLab.Dac;CoreLab.Sdac +-H+ +-W+ +-M +-$M4096,1048576 +-K$00400000 +-N"." +-LN"." +-U"..\;..\Net" +-O"..\;..\Net" +-I"..\;..\Net" +-R"..\;..\Net" +-DSDAC +-Z diff --git a/internal/4.10.0.10/1/Source/Delphi8/CoreLab.Sdac.dpk b/internal/4.10.0.10/1/Source/Delphi8/CoreLab.Sdac.dpk new file mode 100644 index 0000000..56296af --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi8/CoreLab.Sdac.dpk @@ -0,0 +1,107 @@ +package CoreLab.Sdac; + +{$ALIGN 0} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'SQL Server Data Access Components'} +{$RUNONLY} +{$IMPLICITBUILD OFF} +{$DEFINE SDAC} + +requires + Borland.Delphi, + Borland.Vcl, + Borland.VclDbRtl, + Borland.VclRtl, + CoreLab.Dac; + +contains + CoreLab.Sdac.SdacVcl in '..\Net\CoreLab.Sdac.SdacVcl.pas', + CoreLab.Sdac.OLEDBIntf in '..\Net\CoreLab.Sdac.OLEDBIntf.pas', + CoreLab.Sdac.MSAccess in '..\Net\CoreLab.Sdac.MSAccess.pas', + CoreLab.Sdac.MSConnectForm in '..\Net\CoreLab.Sdac.MSConnectForm.pas', + CoreLab.Sdac.MSConnectionPool in '..\Net\CoreLab.Sdac.MSConnectionPool.pas', + CoreLab.Sdac.MSConsts in '..\Net\CoreLab.Sdac.MSConsts.pas', + CoreLab.Sdac.MSParser in '..\Net\CoreLab.Sdac.MSParser.pas', + CoreLab.Sdac.MSLoader in '..\Net\CoreLab.Sdac.MSLoader.pas', + CoreLab.Sdac.MSDump in '..\Net\CoreLab.Sdac.MSDump.pas', + CoreLab.Sdac.MSScript in '..\Net\CoreLab.Sdac.MSScript.pas', + CoreLab.Sdac.CRThread in '..\Net\CoreLab.Sdac.CRThread.pas', + CoreLab.Sdac.MSServiceBroker in '..\Net\CoreLab.Sdac.MSServiceBroker.pas', + CoreLab.Sdac.MSSQLMonitor in '..\Net\CoreLab.Sdac.MSSQLMonitor.pas', + CoreLab.Sdac.OLEDBAccess in '..\Net\CoreLab.Sdac.OLEDBAccess.pas', + CoreLab.Sdac.OLEDBC in '..\Net\CoreLab.Sdac.OLEDBC.pas'; + +[assembly: AssemblyTitle('SQL Server Data Access Components')] +[assembly: AssemblyDescription('SQL Server Data Access Components')] +[assembly: AssemblyConfiguration('')] +[assembly: AssemblyCompany('Core Lab')] +[assembly: AssemblyProduct('SQL Server Data Access Components')] +[assembly: AssemblyCopyright('')] +[assembly: AssemblyTrademark('')] +[assembly: AssemblyCulture('')] + +//[assembly: CLSCompliant(true)] + + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion('4.10.0.2010')] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory which is +// %Project Directory%\obj\. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile('CoreLab.snk')] +[assembly: AssemblyKeyName('')] + +end. diff --git a/internal/4.10.0.10/1/Source/Delphi8/Make.bat b/internal/4.10.0.10/1/Source/Delphi8/Make.bat new file mode 100644 index 0000000..f80733e --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi8/Make.bat @@ -0,0 +1,10 @@ +@echo off +rem ********************************************************************** +rem * +rem * Sdac for Delphi 8 +rem * +rem ********************************************************************** + +set IdeDir="D:\Program Files\Borland\BDS\2.0 +del /Q/S SDAC\*.* +call ..\Make.bat Delphi 8 CLR diff --git a/internal/4.10.0.10/1/Source/Delphi9/CoreLab.Dac.AdoNet.bdsproj b/internal/4.10.0.10/1/Source/Delphi9/CoreLab.Dac.AdoNet.bdsproj new file mode 100644 index 0000000..1cc4a19 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi9/CoreLab.Dac.AdoNet.bdsproj @@ -0,0 +1,170 @@ + + + + + + + + + + + + CoreLab.Dac.AdoNet.dpk + + + 7.0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 0 + 1 + True + True + WinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + Borland.Vcl;CoreLab.Dac + False + + False + True + False + True + True + False + True + True + True + True + True + True + True + True + True + True + True + True + False + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + + + 0 + 0 + 1 + True + False + 4096 + 1048576 + 4194304 + Core Lab Data Access Components + False + + + + . + + . + .\;..\Net;..\;d:\program files\common files\borland shared\bds\shared assemblies\3.0;d:\winnt\microsoft.net\framework\v1.1.4322;d:\projects\delphi\dac\source\delphi9 + CoreLab.Dac;Borland.VclDbRtl;d:\winnt\microsoft.net\framework\v1.1.4322\System.Data.dll;Borland.Delphi + + + False + + + + + + False + + + + + + False + + + + $00000000 + + + + True + False + 6 + 10 + 1 + 3010 + False + False + False + False + False + + + + + + + + + + + + + + diff --git a/internal/4.10.0.10/1/Source/Delphi9/CoreLab.Dac.AdoNet.cfg b/internal/4.10.0.10/1/Source/Delphi9/CoreLab.Dac.AdoNet.cfg new file mode 100644 index 0000000..83f5c2e --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi9/CoreLab.Dac.AdoNet.cfg @@ -0,0 +1,45 @@ +-$A- +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-cg +-vn +-AWinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-NSBorland.Vcl;CoreLab.Dac +-H+ +-W+ +-M +-$M4096,1048576 +-K$00400000 +-N"." +-LN"." +-U".\;..\Net;..\;d:\program files\common files\borland shared\bds\shared assemblies\3.0;d:\winnt\microsoft.net\framework\v1.1.4322;d:\projects\delphi\dac\source\delphi9" +-O".\;..\Net;..\" +-I".\;..\Net;..\" +-R".\;..\Net;..\" +-w-SYMBOL_DEPRECATED +-w-SYMBOL_PLATFORM +-w-UNIT_PLATFORM +-w-CASE_LABEL_RANGE diff --git a/internal/4.10.0.10/1/Source/Delphi9/CoreLab.Dac.AdoNet.dpk b/internal/4.10.0.10/1/Source/Delphi9/CoreLab.Dac.AdoNet.dpk new file mode 100644 index 0000000..7b31c88 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi9/CoreLab.Dac.AdoNet.dpk @@ -0,0 +1,97 @@ +package CoreLab.Dac.AdoNet; + + +{$ALIGN 0} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Core Lab Data Access Components'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + Borland.Delphi, + System.Data, + Borland.VclDbRtl, + CoreLab.Dac; + +contains + CoreLab.Dac.DataAdapter in '..\Net\CoreLab.Dac.DataAdapter.pas'; + +[assembly: AssemblyTitle('CoreLab.Dac.AdoNet')] +[assembly: AssemblyDescription('')] +[assembly: AssemblyConfiguration('')] +[assembly: AssemblyCompany('Core Lab')] +[assembly: AssemblyProduct('Core Lab Data Access Components')] +[assembly: AssemblyCopyright('')] +[assembly: AssemblyTrademark('')] +[assembly: AssemblyCulture('')] + + +// The Delphi compiler controls the AssemblyTitleAttribute via the ExeDescription. +// You can set this in the IDE via the Project Options. +// Manually setting the AssemblyTitle attribute below will override the IDE +// setting. +// [assembly: AssemblyTitle('')] + + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion('6.10.1.3010')] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile('mykey.snk')], provided your output +// directory is the project directory (the default). +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile('CoreLab.snk')] +[assembly: AssemblyKeyName('')] + +end. diff --git a/internal/4.10.0.10/1/Source/Delphi9/CoreLab.Dac.Design.bdsproj b/internal/4.10.0.10/1/Source/Delphi9/CoreLab.Dac.Design.bdsproj new file mode 100644 index 0000000..9a0234f --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi9/CoreLab.Dac.Design.bdsproj @@ -0,0 +1,205 @@ + + + + + + + + + + + + CoreLab.Dac.Design.dpk + + + 7.0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 0 + 1 + True + True + WinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + CoreLab.Dac;CoreLab.Dac.Design + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + + + 0 + 0 + 1 + False + False + False + 4096 + 1048576 + 4194304 + Data Access Components + + + + . + + . + ..\Design;.\;..\Net;..\;d:\program files\common files\borland shared\bds\shared assemblies\3.0;d:\program files\borland\bds\3.0\bin;d:\projects\delphi\dac\source\delphi9 + Borland.Vcl.Design.DbRtl;Borland.VclDbCtrls;Borland.Studio.Vcl.Design;CoreLab.Dac;Borland.VclRtl;Borland.Vcl;Borland.Delphi + + + False + + + + + + False + + + + + + False + + + + $00000000 + + + + True + False + 6 + 10 + 1 + 3010 + False + False + False + False + False + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/internal/4.10.0.10/1/Source/Delphi9/CoreLab.Dac.Design.cfg b/internal/4.10.0.10/1/Source/Delphi9/CoreLab.Dac.Design.cfg new file mode 100644 index 0000000..83ff37c --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi9/CoreLab.Dac.Design.cfg @@ -0,0 +1,40 @@ +-$A- +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J- +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-cg +-AWinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-NSCoreLab.Dac;CoreLab.Dac.Design +-H+ +-W+ +-M +-$M4096,1048576 +-K$00400000 +-N"." +-LN"." +-U".\;..\Net;..\;..\Design;..\..\DBToolsInterfaces" +-O".\;..\Net;..\;..\Design" +-I".\;..\Net;..\;..\Design" +-R".\;..\Net;..\;..\Design" diff --git a/internal/4.10.0.10/1/Source/Delphi9/CoreLab.Dac.Design.dpk b/internal/4.10.0.10/1/Source/Delphi9/CoreLab.Dac.Design.dpk new file mode 100644 index 0000000..1c6858f --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi9/CoreLab.Dac.Design.dpk @@ -0,0 +1,132 @@ +package CoreLab.Dac.Design; + + +{$ALIGN 0} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Data Access Components'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + CoreLab.DbTools.Interfaces, + Borland.Delphi, + Borland.Vcl, + Borland.VclRtl, + Borland.Studio.Vcl.Design, + Borland.Studio.ToolsAPI, + Borland.VclDbCtrls, + Borland.Vcl.Design.DbRtl, + CoreLab.Dac; + +contains + CoreLab.Dac.Design.DacReg in '..\Net\CoreLab.Dac.Design.DacReg.pas', + CoreLab.Dac.Design.VTDesign in '..\Net\CoreLab.Dac.Design.VTDesign.pas', + CoreLab.Dac.Design.DAMenu in '..\Net\CoreLab.Dac.Design.DAMenu.pas', + CoreLab.Dac.Design.DADesign in '..\Net\CoreLab.Dac.Design.DADesign.pas', + CoreLab.Dac.Design.DAUpdateSQLFrame in '..\Net\CoreLab.Dac.Design.DAUpdateSQLFrame.pas', + CoreLab.Dac.Design.CRFrame in '..\Net\CoreLab.Dac.Design.CRFrame.pas', + CoreLab.Dac.Design.CRColFrame in '..\Net\CoreLab.Dac.Design.CRColFrame.pas', + CoreLab.Dac.Design.CRTabEditor in '..\Net\CoreLab.Dac.Design.CRTabEditor.pas', + CoreLab.Dac.Design.DAConnectionEditor in '..\Net\CoreLab.Dac.Design.DAConnectionEditor.pas', + CoreLab.Dac.Design.CRDataEditor in '..\Net\CoreLab.Dac.Design.CRDataEditor.pas', + CoreLab.Dac.Design.DADataEditor in '..\Net\CoreLab.Dac.Design.DADataEditor.pas', + CoreLab.Dac.Design.DAMacrosFrame in '..\Net\CoreLab.Dac.Design.DAMacrosFrame.pas', + CoreLab.Dac.Design.DAParamsFrame in '..\Net\CoreLab.Dac.Design.DAParamsFrame.pas', + CoreLab.Dac.Design.DAParamValueEditor in '..\Net\CoreLab.Dac.Design.DAParamValueEditor.pas', + CoreLab.Dac.Design.DAQueryEditor in '..\Net\CoreLab.Dac.Design.DAQueryEditor.pas', + CoreLab.Dac.Design.DADualListEditor in '..\Net\CoreLab.Dac.Design.DADualListEditor.pas', + CoreLab.Dac.Design.DADumpProgress in '..\Net\CoreLab.Dac.Design.DADumpProgress.pas', + CoreLab.Dac.Design.DADumpEditor in '..\Net\CoreLab.Dac.Design.DADumpEditor.pas', + CoreLab.Dac.Design.DASPCallFrame in '..\Net\CoreLab.Dac.Design.DASPCallFrame.pas', + CoreLab.Dac.Design.DASQLEditor in '..\Net\CoreLab.Dac.Design.DASQLEditor.pas', + CoreLab.Dac.Design.DASQLFrame in '..\Net\CoreLab.Dac.Design.DASQLFrame.pas', + CoreLab.Dac.Design.DASQLGeneratorFrame in '..\Net\CoreLab.Dac.Design.DASQLGeneratorFrame.pas', + CoreLab.Dac.Design.DATableEditor in '..\Net\CoreLab.Dac.Design.DATableEditor.pas', + CoreLab.Dac.Design.CREditor in '..\Net\CoreLab.Dac.Design.CREditor.pas', + CoreLab.Dac.Design.DADesignUtils in '..\Net\CoreLab.Dac.Design.DADesignUtils.pas', + CoreLab.Dac.Design.DAUpdateSQLEditor in '..\Net\CoreLab.Dac.Design.DAUpdateSQLEditor.pas', + CoreLab.Dac.Design.DAScriptEditor in '..\Net\CoreLab.Dac.Design.DAScriptEditor.pas', + CoreLab.Dac.Design.DAStoredProcEditor in '..\Net\CoreLab.Dac.Design.DAStoredProcEditor.pas', + CoreLab.Dac.Design.VTDataEditor in '..\Net\CoreLab.Dac.Design.VTDataEditor.pas', + CoreLab.Dac.Design.Download in '..\Net\CoreLab.Dac.Design.Download.pas', + CoreLab.Dac.Design.DBToolsClient in '..\Net\CoreLab.Dac.Design.DBToolsClient.pas', + CoreLab.Dac.Design.DBToolsIntf in '..\Net\CoreLab.Dac.Design.DBToolsIntf.pas', + CoreLab.Dac.Design.HelpUtils in '..\Net\CoreLab.Dac.Design.HelpUtils.pas'; + +[assembly: AssemblyTitle('Core Lab Data Access Components')] +[assembly: AssemblyDescription('Core Lab Data Access Components')] +[assembly: AssemblyConfiguration('')] +[assembly: AssemblyCompany('Core Lab')] +[assembly: AssemblyProduct('Core Lab Data Access Components')] +[assembly: AssemblyCopyright('')] +[assembly: AssemblyTrademark('')] +[assembly: AssemblyCulture('')] + +// The Delphi compiler controls the AssemblyTitleAttribute via the ExeDescription. +// You can set this in the IDE via the Project Options. +// Manually setting the AssemblyTitle attribute below will override the IDE +// setting. +// [assembly: AssemblyTitle('')] + + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion('6.10.1.3010')] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile('mykey.snk')], provided your output +// directory is the project directory (the default). +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile('CoreLab.snk')] +[assembly: AssemblyKeyName('')] +end. diff --git a/internal/4.10.0.10/1/Source/Delphi9/CoreLab.Dac.bdsproj b/internal/4.10.0.10/1/Source/Delphi9/CoreLab.Dac.bdsproj new file mode 100644 index 0000000..b48884e --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi9/CoreLab.Dac.bdsproj @@ -0,0 +1,196 @@ + + + + + + + + + + + + CoreLab.Dac.dpk + + + 7.0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 0 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + Borland.Vcl;CoreLab.Dac + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + + True + + + 0 + 0 + 1 + False + False + 4096 + 1048576 + 4194304 + Core Lab Data Access Components + False + + + + . + + . + ..\Net;..;d:\program files\common files\borland shared\bds\shared assemblies\3.0 + Borland.VclRtl;Borland.VclDbRtl;Borland.Vcl;Borland.Delphi + + + False + + + + + + False + + + + + + False + + + True + False + 6 + 10 + 1 + 3010 + False + False + False + False + False + + + Core Lab + + 6.10.1.10 + + + + + DAC + 6.10.1.10 + + + + + $00000000 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/internal/4.10.0.10/1/Source/Delphi9/CoreLab.Dac.cfg b/internal/4.10.0.10/1/Source/Delphi9/CoreLab.Dac.cfg new file mode 100644 index 0000000..4971988 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi9/CoreLab.Dac.cfg @@ -0,0 +1,41 @@ +-$A- +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-cg +-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-NSBorland.Vcl;CoreLab.Dac +-H+ +-W+ +-M +-$M4096,1048576 +-K$00400000 +-N"." +-LN"." +-U"..\Net;..;d:\program files\common files\borland shared\bds\shared assemblies\3.0" +-O"..\Net;..;d:\program files\common files\borland shared\bds\shared assemblies\3.0" +-I"..\Net;..;d:\program files\common files\borland shared\bds\shared assemblies\3.0" +-R"..\Net;..;d:\program files\common files\borland shared\bds\shared assemblies\3.0" +-Z diff --git a/internal/4.10.0.10/1/Source/Delphi9/CoreLab.Dac.dpk b/internal/4.10.0.10/1/Source/Delphi9/CoreLab.Dac.dpk new file mode 100644 index 0000000..a523a16 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi9/CoreLab.Dac.dpk @@ -0,0 +1,108 @@ +package CoreLab.Dac; + +{$ALIGN 0} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Core Lab Data Access Components'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + Borland.Delphi, + Borland.Vcl, + Borland.VclDbRtl, + Borland.VclRtl; + +contains + CoreLab.Dac.VirtualTable in '..\Net\CoreLab.Dac.VirtualTable.pas', + CoreLab.Dac.CRParser in '..\Net\CoreLab.Dac.CRParser.pas', + CoreLab.Dac.DAConsts in '..\Net\CoreLab.Dac.DAConsts.pas', + CoreLab.Dac.DacVcl in '..\Net\CoreLab.Dac.DacVcl.pas', + CoreLab.Dac.DALoader in '..\Net\CoreLab.Dac.DALoader.pas', + CoreLab.Dac.DASQLMonitor in '..\Net\CoreLab.Dac.DASQLMonitor.pas', + CoreLab.Dac.DBAccess in '..\Net\CoreLab.Dac.DBAccess.pas', + CoreLab.Dac.DBMonitorClient in '..\Net\CoreLab.Dac.DBMonitorClient.pas', + CoreLab.Dac.DBMonitorIntf in '..\Net\CoreLab.Dac.DBMonitorIntf.pas', + CoreLab.Dac.MemData in '..\Net\CoreLab.Dac.MemData.pas', + CoreLab.Dac.MemDS in '..\Net\CoreLab.Dac.MemDS.pas', + CoreLab.Dac.MemUtils in '..\Net\CoreLab.Dac.MemUtils.pas', + CoreLab.Dac.CRAccess in '..\Net\CoreLab.Dac.CRAccess.pas', + CoreLab.Dac.CRConnectionPool in '..\Net\CoreLab.Dac.CRConnectionPool.pas', + CoreLab.Dac.DAScript in '..\Net\CoreLab.Dac.DAScript.pas', + CoreLab.Dac.DADump in '..\Net\CoreLab.Dac.DADump.pas', + CoreLab.Dac.CRBatchMove in '..\Net\CoreLab.Dac.CRBatchMove.pas', + CoreLab.Dac.Win32Timer in '..\Net\CoreLab.Dac.Win32Timer.pas'; + +[assembly: AssemblyTitle('Core Lab Data Access Components')] +[assembly: AssemblyDescription('Core Lab Data Access Components')] +[assembly: AssemblyConfiguration('')] +[assembly: AssemblyCompany('Core Lab')] +[assembly: AssemblyProduct('Core Lab Data Access Components')] +[assembly: AssemblyCopyright('')] +[assembly: AssemblyTrademark('')] +[assembly: AssemblyCulture('')] + +//[assembly: CLSCompliant(true)] + + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion('6.10.1.3010')] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory which is +// %Project Directory%\obj\. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile('CoreLab.snk')] +[assembly: AssemblyKeyName('')] + +end. diff --git a/internal/4.10.0.10/1/Source/Delphi9/CoreLab.Sdac.AdoNet.bdsproj b/internal/4.10.0.10/1/Source/Delphi9/CoreLab.Sdac.AdoNet.bdsproj new file mode 100644 index 0000000..e5d5eff --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi9/CoreLab.Sdac.AdoNet.bdsproj @@ -0,0 +1,185 @@ + + + + + + + + + + + + CoreLab.Sdac.AdoNet.dpk + + + + + + + + + + + + + + + 7.0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 0 + 1 + True + True + WinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + Borland.Vcl + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + + + 0 + 0 + 1 + True + False + False + 4096 + 1048576 + 4194304 + SQL Server Data Access Components + + + + + + + + + + + False + + + + + + False + + + + + + False + + + + $00000000 + + + + False + False + 4 + 10 + 0 + 3010 + False + False + False + False + False + 1049 + 1251 + + + + + 4.10.0.10 + + + + + + 4.10.0.10 + + + + diff --git a/internal/4.10.0.10/1/Source/Delphi9/CoreLab.Sdac.AdoNet.cfg b/internal/4.10.0.10/1/Source/Delphi9/CoreLab.Sdac.AdoNet.cfg new file mode 100644 index 0000000..e048f42 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi9/CoreLab.Sdac.AdoNet.cfg @@ -0,0 +1,39 @@ +-$A- +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-cg +-vn +-AWinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-NSBorland.Vcl;CoreLab.Dac;CoreLab.Sdac +-H+ +-W+ +-M +-$M4096,1048576 +-K$00400000 +-U"..\;..\Net" +-O"..\;..\Net" +-I"..\;..\Net" +-R"..\;..\Net" diff --git a/internal/4.10.0.10/1/Source/Delphi9/CoreLab.Sdac.AdoNet.dpk b/internal/4.10.0.10/1/Source/Delphi9/CoreLab.Sdac.AdoNet.dpk new file mode 100644 index 0000000..3bc6183 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi9/CoreLab.Sdac.AdoNet.dpk @@ -0,0 +1,99 @@ +package CoreLab.Sdac.AdoNet; + + +{$ALIGN 0} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'SQL Server Data Access Components'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + Borland.Delphi, + System.Data, + Borland.VclDbRtl, + CoreLab.Sdac, + System.Drawing; + +contains + CoreLab.Dac.DataAdapter {CoreLab.Dac.DataAdapter.DADataAdapter: System.Data.Common.DbDataAdapter}, + CoreLab.Sdac.DataAdapter in '..\Net\CoreLab.Sdac.DataAdapter.pas' {CoreLab.Sdac.DataAdapter.MyDataAdapter: CoreLab.Dac.DataAdapter.DADataAdapter}; + +[assembly: AssemblyTitle('CoreLab.Sdac.AdoNet')] +[assembly: AssemblyDescription('')] +[assembly: AssemblyConfiguration('')] +[assembly: AssemblyCompany('Core Lab')] +[assembly: AssemblyProduct('SQL Server Data Access Components')] +[assembly: AssemblyCopyright('')] +[assembly: AssemblyTrademark('')] +[assembly: AssemblyCulture('')] + + +// The Delphi compiler controls the AssemblyTitleAttribute via the ExeDescription. +// You can set this in the IDE via the Project Options. +// Manually setting the AssemblyTitle attribute below will override the IDE +// setting. +// [assembly: AssemblyTitle('')] + + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion('4.10.0.3010')] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile('mykey.snk')], provided your output +// directory is the project directory (the default). +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile('CoreLab.snk')] +[assembly: AssemblyKeyName('')] + +end. diff --git a/internal/4.10.0.10/1/Source/Delphi9/CoreLab.Sdac.Design.bdsproj b/internal/4.10.0.10/1/Source/Delphi9/CoreLab.Sdac.Design.bdsproj new file mode 100644 index 0000000..2a9a305 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi9/CoreLab.Sdac.Design.bdsproj @@ -0,0 +1,206 @@ + + + + + + + + + + + + CoreLab.Sdac.Design.dpk + + + 7.0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 0 + 1 + True + True + WinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + Borland.Vcl;CoreLab.Dac;CoreLab.Sdac;CoreLab.Dac.Design;CoreLab.Sdac.Design + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + + + 0 + 0 + 1 + False + False + False + 4096 + 1048576 + 4194304 + SQL Server Data Access Components + + + + . + + . + d:\program files\common files\borland shared\bds\shared assemblies\3.0;d:\program files\borland\bds\3.0\bin;d:\projects\delphi\Dac\source\delphi9;d:\Projects\Delphi\Sdac\Source\Delphi9;d:\winnt\microsoft.net\framework\v1.1.4322;..\Net;..;..\..\..\Dac\Source\Net;..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi9;d:\projects\delphi\Sdac\source\delphi9;d:\projects\delphi\dac\source\delphi9;d:\projects\delphi\sdac\source\delphi9;d:\Projects\Delphi\dac\source\delphi9;d:\Projects\Delphi\Sdac\Source\Delphi9;d:\windows\microsoft.net\framework\v1.1.4322;d:\program files\corelab\mydac for delphi9\bin;D:\Projects\Delphi\Sdac\Source\Delphi9 + CoreLab.Sdac.AdoNet;d:\windows\microsoft.net\framework\v1.1.4322\System.Windows.Forms.dll;CoreLab.Sdac;d:\program files\corelab\mydac for delphi9\bin\CoreLab.Dac.Design.dll;Borland.Vcl.Design.Standard;Borland.Vcl.Design.DbRtl;Borland.Studio.Vcl.Design;d:\program files\borland\bds\3.0\bin\Borland.Studio.ToolsAPI.dll;Borland.Delphi + SDAC + + False + + + + + + False + + + + + + False + + + + $00000000 + + + + True + False + 4 + 10 + 0 + 3010 + False + False + False + False + False 1033 + 1252 + + + + + 4.10.0.10 + + + + + + 4.10.0.10 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/internal/4.10.0.10/1/Source/Delphi9/CoreLab.Sdac.Design.cfg b/internal/4.10.0.10/1/Source/Delphi9/CoreLab.Sdac.Design.cfg new file mode 100644 index 0000000..2582085 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi9/CoreLab.Sdac.Design.cfg @@ -0,0 +1,41 @@ +-$A- +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J- +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-cg +-AWinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-NSBorland.Vcl;CoreLab.Dac;CoreLab.Sdac;CoreLab.Dac.Design;CoreLab.Sdac.Design +-H+ +-W+ +-M +-$M4096,1048576 +-K$00400000 +-N"." +-LN"." +-U"..\Design;.\;..\Net;..\;..\..\..\Dac\Source\Net;..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi9;d:\program files\common files\borland shared\bds\shared assemblies\3.0;d:\program files\borland\bds\3.0\bin;d:\projects\delphi\dac\source\delphi9;d:\projects\delphi\sdac\source\delphi9" +-O"..\Design;.\;..\Net;..\;..\..\..\Dac\Source\Net;..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi9;d:\program files\common files\borland shared\bds\shared assemblies\3.0;d:\program files\borland\bds\3.0\bin;d:\projects\delphi\dac\source\delphi9;d:\projects\delphi\sdac\source\delphi9" +-I"..\Design;.\;..\Net;..\;..\..\..\Dac\Source\Net;..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi9;d:\program files\common files\borland shared\bds\shared assemblies\3.0;d:\program files\borland\bds\3.0\bin;d:\projects\delphi\dac\source\delphi9;d:\projects\delphi\sdac\source\delphi9" +-R"..\Design;.\;..\Net;..\;..\..\..\Dac\Source\Net;..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi9;d:\program files\common files\borland shared\bds\shared assemblies\3.0;d:\program files\borland\bds\3.0\bin;d:\projects\delphi\dac\source\delphi9;d:\projects\delphi\sdac\source\delphi9" +-DSDAC diff --git a/internal/4.10.0.10/1/Source/Delphi9/CoreLab.Sdac.Design.dpk b/internal/4.10.0.10/1/Source/Delphi9/CoreLab.Sdac.Design.dpk new file mode 100644 index 0000000..c225a6e --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi9/CoreLab.Sdac.Design.dpk @@ -0,0 +1,119 @@ +package CoreLab.Sdac.Design; + + +{$ALIGN 0} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'SQL Server Data Access Components'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} +{$DEFINE MYBUILDER} +{$DEFINE SDAC} + +requires + Borland.Delphi, + Borland.Studio.ToolsAPI, + Borland.Studio.Vcl.Design, + Borland.Vcl.Design.DbRtl, + Borland.Vcl.Design.Standard, + CoreLab.Dac.Design, + CoreLab.Sdac, + System.Windows.Forms, + CoreLab.Sdac.AdoNet; + +contains + CoreLab.Sdac.Design.MSNamesEditor in '..\Net\CoreLab.Sdac.Design.MSNamesEditor.pas', + CoreLab.Sdac.Design.MSDumpEditor in '..\Net\CoreLab.Sdac.Design.MSDumpEditor.pas', + CoreLab.Sdac.Design.SdacAbout in '..\Net\CoreLab.Sdac.Design.SdacAbout.pas', + CoreLab.Sdac.Design.MSConnectionEditor in '..\Net\CoreLab.Sdac.Design.MSConnectionEditor.pas', + CoreLab.Sdac.Design.MSParamsFrame in '..\Net\CoreLab.Sdac.Design.MSParamsFrame.pas', + CoreLab.Sdac.Design.MSQueryEditor in '..\Net\CoreLab.Sdac.Design.MSQueryEditor.pas', + CoreLab.Sdac.Design.MSSPCallFrame in '..\Net\CoreLab.Sdac.Design.MSSPCallFrame.pas', + CoreLab.Sdac.Design.MSSQLEditor in '..\Net\CoreLab.Sdac.Design.MSSQLEditor.pas', + CoreLab.Sdac.Design.MSStoredProcEditor in '..\Net\CoreLab.Sdac.Design.MSStoredProcEditor.pas', + CoreLab.Sdac.Design.MSUpdateSQLEditor in '..\Net\CoreLab.Sdac.Design.MSUpdateSQLEditor.pas', + CoreLab.Sdac.Design.MSDesign in '..\Net\CoreLab.Sdac.Design.MSDesign.pas', + CoreLab.Sdac.Design.MSDesignUtils in '..\Net\CoreLab.Sdac.Design.MSDesignUtils.pas', + CoreLab.Sdac.Design.MSMenu in '..\Net\CoreLab.Sdac.Design.MSMenu.pas', + CoreLab.Sdac.Design.MSReg in '..\Net\CoreLab.Sdac.Design.MSReg.pas', + CoreLab.Sdac.MSScript in '..\Net\CoreLab.Sdac.MSScript.pas', + CoreLab.Sdac.MSLoader in '..\Net\CoreLab.Sdac.MSLoader.pas', + CoreLab.Sdac.MSDump in '..\Net\CoreLab.Sdac.MSDump.pas'; + +[assembly: AssemblyTitle('SQL Server Data Access Components')] +[assembly: AssemblyDescription('SQL Server Data Access Components')] +[assembly: AssemblyConfiguration('')] +[assembly: AssemblyCompany('Core Lab')] +[assembly: AssemblyProduct('SQL Server Data Access Components')] +[assembly: AssemblyCopyright('')] +[assembly: AssemblyTrademark('')] +[assembly: AssemblyCulture('')] + + +// The Delphi compiler controls the AssemblyTitleAttribute via the ExeDescription. +// You can set this in the IDE via the Project Options. +// Manually setting the AssemblyTitle attribute below will override the IDE +// setting. +// [assembly: AssemblyTitle('')] + + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion('4.10.0.3010')] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile('mykey.snk')], provided your output +// directory is the project directory (the default). +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile('CoreLab.snk')] +[assembly: AssemblyKeyName('')] +end. diff --git a/internal/4.10.0.10/1/Source/Delphi9/CoreLab.Sdac.bdsproj b/internal/4.10.0.10/1/Source/Delphi9/CoreLab.Sdac.bdsproj new file mode 100644 index 0000000..13e2cb0 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi9/CoreLab.Sdac.bdsproj @@ -0,0 +1,191 @@ + + + + + + + + + + + + CoreLab.Sdac.dpk + + + 7.0 + + + 0 + 0 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 0 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + CoreLab.Sdac;CoreLab.Dac;Borland.Vcl + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + + True + + + 0 + 0 + 1 + False + False + 4096 + 1048576 + 4194304 + SQL Server Data Access Components + False + + + + . + + . + ..\Net;..;..\..\..\Dac\Source\Net;..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi9;d:\program files\common files\borland shared\bds\shared assemblies\3.0;d:\projects\delphi\dac\source\delphi9 + CoreLab.Dac;Borland.VclRtl;Borland.VclDbRtl;Borland.Vcl;Borland.Delphi + + + False + + + + + + False + + + + + + False + + + True + False + 4 + 10 + 0 + 3010 + False + False + False + False + False + + + + + Core Lab + + 4.10.0.10 + + + + + DAC + 4.10.0.10 + + + + + $00000000 + + + + + + + + + + + + + + + + + + + + + + diff --git a/internal/4.10.0.10/1/Source/Delphi9/CoreLab.Sdac.cfg b/internal/4.10.0.10/1/Source/Delphi9/CoreLab.Sdac.cfg new file mode 100644 index 0000000..effe558 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi9/CoreLab.Sdac.cfg @@ -0,0 +1,42 @@ +-$A- +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-cg +-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-NSCoreLab.Sdac;CoreLab.Dac;Borland.Vcl +-H+ +-W+ +-M +-$M4096,1048576 +-K$00400000 +-N"." +-LN"." +-U"..\Net;..;..\..\..\Dac\Source\Net;..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi9;d:\program files\common files\borland shared\bds\shared assemblies\3.0;d:\projects\delphi\dac\source\delphi9" +-O"..\Net;..;..\..\..\Dac\Source\Net;..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi9;d:\program files\common files\borland shared\bds\shared assemblies\3.0;d:\projects\delphi\dac\source\delphi9" +-I"..\Net;..;..\..\..\Dac\Source\Net;..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi9;d:\program files\common files\borland shared\bds\shared assemblies\3.0;d:\projects\delphi\dac\source\delphi9" +-R"..\Net;..;..\..\..\Dac\Source\Net;..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi9;d:\program files\common files\borland shared\bds\shared assemblies\3.0;d:\projects\delphi\dac\source\delphi9" +-DSDAC +-Z diff --git a/internal/4.10.0.10/1/Source/Delphi9/CoreLab.Sdac.dpk b/internal/4.10.0.10/1/Source/Delphi9/CoreLab.Sdac.dpk new file mode 100644 index 0000000..a4bc9b0 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi9/CoreLab.Sdac.dpk @@ -0,0 +1,104 @@ +package CoreLab.Sdac; + +{$ALIGN 0} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'SQL Server Data Access Components'} +{$RUNONLY} +{$IMPLICITBUILD OFF} +{$DEFINE SDAC} + +requires + Borland.Delphi, + Borland.Vcl, + Borland.VclDbRtl, + Borland.VclRtl, + CoreLab.Dac; + +contains + CoreLab.Sdac.SdacVcl in '..\Net\CoreLab.Sdac.SdacVcl.pas', + CoreLab.Sdac.OLEDBIntf in '..\Net\CoreLab.Sdac.OLEDBIntf.pas', + CoreLab.Sdac.MSAccess in '..\Net\CoreLab.Sdac.MSAccess.pas', + CoreLab.Sdac.MSConnectForm in '..\Net\CoreLab.Sdac.MSConnectForm.pas', + CoreLab.Sdac.MSConnectionPool in '..\Net\CoreLab.Sdac.MSConnectionPool.pas', + CoreLab.Sdac.MSConsts in '..\Net\CoreLab.Sdac.MSConsts.pas', + CoreLab.Sdac.MSParser in '..\Net\CoreLab.Sdac.MSParser.pas', + CoreLab.Sdac.MSSQLMonitor in '..\Net\CoreLab.Sdac.MSSQLMonitor.pas', + CoreLab.Sdac.OLEDBAccess in '..\Net\CoreLab.Sdac.OLEDBAccess.pas', + CoreLab.Sdac.OLEDBC in '..\Net\CoreLab.Sdac.OLEDBC.pas', + CoreLab.Sdac.CRThread in '..\Net\CoreLab.Sdac.CRThread.pas', + CoreLab.Sdac.MSServiceBroker in '..\Net\CoreLab.Sdac.MSServiceBroker.pas'; + +[assembly: AssemblyTitle('SQL Server Data Access Components')] +[assembly: AssemblyDescription('SQL Server Data Access Components')] +[assembly: AssemblyConfiguration('')] +[assembly: AssemblyCompany('Core Lab')] +[assembly: AssemblyProduct('SQL Server Data Access Components')] +[assembly: AssemblyCopyright('')] +[assembly: AssemblyTrademark('')] +[assembly: AssemblyCulture('')] + +//[assembly: CLSCompliant(true)] + + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion('4.10.0.3010')] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory which is +// %Project Directory%\obj\. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile('CoreLab.snk')] +[assembly: AssemblyKeyName('')] + +end. diff --git a/internal/4.10.0.10/1/Source/Delphi9/Make.bat b/internal/4.10.0.10/1/Source/Delphi9/Make.bat new file mode 100644 index 0000000..68bd7f6 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi9/Make.bat @@ -0,0 +1,11 @@ +@echo off +rem ********************************************************************** +rem * +rem * Sdac for Delphi 9 +rem * +rem ********************************************************************** + +set IdeDir="D:\Program Files\Borland\BDS\3.0 +del /Q/S SDAC\*.* +call ..\Make.bat Delphi 9 WIN32 +call ..\Make.bat Delphi 9 CLR diff --git a/internal/4.10.0.10/1/Source/Delphi9/dac90.bdsproj b/internal/4.10.0.10/1/Source/Delphi9/dac90.bdsproj new file mode 100644 index 0000000..fba57c4 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi9/dac90.bdsproj @@ -0,0 +1,170 @@ + + + + + + + + + + + + dac90.dpk + + + 7.0 + + + 8 + 0 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 0 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + + + 0 + 0 + 1 + False + False + False + 16384 + 1048576 + 4194304 + Core Lab Data Access Components + + + + . + + . + ..\ + rtl;vcl;dbrtl;vcldb;vclx;dclado90;dbxcds;dbexpress;dclib90;dclindy90;xmlrtl;inet;inetdbbde;inetdbxpress;soaprtl;dsnap;dcl31w90;inetdb;vcldbx;dclie90;webdsnap;websnap;dss;teeui;teedb;tee;dcldbxcds90;dclact90;dsnapcon;odacvcl90;odac90;CRControls90;dac90;oraprov90;dacvcl90;dcldac90;dclodac90 + + + False + + + + + + False + + + + + + False + + + + $00000000 + + + + True + False + 6 + 10 + 1 + 3010 + False + False + False + False + False + + + 6.10.1.10 + Core Lab + + + + + + DAC + 6.10.1.10 + + + diff --git a/internal/4.10.0.10/1/Source/Delphi9/dac90.cfg b/internal/4.10.0.10/1/Source/Delphi9/dac90.cfg new file mode 100644 index 0000000..8e2aa2c --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi9/dac90.cfg @@ -0,0 +1,43 @@ +-$A8 +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-cg +-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-H+ +-W+ +-M +-$M16384,1048576 +-K$00400000 +-N"." +-LN"." +-U"..\" +-O"..\" +-I"..\" +-R"..\" +-Z +-w-UNSAFE_TYPE +-w-UNSAFE_CODE +-w-UNSAFE_CAST diff --git a/internal/4.10.0.10/1/Source/Delphi9/dac90.dpk b/internal/4.10.0.10/1/Source/Delphi9/dac90.dpk new file mode 100644 index 0000000..b76a62c --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi9/dac90.dpk @@ -0,0 +1,52 @@ +package dac90; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Core Lab Data Access Components'} +{$RUNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dbrtl; + +contains + CRAccess in '..\CRAccess.pas', + DALoader in '..\DALoader.pas', + DADump in '..\DADump.pas', + CRParser in '..\CRParser.pas', + DAConsts in '..\DAConsts.pas', + DBMonitorIntf in '..\DBMonitorIntf.pas', + DBMonitorClient in '..\DBMonitorClient.pas', + DASQLMonitor in '..\DASQLMonitor.pas', + DBAccess in '..\DBAccess.pas', + MemData in '..\MemData.pas', + MemDS in '..\MemDS.pas', + VirtualTable in '..\VirtualTable.pas', + DAVersionInfo in '..\DAVersionInfo.pas', + CLRClasses in '..\CLRClasses.pas', + MemUtils in '..\MemUtils.pas', + DAScript in '..\DAScript.pas', + CRBatchMove in '..\CRBatchMove.pas'; + +end. diff --git a/internal/4.10.0.10/1/Source/Delphi9/dac90.res b/internal/4.10.0.10/1/Source/Delphi9/dac90.res new file mode 100644 index 0000000..d50d7f1 Binary files /dev/null and b/internal/4.10.0.10/1/Source/Delphi9/dac90.res differ diff --git a/internal/4.10.0.10/1/Source/Delphi9/dacvcl90.bdsproj b/internal/4.10.0.10/1/Source/Delphi9/dacvcl90.bdsproj new file mode 100644 index 0000000..1f925c1 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi9/dacvcl90.bdsproj @@ -0,0 +1,170 @@ + + + + + + + + + + + + dacvcl90.dpk + + + 7.0 + + + 8 + 0 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 0 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + + + 0 + 0 + 1 + False + False + False + 16384 + 1048576 + 4194304 + Core Lab Data Access GUI related Components + + + + . + + . + ..\ + + + + False + + + + + + False + + + + + + False + + + + $00000000 + + + + True + False + 6 + 10 + 1 + 3010 + False + False + False + False + False + + + Core Lab + + 6.10.1.10 + + + + + DAC + 6.10.1.10 + + + diff --git a/internal/4.10.0.10/1/Source/Delphi9/dacvcl90.cfg b/internal/4.10.0.10/1/Source/Delphi9/dacvcl90.cfg new file mode 100644 index 0000000..8e2aa2c --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi9/dacvcl90.cfg @@ -0,0 +1,43 @@ +-$A8 +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-cg +-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-H+ +-W+ +-M +-$M16384,1048576 +-K$00400000 +-N"." +-LN"." +-U"..\" +-O"..\" +-I"..\" +-R"..\" +-Z +-w-UNSAFE_TYPE +-w-UNSAFE_CODE +-w-UNSAFE_CAST diff --git a/internal/4.10.0.10/1/Source/Delphi9/dacvcl90.dpk b/internal/4.10.0.10/1/Source/Delphi9/dacvcl90.dpk new file mode 100644 index 0000000..70e895d --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi9/dacvcl90.dpk @@ -0,0 +1,36 @@ +package dacvcl90; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Core Lab Data Access GUI related Components'} +{$IMPLICITBUILD OFF} + +requires + rtl, + dac90, + vcl; + +contains + DacVcl in '..\DacVcl.pas'; + +end. diff --git a/internal/4.10.0.10/1/Source/Delphi9/dacvcl90.res b/internal/4.10.0.10/1/Source/Delphi9/dacvcl90.res new file mode 100644 index 0000000..d50d7f1 Binary files /dev/null and b/internal/4.10.0.10/1/Source/Delphi9/dacvcl90.res differ diff --git a/internal/4.10.0.10/1/Source/Delphi9/dcldac90.bdsproj b/internal/4.10.0.10/1/Source/Delphi9/dcldac90.bdsproj new file mode 100644 index 0000000..0035d87 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi9/dcldac90.bdsproj @@ -0,0 +1,172 @@ + + + + + + + + + + + + dcldac90.dpk + + + 7.0 + + + 8 + 0 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 0 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + + + 0 + 0 + 1 + False + False + False + 16384 + 1048576 + 4194304 + Core Lab Data Access Components + + + + . + + . + ..\Design;..\;D:\Program Files\Borland\BDS\3.0\source\ToolsAPI\ + + + + False + + + + + + False + + + + + + False + + + + $00000000 + + + + True + False + 6 + 10 + 1 + 3010 + False + False + False + False + False + + + + + Core Lab + + 6.10.1.10 + + + + + DAC + 6.10.1.10 + + + diff --git a/internal/4.10.0.10/1/Source/Delphi9/dcldac90.cfg b/internal/4.10.0.10/1/Source/Delphi9/dcldac90.cfg new file mode 100644 index 0000000..a00a7d9 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi9/dcldac90.cfg @@ -0,0 +1,43 @@ +-$A8 +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J- +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-cg +-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-H+ +-W+ +-M +-$M16384,1048576 +-K$00400000 +-N"." +-LN"." +-U"..\;..\Design\" +-O"..\;..\Design\" +-I"..\;..\Design\" +-R"..\;..\Design\" +-Z +-w-UNSAFE_TYPE +-w-UNSAFE_CODE +-w-UNSAFE_CAST diff --git a/internal/4.10.0.10/1/Source/Delphi9/dcldac90.dpk b/internal/4.10.0.10/1/Source/Delphi9/dcldac90.dpk new file mode 100644 index 0000000..27c3767 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi9/dcldac90.dpk @@ -0,0 +1,47 @@ +package dcldac90; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'Core Lab Data Access Components'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} + +requires + rtl, + dac90, + dcldb, + dacvcl90, + vcl, + dbrtl, + vcldb, + vclactnband; + +contains + DacReg in '..\Design\DacReg.pas', + VTDesign in '..\Design\VTDesign.pas', + DAMenu in '..\Design\DAMenu.pas', + DADesign in '..\Design\DADesign.pas', + Download in '..\Design\Download.pas'; + +end. + \ No newline at end of file diff --git a/internal/4.10.0.10/1/Source/Delphi9/dcldac90.res b/internal/4.10.0.10/1/Source/Delphi9/dcldac90.res new file mode 100644 index 0000000..d50d7f1 Binary files /dev/null and b/internal/4.10.0.10/1/Source/Delphi9/dcldac90.res differ diff --git a/internal/4.10.0.10/1/Source/Delphi9/dclsdac90.bdsproj b/internal/4.10.0.10/1/Source/Delphi9/dclsdac90.bdsproj new file mode 100644 index 0000000..e034c21 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi9/dclsdac90.bdsproj @@ -0,0 +1,172 @@ + + + + + + + + + + + + dclsdac90.dpk + + + 7.0 + + + 8 + 0 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 0 + 1 + True + True + WinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + + + 0 + 0 + 1 + False + False + False + 4096 + 1048576 + 4194304 + SQL Server Data Access Components + + + . + . + + + d:\windows\microsoft.net\framework\v1.1.4322;d:\program files\common files\borland shared\bds\shared assemblies\2.0;d:\Projects\Delphi\Dac\Source\;d:\Projects\Delphi\SDac\Source\;d:\Projects\Delphi\Dac\Source\Delphi9 + + sdac;MYBUILDER + + False + + + + + + False + + + + + + False + + + + $00000000 + + + + True + False + 4 + 10 + 0 + 3010 + False + False + False + False + False + + + + + + + 4.10.0.10 + + + + + + 4.10.0.10 + + + diff --git a/internal/4.10.0.10/1/Source/Delphi9/dclsdac90.cfg b/internal/4.10.0.10/1/Source/Delphi9/dclsdac90.cfg new file mode 100644 index 0000000..31c25ca --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi9/dclsdac90.cfg @@ -0,0 +1,41 @@ +-$A8 +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-cg +-AWinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-H+ +-W+ +-M +-$M4096,1048576 +-K$00400000 +-N"." +-LN"." +-U"..\Design;..\..\Net\D9;..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi9;..\;D:\Program Files\Borland\BDS\3.0\source\ToolsAPI\" +-O"..\Design;..\..\Net\D9;..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi9;..\;D:\Program Files\Borland\BDS\3.0\source\ToolsAPI\" +-I"..\Design;..\..\Net\D9;..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi9;..\;D:\Program Files\Borland\BDS\3.0\source\ToolsAPI\" +-R"..\Design;..\..\Net\D9;..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi9;..\;D:\Program Files\Borland\BDS\3.0\source\ToolsAPI\" +-Dsdac +-Z diff --git a/internal/4.10.0.10/1/Source/Delphi9/dclsdac90.dpk b/internal/4.10.0.10/1/Source/Delphi9/dclsdac90.dpk new file mode 100644 index 0000000..56be516 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi9/dclsdac90.dpk @@ -0,0 +1,50 @@ + +////////////////////////////////////////////////// +// SQL Server Data Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +// SDAC Package for Delphi 9 +////////////////////////////////////////////////// + +package dclsdac90; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'SQL Server Data Access Components'} +{$DESIGNONLY} +{$IMPLICITBUILD OFF} +{$DEFINE sdac} + +requires + sdac90, + dcldb, + dcldac90, + vcljpg, + sdacvcl90, + designide; + +contains + MSDesign in '..\Design\MSDesign.pas', + MSReg in '..\Design\MSReg.pas', + MSMenu in '..\Design\MSMenu.pas'; + +end. diff --git a/internal/4.10.0.10/1/Source/Delphi9/dclsdac90.res b/internal/4.10.0.10/1/Source/Delphi9/dclsdac90.res new file mode 100644 index 0000000..1c23367 Binary files /dev/null and b/internal/4.10.0.10/1/Source/Delphi9/dclsdac90.res differ diff --git a/internal/4.10.0.10/1/Source/Delphi9/sdac90.bdsproj b/internal/4.10.0.10/1/Source/Delphi9/sdac90.bdsproj new file mode 100644 index 0000000..aba2834 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi9/sdac90.bdsproj @@ -0,0 +1,172 @@ + + + + + + + + + + + + sdac90.dpk + + + 7.0 + + + 8 + 0 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 0 + 1 + True + True + WinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + + + 0 + 0 + 1 + False + False + False + 4096 + 1048576 + 4194304 + SQL Server Data Access Components + + + . + . + . + + d:\windows\microsoft.net\framework\v1.1.4322;d:\program files\common files\borland shared\bds\shared assemblies\2.0;d:\Projects\Delphi\Dac\Source\;d:\Projects\Delphi\SDac\Source\ + + SDAC + + False + + + + + + False + + + + + + False + + + + $00000000 + + + + True + False + 4 + 10 + 0 + 3010 + False + False + False + False + False + + + + + + + 4.10.0.10 + + + + + + 4.10.0.10 + + + diff --git a/internal/4.10.0.10/1/Source/Delphi9/sdac90.cfg b/internal/4.10.0.10/1/Source/Delphi9/sdac90.cfg new file mode 100644 index 0000000..10bc42c --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi9/sdac90.cfg @@ -0,0 +1,41 @@ +-$A8 +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-cg +-AWinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-H+ +-W+ +-M +-$M4096,1048576 +-K$00400000 +-N"." +-LN"." +-U"..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi9;..\" +-O"..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi9;..\" +-I"..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi9;..\" +-R"..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi9;..\" +-DSDAC +-Z diff --git a/internal/4.10.0.10/1/Source/Delphi9/sdac90.dpk b/internal/4.10.0.10/1/Source/Delphi9/sdac90.dpk new file mode 100644 index 0000000..4d673c0 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi9/sdac90.dpk @@ -0,0 +1,54 @@ + +////////////////////////////////////////////////// +// SQL Server Data Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +// SDAC Package for Delphi 9 +////////////////////////////////////////////////// + +package sdac90; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'SQL Server Data Access Components'} +{$RUNONLY} +{$IMPLICITBUILD OFF} +{$DEFINE SDAC} + +requires + vcl, + vcldb, + dac90, + rtl, + dbrtl; + +contains + MSAccess in '..\MSAccess.pas', + MSConnectionPool in '..\MSConnectionPool.pas', + MSConsts in '..\MSConsts.pas', + MSSQLMonitor in '..\MSSQLMonitor.pas', + OLEDBAccess in '..\OLEDBAccess.pas', + OLEDBC in '..\OLEDBC.pas', + OLEDBIntf in '..\OLEDBIntf.pas', + MSScript in '..\MSScript.pas'; + +end. diff --git a/internal/4.10.0.10/1/Source/Delphi9/sdac90.res b/internal/4.10.0.10/1/Source/Delphi9/sdac90.res new file mode 100644 index 0000000..1c23367 Binary files /dev/null and b/internal/4.10.0.10/1/Source/Delphi9/sdac90.res differ diff --git a/internal/4.10.0.10/1/Source/Delphi9/sdacvcl90.bdsproj b/internal/4.10.0.10/1/Source/Delphi9/sdacvcl90.bdsproj new file mode 100644 index 0000000..3a6c3b0 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi9/sdacvcl90.bdsproj @@ -0,0 +1,172 @@ + + + + + + + + + + + + sdacvcl90.dpk + + + 7.0 + + + 8 + 0 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 0 + 1 + True + True + WinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + + + 0 + 0 + 1 + False + False + False + 4096 + 1048576 + 4194304 + SQL Server Data Access GUI related Components + + + . + . + + + d:\windows\microsoft.net\framework\v1.1.4322;d:\program files\common files\borland shared\bds\shared assemblies\2.0;d:\Projects\Delphi\Dac\Source\;d:\Projects\Delphi\SDac\Source\ + + SDAC + + False + + + + + + False + + + + + + False + + + + $00000000 + + + + True + False + 4 + 10 + 0 + 3010 + False + False + False + False + False + + + + + 4.10.0.10 + + + + + + + + 4.10.0.10 + + + diff --git a/internal/4.10.0.10/1/Source/Delphi9/sdacvcl90.cfg b/internal/4.10.0.10/1/Source/Delphi9/sdacvcl90.cfg new file mode 100644 index 0000000..10bc42c --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi9/sdacvcl90.cfg @@ -0,0 +1,41 @@ +-$A8 +-$B- +-$C+ +-$D- +-$E- +-$F- +-$G+ +-$H+ +-$I+ +-$J+ +-$K- +-$L- +-$M- +-$N+ +-$O+ +-$P+ +-$Q- +-$R- +-$S- +-$T- +-$U- +-$V+ +-$W- +-$X+ +-$Y- +-$Z1 +-cg +-AWinTypes=Borland.Vcl.Windows;WinProcs=Borland.Vcl.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-H+ +-W+ +-M +-$M4096,1048576 +-K$00400000 +-N"." +-LN"." +-U"..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi9;..\" +-O"..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi9;..\" +-I"..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi9;..\" +-R"..\..\..\Dac\Source;..\..\..\Dac\Source\Delphi9;..\" +-DSDAC +-Z diff --git a/internal/4.10.0.10/1/Source/Delphi9/sdacvcl90.dpk b/internal/4.10.0.10/1/Source/Delphi9/sdacvcl90.dpk new file mode 100644 index 0000000..6c4a9ff --- /dev/null +++ b/internal/4.10.0.10/1/Source/Delphi9/sdacvcl90.dpk @@ -0,0 +1,37 @@ +package sdacvcl90; + +{$R *.res} +{$ALIGN 8} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST ON} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'SQL Server Data Access GUI related Components'} +{$IMPLICITBUILD OFF} +{$DEFINE SDAC} + +requires + rtl, + dacvcl90, + sdac90; + +contains + sdacVcl in '..\sdacVcl.pas'; + +end. diff --git a/internal/4.10.0.10/1/Source/Delphi9/sdacvcl90.res b/internal/4.10.0.10/1/Source/Delphi9/sdacvcl90.res new file mode 100644 index 0000000..1c23367 Binary files /dev/null and b/internal/4.10.0.10/1/Source/Delphi9/sdacvcl90.res differ diff --git a/internal/4.10.0.10/1/Source/Design/CRColFrame.dfm b/internal/4.10.0.10/1/Source/Design/CRColFrame.dfm new file mode 100644 index 0000000..c754dbd --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/CRColFrame.dfm @@ -0,0 +1,21 @@ +inherited CRColFrame: TCRColFrame + Width = 448 + object lbItemName: TListBox + Left = 8 + Top = 24 + Width = 153 + Height = 195 + Anchors = [akLeft, akTop, akBottom] + ItemHeight = 13 + TabOrder = 0 + OnClick = lbItemNameClick + end + object PanelItem: TPanel + Left = 176 + Top = 8 + Width = 264 + Height = 211 + Anchors = [akLeft, akTop, akRight, akBottom] + TabOrder = 1 + end +end diff --git a/internal/4.10.0.10/1/Source/Design/CRColFrame.pas b/internal/4.10.0.10/1/Source/Design/CRColFrame.pas new file mode 100644 index 0000000..2286371 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/CRColFrame.pas @@ -0,0 +1,261 @@ + +////////////////////////////////////////////////// +// DB Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +// Collection Frame +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I Dac.inc} + +unit CRColFrame; +{$ENDIF} + +interface + +uses +{$IFDEF MSWINDOWS} + Windows, Messages, Graphics, Controls, Forms, + Dialogs, StdCtrls, ExtCtrls, +{$ENDIF} +{$IFDEF LINUX} + QStdCtrls, QExtCtrls, QControls, QGraphics, QForms, +{$ENDIF} + Classes, SysUtils, + CRFrame, CRTabEditor; + +type + TCRColFrame = class(TCRFrame) + lbItemName: TListBox; + PanelItem: TPanel; + procedure lbItemNameClick(Sender: TObject); + + protected + FOldItemIndex: integer; + + FInStoreItem, FInSelectItem: boolean; + + function GetItems: TCollection; virtual; + function GetItemName(Item: TCollectionItem): string; virtual; + procedure InitItems; virtual; + procedure StoreItem; + function IsControlEnabled(Control: TControl): boolean; + procedure ItemToControls(Item: TCollectionItem); virtual; + procedure ControlsToItem(Item: TCollectionItem); virtual; + procedure UpdateControlState(Control: TControl); + procedure UpdateControlsState; virtual; + + procedure DoActivate; override; + procedure DoFinish; override; + + property Items: TCollection read GetItems; + public + procedure SelectItem; + end; + +implementation + +{$IFDEF IDE} +{$R *.dfm} +{$ENDIF} +{$IFDEF MSWINDOWS} +{$R CRColFrame.dfm} +{$ENDIF} +{$IFDEF LINUX} +{$R *.xfm} +{$ENDIF} + +uses + DB, DASQLEditor; + +function TCRColFrame.GetItems: TCollection; +begin + Result := nil; + Assert(False, 'Must be overriden'); +end; + +function TCRColFrame.GetItemName(Item: TCollectionItem): string; +begin + Result := ''; + Assert(False, 'Must be overriden'); +end; + +procedure TCRColFrame.ItemToControls(Item: TCollectionItem); +begin + Assert(False, 'Must be overriden'); +end; + +procedure TCRColFrame.ControlsToItem(Item: TCollectionItem); +begin + Assert(False, 'Must be overriden'); +end; + +procedure TCRColFrame.InitItems; +var + i: integer; + OldIndex: integer; +begin + OldIndex := lbItemName.ItemIndex; + lbItemName.Items.Clear; + Enabled := Items.Count > 0; + if not Enabled then begin + UpdateControlsState; + if (Editor.ActiveControl = nil) and (TCRTabEditorForm(Editor).PageControl.ActivePage = Page) then + Editor.ActiveControl := Page; + Exit; + end; + FOldItemIndex := -1; + + for i := 0 to Items.Count - 1 do + lbItemName.Items.Add(GetItemName(Items.Items[i])); + + if (OldIndex >= 0) and (OldIndex < Items.Count) then + lbItemName.ItemIndex := OldIndex + else + lbItemName.ItemIndex := 0; + + SelectItem; +end; + +function TCRColFrame.IsControlEnabled(Control: TControl): boolean; +begin + Result := Enabled and Control.Enabled and Control.Parent.Enabled and Control.Visible; +end; + +procedure TCRColFrame.UpdateControlState(Control: TControl); +var + e: boolean; +begin + e := IsControlEnabled(Control); + + if Control is TComboBox then begin + if e then + TComboBox(Control).Color := clWindow + else + begin + TComboBox(Control).Color := clBtnFace; + TComboBox(Control).ItemIndex := -1; + end; + end + else + if Control is TEdit then begin + if e then begin + TEdit(Control).Color := clWindow; + TEdit(Control).ParentFont := True; + end + else + begin + TEdit(Control).Color := clBtnFace; + TEdit(Control).Font.Color := clBtnFace; + TEdit(Control).Text := ''; + end; + end + else + if Control is TMemo then begin + if e then begin + TMemo(Control).Color := clWindow; + TMemo(Control).ParentFont := True; + end + else + begin + TMemo(Control).Color := clBtnFace; + TMemo(Control).Font.Color := clBtnFace; + TMemo(Control).Text := ''; + end; + end + else + if not (Control is TLabel) and not (Control is TButton) and + not (Control is TCheckBox) then + Assert(False, Control.Name + ' is ' + Control.ClassName); +end; + +procedure TCRColFrame.UpdateControlsState; +var + i: integer; +begin + for i := 0 to PanelItem.ControlCount - 1 do + UpdateControlState(PanelItem.Controls[i]); +end; + +procedure TCRColFrame.StoreItem; +var + Item: TCollectionItem; +begin + if (FOldItemIndex <> - 1) and + (Items.Count > FOldItemIndex) then begin + Item := Items.Items[FOldItemIndex]; + FInStoreItem := True; + try + ControlsToItem(Item); + finally + FInStoreItem := False; + end; + end; +end; + +procedure TCRColFrame.SelectItem; +var + Item: TCollectionItem; + OldModified: boolean; + i: integer; + +begin + OldModified := Modified; + FInSelectItem := True; + try + PanelItem.Enabled := lbItemName.ItemIndex <> - 1; + + if PanelItem.Enabled then begin + for i := 0 to PanelItem.ControlCount - 1 do + PanelItem.Controls[i].Enabled := True; + + Item := Items.Items[lbItemName.ItemIndex]; + ItemToControls(Item); + + FOldItemIndex := lbItemName.ItemIndex; + end; + + finally + UpdateControlsState; + FInSelectItem := False; + Modified := OldModified; + end; +end; + +procedure TCRColFrame.DoActivate; +begin + inherited; + + // on processing error in ControlsToItem FInStoreItem maybe True + if not FInStoreItem then + InitItems; +end; + +procedure TCRColFrame.DoFinish; +begin + inherited; +{ + Temporary commented to avoid folowing situations: + 1. Set DataType to Integer + 2. Set value to 'qqqq' + 3. Press Cancel button + 4. Press 'Yes' + + Assert(Owner is TDASQLEditorForm); + if (TDASQLEditorForm(Owner).ActiveControl <> TDASQLEditorForm(Owner).btCancel) + and (TDASQLEditorForm(Owner).ActiveControl <> nil) then +} + + StoreItem; +end; + +procedure TCRColFrame.lbItemNameClick(Sender: TObject); +begin + if lbItemName.ItemIndex <> FOldItemIndex then begin + StoreItem; + SelectItem; + end; +end; + +end. diff --git a/internal/4.10.0.10/1/Source/Design/CRColFrame.xfm b/internal/4.10.0.10/1/Source/Design/CRColFrame.xfm new file mode 100644 index 0000000..fa29923 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/CRColFrame.xfm @@ -0,0 +1,21 @@ +inherited CRColFrame: TCRColFrame + Width = 450 + object lbItemName: TListBox + Left = 8 + Top = 24 + Width = 153 + Height = 197 + Anchors = [akLeft, akTop, akBottom] + ItemHeight = 13 + TabOrder = 0 + OnClick = lbItemNameClick + end + object PanelItem: TPanel + Left = 176 + Top = 8 + Width = 266 + Height = 213 + Anchors = [akLeft, akTop, akRight, akBottom] + TabOrder = 1 + end +end diff --git a/internal/4.10.0.10/1/Source/Design/CRDataEditor.dfm b/internal/4.10.0.10/1/Source/Design/CRDataEditor.dfm new file mode 100644 index 0000000..bf206c2 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/CRDataEditor.dfm @@ -0,0 +1,83 @@ +inherited CRDataEditorForm: TCRDataEditorForm + Width = 697 + Height = 360 + Caption = 'CRDataEditorForm' + PixelsPerInch = 96 + TextHeight = 13 + inherited BtnPanel: TPanel + Top = 292 + Width = 689 + TabOrder = 2 + Visible = False + inherited imCorner: TImage + Left = 677 + end + inherited btOk: TBitBtn + Left = 525 + end + inherited btCancel: TBitBtn + Left = 606 + end + end + object StatusBar: TStatusBar + Left = 0 + Top = 273 + Width = 689 + Height = 19 + Panels = < + item + Width = 120 + end + item + Width = 120 + end + item + Width = 50 + end> + end + object pnlToolBar: TPanel + Left = 0 + Top = 0 + Width = 689 + Height = 22 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object btClose: TSpeedButton + Left = 75 + Top = 0 + Width = 75 + Height = 23 + Caption = '&Close' + end + object DBNavigator: TDBNavigator + Left = 425 + Top = 0 + Width = 240 + Height = 22 + DataSource = DataSource + TabOrder = 0 + end + end + object DBGrid: TDBGrid + Left = 0 + Top = 22 + Width = 689 + Height = 251 + Align = alClient + DataSource = DataSource + TabOrder = 1 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = 13 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Pitch = fpVariable + TitleFont.Style = [] + end + object DataSource: TDataSource + OnStateChange = DataSourceStateChange + OnDataChange = DataSourceDataChange + Left = 16 + Top = 48 + end +end diff --git a/internal/4.10.0.10/1/Source/Design/CRDataEditor.pas b/internal/4.10.0.10/1/Source/Design/CRDataEditor.pas new file mode 100644 index 0000000..4318079 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/CRDataEditor.pas @@ -0,0 +1,134 @@ +////////////////////////////////////////////////// +// DB Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +// Base Component Editor +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I Dac.inc} + +unit CRDataEditor; +{$ENDIF} + +interface +uses +{$IFDEF MSWINDOWS} + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, DBGrids, Dialogs, + StdCtrls, ExtCtrls, Buttons, ComCtrls, Grids, DBCtrls, +{$ENDIF} +{$IFDEF LINUX} + SysUtils, Types, Classes, QGraphics, QControls, QForms, QDBGrids, QDialogs, QStdCtrls, + QExtCtrls, QButtons, QDBCtrls, QComCtrls, QGrids, +{$ENDIF} + DB, CREditor, MemDS, DADesignUtils; + +type + TCRDataEditorForm = class(TCREditorForm) + pnlToolBar: TPanel; + btClose: TSpeedButton; + DBNavigator: TDBNavigator; +{$IFDEF CLR} + DBGrid: TCustomDBGrid; +{$ELSE} + DBGrid: TDBGrid; +{$ENDIF} + StatusBar: TStatusBar; + DataSource: TDataSource; + procedure DataSourceStateChange(Sender: TObject); + procedure DataSourceDataChange(Sender: TObject; Field: TField); + procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); + protected + FDataSet: TMemDataSet; + + procedure DoInit; override; + procedure DoSave; override; + procedure DoFinish; override; + + function GetComponent: TComponent; override; + procedure SetComponent(Value: TComponent); override; + end; + +implementation + +{$IFDEF IDE} +{$R *.dfm} +{$ENDIF} +{$IFDEF MSWINDOWS} +{$R CRDataEditor.dfm} +{$ENDIF} +{$IFDEF LINUX} +{$R *.xfm} +{$ENDIF} + +uses +{$IFDEF CLR} + Variants, +{$ENDIF} + TypInfo; + +{ TDADataEditorForm } + +procedure TCRDataEditorForm.DoInit; +var + cg: TCustomDBGrid; +begin + inherited; + + cg := DBGrid; + if ReplaceGridToCRGrid(cg) then begin + {$IFDEF CLR} + DBGrid := cg; + {$ELSE} + DBGrid := TDBGrid(cg); + {$ENDIF} + SetPropValue(DBGrid, 'OptionsEx', Variant('dgeEnableSort,dgeLocalFilter,dgeLocalSorting]')); // disable dgeRecordCount + end; + DataSource.DataSet := Component as TMemDataSet; +end; + +procedure TCRDataEditorForm.DoSave; +begin +end; + +procedure TCRDataEditorForm.DoFinish; +begin + inherited; +end; + +function TCRDataEditorForm.GetComponent: TComponent; +begin + Result := FDataSet; +end; + +procedure TCRDataEditorForm.SetComponent(Value: TComponent); +begin + FDataSet := Value as TMemDataSet; +end; + +procedure TCRDataEditorForm.DataSourceStateChange(Sender: TObject); +begin + StatusBar.Panels[0].Text := 'RecordCount: ' + IntToStr(FDataSet.RecordCount); + StatusBar.Panels[1].Text := 'RecordNo: ' + IntToStr(FDataSet.RecNo); +end; + +procedure TCRDataEditorForm.DataSourceDataChange(Sender: TObject; + Field: TField); +begin + DataSourceStateChange(nil); +end; + +procedure TCRDataEditorForm.FormCloseQuery(Sender: TObject; + var CanClose: Boolean); +begin + DBGrid.SetFocus; + inherited; +end; + +{$IFDEF CLR} +initialization + + RegisterClass(TDBGrid); +{$ENDIF} + +end. diff --git a/internal/4.10.0.10/1/Source/Design/CRDataEditor.xfm b/internal/4.10.0.10/1/Source/Design/CRDataEditor.xfm new file mode 100644 index 0000000..bf206c2 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/CRDataEditor.xfm @@ -0,0 +1,83 @@ +inherited CRDataEditorForm: TCRDataEditorForm + Width = 697 + Height = 360 + Caption = 'CRDataEditorForm' + PixelsPerInch = 96 + TextHeight = 13 + inherited BtnPanel: TPanel + Top = 292 + Width = 689 + TabOrder = 2 + Visible = False + inherited imCorner: TImage + Left = 677 + end + inherited btOk: TBitBtn + Left = 525 + end + inherited btCancel: TBitBtn + Left = 606 + end + end + object StatusBar: TStatusBar + Left = 0 + Top = 273 + Width = 689 + Height = 19 + Panels = < + item + Width = 120 + end + item + Width = 120 + end + item + Width = 50 + end> + end + object pnlToolBar: TPanel + Left = 0 + Top = 0 + Width = 689 + Height = 22 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object btClose: TSpeedButton + Left = 75 + Top = 0 + Width = 75 + Height = 23 + Caption = '&Close' + end + object DBNavigator: TDBNavigator + Left = 425 + Top = 0 + Width = 240 + Height = 22 + DataSource = DataSource + TabOrder = 0 + end + end + object DBGrid: TDBGrid + Left = 0 + Top = 22 + Width = 689 + Height = 251 + Align = alClient + DataSource = DataSource + TabOrder = 1 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = 13 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Pitch = fpVariable + TitleFont.Style = [] + end + object DataSource: TDataSource + OnStateChange = DataSourceStateChange + OnDataChange = DataSourceDataChange + Left = 16 + Top = 48 + end +end diff --git a/internal/4.10.0.10/1/Source/Design/CREditor.dfm b/internal/4.10.0.10/1/Source/Design/CREditor.dfm new file mode 100644 index 0000000..1449b4e --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/CREditor.dfm @@ -0,0 +1,87 @@ +object CREditorForm: TCREditorForm + Left = 302 + Top = 181 + Width = 511 + Height = 73 + Caption = 'CREditorForm' + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = 13 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [] + KeyPreview = True + OldCreateOrder = True + Position = poDefaultPosOnly + Scaled = False + OnCloseQuery = FormCloseQuery + OnHide = FormHide + OnKeyPress = FormKeyPress + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 13 + object BtnPanel: TPanel + Left = 0 + Top = 5 + Width = 503 + Height = 41 + Align = alBottom + BevelOuter = bvNone + TabOrder = 0 + object imCorner: TImage + Left = 491 + Top = 29 + Width = 12 + Height = 12 + Anchors = [akRight, akBottom] + Picture.Data = { + 07544269746D6170D6000000424DD60000000000000076000000280000000C00 + 00000C0000000100040000000000600000000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF008778F778F77800008F778F778F77000088F778F778F70000888F778F778F + 00008888F778F778000088888F778F770000888888F778F700008888888F778F + 000088888888F7780000888888888F7700008888888888F70000888888888888 + 0000} + Transparent = True + end + object btOk: TBitBtn + Left = 339 + Top = 8 + Width = 75 + Height = 25 + Anchors = [akRight, akBottom] + Caption = 'OK' + Default = True + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [] + ParentFont = False + TabOrder = 0 + OnClick = SaveClick + end + object btCancel: TBitBtn + Left = 420 + Top = 8 + Width = 75 + Height = 25 + Anchors = [akRight, akBottom] + Cancel = True + Caption = 'Cancel' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [] + ParentFont = False + TabOrder = 1 + OnClick = CloseClick + NumGlyphs = 2 + end + end +end diff --git a/internal/4.10.0.10/1/Source/Design/CREditor.pas b/internal/4.10.0.10/1/Source/Design/CREditor.pas new file mode 100644 index 0000000..824a0a1 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/CREditor.pas @@ -0,0 +1,1255 @@ + +////////////////////////////////////////////////// +// DB Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +// Base Component Editor +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I Dac.inc} + +unit CREditor; +{$ENDIF} + +interface +uses +{$IFDEF MSWINDOWS} + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, DBGrids, Dialogs, + StdCtrls, ExtCtrls, Buttons, +{$ENDIF} +{$IFDEF LINUX} + SysUtils, Types, Classes, QGraphics, QControls, QForms, QDBGrids, QDialogs, QStdCtrls, QExtCtrls, + QButtons, Qt, +{$ENDIF} +{$IFDEF DBTOOLS} + DBToolsClient, +{$IFDEF CLR} + System.Text, +{$ENDIF} +{$ENDIF} + DBAccess, DADesignUtils; + +type + TCREditorClass = class of TCREditorForm; + TCREditorForm = class(TForm) + BtnPanel: TPanel; + btOk: TBitBtn; + btCancel: TBitBtn; + imCorner: TImage; + procedure FormShow(Sender: TObject); + procedure FormHide(Sender: TObject); + procedure SaveClick(Sender: TObject); + procedure CloseClick(Sender: TObject); + procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); + procedure FormKeyPress(Sender: TObject; var Key: Char); + {$IFDEF DBTOOLS} + {$IFDEF CLR} + protected + OldMessageProcessing : TMessageEvent; + procedure MessageProcessing(var Msg: TMsg; var Handled: Boolean); + public + destructor Destroy; override; + {$ENDIF} + {$ENDIF} + private + FOldCreateOrder: boolean; + {$IFDEF MSWINDOWS} + FOldPosition: TPosition; + {$ENDIF} + + FConfirmCancel: boolean; + + procedure SetConfirmCancel(const Value: boolean); + {$IFDEF DBTOOLS} + procedure WMActivate(var Message: TWMActivate); message WM_ACTIVATE; + {$ENDIF} + protected + FModified: boolean; + FolderName: string; + FDADesignUtilsClass: TDADesignUtilsClass; + FInitialProperty: string; + {$IFDEF USE_SYNEDIT} + FSynSQLSyn: TPersistent; + FUseSynEdit: boolean; + {$ENDIF} + + function GetModified: boolean; virtual; + procedure SetModified(Value: boolean); virtual; + + procedure ReplaceMemos; + {$IFDEF USE_SYNEDIT} + procedure SynMenuItemClick(Sender: TObject); + procedure SynMenuPopup(Sender: TObject); + {$ENDIF} + + procedure DoInit; virtual; + procedure DoActivate; virtual; + procedure DoSave; virtual; + procedure DoFinish; virtual; + + procedure ExitActiveControl; virtual; + procedure SaveControlData; virtual; + + function SaveState: boolean; virtual; + function LoadState: boolean; virtual; + + function GetComponent: TComponent; virtual; + procedure SetComponent(Value: TComponent); virtual; + function GetLocalComponent: TComponent; virtual; + + {$IFDEF MSWINDOWS} + function KeyPath: string; + {$ENDIF} + {$IFDEF DBTOOLS} + procedure ActiveChanged; override; + {$ENDIF} + property Modified: boolean read GetModified write SetModified; + + public + constructor Create(Owner: TComponent; DADesignUtilsClass: TDADesignUtilsClass); reintroduce; virtual; + + {$IFDEF USE_SYNEDIT} + procedure ReplaceMemo(var Memo: TWinControl; DrawGutter: boolean); + {$ENDIF} + + procedure CheckConnection(const Component: TComponent); + + /// If ConfirmCancel is True editor asks user for comfirmation to discard + /// changes. By default ConfirmCancel is set to True. + property ConfirmCancel: boolean read FConfirmCancel write SetConfirmCancel; + + property DADesignUtilsClass: TDADesignUtilsClass read FDADesignUtilsClass; + + property Component: TComponent read GetComponent write SetComponent; + property LocalComponent: TComponent read GetLocalComponent; + property InitialProperty: string read FInitialProperty write FInitialProperty; + + published + property OldCreateOrder: boolean read FOldCreateOrder write FOldCreateOrder; // for D3 + end; + + { + TComponent + TControl + TWinControl + TCustomEdit + TCustomMemo + TMemo + TDAMemo + TCustomControl + TCustomSynEdit + TSynEdit + TSynMemo + } + + TDAMemo = class(TMemo) + protected + BackSpacePressed: boolean; + procedure KeyDown(var Key: Word; Shift: TShiftState); override; + procedure KeyPress(var Key: Char); override; + end; + +{$IFDEF LINUX} + TWinControlClass = class of TWinControl; +{$ENDIF} + + function ReplaceControl(var Control: TWinControl; const NewClass: TWinControlClass): boolean; + function ReplaceGridToCRGrid(var DBGrid: TCustomDBGrid): boolean; + + function GetMemoText(Memo: TWinControl): string; + procedure SetMemoText(Memo: TWinControl; Value: string); + function GetReadOnly(Memo: TWinControl): boolean; + procedure SetReadOnly(Memo: TWinControl; Value: boolean); + function GetSelStart(Memo: TWinControl): integer; + procedure SetSelStart(Memo: TWinControl; Value: integer); + procedure SetSelLength(Memo: TWinControl; Value: integer); + procedure LoadFromFile(Memo: TWinControl; FileName: string); + procedure SaveToFile(Memo: TWinControl; FileName: string); + +implementation +uses +{$IFDEF MSWINDOWS} + Registry, +{$ENDIF} +{$IFDEF USE_SYNEDIT} + Menus, +{$ENDIF} + TypInfo, + DAParamValueEditor, DB, DAConsts; + +{$IFDEF IDE} +{$R *.dfm} +{$ENDIF} +{$IFDEF MSWINDOWS} +{$R CREditor.dfm} +{$ENDIF} +{$IFDEF LINUX} +{$R *.xfm} +{$ENDIF} + +const + sSynMemo = 'TSynMemo'; + sSynSQLSyn = 'TSynSQLSyn'; + +{$IFDEF USE_SYNEDIT} + SynMenuItemNames: array[0..7] of string = ( + '&Undo', + '-', + 'Cu&t', + '&Copy', + '&Paste', + '&Delete', + '-', + 'Select &All' + ); + +type + TSynMenuItem = class(TMenuItem) + public + Memo: TWinControl; + end; +{$ENDIF} + + +function ReplaceControl(var Control: TWinControl; const NewClass: TWinControlClass): boolean; +var + NewControl: TWinControl; + + i, PropCount: integer; +{$IFDEF CLR} + PropList: TPropList; + PropInfo: TPropInfo; +{$ELSE} + PropList: PPropList; + PropInfo: PPropInfo; +{$ENDIF} + + OldParent: TWinControl; + OldTabOrder: integer; + OldName: string; + + Obj, NewObj: TPersistent; + + OldAct: boolean; + OldMemoValue: string; + +begin + Result := NewClass <> nil; + if not Result then + Exit; + +{$IFDEF CLR} + if NewClass.ClassName = 'TCRDBGrid' then begin + Result := False; + Exit; + end; +{$ENDIF} + + NewControl := NewClass.Create(Control.Owner); + + OldParent := Control.Parent; + OldTabOrder := Control.TabOrder; + OldName := Control.Name; + + if (Control is TMemo) and (NewControl is TMemo) then + OldMemoValue := TMemo(Control).Lines.Text + else + OldMemoValue := ''; + + OldAct := (Control.Owner <> nil) + and (Control.Owner is TCustomForm) + and (TCustomForm(Control.Owner).ActiveControl = Control); + + Control.Parent := OldParent; + +{$IFDEF CLR} + PropList := GetPropList(NewClass.ClassInfo, tkAny, False); + PropCount := Length(PropList); +{$ELSE} + PropCount := GetPropList(NewClass.ClassInfo, tkAny, nil{$IFDEF VER6P}, False {$ENDIF}); + GetMem(PropList, PropCount * sizeof(PropList[0])); + try + GetPropList(NewClass.ClassInfo, tkAny, PropList{$IFDEF VER6P}, False {$ENDIF}); +{$ENDIF} + for i := 0 to PropCount - 1 do begin + PropInfo := GetPropInfo(Control, PropList[i].Name); + if (PropInfo <> nil) // published property + and (PropList[i].Name <> 'Name') + and (IsStoredProp(Control, PropInfo)) then + case PropList[i].PropType{$IFNDEF CLR}^{$ENDIF}.Kind of + tkClass: + begin + {$IFDEF CLR} + Obj := GetObjectProp(Control, PropInfo) as TPersistent; + {$ELSE} + Obj := TPersistent(integer(GetPropValue(Control, PropList[i].Name))); + {$ENDIF} + + if (Obj <> nil) and (Obj.ClassName <> 'TMemoStrings'{$IFDEF CLR}{$IFDEF VER9P} + '$StdCtrls'{$ENDIF}{$ENDIF}) then begin + Assert(Obj is TPersistent); + {$IFDEF CLR} + NewObj := GetObjectProp(NewControl, PropList[i].Name) as TPersistent; + {$ELSE} + NewObj := TPersistent(integer(GetPropValue(NewControl, PropList[i].Name))); + {$ENDIF} + if NewObj = nil then begin + NewObj := Obj; + SetObjectProp(Control, PropInfo, nil); + //SetOrdProp(Control, PropList[i], integer(nil)); + end + else + begin + Assert(NewObj is TPersistent); + {$IFDEF VER10} + if NewObj is TMargins then Continue; + {$ENDIF} + NewObj.Assign(Obj); + end; + {$IFDEF CLR} + PropInfo := GetPropInfo(NewControl, PropList[i].Name); + {$ENDIF} + SetObjectProp(NewControl, PropInfo, NewObj); + //SetOrdProp(NewControl, PropList[i], integer(NewObj)); + end; + end; + tkMethod: + SetMethodProp(NewControl, PropList[i], GetMethodProp(Control, PropList[i])); + else + SetPropValue(NewControl, PropList[i].Name, GetPropValue(Control, PropList[i].Name)); + end; + end; + +{$IFNDEF CLR} + finally + FreeMem(PropList); + end; +{$ENDIF} + + Control.Free; + Control := NewControl; + Control.Name := OldName; + Control.Parent := OldParent; + Control.TabOrder := OldTabOrder; + + if Control is TMemo then + TMemo(Control).Lines.Text := OldMemoValue; + + if OldAct then + TCustomForm(Control.Owner).ActiveControl := Control; +end; + +function ReplaceGridToCRGrid(var DBGrid: TCustomDBGrid): boolean; +var + wc: TWinControl; + NewClass: TWinControlClass; +begin + wc := TWinControl(DBGrid); + NewClass := TWinControlClass(GetClass('TCRDBGrid')); + Result := ReplaceControl(wc, NewClass); + if Result then + DBGrid := wc as TCustomDBGrid; +end; + +function GetMemoText(Memo: TWinControl): string; +begin +{$IFDEF DBTOOLS} + if DBTools.HasDACSqlEditorFrame(Memo) then + Result := DBTools.GetDACSqlEditorFrame(Memo).Text + else +{$ENDIF} + if Memo is TMemo then + Result := TMemo(Memo).Lines.Text + else + if Memo.ClassName = sSynMemo then + Result := TStrings(GetObjectProp(Memo, 'Lines')).Text + else + begin + Result := ''; + Assert(False, Memo.ClassName); + end; +end; + +procedure SetMemoText(Memo: TWinControl; Value: string); +begin +{$IFDEF DBTOOLS} + if DBTools.HasDACSqlEditorFrame(Memo) then + DBTools.GetDACSqlEditorFrame(Memo).Text := Value + else +{$ENDIF} + if Memo is TMemo then + TMemo(Memo).Lines.Text := Value + else + if Memo.ClassName = sSynMemo then + TStrings(GetObjectProp(Memo, 'Lines')).Text := Value + else + Assert(False, Memo.ClassName); +end; + +function GetReadOnly(Memo: TWinControl): boolean; +begin +{$IFDEF DBTOOLS} + if DBTools.HasDACSqlEditorFrame(Memo) then + Result := DBTools.GetDACSqlEditorFrame(Memo).ReadOnly + else +{$ENDIF} + if Memo is TMemo then + Result := TMemo(Memo).ReadOnly + else + if Memo.ClassName = sSynMemo then + Result := Boolean(GetOrdProp(Memo, 'ReadOnly')) + else + begin + Result := False; + Assert(False, Memo.ClassName); + end; +end; + +procedure SetReadOnly(Memo: TWinControl; Value: boolean); +begin +{$IFDEF DBTOOLS} + if DBTools.HasDACSqlEditorFrame(Memo) then + DBTools.GetDACSqlEditorFrame(Memo).ReadOnly := Value + else +{$ENDIF} + if Memo is TMemo then + TMemo(Memo).ReadOnly := Value + else + if Memo.ClassName = sSynMemo then + SetOrdProp(Memo, 'ReadOnly', Longint(Value)); +end; + +function GetSelStart(Memo: TWinControl): integer; +begin +{$IFDEF DBTOOLS} + if DBTools.HasDACSqlEditorFrame(Memo) then + Result := 0 + else +{$ENDIF} + if Memo is TMemo then + Result := TMemo(Memo).SelStart + else + {$IFDEF USE_SYNEDIT} + if Memo.ClassName = sSynMemo then + SendMessage(Memo.Handle, EM_GETSEL, Integer(@Result), 0) + else + {$ENDIF} + begin + Result := -1; + Assert(False, Memo.ClassName); + end; +end; + +procedure SetSelStart(Memo: TWinControl; Value: integer); +begin +{$IFDEF DBTOOLS} + if DBTools.HasDACSqlEditorFrame(Memo) then begin + + end + else +{$ENDIF} + if Memo is TMemo then + TMemo(Memo).SelStart := Value + else + {$IFDEF USE_SYNEDIT} + if Memo.ClassName = sSynMemo then + SendMessage(Memo.Handle, EM_SETSEL, Value, Value) + else + {$ENDIF} + Assert(False, Memo.ClassName); +end; + +procedure SetSelLength(Memo: TWinControl; Value: integer); +begin +{$IFDEF DBTOOLS} + if DBTools.HasDACSqlEditorFrame(Memo) then begin + + end + else +{$ENDIF} + if Memo is TMemo then + TMemo(Memo).SelLength := Value + else + {$IFDEF USE_SYNEDIT} + if Memo.ClassName = sSynMemo then + SetOrdProp(Memo, 'SelLength', Value) + else + {$ENDIF} + Assert(False, Memo.ClassName); +end; + +procedure LoadFromFile(Memo: TWinControl; FileName: string); +var + SL: TStrings; +{$IFDEF DBTOOLS} + UseDBTools: boolean; +{$ENDIF} +begin + SL := nil; +{$IFDEF DBTOOLS} + if not DBTools.HasDACSqlEditorFrame(Memo) then +{$ENDIF} + if Memo is TMemo then + SL := TMemo(Memo).Lines + else + {$IFDEF USE_SYNEDIT} + if Memo.ClassName = sSynMemo then + SL := TStrings(GetObjectProp(Memo, 'Lines')) + else + {$ENDIF} + Assert(False, Memo.ClassName); + +{$IFDEF DBTOOLS} + UseDBTools := SL = nil; + if UseDBTools then + SL := TSTringList.Create; + try +{$ENDIF} + SL.LoadFromFile(FileName); +{$IFDEF DBTOOLS} + if UseDBTools then + DBTools.GetDACSqlEditorFrame(Memo).Text := SL.Text + finally + if UseDBTools then + SL.Free; + end; +{$ENDIF} +end; + +procedure SaveToFile(Memo: TWinControl; FileName: string); +var + SL: TStrings; +{$IFDEF DBTOOLS} + UseDBTools: boolean; +{$ENDIF} +begin + SL := nil; +{$IFDEF DBTOOLS} + if not DBTools.HasDACSqlEditorFrame(Memo) then +{$ENDIF} + if Memo is TMemo then + SL := TMemo(Memo).Lines + else + {$IFDEF USE_SYNEDIT} + if Memo.ClassName = sSynMemo then + SL := TStrings(GetObjectProp(Memo, 'Lines')) + else + {$ENDIF} + Assert(False, Memo.ClassName); + +{$IFDEF DBTOOLS} + UseDBTools := SL = nil; + if UseDBTools then begin + SL := TSTringList.Create; + SL.Text := DBTools.GetDACSqlEditorFrame(Memo).Text + end; + try +{$ENDIF} + SL.SaveToFile(FileName); +{$IFDEF DBTOOLS} + finally + if UseDBTools then + SL.Free; + end; +{$ENDIF} +end; + +{ TDAMemo } + +procedure TDAMemo.KeyDown(var Key: Word; Shift: TShiftState); +begin + inherited; + + if Shift = [ssCtrl] then begin + if Key = 65 then + SelectAll + else + if (Key = {$IFNDEF LINUX}VK_BACK{$ELSE}Key_Backspace{$ENDIF}) then + BackSpacePressed := True; + end; +end; + +procedure TDAMemo.KeyPress(var Key: Char); +var + StartI, EndI: integer; + Text: string; +begin + inherited; + + if BackSpacePressed then begin + BackSpacePressed := False; + Text := Lines.Text; + StartI := SelStart; + EndI := SelStart; + while (StartI > 0) and (Text[StartI] <= ' ') do + Dec(StartI); + while (StartI > 0) and (Text[StartI] > ' ') do + Dec(StartI); + if EndI > StartI then begin + SelStart := StartI; + SelLength := EndI - StartI; + SelText := ''; + end; + Key := #0; + end; +end; + +{ TCREditorForm } + +constructor TCREditorForm.Create(Owner: TComponent; DADesignUtilsClass: TDADesignUtilsClass); +begin + inherited Create(Owner); + FDADesignUtilsClass := DADesignUtilsClass; + FolderName := ClassName; + ConfirmCancel := True; +end; + +{$IFDEF USE_SYNEDIT} +procedure TCREditorForm.SynMenuPopup(Sender: TObject); +var + n, m: DWORD; + Memo: TWinControl; + HasSelection: boolean; +begin + with TPopupMenu(Sender) do begin + Memo := TSynMenuItem(Items[0]).Memo; + SendMessage(Memo.Handle, EM_GETSEL, Integer(@n), Integer(@m)); + HasSelection := n < m; + Items[0].Enabled := // Undo + SendMessage(Memo.Handle, EM_CANUNDO, 0, 0) <> 0; + Items[2].Enabled := // Cut + HasSelection; + Items[3].Enabled := // Copy + HasSelection; + Items[4].Enabled := // Paste + IsClipboardFormatAvailable(CF_TEXT); + Items[5].Enabled := // Delete + HasSelection; + Items[7].Enabled := // Select All + GetMemoText(Memo) <> ''; + end; +end; + +procedure TCREditorForm.SynMenuItemClick(Sender: TObject); +begin + with TSynMenuItem(Sender) do begin + case Tag of + 0: // Undo + SendMessage(Memo.Handle, EM_UNDO, 0, 0); + 2:// Cut + SendMessage(Memo.Handle, WM_CUT, 0, 0); + 3:// Copy + SendMessage(Memo.Handle, WM_COPY, 0, 0); + 4:// Paste + SendMessage(Memo.Handle, WM_PASTE, 0, 0); + 5:// Delete + SendMessage(Memo.Handle, WM_CLEAR, 0, 0); + 7:// Select All + SendMessage(Memo.Handle, EM_SETSEL, 0, Length(GetMemoText(Memo))); + end; + end; +end; + +procedure TCREditorForm.ReplaceMemo(var Memo: TWinControl; DrawGutter: boolean); +type + TSetProc = procedure (Self: TObject; Ptr: pointer); +const + NilMethod: TMethod = + (Code: nil; Data: nil); +var + MemoClass: string; + NewMemo: TCustomControl; + OldName: string; + TypeInfo: PTypeInfo; +// Ptr:pointer; +// i: integer; + Gutter: TObject; + i: integer; + Menu: TPopupMenu; + MenuItem: TSynMenuItem; +begin + if FUseSynEdit and (GetClass(sSynMemo) <> nil) and (FSynSQLSyn <> nil) then begin + MemoClass := sSynMemo; + + NewMemo := TCustomControl(GetClass(MemoClass).NewInstance); + NewMemo.Create(Memo.Owner); + + with NewMemo do begin + Parent := Memo.Parent; + Left := Memo.Left; + Top := Memo.Top; + Width := Memo.Width; + Height := Memo.Height; + Align := Memo.Align; + TabOrder := Memo.TabOrder; + Anchors := Memo.Anchors; + //Constraints := Memo.Constraints; + TypeInfo := GetClass(MemoClass).ClassInfo; + HelpContext := Memo.HelpContext; + if Memo is TMemo then begin + SetReadOnly(NewMemo, TMemo(Memo).ReadOnly); + if MemoClass = sSynMemo then + SetOrdProp(NewMemo, 'Color', Longint(TMemo(Memo).Color)); + end; + + if GetPropInfo(Memo.ClassInfo, 'OnChange') <> nil then + SetMethodProp(NewMemo, GetPropInfo(TypeInfo, 'OnChange'), + GetMethodProp(Memo, GetPropInfo(Memo.ClassInfo, 'OnChange'))); + SetMethodProp(NewMemo, GetPropInfo(TypeInfo, 'OnExit'), + GetMethodProp(Memo, GetPropInfo(Memo.ClassInfo, 'OnExit'))); + SetMethodProp(NewMemo, GetPropInfo(TypeInfo, 'OnKeyDown'), + GetMethodProp(Memo, GetPropInfo(Memo.ClassInfo, 'OnKeyDown'))); + SetMethodProp(NewMemo, GetPropInfo(TypeInfo, 'OnKeyPress'), + GetMethodProp(Memo, GetPropInfo(Memo.ClassInfo, 'OnKeyPress'))); + end; + + if (Memo.Owner <> nil) and (TForm(Memo.Owner).ActiveControl = Memo) then begin + SetMethodProp(Memo, GetPropInfo(TypeInfo, 'OnExit'), NilMethod); + TForm(Memo.Owner).ActiveControl := NewMemo; + end; + + OldName := Memo.Name; + Memo.Free; + Memo := TMemo(NewMemo); + NewMemo.Name := OldName; + + if MemoClass = sSynMemo then begin + SetObjectProp(NewMemo, 'Highlighter', FSynSQLSyn); + SetOrdProp(NewMemo, 'Options', $3680DBF); // [eoAltSetsColumnMode, eoAutoIndent, eoAutoSizeMaxScrollWidth, eoDisableScrollArrows, eoDragDropEditing, eoDropFiles, eoEnhanceEndKey, eoGroupUndo, eoHideShowScrollbars, eoKeepCaretX, eoShowScrollHint, eoSmartTabDelete, eoSmartTabs, eoTabIndent, eoTabsToSpaces] + Gutter := GetObjectProp(NewMemo, 'Gutter'); + Assert(Gutter <> nil); + if DrawGutter then begin + SetOrdProp(Gutter, 'Visible', Longint(True)); + + SetOrdProp(Gutter, 'AutoSize', Longint(True)); + SetOrdProp(Gutter, 'DigitCount', 2); + SetOrdProp(Gutter, 'LeftOffset', 0); + SetOrdProp(Gutter, 'RightOffset', 0); + SetOrdProp(Gutter, 'ShowLineNumbers', Longint(True)); + SetOrdProp(Gutter, 'Width', 1); + end + else + SetOrdProp(Gutter, 'Visible', Longint(False)); + + Menu := TPopupMenu.Create(Self); + Menu.OnPopup := SynMenuPopup; + for i := 0 to High(SynMenuItemNames) do begin + MenuItem := TSynMenuItem.Create(Self); + MenuItem.Memo := Memo; + MenuItem.Caption := SynMenuItemNames[i]; + MenuItem.Tag := i; + MenuItem.OnClick := SynMenuItemClick; + Menu.Items.Add(MenuItem); + end; + SetObjectProp(Memo, 'PopupMenu', Menu); + end; + end; +end; +{$ENDIF} + +procedure TCREditorForm.ReplaceMemos; +var + i: integer; + MemoArr: array of TWinControl; + + procedure ProcessComponent(Component: TComponent); + var + i: integer; + SubComponent: TComponent; + begin + for i := 0 to Component.ComponentCount - 1 do begin + SubComponent := Component.Components[i]; + if SubComponent.ClassType = TMemo then begin + SetLength(MemoArr, Length(MemoArr) + 1); + MemoArr[Length(MemoArr) - 1] := TMemo(SubComponent); + end + else + if SubComponent is TFrame then + ProcessComponent(SubComponent); + end; + end; + +begin +{$IFDEF USE_SYNEDIT} + if not (FUseSynEdit or FDADesignUtilsClass.DBToolsAvailable) then +{$ENDIF} + begin + ProcessComponent(Self); + for i := 0 to Length(MemoArr) - 1 do + ReplaceControl(MemoArr[i], TDAMemo) + end; +end; + +procedure TCREditorForm.DoInit; +{$IFDEF LINUX} + procedure ProcessCombos(Component: TComponent); + var + i: integer; + begin + // K2 Only??? + for i := 0 to Component.ComponentCount - 1 do + if (Component.Components[i] is TComboBox) + and (TComboBox(Component.Components[i]).Items.Count = 0) + and Assigned(TComboBox(Component.Components[i]).OnDropDown) then + TComboBox(Component.Components[i]).Items.Add(''); + end; + +var + i: integer; +{$ENDIF} +begin + Modified := False; + + if (Component = nil) and (Self is TDAParamValueEditor) then + Exit; + Assert(Component <> nil, ClassName); + if Component.Owner <> nil then + Caption := Component.Owner.Name + '.' + Component.Name + else + Caption := Component.Name; + + ReplaceMemos; +{$IFDEF LINUX} + ProcessCombos(Self); + for i := 0 to ComponentCount - 1 do + if Components[i] is TCustomFrame then + ProcessCombos(Components[i]); + + // Events order on Windows: OnCloseQuery, OnClose + // Events order on Kylix: OnClose, OnCloseQuery + OnCloseQuery := nil; +{$ENDIF} +end; + +procedure TCREditorForm.DoActivate; +begin +end; + +procedure TCREditorForm.DoSave; +begin + SaveControlData; +end; + +procedure TCREditorForm.DoFinish; +begin +end; + +procedure TCREditorForm.ExitActiveControl; +var + C: {$IFNDEF LINUX}TWinControl{$ELSE}TWidgetControl{$ENDIF}; +begin + C := ActiveControl; + if (C is TComboBox) then + (C as TComboBox).DroppedDown := False; + ActiveControl := nil; + if ActiveControl <> nil then + SysUtils.Abort; // Error on, for example, OnFrameExit + // SysUtils prefix is needed to compile in Kylix + + while (C <> nil) and (not C.Visible or not C.Enabled) do // "Cannot focus disabled or invisible window" bug. See TCRGridTitleEdit.DoFinish code + C := C.Parent; + + ActiveControl := C; +end; + +procedure TCREditorForm.SaveControlData; +begin + ExitActiveControl; +end; + +{$IFDEF MSWINDOWS} + +function TCREditorForm.SaveState: boolean; +var + Registry: TRegistry; +begin + if (BorderStyle <> bsDialog) or (FOldPosition <> poScreenCenter) + then begin + Registry := TRegistry.Create; + try + with Registry do begin + OpenKey(KeyPath + '\' + FolderName, True); + if BorderStyle in [bsSizeable, bsSizeToolWin] then begin + WriteBool('Maximized', WindowState = wsMaximized); + WriteBool('Minimized', WindowState = wsMinimized); + if WindowState = wsNormal then begin + WriteInteger('Width', Width); + WriteInteger('Height', Height); + end; + end; + if (FOldPosition <> poScreenCenter) and (WindowState = wsNormal) then begin + WriteInteger('Left', Left); + WriteInteger('Top', Top); + end; + {if not Modal then + SetBool('Visible', Visible);} + Result := True; + end + finally + Registry.Free; + end + end + else + Result := False; +end; + +function TCREditorForm.LoadState: boolean; +var + Registry: TRegistry; +begin + Registry := TRegistry.Create; + try + with Registry do begin + if OpenKey(KeyPath + '\' + FolderName, False) then begin + if Position <> poScreenCenter then begin + if ValueExists('Left') then + Left := ReadInteger('Left'); + if ValueExists('Top') then + Top := ReadInteger('Top'); + end; + if BorderStyle in [bsSizeable, bsSizeToolWin] then begin + if ValueExists('Width') then + Width := ReadInteger('Width'); + if ValueExists('Height') then + Height := ReadInteger('Height'); + + if ValueExists('Maximized') and ReadBool('Maximized') then + WindowState := wsMaximized + else + {if ValueExists('Minimized') and ReadBool('Minimized') then + WindowState := wsMinimized + else} + WindowState := wsNormal; + end; + if ValueExists('Visible') and ReadBool('Visible') then begin + Show; + Update; + end; + Result := True; + end + else + begin + Left := (Screen.Width - Width) div 2; + Top := (Screen.Height - Height) div 2; + Result := False; + end; + + {$IFDEF USE_SYNEDIT} + if OpenKey(KeyPath, False) and ValueExists('UseSynEdit') then + FUseSynEdit := ReadBool('UseSynEdit') + else + FUseSynEdit := True; + FUseSynEdit := FUseSynEdit and (GetClass(sSynSQLSyn) <> nil) and (GetClass(sSynMemo) <> nil); + {$ENDIF} + end; + finally + Registry.Free; + end; + FOldPosition := Position; +end; + +function TCREditorForm.KeyPath: string; +begin + Result := '\SOFTWARE\CoreLab\' + FDADesignUtilsClass.GetProjectName + '\Editors'; +end; + +{$ENDIF} + +{$IFDEF DBTOOLS} +procedure TCREditorForm.ActiveChanged; +begin + inherited; + + if ActiveControl is TDACSqlEditorFrame then + ActiveControl.SetFocus; +end; +{$ENDIF} + +{$IFDEF LINUX} + +function TCREditorForm.SaveState: boolean; +begin + Result := True; +end; + +function TCREditorForm.LoadState: boolean; +begin + Result := True; +end; +{$ENDIF} + +function TCREditorForm.GetComponent: TComponent; +begin + Assert(False, 'Must be overriden'); + Result := nil; +end; + +procedure TCREditorForm.SetComponent(Value: TComponent); +begin + Assert(False, 'Must be overriden'); +end; + +function TCREditorForm.GetLocalComponent: TComponent; +begin + Assert(False, 'Must be overriden'); + Result := nil; +end; + +procedure TCREditorForm.FormShow(Sender: TObject); +{$IFDEF USE_SYNEDIT} +var + NewSHClass: TPersistentClass; +{$ENDIF} +begin +{$IFDEF DBTOOLS} +{$IFDEF CLR} + OldMessageProcessing := Application.OnMessage; + Application.OnMessage := MessageProcessing; +{$ENDIF} +{$ENDIF} + + LoadState; +{$IFDEF USE_SYNEDIT} + NewSHClass := GetClass(sSynSQLSyn); + if FUseSynEdit and (NewSHClass <> nil) then begin + FSynSQLSyn := TComponentClass(NewSHClass).Create(Self); + SetOrdProp(FSynSQLSyn, 'SQLDialect', FDADesignUtilsClass.SQLDialect); + end; +{$ENDIF} + +{$IFDEF LINUX} + DoInit; +{$ELSE} + try + DoInit; + except + on E: EAbort do begin + PostMessage(Handle, WM_CLOSE, 0, 0); + end; + end; +{$ENDIF} + DoActivate; +end; + +procedure TCREditorForm.FormHide(Sender: TObject); +{$IFDEF LINUX} +var + CanClose: Boolean; // Skipped by Kylix bug +{$ENDIF} +begin +{$IFDEF LINUX} + FormCloseQuery(Sender, CanClose); +{$ENDIF} + + DoFinish; + SaveState; +{$IFDEF USE_SYNEDIT} + FSynSQLSyn.Free; +{$ENDIF} +end; + +procedure TCREditorForm.SaveClick(Sender: TObject); +begin + DoSave; + + Modified := False; + + ModalResult := mrOk; +end; + +procedure TCREditorForm.CloseClick(Sender: TObject); +begin + ModalResult := mrCancel +end; + +procedure TCREditorForm.FormCloseQuery(Sender: TObject; + var CanClose: Boolean); +{$IFDEF MSWINDOWS} +const + ResYes = IDYES; + ResNo = IDNO; +var + Res: integer; +{$ELSE} +const + ResYes = smbYes; + ResNo = smbNo; +var + Res: TMessageButton; +{$ENDIF} + OldActiveControl: TWinControl; +begin +{$IFDEF DBTOOLS} + DBTools.CheckDBToolsChanges(Self); +{$ENDIF} + OldActiveControl := ActiveControl; + try + ExitActiveControl; + except + // Silent. User can enter wrong data + end; + if (OldActiveControl <> nil) and OldActiveControl.Visible and OldActiveControl.Enabled then + ActiveControl := OldActiveControl; + + if Modified then begin + if ConfirmCancel then + {$IFDEF MSWINDOWS} + Res := Application.MessageBox('Save changes to component?', 'Confirm', + MB_YESNOCANCEL or MB_ICONQUESTION) + {$ELSE} + Res := Application.MessageBox('Save changes to component?', 'Confirm', + [smbYes, smbNo], smsWarning) + {$ENDIF} + else + Res := ResNo; + + if Res = ResYes then begin + {$IFDEF MSWINDOWS} + ModalResult := mrOk; + {$ENDIF} + DoSave; + Modified := False; + CanClose := True; + end + else + if Res = ResNo then begin + CanClose := True; + {$IFDEF MSWINDOWS} + ModalResult := mrCancel; + {$ENDIF} + end + else + CanClose := False; + end + else + CanClose := True; +end; + +procedure TCREditorForm.SetConfirmCancel(const Value: boolean); +begin + FConfirmCancel := Value; +end; + +procedure TCREditorForm.FormKeyPress(Sender: TObject; var Key: Char); +begin + if Key = #27 then begin + Close; + Key := #0; + end; +end; + +function TCREditorForm.GetModified: boolean; +begin + Result := FModified; +end; + +procedure TCREditorForm.SetModified(Value: boolean); +begin + FModified := Value; +end; + +{$IFDEF DBTOOLS} +{$IFDEF CLR} +destructor TCREditorForm.Destroy; +begin + if Assigned(OldMessageProcessing) then + Application.OnMessage := OldMessageProcessing; + + inherited; +end; + +procedure TCREditorForm.MessageProcessing(var Msg: TMsg; var Handled: Boolean); +var + Wnd: HWND; + ParentHwnd: HWND; + IsDbToolsCtrl: boolean; + ClassName: StringBuilder; + + function IsDbToolsShortCut(Key: word): boolean; + var + Shift: word; + begin + Result := False; + if Key and $FF00 = 0 then begin + if GetKeyState(VK_CONTROL) < 0 then + Shift := scCtrl + else + Shift := 0; + if GetKeyState(VK_MENU) < 0 then + Inc(Shift, scAlt); //VK_SHIFT is of no importance + + if ((Key = VK_F4) and (Shift = scAlt)) //Alt+F4 + or ((Key = VK_ESCAPE) and (Shift = 0)) //ESC + or ((Key >= Ord('a')) and (Key <= Ord('z')) and (Shift = scAlt)) //Alt+a..z + or ((Key = VK_TAB) and ((Shift = scCtrl) or (Shift = 0))) then //[Ctrl+]Tab + Exit; + end; + Result := True; + end; + +begin +//This procedure transports messages to managed non VCL DbToolsControls + Handled := False; + if (Msg.Message >= WM_KEYFIRST) and (Msg.Message <= WM_KEYLAST) then + with Msg do begin + IsDbToolsCtrl := False; + Wnd := HWnd; + if (FindControl(Wnd) = nil) and (Wnd <> 0) then begin + //Check that Wnd is our managed control handle + ParentHwnd := GetParent(Wnd); + ClassName := StringBuilder.Create; + ClassName.Capacity := 1024; + while (not IsDbToolsCtrl) and (ParentHwnd <> 0) do begin + GetClassName(ParentHwnd, ClassName, 1024); + IsDbToolsCtrl := Pos('TDACSqlEditorFrame', ClassName.ToString) <> 0; + ParentHwnd := GetParent(ParentHwnd); + end; + ClassName.Free; + if IsDbToolsCtrl and IsDbToolsShortCut(Msg.WParam) then begin + TranslateMessage(Msg); + Handled := DispatchMessage(Msg) = 0; + Exit; + end; + end; + end; + + if (@OldMessageProcessing <> nil) then + OldMessageProcessing(Msg, Handled); +end; +{$ENDIF} + +procedure TCREditorForm.WMActivate(var Message: TWMActivate); +var + Control: TWinControl; +begin + if Message.Active = WA_INACTIVE then begin + Control := DbTools.GetActiveDACSqlEditorFrame; + if Control <> nil then + ActiveControl := Control; + end; + + inherited; +end; + +{$ENDIF} + +procedure TCREditorForm.CheckConnection(const Component: TComponent); +var + Connection: TCustomDAConnection; +begin + if Component is TCustomDAConnection then + Connection := TCustomDAConnection(Component) + else begin + Connection := FDADesignUtilsClass.UsedConnection(Component); + if Connection = nil then + DatabaseError(SConnectionNotDefined); + end; + if not Connection.Connected then begin + Connection.Connect; + {$IFDEF DBTOOLS} + DBTools.CheckConnectionChanges; + {$ENDIF} + end; +end; + +end. diff --git a/internal/4.10.0.10/1/Source/Design/CREditor.xfm b/internal/4.10.0.10/1/Source/Design/CREditor.xfm new file mode 100644 index 0000000..b9237b1 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/CREditor.xfm @@ -0,0 +1,83 @@ +object CREditorForm: TCREditorForm + Left = 301 + Top = 180 + Width = 513 + Height = 75 + Caption = 'CREditorForm' + Color = clButton + Font.Color = clText + Font.Height = 13 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [] + KeyPreview = True + ParentFont = False + Position = poDefaultPosOnly + Scaled = False + OnCloseQuery = FormCloseQuery + OnHide = FormHide + OnKeyPress = FormKeyPress + OnShow = FormShow + PixelsPerInch = 75 + object BtnPanel: TPanel + Left = 0 + Top = 34 + Width = 513 + Height = 41 + Align = alBottom + BevelOuter = bvNone + TabOrder = 0 + object imCorner: TImage + Left = 501 + Top = 29 + Width = 12 + Height = 12 + Anchors = [akRight, akBottom] + Picture.Data = { + 07544269746D6170DA000000424DD60000000000000076000000280000000C00 + 00000C0000000100040000000000600000000000000000000000100000001000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF008778F778F77800008F778F778F77000088F778F778F70000888F778F778F + 00008888F778F778000088888F778F770000888888F778F700008888888F778F + 000088888888F7780000888888888F7700008888888888F70000888888888888 + 0000} + Transparent = True + end + object btOk: TBitBtn + Left = 341 + Top = 8 + Width = 75 + Height = 25 + Anchors = [akRight, akBottom] + Caption = 'OK' + Default = True + Font.Color = clText + Font.Height = 11 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [] + ParentFont = False + TabOrder = 0 + OnClick = SaveClick + end + object btCancel: TBitBtn + Left = 422 + Top = 8 + Width = 75 + Height = 25 + Anchors = [akRight, akBottom] + Cancel = True + Caption = 'Cancel' + Font.Color = clText + Font.Height = 11 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [] + ParentFont = False + TabOrder = 1 + OnClick = CloseClick + NumGlyphs = 2 + end + end +end diff --git a/internal/4.10.0.10/1/Source/Design/CRFldLinks.dfm b/internal/4.10.0.10/1/Source/Design/CRFldLinks.dfm new file mode 100644 index 0000000..743bf75 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/CRFldLinks.dfm @@ -0,0 +1,166 @@ +object CRLinkFields: TCRLinkFields + Left = 235 + Top = 123 + ActiveControl = IndexList + BorderStyle = bsDialog + Caption = 'Field Link Designer' + ClientHeight = 265 + ClientWidth = 352 + Color = clBtnFace + ParentFont = True + OldCreateOrder = True + OnCreate = FormCreate + OnDestroy = FormDestroy + PixelsPerInch = 96 + TextHeight = 13 + object Bevel1: TBevel + Left = 4 + Top = 33 + Width = 343 + Height = 190 + Shape = bsFrame + end + object Bevel2: TBevel + Left = 350 + Top = 285 + Width = 341 + Height = 43 + Shape = bsFrame + end + object Label30: TLabel + Left = 13 + Top = 40 + Width = 57 + Height = 13 + Caption = 'D&etail Fields' + FocusControl = DetailList + IsControl = True + end + object Label31: TLabel + Left = 222 + Top = 38 + Width = 62 + Height = 13 + Caption = '&Master Fields' + FocusControl = MasterList + IsControl = True + end + object IndexLabel: TLabel + Left = 4 + Top = 10 + Width = 83 + Height = 13 + Caption = 'A&vailable Indexes' + FocusControl = IndexList + end + object Label2: TLabel + Left = 12 + Top = 142 + Width = 61 + Height = 13 + Caption = '&Joined Fields' + FocusControl = BindList + end + object DetailList: TListBox + Left = 13 + Top = 55 + Width = 117 + Height = 69 + IntegralHeight = True + ItemHeight = 13 + TabOrder = 1 + OnClick = BindingListClick + IsControl = True + end + object MasterList: TListBox + Left = 222 + Top = 54 + Width = 117 + Height = 69 + IntegralHeight = True + ItemHeight = 13 + TabOrder = 2 + OnClick = BindingListClick + IsControl = True + end + object BindList: TListBox + Left = 12 + Top = 157 + Width = 242 + Height = 56 + IntegralHeight = True + ItemHeight = 13 + MultiSelect = True + TabOrder = 3 + OnClick = BindListClick + IsControl = True + end + object IndexList: TComboBox + Left = 109 + Top = 7 + Width = 192 + Height = 21 + Style = csDropDownList + ItemHeight = 13 + TabOrder = 0 + OnChange = IndexListChange + OnClick = IndexListChange + end + object AddButton: TButton + Left = 138 + Top = 74 + Width = 75 + Height = 25 + Caption = '&Add' + TabOrder = 4 + OnClick = AddButtonClick + end + object DeleteButton: TButton + Left = 263 + Top = 157 + Width = 75 + Height = 25 + Caption = '&Delete' + TabOrder = 5 + OnClick = DeleteButtonClick + end + object ClearButton: TButton + Left = 263 + Top = 188 + Width = 75 + Height = 25 + Caption = '&Clear' + TabOrder = 6 + OnClick = ClearButtonClick + end + object Button1: TButton + Left = 100 + Top = 231 + Width = 75 + Height = 25 + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 7 + OnClick = BitBtn1Click + end + object Button2: TButton + Left = 186 + Top = 231 + Width = 75 + Height = 25 + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 8 + end + object Help: TButton + Left = 272 + Top = 231 + Width = 75 + Height = 25 + Caption = '&Help' + TabOrder = 9 + OnClick = HelpClick + end +end diff --git a/internal/4.10.0.10/1/Source/Design/CRFldLinks.pas b/internal/4.10.0.10/1/Source/Design/CRFldLinks.pas new file mode 100644 index 0000000..93d7f56 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/CRFldLinks.pas @@ -0,0 +1,543 @@ + +////////////////////////////////////////////////// +// DB Access Components +// Copyright @ 1998-2007 Core Lab. All right reserved. +// CRFldLinks +////////////////////////////////////////////////// + +{$I Dac.inc} + +unit CRFldLinks; + +interface + +uses +{$IFDEF LINUX} + QStdCtrls, QControls, QExtCtrls, QForms, +{$ELSE} + StdCtrls, Controls, ExtCtrls, Forms, +{$ENDIF} + {$IFDEF VER6P}DesignIntf, DesignEditors,{$ELSE}DsgnIntf,{$ENDIF} + SysUtils, Classes, DB, Buttons, Windows; + +type + +{ TCRFieldLinkProperty } + + TCRFieldLinkProperty = class(TStringProperty) + private + FChanged: Boolean; + FDataSet: TDataSet; + protected + function GetDataSet: TDataSet; + procedure GetFieldNamesForIndex(List: TStrings); virtual; + function GetIndexBased: Boolean; virtual; + function GetIndexDefs: TIndexDefs; virtual; + function GetIndexFieldNames: string; virtual; + function GetIndexName: string; virtual; + function GetMasterFields: string; virtual; abstract; + procedure SetIndexFieldNames(const Value: string); virtual; + procedure SetIndexName(const Value: string); virtual; + procedure SetMasterFields(const Value: string); virtual; abstract; + public + constructor CreateWith(ADataSet: TDataSet); virtual; + procedure GetIndexNames(List: TStrings); + property IndexBased: Boolean read GetIndexBased; + property IndexDefs: TIndexDefs read GetIndexDefs; + property IndexFieldNames: string read GetIndexFieldNames write SetIndexFieldNames; + property IndexName: string read GetIndexName write SetIndexName; + property MasterFields: string read GetMasterFields write SetMasterFields; + property Changed: Boolean read FChanged; + procedure Edit; override; + function GetAttributes: TPropertyAttributes; override; + property DataSet: TDataSet read GetDataSet; + end; + +{ TCRLinkFields } + + TCRLinkFields = class(TForm) + DetailList: TListBox; + MasterList: TListBox; + BindList: TListBox; + Label30: TLabel; + Label31: TLabel; + IndexList: TComboBox; + IndexLabel: TLabel; + Label2: TLabel; + Bevel1: TBevel; + Bevel2: TBevel; + AddButton: TButton; + DeleteButton: TButton; + ClearButton: TButton; + Button1: TButton; + Button2: TButton; + Help: TButton; + procedure FormCreate(Sender: TObject); + procedure BindingListClick(Sender: TObject); + procedure AddButtonClick(Sender: TObject); + procedure DeleteButtonClick(Sender: TObject); + procedure BindListClick(Sender: TObject); + procedure ClearButtonClick(Sender: TObject); + procedure FormDestroy(Sender: TObject); + procedure BitBtn1Click(Sender: TObject); + procedure HelpClick(Sender: TObject); + procedure IndexListChange(Sender: TObject); + private + FDataSet: TDataSet; + FMasterDataSet: TDataSet; + FDataSetProxy: TCRFieldLinkProperty; + FFullIndexName: string; + MasterFieldList: string; + IndexFieldList: string; + OrderedDetailList: TStringList; + OrderedMasterList: TStringList; + procedure OrderFieldList(OrderedList, List: TStrings); + procedure AddToBindList(const Str1, Str2: string); + procedure Initialize; + property FullIndexName: string read FFullIndexName; + procedure SetDataSet(Value: TDataSet); + public + property DataSet: TDataSet read FDataSet write SetDataSet; + property DataSetProxy: TCRFieldLinkProperty read FDataSetProxy write FDataSetProxy; + function Edit: Boolean; + end; + +function EditMasterFields(ADataSet: TDataSet; ADataSetProxy: TCRFieldLinkProperty): Boolean; + +implementation + +{$IFDEF IDE} +{$R *.dfm} +{$ENDIF} +{$IFDEF MSWINDOWS} +{$R CRFldLinks.dfm} +{$ENDIF} +{$IFDEF LINUX} +{$R *.xfm} +{$ENDIF} + +uses +{$IFDEF LINUX} + QDialogs, +{$ELSE} + Dialogs, +{$IFDEF VER6P} + DsnDBCst, +{$ENDIF} +{$ENDIF} + DBConsts, LibHelp, TypInfo; + +{ Utility Functions } + +function StripFieldName(const Fields: string; var Pos: Integer): string; +var + I: Integer; +begin + I := Pos; + while (I <= Length(Fields)) and (Fields[I] <> ';') do Inc(I); + Result := Copy(Fields, Pos, I - Pos); + if (I <= Length(Fields)) and (Fields[I] = ';') then Inc(I); + Pos := I; +end; + +function StripDetail(const Value: string): string; +var + S: string; + I: Integer; +begin + S := Value; + I := 0; + while Pos('->', S) > 0 do + begin + I := Pos('->', S); + S[I] := ' '; + end; + Result := Copy(Value, 0, I - 2); +end; + +function StripMaster(const Value: string): string; +var + S: string; + I: Integer; +begin + S := Value; + I := 0; + while Pos('->', S) > 0 do + begin + I := Pos('->', S); + S[I] := ' '; + end; + Result := Copy(Value, I + 3, Length(Value)); +end; + +function EditMasterFields(ADataSet: TDataSet; ADataSetProxy: TCRFieldLinkProperty): Boolean; +begin + with TCRLinkFields.Create(nil) do + try + DataSetProxy := ADataSetProxy; + DataSet := ADataSet; + Result := Edit; + finally + Free; + end; +end; + +{ TCRFieldLinkProperty } + +function TCRFieldLinkProperty.GetIndexBased: Boolean; +begin + Result := False; +end; + +function TCRFieldLinkProperty.GetIndexDefs: TIndexDefs; +begin + Result := nil; +end; + +function TCRFieldLinkProperty.GetIndexFieldNames: string; +begin + Result := ''; +end; + +function TCRFieldLinkProperty.GetIndexName: string; +begin + Result := ''; +end; + +procedure TCRFieldLinkProperty.GetIndexNames(List: TStrings); +begin +end; + +procedure TCRFieldLinkProperty.GetFieldNamesForIndex(List: TStrings); +begin +end; + +procedure TCRFieldLinkProperty.SetIndexFieldNames(const Value: string); +begin +end; + +procedure TCRFieldLinkProperty.SetIndexName(const Value: string); +begin +end; + +function TCRFieldLinkProperty.GetAttributes: TPropertyAttributes; +begin + Result := [paDialog]; +{$IFDEF LINUX} + Result := Result + [paVCL] +{$ENDIF} +end; + +procedure TCRFieldLinkProperty.Edit; +begin + FChanged := EditMasterFields(DataSet, Self); + if FChanged then Modified; +end; + +constructor TCRFieldLinkProperty.CreateWith(ADataSet: TDataSet); +begin + FDataSet := ADataSet; +end; + +function TCRFieldLinkProperty.GetDataSet: TDataSet; +begin + if FDataSet = nil then + FDataSet := TDataSet(GetComponent(0)); + Result := FDataSet; +end; + +{ TCRLinkFields } + +procedure TCRLinkFields.FormCreate(Sender: TObject); +begin + OrderedDetailList := TStringList.Create; + OrderedMasterList := TStringList.Create; +{$IFDEF LINUX} + Help.Visible := False; +{$ELSE} +{$IFDEF VER6P} + HelpContext := hcDFieldLinksDesign; +{$ENDIF} +{$ENDIF} +end; + +procedure TCRLinkFields.FormDestroy(Sender: TObject); +begin + OrderedDetailList.Free; + OrderedMasterList.Free; +end; + +function TCRLinkFields.Edit; +begin + Initialize; + if ShowModal = mrOK then + begin + if FullIndexName <> '' then + DataSetProxy.IndexName := FullIndexName else + DataSetProxy.IndexFieldNames := IndexFieldList; + DataSetProxy.MasterFields := MasterFieldList; + Result := True; + end + else + Result := False; +end; + +procedure TCRLinkFields.SetDataSet(Value: TDataSet); +{$IFDEF LINUX} +const + SMissingDataSource = 'Missing MasterSource or DataSource'; +{$ENDIF} +{$IFNDEF VER6P} +const + SMissingDataSource = 'Missing MasterSource or DataSource'; +{$ENDIF} +var + IndexDefs: TIndexDefs; +begin + Value.FieldDefs.Update; + IndexDefs := DataSetProxy.IndexDefs; + if Assigned(IndexDefs) then IndexDefs.Update; + if not Assigned(Value.DataSource) or not Assigned(Value.DataSource.DataSet) then + DatabaseError(SMissingDataSource, Value); + Value.DataSource.DataSet.FieldDefs.Update; + FDataSet := Value; + FMasterDataSet := Value.DataSource.DataSet; +end; + +procedure TCRLinkFields.Initialize; +var + SIndexName: string; + + procedure SetUpLists(const MasterFieldList, DetailFieldList: string); + var + I, J: Integer; + MasterFieldName, DetailFieldName: string; + begin + I := 1; + J := 1; + while (I <= Length(MasterFieldList)) and (J <= Length(DetailFieldList)) do + begin + MasterFieldName := StripFieldName(MasterFieldList, I); + DetailFieldName := StripFieldName(DetailFieldList, J); + if (MasterList.Items.IndexOf(MasterFieldName) <> -1) and + (OrderedDetailList.IndexOf(DetailFieldName) <> -1) then + begin + with OrderedDetailList do + Objects[IndexOf(DetailFieldName)] := TObject(True); + with DetailList.Items do Delete(IndexOf(DetailFieldName)); + with MasterList.Items do Delete(IndexOf(MasterFieldName)); + BindList.Items.Add(Format('%s -> %s', + [DetailFieldName, MasterFieldName])); + ClearButton.Enabled := True; + end; + end; + end; + +begin + if not DataSetProxy.IndexBased then + begin + IndexLabel.Visible := False; + IndexList.Visible := False; + end + else with DataSetProxy do + begin + GetIndexNames(IndexList.Items); + if IndexFieldNames <> '' then + SIndexName := IndexDefs.FindIndexForFields(IndexFieldNames).Name + else SIndexName := IndexName; + if (SIndexName <> '') and (IndexList.Items.IndexOf(SIndexName) >= 0) then + IndexList.ItemIndex := IndexList.Items.IndexOf(SIndexName) else + IndexList.ItemIndex := 0; + end; + with DataSetProxy do + begin + MasterFieldList := MasterFields; + if (IndexFieldNames = '') and (IndexName <> '') and + (IndexDefs.IndexOf(IndexName) >=0) then + IndexFieldList := IndexDefs[IndexDefs.IndexOf(IndexName)].Fields else + IndexFieldList := IndexFieldNames; + end; + IndexListChange(nil); + FMasterDataSet.GetFieldNames(MasterList.Items); + OrderedMasterList.Assign(MasterList.Items); + SetUpLists(MasterFieldList, IndexFieldList); +end; + +procedure TCRLinkFields.IndexListChange(Sender: TObject); +var + I: Integer; + IndexExp: string; +begin + DetailList.Items.Clear; + if DataSetProxy.IndexBased then + begin + DataSetProxy.IndexName := IndexList.Text; + I := DataSetProxy.IndexDefs.IndexOf(DataSetProxy.IndexName); + if (I <> -1) then IndexExp := DataSetProxy.IndexDefs.Items[I].Expression; + if IndexExp <> '' then + DetailList.Items.Add(IndexExp) else + DataSetProxy.GetFieldNamesForIndex(DetailList.Items); + end else + DataSet.GetFieldNames(DetailList.Items); + MasterList.Items.Assign(OrderedMasterList); + OrderedDetailList.Assign(DetailList.Items); + for I := 0 to OrderedDetailList.Count - 1 do + OrderedDetailList.Objects[I] := TObject(False); + BindList.Clear; + AddButton.Enabled := False; + ClearButton.Enabled := False; + DeleteButton.Enabled := False; + MasterList.ItemIndex := -1; +end; + +procedure TCRLinkFields.OrderFieldList(OrderedList, List: TStrings); +var + I, J: Integer; + MinIndex, Index, FieldIndex: Integer; +begin + for J := 0 to List.Count - 1 do + begin + MinIndex := $7FFF; + FieldIndex := -1; + for I := J to List.Count - 1 do + begin + Index := OrderedList.IndexOf(List[I]); + if Index < MinIndex then + begin + MinIndex := Index; + FieldIndex := I; + end; + end; + List.Move(FieldIndex, J); + end; +end; + +procedure TCRLinkFields.AddToBindList(const Str1, Str2: string); +var + I: Integer; + NewField: string; + NewIndex: Integer; +begin + NewIndex := OrderedDetailList.IndexOf(Str1); + NewField := Format('%s -> %s', [Str1, Str2]); + with BindList.Items do + begin + for I := 0 to Count - 1 do + begin + if OrderedDetailList.IndexOf(StripDetail(Strings[I])) > NewIndex then + begin + Insert(I, NewField); + Exit; + end; + end; + Add(NewField); + end; +end; + +procedure TCRLinkFields.BindingListClick(Sender: TObject); +begin + AddButton.Enabled := (DetailList.ItemIndex <> LB_ERR) and + (MasterList.ItemIndex <> LB_ERR); +end; + +procedure TCRLinkFields.AddButtonClick(Sender: TObject); +var + DetailIndex: Integer; + MasterIndex: Integer; +begin + DetailIndex := DetailList.ItemIndex; + MasterIndex := MasterList.ItemIndex; + AddToBindList(DetailList.Items[DetailIndex], + MasterList.Items[MasterIndex]); + with OrderedDetailList do + Objects[IndexOf(DetailList.Items[DetailIndex])] := TObject(True); + DetailList.Items.Delete(DetailIndex); + MasterList.Items.Delete(MasterIndex); + ClearButton.Enabled := True; + AddButton.Enabled := False; +end; + +procedure TCRLinkFields.ClearButtonClick(Sender: TObject); +var + I: Integer; + BindValue: string; +begin + for I := 0 to BindList.Items.Count - 1 do + begin + BindValue := BindList.Items[I]; + DetailList.Items.Add(StripDetail(BindValue)); + MasterList.Items.Add(StripMaster(BindValue)); + end; + BindList.Clear; + ClearButton.Enabled := False; + DeleteButton.Enabled := False; + OrderFieldList(OrderedDetailList, DetailList.Items); + DetailList.ItemIndex := -1; + MasterList.Items.Assign(OrderedMasterList); + for I := 0 to OrderedDetailList.Count - 1 do + OrderedDetailList.Objects[I] := TObject(False); + AddButton.Enabled := False; +end; + +procedure TCRLinkFields.DeleteButtonClick(Sender: TObject); +var + I: Integer; +begin + with BindList do + begin + for I := Items.Count - 1 downto 0 do + begin + if Selected[I] then + begin + DetailList.Items.Add(StripDetail(Items[I])); + MasterList.Items.Add(StripMaster(Items[I])); + with OrderedDetailList do + Objects[IndexOf(StripDetail(Items[I]))] := TObject(False); + Items.Delete(I); + end; + end; + if Items.Count > 0 then Selected[0] := True; + DeleteButton.Enabled := Items.Count > 0; + ClearButton.Enabled := Items.Count > 0; + OrderFieldList(OrderedDetailList, DetailList.Items); + DetailList.ItemIndex := -1; + OrderFieldList(OrderedMasterList, MasterList.Items); + MasterList.ItemIndex := -1; + AddButton.Enabled := False; + end; +end; + +procedure TCRLinkFields.BindListClick(Sender: TObject); +begin + DeleteButton.Enabled := BindList.ItemIndex <> LB_ERR; +end; + +procedure TCRLinkFields.BitBtn1Click(Sender: TObject); +var + I: Integer; +begin + MasterFieldList := ''; + IndexFieldList := ''; + FFullIndexName := ''; + with BindList do + begin + for I := 0 to Items.Count - 1 do + begin + MasterFieldList := Format('%s%s;', [MasterFieldList, StripMaster(Items[I])]); + IndexFieldList := Format('%s%s;', [IndexFieldList, StripDetail(Items[I])]); + end; + if MasterFieldList <> '' then + SetLength(MasterFieldList, Length(MasterFieldList) - 1); + if IndexFieldList <> '' then + SetLength(IndexFieldList, Length(IndexFieldList) - 1); + end; +end; + +procedure TCRLinkFields.HelpClick(Sender: TObject); +begin +{$IFNDEF LINUX} + Application.HelpContext(HelpContext); +{$ENDIF} +end; + +end. diff --git a/internal/4.10.0.10/1/Source/Design/CRFldLinks.xfm b/internal/4.10.0.10/1/Source/Design/CRFldLinks.xfm new file mode 100644 index 0000000..f35ce12 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/CRFldLinks.xfm @@ -0,0 +1,155 @@ +object CRLinkFields: TCRLinkFields + Left = 235 + Top = 123 + Width = 697 + Height = 334 + HorzScrollBar.Range = 691 + VertScrollBar.Range = 328 + ActiveControl = IndexList + Caption = 'Field Link Designer' + Color = clButton + OnCreate = FormCreate + OnDestroy = FormDestroy + PixelsPerInch = 96 + TextHeight = 15 + TextWidth = 7 + object Bevel1: TBevel + Left = 4 + Top = 33 + Width = 343 + Height = 190 + Shape = bsFrame + end + object Bevel2: TBevel + Left = 350 + Top = 285 + Width = 341 + Height = 43 + Shape = bsFrame + end + object Label30: TLabel + Left = 13 + Top = 40 + Width = 70 + Height = 15 + Caption = 'D&etail Fields' + FocusControl = DetailList + end + object Label31: TLabel + Left = 222 + Top = 38 + Width = 76 + Height = 15 + Caption = '&Master Fields' + FocusControl = MasterList + end + object IndexLabel: TLabel + Left = 4 + Top = 10 + Width = 100 + Height = 15 + Caption = 'A&vailable Indexes' + FocusControl = IndexList + end + object Label2: TLabel + Left = 12 + Top = 142 + Width = 76 + Height = 15 + Caption = '&Joined Fields' + FocusControl = BindList + end + object DetailList: TListBox + Left = 13 + Top = 55 + Width = 117 + Height = 69 + TabOrder = 1 + OnClick = BindingListClick + end + object MasterList: TListBox + Left = 222 + Top = 54 + Width = 117 + Height = 69 + TabOrder = 2 + OnClick = BindingListClick + end + object BindList: TListBox + Left = 12 + Top = 157 + Width = 242 + Height = 56 + MultiSelect = True + TabOrder = 3 + OnClick = BindListClick + end + object IndexList: TComboBox + Left = 109 + Top = 7 + Width = 192 + Height = 23 + Style = csDropDownList + ItemHeight = 17 + TabOrder = 0 + OnChange = IndexListChange + OnClick = IndexListChange + end + object AddButton: TButton + Left = 138 + Top = 74 + Width = 75 + Height = 25 + Caption = '&Add' + TabOrder = 4 + OnClick = AddButtonClick + end + object DeleteButton: TButton + Left = 263 + Top = 157 + Width = 75 + Height = 25 + Caption = '&Delete' + TabOrder = 5 + OnClick = DeleteButtonClick + end + object ClearButton: TButton + Left = 263 + Top = 188 + Width = 75 + Height = 25 + Caption = '&Clear' + TabOrder = 6 + OnClick = ClearButtonClick + end + object Button1: TButton + Left = 100 + Top = 231 + Width = 75 + Height = 25 + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 7 + OnClick = BitBtn1Click + end + object Button2: TButton + Left = 186 + Top = 231 + Width = 75 + Height = 25 + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 8 + end + object Help: TButton + Left = 272 + Top = 231 + Width = 75 + Height = 25 + Caption = '&Help' + TabOrder = 9 + OnClick = HelpClick + end +end diff --git a/internal/4.10.0.10/1/Source/Design/CRFrame.dfm b/internal/4.10.0.10/1/Source/Design/CRFrame.dfm new file mode 100644 index 0000000..ebf3a3d --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/CRFrame.dfm @@ -0,0 +1,8 @@ +object CRFrame: TCRFrame + Left = 0 + Top = 0 + Width = 481 + Height = 229 + TabOrder = 0 + OnEnter = FrameEnter +end diff --git a/internal/4.10.0.10/1/Source/Design/CRFrame.pas b/internal/4.10.0.10/1/Source/Design/CRFrame.pas new file mode 100644 index 0000000..1c47d56 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/CRFrame.pas @@ -0,0 +1,115 @@ + +////////////////////////////////////////////////// +// DB Access Components +// Copyright © 1998-2005 Core Lab. All right reserved. +// Base Frame +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I Dac.inc} + +unit CRFrame; +{$ENDIF} + +interface + +uses +{$IFDEF MSWINDOWS} + Controls, ComCtrls, + Forms, +{$ENDIF} +{$IFDEF LINUX} + QControls, QForms, QComCtrls, +{$ENDIF} +{$IFDEF DBTOOLS} + DBToolsClient, +{$ENDIF} + Classes, CREditor; + +type + TCRFrameClass = class of TCRFrame; + + TCRFrame = class(TFrame) + procedure FrameEnter(Sender: TObject); + protected + FModified: boolean; + FEditor: TCREditorForm; + FActivated: boolean; // To avoid duplicate call (for example, on TCRFrame.FrameExit and PageControl.OnChanging events) + + function GetPage: TTabSheet; + procedure DoActivate; virtual; + procedure DoFinish; virtual; + + public + function ActiveControl: TWinControl; virtual; // Return default control for this frame + procedure Activate; + procedure Finish; + procedure ReActivate; + + property Page: TTabSheet read GetPage; + property Editor: TCREditorForm read FEditor write FEditor; + property Modified: boolean read FModified write FModified; + + end; + +implementation + +{$IFDEF IDE} +{$R *.dfm} +{$ENDIF} +{$IFDEF MSWINDOWS} +{$R CRFrame.dfm} +{$ENDIF} +{$IFDEF LINUX} +{$R *.xfm} +{$ENDIF} + +{ TCRFrame } + +function TCRFrame.ActiveControl: TWinControl; +begin + Result := nil; +end; + +function TCRFrame.GetPage: TTabSheet; +begin + Result := Parent as TTabSheet; +end; + +procedure TCRFrame.DoActivate; +begin +end; + +procedure TCRFrame.DoFinish; +begin +{$IFDEF DBTOOLS} + DBTools.CheckDBToolsChanges(Self); +{$ENDIF} +end; + +procedure TCRFrame.Activate; +begin + if not FActivated then + ReActivate; +end; + +procedure TCRFrame.Finish; +begin + if FActivated then + DoFinish; + FActivated := False; +end; + +procedure TCRFrame.FrameEnter(Sender: TObject); +begin + Activate; +end; + +procedure TCRFrame.ReActivate; +begin + DoActivate; + FActivated := True; +end; + +end. diff --git a/internal/4.10.0.10/1/Source/Design/CRFrame.xfm b/internal/4.10.0.10/1/Source/Design/CRFrame.xfm new file mode 100644 index 0000000..d70aa96 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/CRFrame.xfm @@ -0,0 +1,8 @@ +object CRFrame: TCRFrame + Left = 0 + Top = 0 + Width = 481 + Height = 229 + TabOrder = 0 + OnEnter = FrameEnter +end diff --git a/internal/4.10.0.10/1/Source/Design/CRTabEditor.dfm b/internal/4.10.0.10/1/Source/Design/CRTabEditor.dfm new file mode 100644 index 0000000..c3108f7 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/CRTabEditor.dfm @@ -0,0 +1,40 @@ +inherited CRTabEditorForm: TCRTabEditorForm + Left = 295 + Top = 204 + Width = 512 + Height = 338 + HorzScrollBar.Visible = False + VertScrollBar.Visible = False + BorderIcons = [biSystemMenu] + Constraints.MinHeight = 332 + Constraints.MinWidth = 512 + Font.Height = -11 + OnDestroy = FormDestroy + PixelsPerInch = 96 + TextHeight = 13 + inherited BtnPanel: TPanel + Top = 270 + Width = 504 + TabOrder = 1 + inherited imCorner: TImage + Left = 492 + end + inherited btOk: TBitBtn + Left = 340 + end + inherited btCancel: TBitBtn + Left = 421 + end + end + object PageControl: TPageControl + Left = 8 + Top = 8 + Width = 488 + Height = 255 + Anchors = [akLeft, akTop, akRight, akBottom] + TabOrder = 0 + TabStop = False + OnChange = PageControlChange + OnChanging = PageControlChanging + end +end diff --git a/internal/4.10.0.10/1/Source/Design/CRTabEditor.pas b/internal/4.10.0.10/1/Source/Design/CRTabEditor.pas new file mode 100644 index 0000000..21706bc --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/CRTabEditor.pas @@ -0,0 +1,250 @@ + +////////////////////////////////////////////////// +// Data Access Components +// Copyright © 1998-2005 Core Lab. All right reserved. +// Tab Editor +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I Dac.inc} + +unit CRTabEditor; +{$ENDIF} +interface +uses +{$IFDEF MSWINDOWS} + Windows, Messages, Graphics, Controls, Forms, Dialogs, + ComCtrls, StdCtrls, ExtCtrls, Buttons, +{$ENDIF} +{$IFDEF LINUX} + Types, QGraphics, QControls, QForms, QDialogs, QStdCtrls, + QExtCtrls, QComCtrls, QButtons, +{$ENDIF} +{$IFDEF DBTOOLS} + DBToolsClient, +{$ENDIF} + SysUtils, Classes, + CREditor, CRFrame, DADesignUtils, MemData; + +type + TCRTabEditorForm = class(TCREditorForm) + PageControl: TPageControl; + procedure FormDestroy(Sender: TObject); + procedure PageControlChange(Sender: TObject); + procedure PageControlChanging(Sender: TObject; + var AllowChange: Boolean); + + protected + FFramesList: TList; + + {$IFDEF LINUX} + procedure DoInit; override; + procedure DoActivate; override; + {$ENDIF} + {$IFDEF DBTOOLS} + procedure ExitActiveControl; override; + {$ENDIF} + procedure SaveControlData; override; + + function AddTab(FrameClass: TCRFrameClass; Page: TTabSheet): TCRFrame; + + function GetFrameByInitProp: TCRFrame; virtual; + + function GetModified: boolean; override; + procedure SetModified(Value: boolean); override; + + function GetActiveFrame: TCRFrame; + + // Avoid Kylix bug + procedure DoPageControlChange(Sender: TObject); virtual; + procedure DoPageControlChanging(Sender: TObject; var AllowChange: Boolean); virtual; + public + constructor Create(Owner: TComponent; DADesignUtilsClass: TDADesignUtilsClass); override; + procedure ActivateFrame(Frame: TCRFrame); + + property ActiveFrame: TCRFrame read GetActiveFrame; + end; + +implementation + +{$IFDEF IDE} +{$R *.dfm} +{$ENDIF} +{$IFDEF MSWINDOWS} +{$R CRTabEditor.dfm} +{$ENDIF} +{$IFDEF LINUX} +{$R *.xfm} +{$ENDIF} + +{ TCRTabEditorForm } + +{ +procedure TCRTabEditorForm.CreateFrames; +begin + Assert(False, 'Must be overriden - D8 bug'); +end; +} + +{$IFDEF LINUX} +procedure TCRTabEditorForm.DoInit; +begin + inherited; + + PageControl.OnChange := nil; + PageControl.OnChanging := nil; + PageControl.ActivePageIndex := 0; + PageControl.OnChange := PageControlChange; + PageControl.OnChanging := PageControlChanging; +end; + +procedure TCRTabEditorForm.DoActivate; +var + ActiveFrame: TCRFrame; +begin + inherited; + + // on Windows frame is activated from PageControlChange method + ActiveFrame := GetActiveFrame; + if ActiveFrame <> nil then + ActiveFrame.Activate; +end; +{$ENDIF} + +{$IFDEF DBTOOLS} +procedure TCRTabEditorForm.ExitActiveControl; +begin + DBTools.CheckDBToolsChanges(GetActiveFrame); + inherited; +end; +{$ENDIF} + +procedure TCRTabEditorForm.SaveControlData; +var + ActiveFrame: TCRFrame; +begin + ActiveFrame := GetActiveFrame; + if ActiveFrame <> nil then + ActiveFrame.Finish; + + inherited; +end; + +function TCRTabEditorForm.AddTab(FrameClass: TCRFrameClass; Page: TTabSheet): TCRFrame; +begin + Result := FrameClass.Create(Self); + Result.Parent := Page; + Result.Align := alClient; + Result.Name := Page.Name + FrameClass.ClassName; + Result.Editor := Self; + + FFramesList.Add(Result); +end; + +function TCRTabEditorForm.GetModified: boolean; +var + i :integer; +begin + Result := inherited GetModified; + for i := 0 to FFramesList.Count - 1 do + Result := Result or TCRFrame(FFramesList[i]).Modified; +end; + +procedure TCRTabEditorForm.SetModified(Value: boolean); +var + i :integer; +begin + inherited; + for i := 0 to FFramesList.Count - 1 do + TCRFrame(FFramesList[i]).Modified := Value; +end; + +constructor TCRTabEditorForm.Create(Owner: TComponent; DADesignUtilsClass: TDADesignUtilsClass); +begin + FFramesList := TList.Create; + inherited; +end; + +procedure TCRTabEditorForm.FormDestroy(Sender: TObject); +begin + inherited; + FFramesList.Free; +end; + +function TCRTabEditorForm.GetActiveFrame: TCRFrame; +var + i: integer; +begin + for i := 0 to FFramesList.Count - 1 do + if TCRFrame(FFramesList[i]).Page = PageControl.ActivePage then begin + Result := TCRFrame(FFramesList[i]); + Exit; + end; + Result := nil; +end; + +procedure TCRTabEditorForm.ActivateFrame(Frame: TCRFrame); +var + ActiveFrame: TCRFrame; +begin + ActiveFrame := GetActiveFrame; + if ActiveFrame <> nil then + ActiveFrame.Finish; + + if Frame.Page <> PageControl.ActivePage then + PageControl.ActivePage := Frame.Page; + Frame.Activate; +end; + +procedure TCRTabEditorForm.DoPageControlChange(Sender: TObject); +var + ActiveFrame: TCRFrame; +begin + ActiveFrame := GetActiveFrame; + if ActiveFrame <> nil then + ActiveFrame.Activate; +end; + +procedure TCRTabEditorForm.PageControlChange(Sender: TObject); +begin + DoPageControlChange(Sender); +end; + +procedure TCRTabEditorForm.DoPageControlChanging(Sender: TObject; var AllowChange: Boolean); +var + ActiveFrame: TCRFrame; +begin + try + ActiveFrame := GetActiveFrame; + if ActiveFrame <> nil then + ActiveFrame.Finish; + except + on E: Exception do begin + AllowChange := False; + ApplicationHandleException(E); + end; + end; +end; + +procedure TCRTabEditorForm.PageControlChanging(Sender: TObject; var AllowChange: Boolean); +begin + DoPageControlChanging(Sender, AllowChange); +end; + +function TCRTabEditorForm.GetFrameByInitProp: TCRFrame; +var + i :integer; +begin + Result := nil; + if InitialProperty <> '' then begin + for i := 0 to FFramesList.Count - 1 do + if TCRFrame(FFramesList[i]).Page.Caption = InitialProperty then begin + Result := TCRFrame(FFramesList[i]); + Break; + end; + Assert(Result <> nil, 'Unknown frame ' + InitialProperty); + end; +end; + +end. diff --git a/internal/4.10.0.10/1/Source/Design/CRTabEditor.xfm b/internal/4.10.0.10/1/Source/Design/CRTabEditor.xfm new file mode 100644 index 0000000..fd1c96b --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/CRTabEditor.xfm @@ -0,0 +1,29 @@ +inherited CRTabEditorForm: TCRTabEditorForm + Left = 294 + Top = 203 + Height = 340 + HorzScrollBar.Visible = False + VertScrollBar.Visible = False + BorderIcons = [biSystemMenu] + Constraints.MinHeight = 332 + Constraints.MinWidth = 512 + Font.Height = -11 + OnDestroy = FormDestroy + PixelsPerInch = 96 + TextHeight = 13 + inherited BtnPanel: TPanel + Top = 272 + TabOrder = 1 + end + object PageControl: TPageControl + Left = 8 + Top = 8 + Width = 489 + Height = 281 + Anchors = [akLeft, akTop, akRight, akBottom] + TabOrder = 0 + TabStop = False + OnChange = PageControlChange + OnChanging = PageControlChanging + end +end diff --git a/internal/4.10.0.10/1/Source/Design/DAConnectionEditor.dfm b/internal/4.10.0.10/1/Source/Design/DAConnectionEditor.dfm new file mode 100644 index 0000000..2203f56 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DAConnectionEditor.dfm @@ -0,0 +1,415 @@ +inherited DAConnectionEditorForm: TDAConnectionEditorForm + Left = 307 + Top = 150 + VertScrollBar.Range = 0 + ActiveControl = edUsername + BorderStyle = bsDialog + Caption = 'DAConnectionEditorForm' + ClientHeight = 281 + ClientWidth = 450 + PixelsPerInch = 96 + TextHeight = 13 + inherited BtnPanel: TPanel + Top = 256 + Width = 25 + Height = 25 + Align = alNone + TabOrder = 2 + Visible = False + inherited imCorner: TImage + Left = 68 + Top = 13 + end + inherited btOk: TBitBtn + Left = 40 + Top = 16 + end + inherited btCancel: TBitBtn + Left = 40 + Top = 0 + end + end + object PageControl: TPageControl + Left = 8 + Top = 8 + Width = 434 + Height = 232 + ActivePage = shConnect + Anchors = [akLeft, akTop, akRight, akBottom] + TabOrder = 0 + OnChange = PageControlChange + object shConnect: TTabSheet + Caption = 'C&onnect' + object shRed: TShape + Left = 24 + Top = 175 + Width = 15 + Height = 15 + Anchors = [akLeft, akBottom] + Brush.Color = clBtnFace + Pen.Color = clBtnShadow + Shape = stCircle + end + object shYellow: TShape + Left = 41 + Top = 175 + Width = 15 + Height = 15 + Anchors = [akLeft, akBottom] + Brush.Color = clBtnFace + Enabled = False + Pen.Color = clBtnShadow + Shape = stCircle + end + object shGreen: TShape + Left = 58 + Top = 175 + Width = 15 + Height = 15 + Anchors = [akLeft, akBottom] + Brush.Color = clBtnFace + Enabled = False + Pen.Color = clBtnShadow + Shape = stCircle + end + object Panel: TPanel + Left = 8 + Top = 8 + Width = 273 + Height = 150 + Anchors = [akLeft, akTop, akBottom] + BevelInner = bvRaised + BevelOuter = bvLowered + TabOrder = 0 + object lbUsername: TLabel + Left = 16 + Top = 20 + Width = 48 + Height = 13 + Caption = 'Username' + end + object lbPassword: TLabel + Left = 16 + Top = 53 + Width = 46 + Height = 13 + Caption = 'Password' + end + object lbServer: TLabel + Left = 16 + Top = 86 + Width = 31 + Height = 13 + Caption = 'Server' + end + object edServer: TComboBox + Left = 104 + Top = 82 + Width = 153 + Height = 21 + ItemHeight = 13 + Sorted = True + TabOrder = 2 + OnChange = edServerChange + OnDropDown = edServerDropDown + OnExit = edServerExit + OnKeyUp = edServerKeyUp + end + object edUsername: TEdit + Left = 104 + Top = 16 + Width = 153 + Height = 21 + TabOrder = 0 + OnChange = edUsernameChange + OnExit = edServerExit + end + object edPassword: TMaskEdit + Left = 104 + Top = 49 + Width = 153 + Height = 21 + PasswordChar = '*' + TabOrder = 1 + OnChange = edPasswordChange + end + end + object btConnect: TButton + Left = 92 + Top = 170 + Width = 89 + Height = 25 + Anchors = [akLeft, akBottom] + Caption = '&Connect' + Default = True + TabOrder = 2 + OnClick = btConnectClick + end + object btDisconnect: TButton + Left = 192 + Top = 170 + Width = 89 + Height = 25 + Anchors = [akLeft, akBottom] + Caption = '&Disconnect' + TabOrder = 3 + OnClick = btDisconnectClick + end + object cbLoginPrompt: TCheckBox + Left = 300 + Top = 8 + Width = 121 + Height = 17 + Caption = '&LoginPrompt' + TabOrder = 1 + OnClick = cbLoginPromptClick + end + end + object shInfo: TTabSheet + Caption = '&Info' + ImageIndex = 1 + object meInfo: TMemo + Left = 8 + Top = 8 + Width = 409 + Height = 185 + Anchors = [akLeft, akTop, akRight, akBottom] + ReadOnly = True + TabOrder = 0 + end + end + object shAbout: TTabSheet + Caption = '&About' + ImageIndex = 2 + OnMouseMove = shAboutMouseMove + object Label1: TLabel + Left = 10 + Top = 6 + Width = 240 + Height = 23 + Caption = 'Data Access Components' + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Height = -19 + Font.Name = 'Tahoma' + Font.Pitch = fpVariable + Font.Style = [fsBold] + ParentFont = False + end + object Label2: TLabel + Left = 10 + Top = 68 + Width = 38 + Height = 13 + Caption = 'Version ' + end + object lbVersion: TLabel + Left = 56 + Top = 68 + Width = 45 + Height = 13 + Caption = '3.20.0.20' + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Height = 13 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [] + ParentFont = False + end + object Label3: TLabel + Left = 10 + Top = 92 + Width = 243 + Height = 13 + Caption = 'Copyright '#169' 1997-2007 Core Lab. All right reserved.' + end + object Label5: TLabel + Left = 10 + Top = 116 + Width = 26 + Height = 13 + Caption = 'Web:' + end + object Label6: TLabel + Left = 10 + Top = 140 + Width = 31 + Height = 13 + Caption = 'E-mail:' + end + object lbWeb: TLabel + Left = 56 + Top = 116 + Width = 73 + Height = 13 + Cursor = crHandPoint + Caption = 'www.crlab.com' + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlue + Font.Height = 13 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [fsUnderline] + ParentFont = False + OnClick = lbWebClick + OnMouseMove = lbWebMouseMove + end + object lbMail: TLabel + Left = 56 + Top = 140 + Width = 92 + Height = 13 + Cursor = crHandPoint + Caption = 'support@crlab.com' + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlue + Font.Height = 13 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [fsUnderline] + ParentColor = False + ParentFont = False + OnClick = lbMailClick + OnMouseMove = lbMailMouseMove + end + object lbIDE: TLabel + Left = 115 + Top = 68 + Width = 54 + Height = 13 + Caption = 'for Delphi 6' + end + object imPeng: TImage + Left = 376 + Top = 8 + Width = 40 + Height = 48 + Picture.Data = { + 07544269746D6170B60B0000424DB60B00000000000036040000280000002800 + 000030000000010008000000000080070000120B0000120B0000000100000000 + 000000000000000080000080000000808000800000008000800080800000C0C0 + C000C0DCC000F0CAA6000020400000206000002080000020A0000020C0000020 + E00000400000004020000040400000406000004080000040A0000040C0000040 + E00000600000006020000060400000606000006080000060A0000060C0000060 + E00000800000008020000080400000806000008080000080A0000080C0000080 + E00000A0000000A0200000A0400000A0600000A0800000A0A00000A0C00000A0 + E00000C0000000C0200000C0400000C0600000C0800000C0A00000C0C00000C0 + E00000E0000000E0200000E0400000E0600000E0800000E0A00000E0C00000E0 + E00040000000400020004000400040006000400080004000A0004000C0004000 + E00040200000402020004020400040206000402080004020A0004020C0004020 + E00040400000404020004040400040406000404080004040A0004040C0004040 + E00040600000406020004060400040606000406080004060A0004060C0004060 + E00040800000408020004080400040806000408080004080A0004080C0004080 + E00040A0000040A0200040A0400040A0600040A0800040A0A00040A0C00040A0 + E00040C0000040C0200040C0400040C0600040C0800040C0A00040C0C00040C0 + E00040E0000040E0200040E0400040E0600040E0800040E0A00040E0C00040E0 + E00080000000800020008000400080006000800080008000A0008000C0008000 + E00080200000802020008020400080206000802080008020A0008020C0008020 + E00080400000804020008040400080406000804080008040A0008040C0008040 + E00080600000806020008060400080606000806080008060A0008060C0008060 + E00080800000808020008080400080806000808080008080A0008080C0008080 + E00080A0000080A0200080A0400080A0600080A0800080A0A00080A0C00080A0 + E00080C0000080C0200080C0400080C0600080C0800080C0A00080C0C00080C0 + E00080E0000080E0200080E0400080E0600080E0800080E0A00080E0C00080E0 + E000C0000000C0002000C0004000C0006000C0008000C000A000C000C000C000 + E000C0200000C0202000C0204000C0206000C0208000C020A000C020C000C020 + E000C0400000C0402000C0404000C0406000C0408000C040A000C040C000C040 + E000C0600000C0602000C0604000C0606000C0608000C060A000C060C000C060 + E000C0800000C0802000C0804000C0806000C0808000C080A000C080C000C080 + E000C0A00000C0A02000C0A04000C0A06000C0A08000C0A0A000C0A0C000C0A0 + E000C0C00000C0C02000C0C04000C0C06000C0C08000C0C0A000F0FBFF00A4A0 + A000808080000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00030303030303030303030303030303030303030303030303030303030303 + 0303030303030303030303030303030303030303030303030303030303030303 + 0303030303030364030303030303030303030303030303030303031D1C1D1C13 + 5C03030303030303030303035B1C25251D650303030303030303030303030366 + 2525262F2F2F2F25130A529BA49BA49B9B9B5B5214262F2F2F26666603030303 + 030303032626262F2F3737373737372F250A000000000000000000001C2F3737 + 37372F2F2F030303030303262F373737373737373737372F1D00525B5B524900 + 000000001C2F3737373737372F6F2F03030303032F373737373737373737372F + 6507FFFFFFFFF6079B0000001C2F37373737373737372F2F030303032F373737 + 373737373737372FF6FFFFFFFFFFFFFFFF0749001C2F37373737373737373737 + 2F0303032F3737373737373737373713A4F6FFFFFFFFFFFFFFFFF652132F3737 + 37373737373737372F0303032F3737373737373737371C0000F7FFFFFFFFFFFF + FFFFFF08652F37372F3737373737372F2F0303032F37373737373737372F0000 + 0007FFFFFFFFFFFFFFFFFF08AE2F2F2F2F2F2F3737372F03030303032F373737 + 373737373713000007FFFFFFFFFFFFFFFFFFFF086E2F2F251C1C263737772F03 + 030303032F2F2F2F3737373726005208FFFFFFFFFFFFFFFFFFFFFFF6B737260A + 00000025372F2F03030303030303036F2F37372F005BF6FFFFFFF6FFFFFFFFFF + FFFFFFFFB73726000000000A372F030303030303030303036F3737129BFFFFFF + FFFFF6FFFFFFFFFFFFFFFFFFBF7F6D00000000002F0303030303030303030303 + 531C0A52FFFFFFFFFFF6F6FFFFFFFFFFFFFFFFFFFFFFA4000000004949030303 + 03030303030303030000009BFFFFFFFFFFFFF6FFFFFFFFFFFFFFFFFFFFFFF700 + 0000000000030303030303030303030349004952FFFFFFFFFFFFF6FFFFFFFFFF + FFFFFFFFFFFF0700000000000003030303030303030303039B000052FFFFFFFF + FFFFF6FFFFFFFFFFFFFFFFFFFFFFF70000000000000303030303030303030303 + 0349000008FFFFFFFFFFF6FFFFFFFFFFFFFFFFFFFFFFF7000000000000030303 + 0303030303030303039B0000F7FFFFFFFFFFF6FFFFFFFFFFFFFFFFFFFFFFA400 + 000000005203030303030303030303030303490052FFFFFFFFFFF6FFFFFFFFFF + FFFFFFFFFFFF9B00000000009B03030303030303030303030303520000F7FFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFF6524949000000030303030303030303030303 + 03039B000052F6FFFFFFFFFFFFFFFFFFFFFFFFFFF6F700000000005203030303 + 0303030303030303030303000000F7F6FFFFFFF6FFFFFFFFFFF6F60808520000 + 0000009B0303030303030303030303030303039B00005207F6FFF6F6F6FFFFF6 + 08070707A4000000000049030303030303030303030303030303030349004908 + FFFFFFF6F6FFFFFFF6F6F6080000000000000303030303030303030303030303 + 0303030303000007FFFFFFFFFFFFFFFFFFFFFF07000000000003030303030303 + 030303030303030303030303039B005BFFFFF60808F6FFFFFFFFFFA400000000 + 9B0303030303030303030303030303030303030303039B0007FF07070707F6FF + FFFFF64900000052030303030303030303030303030303030303030303030349 + 490807AD65AD0708FFFFA4000000000303030303030303030303030303030303 + 030303030303030300F76526262666AE0807000052005B030303030303030303 + 0303030303030303030303030303030300652E372F2E262E6E5C00525B000303 + 030303030303030303030303030303030303030303030303122E37377F37372E + 2F1C000000520303030303030303030303030303030303030303030303030303 + 0A263737377F3F3F37250000009B030303030303030303030303030303030303 + 030303030303030349AE2F37377F3F2FB75B0000000303030303030303030303 + 030303030303030303030303030303A49B52122E2E6D65009BF7000000030303 + 0303030303030303030303030303030303030303030303A49B009BA400A4A400 + 520700000003030303030303030303030303030303030303030303030303039B + 5BF7079B00A4F65B07A400000003030303030303030303030303030303030303 + 030303030303035B0007F7000000F70807490000000303030303030303030303 + 0303030303030303030303030303039B00000000000000525200000000030303 + 0303030303030303030303030303030303030303030303030000000000000000 + 0000000052030303030303030303030303030303030303030303030303030303 + 0000000000000000000000009B03030303030303030303030303030303030303 + 030303030303030300000000000000005B520000030303030303030303030303 + 0303030303030303030303030303030303000000000000005B49000303030303 + 030303030303030303030303030303030303030303030303035B000000000000 + 0049030303030303030303030303030303030303030303030303030303030303 + 0303035B49000052030303030303030303030303030303030303030303030303 + 0303030303030303030303030303030303030303030303030303030303030303 + 0303} + Transparent = True + Visible = False + end + object lbEdition: TLabel + Left = 23 + Top = 31 + Width = 104 + Height = 18 + Caption = 'Standard Edition' + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Height = -15 + Font.Name = 'Tahoma' + Font.Pitch = fpVariable + Font.Style = [] + ParentFont = False + end + end + end + object btClose: TButton + Left = 366 + Top = 249 + Width = 75 + Height = 25 + Anchors = [akRight, akBottom] + Cancel = True + Caption = 'Close' + TabOrder = 1 + OnClick = SaveClick + end +end diff --git a/internal/4.10.0.10/1/Source/Design/DAConnectionEditor.pas b/internal/4.10.0.10/1/Source/Design/DAConnectionEditor.pas new file mode 100644 index 0000000..3569b7b --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DAConnectionEditor.pas @@ -0,0 +1,533 @@ + +////////////////////////////////////////////////// +// Data Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +// ConnectionEditor Editor +////////////////////////////////////////////////// + +{$IFNDEF CLR} +{$I Dac.inc} + +unit DAConnectionEditor; +{$ENDIF} +interface +uses +{$IFDEF MSWINDOWS} + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + StdCtrls, Mask, ExtCtrls, ComCtrls, Registry, DacVcl, Buttons, +{$ENDIF} +{$IFDEF LINUX} + SysUtils, Types, Classes, QGraphics, QControls, QForms, QDialogs, QStdCtrls, + QMask, QExtCtrls, QComCtrls, DacClx, Qt, QButtons, +{$ENDIF} +{$IFDEF DBTOOLS} + DBToolsClient, +{$ENDIF} + CREditor, DBAccess, DADesignUtils; + +type + TDAConnectionEditorForm = class(TCREditorForm) + PageControl: TPageControl; + shConnect: TTabSheet; + Panel: TPanel; + lbUsername: TLabel; + lbPassword: TLabel; + lbServer: TLabel; + edUsername: TEdit; + edPassword: TMaskEdit; + edServer: TComboBox; + btConnect: TButton; + btDisconnect: TButton; + shInfo: TTabSheet; + shAbout: TTabSheet; + btClose: TButton; + meInfo: TMemo; + Label1: TLabel; + Label2: TLabel; + lbVersion: TLabel; + Label3: TLabel; + Label5: TLabel; + Label6: TLabel; + lbWeb: TLabel; + lbMail: TLabel; + lbIDE: TLabel; + cbLoginPrompt: TCheckBox; + shRed: TShape; + shYellow: TShape; + shGreen: TShape; + imPeng: TImage; + lbEdition: TLabel; + procedure btDisconnectClick(Sender: TObject); + procedure lbWebClick(Sender: TObject); + procedure lbMailClick(Sender: TObject); + procedure cbLoginPromptClick(Sender: TObject); + procedure lbWebMouseMove(Sender: TObject; Shift: TShiftState; X, + Y: Integer); + procedure shAboutMouseMove(Sender: TObject; Shift: TShiftState; X, + Y: Integer); + procedure lbMailMouseMove(Sender: TObject; Shift: TShiftState; X, + Y: Integer); + procedure edUsernameChange(Sender: TObject); + procedure edPasswordChange(Sender: TObject); + procedure edServerChange(Sender: TObject); + procedure btConnectClick(Sender: TObject); + procedure edServerDropDown(Sender: TObject); virtual; + procedure PageControlChange(Sender: TObject); + procedure edServerKeyUp(Sender: TObject; var Key: Word; + Shift: TShiftState); + procedure edServerExit(Sender: TObject); + + protected + FConnection: TCustomDAConnection; + FInDoInit: boolean; + {$IFDEF MSWINDOWS} + FRegistry: TRegistry; + {$ENDIF} + {$IFDEF DBTOOLS} + FInExistingChange: boolean; + + function GetExistingConnectionComboBox: TComboBox; virtual; + procedure ChooseExistingConnection; + function GetConnectionCondition: string; virtual; + {$ENDIF} + + procedure GetServerList(List: TStrings); virtual; + procedure AddServerToList; virtual; + + procedure ShowState(Yellow: boolean = False); virtual; + procedure ConnToControls; virtual; + procedure ControlsToConn; virtual; + procedure FillInfo; virtual; + + procedure DoInit; override; + + function GetComponent: TComponent; override; + procedure SetComponent(Value: TComponent); override; + + public + constructor Create(Owner: TComponent; DADesignUtilsClass: TDADesignUtilsClass); override; + destructor Destroy; override; + + end; + +implementation + +uses + {$IFDEF MSWINDOWS}ShellAPI, HelpUtils,{$ENDIF} + {$IFDEF VER6P}Variants, {$ENDIF} + MemData, + MemUtils; + +{$IFDEF IDE} +{$R *.dfm} +{$ENDIF} +{$IFDEF MSWINDOWS} +{$R DAConnectionEditor.dfm} +{$ENDIF} +{$IFDEF LINUX} +{$R *.xfm} +{$ENDIF} + +{$I DacVer.inc} + +{$IFDEF LINUX} +type + _TMaskEdit = class (TMaskEdit) + end; +{$ENDIF} + +constructor TDAConnectionEditorForm.Create(Owner: TComponent; DADesignUtilsClass: TDADesignUtilsClass); +begin + inherited; + +{$IFDEF MSWINDOWS} + FRegistry := TRegistry.Create; + if not FRegistry.OpenKey('\SOFTWARE\CoreLab\' + FDADesignUtilsClass.GetProjectName + '\Connect', True) then + FreeAndNil(FRegistry); +{$ENDIF} +end; + +destructor TDAConnectionEditorForm.Destroy; +begin +{$IFDEF MSWINDOWS} + FreeAndNil(FRegistry); +{$ENDIF} + inherited; +end; + +procedure TDAConnectionEditorForm.DoInit; +var + IDE: string; +begin + FInDoInit := True; + try + inherited; + + {$IFDEF D3} + IDE := 'Delphi 3'; + {$ENDIF} + {$IFDEF D4} + IDE := 'Delphi 4'; + {$ENDIF} + {$IFDEF D5} + IDE := 'Delphi 5'; + {$ENDIF} + {$IFDEF D6} + IDE := 'Delphi 6'; + {$ENDIF} + {$IFDEF D7} + IDE := 'Delphi 7'; + {$ENDIF} + {$IFDEF D8} + IDE := 'Delphi 8'; + {$ENDIF} + {$IFDEF D9} + IDE := 'Delphi 2005'; + {$ENDIF} + {$IFDEF D10} + IDE := 'Delphi 2006'; + {$ENDIF} + {$IFDEF D11} + IDE := 'Delphi 2007'; + {$ENDIF} + {$IFDEF CB3} + IDE := 'C++Builder 3'; + {$ENDIF} + {$IFDEF CB4} + IDE := 'C++Builder 4'; + {$ENDIF} + {$IFDEF CB5} + IDE := 'C++Builder 5'; + {$ENDIF} + {$IFDEF CB6} + IDE := 'C++Builder 6'; + {$ENDIF} + {$IFDEF LINUX} + IDE := 'Kylix'; + {$ENDIF} + lbVersion.Caption := DACVersion + ' '; + lbIDE.Caption := 'for ' + IDE; + lbIDE.Left := lbVersion.Left + lbVersion.Width; + + + {$IFDEF LINUX} + imPeng.Visible := True; + imPeng.BringToFront; + _TMaskEdit(edPassword).EchoMode := emPassword; + {$ENDIF} + + {$IFDEF DBTOOLS} + if DADesignUtilsClass.DBToolsAvailable then begin + GetDBToolsService(DADesignUtilsClass).GetConnections(GetExistingConnectionComboBox.Items, GetConnectionCondition); + ChooseExistingConnection; + end; + {$ENDIF} + + ConnToControls; + + ShowState; + finally + FInDoInit := False; + end; +end; + +function TDAConnectionEditorForm.GetComponent: TComponent; +begin + Result := FConnection; +end; + +procedure TDAConnectionEditorForm.SetComponent(Value: TComponent); +begin + FConnection := Value as TCustomDAConnection; +end; + +{$IFDEF DBTOOLS} +function TDAConnectionEditorForm.GetExistingConnectionComboBox: TComboBox; +begin + Result := nil; + Assert(False, 'Must be overriden'); +end; + +procedure TDAConnectionEditorForm.ChooseExistingConnection; +begin + if not FInExistingChange and DADesignUtilsClass.DBToolsAvailable then + with GetExistingConnectionComboBox do + ItemIndex := Items.IndexOf(GetDBToolsService(DADesignUtilsClass).FindConnectionName(FConnection)); +end; + +function TDAConnectionEditorForm.GetConnectionCondition: string; +begin + Result := ''; +end; +{$ENDIF} + +procedure TDAConnectionEditorForm.ConnToControls; +begin + edUsername.Text := FConnection.Username; + edPassword.Text := FConnection.Password; + edServer.Text := FConnection.Server; + cbLoginPrompt.Checked := FConnection.LoginPrompt; +end; + +procedure TDAConnectionEditorForm.ControlsToConn; +begin + // all parameters are set in controls OnChange event handlers +end; + +procedure TDAConnectionEditorForm.ShowState(Yellow: boolean); +begin + btDisconnect.Enabled := FConnection.Connected; + + shRed.Brush.Color := clBtnFace; + shYellow.Brush.Color := clBtnFace; + shGreen.Brush.Color := clBtnFace; + + if Yellow then begin + shYellow.Brush.Color := clYellow; + shYellow.Update; + end + else + if FConnection.Connected then begin + shGreen.Brush.Color := clGreen; + shYellow.Update; + end + else + shRed.Brush.Color := clRed; +end; + +procedure TDAConnectionEditorForm.lbWebClick(Sender: TObject); +begin +{$IFDEF MSWINDOWS} + OpenUrl('http://' + lbWeb.Caption); + lbWeb.Font.Color := $FF0000; +{$ENDIF} +end; + +procedure TDAConnectionEditorForm.lbMailClick(Sender: TObject); +begin +{$IFDEF MSWINDOWS} + MailTo(lbMail.Caption); + lbMail.Font.Color := $FF0000; +{$ENDIF} +end; + +procedure TDAConnectionEditorForm.cbLoginPromptClick(Sender: TObject); +begin + FConnection.LoginPrompt := cbLoginPrompt.Checked; +end; + +procedure TDAConnectionEditorForm.lbWebMouseMove(Sender: TObject; + Shift: TShiftState; X, Y: Integer); +begin + lbWeb.Font.Color := $4080FF; +end; + +procedure TDAConnectionEditorForm.lbMailMouseMove(Sender: TObject; + Shift: TShiftState; X, Y: Integer); +begin + lbMail.Font.Color := $4080FF; +end; + +procedure TDAConnectionEditorForm.shAboutMouseMove(Sender: TObject; + Shift: TShiftState; X, Y: Integer); +begin + lbWeb.Font.Color := $FF0000; + lbMail.Font.Color := $FF0000; +end; + +procedure TDAConnectionEditorForm.edUsernameChange(Sender: TObject); +begin + if FInDoInit then + Exit; + + try + FConnection.Username := edUsername.Text; + finally + ShowState; + end; +end; + +procedure TDAConnectionEditorForm.edPasswordChange(Sender: TObject); +begin + if FInDoInit then + Exit; + + try + FConnection.Password := edPassword.Text; + finally + ShowState; + end; +end; + +procedure TDAConnectionEditorForm.edServerChange(Sender: TObject); +begin + if FInDoInit then + Exit; + + try + FConnection.Server := edServer.Text; + finally + ShowState; + end; +end; + +procedure TDAConnectionEditorForm.btConnectClick(Sender: TObject); +begin + ShowState(True); +{$IFDEF DBTOOLS} + ChooseExistingConnection; +{$ENDIF} + StartWait; + try + ControlsToConn; + FConnection.PerformConnect; + if FConnection.Connected then + AddServerToList; + finally + StopWait; + ShowState; + end; + + ModalResult := mrOk; +end; + +procedure TDAConnectionEditorForm.btDisconnectClick(Sender: TObject); +begin +{$IFDEF DBTOOLS} + ChooseExistingConnection; +{$ENDIF} + try + FConnection.Disconnect; + finally + ShowState; + end; +end; + +procedure TDAConnectionEditorForm.edServerDropDown(Sender: TObject); +begin + StartWait; + try + GetServerList(edServer.Items); + finally + StopWait; + end; +end; + +procedure TDAConnectionEditorForm.GetServerList(List: TStrings); +{$IFDEF MSWINDOWS} +var + i: integer; + s: string; + ValueNames: TStringList; +{$ENDIF} +begin + List.Clear; +{$IFDEF MSWINDOWS} + if FRegistry <> nil then begin + ValueNames := TStringList.Create; + try + FRegistry.GetValueNames(ValueNames); + ValueNames.Sort; + for i := 0 to ValueNames.Count - 1 do begin + s := Trim(FRegistry.ReadString(ValueNames[i])); + if (s <> '') and (List.IndexOf(s) = -1) then + List.Add(s); + end; + finally + ValueNames.Free; + end; + end; +{$ENDIF} +end; + +procedure TDAConnectionEditorForm.AddServerToList; +{$IFDEF MSWINDOWS} +var + i: integer; + s: string; + ValueNames, Values: TStringList; +{$ENDIF} +begin +{$IFDEF MSWINDOWS} + if FRegistry <> nil then begin + ValueNames := nil; + Values := nil; + try + ValueNames := TStringList.Create; + Values := TStringList.Create; + + Values.Add(FConnection.Server); // Add current server at first position + + FRegistry.GetValueNames(ValueNames); + ValueNames.Sort; + + for i := 0 to ValueNames.Count - 1 do + if FRegistry.GetDataType(ValueNames[i]) = rdString then begin + s := Trim(FRegistry.ReadString(ValueNames[i])); + if (s <> '') and (Values.IndexOf(s) = -1) then + Values.Add(s); + FRegistry.DeleteValue(ValueNames[i]); // Clear old list + end; + + // Store updated list in registry + for i := 0 to Values.Count - 1 do begin + s := Format('Server %d', [i]); + FRegistry.WriteString(s, Values[i]); + end; + + finally + ValueNames.Free; + Values.Free; + end; + end; +{$ENDIF} +end; + +procedure TDAConnectionEditorForm.FillInfo; +var + OldLoginPrompt: boolean; + +begin + OldLoginPrompt := FConnection.LoginPrompt; + try + FConnection.LoginPrompt := False; + + if not FConnection.Connected then + try + ShowState(True); + FConnection.Connect; + except + on E: Exception do + begin + // PageControl.ActivePage := shConnect; + // Application.ShowException(E); - silent exception. Please see CR MyDAC 3443 + end; + end; + meInfo.Lines.Clear; + finally + FConnection.LoginPrompt := OldLoginPrompt; + ShowState(False); + end; +end; + +procedure TDAConnectionEditorForm.PageControlChange(Sender: TObject); +begin + if PageControl.ActivePage = shInfo then + FillInfo; +end; + +procedure TDAConnectionEditorForm.edServerKeyUp(Sender: TObject; + var Key: Word; Shift: TShiftState); +begin + if Key ={$IFDEF MSWINDOWS}VK_RETURN{$ELSE}KEY_RETURN{$ENDIF} then + edServerChange(Sender); +end; + +procedure TDAConnectionEditorForm.edServerExit(Sender: TObject); +begin +{$IFDEF DBTOOLS} + ChooseExistingConnection; +{$ENDIF} +end; + +end. diff --git a/internal/4.10.0.10/1/Source/Design/DAConnectionEditor.xfm b/internal/4.10.0.10/1/Source/Design/DAConnectionEditor.xfm new file mode 100644 index 0000000..12ef51a --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DAConnectionEditor.xfm @@ -0,0 +1,411 @@ +inherited DAConnectionEditorForm: TDAConnectionEditorForm + Left = 307 + Top = 150 + Width = 450 + Height = 281 + VertScrollBar.Range = 0 + ActiveControl = edUsername + BorderStyle = fbsDialog + Caption = 'DAConnectionEditorForm' + Constraints.MinHeight = 281 + Constraints.MinWidth = 450 + PixelsPerInch = 75 + inherited BtnPanel: TPanel + Top = 256 + Width = 25 + Height = 25 + Align = alNone + TabOrder = 2 + Visible = False + inherited imCorner: TImage + Left = 68 + Top = 13 + end + inherited btOk: TBitBtn + Left = 40 + Top = 16 + end + inherited btCancel: TBitBtn + Left = 40 + Top = 0 + end + end + object PageControl: TPageControl + Left = 8 + Top = 8 + Width = 434 + Height = 232 + ActivePage = shConnect + Anchors = [akLeft, akTop, akRight, akBottom] + TabOrder = 0 + OnChange = PageControlChange + object shConnect: TTabSheet + Caption = 'C&onnect' + object shRed: TShape + Left = 24 + Top = 175 + Width = 15 + Height = 15 + Anchors = [akLeft, akBottom] + Brush.Color = clButton + Pen.Color = clDark + Pen.Width = 0 + Shape = stCircle + end + object shYellow: TShape + Left = 41 + Top = 175 + Width = 15 + Height = 15 + Anchors = [akLeft, akBottom] + Brush.Color = clButton + Enabled = False + Pen.Color = clDark + Pen.Width = 0 + Shape = stCircle + end + object shGreen: TShape + Left = 58 + Top = 175 + Width = 15 + Height = 15 + Anchors = [akLeft, akBottom] + Brush.Color = clButton + Enabled = False + Pen.Color = clDark + Pen.Width = 0 + Shape = stCircle + end + object Panel: TPanel + Left = 8 + Top = 8 + Width = 273 + Height = 150 + Anchors = [akLeft, akTop, akBottom] + BevelInner = bvRaised + BevelOuter = bvLowered + TabOrder = 0 + object lbUsername: TLabel + Left = 16 + Top = 20 + Width = 55 + Height = 20 + Caption = 'Username' + end + object lbPassword: TLabel + Left = 16 + Top = 53 + Width = 54 + Height = 20 + Caption = 'Password' + end + object lbServer: TLabel + Left = 16 + Top = 86 + Width = 37 + Height = 20 + Caption = 'Server' + end + object edServer: TComboBox + Left = 104 + Top = 82 + Width = 153 + Height = 28 + ItemHeight = 22 + TabOrder = 2 + OnChange = edServerChange + OnDropDown = edServerDropDown + OnKeyUp = edServerKeyUp + end + object edUsername: TEdit + Left = 104 + Top = 16 + Width = 153 + Height = 28 + TabOrder = 0 + OnChange = edUsernameChange + end + object edPassword: TMaskEdit + Left = 104 + Top = 49 + Width = 153 + Height = 28 + TabOrder = 1 + OnChange = edPasswordChange + end + end + object btConnect: TButton + Left = 92 + Top = 170 + Width = 89 + Height = 25 + Anchors = [akLeft, akBottom] + Caption = '&Connect' + Default = True + TabOrder = 2 + OnClick = btConnectClick + end + object btDisconnect: TButton + Left = 192 + Top = 170 + Width = 89 + Height = 25 + Anchors = [akLeft, akBottom] + Caption = '&Disconnect' + TabOrder = 3 + OnClick = btDisconnectClick + end + object cbLoginPrompt: TCheckBox + Left = 300 + Top = 8 + Width = 121 + Height = 17 + Caption = '&LoginPrompt' + TabOrder = 1 + OnClick = cbLoginPromptClick + end + end + object shInfo: TTabSheet + Caption = '&Info' + ImageIndex = 1 + object meInfo: TMemo + Left = 8 + Top = 8 + Width = 409 + Height = 185 + Anchors = [akLeft, akTop, akRight, akBottom] + ReadOnly = True + TabOrder = 0 + end + end + object shAbout: TTabSheet + Caption = '&About' + ImageIndex = 2 + OnMouseMove = shAboutMouseMove + object Label1: TLabel + Left = 10 + Top = 6 + Width = 240 + Height = 23 + Caption = 'Data Access Components' + Font.Color = clNavy + Font.Height = 19 + Font.Name = 'Tahoma' + Font.Pitch = fpVariable + Font.Style = [fsBold] + ParentFont = False + end + object Label2: TLabel + Left = 10 + Top = 68 + Width = 38 + Height = 13 + Caption = 'Version ' + end + object lbVersion: TLabel + Left = 56 + Top = 68 + Width = 45 + Height = 13 + Caption = '3.20.0.20' + Font.Color = clNavy + Font.Height = 13 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [] + ParentFont = False + end + object Label3: TLabel + Left = 10 + Top = 92 + Width = 243 + Height = 13 + Caption = 'Copyright '#169' 1997-2007 Core Lab. All right reserved.' + end + object Label5: TLabel + Left = 10 + Top = 116 + Width = 26 + Height = 13 + Caption = 'Web:' + end + object Label6: TLabel + Left = 10 + Top = 140 + Width = 31 + Height = 13 + Caption = 'E-mail:' + end + object lbWeb: TLabel + Left = 56 + Top = 116 + Width = 73 + Height = 13 + Cursor = crHandPoint + Caption = 'www.crlab.com' + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlue + Font.Height = 13 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [fsUnderline] + ParentFont = False + OnClick = lbWebClick + OnMouseMove = lbWebMouseMove + end + object lbMail: TLabel + Left = 56 + Top = 140 + Width = 92 + Height = 13 + Cursor = crHandPoint + Caption = 'support@crlab.com' + Color = clBtnFace + Font.Color = clBlue + Font.Height = 13 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [fsUnderline] + ParentColor = False + ParentFont = False + OnClick = lbMailClick + OnMouseMove = lbMailMouseMove + end + object lbIDE: TLabel + Left = 115 + Top = 68 + Width = 54 + Height = 13 + Caption = 'for Delphi 6' + end + object imPeng: TImage + Left = 376 + Top = 8 + Width = 40 + Height = 48 + Picture.Data = { + 07544269746D6170BA0B0000424DB60B00000000000036040000280000002800 + 000030000000010008000000000080070000120B0000120B0000000100000000 + 000000000000000080000080000000808000800000008000800080800000C0C0 + C000C0DCC000F0CAA6000020400000206000002080000020A0000020C0000020 + E00000400000004020000040400000406000004080000040A0000040C0000040 + E00000600000006020000060400000606000006080000060A0000060C0000060 + E00000800000008020000080400000806000008080000080A0000080C0000080 + E00000A0000000A0200000A0400000A0600000A0800000A0A00000A0C00000A0 + E00000C0000000C0200000C0400000C0600000C0800000C0A00000C0C00000C0 + E00000E0000000E0200000E0400000E0600000E0800000E0A00000E0C00000E0 + E00040000000400020004000400040006000400080004000A0004000C0004000 + E00040200000402020004020400040206000402080004020A0004020C0004020 + E00040400000404020004040400040406000404080004040A0004040C0004040 + E00040600000406020004060400040606000406080004060A0004060C0004060 + E00040800000408020004080400040806000408080004080A0004080C0004080 + E00040A0000040A0200040A0400040A0600040A0800040A0A00040A0C00040A0 + E00040C0000040C0200040C0400040C0600040C0800040C0A00040C0C00040C0 + E00040E0000040E0200040E0400040E0600040E0800040E0A00040E0C00040E0 + E00080000000800020008000400080006000800080008000A0008000C0008000 + E00080200000802020008020400080206000802080008020A0008020C0008020 + E00080400000804020008040400080406000804080008040A0008040C0008040 + E00080600000806020008060400080606000806080008060A0008060C0008060 + E00080800000808020008080400080806000808080008080A0008080C0008080 + E00080A0000080A0200080A0400080A0600080A0800080A0A00080A0C00080A0 + E00080C0000080C0200080C0400080C0600080C0800080C0A00080C0C00080C0 + E00080E0000080E0200080E0400080E0600080E0800080E0A00080E0C00080E0 + E000C0000000C0002000C0004000C0006000C0008000C000A000C000C000C000 + E000C0200000C0202000C0204000C0206000C0208000C020A000C020C000C020 + E000C0400000C0402000C0404000C0406000C0408000C040A000C040C000C040 + E000C0600000C0602000C0604000C0606000C0608000C060A000C060C000C060 + E000C0800000C0802000C0804000C0806000C0808000C080A000C080C000C080 + E000C0A00000C0A02000C0A04000C0A06000C0A08000C0A0A000C0A0C000C0A0 + E000C0C00000C0C02000C0C04000C0C06000C0C08000C0C0A000F0FBFF00A4A0 + A000808080000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00030303030303030303030303030303030303030303030303030303030303 + 0303030303030303030303030303030303030303030303030303030303030303 + 0303030303030364030303030303030303030303030303030303031D1C1D1C13 + 5C03030303030303030303035B1C25251D650303030303030303030303030366 + 2525262F2F2F2F25130A529BA49BA49B9B9B5B5214262F2F2F26666603030303 + 030303032626262F2F3737373737372F250A000000000000000000001C2F3737 + 37372F2F2F030303030303262F373737373737373737372F1D00525B5B524900 + 000000001C2F3737373737372F6F2F03030303032F373737373737373737372F + 6507FFFFFFFFF6079B0000001C2F37373737373737372F2F030303032F373737 + 373737373737372FF6FFFFFFFFFFFFFFFF0749001C2F37373737373737373737 + 2F0303032F3737373737373737373713A4F6FFFFFFFFFFFFFFFFF652132F3737 + 37373737373737372F0303032F3737373737373737371C0000F7FFFFFFFFFFFF + FFFFFF08652F37372F3737373737372F2F0303032F37373737373737372F0000 + 0007FFFFFFFFFFFFFFFFFF08AE2F2F2F2F2F2F3737372F03030303032F373737 + 373737373713000007FFFFFFFFFFFFFFFFFFFF086E2F2F251C1C263737772F03 + 030303032F2F2F2F3737373726005208FFFFFFFFFFFFFFFFFFFFFFF6B737260A + 00000025372F2F03030303030303036F2F37372F005BF6FFFFFFF6FFFFFFFFFF + FFFFFFFFB73726000000000A372F030303030303030303036F3737129BFFFFFF + FFFFF6FFFFFFFFFFFFFFFFFFBF7F6D00000000002F0303030303030303030303 + 531C0A52FFFFFFFFFFF6F6FFFFFFFFFFFFFFFFFFFFFFA4000000004949030303 + 03030303030303030000009BFFFFFFFFFFFFF6FFFFFFFFFFFFFFFFFFFFFFF700 + 0000000000030303030303030303030349004952FFFFFFFFFFFFF6FFFFFFFFFF + FFFFFFFFFFFF0700000000000003030303030303030303039B000052FFFFFFFF + FFFFF6FFFFFFFFFFFFFFFFFFFFFFF70000000000000303030303030303030303 + 0349000008FFFFFFFFFFF6FFFFFFFFFFFFFFFFFFFFFFF7000000000000030303 + 0303030303030303039B0000F7FFFFFFFFFFF6FFFFFFFFFFFFFFFFFFFFFFA400 + 000000005203030303030303030303030303490052FFFFFFFFFFF6FFFFFFFFFF + FFFFFFFFFFFF9B00000000009B03030303030303030303030303520000F7FFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFF6524949000000030303030303030303030303 + 03039B000052F6FFFFFFFFFFFFFFFFFFFFFFFFFFF6F700000000005203030303 + 0303030303030303030303000000F7F6FFFFFFF6FFFFFFFFFFF6F60808520000 + 0000009B0303030303030303030303030303039B00005207F6FFF6F6F6FFFFF6 + 08070707A4000000000049030303030303030303030303030303030349004908 + FFFFFFF6F6FFFFFFF6F6F6080000000000000303030303030303030303030303 + 0303030303000007FFFFFFFFFFFFFFFFFFFFFF07000000000003030303030303 + 030303030303030303030303039B005BFFFFF60808F6FFFFFFFFFFA400000000 + 9B0303030303030303030303030303030303030303039B0007FF07070707F6FF + FFFFF64900000052030303030303030303030303030303030303030303030349 + 490807AD65AD0708FFFFA4000000000303030303030303030303030303030303 + 030303030303030300F76526262666AE0807000052005B030303030303030303 + 0303030303030303030303030303030300652E372F2E262E6E5C00525B000303 + 030303030303030303030303030303030303030303030303122E37377F37372E + 2F1C000000520303030303030303030303030303030303030303030303030303 + 0A263737377F3F3F37250000009B030303030303030303030303030303030303 + 030303030303030349AE2F37377F3F2FB75B0000000303030303030303030303 + 030303030303030303030303030303A49B52122E2E6D65009BF7000000030303 + 0303030303030303030303030303030303030303030303A49B009BA400A4A400 + 520700000003030303030303030303030303030303030303030303030303039B + 5BF7079B00A4F65B07A400000003030303030303030303030303030303030303 + 030303030303035B0007F7000000F70807490000000303030303030303030303 + 0303030303030303030303030303039B00000000000000525200000000030303 + 0303030303030303030303030303030303030303030303030000000000000000 + 0000000052030303030303030303030303030303030303030303030303030303 + 0000000000000000000000009B03030303030303030303030303030303030303 + 030303030303030300000000000000005B520000030303030303030303030303 + 0303030303030303030303030303030303000000000000005B49000303030303 + 030303030303030303030303030303030303030303030303035B000000000000 + 0049030303030303030303030303030303030303030303030303030303030303 + 0303035B49000052030303030303030303030303030303030303030303030303 + 0303030303030303030303030303030303030303030303030303030303030303 + 0303} + Transparent = True + Visible = False + end + object lbEdition: TLabel + Left = 23 + Top = 31 + Width = 104 + Height = 18 + Caption = 'Standard Edition' + Font.Color = clNavy + Font.Height = 15 + Font.Name = 'Tahoma' + Font.Pitch = fpVariable + Font.Style = [] + ParentFont = False + end + end + end + object btClose: TButton + Left = 366 + Top = 249 + Width = 75 + Height = 25 + Anchors = [akRight, akBottom] + Cancel = True + Caption = 'Close' + TabOrder = 1 + OnClick = SaveClick + end +end diff --git a/internal/4.10.0.10/1/Source/Design/DADataEditor.dfm b/internal/4.10.0.10/1/Source/Design/DADataEditor.dfm new file mode 100644 index 0000000..15a0ad5 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DADataEditor.dfm @@ -0,0 +1,45 @@ +inherited DADataEditorForm: TDADataEditorForm + Caption = 'DADataEditorForm' + PixelsPerInch = 96 + TextHeight = 13 + inherited pnlToolBar: TPanel + inherited btClose: TSpeedButton + OnClick = btCloseClick + end + object btOpen: TSpeedButton [1] + Left = 0 + Top = 0 + Width = 75 + Height = 23 + Caption = '&Open' + OnClick = btOpenClick + end + object btnExit: TSpeedButton [2] + Left = 233 + Top = 0 + Width = 75 + Height = 23 + Caption = 'Exit' + OnClick = CloseClick + end + object btSaveToFile: TSpeedButton [3] + Left = 154 + Top = 0 + Width = 75 + Height = 23 + Caption = '&Save to file' + OnClick = btSaveToFileClick + end + inherited DBNavigator: TDBNavigator + Left = 336 + Hints.Strings = () + end + end + object SaveDialog: TSaveDialog + DefaultExt = 'xml' + FileName = 'Data1.xml' + Filter = 'XML (*.xml)|*.xml|Any File (*.*)|*.*' + Left = 384 + Top = 34 + end +end diff --git a/internal/4.10.0.10/1/Source/Design/DADataEditor.pas b/internal/4.10.0.10/1/Source/Design/DADataEditor.pas new file mode 100644 index 0000000..82c0096 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DADataEditor.pas @@ -0,0 +1,137 @@ +////////////////////////////////////////////////// +// DB Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +// Base Component Editor +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I Dac.inc} + +unit DADataEditor; +{$ENDIF} + +interface +uses +{$IFDEF MSWINDOWS} + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, DBGrids, Dialogs, + StdCtrls, ExtCtrls, Buttons, ComCtrls, Grids, DBCtrls, +{$ENDIF} +{$IFDEF LINUX} + SysUtils, Types, Classes, QGraphics, QControls, QForms, QDBGrids, QDialogs, QStdCtrls, + QExtCtrls, QButtons, QDBCtrls, QComCtrls, QGrids, +{$ENDIF} + DB, CRDataEditor, DBAccess, DADesignUtils; + +type + TDADataEditorForm = class(TCRDataEditorForm) + btOpen: TSpeedButton; + btnExit: TSpeedButton; + btSaveToFile: TSpeedButton; + SaveDialog: TSaveDialog; + procedure btOpenClick(Sender: TObject); + procedure btCloseClick(Sender: TObject); + procedure btSaveToFileClick(Sender: TObject); + private + // fields to store old DataSet properties + FOldAutoCommit: boolean; + FOldFilterOptions: TFilterOptions; + FOldFilterSQL: string; + FOldSQL: string; + FOldActive: boolean; + FOldFilter: string; + FOldFiltered: boolean; + protected + procedure DoInit; override; + procedure DoSave; override; + procedure DoFinish; override; + end; + +implementation + +{$IFDEF IDE} +{$R *.dfm} +{$ENDIF} +{$IFDEF MSWINDOWS} +{$R DADataEditor.dfm} +{$ENDIF} +{$IFDEF LINUX} +{$R *.xfm} +{$ENDIF} + +uses +{$IFDEF CLR} + Variants, +{$ENDIF} + TypInfo; + +{ TDADataEditorForm } + +procedure TDADataEditorForm.DoInit; +begin + inherited; + + FOldAutoCommit := TDBAccessUtils.GetAutoCommit(TCustomDADataSet(FDataSet)); + FOldFilterOptions := TCustomDADataSet(FDataSet).FilterOptions; + FOldFilterSQL := TCustomDADataSet(FDataSet).FilterSQL; + FOldSQL := TCustomDADataSet(FDataSet).SQL.Text; + FOldActive := FDataSet.Active; + TDBAccessUtils.SetAutoCommit(TCustomDADataSet(FDataSet), True); + FOldFilter := FDataSet.Filter; + FOldFiltered := FDataSet.Filtered; + FOldActive := FDataSet.Active; + try + FDataSet.Open; + except + Application.HandleException(Self); + end; + btOpen.Enabled := not FDataSet.Active; + btClose.Enabled := FDataSet.Active; +end; + +procedure TDADataEditorForm.DoSave; +begin +end; + +procedure TDADataEditorForm.DoFinish; +begin + TDBAccessUtils.SetAutoCommit(TCustomDADataSet(FDataSet), FOldAutoCommit); + TCustomDADataSet(FDataSet).FilterOptions := FOldFilterOptions; + TCustomDADataSet(FDataSet).FilterSQL := FOldFilterSQL; + if TCustomDADataSet(FDataSet).SQL.Text <> FOldSQL then + TCustomDADataSet(FDataSet).SQL.Text := FOldSQL; + FDataSet.Filter := FOldFilter; + FDataSet.Filtered := FOldFiltered; + FDataSet.Active := FOldActive; + + inherited; +end; + +procedure TDADataEditorForm.btOpenClick(Sender: TObject); +begin + FDataSet.Open; + btOpen.Enabled := not FDataSet.Active; + btClose.Enabled := FDataSet.Active; +end; + +procedure TDADataEditorForm.btCloseClick(Sender: TObject); +begin + FDataSet.Close; + btOpen.Enabled := not FDataSet.Active; + btClose.Enabled := FDataSet.Active; +end; + +procedure TDADataEditorForm.btSaveToFileClick(Sender: TObject); +begin + if SaveDialog.Execute then + FDataSet.SaveToXML(SaveDialog.FileName); +end; + +{$IFDEF CLR} + +initialization + + RegisterClass(TDBGrid); +{$ENDIF} + +end. diff --git a/internal/4.10.0.10/1/Source/Design/DADataEditor.xfm b/internal/4.10.0.10/1/Source/Design/DADataEditor.xfm new file mode 100644 index 0000000..baba82f --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DADataEditor.xfm @@ -0,0 +1,45 @@ +inherited DADataEditorForm: TDADataEditorForm + Caption = 'DADataEditorForm' + PixelsPerInch = 96 + TextHeight = 13 + inherited pnlToolBar: TPanel + inherited btClose: TSpeedButton + OnClick = btCloseClick + end + object btOpen: TSpeedButton [1] + Left = 0 + Top = 0 + Width = 75 + Height = 23 + Caption = '&Open' + OnClick = btOpenClick + end + object btnExit: TSpeedButton [2] + Left = 233 + Top = 0 + Width = 75 + Height = 23 + Caption = 'Exit' + OnClick = CloseClick + end + object btSaveToFile: TSpeedButton [3] + Left = 154 + Top = 0 + Width = 75 + Height = 23 + Caption = '&Save to file' + OnClick = btSaveToFileClick + end + inherited DBNavigator: TDBNavigator + Left = 240 + Hints.Strings = () + end + end + object SaveDialog: TSaveDialog + DefaultExt = 'xml' + FileName = 'Data1.xml' + Filter = 'XML (*.xml)|*.xml|Any File (*.*)|*.*' + Left = 384 + Top = 34 + end +end diff --git a/internal/4.10.0.10/1/Source/Design/DADesign.pas b/internal/4.10.0.10/1/Source/Design/DADesign.pas new file mode 100644 index 0000000..2605b79 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DADesign.pas @@ -0,0 +1,2015 @@ + +////////////////////////////////////////////////// +// DB Access Components +// Copyright @ 1998-2007 Core Lab. All right reserved. +// DADesign +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I Dac.inc} + +unit DADesign; +{$ENDIF} +interface + +uses +{$IFDEF MSWINDOWS} + Windows, Messages, Graphics, Controls, Forms, Dialogs, + Registry, StdCtrls, +{$IFDEF CLR} + Borland.Vcl.Design.DesignEditors, Borland.Vcl.Design.DesignIntf, + Borland.Vcl.Design.FldLinks, + System.Runtime.InteropServices, +{$ELSE} + {$IFDEF VER6P}DesignIntf, DesignEditors,{$ELSE}DsgnIntf,{$ENDIF} + {$IFNDEF BCB}{$IFDEF VER5P}FldLinks, {$ENDIF}ColnEdit, {$ELSE}CRFldLinks,{$ENDIF} +{$ENDIF} +{$ENDIF} +{$IFDEF LINUX} + Types, QGraphics, QControls, QForms, QDialogs, QStdCtrls, + DesignIntf, DesignEditors, CRFldLinks, +{$ENDIF} +{$IFDEF DBTOOLS} + Menus, + {$IFDEF CLR}Borland.Vcl.Design.DesignMenus{$ELSE}DesignMenus{$ENDIF}, + DBToolsIntf, + DBToolsClient, +{$ENDIF} + SysUtils, Classes, TypInfo, DBAccess, DAScript, DALoader, DADump, + CRFrame, CREditor, DADesignUtils, CRParser; + + procedure ConvertToClass(Designer:{$IFDEF VER6P}IDesigner{$ELSE}IFormDesigner{$ENDIF}; Component: TComponent; NewClass: TComponentClass); + +{ ------------ DAC property editors ----------- } +type + TDAFieldsEditor = class (TPropertyEditor) + public + function GetAttributes: TPropertyAttributes; override; + function GetValue: string; override; + procedure Edit; override; + end; + + TDAPropertyEditor = class (TPropertyEditor) + public + function GetAttributes: TPropertyAttributes; override; + function GetValue: string; override; + procedure Edit; override; + end; + + TDAPasswordProperty = class(TStringProperty) + protected + FActivated: boolean; +{$IFNDEF CLR} + public +{$ENDIF} + procedure Initialize; override; +{$IFDEF CLR} + public +{$ENDIF} + procedure Activate; override; + function GetValue: string; override; + end; + + TDATableNameEditor = class (TStringProperty) + public + function GetAttributes: TPropertyAttributes; override; + procedure GetValues(Proc: TGetStrProc); override; + function AutoFill: boolean; override; + end; + + TDAUpdatingTableEditor = class (TStringProperty) + public + function GetAttributes: TPropertyAttributes; override; + procedure GetValues(Proc: TGetStrProc); override; + end; + + TDADatabaseNameEditor = class (TStringProperty) + public + function GetAttributes: TPropertyAttributes; override; + procedure GetValues(Proc: TGetStrProc); override; + function AutoFill: boolean; override; + end; + + TDASPNameEditor = class (TStringProperty) + public + function GetAttributes: TPropertyAttributes; override; + procedure GetValues(Proc: TGetStrProc); override; + function AutoFill: boolean; override; + end; + + TDAFieldDefsListEditor = class (TStringProperty) // TDATableOrderFieldsEditor + public + function GetAttributes: TPropertyAttributes; override; + procedure GetValues(Proc: TGetStrProc); override; + function AutoFill: boolean; override; + end; + + TDAFieldsListEditor = class (TStringProperty) // TDADataSetIndexFieldNamesEditor + public + function GetAttributes: TPropertyAttributes; override; + procedure GetValues(Proc: TGetStrProc); override; + function AutoFill: boolean; override; + end; + + TDALoaderTableNameEditor = class (TStringProperty) + public + function GetAttributes: TPropertyAttributes; override; + procedure GetValues(Proc: TGetStrProc); override; + function AutoFill: boolean; override; + end; + +{$IFDEF LINUX} + TDADataSetMasterFieldsEditor = class (TCRFieldLinkProperty) +{$ELSE} +{$IFDEF BCB} + TDADataSetMasterFieldsEditor = class (TCRFieldLinkProperty) +{$ELSE} + TDADataSetMasterFieldsEditor = class (TFieldLinkProperty) +{$ENDIF} +{$ENDIF} + protected + function GetMasterFields: string; override; + procedure SetMasterFields(const Value: string); override; + function GetIndexFieldNames: string; override; + procedure SetIndexFieldNames(const Value: string); override; + end; + + TVariantEditor = class (TStringProperty) + public + function GetAttributes: TPropertyAttributes; override; + function GetValue: string; override; + procedure SetValue(const Value: string); override; + end; + + TDADatasetOrSQLProperty = class(TComponentProperty) + private + FCheckProc: TGetStrProc; + procedure CheckComponent(const Value: string); + public + procedure GetValues(Proc: TGetStrProc); override; + end; + + TDAUpdateSQLProperty = class(TComponentProperty) + private + FCheckProc: TGetStrProc; + procedure CheckComponent(const Value: string); + public + procedure GetValues(Proc: TGetStrProc); override; + end; + + TCustomDAConnectionClass = class of TCustomDAConnection; + + TDAConnectionList = class + private + procedure ListBoxDblClick(Sender: TObject); + procedure ListBoxKeyPress(Sender: TObject; var Key: Char); + {$IFDEF CLR} + procedure FormShow(Sender: TObject); + {$ENDIF} + + protected + Items: TStrings; + Form: TForm; + {$IFDEF CLR} + FormLeft: integer; + FormTop: integer; + {$ENDIF} + + procedure StrProc(const S: string); + function GetConnectionType: TCustomDAConnectionClass; virtual; abstract; + public + constructor Create; + destructor Destroy; override; + + function GetConnection(Component: TComponent; Designer: {$IFDEF VER6P}IDesigner{$ELSE}IFormDesigner{$ENDIF}): TCustomDAConnection; + end; + +{$IFDEF VER6P} + + TDAConnectionListClass = class of TDAConnectionList; + + TDADesignNotification = class(TInterfacedObject, IDesignNotification) + protected + FItem: TPersistent; + FConnectionList: TDAConnectionList; + DSItems: TStrings; + procedure StrProc(const S: string); + procedure DSStrProc(const S: string); + public + procedure ItemDeleted(const ADesigner: IDesigner; AItem: TPersistent); virtual; + //overide this method on Product level and add all product specific classess + procedure ItemInserted(const ADesigner: IDesigner; AItem: TPersistent); virtual; abstract; + procedure ItemsModified(const ADesigner: IDesigner); virtual; + procedure SelectionChanged(const ADesigner: IDesigner; + const ASelection: IDesignerSelections); virtual; + procedure DesignerOpened(const ADesigner: IDesigner + {$IFNDEF K1}; AResurrecting: Boolean{$ENDIF}); virtual; + procedure DesignerClosed(const ADesigner: IDesigner + {$IFNDEF K1}; AGoingDormant: Boolean{$ENDIF}); virtual; + + function CreateConnectionList: TDAConnectionList; virtual; abstract; + function GetConnectionPropertyName: string; virtual; abstract; + end; +{$ENDIF} + +{ ------------ DAC component editors ----------- } +type + TVerbMethod = procedure of object; + TVerb = record + Caption: string; + Method: TVerbMethod; + end; + TVerbs = array of TVerb; + + TDAComponentEditorClass = class of TDAComponentEditor; + TDAComponentEditor = class (TComponentEditor) + protected + FCREditorClass: TCREditorClass; + FDADesignUtilsClass: TDADesignUtilsClass; + + FVerbs: TVerbs; + {$IFDEF DBTOOLS} + FDBToolsVerbs: TDBToolsVerbs; + FDBToolsSingleVerb: TDBToolsVerb; + FDBToolsVerbIndex: integer; + {$ENDIF} + function AddVerb(const Caption: string; Method: TVerbMethod): integer; overload; + function AddVerb(const Caption: string; CREditorClass: TCREditorClass; DADesignUtilsClass: TDADesignUtilsClass): integer; overload; + procedure InitVerbs; virtual; + + procedure ShowEditor; overload; + procedure ShowEditor(const InitialProperty: string); overload; + {$IFDEF DBTOOLS} + procedure AddDBToolsVerbs(Verbs: TDBToolsVerbs); + procedure DBToolsMenuExecute; + {$ENDIF} + public + constructor Create(AComponent: TComponent; ADesigner: {$IFDEF VER6P}IDesigner{$ELSE}IFormDesigner{$ENDIF}); override; + + function GetVerbCount: integer; override; + function GetVerb(Index: integer): string; override; + procedure ExecuteVerb(Index: integer); override; + procedure Edit; override; + {$IFDEF DBTOOLS} + procedure PrepareItem(Index: integer; const AItem: IMenuItem); override; + {$ENDIF} + end; + + TDAConnectionEditor = class(TDAComponentEditor); + + TDASQLEditor = class(TDAComponentEditor); + + TDAScriptEditor = class(TDAComponentEditor); + + TDAUpdateSQLEditor = class(TDAComponentEditor); + + TDADataSetEditor = class(TDAComponentEditor) + private +{$IFDEF MSWINDOWS} +{$IFNDEF VER8} + procedure ExecuteDsmAction(const ProcName: string); + procedure DsmCreateDefaultControl; + procedure DsmShowInDataSetManager; + procedure Separator; +{$ENDIF} +{$ENDIF} + protected + procedure ShowFieldsEditor; + procedure ShowDataEditor; +{$IFDEF MSWINDOWS} +{$IFNDEF VER8} + procedure InitVerbs; override; +{$ENDIF} +{$ENDIF} + end; + + TDALoaderEditor = class(TDAComponentEditor) + protected + procedure InitVerbs; override; + procedure ShowColEditor; + procedure CreateColumns; + end; + +{$IFDEF MSWINDOWS} + TDASQLMonitorEditor = class (TDAComponentEditor) + protected + procedure RunDBMonitor; + procedure RunSQLMonitor; + procedure InitVerbs; override; + public + procedure Edit; override; + end; +{$ENDIF} + + TCRDataSourceEditor = class(TDAComponentEditor) + private + Items: TStrings; + FFirstProp: {$IFDEF VER6P}IProperty{$ELSE}TPropertyEditor{$ENDIF}; + procedure StrProc(const S: string); + procedure ConvertToDataSource; + procedure CheckEdit({$IFDEF VER6P}const Prop: IProperty{$ELSE}Prop: TPropertyEditor{$ENDIF}); + protected + procedure InitVerbs; override; + public + constructor Create(Component: TComponent; aDesigner: {$IFDEF VER6P}IDesigner{$ELSE}IFormDesigner{$ENDIF}); override; + procedure Edit; override; + end; + + TDesignMacros = class(TMacros) + protected + function GetMacroValue(Macro: TMacro): string; override; + public + procedure Scan(var SQL: string); reintroduce; + end; + +procedure Register; +procedure DARegisterComponentEditor(ComponentClass: TComponentClass; ComponentEditor: TDAComponentEditorClass; + CREditorClass: TCREditorClass; + DADesignUtilsClass: TDADesignUtilsClass); +procedure ShowEditor( + CREditorClass: TCREditorClass; + DADesignUtilsClass: TDADesignUtilsClass; + Component: TComponent; + Designer:{$IFDEF VER6P}IDesigner{$ELSE}IFormDesigner{$ENDIF}; + InitialProperty: string = '' +); + +implementation + +uses +{$IFDEF CLR} + Borland.Studio.ToolsAPI, Borland.VCL.Design.DSDesign, Borland.Vcl.Design.ColnEdit, + MemUtils, +{$ELSE} + ToolsAPI, +{$IFNDEF BCB} +{$IFNDEF LINUX} + DSDesign, +{$ENDIF} +{$ENDIF} +{$ENDIF} +{$IFDEF VER6P} + Variants, +{$ENDIF} +{$IFDEF MSWINDOWS} + DBMonitorClient, DASQLMonitor, ShellAPI, +{$ENDIF} +{$IFDEF DBTOOLS} + Download, +{$ENDIF} + DB, CRAccess, + DAConnectionEditor, DATableEditor, DAQueryEditor, DASQLEditor, DADataEditor, CRTabEditor, + DAStoredProcEditor, DAScriptEditor, DADumpEditor, + DAParamsFrame, DAMacrosFrame, DAConsts; + +type + TDAComponentInfo = record + ComponentClass: TComponentClass; + ComponentEditor: TDAComponentEditorClass; + CREditorClass: TCREditorClass; + DADesignUtilsClass: TDADesignUtilsClass + end; + +var + ComponentsInfo: array of TDAComponentInfo; + NotificationActive: boolean; + +procedure DARegisterComponentEditor(ComponentClass: TComponentClass; ComponentEditor: TDAComponentEditorClass; + CREditorClass: TCREditorClass; + DADesignUtilsClass: TDADesignUtilsClass); +var + i: integer; +begin + RegisterComponentEditor(ComponentClass, ComponentEditor); + i := Length(ComponentsInfo); + SetLength(ComponentsInfo, i + 1); + ComponentsInfo[i].ComponentClass := ComponentClass; + ComponentsInfo[i].ComponentEditor := ComponentEditor; + ComponentsInfo[i].CREditorClass := CREditorClass; + ComponentsInfo[i].DADesignUtilsClass := DADesignUtilsClass; +end; + +procedure ConvertToClass(Designer:{$IFDEF VER6P}IDesigner{$ELSE}IFormDesigner{$ENDIF}; Component: TComponent; NewClass: TComponentClass); +type + TPropData = record + Component: TComponent; + PropInfo: PPropInfo; + end; +var + AName: string; + NewComponent: TComponent; + DesignInfo: Longint; + Instance: TComponent; + + FreeNotifies: TList; + i, j, PropCount: integer; +{$IFDEF CLR} + PropList: TPropList; +{$ELSE} + PropList: PPropList; +{$ENDIF} + Refs: array of TPropData; + l: integer; + + Root: TComponent; + OldNotificationActive: boolean; +begin + DesignInfo := Component.DesignInfo; + OldNotificationActive := NotificationActive; + try + NotificationActive := False; + NewComponent := Designer.CreateComponent(NewClass, Component.Owner, + Word(DesignInfo {$IFDEF CLR}shr 16{$ENDIF}), Word(DesignInfo {$IFNDEF CLR}shr 16{$ENDIF}), 28, 28); + finally + NotificationActive := OldNotificationActive; + end; + AName := Component.Name; + Component.Name := 'CRTemp_' + AName; + FreeNotifies := TList.Create; + try +{$IFDEF VER6P} + Root := Designer.Root; +{$ELSE} + Root := Designer.ContainerWindow; +{$ENDIF} + for i := 0 to Root.ComponentCount - 1 do begin + FreeNotifies.Add(Root.Components[i]); + end; + for i := 0 to FreeNotifies.Count - 1 do begin + Instance := TComponent(FreeNotifies[i]); + {$IFDEF CLR} + PropList := GetPropList(Instance.ClassInfo, [tkClass]{$IFNDEF CLR}, nil{$IFDEF VER6P}, False{$ENDIF}{$ENDIF}); + PropCount := Length(PropList); + if PropCount > 0 then begin + {$ELSE} + PropCount := GetPropList(Instance.ClassInfo, [tkClass]{$IFNDEF CLR}, nil{$IFDEF VER6P}, False{$ENDIF}{$ENDIF}); + if PropCount > 0 then begin + GetMem(PropList, PropCount * SizeOf(PropList[0])); + try + GetPropList(Instance.ClassInfo, [tkClass]{$IFNDEF CLR}, PropList{$IFDEF VER6P}, False{$ENDIF}{$ENDIF}); + {$ENDIF} + for j := 0 to PropCount - 1 do begin + if (PropList[j].PropType <> nil) and + ({$IFDEF CLR}KindOf(PropList[j].PropType){$ELSE}PropList[j].PropType^.Kind{$ENDIF}= tkClass) + and (TComponent(GetObjectProp(Instance, PropList[j])) = Component) + then begin + l := Length(Refs); + SetLength(Refs, l + 1); + Refs[l].Component := Instance; + Refs[l].PropInfo := PropList[j]; + end; + end; + {$IFNDEF CLR} + finally + FreeMem(PropList); + end; + end; + {$ELSE} + end; + {$ENDIF} + end; + finally + FreeNotifies.Free; + end; + NewComponent.Assign(Component); + for i := 0 to Length(Refs) - 1 do begin + SetObjectProp(Refs[i].Component, Refs[i].PropInfo, NewComponent); + end; + Component.Free; + NewComponent.Name := AName; + Designer.Modified; +end; + +type +{$IFDEF LINUX} + {$DEFINE OLDDESIGNER} +{$ENDIF} +{$IFDEF BCB} + {$DEFINE OLDDESIGNER} +{$ENDIF} + +{$IFDEF OLDDESIGNER} + TDADSDesigner = class (TDataSetDesigner) + private + FFieldsEditor: TForm; // TFieldsEditor; // WAR For support TDSDesigner + public + constructor Create(DataSet: TDataSet); + destructor Destroy; override; + property FieldsEditor: TForm read FFieldsEditor; + end; +{$ELSE} + TDADSDesigner = TDSDesigner; +{$ENDIF} + +{$IFDEF OLDDESIGNER} +var + DataSetEditorClass: TComponentEditorClass; + + +{ TOraDSDesigner } +constructor TDADSDesigner.Create(DataSet: TDataSet); +begin + inherited Create(DataSet); + + FFieldsEditor := nil; +end; + +destructor TDADSDesigner.Destroy; +begin + inherited; +end; +{$ENDIF} + +procedure ShowEditor( + CREditorClass: TCREditorClass; + DADesignUtilsClass: TDADesignUtilsClass; + Component: TComponent; + Designer:{$IFDEF VER6P}IDesigner{$ELSE}IFormDesigner{$ENDIF}; + InitialProperty: string = '' +); +var + CREditor: TCREditorForm; +begin + Assert(CREditorClass <> nil); + CREditor := CREditorClass.Create(nil, DADesignUtilsClass); + try + CREditor.Component := Component; + TCREditorForm(CREditor).InitialProperty := InitialProperty; + if CREditor.ShowModal = mrOk then + if Designer <> nil then + Designer.Modified; + finally + CREditor.Free; + end; +end; + +{ TDAFieldsEditor } + +function TDAFieldsEditor.GetAttributes: TPropertyAttributes; +begin + Result := [paDialog, paReadOnly]; +end; + +function TDAFieldsEditor.GetValue: string; +begin + Result := '(' + DB.TFields.ClassName + ')'; +end; + +procedure TDAFieldsEditor.Edit; +var + NeedCreate: boolean; + DADSDesigner: TDADSDesigner; + Component: TComponent; +{$IFDEF OLDDESIGNER} + DataSetEditor: TComponentEditor; +{$ENDIF} +begin + Component := TComponent(GetComponent(0)); + + if (Component as TDataSet).Designer = nil then + NeedCreate := True + else + if (Component as TDataSet).Designer is TDADSDesigner then begin + (Component as TDataSet).Designer.Free; + NeedCreate := True; + end + else + NeedCreate := False; + + if NeedCreate then begin + {$IFDEF OLDDESIGNER} + DataSetEditor := DataSetEditorClass.Create(Component, Designer) as TComponentEditor; + try + DataSetEditor.ExecuteVerb(0); + finally + DataSetEditor.Free; + end; + {$ELSE} + {$IFDEF CLR}Borland.VCL.Design.{$ENDIF}DSDesign.ShowFieldsEditor(Designer, TDataSet(Component), TDSDesigner); + {$ENDIF} + end + else begin + DADSDesigner := TDADSDesigner((Component as TDataSet).Designer); + DADSDesigner.FieldsEditor.Show; + end; +end; + +{ TDAPropertyEditor } + +function TDAPropertyEditor.GetAttributes: TPropertyAttributes; +begin + Result := [paDialog, paReadOnly]; +end; + +function TDAPropertyEditor.GetValue: string; +var +{$IFDEF CLR} + PropInfo: TPropInfo; +{$ELSE} + PropInfo: PPropInfo; +{$ENDIF} + Obj: TPersistent; +begin + Obj := nil; + PropInfo := GetPropInfo; + if (PropInfo <> nil) and (PropInfo.PropType{$IFNDEF CLR}^{$ENDIF}.Kind = tkClass) then begin + {$IFDEF CLR} + Obj := GetObjectProp(GetComponent(0), PropInfo) as TPersistent; + {$ELSE} + Obj := TPersistent(integer(GetPropValue(GetComponent(0), GetName))); + {$ENDIF} + end; + if Obj <> nil then + Result := '(' + GetPropType.Name + ')' // CR 19906 S + else + Result := inherited GetValue; +end; + +procedure TDAPropertyEditor.Edit; +var + Component: TComponent; + i: integer; +begin + Component := GetComponent(0) as TComponent; + + for i := 0 to Length(ComponentsInfo) - 1 do + if Component is ComponentsInfo[i].ComponentClass then begin + ShowEditor(ComponentsInfo[i].CREditorClass, ComponentsInfo[i].DADesignUtilsClass, Component, Designer, GetName); + Exit; + end; + Assert(False); +end; + +{ TDAPasswordProperty } + +procedure TDAPasswordProperty.Initialize; +begin + inherited; + + FActivated := False; +end; + +function TDAPasswordProperty.GetValue: string; +var + i: Integer; +begin + Result := inherited GetValue; + if not FActivated then begin + for i := 1 to Length(Result) do + Result[i] := '*'; + end + else + FActivated := False; +end; + +procedure TDAPasswordProperty.Activate; +begin + inherited; + + FActivated := True; +end; + +{ TDATableNameEditor } + +function TDATableNameEditor.GetAttributes: TPropertyAttributes; +begin + Result := [paValueList]; +end; + +function TDATableNameEditor.AutoFill: boolean; +begin + Result := False; +end; + +procedure TDATableNameEditor.GetValues(Proc: TGetStrProc); +var + List: TStringList; + i: integer; + Component: TComponent; + UsedConnection: TCustomDAConnection; +begin + Assert(PropCount > 0, 'PropCount = 0'); + Component := GetComponent(0) as TComponent; + Assert(Component is TCustomDADataSet, Component.ClassName); + + UsedConnection := TDBAccessUtils.UsedConnection(TCustomDADataSet(Component)); + if UsedConnection = nil then + Exit; + + List := TStringList.Create; + try + UsedConnection.GetTableNames(List); + // List.Sort; + for i := 0 to List.Count - 1 do + Proc(List[i]); + finally + List.Free; + end; +end; + +{ TDAUpdatingTableEditor } + +function TDAUpdatingTableEditor.GetAttributes: TPropertyAttributes; +begin + Result := [paValueList]; +end; + +procedure TDAUpdatingTableEditor.GetValues(Proc: TGetStrProc); +var + Component: TComponent; + DataSet: TCustomDADataset; + TablesInfo: TCRTablesInfo; + UsedConnection: TCustomDAConnection; + + i: integer; + OldSQL: string; + OldActive: boolean; + +begin + Component := TComponent(GetComponent(0)); + DataSet := Component as TCustomDADataset; + + if (DataSet = nil) then + Exit; + UsedConnection := TDBAccessUtils.UsedConnection(DataSet); + if (UsedConnection = nil) or not UsedConnection.Connected then + Exit; + + OldSQL := DataSet.SQL.text; + OldActive := DataSet.Active; + try + TablesInfo := TDBAccessUtils.GetTablesInfo(DataSet); + try + if TablesInfo.Count = 0 then begin + DataSet.AddWhere('0=1'); + DataSet.Active := True; + TablesInfo := TDBAccessUtils.GetTablesInfo(DataSet); + end; + + for i := 0 to TablesInfo.Count - 1 do + Proc(TablesInfo[i].TableName); + except + end; + + finally + if DataSet.SQL.Text <> OldSQL then + DataSet.SQL.Text := OldSQL; + + if DataSet.Active <> OldActive then + DataSet.Active := OldActive; + end; +end; + +{ TDADatabaseNameEditor } + +function TDADatabaseNameEditor.GetAttributes: TPropertyAttributes; +begin + Result := [paValueList]; +end; + +function TDADatabaseNameEditor.AutoFill: boolean; +begin + Result := False; +end; + +procedure TDADatabaseNameEditor.GetValues(Proc: TGetStrProc); +var + List: TStringList; + i: integer; + Component: TComponent; +begin + Assert(PropCount > 0, 'PropCount = 0'); + Component := GetComponent(0) as TComponent; + Assert(Component is TCustomDAConnection, Component.ClassName); + + List := TStringList.Create; + try + TCustomDAConnection(Component).GetDatabaseNames(List); + List.Sort; + for i := 0 to List.Count - 1 do + Proc(List[i]); + finally + List.Free; + end; +end; + +{ TDASPNameEditor } + +function TDASPNameEditor.GetAttributes: TPropertyAttributes; +begin + Result := [paValueList]; +end; + +function TDASPNameEditor.AutoFill: boolean; +begin + Result := False; +end; + +procedure TDASPNameEditor.GetValues(Proc: TGetStrProc); +var + List: TStringList; + i: integer; + Component: TComponent; + UsedConnection: TCustomDAConnection; +begin + Assert(PropCount > 0, 'PropCount = 0'); + Component := GetComponent(0) as TComponent; + Assert(Component is TCustomDADataSet, Component.ClassName); + + UsedConnection := TDBAccessUtils.UsedConnection(TCustomDADataSet(Component)); + if UsedConnection = nil then + Exit; + + List := TStringList.Create; + try + UsedConnection.GetStoredProcNames(List); + List.Sort; + for i := 0 to List.Count - 1 do + Proc(List[i]); + finally + List.Free; + end; +end; + +{ TDAFieldDefsListEditor } + +function TDAFieldDefsListEditor.GetAttributes: TPropertyAttributes; +begin + Result := [paValueList]; +end; + +function TDAFieldDefsListEditor.AutoFill: boolean; +begin + Result := False; +end; + +procedure TDAFieldDefsListEditor.GetValues(Proc: TGetStrProc); +var + i: integer; + Component: TComponent; + Table: TCustomDADataSet; + DataSetUtils: TDADataSetUtils; +begin + Assert(PropCount > 0, 'PropCount = 0'); + Component := GetComponent(0) as TComponent; + Assert(Component is TCustomDADataSet, Component.ClassName); + + DataSetUtils := TDADataSetUtils.Create; + try + Table := TCustomDADataSet(GetComponent(0)); + DataSetUtils.QuickOpen(Table); + + for i := 0 to Table.FieldDefs.Count - 1 do + Proc(Table.FieldDefs[i].Name); + + finally + DataSetUtils.Restore(True); + DataSetUtils.Free; + end; +end; + +{ TDAFieldsListEditor } + +function TDAFieldsListEditor.GetAttributes: TPropertyAttributes; +begin + Result := [paValueList]; +end; + +function TDAFieldsListEditor.AutoFill: boolean; +begin + Result := False; +end; + +procedure TDAFieldsListEditor.GetValues(Proc: TGetStrProc); +var + i: integer; + Component: TComponent; + Table: TCustomDADataSet; + DataSetUtils: TDADataSetUtils; +begin + Assert(PropCount > 0, 'PropCount = 0'); + Component := GetComponent(0) as TComponent; + Assert(Component is TCustomDADataSet, Component.ClassName); + + DataSetUtils := TDADataSetUtils.Create; + try + Table := TCustomDADataSet(GetComponent(0)); + DataSetUtils.QuickOpen(Table); + + for i := 0 to Table.Fields.Count - 1 do + Proc(Table.Fields[i].FieldName); + + finally + DataSetUtils.Restore(True); + DataSetUtils.Free; + end; +end; + +{ TDALoaderTableNameEditor } + +function TDALoaderTableNameEditor.GetAttributes: TPropertyAttributes; +begin + Result := [paValueList]; +end; + +function TDALoaderTableNameEditor.AutoFill: boolean; +begin + Result := False; +end; + +procedure TDALoaderTableNameEditor.GetValues(Proc: TGetStrProc); +var + List: TStrings; + i: integer; + UsedConnection: TCustomDAConnection; +begin + List := TStringList.Create; + try + UsedConnection := TDALoaderUtils.UsedConnection(TDALoader(GetComponent(0))); + if UsedConnection = nil then + exit; + UsedConnection.GetTableNames(List); + for i := 0 to List.Count - 1 do + Proc(List[i]); + finally + List.Free; + end; +end; + + +{ TDADataSetMasterFieldsEditor } + +function TDADataSetMasterFieldsEditor.GetMasterFields: string; +begin + Result := (DataSet as TCustomDADataSet).MasterFields; +end; + +procedure TDADataSetMasterFieldsEditor.SetMasterFields(const Value: string); +begin + (DataSet as TCustomDADataSet).MasterFields := Value; +end; + +function TDADataSetMasterFieldsEditor.GetIndexFieldNames: string; +begin + Result := (DataSet as TCustomDADataSet).DetailFields; +end; + +procedure TDADataSetMasterFieldsEditor.SetIndexFieldNames(const Value: string); +begin + (DataSet as TCustomDADataSet).DetailFields := Value; +end; + +{ TVariantEditor } + +function TVariantEditor.GetAttributes: TPropertyAttributes; +begin + if VarIsArray(GetVarValue) then + Result := [paReadOnly] + else + Result := inherited GetAttributes; +end; + +function TVariantEditor.GetValue: string; +begin + if VarIsArray(GetVarValue) then + Result := '' + else + Result := GetVarValue;//inherited GetValue; +end; + +procedure TVariantEditor.SetValue(const Value: string); +begin + SetVarValue(Value); +end; + +{ TDADatasetOrSQLProperty } + +procedure TDADatasetOrSQLProperty.CheckComponent(const Value: string); +var + i: integer; + Component: TComponent; + AClass: TClass; + DataSetClass: TCustomDADataSetClass; + SQLClass: TCustomDASQLClass; + UpdateSQL: TCustomDAUpdateSQL; +begin + DataSetClass := nil; + SQLClass := nil; + Component := Designer.GetComponent(Value); + if Component <> nil then begin + for i := 0 to PropCount - 1 do begin + UpdateSQL := TCustomDAUpdateSQL(GetComponent(i)); + if UpdateSQL.Dataset = Component then + Exit; + if (i = 0) or (DataSetClass <> nil) then begin + AClass := TDBAccessUtils.GetDataSetClass(UpdateSQL); + if (i > 0) and (AClass <> DataSetClass) then + DataSetClass := nil + else + DataSetClass := TCustomDADataSetClass(AClass); + end; + if (i = 0) or (SQLClass <> nil) then begin + AClass := TDBAccessUtils.GetSQLClass(UpdateSQL); + if (i > 0) and (AClass <> SQLClass) then + SQLClass := nil + else + SQLClass := TCustomDASQLClass(AClass); + end; + end; + if not ((Component is SQLClass) or (Component is DataSetClass)) then + Exit; + end; + FCheckProc(Value); +end; + +procedure TDADatasetOrSQLProperty.GetValues(Proc: TGetStrProc); +begin + FCheckProc := Proc; + inherited GetValues(CheckComponent); +end; + +{ TDAUpdateSQLProperty } + +procedure TDAUpdateSQLProperty.CheckComponent(const Value: string); +var + i, j: integer; + UpdateObject: TComponent; + UpdateSQL: TCustomDAUpdateSQL; + DataSetClass: TCustomDADataSetClass; +begin + Assert(Designer.GetComponent(Value) is TCustomDAUpdateSQL); + UpdateSQL := TCustomDAUpdateSQL(Designer.GetComponent(Value)); + + DataSetClass := TDBAccessUtils.GetDataSetClass(UpdateSQL); + for i := 0 to PropCount - 1 do + if not (GetComponent(i) is DataSetClass) then + Exit; + + for i := 0 to 3 do begin + UpdateObject := nil; + case i of + 0: UpdateObject := UpdateSQL.ModifyObject; + 1: UpdateObject := UpdateSQL.InsertObject; + 2: UpdateObject := UpdateSQL.DeleteObject; + 3: UpdateObject := UpdateSQL.RefreshObject; + end; + + if UpdateObject <> nil then + for j := 0 to PropCount - 1 do + if TCustomDADataSet(GetComponent(j)) = UpdateObject then + Exit; + end; + + FCheckProc(Value); +end; + +procedure TDAUpdateSQLProperty.GetValues(Proc: TGetStrProc); +begin + FCheckProc := Proc; + inherited GetValues(CheckComponent); +end; + +{ TDAConnectionList } + +constructor TDAConnectionList.Create; +begin + inherited; + + Items := TStringList.Create; +end; + +destructor TDAConnectionList.Destroy; +begin + Items.Free; + + inherited; +end; + +procedure TDAConnectionList.StrProc(const S: string); +begin +{$IFNDEF VER6P} + Items.Add(S); +{$ENDIF} +end; + +procedure TDAConnectionList.ListBoxDblClick(Sender: TObject); +begin + Form.ModalResult := mrOk; +end; + +procedure TDAConnectionList.ListBoxKeyPress(Sender: TObject; var Key: Char); +begin + case Key of + #13: + Form.ModalResult := mrOk; + #27: + Form.ModalResult := mrCancel; + end; +end; + +{$IFDEF CLR} /// DAC 11241 +procedure TDAConnectionList.FormShow(Sender: TObject); +begin + Form.Left := FormLeft - 20; + Form.Top := FormTop - 20; +end; +{$ENDIF} + +function TDAConnectionList.GetConnection(Component: TComponent; Designer: {$IFDEF VER6P}IDesigner{$ELSE}IFormDesigner{$ENDIF}): TCustomDAConnection; +const + Width = 124; + Height = 180; +var + ListBox: TListBox; + TypeData: TTypeData; +{$IFDEF VER6P} + DesignOffset: TPoint; +{$ENDIF} +begin +{$IFDEF CLR} + TypeData := TTypeData.Create(TypeOf(GetConnectionType)); + Designer.GetComponentNames(TypeData, StrProc); +{$ELSE} + TypeData.ClassType := GetConnectionType; + Designer.GetComponentNames(@TypeData, StrProc); +{$ENDIF} + + if Items.Count = 0 then + Result := nil + else + if Items.Count = 1 then + Result := TCustomDAConnection(Designer.GetComponent(Items[0])) + else begin + Form := TForm.Create(nil); + ListBox := TListBox.Create(Form); + {$IFDEF MSWINDOWS} + Form.BorderStyle := bsSizeToolWin; + {$ENDIF} + {$IFDEF LINUX} + Form.BorderStyle := fbsSizeToolWin; + {$ENDIF} + {$IFDEF VER6P} + if Designer.Root is TForm then begin + {$IFDEF CLR} + DesignOffset := (Designer.Root as TForm).ClientToScreen(TPoint.Create(Word(Designer.Root.DesignInfo), Word(Designer.Root.DesignInfo shr 16))); + FormLeft := DesignOffset.X + Word(Component.DesignInfo shr 16) - Width div 3; + FormTop := DesignOffset.Y + Word(Component.DesignInfo) - 5; + {$ELSE} + DesignOffset := TForm(Designer.Root).BoundsRect.TopLeft; + {$ENDIF} + end + else + {$IFDEF CLR} + DesignOffset := TPoint.Create(Word(Designer.Root.DesignInfo), Word(Designer.Root.DesignInfo shr 16)); + {$ELSE} + DesignOffset := Point(LongRec(Designer.Root.DesignInfo).Lo, LongRec(Designer.Root.DesignInfo).Hi); + Form.Left := DesignOffset.X + Word(Component.DesignInfo) - Width div 3; + Form.Top := DesignOffset.Y + Word(Component.DesignInfo shr 16) - 5; + {$ENDIF} + {$ELSE} + Form.Left := Designer.Form.Left + LongRec(Component.DesignInfo).Lo - Width div 3; + Form.Top := Designer.Form.Top + LongRec(Component.DesignInfo).Hi - 5; + {$ENDIF} + Form.Width := Width; + Form.Height := Height; + Form.Caption := 'Connection List'; + Form.InsertControl(TControl(ListBox));//Form.InsertControl(QControls.TControl(ListBox)); + ListBox.Items.Assign(Items); + ListBox.Align := alClient; + ListBox.ItemIndex := 0; + ListBox.OnDblClick := ListBoxDblClick; + ListBox.OnKeyPress := ListBoxKeyPress; + {$IFDEF CLR} + Form.OnShow := FormShow; + {$ENDIF} + + if Form.ShowModal = mrOk then + Result := TCustomDAConnection(Designer.GetComponent(Items[ListBox.ItemIndex])) + else + Result := nil; + Form.Free; + end; +end; + +{$IFDEF VER6P} + +{ TDADesignNotification } + +procedure TDADesignNotification.DesignerClosed(const ADesigner: IDesigner + {$IFNDEF K1}; AGoingDormant: Boolean{$ENDIF}); +begin + +end; + +procedure TDADesignNotification.DesignerOpened(const ADesigner: IDesigner + {$IFNDEF K1}; AResurrecting: Boolean{$ENDIF}); +begin + +end; + +procedure TDADesignNotification.ItemDeleted(const ADesigner: IDesigner; + AItem: TPersistent); +begin + +end; + +procedure TDADesignNotification.StrProc(const S: string); +begin + FConnectionList.Items.Add(S); +end; + +procedure TDADesignNotification.DSStrProc(const S: string); +begin + DSItems.Add(S); +end; + +procedure TDADesignNotification.ItemsModified(const ADesigner: IDesigner); +var + Component: TComponent; + TypeData: TTypeData; + i, Width, Height: integer; + DS: TDataSet; + DADesignUtilsClass: TDADesignUtilsClass; + Modified: boolean; +begin + if (FItem <> nil) and (FItem is TCRDataSource) then begin + try + Component := TComponent(FItem); + with TCRDataSource(Component) do + if TDBAccessUtils.GetDesignCreate(TCRDataSource(Component)) then begin + DSItems := TStringList.Create; + try + {$IFDEF CLR} + TypeData := TTypeData.Create(TypeOf(TDataSet)); + ADesigner.GetComponentNames(TypeData, DSStrProc); + {$ELSE} + TypeData.ClassType := TDataSet; + ADesigner.GetComponentNames(@TypeData, DSStrProc); + {$ENDIF} + for i := 0 to DSItems.Count - 1 do begin + DS := TDataSet(ADesigner.GetComponent(DSItems[i])); + Width := Word(DesignInfo) - Word(DS.DesignInfo); + Height := Word(DesignInfo shr 16) - Word(DS.DesignInfo shr 16); + if (Width >= -32) and (Width <= 32) and + (Height >= -32) and (Height <= 32) + then begin + DataSet := DS; + break; + end; + end; + TDBAccessUtils.SetDesignCreate(TCRDataSource(Component), False); + finally + DSItems.Free; + end + end; + finally + FItem := nil; + ADesigner.Modified; + end; + end + + else begin + if FConnectionList <> nil then + exit; + if not NotificationActive then + FItem := nil + else + if FItem <> nil then begin + Modified := False; + DADesignUtilsClass := nil; + try + for i := 0 to Length(ComponentsInfo) - 1 do + if FItem is ComponentsInfo[i].ComponentClass then begin + DADesignUtilsClass := ComponentsInfo[i].DADesignUtilsClass; + Modified := True; + Break; + end; + Modified := Modified and (DADesignUtilsClass.GetConnection(TComponent(FItem)) = nil); + if Modified then + try + FConnectionList := CreateConnectionList; + ADesigner.GetComponentNames(GetTypeData(FConnectionList.GetConnectionType.ClassInfo), StrProc); + SetObjectProp(FItem, GetConnectionPropertyName, FConnectionList.GetConnection(TComponent(FItem), ADesigner)); + finally + FreeAndNil(FConnectionList); + end; + finally + FItem := nil; + if Modified then + ADesigner.Modified; + end; + end; + end; +end; + +procedure TDADesignNotification.SelectionChanged( + const ADesigner: IDesigner; const ASelection: IDesignerSelections); +begin + +end; +{$ENDIF} + +{ TDAComponentEditor } + +constructor TDAComponentEditor.Create(AComponent: TComponent; ADesigner: {$IFDEF VER6P}IDesigner{$ELSE}IFormDesigner{$ENDIF}); +var + i: integer; +{$IFNDEF VER6P} + Connection: TCustomDAConnection; +{$ENDIF} +begin +{$IFDEF DBTOOLS} + FDBToolsVerbIndex := -1; +{$ENDIF} + inherited; + + for i := 0 to Length(ComponentsInfo) - 1 do + if AComponent is ComponentsInfo[i].ComponentClass then begin + FDADesignUtilsClass := ComponentsInfo[i].DADesignUtilsClass; + Break; + end; + + InitVerbs; + +{$IFNDEF VER6P} + if (FDADesignUtilsClass <> nil) + and FDADesignUtilsClass.HasConnection(Component) + and FDADesignUtilsClass.GetDesignCreate(Component) then begin + + with TDAConnectionList(FDADesignUtilsClass.GetConnectionList) do begin + Connection := GetConnection(Component, Designer); + FDADesignUtilsClass.SetConnection(Component, Connection); + Free; + end; + FDADesignUtilsClass.SetDesignCreate(Component, False); + end; +{$ENDIF} +end; + +procedure TDAComponentEditor.InitVerbs; +begin +end; + +procedure TDAComponentEditor.ShowEditor(const InitialProperty: string); +begin + {$IFDEF CLR}CoreLab.Dac.Design.{$ENDIF}DADesign.ShowEditor(FCREditorClass, FDADesignUtilsClass, Component, Designer, InitialProperty); +end; + +procedure TDAComponentEditor.ShowEditor; +begin + {$IFDEF CLR}CoreLab.Dac.Design.{$ENDIF}DADesign.ShowEditor(FCREditorClass, FDADesignUtilsClass, Component, Designer); +end; + +{$IFDEF DBTOOLS} +procedure TDAComponentEditor.AddDBToolsVerbs(Verbs: TDBToolsVerbs); +var + IsSingle: boolean; + VerbIdx: TDBToolsVerb; +begin + if not FDADesignUtilsClass.DBToolsAvailable then begin + if FDADesignUtilsClass.NeedToCheckDbTools = ncExpired then + Exit; + FDADesignUtilsClass.SetDBToolsDownloadParams(True, FDADesignUtilsClass.NeedToCheckDbTools = ncIncompatible); + if NoCheckForTools(FDADesignUtilsClass.NeedToCheckDbTools = ncIncompatible) then + Exit; + end; + + IsSingle := False; + for VerbIdx := Low(TDBToolsVerb) to High(TDBToolsVerb) do + if VerbIdx in Verbs then begin + IsSingle := not IsSingle; + if not IsSingle then + Break; + FDBToolsSingleVerb := VerbIdx; + end; + + if IsSingle then + FDBToolsVerbIndex := AddVerb(DBTools.MenuActions[FDBToolsSingleVerb].Caption, DBToolsMenuExecute) + else begin + FDBToolsVerbs := Verbs; + FDBToolsVerbIndex := AddVerb(FDADesignUtilsClass.GetDBToolsMenuCaption, DBToolsMenuExecute); + end; +end; + +procedure TDAComponentEditor.DBToolsMenuExecute; +begin + DBTools.PrepareMenu(Designer, Component, FDADesignUtilsClass); + if FDBToolsVerbs = [] then //Single verb + DBTools.MenuActions[FDBToolsSingleVerb].Execute; +end; + +procedure TDAComponentEditor.PrepareItem(Index: integer; const AItem: IMenuItem); +var + VerbIdx: TDBToolsVerb; +begin + if (Index = FDBToolsVerbIndex) and (FDBToolsVerbs <> []) then + for VerbIdx := Low(TDBToolsVerb) to High(TDBToolsVerb) do + if VerbIdx in FDBToolsVerbs then + AItem.AddItem(DBTools.MenuActions[VerbIdx]); +end; +{$ENDIF} + +function TDAComponentEditor.AddVerb(const Caption: string; Method: TVerbMethod): integer; +begin + Result := Length(FVerbs); + SetLength(FVerbs, Result + 1); + FVerbs[Result].Caption := Caption; + FVerbs[Result].Method := Method; +end; + +function TDAComponentEditor.AddVerb(const Caption: string; CREditorClass: TCREditorClass; DADesignUtilsClass: TDADesignUtilsClass): integer; +begin + Assert(FCREditorClass = nil); + FCREditorClass := CREditorClass; + Assert(FDADesignUtilsClass <> nil); + Result := AddVerb(Caption, ShowEditor); +end; + +function TDAComponentEditor.GetVerbCount: integer; +{$IFDEF DBTOOLS} +var + i: integer; +{$ENDIF} +begin +{$IFDEF DBTOOLS} + if (FDBToolsVerbIndex >=0) and not FDADesignUtilsClass.DBToolsAvailable then begin + FDADesignUtilsClass.SetDBToolsDownloadParams(True, FDADesignUtilsClass.NeedToCheckDbTools = ncIncompatible); + if NoCheckForTools(FDADesignUtilsClass.NeedToCheckDbTools = ncIncompatible) then begin + for i := FDBToolsVerbIndex to Length(FVerbs) - 2 do + FVerbs[i] := FVerbs[i + 1]; + SetLength(FVerbs, Length(FVerbs) - 1); + FDBToolsVerbIndex := -1; + end; + end; +{$ENDIF} + Result := Length(FVerbs); +end; + +function TDAComponentEditor.GetVerb(Index: integer): string; +begin + Result := FVerbs[Index].Caption; +end; + +procedure TDAComponentEditor.ExecuteVerb(Index: integer); +begin + FVerbs[Index].Method; +end; + +procedure TDAComponentEditor.Edit; +begin + if FCREditorClass <> nil then + ShowEditor + else + if GetVerbCount > 0 then + ExecuteVerb(0) + else + inherited; +end; + +{ TDADataSetEditor } + +procedure TDADataSetEditor.ShowFieldsEditor; +var + NeedCreate: boolean; + DADSDesigner: TDADSDesigner; +{$IFDEF OLDDESIGNER} + DataSetEditor: TComponentEditor; +{$ENDIF} +begin + if (Component as TDataSet).Designer = nil then + NeedCreate := True + else + if (Component as TDataSet).Designer is TDADSDesigner then begin + (Component as TDataSet).Designer.Free; + NeedCreate := True; + end + else + NeedCreate := False; + + if NeedCreate then begin + {$IFDEF OLDDESIGNER} + DataSetEditor := DataSetEditorClass.Create(Component, Designer) as TComponentEditor; + try + DataSetEditor.ExecuteVerb(0); + finally + DataSetEditor.Free; + end; + {$ELSE} + {$IFDEF CLR}Borland.VCL.Design.{$ENDIF}DSDesign.ShowFieldsEditor(Designer, TDataSet(Component), TDSDesigner); + {$ENDIF} + end + else begin + DADSDesigner := TDADSDesigner((Component as TDataSet).Designer); + {$IFDEF LINUX} + DADSDesigner.FFieldsEditor.Show; + {$ELSE} + DADSDesigner.FieldsEditor.Show; + {$ENDIF} + end; +end; + +procedure TDADataSetEditor.ShowDataEditor; +begin + {$IFDEF CLR}CoreLab.Dac.Design.{$ENDIF}DADesign.ShowEditor(TDADataEditorForm, FDADesignUtilsClass, Component, Designer); +end; + +{$IFDEF MSWINDOWS} +{$IFNDEF VER8} +const +{$IFDEF VER5} + DsmBplName = 'DataSetManager50.bpl'; +{$ENDIF} +{$IFDEF VER6} + DsmBplName = 'DataSetManager60.bpl'; +{$ENDIF} +{$IFDEF VER7} + DsmBplName = 'DataSetManager70.bpl'; +{$ENDIF} +{$IFDEF VER9} + DsmBplName = 'DataSetManager90.bpl'; +{$ENDIF} +{$IFDEF VER10} + DsmBplName = 'DataSetManager100.bpl'; +{$ENDIF} +{$IFDEF VER11} + DsmBplName = 'DataSetManager105.bpl'; +{$ENDIF} +{$IFDEF CLR} +[DllImport(DsmBplName)] +procedure CreateDefaultControl([MarshalAs(UnmanagedType.LPStr)]Owner, DataSet: string); external; +[DllImport(DsmBplName)] +procedure ShowDataSetManager([MarshalAs(UnmanagedType.LPStr)]Owner, DataSet: string); external; +{$ENDIF} +procedure TDADataSetEditor.ExecuteDsmAction(const ProcName: string); +var + Handle: Cardinal; +{$IFNDEF CLR} + Proc: procedure(Owner, DataSet: PChar); stdcall; +{$ENDIF} + OwnerName: string; + DataSetName: string; +begin + Handle := GetModuleHandle(PChar(DsmBplName)); + if Handle <> 0 then begin +{$IFNDEF CLR} + Proc := GetProcAddress(Handle, PChar(ProcName)); + if Assigned(Proc) and Assigned(Component.Owner) then begin + OwnerName := (Component as TDataSet).Owner.Name; + DataSetName := (Component as TDataSet).Name; + Proc(@OwnerName[1], @DataSetName[1]); + end; +{$ELSE} + if Assigned(Component.Owner) then begin + OwnerName := Component.Owner.Name; + DataSetName := (Component as TDataSet).Name; + if SameText(ProcName, 'CreateDefaultControl') then + CreateDefaultControl(OwnerName, DataSetName) + else + if SameText(ProcName, 'ShowDataSetManager') then + ShowDataSetManager(OwnerName, DataSetName); + end; +{$ENDIF} + end; +end; + +procedure TDADataSetEditor.InitVerbs; +var + Handle: Cardinal; +begin + inherited; + + Handle := GetModuleHandle(PChar(DsmBplName)); + if Handle <> 0 then begin + AddVerb('-', Separator); + AddVerb('Create default control', DsmCreateDefaultControl); + AddVerb('Show in DataSet Manager', DsmShowInDataSetManager); + end; +end; + +procedure TDADataSetEditor.DsmCreateDefaultControl; +begin +{$IFDEF CLR} + DsmShowInDataSetManager; +{$ENDIF} + ExecuteDsmAction('CreateDefaultControl'); +end; + +procedure TDADataSetEditor.DsmShowInDataSetManager; +begin + ExecuteDsmAction('ShowDataSetManager'); +end; + +procedure TDADataSetEditor.Separator; +begin +end; +{$ENDIF} +{$ENDIF} + +{ TDALoaderEditor } + +procedure TDALoaderEditor.InitVerbs; +begin + inherited; +{$IFNDEF LINUX} +{$IFNDEF CLR} +{$IFNDEF BCB} + AddVerb('Columns E&ditor...', ShowColEditor); +{$ENDIF} +{$ENDIF} +{$ENDIF} + AddVerb('Create Columns', CreateColumns); +end; + +procedure TDALoaderEditor.ShowColEditor; +begin +{$IFNDEF LINUX} +{$IFNDEF CLR} +{$IFNDEF BCB} + Assert(Component is TDALoader); + with ShowCollectionEditorClass(Designer, TCollectionEditor, Component, + TDALoader(Component).Columns, 'Columns', [coAdd,coDelete{,coMove}]) do + UpdateListbox; +{$ENDIF} +{$ENDIF} +{$ENDIF} +end; + +procedure TDALoaderEditor.CreateColumns; +begin + Assert(Component is TDALoader); + if (TDALoader(Component).Columns.Count = 0) or + (MessageDlg('Do you want recreate columns for table ' + + TDALoader(Component).TableName + '?', mtConfirmation, [mbYes,mbNo], 0) = mrYes) + then begin + TDALoader(Component).CreateColumns; + ShowColEditor; + end; +end; + +{$IFDEF MSWINDOWS} + +{ TDASQLMonitorEditor } + +procedure TDASQLMonitorEditor.RunDBMonitor; +begin + Assert(HasMonitor); + ShellExecute(0, 'open', PChar(WhereMonitor), '', '', SW_SHOW) +end; + +procedure TDASQLMonitorEditor.RunSQLMonitor; +begin + ShellExecute(0, 'open', 'sqlmon.exe', '', '', SW_SHOW); +end; + +procedure TDASQLMonitorEditor.InitVerbs; +begin + if HasMonitor then + AddVerb('Run DBMonitor...', RunDBMonitor); + AddVerb('Run SQL Monitor...', RunSQLMonitor); +end; + +procedure TDASQLMonitorEditor.Edit; +begin + if GetVerbCount > 0 then + ExecuteVerb(0); +end; + +{$ENDIF} +{ TCRDataSourceEditor } +constructor TCRDataSourceEditor.Create(Component: TComponent; aDesigner: {$IFDEF VER6P}IDesigner{$ELSE}IFormDesigner{$ENDIF}); +var + TypeData: TTypeData; + i, Width, Height: integer; + DS: TDataSet; +begin + inherited; + + with TCRDataSource(Component) do + if TDBAccessUtils.GetDesignCreate(TCRDataSource(Component)) then begin + Items := TStringList.Create; + try + {$IFDEF CLR} + TypeData := TTypeData.Create(TypeOf(TDataSet)); + aDesigner.GetComponentNames(TypeData, StrProc); + {$ELSE} + TypeData.ClassType := TDataSet; + aDesigner.GetComponentNames(@TypeData, StrProc); + {$ENDIF} + + for i := 0 to Items.Count - 1 do begin + DS := TDataSet(aDesigner.GetComponent(Items[i])); + Width := Word(DesignInfo) - Word(DS.DesignInfo); + Height := Word(DesignInfo shr 16) - Word(DS.DesignInfo shr 16); + if (Width >= 0) and (Width <= 28 + 4) and + (Height >= 0) and (Height <= 28 + 4) + then + DataSet := DS; + end; + TDBAccessUtils.SetDesignCreate(TCRDataSource(Component), False); + finally + Items.Free; + end + end; +end; + +procedure TCRDataSourceEditor.StrProc(const S: string); +begin + Items.Add(S); +end; + +procedure TCRDataSourceEditor.ConvertToDataSource; +begin + if Designer <> nil then + ConvertToClass(Self.Designer, Component, TDataSource); +end; + +procedure TCRDataSourceEditor.InitVerbs; +begin + inherited; + AddVerb('Convert to TDataSource', ConvertToDataSource); +end; + +procedure TCRDataSourceEditor.CheckEdit({$IFDEF VER6P}const Prop: IProperty{$ELSE}Prop: TPropertyEditor{$ENDIF}); +begin + if FFirstProp = nil then + FFirstProp := Prop +{$IFNDEF VER6P} + else + Prop.Free; +{$ENDIF} +end; + +procedure TCRDataSourceEditor.Edit; +var + Components: {$IFDEF VER6P}IDesignerSelections;{$ELSE}TDesignerSelectionList;{$ENDIF} +begin + Components := {$IFDEF VER6P}TDesignerSelections.Create{$ELSE}TDesignerSelectionList.Create{$ENDIF}; +{$IFNDEF VER6P} + try +{$ENDIF} + Components.Add(Component); + FFirstProp := nil; + GetComponentProperties(Components, tkMethods, Designer, CheckEdit); + if FFirstProp <> nil then + {$IFNDEF VER6P} + try + {$ENDIF} + FFirstProp.Edit; + {$IFNDEF VER6P} + finally + FFirstProp.Free; + end; + {$ENDIF} +{$IFNDEF VER6P} + finally + Components.Free; + end; +{$ENDIF} +end; + +{ TDesignMacros } + +const + SComment = '--'; + SBeginMacroComment = 'MACRO'; + SEndMacroComment = 'ENDMACRO'; + +function TDesignMacros.GetMacroValue(Macro: TMacro): string; +var + i: integer; + ResultList: TStringList; +begin + ResultList := TStringList.Create; + try + ResultList.Text := Macro.Value; + if not Macro.Active then + for i := 0 to ResultList.Count - 1 do + ResultList[i] := SComment + ' ' + ResultList[i]; + + ResultList.Insert(0, ''); + ResultList.Insert(1, SComment + ' ' + SBeginMacroComment + ' ' + Macro.Name); + ResultList.Add(SComment + ' ' + SEndMacroComment); + finally + Result := ResultList.Text; + ResultList.Free; + end; +end; + +procedure TDesignMacros.Scan(var SQL: string); +var + i, j: integer; + s, St, CommentSt: string; + SourceSQL: TStringList; + MacroSQL: TStringList; + NewMacro, + MacroFound: boolean; + Macro: TMacro; + + Parser: TParser; + CodeLexem: integer; + + function TrimLineSeparator(s: string): string; + begin + if Copy(s, Length(s) - Length(SLLineSeparator) + 1, Length(SLLineSeparator)) = SLLineSeparator then + Result := Copy(s, 1, Length(s) - Length(SLLineSeparator)) + else + Result := s; + end; + + function AtFirstPos(Substr: string; s: string): boolean; + begin + Result := Copy(Trim(s), 1, Length(Substr)) = Substr; + end; + + function TrimFirst(Substr: string; s: string): string; + begin + s := Trim(s); + Result := Copy(s, Length(Substr) + 1, Length(s) - Length(Substr)) + end; + +begin + Clear; + + MacroFound := False; + SourceSQL := TStringList.Create; + MacroSQL := TStringList.Create; + Parser := FParserClass.Create(''); + Macro := nil; + + try + Parser.OmitBlank := False; + Parser.Uppered := False; + SourceSQL.Text := SQL; + SQL := ''; + + for i := 0 to SourceSQL.Count - 1 do begin + s := SourceSQL[i]; + + CommentSt := ''; + + if AtFirstPos(SComment, s) then begin + + Parser.SetText(Trim(s)); + Parser.ToBegin; + if Parser.GetNext(St) = lcComment then begin + Parser.SetText(TrimFirst(SComment, s)); + Parser.ToBegin; + repeat + CodeLexem := Parser.GetNext(St) + until CodeLexem <> lcBlank; + CommentSt := St; + end; + end; + + if Macro <> nil then + if CommentSt = SEndMacroComment then begin + if not Macro.Active then + for j := 0 to MacroSQL.Count - 1 do begin + St := TrimFirst(SComment, MacroSQL[j]); + if St[1] = ' ' then + St := Copy(St, 2, Length(St) - 1); + MacroSQL[j] := St; + end; + + if MacroSQL.Count = 0 then + Macro.Active := True; + Macro.Value := TrimLineSeparator(MacroSQL.Text); + MacroSQL.Clear; + Macro := nil; + end + else begin + MacroSQL.Add(s); + if CommentSt = '' then + Macro.Active := True; + end + + else begin + NewMacro := False; + + if CommentSt = SBeginMacroComment then begin + + if Parser.GetNext(St) = lcBlank then begin + repeat + CodeLexem := Parser.GetNext(St) + until CodeLexem <> lcBlank; + + NewMacro := (CodeLexem = lcIdent) or + Parser.IsNumericMacroNameAllowed and (CodeLexem = lcNumber) or + (CodeLexem > Parser.SymbolLexems.Count) and + (CodeLexem <= Parser.SymbolLexems.Count + Parser.KeywordLexems.Count); + if NewMacro and (CodeLexem = lcNumber) then begin + CodeLexem := Parser.GetNext(s); + if (CodeLexem = lcIdent) or (CodeLexem > Parser.SymbolLexems.Count) + and (CodeLexem <= Parser.SymbolLexems.Count + Parser.KeywordLexems.Count) + then + St := St + s + end; + end; + end; + + if NewMacro then begin + MacroFound := True; + Macro := FindMacro(St); + if Macro = nil then begin + Macro := TMacro(Add); + Macro.Name := St; + end; + Macro.Active := False; + SQL := TrimLineSeparator(SQL); + if (SQL <> '') and (Pos(SQL[Length(SQL)], #$9#$A#$D#$20) < 1) then + SQL := SQL + ' '; + SQL := SQL + MacroChar + Macro.Name; + end + else begin + if MacroFound then begin + SQL := TrimLineSeparator(SQL); + end; + if i < SourceSQL.Count - 1 then + s := s + SLLineSeparator; + SQL := SQL + s; + MacroFound := False; + end; + end; + end; + + finally + SourceSQL.Free; + MacroSQL.Free; + Parser.Free; + end; +end; + +procedure Register; +{$IFDEF OLDDESIGNER} +var + DataSet: TDataSet; + DataSetEditor: TComponentEditor; +{$ENDIF} +begin + +{$IFDEF OLDDESIGNER} +{$WARNINGS OFF} +{$IFDEF VER6P} + DataSet := nil; + try + DataSet := TDataSet.Create(nil); + DataSetEditor := Pointer(Integer(GetComponentEditor(DataSet, nil)) - 20); + DataSetEditorClass := TComponentEditorClass(DataSetEditor.ClassType); + finally + DataSet.Free; + end; +{$ELSE} + DataSet := nil; + DataSetEditor := nil; + try + DataSet := TDataSet.Create(nil); + DataSetEditor := GetComponentEditor(DataSet, nil); + DataSetEditorClass := TComponentEditorClass(DataSetEditor.ClassType); + finally + DataSetEditor.Free; + DataSet.Free; + end; +{$ENDIF} +{$WARNINGS ON} +{$ENDIF} + + // Register property editors + RegisterPropertyEditor(TypeInfo(TFields), TCustomDADataSet, 'Fields', TDAFieldsEditor); + RegisterPropertyEditor(TypeInfo(TDAParams), TCustomDASQL, 'Params', TDAPropertyEditor); + RegisterPropertyEditor(TypeInfo(TDAParams), TCustomDADataset, 'Params', TDAPropertyEditor); + RegisterPropertyEditor(TypeInfo(TMacros), TCustomDASQL, 'Macros', TDAPropertyEditor); + RegisterPropertyEditor(TypeInfo(TMacros), TDAScript, 'Macros', TDAPropertyEditor); + RegisterPropertyEditor(TypeInfo(TMacros), TCustomDADataset, 'Macros', TDAPropertyEditor); + RegisterPropertyEditor(TypeInfo(String), TCustomDADataset, 'TableName', TDATableNameEditor); + RegisterPropertyEditor(TypeInfo(String), TCustomDADataset, 'StoredProcName', TDASPNameEditor); + RegisterPropertyEditor(TypeInfo(String), TCustomDADataset, 'OrderFields', TDAFieldDefsListEditor); + RegisterPropertyEditor(TypeInfo(String), TCustomDADataset, 'IndexFieldNames', TDAFieldsListEditor); + RegisterPropertyEditor(TypeInfo(String), TCustomDADataSet, 'MasterFields', TDADataSetMasterFieldsEditor); + RegisterPropertyEditor(TypeInfo(String), TCustomDADataSet, 'DetailFields', TDADataSetMasterFieldsEditor); + RegisterPropertyEditor(TypeInfo(Variant), TDAParam, 'Value', TVariantEditor); + RegisterPropertyEditor(TypeInfo(String), TCustomDAConnection, 'Database', TDADatabaseNameEditor); + RegisterPropertyEditor(TypeInfo(String), TCustomDADataSet, 'UpdatingTable', TDAUpdatingTableEditor); + + RegisterPropertyEditor(TypeInfo(String), TCustomDAConnection, 'Password', TDAPasswordProperty); + + RegisterPropertyEditor(TypeInfo(TComponent), TCustomDAUpdateSQL, 'RefreshObject', TDADatasetOrSQLProperty); + RegisterPropertyEditor(TypeInfo(TComponent), TCustomDAUpdateSQL, 'ModifyObject', TDADatasetOrSQLProperty); + RegisterPropertyEditor(TypeInfo(TComponent), TCustomDAUpdateSQL, 'InsertObject', TDADatasetOrSQLProperty); + RegisterPropertyEditor(TypeInfo(TComponent), TCustomDAUpdateSQL, 'DeleteObject', TDADatasetOrSQLProperty); + RegisterPropertyEditor(TypeInfo(TCustomDAUpdateSQL), TCustomDADataSet, 'UpdateObject', TDAUpdateSQLProperty); + RegisterPropertyEditor(TypeInfo(String), TDALoader, 'TableName', TDALoaderTableNameEditor); + RegisterPropertyEditor(TypeInfo(Boolean), TDALoader, 'Debug', nil); + + // Register component editors + RegisterComponentEditor(TDALoader, TDALoaderEditor); +{$IFDEF MSWINDOWS} + RegisterComponentEditor(TCustomDASQLMonitor, TDASQLMonitorEditor); +{$ENDIF} +end; + +initialization + + NotificationActive := True; + +end. diff --git a/internal/4.10.0.10/1/Source/Design/DADesign.res b/internal/4.10.0.10/1/Source/Design/DADesign.res new file mode 100644 index 0000000..8a83ab0 Binary files /dev/null and b/internal/4.10.0.10/1/Source/Design/DADesign.res differ diff --git a/internal/4.10.0.10/1/Source/Design/DADesign10p.res b/internal/4.10.0.10/1/Source/Design/DADesign10p.res new file mode 100644 index 0000000..8688e5c Binary files /dev/null and b/internal/4.10.0.10/1/Source/Design/DADesign10p.res differ diff --git a/internal/4.10.0.10/1/Source/Design/DADesign9.res b/internal/4.10.0.10/1/Source/Design/DADesign9.res new file mode 100644 index 0000000..a995cfb Binary files /dev/null and b/internal/4.10.0.10/1/Source/Design/DADesign9.res differ diff --git a/internal/4.10.0.10/1/Source/Design/DADesignUtils.pas b/internal/4.10.0.10/1/Source/Design/DADesignUtils.pas new file mode 100644 index 0000000..f677494 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DADesignUtils.pas @@ -0,0 +1,625 @@ + +////////////////////////////////////////////////// +// DB Access Components +// Copyright © 1998-2005 Core Lab. All right reserved. +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I Dac.inc} + +unit DADesignUtils; +{$ENDIF} + +interface + +uses +{$IFDEF DBTOOLS} + DBToolsIntf, + CRAccess, +{$ENDIF} + Classes, SysUtils, DBAccess; + +type +{$IFDEF DBTOOLS} + TNeedToCheckDbTools = (ncNone, ncExpired, ncNoAddin, ncIncompatible); +{$ENDIF} + + TDADesignUtilsAlias = class + public + {$IFNDEF VER8}class{$ENDIF} function GetProjectName: string; virtual; // Returns ProjectName = ('DataEditor', 'ODAC', 'SDAC', 'MyDAC', ...) + + { Component } + {$IFNDEF VER8}class{$ENDIF} function GetDesignCreate(Obj: TComponent): boolean; virtual; + {$IFNDEF VER8}class{$ENDIF} procedure SetDesignCreate(Obj: TComponent; Value: boolean); virtual; + {$IFNDEF VER8}class{$ENDIF} function GetConnectionList: TObject; virtual; //avoid circular link error + + { Connection support } + {$IFNDEF VER8}class{$ENDIF} function HasConnection(Obj: TComponent): boolean; virtual; + {$IFNDEF VER8}class{$ENDIF} function GetConnection(Obj: TComponent): TCustomDAConnection; virtual; + {$IFNDEF VER8}class{$ENDIF} procedure SetConnection(Obj: TComponent; Value: TCustomDAConnection); virtual; + {$IFNDEF VER8}class{$ENDIF} function UsedConnection(Obj: TComponent): TCustomDAConnection; virtual; + + { SQL support } + {$IFNDEF VER8}class{$ENDIF} function GetSQL(Obj: TComponent; StatementType: TStatementType = stQuery): TStrings; virtual; + {$IFNDEF VER8}class{$ENDIF} procedure SetSQL(Obj: TComponent; Value: TStrings; StatementType: TStatementType = stQuery); overload; virtual; + {$IFNDEF VER8}class{$ENDIF} procedure SetSQL(Obj: TComponent; Value: string; StatementType: TStatementType = stQuery); overload; virtual; + + class function GetParams(Obj: TComponent): TDAParams; + class procedure SetParams(Obj: TComponent; Value: TDAParams); + class function GetMacros(Obj: TComponent): TMacros; + class procedure SetMacros(Obj: TComponent; Value: TMacros); + class procedure Execute(Obj: TComponent); + class function GetAfterExecute(Obj: TComponent): TAfterExecuteEvent; + class procedure SetAfterExecute(Obj: TComponent; Value: TAfterExecuteEvent); + + { DataSet support} + {$IFNDEF VER8}class{$ENDIF} function GetStatementTypes: TStatementTypes; virtual; // allowable StatementTypes for GetSQL and SetSQL + + { TDATable support } + {$IFNDEF VER8}class{$ENDIF} function GetTableName(Obj: TCustomDADAtaSet): string; virtual; + {$IFNDEF VER8}class{$ENDIF} procedure SetTableName(Obj: TCustomDADAtaSet; Value: string); virtual; + {$IFNDEF VER8}class{$ENDIF} function GetOrderFields(Obj: TCustomDADAtaSet): string; virtual; + {$IFNDEF VER8}class{$ENDIF} procedure SetOrderFields(Obj: TCustomDADAtaSet; Value: string); virtual; + {$IFNDEF VER8}class{$ENDIF} procedure PrepareSQL(Obj: TCustomDADAtaSet); virtual; + + { TDAStoredProc support} + {$IFNDEF VER8}class{$ENDIF} function GetStoredProcName(Obj: TCustomDADataSet): string; virtual; + {$IFNDEF VER8}class{$ENDIF} procedure SetStoredProcName(Obj: TCustomDADataSet; Value: string); virtual; + + {$IFDEF USE_SYNEDIT} + {$IFNDEF VER8}class{$ENDIF} function SQLDialect: integer ; virtual; // SynHighlighterSQL TSQLDialect = (sqlStandard, sqlInterbase6, sqlMSSQL7, sqlMySQL, sqlOracle, sqlSybase, sqlIngres, sqlMSSQL2K); + {$ENDIF} + + class function DBToolsAvailable: boolean; + + {$IFDEF DBTOOLS} + class function DBToolsService: TObject; virtual; //avoid circular link error + class function NeedToCheckDbTools: TNeedToCheckDbTools; virtual; + class function GetDBToolsServiceVersion: int64; virtual; + class function GetDBToolsServiceVersionStr: string; + class function GetDBToolsMenuCaption: string; virtual; + class function HasParams(Obj: TComponent): boolean; + class function GetFullName(Obj: TComponent): string; virtual; + class function GetObjectType(Obj: TComponent): string; virtual; + class function IsStoredProc(Obj: TComponent): boolean; virtual; + + class procedure GetDBToolsConnectionList(Connection: TCustomDAConnection); virtual; + class procedure SetDBToolsDownloadParams(VerbCheck: boolean; Incompatible: boolean); virtual; + {$ENDIF} + end; + +{$IFDEF VER8} + TDADesignUtilsClass = TDADesignUtilsAlias; + +var + TDADesignUtils: TDADesignUtilsAlias; +{$ELSE} + TDADesignUtils = TDADesignUtilsAlias; + TDADesignUtilsClass = class of TDADesignUtils; +{$ENDIF} + +implementation + +uses +{$IFDEF MSWINDOWS} + Forms, Windows, ComObj, +{$ELSE} + QForms, +{$ENDIF} +{$IFDEF CLR} + System.Runtime.InteropServices, +{$ELSE} + CLRClasses, +{$ENDIF} +{$IFDEF DBTOOLS} + DBToolsClient, +{$ENDIF} + DALoader, DADump, DAScript; + +{ TDADesignUtilsAlias } + +{$IFNDEF VER8}class{$ENDIF} function TDADesignUtilsAlias.GetProjectName: string; +begin + Result := 'DAC'; +end; + +{$IFNDEF VER8}class{$ENDIF} function TDADesignUtilsAlias.GetDesignCreate(Obj: TComponent): boolean; +begin + Result := False; + Assert(Obj <> nil); + if Obj is TCustomDASQL then + Result := TDBAccessUtils.GetDesignCreate(TCustomDASQL(Obj)) + else + if Obj is TCustomDADataSet then + Result := TDBAccessUtils.GetDesignCreate(TCustomDADataSet(Obj)) + else + if Obj is TDALoader then + Result := TDALoaderUtils.GetDesignCreate(TDALoader(Obj)) + else + if Obj is TDADump then + Result := TDADumpUtils.GetDesignCreate(TDADump(Obj)) + else + if Obj is TDAScript then + Result := TDAScriptUtils.GetDesignCreate(TDAScript(Obj)) + else + if Obj is TCustomDAUpdateSQL then + Result := TDBAccessUtils.GetDesignCreate(TCustomDAUpdateSQL(Obj)) + else + if Obj is TCRDataSource then + Result := TDBAccessUtils.GetDesignCreate(TCRDataSource(Obj)) + else + Assert(False, Obj.ClassName); +end; + +{$IFNDEF VER8}class{$ENDIF} procedure TDADesignUtilsAlias.SetDesignCreate(Obj: TComponent; Value: boolean); +begin + Assert(Obj <> nil); + if Obj is TCustomDASQL then + TDBAccessUtils.SetDesignCreate(TCustomDASQL(Obj), Value) + else + if Obj is TCustomDADataSet then + TDBAccessUtils.SetDesignCreate(TCustomDADataSet(Obj), Value) + else + if Obj is TDALoader then + TDALoaderUtils.SetDesignCreate(TDALoader(Obj), Value) + else + if Obj is TDADump then + TDADumpUtils.SetDesignCreate(TDADump(Obj), Value) + else + if Obj is TDAScript then + TDAScriptUtils.SetDesignCreate(TDAScript(Obj), Value) + else + if Obj is TCustomDAUpdateSQL then + TDBAccessUtils.SetDesignCreate(TCustomDAUpdateSQL(Obj), Value) + else + if Obj is TCRDataSource then + TDBAccessUtils.SetDesignCreate(TCRDataSource(Obj), Value) + else + Assert(False, Obj.ClassName); +end; + +{$IFNDEF VER8}class{$ENDIF} function TDADesignUtilsAlias.GetConnectionList: TObject; +begin + Result := nil; + Assert(False, 'Must be overriden on Product layer'); +end; + +{$IFNDEF VER8}class{$ENDIF} function TDADesignUtilsAlias.HasConnection(Obj: TComponent): boolean; +begin + Assert(Obj <> nil); + if Obj is TCustomDASQL then + Result := True + else + if Obj is TCustomDADataSet then + Result := True + else + if Obj is TDAScript then + Result := True + else + if Obj is TDALoader then + Result := True + else + if Obj is TDADump then + Result := True + else + Result := False; +end; + +{$IFNDEF VER8}class{$ENDIF} function TDADesignUtilsAlias.GetConnection(Obj: TComponent): TCustomDAConnection; +begin + Result := nil; + Assert(Obj <> nil); + if Obj is TCustomDASQL then + Result := TCustomDASQL(Obj).Connection + else + if Obj is TCustomDADataSet then + Result := TCustomDADataSet(Obj).Connection + else + if Obj is TDAScript then + Result := TDAScript(Obj).Connection + else + if Obj is TDALoader then + Result := TDALoader(Obj).Connection + else + if Obj is TDADump then + Result := TDADump(Obj).Connection + else + Assert(False, Obj.ClassName); +end; + +{$IFNDEF VER8}class{$ENDIF} procedure TDADesignUtilsAlias.SetConnection(Obj: TComponent; Value: TCustomDAConnection); +begin + Assert(Obj <> nil); + if Obj is TCustomDASQL then + TCustomDASQL(Obj).Connection := Value + else + if Obj is TCustomDADataSet then + TCustomDADataSet(Obj).Connection := Value + else + if Obj is TDAScript then + TDAScript(Obj).Connection := Value + else + if Obj is TDALoader then + TDALoader(Obj).Connection := Value + else + if Obj is TDADump then + TDADump(Obj).Connection := Value + else + Assert(False, Obj.ClassName); +end; + +{$IFNDEF VER8}class{$ENDIF} function TDADesignUtilsAlias.UsedConnection(Obj: TComponent): TCustomDAConnection; +begin + Result := nil; + Assert(Obj <> nil); + if Obj is TCustomDASQL then + Result := TDBAccessUtils.UsedConnection(TCustomDASQL(Obj)) + else + if Obj is TCustomDADataSet then + Result := TDBAccessUtils.UsedConnection(TCustomDADataSet(Obj)) + else + if Obj is TDAScript then + Result := TDAScriptUtils.UsedConnection(TDAScript(Obj)) + else + if Obj is TDALoader then + Result := TDALoaderUtils.UsedConnection(TDALoader(Obj)) + else + if Obj is TCustomDAUpdateSQL then begin + if TCustomDAUpdateSQL(Obj).DataSet <> nil then + Result := TDBAccessUtils.UsedConnection(TCustomDAUpdateSQL(Obj).DataSet) + else + Result := nil; + end + else + if Obj is TDADump then + Result := TDADump(Obj).Connection + else + Assert(False, Obj.ClassName); +end; + +{$IFNDEF VER8}class{$ENDIF} function TDADesignUtilsAlias.GetStatementTypes: TStatementTypes; +begin + Result := [stQuery, stInsert, stUpdate, stDelete, stRefresh]; +end; + +{$IFNDEF VER8}class{$ENDIF} function TDADesignUtilsAlias.GetSQL(Obj: TComponent; StatementType: TStatementType = stQuery): TStrings; +begin + Result := nil; + Assert(Obj <> nil); + Assert((StatementType = stQuery) or (Obj is TCustomDADataSet) or (Obj is TCustomDAUpdateSQL)); + if Obj is TCustomDASQL then + Result := TCustomDASQL(Obj).SQL + else + if Obj is TCustomDADataSet then begin + case StatementType of + stQuery: + Result := TCustomDADataSet(Obj).SQL; + stInsert: + Result := TCustomDADataSet(Obj).SQLInsert; + stUpdate: + Result := TCustomDADataSet(Obj).SQLUpdate; + stDelete: + Result := TCustomDADataSet(Obj).SQLDelete; + stRefresh: + Result := TCustomDADataSet(Obj).SQLRefresh; + else + begin + Result := nil; + Assert(False, 'StatementType = ' + IntToStr(Integer(StatementType))); + end; + end; + end + else + if Obj is TCustomDAUpdateSQL then begin + case StatementType of + stInsert: + Result := TCustomDAUpdateSQL(Obj).InsertSQL; + stUpdate: + Result := TCustomDAUpdateSQL(Obj).ModifySQL; + stDelete: + Result := TCustomDAUpdateSQL(Obj).DeleteSQL; + stRefresh: + Result := TCustomDAUpdateSQL(Obj).RefreshSQL; + else + begin + Result := nil; + Assert(False, 'StatementType = ' + IntToStr(Integer(StatementType))); + end; + end; + end + else + if Obj is TDAScript then + Result := TDAScript(Obj).SQL + else + Assert(False, Obj.ClassName); +end; + +{$IFNDEF VER8}class{$ENDIF} procedure TDADesignUtilsAlias.SetSQL(Obj: TComponent; Value: TStrings; StatementType: TStatementType = stQuery); +begin + Assert(Obj <> nil); + Assert((StatementType = stQuery) or (Obj is TCustomDADataSet) or (Obj is TCustomDAUpdateSQL)); + if Obj is TCustomDASQL then + TCustomDASQL(Obj).SQL := Value + else + if Obj is TCustomDADataSet then begin + case StatementType of + stQuery: + TCustomDADataSet(Obj).SQL := Value; + stInsert: + TCustomDADataSet(Obj).SQLInsert := Value; + stUpdate: + TCustomDADataSet(Obj).SQLUpdate := Value; + stDelete: + TCustomDADataSet(Obj).SQLDelete := Value; + stRefresh: + TCustomDADataSet(Obj).SQLRefresh := Value; + else + Assert(False, 'StatementType = ' + IntToStr(Integer(StatementType))); + end; + end + else + if Obj is TCustomDAUpdateSQL then begin + case StatementType of + stInsert: + TCustomDAUpdateSQL(Obj).InsertSQL := Value; + stUpdate: + TCustomDAUpdateSQL(Obj).ModifySQL := Value; + stDelete: + TCustomDAUpdateSQL(Obj).DeleteSQL := Value; + stRefresh: + TCustomDAUpdateSQL(Obj).RefreshSQL := Value; + else + Assert(False, 'StatementType = ' + IntToStr(Integer(StatementType))); + end; + end + else + if Obj is TDAScript then + TDAScript(Obj).SQL := Value + else + Assert(False, Obj.ClassName); +end; + +{$IFNDEF VER8}class{$ENDIF} procedure TDADesignUtilsAlias.SetSQL(Obj: TComponent; Value: string; StatementType: TStatementType = stQuery); +var + List: TStringList; +begin + List := TStringList.Create; + try + List.Text := Value; + SetSQL(Obj, List, StatementType); + finally + List.Free; + end; +end; + +class function TDADesignUtilsAlias.GetParams(Obj: TComponent): TDAParams; +begin + Result := nil; + Assert(Obj <> nil); + if Obj is TCustomDASQL then + Result := TCustomDASQL(Obj).Params + else + if Obj is TCustomDADataSet then + Result := TCustomDADataSet(Obj).Params + else + Assert(False, Obj.ClassName); +end; + +class procedure TDADesignUtilsAlias.SetParams(Obj: TComponent; Value: TDAParams); +begin + Assert(Obj <> nil); + if Obj is TCustomDASQL then + TCustomDASQL(Obj).Params := Value + else + if Obj is TCustomDADataSet then + TCustomDADataSet(Obj).Params := Value + else + Assert(False, Obj.ClassName); +end; + +class function TDADesignUtilsAlias.GetMacros(Obj: TComponent): TMacros; +begin + Result := nil; + Assert(Obj <> nil); + if Obj is TCustomDASQL then + Result := TCustomDASQL(Obj).Macros + else + if Obj is TCustomDADataSet then + Result := TCustomDADataSet(Obj).Macros + else + if Obj is TDAScript then + Result := TDAScript(Obj).Macros + else + Assert(False, Obj.ClassName); +end; + +class procedure TDADesignUtilsAlias.SetMacros(Obj: TComponent; Value: TMacros); +begin + Assert(Obj <> nil); + if Obj is TCustomDASQL then + TCustomDASQL(Obj).Macros := Value + else + if Obj is TCustomDADataSet then + TCustomDADataSet(Obj).Macros := Value + else + if Obj is TDAScript then + TDAScript(Obj).Macros := Value + else + Assert(False, Obj.ClassName); +end; + +class procedure TDADesignUtilsAlias.Execute(Obj: TComponent); +begin + Assert(Obj <> nil); + if Obj is TCustomDASQL then + TCustomDASQL(Obj).Execute + else + if Obj is TCustomDADataSet then + TCustomDADataSet(Obj).Execute + else + Assert(False, Obj.ClassName); +end; + +class function TDADesignUtilsAlias.GetAfterExecute(Obj: TComponent): DBAccess.TAfterExecuteEvent; +begin + Result := nil; + Assert(Obj <> nil); + if Obj is TCustomDASQL then + Result := TCustomDASQL(Obj).AfterExecute + else + if Obj is TCustomDADataSet then + Result := TCustomDADataSet(Obj).AfterExecute + else + Assert(False, Obj.ClassName); +end; + +class procedure TDADesignUtilsAlias.SetAfterExecute(Obj: TComponent; Value: DBAccess.TAfterExecuteEvent); +begin + Assert(Obj <> nil); + if Obj is TCustomDASQL then + TCustomDASQL(Obj).AfterExecute := Value + else + if Obj is TCustomDADataSet then + TCustomDADataSet(Obj).AfterExecute := Value + else + Assert(False, Obj.ClassName); +end; + +{$IFNDEF VER8}class{$ENDIF} function TDADesignUtilsAlias.GetTableName(Obj: TCustomDADAtaSet): string; +begin + Result := ''; + Assert(False, 'Must be overriden - D8 bug'); +end; + +{$IFNDEF VER8}class{$ENDIF} procedure TDADesignUtilsAlias.SetTableName(Obj: TCustomDADAtaSet; Value: string); +begin + Assert(False, 'Must be overriden - D8 bug'); +end; + +{$IFNDEF VER8}class{$ENDIF} function TDADesignUtilsAlias.GetOrderFields(Obj: TCustomDADAtaSet): string; +begin + Result := ''; + Assert(False, 'Must be overriden - D8 bug'); +end; + +{$IFNDEF VER8}class{$ENDIF} procedure TDADesignUtilsAlias.SetOrderFields(Obj: TCustomDADAtaSet; Value: string); +begin + Assert(False, 'Must be overriden - D8 bug'); +end; + +{$IFNDEF VER8}class{$ENDIF} procedure TDADesignUtilsAlias.PrepareSQL(Obj: TCustomDADAtaSet); +begin + Assert(False, 'Must be overriden - D8 bug'); +end; + +{$IFNDEF VER8}class{$ENDIF} function TDADesignUtilsAlias.GetStoredProcName(Obj: TCustomDADataSet): string; +begin + Assert(False, 'Must be overriden - D8 bug'); +end; + +{$IFNDEF VER8}class{$ENDIF} procedure TDADesignUtilsAlias.SetStoredProcName(Obj: TCustomDADataSet; Value: string); +begin + Assert(False, 'Must be overriden - D8 bug'); +end; + +{$IFDEF USE_SYNEDIT} +{$IFNDEF VER8}class{$ENDIF} function TDADesignUtilsAlias.SQLDialect: integer; +begin + Result := 0; // sqlStandard +end; +{$ENDIF} + +class function TDADesignUtilsAlias.DBToolsAvailable: boolean; +begin + Result := {$IFDEF DBTOOLS}DBToolsService <> nil{$ELSE}False{$ENDIF}; +end; + +{$IFDEF DBTOOLS} +class function TDADesignUtilsAlias.HasParams(Obj: TComponent): boolean; +begin + Result := (Obj is TCustomDASQL) or (Obj is TCustomDADataSet); +end; + +class function TDADesignUtilsAlias.GetFullName(Obj: TComponent): string; +begin + Result := ''; + if not (Obj is TCustomDAConnection) then + Assert(False, Obj.ClassName); +end; + +class function TDADesignUtilsAlias.GetObjectType(Obj: TComponent): string; +begin + Result := ''; + if not (Obj is TCustomDAConnection) then + Assert(False, Obj.ClassName); +end; + +class function TDADesignUtilsAlias.DBToolsService: TObject; +begin + Result := nil; +end; + +class function TDADesignUtilsAlias.NeedToCheckDbTools: TNeedToCheckDbTools; +begin + Result := ncNone; + Assert(False, 'Must be overriden'); +end; + +class function TDADesignUtilsAlias.GetDBToolsServiceVersion: int64; +begin + Result := 0; + Assert(False, 'Must be overriden'); +end; + +class function TDADesignUtilsAlias.GetDBToolsServiceVersionStr: string; +var + n: int64; + i: integer; +begin + n := GetDBToolsServiceVersion; + Result := ''; + for i := 0 to 3 do begin + Result := IntToStr(n and $ffff) + Result; + if i < 3 then begin + Result := '.' + Result; + n := n shr 16; + end; + end; +end; + +class function TDADesignUtilsAlias.GetDBToolsMenuCaption: string; +begin + Result := ''; + Assert(False, 'Must be overriden'); +end; + +class procedure TDADesignUtilsAlias.GetDBToolsConnectionList(Connection: TCustomDAConnection); +begin + Assert(False, 'Must be overriden'); +end; + +class procedure TDADesignUtilsAlias.SetDBToolsDownloadParams(VerbCheck: boolean; Incompatible: boolean); +begin + Assert(False, 'Must be overriden'); +end; + +class function TDADesignUtilsAlias.IsStoredProc(Obj: TComponent): boolean; +begin + Result := False; + Assert(False, 'Must be overriden'); +end; +{$ENDIF} + +initialization +{$IFDEF VER8} + TDADesignUtils := TDADesignUtilsAlias.Create; +{$ENDIF} + +finalization +{$IFDEF VER8} + TDADesignUtils.Free; +{$ENDIF} + + +end. diff --git a/internal/4.10.0.10/1/Source/Design/DADualListEditor.dfm b/internal/4.10.0.10/1/Source/Design/DADualListEditor.dfm new file mode 100644 index 0000000..d4b045d --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DADualListEditor.dfm @@ -0,0 +1,363 @@ +inherited DADualListEditorForm: TDADualListEditorForm + Left = 339 + Top = 221 + Width = 524 + Height = 332 + HorzScrollBar.Visible = False + VertScrollBar.Visible = False + BorderStyle = bsSizeToolWin + Caption = 'Select Tables' + Constraints.MinHeight = 332 + Constraints.MinWidth = 513 + OnResize = FormResize + PixelsPerInch = 96 + TextHeight = 13 + inherited BtnPanel: TPanel + Top = 257 + Width = 516 + TabOrder = 4 + inherited imCorner: TImage + Left = 504 + end + inherited btOk: TBitBtn + Left = 320 + end + inherited btCancel: TBitBtn + Left = 401 + end + end + object Panel2: TPanel + Left = 0 + Top = 0 + Width = 230 + Height = 257 + Align = alLeft + BevelOuter = bvNone + TabOrder = 0 + object SrcLabel: TLabel + Left = 8 + Top = 8 + Width = 214 + Height = 16 + AutoSize = False + Caption = 'Available tables' + end + object SrcList: TListBox + Left = 8 + Top = 24 + Width = 214 + Height = 230 + Anchors = [akLeft, akTop, akRight, akBottom] + DragMode = dmAutomatic + ItemHeight = 13 + MultiSelect = True + Sorted = True + TabOrder = 0 + OnClick = ListClick + OnDblClick = IncludeBtnClick + OnDragDrop = SrcListDragDrop + OnDragOver = SrcListDragOver + end + end + object PanelButtons: TPanel + Left = 230 + Top = 0 + Width = 24 + Height = 257 + Align = alLeft + BevelOuter = bvNone + TabOrder = 1 + object IncludeBtn: TSpeedButton + Left = 0 + Top = 32 + Width = 24 + Height = 24 + Caption = '>' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [] + ParentFont = False + OnClick = IncludeBtnClick + end + object IncAllBtn: TSpeedButton + Left = 0 + Top = 64 + Width = 24 + Height = 24 + Caption = '>>' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [] + ParentFont = False + OnClick = IncAllBtnClick + end + object ExcludeBtn: TSpeedButton + Left = 0 + Top = 96 + Width = 24 + Height = 24 + Caption = '<' + Enabled = False + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [] + ParentFont = False + OnClick = ExcludeBtnClick + end + object ExAllBtn: TSpeedButton + Left = 0 + Top = 128 + Width = 24 + Height = 24 + Caption = '<<' + Enabled = False + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [] + ParentFont = False + OnClick = ExcAllBtnClick + end + end + object Panel3: TPanel + Left = 254 + Top = 0 + Width = 231 + Height = 257 + Align = alClient + BevelOuter = bvNone + TabOrder = 2 + object DstLabel: TLabel + Left = 8 + Top = 8 + Width = 214 + Height = 16 + AutoSize = False + Caption = 'Selected tables' + end + object DstList: TListBox + Left = 8 + Top = 24 + Width = 214 + Height = 230 + Anchors = [akLeft, akTop, akRight, akBottom] + DragMode = dmAutomatic + ItemHeight = 13 + MultiSelect = True + TabOrder = 0 + OnClick = ListClick + OnDblClick = ExcludeBtnClick + OnDragDrop = DstListDragDrop + OnDragOver = DstListDragOver + OnKeyDown = DstListKeyDown + end + end + object PanelButtons2: TPanel + Left = 485 + Top = 0 + Width = 31 + Height = 257 + Align = alRight + BevelOuter = bvNone + TabOrder = 3 + object UpBtn: TSpeedButton + Left = 0 + Top = 32 + Width = 24 + Height = 24 + Enabled = False + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [] + Glyph.Data = { + 96090000424D9609000000000000360000002800000028000000140000000100 + 1800000000006009000000000000000000000000000000000000FFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8080808080808080808080 + 80808080FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF808080808080808080808080808080 + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFF800000800000800000800000800000808080FFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFF800000800000800000800000800000808080FFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFF0000FF0000FF0000FF0000800000808080FFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC0C0 + C0C0C0C0C0C0C0C0C0C0800000808080FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000FF0000 + FF0000FF0000800000808080FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC0C0C0C0C0C0C0C0C0C0 + C0C0800000808080FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000FF0000FF0000FF00008000 + 00808080FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFC0C0C0C0C0C0C0C0C0C0C0C0800000808080 + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFF0000FF0000FF0000FF0000800000808080FFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFC0C0C0C0C0C0C0C0C0C0C0C0800000808080FFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFF0000FF0000FF0000FF0000800000808080808080808080FFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC0C0 + C0C0C0C0C0C0C0C0C0C0800000808080808080808080FFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000FF0000FF0000FF0000 + FF0000FF0000FF0000FF0000FF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0 + C0C0C0C0C0C0C0C0C0C0C0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000FF0000FF0000FF0000FF0000FF00 + 00FF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFC0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0 + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFF0000FF0000FF0000FF0000FF0000FFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFC0C0C0C0C0C0C0C0C0C0C0C0C0C0C0FFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFF0000FF0000FF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFC0C0C0C0C0C0C0C0C0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC0C0C0FF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF} + NumGlyphs = 2 + ParentFont = False + OnClick = UpBtnClick + end + object DownBtn: TSpeedButton + Left = 0 + Top = 64 + Width = 24 + Height = 24 + Enabled = False + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [] + Glyph.Data = { + 96090000424D9609000000000000360000002800000028000000140000000100 + 1800000000006009000000000000000000000000000000000000FFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF808080FFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF808080FFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF800000808080808080FFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFF800000808080808080FFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFF0000FF0000800000808080808080FFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFC0C0C0C0C0C0800000808080808080FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000FF0000 + FF0000FF0000800000808080808080FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC0C0C0C0C0C0C0C0C0C0 + C0C0800000808080808080FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000FF0000FF0000FF0000FF0000FF00 + 00800000808080808080FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFC0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0800000 + 808080808080FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFF0000FF0000FF0000FF0000FF0000FF0000800000800000800000FF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0800000800000800000FFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFF0000FF0000FF0000FF0000800000808080FFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC0C0 + C0C0C0C0C0C0C0C0C0C0800000808080FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000FF0000 + FF0000FF0000800000808080FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC0C0C0C0C0C0C0C0C0C0 + C0C0800000808080FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000FF0000FF0000FF00008000 + 00808080FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFC0C0C0C0C0C0C0C0C0C0C0C0800000808080 + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFF0000FF0000FF0000FF0000800000808080FFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFC0C0C0C0C0C0C0C0C0C0C0C0800000808080FFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFF0000FF0000FF0000FF0000800000808080FFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC0C0 + C0C0C0C0C0C0C0C0C0C0800000808080FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000FF0000 + FF0000FF0000800000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC0C0C0C0C0C0C0C0C0C0 + C0C0800000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF} + NumGlyphs = 2 + ParentFont = False + OnClick = DownBtnClick + end + end +end diff --git a/internal/4.10.0.10/1/Source/Design/DADualListEditor.pas b/internal/4.10.0.10/1/Source/Design/DADualListEditor.pas new file mode 100644 index 0000000..c82304e --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DADualListEditor.pas @@ -0,0 +1,328 @@ + +////////////////////////////////////////////////// +// DB Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +// Dual List Editor +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I Dac.inc} + +unit DADualListEditor; +{$ENDIF} + +interface + +uses +{$IFDEF MSWINDOWS} + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + ComCtrls, Grids, DBGrids, DBCtrls, Buttons, ExtCtrls, StdCtrls, +{$ENDIF} +{$IFDEF LINUX} + Qt, SysUtils, Types, Classes, QGraphics, QControls, QForms, QDialogs, QStdCtrls, + QComCtrls, QGrids, QDBGrids, QDBCtrls, QButtons, QExtCtrls, +{$ENDIF} + CREditor, DBAccess; + +type + TDADualListEditorForm = class(TCREditorForm) + Panel2: TPanel; + SrcLabel: TLabel; + SrcList: TListBox; + PanelButtons: TPanel; + IncludeBtn: TSpeedButton; + IncAllBtn: TSpeedButton; + ExcludeBtn: TSpeedButton; + ExAllBtn: TSpeedButton; + Panel3: TPanel; + DstLabel: TLabel; + DstList: TListBox; + PanelButtons2: TPanel; + UpBtn: TSpeedButton; + DownBtn: TSpeedButton; + procedure IncludeBtnClick(Sender: TObject); + procedure ExcludeBtnClick(Sender: TObject); + procedure IncAllBtnClick(Sender: TObject); + procedure ExcAllBtnClick(Sender: TObject); + procedure DstListDragOver(Sender, Source: TObject; X, Y: Integer; + State: TDragState; var Accept: Boolean); + procedure DstListDragDrop(Sender, Source: TObject; X, Y: Integer); + procedure SrcListDragOver(Sender, Source: TObject; X, Y: Integer; + State: TDragState; var Accept: Boolean); + procedure SrcListDragDrop(Sender, Source: TObject; X, Y: Integer); + procedure FormResize(Sender: TObject); + procedure UpBtnClick(Sender: TObject); + procedure DownBtnClick(Sender: TObject); + procedure DstListKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); + procedure ListClick(Sender: TObject); + protected + procedure DoInit; override; + + procedure MoveSelected(Source, Dest: TListBox; Index: Integer; SelectNext: boolean); + procedure MoveAll(Source, Dest: TListBox; Index: Integer); + procedure Move(List: TListBox; FromIndex, ToIndex: integer); + function GetFirstSelection(List: TCustomListBox): Integer; + procedure SetButtons; + + function GetSrcLabelCaption: string; virtual; + procedure GetSrcListItems(Items: TStrings); virtual; + function GetDestLabelCaption: string; virtual; + procedure GetDstListItems(Items: TStrings); virtual; + end; + +implementation + +{$IFDEF IDE} +{$R *.dfm} +{$ENDIF} +{$IFDEF MSWINDOWS} +{$R DADualListEditor.dfm} +{$ENDIF} +{$IFDEF LINUX} +{$R *.xfm} +{$ENDIF} + +procedure TDADualListEditorForm.IncludeBtnClick(Sender: TObject); +begin + MoveSelected(SrcList, DstList, DstList.Items.Count, True); +end; + +procedure TDADualListEditorForm.ExcludeBtnClick(Sender: TObject); +begin + MoveSelected(DstList, SrcList, SrcList.Items.Count, True); +end; + +procedure TDADualListEditorForm.IncAllBtnClick(Sender: TObject); +begin + MoveAll(SrcList, DstList, DstList.Items.Count); +end; + +procedure TDADualListEditorForm.ExcAllBtnClick(Sender: TObject); +begin + MoveAll(DstList, SrcList, SrcList.Items.Count); +end; + +procedure TDADualListEditorForm.MoveSelected(Source, Dest: TListBox; Index: Integer; + SelectNext: boolean); +var + i, FirstSel: integer; +begin + for i := 0 to Dest.Items.Count - 1 do + Dest.Selected[i] := False; + + FirstSel := -1; + for i := Source.Items.Count - 1 downto 0 do + if Source.Selected[i] then begin + if Dest.Sorted then + Dest.Items.AddObject(Source.Items[i], Source.Items.Objects[i]) + else begin + Dest.Items.InsertObject(Index, Source.Items[i], Source.Items.Objects[i]); + Dest.Selected[Index] := True; + end; + Source.Items.Delete(i); + FirstSel := i; + end; + + if FirstSel >= 0 then begin + if SelectNext then + if Source.Items.Count > FirstSel then + Source.Selected[FirstSel] := True + else + if Source.Items.Count > 0 then + Source.Selected[Source.Items.Count - 1] := True; + Modified := True; + SetButtons; + end; +end; + +procedure TDADualListEditorForm.MoveAll(Source, Dest: TListBox; Index: Integer); +var + i: integer; +begin + for i := 0 to Dest.Items.Count - 1 do + Dest.Selected[i] := False; + + for i := Source.Items.Count - 1 downto 0 do + if Dest.Sorted then + Dest.Items.AddObject(Source.Items[i], Source.Items.Objects[i]) + else begin + Dest.Items.InsertObject(Index, Source.Items[i], Source.Items.Objects[i]); + Dest.Selected[Index] := True; + end; + Source.Items.Clear; + + Modified := True; + SetButtons; +end; + +procedure TDADualListEditorForm.SetButtons; +var + SrcEmpty, DstEmpty: Boolean; +begin + SrcEmpty := SrcList.Items.Count = 0; + DstEmpty := DstList.Items.Count = 0; + IncludeBtn.Enabled := SrcList.SelCount > 0; + IncAllBtn.Enabled := not SrcEmpty; + ExcludeBtn.Enabled := DstList.SelCount > 0; + ExAllBtn.Enabled := not DstEmpty; + UpBtn.Enabled := (DstList.SelCount = 1) and (GetFirstSelection(DstList) > 0); + DownBtn.Enabled := (DstList.SelCount = 1) and (GetFirstSelection(DstList) < DstList.Items.Count - 1); +end; + +function TDADualListEditorForm.GetFirstSelection(List: TCustomListBox): Integer; +var + i: integer; +begin + for i := 0 to List.Items.Count - 1 do + if List.Selected[i] then begin + Result := i; + Exit; + end; + Result := -1; +end; + +procedure TDADualListEditorForm.DoInit; +var + i, j: integer; +begin + inherited; + + SrcLabel.Caption := GetSrcLabelCaption; + GetSrcListItems(SrcList.Items); + DstLabel.Caption := GetDestLabelCaption; + GetDstListItems(DstList.Items); + + for i := 0 to DstList.Items.Count - 1 do begin + j := SrcList.Items.IndexOf(DstList.Items[i]); + if j <> -1 then + SrcList.Items.Delete(j); + end; + + SetButtons; + ConfirmCancel := False; + Modified := False; + FormResize(nil); +end; + +procedure TDADualListEditorForm.DstListDragOver(Sender, Source: TObject; X, + Y: Integer; State: TDragState; var Accept: Boolean); +begin + Accept := (Source = SrcList) and (SrcList.SelCount > 0) or + (Source = DstList) and (DstList.SelCount = 1); +end; + +procedure TDADualListEditorForm.DstListDragDrop(Sender, Source: TObject; X, + Y: Integer); +var + pos: TPoint; + Index, SelIndex: Integer; +begin + pos.X := X; + pos.Y := Y; + Index := DstList.ItemAtPos(pos, False); + if Source = SrcList then + MoveSelected(SrcList, DstList, Index, False) + else + if Source = DstList then begin + SelIndex := GetFirstSelection(DstList); + Move(DstList, SelIndex, Index); + end; +end; + +procedure TDADualListEditorForm.SrcListDragOver(Sender, Source: TObject; X, + Y: Integer; State: TDragState; var Accept: Boolean); +begin + Accept := (Source = DstList) and (DstList.SelCount > 0); +end; + +procedure TDADualListEditorForm.SrcListDragDrop(Sender, Source: TObject; X, + Y: Integer); +var + pos: TPoint; + Index: Integer; +begin + if Source = DstList then begin + pos.X := X; + pos.Y := Y; + Index := SrcList.ItemAtPos(pos, False); + MoveSelected(DstList, SrcList, Index, False); + end; +end; + +procedure TDADualListEditorForm.FormResize(Sender: TObject); +begin + inherited; + Panel2.Width := (ClientWidth - PanelButtons.Width * 2) div 2; +end; + +function TDADualListEditorForm.GetSrcLabelCaption: string; +begin + Result := 'Source list items'; +end; + +procedure TDADualListEditorForm.GetSrcListItems(Items: TStrings); +begin + Items.Clear; +end; + +function TDADualListEditorForm.GetDestLabelCaption: string; +begin + Result := 'Destination list items'; +end; + +procedure TDADualListEditorForm.GetDstListItems(Items: TStrings); +begin + Items.Clear; +end; + +procedure TDADualListEditorForm.Move(List: TListBox; FromIndex, ToIndex: integer); +begin + if (FromIndex >= 0) and (ToIndex >= 0) and (ToIndex < List.Items.Count) and (FromIndex <> ToIndex) + then begin + List.Items.Move(FromIndex, ToIndex); + List.Selected[ToIndex] := True; + Modified := True; + SetButtons; + end; +end; + +procedure TDADualListEditorForm.UpBtnClick(Sender: TObject); +var + SelIndex: integer; +begin + SelIndex := GetFirstSelection(DstList); + Move(DstList, SelIndex, SelIndex - 1); +end; + +procedure TDADualListEditorForm.DownBtnClick(Sender: TObject); +var + SelIndex: integer; +begin + SelIndex := GetFirstSelection(DstList); + Move(DstList, SelIndex, SelIndex + 1); +end; + +procedure TDADualListEditorForm.DstListKeyDown(Sender: TObject; + var Key: Word; Shift: TShiftState); +begin + if Shift = [ssCtrl] then + case Key of + {$IFDEF LINUX}Key_Up{$ELSE}VK_UP{$ENDIF}: begin + UpBtnClick(nil); + Key := 0; + end; + {$IFDEF LINUX}Key_Down{$ELSE}VK_DOWN{$ENDIF}: begin + DownBtnClick(nil); + Key := 0; + end; + end; +end; + +procedure TDADualListEditorForm.ListClick(Sender: TObject); +begin + SetButtons; +end; + +end. diff --git a/internal/4.10.0.10/1/Source/Design/DADualListEditor.xfm b/internal/4.10.0.10/1/Source/Design/DADualListEditor.xfm new file mode 100644 index 0000000..bd83db4 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DADualListEditor.xfm @@ -0,0 +1,363 @@ +inherited DADualListEditorForm: TDADualListEditorForm + Left = 339 + Top = 221 + Width = 524 + Height = 332 + HorzScrollBar.Visible = False + VertScrollBar.Visible = False + BorderStyle = fbsSizeToolWin + Caption = 'Select Tables' + Constraints.MinHeight = 332 + Constraints.MinWidth = 513 + OnResize = FormResize + PixelsPerInch = 96 + TextHeight = 13 + inherited BtnPanel: TPanel + Top = 257 + Width = 516 + TabOrder = 4 + inherited imCorner: TImage + Left = 504 + end + inherited btOk: TBitBtn + Left = 320 + end + inherited btCancel: TBitBtn + Left = 401 + end + end + object Panel2: TPanel + Left = 0 + Top = 0 + Width = 230 + Height = 257 + Align = alLeft + BevelOuter = bvNone + TabOrder = 0 + object SrcLabel: TLabel + Left = 8 + Top = 8 + Width = 214 + Height = 16 + AutoSize = False + Caption = 'Available tables' + end + object SrcList: TListBox + Left = 8 + Top = 24 + Width = 214 + Height = 230 + Anchors = [akLeft, akTop, akRight, akBottom] + DragMode = dmAutomatic + ItemHeight = 13 + MultiSelect = True + Sorted = True + TabOrder = 0 + OnClick = ListClick + OnDblClick = IncludeBtnClick + OnDragDrop = SrcListDragDrop + OnDragOver = SrcListDragOver + end + end + object PanelButtons: TPanel + Left = 230 + Top = 0 + Width = 24 + Height = 257 + Align = alLeft + BevelOuter = bvNone + TabOrder = 1 + object IncludeBtn: TSpeedButton + Left = 0 + Top = 32 + Width = 24 + Height = 24 + Caption = '>' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [] + ParentFont = False + OnClick = IncludeBtnClick + end + object IncAllBtn: TSpeedButton + Left = 0 + Top = 64 + Width = 24 + Height = 24 + Caption = '>>' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [] + ParentFont = False + OnClick = IncAllBtnClick + end + object ExcludeBtn: TSpeedButton + Left = 0 + Top = 96 + Width = 24 + Height = 24 + Caption = '<' + Enabled = False + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [] + ParentFont = False + OnClick = ExcludeBtnClick + end + object ExAllBtn: TSpeedButton + Left = 0 + Top = 128 + Width = 24 + Height = 24 + Caption = '<<' + Enabled = False + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [] + ParentFont = False + OnClick = ExcAllBtnClick + end + end + object Panel3: TPanel + Left = 254 + Top = 0 + Width = 231 + Height = 257 + Align = alClient + BevelOuter = bvNone + TabOrder = 2 + object DstLabel: TLabel + Left = 8 + Top = 8 + Width = 214 + Height = 16 + AutoSize = False + Caption = 'Selected tables' + end + object DstList: TListBox + Left = 8 + Top = 24 + Width = 214 + Height = 230 + Anchors = [akLeft, akTop, akRight, akBottom] + DragMode = dmAutomatic + ItemHeight = 13 + MultiSelect = True + TabOrder = 0 + OnClick = ListClick + OnDblClick = ExcludeBtnClick + OnDragDrop = DstListDragDrop + OnDragOver = DstListDragOver + OnKeyDown = DstListKeyDown + end + end + object PanelButtons2: TPanel + Left = 485 + Top = 0 + Width = 31 + Height = 257 + Align = alRight + BevelOuter = bvNone + TabOrder = 3 + object UpBtn: TSpeedButton + Left = 0 + Top = 32 + Width = 24 + Height = 24 + Enabled = False + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [] + Glyph.Data = { + 96090000424D9609000000000000360000002800000028000000140000000100 + 1800000000006009000000000000000000000000000000000000FFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8080808080808080808080 + 80808080FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF808080808080808080808080808080 + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFF800000800000800000800000800000808080FFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFF800000800000800000800000800000808080FFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFF0000FF0000FF0000FF0000800000808080FFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC0C0 + C0C0C0C0C0C0C0C0C0C0800000808080FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000FF0000 + FF0000FF0000800000808080FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC0C0C0C0C0C0C0C0C0C0 + C0C0800000808080FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000FF0000FF0000FF00008000 + 00808080FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFC0C0C0C0C0C0C0C0C0C0C0C0800000808080 + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFF0000FF0000FF0000FF0000800000808080FFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFC0C0C0C0C0C0C0C0C0C0C0C0800000808080FFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFF0000FF0000FF0000FF0000800000808080808080808080FFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC0C0 + C0C0C0C0C0C0C0C0C0C0800000808080808080808080FFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000FF0000FF0000FF0000 + FF0000FF0000FF0000FF0000FF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0 + C0C0C0C0C0C0C0C0C0C0C0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000FF0000FF0000FF0000FF0000FF00 + 00FF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFC0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0 + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFF0000FF0000FF0000FF0000FF0000FFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFC0C0C0C0C0C0C0C0C0C0C0C0C0C0C0FFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFF0000FF0000FF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFC0C0C0C0C0C0C0C0C0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC0C0C0FF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF} + NumGlyphs = 2 + ParentFont = False + OnClick = UpBtnClick + end + object DownBtn: TSpeedButton + Left = 0 + Top = 64 + Width = 24 + Height = 24 + Enabled = False + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [] + Glyph.Data = { + 96090000424D9609000000000000360000002800000028000000140000000100 + 1800000000006009000000000000000000000000000000000000FFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF808080FFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF808080FFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF800000808080808080FFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFF800000808080808080FFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFF0000FF0000800000808080808080FFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFC0C0C0C0C0C0800000808080808080FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000FF0000 + FF0000FF0000800000808080808080FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC0C0C0C0C0C0C0C0C0C0 + C0C0800000808080808080FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000FF0000FF0000FF0000FF0000FF00 + 00800000808080808080FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFC0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0800000 + 808080808080FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFF0000FF0000FF0000FF0000FF0000FF0000800000800000800000FF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0800000800000800000FFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFF0000FF0000FF0000FF0000800000808080FFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC0C0 + C0C0C0C0C0C0C0C0C0C0800000808080FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000FF0000 + FF0000FF0000800000808080FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC0C0C0C0C0C0C0C0C0C0 + C0C0800000808080FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000FF0000FF0000FF00008000 + 00808080FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFC0C0C0C0C0C0C0C0C0C0C0C0800000808080 + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFF0000FF0000FF0000FF0000800000808080FFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFC0C0C0C0C0C0C0C0C0C0C0C0800000808080FFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFF0000FF0000FF0000FF0000800000808080FFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC0C0 + C0C0C0C0C0C0C0C0C0C0800000808080FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000FF0000 + FF0000FF0000800000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC0C0C0C0C0C0C0C0C0C0 + C0C0800000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF} + NumGlyphs = 2 + ParentFont = False + OnClick = DownBtnClick + end + end +end diff --git a/internal/4.10.0.10/1/Source/Design/DADumpEditor.dfm b/internal/4.10.0.10/1/Source/Design/DADumpEditor.dfm new file mode 100644 index 0000000..ec1e6a7 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DADumpEditor.dfm @@ -0,0 +1,130 @@ +inherited DADumpEditorForm: TDADumpEditorForm + Left = 336 + Top = 182 + Height = 468 + Caption = 'DADumpEditorForm' + PixelsPerInch = 96 + TextHeight = 13 + inherited BtnPanel: TPanel + Top = 393 + end + object ClientPanel: TPanel + Left = 0 + Top = 0 + Width = 505 + Height = 393 + Align = alClient + Constraints.MinHeight = 257 + Constraints.MinWidth = 489 + TabOrder = 1 + object meSQL: TMemo + Left = 233 + Top = 1 + Width = 271 + Height = 391 + Align = alClient + ScrollBars = ssBoth + TabOrder = 1 + WordWrap = False + OnExit = meSQLExit + end + object LeftPanel: TPanel + Left = 1 + Top = 1 + Width = 232 + Height = 391 + Align = alLeft + BevelOuter = bvNone + BevelWidth = 5 + Constraints.MinHeight = 335 + TabOrder = 0 + object gbBackupOptions: TGroupBox + Left = 8 + Top = 8 + Width = 217 + Height = 313 + Caption = 'Backup Options' + TabOrder = 0 + object lbTableNames: TLabel + Left = 8 + Top = 20 + Width = 63 + Height = 13 + Caption = 'Table Names' + end + object cbTableNames: TComboBox + Left = 8 + Top = 40 + Width = 201 + Height = 21 + Anchors = [akLeft, akTop, akRight] + DropDownCount = 16 + ItemHeight = 13 + TabOrder = 1 + OnChange = cbTableNamesChange + OnDropDown = cbTableNamesDropDown + end + object cbGenerateHeader: TCheckBox + Left = 8 + Top = 128 + Width = 201 + Height = 17 + Caption = 'Generate Header' + TabOrder = 0 + end + end + object btBackup: TBitBtn + Left = 16 + Top = 328 + Width = 97 + Height = 25 + Caption = 'Backup' + TabOrder = 1 + OnClick = btBackupClick + end + object btRestore: TBitBtn + Left = 121 + Top = 328 + Width = 96 + Height = 25 + Caption = 'Restore' + TabOrder = 2 + OnClick = btRestoreClick + end + object btImport: TBitBtn + Left = 16 + Top = 359 + Width = 97 + Height = 25 + Caption = 'Import from file' + TabOrder = 3 + OnClick = btImportClick + end + object btExport: TBitBtn + Left = 120 + Top = 359 + Width = 97 + Height = 25 + Caption = 'Export to file' + TabOrder = 4 + OnClick = btExportClick + end + end + end + object OpenDialog: TOpenDialog + DefaultExt = 'sql' + Filter = 'Query files (*.sql)|*.sql|All files (*.*)|*.*' + FilterIndex = 0 + Options = [ofHideReadOnly, ofFileMustExist, ofEnableSizing] + Left = 321 + Top = 25 + end + object SaveDialog: TSaveDialog + DefaultExt = 'sql' + Filter = 'Query files (*.sql)|*.sql|All files (*.*)|*.*' + FilterIndex = 0 + Options = [ofOverwritePrompt, ofHideReadOnly, ofEnableSizing] + Left = 353 + Top = 25 + end +end diff --git a/internal/4.10.0.10/1/Source/Design/DADumpEditor.pas b/internal/4.10.0.10/1/Source/Design/DADumpEditor.pas new file mode 100644 index 0000000..da37c8c --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DADumpEditor.pas @@ -0,0 +1,249 @@ + +////////////////////////////////////////////////// +// Data Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +// DADump Editor +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I Dac.inc} + +unit DADumpEditor; +{$ENDIF} + +interface + +uses +{$IFDEF MSWINDOWS} + Windows, Messages, Graphics, Controls, Forms, Dialogs, + ComCtrls, StdCtrls, ExtCtrls, Buttons, DacVcl, +{$ENDIF} +{$IFDEF LINUX} + Types, QGraphics, QControls, QForms, QDialogs, QStdCtrls, + QExtCtrls, QComCtrls, QButtons, DacClx, +{$ENDIF} +{$IFDEF DBTOOLS} + DBToolsClient, +{$ENDIF} + SysUtils, Classes, CREditor, DBAccess, DADump, DADesignUtils, DADualListEditor; + +type + TDADumpEditorForm = class(TCREditorForm) + ClientPanel: TPanel; + LeftPanel: TPanel; + meSQL: TMemo; + gbBackupOptions: TGroupBox; + cbGenerateHeader: TCheckBox; + btBackup: TBitBtn; + btRestore: TBitBtn; + btImport: TBitBtn; + btExport: TBitBtn; + OpenDialog: TOpenDialog; + SaveDialog: TSaveDialog; + cbTableNames: TComboBox; + lbTableNames: TLabel; + procedure btBackupClick(Sender: TObject); + procedure btRestoreClick(Sender: TObject); + procedure meSQLExit(Sender: TObject); + procedure btImportClick(Sender: TObject); + procedure btExportClick(Sender: TObject); + procedure SaveClick(Sender: TObject); + procedure cbTableNamesChange(Sender: TObject); + procedure cbTableNamesDropDown(Sender: TObject); + protected + FDump, FLocalDump: TDADump; + + procedure EditTableNames(Sender: TObject); virtual; + procedure DoInit; override; + procedure DoSave; override; + procedure DoFinish; override; + + procedure GetButtons; virtual; + procedure SetButtons; virtual; + + function GetComponent: TComponent; override; + procedure SetComponent(Value: TComponent); override; + function GetLocalComponent: TComponent; override; + public + property Dump: TDADump read FDump write FDump; + end; + +implementation + +uses + DAConsts, DADumpProgress; + +{$IFDEF IDE} +{$R *.dfm} +{$ENDIF} +{$IFDEF MSWINDOWS} +{$R DADumpEditor.dfm} +{$ENDIF} +{$IFDEF LINUX} +{$R *.xfm} +{$ENDIF} + +{ TDADumpEditorForm } + +procedure TDADumpEditorForm.DoInit; +{$IFDEF USE_SYNEDIT} +var + WinControl: TWinControl; +{$ENDIF} +begin + inherited; + +{$IFDEF USE_SYNEDIT} +{$IFDEF DBTOOLS} + if DADesignUtilsClass.DBToolsAvailable then + DBTools.ReplaceMemo(meSQL, DADesignUtilsClass, Component) + else begin +{$ENDIF} + WinControl := meSQL; + ReplaceMemo(WinControl, True); + meSQL := TMemo(WinControl); +{$IFDEF DBTOOLS} + end; +{$ENDIF} +{$ENDIF} + + FLocalDump := TComponentClass(Dump.ClassType).Create(nil) as TDADump; + FLocalDump.Assign(Dump); + + SetMemoText(meSQL, FLocalDump.SQL.Text); + + cbGenerateHeader.Checked := FLocalDump.Options.GenerateHeader; +end; + +procedure TDADumpEditorForm.DoSave; +begin + GetButtons; + Dump.Assign(FLocalDump); +end; + +procedure TDADumpEditorForm.DoFinish; +begin + FLocalDump.Free; +end; + +procedure TDADumpEditorForm.GetButtons; +begin + FLocalDump.Options.GenerateHeader := cbGenerateHeader.Checked; +end; + +procedure TDADumpEditorForm.SetButtons; +begin + btRestore.Enabled := Length(Trim(GetMemoText(meSQL))) > 0; +end; + +function TDADumpEditorForm.GetComponent: TComponent; +begin + Result := Dump; +end; + +function TDADumpEditorForm.GetLocalComponent: TComponent; +begin + Result := FLocalDump; +end; + +procedure TDADumpEditorForm.SetComponent(Value: TComponent); +begin + Dump := Value as TDADump; +end; + +procedure TDADumpEditorForm.btBackupClick(Sender: TObject); +var + OldChangeCursor: boolean; +begin + GetButtons; + + OldChangeCursor := ChangeCursor; + try + StartWait; + ChangeCursor := False; + with TDADumpProgressForm.Create(nil) do + try + if Dump.Owner <> nil then + Caption := Dump.Owner.Name + '.' + Dump.Name + else + Caption := Dump.Name; + DADump := FLocalDump; + Backup; + finally + Free; + end; + finally + SetMemoText(meSQL, FLocalDump.SQL.Text); + ChangeCursor := OldChangeCursor; + StopWait; + end; + Modified := True; + SetButtons; +end; + +procedure TDADumpEditorForm.btRestoreClick(Sender: TObject); +begin + if MessageDlg(SAreYouSureRestore, mtConfirmation, [mbYes,mbNo], 0) = mrNo then + Exit; + + with TDADumpProgressForm.Create(nil) do + try + if Dump.Owner <> nil then + Caption := Dump.Owner.Name + '.' + Dump.Name + else + Caption := Dump.Name; + DADump := FLocalDump; + Restore; + finally + Free; + end; +end; + +procedure TDADumpEditorForm.meSQLExit(Sender: TObject); +begin + if TrimRight(FLocalDump.SQL.Text) = TrimRight(GetMemoText(meSQL)) then + Exit; + + Modified := True; + FLocalDump.SQL.Text := GetMemoText(meSQL); + SetButtons; +end; + +procedure TDADumpEditorForm.btImportClick(Sender: TObject); +begin + if OpenDialog.Execute then + LoadFromFile(meSQL, OpenDialog.FileName); +end; + +procedure TDADumpEditorForm.btExportClick(Sender: TObject); +begin + if not SaveDialog.Execute then + Exit; + + meSQLExit(nil); + SaveToFile(meSQL, SaveDialog.FileName); +end; + +procedure TDADumpEditorForm.SaveClick(Sender: TObject); +begin + meSQLExit(nil); + inherited; +end; + +procedure TDADumpEditorForm.cbTableNamesChange(Sender: TObject); +begin + FLocalDump.TableNames := cbTableNames.Text; +end; + +procedure TDADumpEditorForm.cbTableNamesDropDown(Sender: TObject); +begin + EditTableNames(Sender); +end; + +procedure TDADumpEditorForm.EditTableNames(Sender: TObject); +begin +// +end; + +end. diff --git a/internal/4.10.0.10/1/Source/Design/DADumpEditor.xfm b/internal/4.10.0.10/1/Source/Design/DADumpEditor.xfm new file mode 100644 index 0000000..148084c --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DADumpEditor.xfm @@ -0,0 +1,128 @@ +inherited DADumpEditorForm: TDADumpEditorForm + Left = 336 + Top = 182 + Height = 468 + Caption = 'DADumpEditorForm' + PixelsPerInch = 96 + TextHeight = 13 + inherited BtnPanel: TPanel + Top = 393 + end + object ClientPanel: TPanel + Left = 0 + Top = 0 + Width = 505 + Height = 393 + Align = alClient + Constraints.MinHeight = 257 + Constraints.MinWidth = 489 + TabOrder = 1 + object meSQL: TMemo + Left = 233 + Top = 1 + Width = 271 + Height = 391 + Align = alClient + ScrollBars = ssBoth + TabOrder = 1 + WordWrap = False + OnExit = meSQLExit + end + object LeftPanel: TPanel + Left = 1 + Top = 1 + Width = 232 + Height = 391 + Align = alLeft + BevelOuter = bvNone + BevelWidth = 5 + Constraints.MinHeight = 335 + TabOrder = 0 + object gbBackupOptions: TGroupBox + Left = 8 + Top = 8 + Width = 217 + Height = 313 + Caption = 'Backup Options' + TabOrder = 0 + object lbTableNames: TLabel + Left = 8 + Top = 20 + Width = 63 + Height = 13 + Caption = 'Table Names' + end + object cbTableNames: TComboBox + Left = 8 + Top = 40 + Width = 201 + Height = 21 + Anchors = [akLeft, akTop, akRight] + DropDownCount = 16 + ItemHeight = 13 + TabOrder = 1 + OnChange = cbTableNamesChange + OnDropDown = cbTableNamesDropDown + end + object cbGenerateHeader: TCheckBox + Left = 8 + Top = 128 + Width = 201 + Height = 17 + Caption = 'Generate Header' + TabOrder = 0 + end + end + object btBackup: TBitBtn + Left = 16 + Top = 328 + Width = 97 + Height = 25 + Caption = 'Backup' + TabOrder = 1 + OnClick = btBackupClick + end + object btRestore: TBitBtn + Left = 121 + Top = 328 + Width = 96 + Height = 25 + Caption = 'Restore' + TabOrder = 2 + OnClick = btRestoreClick + end + object btImport: TBitBtn + Left = 16 + Top = 359 + Width = 97 + Height = 25 + Caption = 'Import from file' + TabOrder = 3 + OnClick = btImportClick + end + object btExport: TBitBtn + Left = 120 + Top = 359 + Width = 97 + Height = 25 + Caption = 'Export to file' + TabOrder = 4 + OnClick = btExportClick + end + end + end + object OpenDialog: TOpenDialog + DefaultExt = 'sql' + Filter = 'Query files (*.sql)|*.sql|All files (*.*)|*.*' + FilterIndex = 0 + Left = 321 + Top = 25 + end + object SaveDialog: TSaveDialog + DefaultExt = 'sql' + Filter = 'Query files (*.sql)|*.sql|All files (*.*)|*.*' + FilterIndex = 0 + Left = 353 + Top = 25 + end +end diff --git a/internal/4.10.0.10/1/Source/Design/DADumpProgress.dfm b/internal/4.10.0.10/1/Source/Design/DADumpProgress.dfm new file mode 100644 index 0000000..3af46ef --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DADumpProgress.dfm @@ -0,0 +1,78 @@ +object DADumpProgressForm: TDADumpProgressForm + Left = 656 + Top = 188 + BorderStyle = bsDialog + Caption = 'DADumpProgressForm' + ClientHeight = 131 + ClientWidth = 248 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + OnActivate = FormActivate + OnClose = FormClose + OnResize = FormResize + PixelsPerInch = 96 + TextHeight = 13 + object Label1: TLabel + Left = 8 + Top = 8 + Width = 41 + Height = 16 + Caption = 'Label1' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'MS Sans Serif' + Font.Style = [] + ParentFont = False + end + object BitBtn1: TBitBtn + Left = 86 + Top = 98 + Width = 75 + Height = 25 + Anchors = [akBottom] + Cancel = True + Caption = 'Cancel' + TabOrder = 0 + OnClick = BitBtn1Click + Glyph.Data = { + DE010000424DDE01000000000000760000002800000024000000120000000100 + 0400000000006801000000000000000000001000000000000000000000000000 + 80000080000000808000800000008000800080800000C0C0C000808080000000 + FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00333333333333 + 333333333333333333333333000033338833333333333333333F333333333333 + 0000333911833333983333333388F333333F3333000033391118333911833333 + 38F38F333F88F33300003339111183911118333338F338F3F8338F3300003333 + 911118111118333338F3338F833338F3000033333911111111833333338F3338 + 3333F8330000333333911111183333333338F333333F83330000333333311111 + 8333333333338F3333383333000033333339111183333333333338F333833333 + 00003333339111118333333333333833338F3333000033333911181118333333 + 33338333338F333300003333911183911183333333383338F338F33300003333 + 9118333911183333338F33838F338F33000033333913333391113333338FF833 + 38F338F300003333333333333919333333388333338FFF830000333333333333 + 3333333333333333333888330000333333333333333333333333333333333333 + 0000} + NumGlyphs = 2 + end + object ProgressBar1: TProgressBar + Left = 8 + Top = 32 + Width = 232 + Height = 25 + Anchors = [akLeft, akTop, akRight] + TabOrder = 1 + end + object ProgressBar2: TProgressBar + Left = 8 + Top = 65 + Width = 232 + Height = 25 + Anchors = [akLeft, akTop, akRight] + TabOrder = 2 + end +end diff --git a/internal/4.10.0.10/1/Source/Design/DADumpProgress.pas b/internal/4.10.0.10/1/Source/Design/DADumpProgress.pas new file mode 100644 index 0000000..5148df5 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DADumpProgress.pas @@ -0,0 +1,213 @@ +////////////////////////////////////////////////// +// DB Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +// DB Access +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I Dac.inc} + +unit DADumpProgress; +{$ENDIF} + +interface + +uses + SysUtils, Classes, +{$IFNDEF LINUX} + Windows, Messages, Graphics, Controls, Forms, Dialogs, + ComCtrls, Grids, DBGrids, DBCtrls, Buttons, ExtCtrls, StdCtrls, +{$ELSE} + QGraphics, QControls, QForms, QDialogs, QStdCtrls, + QComCtrls, QGrids, QDBGrids, QDBCtrls, QButtons, QExtCtrls, Qt, QTypes, +{$ENDIF} + DBAccess, DADump; + +type + TDADumpProgressForm = class(TForm) + Label1: TLabel; + BitBtn1: TBitBtn; + ProgressBar1: TProgressBar; + ProgressBar2: TProgressBar; + procedure DADumpBackupProgress(Sender: TObject; TableName: String; + TableNum, TableCount, Percent: Integer); + procedure DADumpRestoreProgress(Sender: TObject; Percent: Integer); + procedure FormActivate(Sender: TObject); + procedure BitBtn1Click(Sender: TObject); + procedure FormClose(Sender: TObject; var Action: TCloseAction); + procedure FormResize(Sender: TObject); + protected + IsBackup: boolean; + WaitForTerminate: boolean; + InProgress: boolean; + + procedure Process; + + {$IFDEF LINUX} + function EventFilter(Sender: QObjectH; Event: QEventH): Boolean; override; + {$ENDIF} + public + DADump: TDADump; + + procedure Backup; + procedure Restore; + end; + +implementation + +{$IFDEF IDE} +{$R *.dfm} +{$ENDIF} +{$IFDEF MSWINDOWS} +{$R DADumpProgress.dfm} +{$ENDIF} +{$IFDEF LINUX} +{$R *.xfm} +{$ENDIF} + +{$IFDEF LINUX} +const + QEventType_CMFormActivate = QEventType(Integer(QEventType_ClxBase) + $1000); +{$ENDIF} + +{ TDADumpProgressForm } + +procedure TDADumpProgressForm.Backup; +var + OldProgress: TDABackupProgressEvent; +begin + Assert(DADump <> nil); + OldProgress := DADump.OnBackupProgress; + try + Label1.Caption := 'Backup'; + IsBackup := True; + DADump.OnBackupProgress := DADumpBackupProgress; + + {$IFDEF LINUX} + // ShowMessage('1 ' + IntToStr(Integer(Self))); + QApplication_postEvent(Handle, QCustomEvent_create(QEventType_CMFormActivate, Self)); + // ShowMessage('2'); + {$ENDIF} + ShowModal; + finally + DADump.OnBackupProgress := OldProgress; + end; +end; + +procedure TDADumpProgressForm.Restore; +var + OldProgress: TDARestoreProgressEvent; + +begin + Assert(DADump <> nil); + OldProgress := DADump.OnRestoreProgress; + try + Label1.Caption := 'Restore'; + IsBackup := False; + DADump.OnRestoreProgress := DADumpRestoreProgress; + ShowModal; + finally + DADump.OnRestoreProgress := OldProgress; + end; +end; + +procedure TDADumpProgressForm.DADumpBackupProgress(Sender: TObject; + TableName: String; TableNum, TableCount, Percent: Integer); +begin + if WaitForTerminate then + SysUtils.Abort; + + Label1.Caption := 'Backup ' + TableName; + ProgressBar1.Max := TableCount; + ProgressBar1.Position := TableNum; + ProgressBar2.Position := Percent; + + Update; + Application.ProcessMessages; + end; + +procedure TDADumpProgressForm.DADumpRestoreProgress(Sender: TObject; + Percent: Integer); +begin + if WaitForTerminate then + SysUtils.Abort; + + ProgressBar2.Position := Percent; + + Update; + Application.ProcessMessages; +end; + +procedure TDADumpProgressForm.Process; +begin + ProgressBar1.Enabled := IsBackup; + + WaitForTerminate := False; + InProgress := True; + Cursor := crSQLWait; + try + try + if IsBackup then + DADump.Backup + else + DADump.Restore; + except + on E: Exception do + Application.ShowException(E); + end; + finally + InProgress := False; + Cursor := crDefault; + {$IFDEF MSWINDOWS} + PostMessage(Handle, WM_CLOSE, 0, 0); + {$ELSE} + QApplication_postEvent(Handle, QCloseEvent_create); + {$ENDIF} + end; +end; + +procedure TDADumpProgressForm.FormActivate(Sender: TObject); +begin +{$IFDEF MSWINDOWS} + Process; +{$ENDIF} +end; + +{$IFDEF LINUX} +function TDADumpProgressForm.EventFilter(Sender: QObjectH; Event: QEventH): Boolean; +begin + Result := True; + if QEvent_type(Event) = QEventType_CMFormActivate then + Process + else + Result := inherited EventFilter(Sender, Event); +end; +{$ENDIF} + +procedure TDADumpProgressForm.BitBtn1Click(Sender: TObject); +begin + WaitForTerminate := True; + Close; +end; + +procedure TDADumpProgressForm.FormClose(Sender: TObject; + var Action: TCloseAction); +begin + WaitForTerminate := True; + while InProgress do + Sleep(300); +end; + +procedure TDADumpProgressForm.FormResize(Sender: TObject); +begin +{$IFDEF LINUX} + ClientHeight := 131; + ClientWidth := 248; + ProgressBar1.Width := 232; + ProgressBar2.Width := 232; + BitBtn1.Left := 86; +{$ENDIF} +end; + +end. \ No newline at end of file diff --git a/internal/4.10.0.10/1/Source/Design/DADumpProgress.xfm b/internal/4.10.0.10/1/Source/Design/DADumpProgress.xfm new file mode 100644 index 0000000..d9d8ebf --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DADumpProgress.xfm @@ -0,0 +1,76 @@ +object DADumpProgressForm: TDADumpProgressForm + Left = 656 + Top = 188 + BorderStyle = fbsDialog + Caption = 'DADumpProgressForm' + ClientHeight = 131 + ClientWidth = 248 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + OnActivate = FormActivate + OnClose = FormClose + OnResize = FormResize + PixelsPerInch = 96 + TextHeight = 13 + object Label1: TLabel + Left = 8 + Top = 8 + Width = 41 + Height = 16 + Caption = 'Label1' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'MS Sans Serif' + Font.Style = [] + ParentFont = False + end + object BitBtn1: TBitBtn + Left = 86 + Top = 98 + Width = 75 + Height = 25 + Anchors = [akBottom] + Cancel = True + Caption = 'Cancel' + TabOrder = 0 + OnClick = BitBtn1Click + Glyph.Data = { + DE010000424DDE01000000000000760000002800000024000000120000000100 + 0400000000006801000000000000000000001000000000000000000000000000 + 80000080000000808000800000008000800080800000C0C0C000808080000000 + FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00333333333333 + 333333333333333333333333000033338833333333333333333F333333333333 + 0000333911833333983333333388F333333F3333000033391118333911833333 + 38F38F333F88F33300003339111183911118333338F338F3F8338F3300003333 + 911118111118333338F3338F833338F3000033333911111111833333338F3338 + 3333F8330000333333911111183333333338F333333F83330000333333311111 + 8333333333338F3333383333000033333339111183333333333338F333833333 + 00003333339111118333333333333833338F3333000033333911181118333333 + 33338333338F333300003333911183911183333333383338F338F33300003333 + 9118333911183333338F33838F338F33000033333913333391113333338FF833 + 38F338F300003333333333333919333333388333338FFF830000333333333333 + 3333333333333333333888330000333333333333333333333333333333333333 + 0000} + NumGlyphs = 2 + end + object ProgressBar1: TProgressBar + Left = 8 + Top = 32 + Width = 232 + Height = 25 + Anchors = [akLeft, akTop, akRight] + end + object ProgressBar2: TProgressBar + Left = 8 + Top = 65 + Width = 232 + Height = 25 + Anchors = [akLeft, akTop, akRight] + end +end diff --git a/internal/4.10.0.10/1/Source/Design/DAMacrosFrame.dfm b/internal/4.10.0.10/1/Source/Design/DAMacrosFrame.dfm new file mode 100644 index 0000000..7f5921d --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DAMacrosFrame.dfm @@ -0,0 +1,62 @@ +inherited DAMacrosFrame: TDAMacrosFrame + object lbMName: TLabel [0] + Left = 19 + Top = 8 + Width = 61 + Height = 13 + Caption = 'Macro Name' + end + object lbMacroLog: TLabel [1] + Left = 8 + Top = 7 + Width = 11 + Height = 16 + Caption = '&&' + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Height = -13 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [fsBold] + ParentFont = False + end + inherited PanelItem: TPanel + object lbMValue: TLabel + Left = 16 + Top = 12 + Width = 27 + Height = 13 + Caption = 'Value' + end + object lbActive: TLabel + Left = 33 + Top = 191 + Width = 30 + Height = 13 + Anchors = [akLeft, akBottom] + Caption = 'Active' + end + object meMacroValue: TMemo + Left = 14 + Top = 28 + Width = 238 + Height = 157 + Anchors = [akLeft, akTop, akRight, akBottom] + Lines.Strings = ( + '') + ScrollBars = ssBoth + TabOrder = 0 + WordWrap = False + OnExit = meMacroValueExit + end + object cbMacroActive: TCheckBox + Left = 14 + Top = 189 + Width = 15 + Height = 17 + Anchors = [akLeft, akBottom] + TabOrder = 1 + OnClick = cbMacroActiveClick + end + end +end diff --git a/internal/4.10.0.10/1/Source/Design/DAMacrosFrame.pas b/internal/4.10.0.10/1/Source/Design/DAMacrosFrame.pas new file mode 100644 index 0000000..c0e3379 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DAMacrosFrame.pas @@ -0,0 +1,119 @@ + +////////////////////////////////////////////////// +// DB Access Components +// Copyright © 1998-2005 Core Lab. All right reserved. +// Macros Frame +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I Dac.inc} + +unit DAMacrosFrame; +{$ENDIF} + +interface + +uses +{$IFDEF MSWINDOWS} + Windows, Messages, Graphics, Controls, Forms, + Dialogs, + StdCtrls, ExtCtrls, +{$ENDIF} +{$IFDEF LINUX} + QStdCtrls, QExtCtrls, QControls, +{$ENDIF} + Classes, SysUtils, + DBAccess, CRFrame, CRColFrame, CRTabEditor; + +type + TDAMacrosFrame = class(TCRColFrame) + lbMName: TLabel; + lbMacroLog: TLabel; + lbMValue: TLabel; + meMacroValue: TMemo; + cbMacroActive: TCheckBox; + lbActive: TLabel; + procedure cbMacroActiveClick(Sender: TObject); + procedure meMacroValueExit(Sender: TObject); + + protected + function GetItems: TCollection; override; + function GetMacros: TMacros; + + function GetItemName(Item: TCollectionItem): string; override; + procedure ItemToControls(Item: TCollectionItem); override; + procedure ControlsToItem(Item: TCollectionItem); override; + + property Macros: TMacros read GetMacros; + public + end; + +implementation + +{$IFDEF IDE} +{$R *.dfm} +{$ENDIF} +{$IFDEF MSWINDOWS} +{$R DAMacrosFrame.dfm} +{$ENDIF} +{$IFDEF LINUX} +{$R *.xfm} +{$ENDIF} + +uses + DB, DASQLEditor; + +function TDAMacrosFrame.GetItems: TCollection; +begin + Result := Editor.DADesignUtilsClass.GetMacros(Editor.localComponent); +end; + +function TDAMacrosFrame.GetMacros: TMacros; +begin + Result := Items as TMacros; +end; + +function TDAMacrosFrame.GetItemName(Item: TCollectionItem): string; +begin + Result := TMacro(Item).Name; +end; + +procedure TDAMacrosFrame.ItemToControls(Item: TCollectionItem); +begin + meMacroValue.Lines.Text := TMacro(Item).Value; + cbMacroActive.Checked := TMacro(Item).Active; +end; + +procedure TDAMacrosFrame.ControlsToItem(Item: TCollectionItem); +begin + TMacro(Item).Value := meMacroValue.Lines.Text; + TMacro(Item).Active := cbMacroActive.Checked; +end; + +procedure TDAMacrosFrame.cbMacroActiveClick(Sender: TObject); +begin + if FInSelectItem or not IsControlEnabled(Sender as TControl) then + Exit; + + Macros[lbItemName.ItemIndex].Active := cbMacroActive.Checked; + Modified := True; + + UpdateControlsState; +end; + +procedure TDAMacrosFrame.meMacroValueExit(Sender: TObject); +begin + if FInSelectItem or not IsControlEnabled(Sender as TControl) then + Exit; + + if meMacroValue.Lines.Text <> Macros[lbItemName.ItemIndex].Value then begin + Macros[lbItemName.ItemIndex].Value := meMacroValue.Lines.Text; + + Modified := True; + + UpdateControlsState; + end; +end; + +end. diff --git a/internal/4.10.0.10/1/Source/Design/DAMacrosFrame.xfm b/internal/4.10.0.10/1/Source/Design/DAMacrosFrame.xfm new file mode 100644 index 0000000..6be5ee0 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DAMacrosFrame.xfm @@ -0,0 +1,62 @@ +inherited DAMacrosFrame: TDAMacrosFrame + object lbMName: TLabel [0] + Left = 19 + Top = 8 + Width = 61 + Height = 13 + Caption = 'Macro Name' + end + object lbMacroLog: TLabel [1] + Left = 8 + Top = 7 + Width = 11 + Height = 16 + Caption = '&&' + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Height = -13 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [fsBold] + ParentFont = False + end + inherited PanelItem: TPanel + object lbMValue: TLabel + Left = 16 + Top = 12 + Width = 27 + Height = 13 + Caption = 'Value' + end + object lbActive: TLabel + Left = 33 + Top = 191 + Width = 30 + Height = 13 + Anchors = [akLeft, akBottom] + Caption = 'Active' + end + object meMacroValue: TMemo + Left = 14 + Top = 28 + Width = 238 + Height = 157 + Anchors = [akLeft, akTop, akRight, akBottom] + Lines.Strings = ( + '') + ScrollBars = ssBoth + TabOrder = 0 + WordWrap = False + OnExit = meMacroValueExit + end + object cbMacroActive: TCheckBox + Left = 14 + Top = 189 + Width = 15 + Height = 17 + Anchors = [akLeft, akBottom] + TabOrder = 1 + OnClick = cbMacroActiveClick + end + end +end diff --git a/internal/4.10.0.10/1/Source/Design/DAMenu.pas b/internal/4.10.0.10/1/Source/Design/DAMenu.pas new file mode 100644 index 0000000..8bc72ea --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DAMenu.pas @@ -0,0 +1,646 @@ + +////////////////////////////////////////////////// +// DB Access Components +// Copyright @ 1998-2007 Core Lab. All right reserved. +// DAMenu +////////////////////////////////////////////////// + +{$IFNDEF DAMENU_HEADER} + +{$I Dac.inc} + +unit DAMenu; +{$ENDIF} +interface + +{$IFDEF VER7P} + {$WARN UNIT_DEPRECATED OFF} +{$ENDIF} + +uses +{$IFDEF CLR} + System.Windows.Forms, Borland.Studio.ToolsAPI, WinUtils, +{$ELSE} + ToolsAPI, Menus, +{$ENDIF} +{$IFDEF MSWINDOWS} + Windows, +{$ENDIF} + Graphics, Classes, SysUtils; + +type + TDAMenu = class; + + +{$IFDEF CLR} + TAPIMenuItem = IOTAMenuItem; + TDAMenuClickSender = TObject; + TDAMenuClickEvent = procedure (Sender: TDAMenuClickSender; E: EventArgs) of object; +{$ELSE} + TAPIMenuItem = TMenuItem; + TDAMenuClickSender = TObject; + TDAMenuClickEvent = procedure (Sender: TDAMenuClickSender) of object; +{$ENDIF} + + TDAMenuItem = class(TCollectionItem) + protected + FSubMenu: TDAMenu; + FCaption: string; + FName: string; + FVisible: boolean; + + FNeedDestroyMenuItem: boolean; + FMenuItem: TAPIMenuItem; + + procedure SetCaption(Value: string); + procedure SetVisible(Value: boolean); + public + constructor Create(DAMenu: TDAMenu; MenuItem: TAPIMenuItem); reintroduce; overload; + constructor Create(DAMenu: TDAMenu; Caption, Name: string; ClickEvent: TDAMenuClickEvent = nil; Index: integer = -1); reintroduce; overload; + destructor Destroy; override; + + property SubMenu: TDAMenu read FSubMenu; + property Caption: string read FCaption write SetCaption; + property Name: string read FName; + property Visible: boolean read FVisible write SetVisible; + end; + + TDAMenu = class(TCollection) + protected + FParentItem: TDAMenuItem; + FHInstance: HINST; + FMenuItems: TAPIMenuItem; + FProjectName: string; + FSubMenuProcessed: boolean; + FFAQName: string; + FWizardPosition: integer; + {$IFNDEF LITE} + procedure HelpItemClick(Sender: TDAMenuClickSender{$IFDEF CLR}; E: EventArgs{$ENDIF}); + procedure FAQItemClick(Sender: TDAMenuClickSender{$IFDEF CLR}; E: EventArgs{$ENDIF}); + {$ENDIF} + public + constructor Create( + ParentItem: TDAMenuItem; + const AProcessSubMenu: boolean = False); + destructor Destroy; override; + + function AddSeparator: TDAMenuItem; + {$IFNDEF LITE} + function AddFAQ(Caption, Name, ProjectName {'Mydac', 'Oda', 'Sdac'}: string): TDAMenuItem; + function AddHelp(Caption, Name, ProjectName {'Mydac', 'Oda', 'Sdac'}: string): TDAMenuItem; + {$IFNDEF VER9P} + procedure AddWizard(Caption, Name: string; ClickEvent: TDAMenuClickEvent); + {$ENDIF} + {$ENDIF} + procedure AddWizards; + function Add(Caption, Name: string; ClickEvent: TDAMenuClickEvent = nil; Index: integer = -1): TDAMenuItem; + procedure ProcessSubMenu; + procedure GetSubMenu; + end; + + TDAProductMenu = class(TDAMenu) + protected + {$IFDEF CLR} + FMenuItems: IOTAMainMenuService; + {$ENDIF} + FCRMenuName: string; + FServerMenuCaption: string; + FProductMenuCaption: string; + FAboutCaption: string; + FAboutName: string; + FAboutClickEvent: TDAMenuClickEvent; + + FCRMenu: TDAMenuItem; + FHasProduct: boolean; + + procedure Prepare; + function GetSubMenu: TDAMenu; + {$IFDEF VER9P} + property SubMenu: TDAMenu read GetSubMenu; + {$ENDIF} + public + constructor Create(const ACRMenuName, AAboutCaption, AAboutName: string; + const AServerMenuCaption: string; const AProductMenuCaption: string = ''); overload; + constructor Create; overload; + function AddItems(Instance: HINST): boolean; virtual; + function AddAbout: TDAMenuItem; + + property CRMenuName: string read FCRMenuName; + property ServerMenuCaption: string read FServerMenuCaption; + property ProductMenuCaption: string read FProductMenuCaption; + {$IFNDEF VER9P} + property SubMenu: TDAMenu read GetSubMenu; + {$ENDIF} + end; + +function RemoveAmpersands(RawCaption: string): string; + +implementation + +uses +{$IFDEF CLR} + Registry, +{$ENDIF} +{$IFDEF MSWINDOWS} +{$IFNDEF LITE} + DacVcl, +{$ENDIF} +{$ENDIF} +{$IFNDEF LITE} + ShellApi, +{$ENDIF} +{$IFNDEF VER6P} + ActiveX, comobj, +{$ENDIF} +{$IFNDEF LITE} + HelpUtils, +{$ENDIF} + Forms, Dialogs; + +{ TDAMenuItem } + +constructor TDAMenuItem.Create(DAMenu: TDAMenu; MenuItem: TAPIMenuItem); +begin + inherited Create(DAMenu); + FMenuItem := MenuItem; + FNeedDestroyMenuItem := False; + + if FMenuItem <> nil then begin + FName := FMenuItem.Name; + FVisible := FMenuItem.Visible; + {$IFDEF CLR} + FCaption := FMenuItem.Text; + {$ELSE} + FCaption := FMenuItem.Caption; + {$ENDIF} + end; + + FSubMenu := TDAMenu.Create(Self); +end; + +constructor TDAMenuItem.Create(DAMenu: TDAMenu; Caption, Name: string; ClickEvent: TDAMenuClickEvent = nil; Index: integer = -1); +var + Bmp: Graphics.TBitmap; +{$IFDEF CLR} + MainMenu: TDAMenu; + bitmapHandle: IntPtr; + referenceItemName: string; + Location: OTAMenuItemLocation; + h: HBITMAP; +{$ENDIF} + MenuItem: TAPIMenuItem; +begin + Bmp := nil; + try + if (DAMenu <> nil) and (DAMenu.FHInstance <> 0) then begin + Bmp := Graphics.TBitmap.Create; + try + //Bmp.LoadFromResourceName(FHInstance, UpperCase(Name)); + Bmp.LoadFromResourceName(DAMenu.FHInstance, UpperCase(Name)); + //Bmp.LoadFromFile('d:\' + Name + '.bmp'); + except + Bmp.Free; // Resource not found + Bmp := nil; + end; + end; + {$IFDEF CLR} + MainMenu := DAMenu; + while not (MainMenu is TDAProductMenu) do + MainMenu := TDAMenu(MainMenu.FParentItem.Collection); + + if DAMenu.Count = 0 then begin + referenceItemName := DAMenu.FMenuItems.Name; + Location := OTAMenuItemLocation.otamlChild; + end + else + if (Index = -1) or (Index >= DAMenu.Count) then begin + referenceItemName := DAMenu.FMenuItems.ChildMenuItem(DAMenu.Count - 1).Name; + Location := OTAMenuItemLocation.otamlAfter; + end + else + begin + referenceItemName := DAMenu.FMenuItems.ChildMenuItem(Index).Name; + Location := OTAMenuItemLocation.otamlBefore; + end; + + bitmapHandle := nil; + if Bmp <> nil then + try + h := Bmp.Handle; + bitmapHandle := IntPtr(Integer(h)); + except + bitmapHandle := nil; + end; + MenuItem := TDAProductMenu(MainMenu).FMenuItems.AddMenuItem( + referenceItemName, + Location, + Name, + Caption, + bitmapHandle); + + if Assigned(ClickEvent) then + Include(MenuItem.Executed, ClickEvent); + Create(DAMenu, MenuItem); + {$ELSE} + if Index = -1 then + Index := DAMenu.Count; + MenuItem := TAPIMenuItem.Create(nil); + MenuItem.Caption := Caption; + MenuItem.Name := Name; + MenuItem.OnClick := ClickEvent; + if Bmp <> nil then + MenuItem.ImageIndex := (BorlandIDEServices as INTAServices).AddMasked(Bmp, Bmp.TransparentColor); + DAMenu.FMenuItems.Insert(Index, MenuItem); + Create(DAMenu, MenuItem); + {$ENDIF} + FNeedDestroyMenuItem := True; + finally + Bmp.Free; + end; +end; + +destructor TDAMenuItem.Destroy; +begin + FSubMenu.Free; + +{$IFNDEF CLR} + if Assigned(FMenuItem) then begin + if FNeedDestroyMenuItem then + FMenuItem.Free + end; +{$ENDIF} + + inherited Destroy; +end; + +procedure TDAMenuItem.SetCaption(Value: string); +begin +{$IFDEF CLR} + FMenuItem.Text := Value; +{$ELSE} + FMenuItem.Caption := Value; +{$ENDIF} +end; + +procedure TDAMenuItem.SetVisible(Value: boolean); +begin + FMenuItem.Visible := Value; +end; +{ TDAMenu } + +constructor TDAMenu.Create( + ParentItem: TDAMenuItem; + const AProcessSubMenu: boolean = False); + +{$IFDEF CLR} + procedure MainMenu; + var + MainMenu: IOTAMainMenuService; + begin + MainMenu := BorlandIDE.GetService(typeof(IOTAMainMenuService)) as IOTAMainMenuService; + + Assert(Self is TDAProductMenu); + + TDAProductMenu(Self).FMenuItems := MainMenu; + end; +{$ELSE} + procedure MainMenu; + var + MainMenu: TMenu; + begin + MainMenu := (BorlandIDEServices as INTAServices).GetMainMenu; + if MainMenu <> nil then + FMenuItems := MainMenu.Items + else + FMenuItems := nil; + end; +{$ENDIF} +begin + inherited Create(TDAMenuItem); + + FWizardPosition := -1; + + if ParentItem = nil then + MainMenu; + +{$IFDEF CLR} + + FParentItem := ParentItem; + if ParentItem = nil then + FMenuItems := TDAProductMenu(Self).FMenuItems.GetFirstMenuItem.ParentMenuItem + else + FMenuItems := ParentItem.FMenuItem; +{$ELSE} + if ParentItem <> nil then + FMenuItems := ParentItem.FMenuItem; +{$ENDIF} + if (FMenuItems <> nil) and AProcessSubMenu + (*{$IFDEF VER9P}and (ParentItem <> nil){$ENDIF}*) // bug with IOTAMenuItem.Count under CLR (DbxOda) + then + ProcessSubMenu; +end; + +destructor TDAMenu.Destroy; +begin + Clear; + inherited; +end; + +{$IFNDEF LITE} +procedure TDAMenu.HelpItemClick(Sender: TDAMenuClickSender{$IFDEF CLR}; E: EventArgs{$ENDIF}); +var + HelpFile, JumpID: string; +begin +{$IFDEF VER8P} + HelpFile := 'ms-help://CoreLab.' + FProjectName; + JumpID := Format('ms-help://CoreLab.%s/%s/overview_%s.htm', [FProjectName, FProjectName, FProjectName]); +{$ELSE} + HelpFile := GetHelpFileName(FProjectName); + JumpID := 'Overview_' + FProjectName; +{$ENDIF} + ShowHelp(HelpFile, JumpID); +end; +{$ENDIF} + +function TDAMenu.AddSeparator: TDAMenuItem; +var + guid: TGuid; + s, s1: string; + i, Cnt: integer; +begin + Result := nil; + if FMenuItems <> nil then begin + s := '-'; + {$IFDEF CLR} + Cnt := FMenuItems.ChildCount; + {$ELSE} + Cnt := FMenuItems.Count; + {$ENDIF} + if FWizardPosition <> -1 then + Cnt := FWizardPosition - 1; + if Cnt > 0 then + {$IFDEF CLR} + s := FMenuItems.ChildMenuItem(Cnt - 1).Text; + {$ELSE} + s := FMenuItems.Items[Cnt - 1].Caption; + {$ENDIF} + + if s = '-' then + Exit; + end; + +{$IFDEF VER6P} + if CreateGuid(guid) <> 0 then + RaiseLastOSError; +{$ELSE} + if CoCreateGuid(guid) <> 0 then + RaiseLastWin32Error; +{$ENDIF} + + s := GUIDToString(guid); + s1 := 'Separator'; + for i := 1 to Length(s) do + case s[i] of + '0'..'9', 'a'..'z', 'A'..'Z': + s1 := s1 + s[i]; + end; + + Result := Add('-', s1); +end; + +{$IFNDEF LITE} +function TDAMenu.AddFAQ(Caption, Name, ProjectName {'Mydac', 'Oda', 'Sdac'}: string): TDAMenuItem; +var + i: integer; +begin + Result := nil; +{$IFDEF VER8P} + FFAQName := ExtractFilePath(GetHelpFileName(ProjectName)); +{$ELSE} + FFAQName := ExtractFilePath(Application.ExeName); +{$ENDIF} + i := Length(FFAQName) - 1; + while (i > 1) and (FFAQName[i] <> '/') and (FFAQName[i] <> '\') do + Dec(i); + + if i < 3 then + Exit; + + FFAQName := Copy(FFAQName, 1, i) {$IFNDEF VER8P}+ ProjectName{$ENDIF} + '\FAQ.html'; + if FileExists(FFAQName) then + Result := Add(Caption, Name, FAQItemClick); +end; + +procedure TDAMenu.FAQItemClick(Sender: TDAMenuClickSender{$IFDEF CLR}; E: EventArgs{$ENDIF}); +begin + ShellExecute(0, 'open', {$IFDEF CLR}FFAQName{$ELSE}PChar(FFAQName){$ENDIF}, '', '', SW_SHOW); +end; + +function TDAMenu.AddHelp(Caption, Name, ProjectName {'Mydac', 'Odac', 'Sdac'}: string): TDAMenuItem; +var + HelpFileName: string; +begin + FProjectName := ProjectName; + HelpFileName := GetHelpFileName(ProjectName); + if (ExtractFilePath(HelpFileName) = '') or (FileExists(HelpFileName)) then + Result := Add(Caption, Name, HelpItemClick) + else + Result := nil; +end; + +{$IFNDEF VER9P} +procedure TDAMenu.AddWizard(Caption, Name: string; ClickEvent: TDAMenuClickEvent); +begin + TDAMenuItem.Create(Self, Caption, Name, ClickEvent, -1); + if FWizardPosition = -1 then + FWizardPosition := 0 +end; +{$ENDIF} + +{$ENDIF} + +function TDAMenu.Add(Caption, Name: string; ClickEvent: TDAMenuClickEvent = nil; Index: integer = -1): TDAMenuItem; +begin + if (Index = -1) and (FWizardPosition <> -1) then begin + Index := FWizardPosition; + Inc(FWizardPosition); + end; + Result := TDAMenuItem.Create(Self, Caption, Name, ClickEvent, Index); +end; + +procedure TDAMenu.ProcessSubMenu; +var + Skip: boolean; + i, j: integer; + MenuItem: TAPIMenuItem; +begin + if FMenuItems <> nil then begin + if not FSubMenuProcessed then + Clear + else + if FMenuItems.{$IFDEF WIN32}Count{$ELSE}ChildCount{$ENDIF} = Count then + Exit; + {$IFDEF CLR} + for i := 0 to FMenuItems.ChildCount - 1 do begin + MenuItem := FMenuItems.ChildMenuItem(i); + {$ELSE} + for i := 0 to FMenuItems.Count - 1 do begin + MenuItem := FMenuItems.Items[i]; + {$ENDIF} + Skip := False; + if FSubMenuProcessed then + for j := 0 to Count - 1 do + if TDAMenuItem(Items[j]).Name = MenuItem.Name then begin + Skip := True; + Break; + end; + if Skip then + Continue; + TDAMenuItem.Create(Self, MenuItem); + FWizardPosition := 0; + end; + FSubMenuProcessed := True; + end; +end; + +procedure TDAMenu.GetSubMenu; +var + i: integer; + MenuItem: TAPIMenuItem; +begin + if (FMenuItems <> nil) and not FSubMenuProcessed then begin + Clear; + {$IFDEF CLR} + for i := 0 to FMenuItems.ChildCount - 1 do begin + MenuItem := FMenuItems.ChildMenuItem(i); + TDAMenuItem.Create(Self, MenuItem); + end; + {$ELSE} + for i := 0 to FMenuItems.Count - 1 do begin + MenuItem := FMenuItems.Items[i]; + TDAMenuItem.Create(Self, MenuItem); + end; + {$ENDIF} + FSubMenuProcessed := True; + end; +end; + +procedure TDAMenu.AddWizards; +begin + FWizardPosition := -1; +end; + +{ TDAProductMenu } + +constructor TDAProductMenu.Create(const ACRMenuName, AAboutCaption, + AAboutName: string; const AServerMenuCaption: string; + const AProductMenuCaption: string = ''); +begin + inherited Create(nil, True); + + FCRMenuName := ACRMenuName; + FAboutCaption := AAboutCaption; + FAboutName := AAboutName; + FServerMenuCaption := AServerMenuCaption; + FProductMenuCaption := AProductMenuCaption; +{$IFNDEF VER9P} + Prepare; +{$ENDIF} +end; + +constructor TDAProductMenu.Create; +begin + inherited Create(nil, True); +end; + +procedure TDAProductMenu.Prepare; +var + ThirdParty: TDAMenuItem; + i: integer; + UsedCaption: string; +begin + ThirdParty := nil; + for i := 0 to Count - 1 do begin + if TDAMenuItem(Items[i]).Name = FCRMenuName then begin + FCRMenu := TDAMenuItem(Items[i]); + SubMenu.ProcessSubMenu; + if SubMenu.Count > 0 then + SubMenu.AddSeparator; + Break; + end + else + if (FProductMenuCaption <> '') and (UpperCase(RemoveAmpersands(TDAMenuItem(Items[i]).Caption)) = + UpperCase(RemoveAmpersands(FServerMenuCaption))) then + ThirdParty := TDAMenuItem(Items[i]); + end; + + FHasProduct := False; + + if ThirdParty = nil then + UsedCaption := FServerMenuCaption + else + UsedCaption := FProductMenuCaption; + if FCRMenu = nil then + FCRMenu := Add(UsedCaption, FCRMenuName, nil, Count - 1{$IFDEF VER9P}{$IFNDEF CLR} - 1{$ENDIF}{$ENDIF}) + else begin + FCRMenu.Caption := UsedCaption; + {$IFDEF VER9P} + for i := 0 to SubMenu.Count - 1 do + if RemoveAmpersands(TDAMenuItem(SubMenu.Items[i]).Caption) = + RemoveAmpersands(FAboutCaption) then begin + FHasProduct := True; + Break; + end; + {$ENDIF} + end; +end; + +function TDAProductMenu.AddItems(Instance: HINST): boolean; +begin + FHInstance := Instance; + Result := False; + ProcessSubMenu; +{$IFDEF VER9P} + Prepare; +{$ENDIF} + if not FHasProduct then begin + FHInstance := Instance; + SubMenu.FHInstance := Instance; + SubMenu.AddSeparator; + Result := True; + FHasProduct := True; + end +{$IFDEF VER9P} + else + AddAbout.Visible := False +{$ENDIF} +end; + +function TDAProductMenu.GetSubMenu: TDAMenu; +begin + Result := FCRMenu.SubMenu; +end; + +function TDAProductMenu.AddAbout: TDAMenuItem; +begin + Result := SubMenu.Add(FAboutCaption, FAboutName, FAboutClickEvent); +end; + +function RemoveAmpersands(RawCaption: string): string; +var + i: integer; +begin + Result := ''; + i := 1; + while i <= Length(RawCaption) do begin + if RawCaption[i] = '&' then begin + Inc(i); + if i > Length(RawCaption) then + Break; + end; + Result := Result + RawCaption[i]; + Inc(i); + end; +end; + +end. \ No newline at end of file diff --git a/internal/4.10.0.10/1/Source/Design/DAParamValueEditor.dfm b/internal/4.10.0.10/1/Source/Design/DAParamValueEditor.dfm new file mode 100644 index 0000000..7bdd118 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DAParamValueEditor.dfm @@ -0,0 +1,26 @@ +inherited DAParamValueEditor: TDAParamValueEditor + Left = 366 + Top = 221 + Height = 332 + HorzScrollBar.Visible = False + VertScrollBar.Visible = False + BorderStyle = bsSizeToolWin + Caption = 'Param.Value Editor' + Constraints.MinHeight = 332 + Constraints.MinWidth = 513 + PixelsPerInch = 96 + TextHeight = 13 + inherited BtnPanel: TPanel + Top = 257 + TabOrder = 1 + end + object Memo: TMemo + Left = 0 + Top = 0 + Width = 505 + Height = 257 + Align = alClient + TabOrder = 0 + OnChange = MemoChange + end +end diff --git a/internal/4.10.0.10/1/Source/Design/DAParamValueEditor.pas b/internal/4.10.0.10/1/Source/Design/DAParamValueEditor.pas new file mode 100644 index 0000000..3586f5a --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DAParamValueEditor.pas @@ -0,0 +1,90 @@ + +////////////////////////////////////////////////// +// Data Access Components +// Copyright © 1998-2005 Core Lab. All right reserved. +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I Dac.inc} + +unit DAParamValueEditor; +{$ENDIF} + +interface +uses +{$IFDEF MSWINDOWS} + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + StdCtrls, Buttons, ComCtrls, ExtCtrls, +{$ENDIF} +{$IFDEF LINUX} + SysUtils, Types, Classes, QGraphics, QControls, QForms, QDialogs, QStdCtrls, + QExtCtrls, QComCtrls, QButtons, +{$ENDIF} + DB, CREditor; + +type + TDAParamValueEditor = class(TCREditorForm) + Memo: TMemo; + //udIndex: TUpDown; + + procedure MemoChange(Sender: TObject); + + protected + function GetValue: string; + procedure SetValue(Value: string); + + function GetComponent: TComponent; override; + procedure SetComponent(Value: TComponent); override; + + public + property Value: string read GetValue write SetValue; + end; + +implementation + +uses + MemData, CRParser + {$IFDEF VER6P} + , Variants + {$ENDIF} + ; + +{$IFDEF IDE} +{$R *.dfm} +{$ENDIF} +{$IFDEF MSWINDOWS} +{$R DAParamValueEditor.dfm} +{$ENDIF} +{$IFDEF LINUX} +{$R *.xfm} +{$ENDIF} + +function TDAParamValueEditor.GetValue: string; +begin + Result := Memo.Lines.Text; +end; + +procedure TDAParamValueEditor.SetValue(Value: string); +begin + Memo.Lines.Text := Value; + Modified := False; +end; + +procedure TDAParamValueEditor.MemoChange(Sender: TObject); +begin + inherited; + Modified := True; +end; + +function TDAParamValueEditor.GetComponent: TComponent; +begin + Result := nil; +end; + +procedure TDAParamValueEditor.SetComponent(Value: TComponent); +begin +end; + +end. + diff --git a/internal/4.10.0.10/1/Source/Design/DAParamValueEditor.xfm b/internal/4.10.0.10/1/Source/Design/DAParamValueEditor.xfm new file mode 100644 index 0000000..6757df9 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DAParamValueEditor.xfm @@ -0,0 +1,26 @@ +inherited DAParamValueEditor: TDAParamValueEditor + Left = 366 + Top = 221 + Height = 332 + HorzScrollBar.Visible = False + VertScrollBar.Visible = False + BorderStyle = fbsSizeToolWin + Caption = 'Param.Value Editor' + Constraints.MinHeight = 332 + Constraints.MinWidth = 513 + PixelsPerInch = 96 + TextHeight = 13 + inherited BtnPanel: TPanel + Top = 257 + TabOrder = 1 + end + object Memo: TMemo + Left = 0 + Top = 0 + Width = 505 + Height = 257 + Align = alClient + TabOrder = 0 + OnChange = MemoChange + end +end diff --git a/internal/4.10.0.10/1/Source/Design/DAParamsFrame.dfm b/internal/4.10.0.10/1/Source/Design/DAParamsFrame.dfm new file mode 100644 index 0000000..f88a847 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DAParamsFrame.dfm @@ -0,0 +1,124 @@ +inherited DAParamsFrame: TDAParamsFrame + object lbPName: TLabel [0] + Left = 16 + Top = 8 + Width = 79 + Height = 13 + Caption = 'Parameter Name' + end + object lbParamLog: TLabel [1] + Left = 9 + Top = 6 + Width = 5 + Height = 16 + Caption = ':' + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Height = -13 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [fsBold] + ParentFont = False + end + inherited PanelItem: TPanel + Top = 24 + Height = 197 + object lbPType: TLabel + Left = 16 + Top = 16 + Width = 50 + Height = 13 + Caption = 'Data Type' + end + object lbParamType: TLabel + Left = 177 + Top = 16 + Width = 57 + Height = 13 + Anchors = [akTop, akRight] + Caption = 'Param Type' + end + object lbPValue: TLabel + Left = 16 + Top = 64 + Width = 27 + Height = 13 + Caption = 'Value' + end + object lbNullValue: TLabel + Left = 34 + Top = 125 + Width = 48 + Height = 13 + Caption = 'Null Value' + FocusControl = cbNullValue + end + object lbSize: TLabel + Left = 136 + Top = 125 + Width = 20 + Height = 13 + Caption = 'Size' + end + object cbDataType: TComboBox + Left = 16 + Top = 32 + Width = 154 + Height = 21 + Style = csDropDownList + Anchors = [akLeft, akTop, akRight] + DropDownCount = 15 + ItemHeight = 13 + TabOrder = 0 + OnChange = cbDataTypeChange + end + object cbParamType: TComboBox + Left = 177 + Top = 32 + Width = 73 + Height = 21 + Style = csDropDownList + Anchors = [akTop, akRight] + DropDownCount = 9 + ItemHeight = 13 + TabOrder = 1 + OnChange = cbParamTypeChange + end + object edValue: TEdit + Left = 16 + Top = 80 + Width = 212 + Height = 21 + Anchors = [akLeft, akTop, akRight] + TabOrder = 2 + OnChange = edValueChange + end + object bEdValue: TButton + Left = 228 + Top = 80 + Width = 21 + Height = 21 + Anchors = [akTop, akRight] + Caption = '...' + TabOrder = 3 + OnClick = bEdValueClick + end + object cbNullValue: TCheckBox + Left = 16 + Top = 124 + Width = 13 + Height = 17 + TabOrder = 4 + OnClick = cbNullValueClick + end + object edSize: TEdit + Left = 192 + Top = 121 + Width = 58 + Height = 21 + Anchors = [akLeft, akTop, akRight] + TabOrder = 5 + OnChange = edSizeChange + end + end +end diff --git a/internal/4.10.0.10/1/Source/Design/DAParamsFrame.pas b/internal/4.10.0.10/1/Source/Design/DAParamsFrame.pas new file mode 100644 index 0000000..a6b3d3e --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DAParamsFrame.pas @@ -0,0 +1,455 @@ + +////////////////////////////////////////////////// +// DB Access Components +// Copyright © 1998-2005 Core Lab. All right reserved. +// Params Frame +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I Dac.inc} + +unit DAParamsFrame; +{$ENDIF} + +interface + +uses +{$IFDEF MSWINDOWS} + Windows, Messages, Graphics, Controls, Forms, + Dialogs, + StdCtrls, ExtCtrls, +{$ENDIF} +{$IFDEF LINUX} + QStdCtrls, QExtCtrls, QControls, +{$ENDIF} + Classes, SysUtils, + DBAccess, DB, + CRFrame, CRTabEditor, CRColFrame; + +type + TDataTypeInfo = record + Name: string; + DataType: TFieldType; + EmptyIsNull: boolean; + Editable: boolean; + Sizeable: boolean; + DefaultValue: string; + end; + TDataTypeInfos = array of TDataTypeInfo; + + TParamTypeInfo = record + Name: string; + ParamType: TParamType; + end; + TParamTypeInfos = array of TParamTypeInfo; + + TDAParamsFrame = class(TCRColFrame) + lbPName: TLabel; + lbParamLog: TLabel; + lbPType: TLabel; + cbDataType: TComboBox; + cbParamType: TComboBox; + lbParamType: TLabel; + lbPValue: TLabel; + edValue: TEdit; + bEdValue: TButton; + cbNullValue: TCheckBox; + lbNullValue: TLabel; + lbSize: TLabel; + edSize: TEdit; + procedure cbDataTypeChange(Sender: TObject); + procedure cbParamTypeChange(Sender: TObject); + procedure edValueChange(Sender: TObject); + procedure cbNullValueClick(Sender: TObject); + procedure edSizeChange(Sender: TObject); + procedure bEdValueClick(Sender: TObject); + + protected + FDataTypeInfos: TDataTypeInfos; // Must be filled in successor's constructor + FParamTypeInfos: TParamTypeInfos; // Must be filled in successor's constructor + + procedure AddDataType( + Name: string; // if empty then use DB array + DataType: TFieldType; + EmptyIsNull: boolean; + Editable: boolean; + Sizeable: boolean; + DefaultValue: string + ); + procedure AddParamType( + Name: string; + ParamType: TParamType + ); + + function GetItems: TCollection; override; + function GetParams: TDAParams; + function GetItemName(Item: TCollectionItem): string; override; + procedure InitItems; override; + procedure ItemToControls(Item: TCollectionItem); override; + procedure StoreItemValue(Item: TCollectionItem); virtual; + procedure ControlsToItem(Item: TCollectionItem); override; + procedure UpdateControlsState; override; + + property Params: TDAParams read GetParams; + public + end; + +implementation + +{$IFDEF IDE} +{$R *.dfm} +{$ENDIF} +{$IFDEF MSWINDOWS} +{$R DAParamsFrame.dfm} +{$ENDIF} +{$IFDEF LINUX} +{$R *.xfm} +{$ENDIF} + +uses +{$IFDEF VER6P} + Variants, +{$ENDIF} + DASQLEditor, DAParamValueEditor, CREditor, MemData; + +function TDAParamsFrame.GetItems: TCollection; +begin + Result := Editor.DADesignUtilsClass.GetParams(Editor.LocalComponent); +end; + +function TDAParamsFrame.GetParams: TDAParams; +begin + Result := Items as TDAParams; +end; + +function TDAParamsFrame.GetItemName(Item: TCollectionItem): string; +begin + Result := TDAParam(Item).Name; +end; + +procedure TDAParamsFrame.InitItems; +var + i: integer; +begin + if (cbDataType.Items.Count = 0) and (Length(FDataTypeInfos) <> 0) then begin // First call + for i := Low(FDataTypeInfos) to High(FDataTypeInfos) do + cbDataType.Items.Add(FDataTypeInfos[i].Name); + cbDataType.DropDownCount := cbDataType.Items.Count; + end; + + if cbParamType.Items.Count = 0 then // First call + if Length(FParamTypeInfos) <> 0 then begin + for i := Low(FParamTypeInfos) to High(FParamTypeInfos) do + cbParamType.Items.Add(FParamTypeInfos[i].Name); + cbParamType.DropDownCount := cbParamType.Items.Count; + end + else + begin + cbParamType.Visible := False; + lbParamType.Visible := False; + cbDataType.Width := cbParamType.Left + cbParamType.Width - cbDataType.Left; + end; + + inherited; +end; + +procedure TDAParamsFrame.ItemToControls(Item: TCollectionItem); +var + Find: boolean; + i: integer; +begin + // DataType + if TDAParam(Item).DataType = ftUnknown then + cbDataType.ItemIndex := -1 + else begin + Find := False; + for i := Low(FDataTypeInfos) to High(FDataTypeInfos) do + if FDataTypeInfos[i].DataType = TDAParam(Item).DataType then begin + cbDataType.ItemIndex := i; + Find := True; + end; + + if not Find then + //raise Exception.Create('EdItem: Data type not found'); + cbDataType.ItemIndex := -1; + end; + + // ItemType + if IsControlEnabled(cbParamType) then begin + if TDAParam(Item).ParamType = ptUnknown then + cbParamType.ItemIndex := -1 + else begin + Find := False; + for i := Low(FParamTypeInfos) to High(FParamTypeInfos) do + if FParamTypeInfos[i].ParamType = TDAParam(Item).ParamType then begin + cbParamType.ItemIndex := i; + Find := True; + end; + + if not Find then + //raise Exception.Create('EdItem: Item type not found'); + cbParamType.ItemIndex := -1; + end; + end; + + // Null + if cbNullValue.Enabled then + cbNullValue.Checked := TDAParam(Item).IsNull; + + // Size + edSize.Text := IntToStr(TDAParam(Item).Size); + if edSize.Text = '0' then + edSize.Text := ''; + + // Value + if edValue.Enabled then + edValue.Text := TDAParam(Item).Text + else + edValue.Text := ''; +end; + +procedure TDAParamsFrame.StoreItemValue(Item: TCollectionItem); +var +{$IFNDEF CLR} + v: Variant; +{$ENDIF} + VType: {$IFDEF VER6P}TVarType{$ELSE}integer{$ENDIF}; +begin + if (cbNullValue.Checked and IsControlEnabled(cbNullValue)) + or not IsControlEnabled(edValue) then + Exit; + + case TDAParam(Item).DataType of + ftLargeInt: + begin + {$IFDEF CLR} + TDAParam(Item).Value := StrToInt64(edValue.Text); + {$ELSE} + {$IFNDEF VER6P} + TVarDataD6(v).VType := varDecimal; + TVarDataD6(v).VInt64 := StrToInt64(edValue.Text); + {$ELSE} + TVarData(v).VType := varInt64; + TVarData(v).VInt64 := StrToInt64(edValue.Text); + {$ENDIF} + + TDAParam(Item).Value := v; + {$ENDIF} + end; + {$IFDEF VER5P} + ftVariant: + TDAParam(Item).Value := edValue.Text; + {$ENDIF} + else + with TDAParam(Item) do begin + if (DataType = ftUnknown) or + (Ord(DataType) > Ord(High(TFieldType))) then + VType := varEmpty + else + VType := FieldTypeVarMap[DataType]; + if VType <> varEmpty then + Value := VarAsType(edValue.Text, VType) + else + Value := edValue.Text; + end; + end; +end; + +procedure TDAParamsFrame.ControlsToItem(Item: TCollectionItem); +var + BadControl: TWinControl; +begin + BadControl := nil; + try + // DataType + BadControl := cbDataType; + if cbDataType.ItemIndex = - 1 then + TDAParam(Item).DataType := ftUnknown + else + TDAParam(Item).DataType := FDataTypeInfos[cbDataType.ItemIndex].DataType; + + // ItemType + if IsControlEnabled(cbParamType) then begin + BadControl := cbParamType; + if cbParamType.ItemIndex = - 1 then + TDAParam(Item).ParamType := ptUnknown + else + TDAParam(Item).ParamType := FParamTypeInfos[cbParamType.ItemIndex].ParamType; + end; + + // Null + // Null must be stored before value + BadControl := cbNullValue; + if IsControlEnabled(cbNullValue) and cbNullValue.Checked then + TDAParam(Item).Clear; + + // Size + BadControl := edSize; + if (edSize.Text <> '') and edSize.Enabled then + TDAParam(Item).Size := StrToInt(edSize.Text) + else + TDAParam(Item).Size := 0; + + // Value + // Value must be stored after Null + BadControl := edValue; + StoreItemValue(Item); + + except + if Page.PageControl.ActivePage = Page then begin + lbItemName.ItemIndex := FOldItemIndex; + + if BadControl <> nil then begin + BadControl.SetFocus; + if BadControl is TCustomEdit then + TCustomEdit(BadControl).SelectAll; + end; + end; + raise; + end; +end; + +procedure TDAParamsFrame.UpdateControlsState; +var + Editable: boolean; +begin + if cbDataType.ItemIndex = - 1 then + Editable := False + else + Editable := FDataTypeInfos[cbDataType.ItemIndex].Editable; + + cbNullValue.Enabled := Editable; + edValue.Enabled := Editable; + bEdValue.Enabled := edValue.Enabled; + cbParamType.Enabled := Editable; + edSize.Enabled := Editable and FDataTypeInfos[cbDataType.ItemIndex].Sizeable; + + inherited; +end; + +procedure TDAParamsFrame.cbDataTypeChange(Sender: TObject); +begin + if FInSelectItem or not IsControlEnabled(Sender as TControl) then + Exit; + + Modified := True; + UpdateControlsState; +end; + +procedure TDAParamsFrame.cbParamTypeChange(Sender: TObject); +begin + if FInSelectItem or not IsControlEnabled(Sender as TControl) then + Exit; + + Modified := True; + UpdateControlsState; +end; + +procedure TDAParamsFrame.edValueChange(Sender: TObject); +var + l, Size: integer; +begin + if FInSelectItem or not IsControlEnabled(Sender as TControl) then + Exit; + + Assert(cbDataType.ItemIndex <> - 1); + l := Length(edValue.Text); + if cbNullValue.Checked and (l <> 0) then begin + cbNullValue.Checked := False; + end + else + if not cbNullValue.Checked and (l = 0) + and FDataTypeInfos[cbDataType.ItemIndex].EmptyIsNull then + cbNullValue.Checked := True; + + if edSize.Enabled then begin + if (edSize.Text <> '') then + Size := StrToInt(edSize.Text) + else + Size := 0; + + if FDataTypeInfos[cbDataType.ItemIndex].Sizeable + and (Size < l) then + edSize.Text := IntToStr(l); + end; + + Modified := True; + UpdateControlsState; +end; + +procedure TDAParamsFrame.cbNullValueClick(Sender: TObject); +begin + if FInSelectItem or not IsControlEnabled(Sender as TControl) then + Exit; + + Modified := True; + + if cbNullValue.Checked then + edValue.Text := '' + else + if (edValue.Text = '') and (cbDataType.ItemIndex <> -1) then + edValue.Text := FDataTypeInfos[cbDataType.ItemIndex].DefaultValue; + UpdateControlsState; +end; + +procedure TDAParamsFrame.edSizeChange(Sender: TObject); +begin + if FInSelectItem or not IsControlEnabled(Sender as TControl) then + Exit; + + Modified := True; + UpdateControlsState; +end; + +procedure TDAParamsFrame.AddDataType( + Name: string; // if empty then use DB array + DataType: TFieldType; + EmptyIsNull: boolean; + Editable: boolean; + Sizeable: boolean; + DefaultValue: string +); +var + l: integer; +begin + l := Length(FDataTypeInfos); + SetLength(FDataTypeInfos, l + 1); + + FDataTypeInfos[l].Name := Name; + FDataTypeInfos[l].DataType := DataType; + FDataTypeInfos[l].EmptyIsNull := EmptyIsNull; + FDataTypeInfos[l].Editable := Editable; + FDataTypeInfos[l].Sizeable := Sizeable; + FDataTypeInfos[l].DefaultValue := DefaultValue; +end; + +procedure TDAParamsFrame.AddParamType( + Name: string; + ParamType: TParamType +); +var + l: integer; +begin + l := Length(FParamTypeInfos); + SetLength(FParamTypeInfos, l + 1); + + FParamTypeInfos[l].Name := Name; + FParamTypeInfos[l].ParamType := ParamType; +end; + +procedure TDAParamsFrame.bEdValueClick(Sender: TObject); +begin + Assert(Owner is TCREditorForm); + with TDAParamValueEditor.Create(Self, TCREditorForm(Owner).DADesignUtilsClass) do + try + Value := edValue.Text; + ShowModal; + if ModalResult = mrOK then + edValue.Text := Value; + finally + Free; + end; +end; + +end. diff --git a/internal/4.10.0.10/1/Source/Design/DAParamsFrame.xfm b/internal/4.10.0.10/1/Source/Design/DAParamsFrame.xfm new file mode 100644 index 0000000..46d2f10 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DAParamsFrame.xfm @@ -0,0 +1,124 @@ +inherited DAParamsFrame: TDAParamsFrame + object lbPName: TLabel [0] + Left = 16 + Top = 8 + Width = 79 + Height = 13 + Caption = 'Parameter Name' + end + object lbParamLog: TLabel [1] + Left = 9 + Top = 6 + Width = 5 + Height = 16 + Caption = ':' + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Height = -13 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [fsBold] + ParentFont = False + end + inherited PanelItem: TPanel + Top = 24 + Height = 197 + object lbPType: TLabel + Left = 16 + Top = 16 + Width = 50 + Height = 13 + Caption = 'Data Type' + end + object lbParamType: TLabel + Left = 177 + Top = 16 + Width = 57 + Height = 13 + Anchors = [akTop, akRight] + Caption = 'Param Type' + end + object lbPValue: TLabel + Left = 16 + Top = 64 + Width = 27 + Height = 13 + Caption = 'Value' + end + object lbNullValue: TLabel + Left = 34 + Top = 125 + Width = 48 + Height = 13 + Caption = 'Null Value' + FocusControl = cbNullValue + end + object lbSize: TLabel + Left = 136 + Top = 125 + Width = 20 + Height = 13 + Caption = 'Size' + end + object cbDataType: TComboBox + Left = 16 + Top = 32 + Width = 154 + Height = 21 + Style = csDropDownList + Anchors = [akLeft, akTop, akRight] + DropDownCount = 15 + ItemHeight = 13 + TabOrder = 0 + OnChange = cbDataTypeChange + end + object cbParamType: TComboBox + Left = 177 + Top = 32 + Width = 73 + Height = 21 + Style = csDropDownList + Anchors = [akTop, akRight] + DropDownCount = 9 + ItemHeight = 13 + TabOrder = 1 + OnChange = cbParamTypeChange + end + object edValue: TEdit + Left = 16 + Top = 80 + Width = 212 + Height = 21 + Anchors = [akLeft, akTop, akRight] + TabOrder = 2 + OnChange = edValueChange + end + object bEdValue: TButton + Left = 228 + Top = 80 + Width = 21 + Height = 21 + Anchors = [akTop, akRight] + Caption = '...' + TabOrder = 3 + OnClick = bEdValueClick + end + object cbNullValue: TCheckBox + Left = 16 + Top = 124 + Width = 13 + Height = 17 + TabOrder = 4 + OnClick = cbNullValueClick + end + object edSize: TEdit + Left = 192 + Top = 121 + Width = 58 + Height = 21 + Anchors = [akLeft, akTop, akRight] + TabOrder = 5 + OnChange = edSizeChange + end + end +end diff --git a/internal/4.10.0.10/1/Source/Design/DAQueryEditor.dfm b/internal/4.10.0.10/1/Source/Design/DAQueryEditor.dfm new file mode 100644 index 0000000..714fec8 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DAQueryEditor.dfm @@ -0,0 +1,30 @@ +inherited DAQueryEditorForm: TDAQueryEditorForm + PixelsPerInch = 96 + TextHeight = 13 + inherited BtnPanel: TPanel + inherited btOk: TBitBtn + TabOrder = 2 + end + inherited btCancel: TBitBtn + TabOrder = 3 + end + object btnDataEditor: TBitBtn + Left = 94 + Top = 8 + Width = 80 + Height = 25 + Anchors = [akLeft, akBottom] + Caption = '&Data Editor...' + TabOrder = 1 + OnClick = btnDataEditorClick + end + end + inherited PageControl: TPageControl + object shEditSQL: TTabSheet [1] + Caption = '&Update SQLs' + end + object shGenerator: TTabSheet [2] + Caption = 'SQL &Generator' + end + end +end diff --git a/internal/4.10.0.10/1/Source/Design/DAQueryEditor.pas b/internal/4.10.0.10/1/Source/Design/DAQueryEditor.pas new file mode 100644 index 0000000..78b0834 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DAQueryEditor.pas @@ -0,0 +1,171 @@ + +////////////////////////////////////////////////// +// Data Access Components +// Copyright © 1998-2005 Core Lab. All right reserved. +// Query Editor +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I Dac.inc} + +unit DAQueryEditor; +{$ENDIF} +interface +uses +{$IFDEF MSWINDOWS} + Windows, Messages, Graphics, Controls, Forms, Dialogs, + ComCtrls, StdCtrls, ExtCtrls, Buttons, +{$ENDIF} +{$IFDEF LINUX} + Types, QGraphics, QControls, QForms, QDialogs, QStdCtrls, + QExtCtrls, QComCtrls, QButtons, +{$ENDIF} + SysUtils, DB, Classes, + DBAccess, MemUtils, + CRFrame, CREditor, CRTabEditor, DASQLFrame, DAParamsFrame, DAMacrosFrame, DASPCallFrame, + DASQLEditor, DAUpdateSQLFrame, DASQLGeneratorFrame; + +type + TDAQueryEditorForm = class(TDASQLEditorForm) + shEditSQL: TTabSheet; + shGenerator: TTabSheet; + btnDataEditor: TBitBtn; + procedure btnDataEditorClick(Sender: TObject); + protected + FUpdateSQLFrame: TDAUpdateSQLFrame; + FSQLGeneratorFrame: TDASQLGeneratorFrame; + + procedure DoInit; override; + procedure DoActivate; override; + procedure DoSave; override; + + function GetQuery: TCustomDADataSet; + procedure SetQuery(Value: TCustomDADataSet); + function GetComponent: TComponent; override; + procedure SetComponent(Value: TComponent); override; + function GetFrameByInitProp: TCRFrame; override; + + property Query: TCustomDADataSet read GetQuery write SetQuery; + + public + property UpdateSQLFrame: TDAUpdateSQLFrame read FUpdateSQLFrame; + + end; + +implementation + +uses + DADesignUtils, DADataEditor; + +{$IFDEF IDE} +{$R *.dfm} +{$ENDIF} +{$IFDEF MSWINDOWS} +{$R DAQueryEditor.dfm} +{$ENDIF} +{$IFDEF LINUX} +{$R *.xfm} +{$ENDIF} + +procedure TDAQueryEditorForm.DoInit; +begin + try + inherited; + finally + Assert(FUpdateSQLFrame <> nil); + Assert(FSQLGeneratorFrame <> nil); + FSPCallFrame.Mode := spQuery; + end; +end; + +procedure TDAQueryEditorForm.DoActivate; +begin + inherited; + if PageControl.ActivePage = FUpdateSQLFrame.Page then + ActiveControl := FUpdateSQLFrame.ActiveControl; +end; + +procedure TDAQueryEditorForm.DoSave; +var + OldActive: boolean; + OldDebug: boolean; +begin + OldActive := TCustomDADataSet(FComponent).Active; + OldDebug := TCustomDADataSet(FComponent).Debug; + try + // CR-M12021 + TCustomDADataSet(FLocalComponent).MasterSource := TCustomDADataSet(FComponent).MasterSource; + TCustomDADataSet(FLocalComponent).MasterFields := TCustomDADataSet(FComponent).MasterFields; + TCustomDADataSet(FLocalComponent).DetailFields := TCustomDADataSet(FComponent).DetailFields; + + inherited; + TCustomDADataSet(FComponent).Debug := False; + try + TCustomDADataSet(FComponent).Active := OldActive; + except + end; + finally + TCustomDADataSet(FComponent).Debug := OldDebug; + end; +end; + +function TDAQueryEditorForm.GetQuery: TCustomDADataSet; +begin + Result := FComponent as TCustomDADataSet; +end; + +procedure TDAQueryEditorForm.SetQuery(Value: TCustomDADataSet); +begin + FComponent := Value; +end; + +function TDAQueryEditorForm.GetComponent: TComponent; +begin + Result := Query; +end; + +procedure TDAQueryEditorForm.SetComponent(Value: TComponent); +begin + Query := Value as TCustomDADataSet; +end; + +function TDAQueryEditorForm.GetFrameByInitProp: TCRFrame; +begin + if InitialProperty = 'SQLDelete' then begin + FUpdateSQLFrame.SetStatementType(stDelete); + Result := FUpdateSQLFrame; + end + else + if InitialProperty = 'SQLInsert' then begin + FUpdateSQLFrame.SetStatementType(stInsert); + Result := FUpdateSQLFrame; + end + else + if InitialProperty = 'SQLRefresh' then begin + FUpdateSQLFrame.SetStatementType(stRefresh); + Result := FUpdateSQLFrame; + end + else + if InitialProperty = 'SQLUpdate' then begin + FUpdateSQLFrame.SetStatementType(stUpdate); + Result := FUpdateSQLFrame; + end + else + Result := inherited GetFrameByInitProp; +end; + +procedure TDAQueryEditorForm.btnDataEditorClick(Sender: TObject); +begin + SaveControlData; + CheckConnection(LocalComponent); + with TDADataEditorForm.Create(nil, FDADesignUtilsClass) do + try + Component := Self.LocalComponent; + ShowModal; + finally + Free; + end; +end; + +end. diff --git a/internal/4.10.0.10/1/Source/Design/DAQueryEditor.xfm b/internal/4.10.0.10/1/Source/Design/DAQueryEditor.xfm new file mode 100644 index 0000000..fadb63e --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DAQueryEditor.xfm @@ -0,0 +1,31 @@ +inherited DAQueryEditorForm: TDAQueryEditorForm + Left = 298 + Top = 226 + PixelsPerInch = 75 + inherited BtnPanel: TPanel + inherited btOk: TBitBtn + TabOrder = 2 + end + inherited btCancel: TBitBtn + TabOrder = 3 + end + object btnDataEditor: TBitBtn + Left = 94 + Top = 8 + Width = 80 + Height = 25 + Anchors = [akLeft, akBottom] + Caption = '&Data Editor...' + TabOrder = 1 + OnClick = btnDataEditorClick + end + end + inherited PageControl: TPageControl + object shEditSQL: TTabSheet [1] + Caption = '&Update SQLs' + end + object shGenerator: TTabSheet [2] + Caption = 'SQL &Generator' + end + end +end diff --git a/internal/4.10.0.10/1/Source/Design/DASPCallFrame.dfm b/internal/4.10.0.10/1/Source/Design/DASPCallFrame.dfm new file mode 100644 index 0000000..3c295db --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DASPCallFrame.dfm @@ -0,0 +1,99 @@ +inherited DASPCallFrame: TDASPCallFrame + Width = 473 + Height = 332 + inherited Panel1: TPanel + Top = 146 + Width = 473 + Height = 186 + TabOrder = 3 + inherited meSQL: TMemo + Width = 457 + Height = 168 + Color = clBtnFace + ReadOnly = True + end + end + inherited pnlTop: TPanel + Top = 56 + Width = 473 + TabOrder = 1 + Visible = False + inherited btClear: TSpeedButton + Left = 465 + Width = 7 + Visible = False + end + inherited gbStatementType: TGroupBox + Width = 458 + end + end + object pnSQL: TPanel + Left = 0 + Top = 0 + Width = 473 + Height = 56 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + Visible = False + object Label14: TLabel + Left = 8 + Top = 8 + Width = 114 + Height = 13 + Caption = 'Stored Procedure Name' + end + object cbStoredProcName: TComboBox + Left = 8 + Top = 24 + Width = 321 + Height = 21 + Anchors = [akLeft, akTop, akRight] + DropDownCount = 16 + ItemHeight = 13 + TabOrder = 0 + OnChange = cbStoredProcNameChange + OnDropDown = cbStoredProcNameDropDown + end + object btGenerate: TButton + Left = 344 + Top = 22 + Width = 121 + Height = 25 + Anchors = [akTop, akRight] + Caption = 'Generate' + Enabled = False + TabOrder = 1 + OnClick = btGenerateClick + end + end + object pnSQLSP: TPanel + Left = 0 + Top = 98 + Width = 473 + Height = 48 + Align = alTop + BevelOuter = bvNone + TabOrder = 2 + Visible = False + object Label2: TLabel + Left = 5 + Top = 20 + Width = 84 + Height = 13 + Caption = 'StoredProc Name' + end + object cbStoredProcNameSP: TComboBox + Left = 97 + Top = 16 + Width = 376 + Height = 21 + Anchors = [akLeft, akTop, akRight] + DropDownCount = 16 + ItemHeight = 13 + TabOrder = 0 + OnDropDown = cbStoredProcNameDropDown + OnExit = cbStoredProcNameSPExit + end + end +end diff --git a/internal/4.10.0.10/1/Source/Design/DASPCallFrame.pas b/internal/4.10.0.10/1/Source/Design/DASPCallFrame.pas new file mode 100644 index 0000000..319e47a --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DASPCallFrame.pas @@ -0,0 +1,258 @@ + +////////////////////////////////////////////////// +// DB Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +// Stored Proc Call Generator Frame +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I Dac.inc} + +unit DASPCallFrame; +{$ENDIF} + +interface + +uses +{$IFDEF MSWINDOWS} + Windows, Messages, Graphics, Controls, Forms, + Dialogs, StdCtrls, ExtCtrls, Buttons, +{$ENDIF} +{$IFDEF LINUX} + QStdCtrls, QExtCtrls, QControls, QButtons, QForms, +{$ENDIF} + Classes, SysUtils, DBAccess, + CRFrame, CRTabEditor, DASQLFrame, DAUpdateSQLFrame; + +type + TDASPCallFrameMode = (spSQL, spQuery, spSQLSP, spQuerySP); + + TDASPCallFrame = class(TDAUpdateSQLFrame) + pnSQL: TPanel; + Label14: TLabel; + cbStoredProcName: TComboBox; + btGenerate: TButton; + pnSQLSP: TPanel; + Label2: TLabel; + cbStoredProcNameSP: TComboBox; + procedure btGenerateClick(Sender: TObject); + procedure cbStoredProcNameChange(Sender: TObject); + procedure cbStoredProcNameDropDown(Sender: TObject); + procedure cbStoredProcNameSPExit(Sender: TObject); + protected + FListGot: boolean; + FMode: TDASPCallFrameMode; + function GetStatementTypes: TStatementTypes; override; + procedure SetMode(Value: TDASPCallFrameMode); + function CreateProcCall(SPName: string; SPParams: TDAParams): string; virtual; + function UsedConnection: TCustomDAConnection; + procedure DoActivate; override; + public + function GetSPName: string; + procedure SetSPName(Value: string); + + function ActiveControl: TWinControl; override; + + property Mode: TDASPCallFrameMode read FMode write SetMode; + end; + +implementation + +{$IFDEF IDE} +{$R *.dfm} +{$ENDIF} +{$IFDEF MSWINDOWS} +{$R DASPCallFrame.dfm} +{$ENDIF} +{$IFDEF LINUX} +{$R *.xfm} +{$ENDIF} + +uses + DASQLEditor, DAQueryEditor, CREditor, DAConsts, DADesignUtils; + +function TDASPCallFrame.ActiveControl: TWinControl; +begin + case Mode of + spSQL, spQuery, spQuerySP: + Result := cbStoredProcName; + spSQLSP: + Result := cbStoredProcNameSP; + else + Result := inherited ActiveControl; + end; +end; + +procedure TDASPCallFrame.SetMode(Value: TDASPCallFrameMode); +begin + if Value = spSQLSP then + meSQL.Left := 1 + else + meSQL.Left := 8; + meSQL.Top := 8; + meSQL.Width := meSQL.Parent.ClientWidth - meSQL.Left * 2; + meSQL.Height := meSQL.Parent.Height - meSQL.Top * 2; // Delphi bug? + + pnSQL.Visible := False; + pnlTop.Visible := False; + pnSQLSP.Visible := False; + + pnSQL.Visible := Value in [spQuery, spQuerySP, spSQL]; + if pnSQL.Visible then + pnlTop.Top := pnSQL.Height + 1 + else + pnlTop.Top := 0; + pnlTop.Visible := Value in [spQuery, spQuerySP]; + pnSQLSP.Visible := Value = spSQLSP; + + FMode := Value; +end; + +function TDASPCallFrame.CreateProcCall(SPName: string; SPParams: TDAParams): string; +begin + Assert(False, 'Must be overriden'); +end; + +function TDASPCallFrame.UsedConnection: TCustomDAConnection; +begin + Result := nil; + if Editor.Component is TCustomDADataSet then + Result := TDBAccessUtils.UsedConnection(TCustomDADataSet(Editor.Component)) + else + if Editor.Component is TCustomDASQL then + Result := TDBAccessUtils.UsedConnection(TCustomDASQL(Editor.Component)) + else + Assert(False); +end; + +procedure TDASPCallFrame.DoActivate; +begin + inherited; +{$IFDEF DBTOOLS} + if Editor.DADesignUtilsClass.DBToolsAvailable then + cbStoredProcNameSP.OnSelect := cbStoredProcNameSPExit; +{$ENDIF} + cbStoredProcNameChange(nil); +end; + +procedure TDASPCallFrame.btGenerateClick(Sender: TObject); +var + Command: TCustomDASQL; + Par: TDAParams; + OldSQL: string; +begin + OldSQL := TrimRight(LocalComponentSQL.Text); + case Mode of + spSQL: begin + SQLText := CreateProcCall(GetSPName, Editor.DADesignUtilsClass.GetParams(Editor.LocalComponent)); + meSQLExit(nil); + end; + spQuery, spQuerySP: begin + Assert(UsedConnection <> nil); + Command := UsedConnection.CreateSQL; + try + if FStatementType = stQuery then + Par := Editor.DADesignUtilsClass.GetParams(Editor.LocalComponent) + else + Par := Command.Params; + + Command.SQL.Text := CreateProcCall(GetSPName, Par); + SQLText := Command.SQL.Text; + meSQLExit(nil); + meSQLChange(nil); + finally + Command.Free; + end; + end; + end; + if TrimRight(SQLText) <> OldSQL then + Modified := True; +end; + +procedure TDASPCallFrame.cbStoredProcNameChange(Sender: TObject); +begin + case Mode of + spSQL, spQuery, spQuerySP: + btGenerate.Enabled := (UsedConnection <> nil) and (Trim(cbStoredProcName.Text) <> ''); + {spSQLSP: + btGenerateSP.Enabled := Trim(cbStoredProcNameSP.Text) <> '';} + end; +end; + +function TDASPCallFrame.GetSPName: string; +begin + case Mode of + spSQL, spQuery, spQuerySP: + Result := cbStoredProcName.Text; + spSQLSP: + Result := cbStoredProcNameSP.Text; + end; + Result := Trim(Result); +end; + +procedure TDASPCallFrame.SetSPName(Value: string); +begin + case Mode of + spSQL, spQuery, spQuerySP: + cbStoredProcName.Text := Value; + spSQLSP: + cbStoredProcNameSP.Text := Value; + end; +end; + +procedure TDASPCallFrame.cbStoredProcNameDropDown(Sender: TObject); +begin + try + if not FListGot and (UsedConnection <> nil) then begin + Editor.CheckConnection(UsedConnection); + UsedConnection.GetStoredProcNames(cbStoredProcName.Items); + cbStoredProcNameSP.Items.Assign(cbStoredProcName.Items); + FListGot := True; + end; + except + Application.HandleException(Self); + end; +end; + +procedure TDASPCallFrame.cbStoredProcNameSPExit(Sender: TObject); +var + SPName: string; +begin + try + SPName := GetSPName; + if (SPName <> '') and (SPName <> Editor.DADesignUtilsClass.GetStoredProcName(Editor.LocalComponent as TCustomDADataSet)) then begin + Modified := True; + Editor.DADesignUtilsClass.SetStoredProcName(Editor.LocalComponent as TCustomDADataSet, SPName); + if UsedConnection = nil then + raise Exception.Create(SConnectionNotDefined) + else begin + SQLText := CreateProcCall(SPName, Editor.DADesignUtilsClass.GetParams(Editor.LocalComponent)); + Application.ProcessMessages; + SetSelStart(meSQL, 0); + meSQLExit(nil); + end; + end; + except + if Editor.ActiveControl <> nil then // prevent from infinite loop if ESC was pressed in Editor + Application.HandleException(Self); + end; +end; + +function TDASPCallFrame.GetStatementTypes: TStatementTypes; +begin + case FMode of + spSQL: + Result := [stQuery]; // invisible + spQuery: + Result := Editor.DADesignUtilsClass.GetStatementTypes; + spSQLSP: + Result := [stQuery]; // invisible + spQuerySP: + Result := Editor.DADesignUtilsClass.GetStatementTypes; + else + Assert(False); + end; +end; + +end. diff --git a/internal/4.10.0.10/1/Source/Design/DASPCallFrame.xfm b/internal/4.10.0.10/1/Source/Design/DASPCallFrame.xfm new file mode 100644 index 0000000..d588856 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DASPCallFrame.xfm @@ -0,0 +1,101 @@ +inherited DASPCallFrame: TDASPCallFrame + Width = 473 + Height = 332 + inherited Panel1: TPanel + Top = 146 + Width = 473 + Height = 186 + TabOrder = 3 + inherited meSQL: TMemo + Width = 457 + Height = 168 + Color = clBtnFace + ReadOnly = True + end + end + inherited pnlTop: TPanel + Top = 56 + Width = 473 + TabOrder = 1 + Visible = False + inherited btClear: TSpeedButton + Left = 465 + Width = 7 + Visible = False + end + inherited gbStatementType: TGroupBox + Width = 458 + end + end + object pnSQL: TPanel + Left = 0 + Top = 0 + Width = 473 + Height = 56 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + Visible = False + object Label14: TLabel + Left = 8 + Top = 8 + Width = 114 + Height = 13 + Caption = 'Stored Procedure Name' + end + object cbStoredProcName: TComboBox + Left = 8 + Top = 24 + Width = 321 + Height = 21 + Anchors = [akLeft, akTop, akRight] + DropDownCount = 16 + ItemHeight = 13 + TabOrder = 0 + Items.Strings = ( + '') + OnChange = cbStoredProcNameChange + OnDropDown = cbStoredProcNameDropDown + end + object btGenerate: TButton + Left = 344 + Top = 22 + Width = 121 + Height = 25 + Anchors = [akTop, akRight] + Caption = 'Generate' + Enabled = False + TabOrder = 1 + OnClick = btGenerateClick + end + end + object pnSQLSP: TPanel + Left = 0 + Top = 98 + Width = 473 + Height = 48 + Align = alTop + BevelOuter = bvNone + TabOrder = 2 + Visible = False + object Label2: TLabel + Left = 5 + Top = 20 + Width = 84 + Height = 13 + Caption = 'StoredProc Name' + end + object cbStoredProcNameSP: TComboBox + Left = 97 + Top = 16 + Width = 376 + Height = 21 + Anchors = [akLeft, akTop, akRight] + DropDownCount = 16 + ItemHeight = 13 + TabOrder = 0 + OnDropDown = cbStoredProcNameDropDown + OnExit = cbStoredProcNameSPExit + end + end +end \ No newline at end of file diff --git a/internal/4.10.0.10/1/Source/Design/DASQLEditor.dfm b/internal/4.10.0.10/1/Source/Design/DASQLEditor.dfm new file mode 100644 index 0000000..a40502c --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DASQLEditor.dfm @@ -0,0 +1,40 @@ +inherited DASQLEditorForm: TDASQLEditorForm + PixelsPerInch = 96 + TextHeight = 13 + inherited BtnPanel: TPanel + inherited btOk: TBitBtn + TabOrder = 1 + end + inherited btCancel: TBitBtn + TabOrder = 2 + end + object btExecute: TButton + Left = 8 + Top = 8 + Width = 80 + Height = 25 + Anchors = [akLeft, akBottom] + Caption = 'Execute' + TabOrder = 0 + OnClick = btExecuteClick + end + end + inherited PageControl: TPageControl + ActivePage = shSQL + object shSQL: TTabSheet + Caption = 'S&QL' + end + object shParameters: TTabSheet + Caption = '&Parameters' + ImageIndex = 1 + end + object shMacros: TTabSheet + Caption = '&Macros' + ImageIndex = 2 + end + object shGeneratorSPC: TTabSheet + Caption = 'S&tored Proc Call Generator' + ImageIndex = 3 + end + end +end diff --git a/internal/4.10.0.10/1/Source/Design/DASQLEditor.pas b/internal/4.10.0.10/1/Source/Design/DASQLEditor.pas new file mode 100644 index 0000000..ef3a54c --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DASQLEditor.pas @@ -0,0 +1,215 @@ + +////////////////////////////////////////////////// +// Data Access Components +// Copyright © 1998-2005 Core Lab. All right reserved. +// SQL Editor +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I Dac.inc} + +unit DASQLEditor; +{$ENDIF} +interface +uses +{$IFDEF MSWINDOWS} + Windows, Messages, Graphics, Controls, Forms, Dialogs, + ComCtrls, StdCtrls, ExtCtrls, Buttons, +{$ENDIF} +{$IFDEF LINUX} + Types, QGraphics, QControls, QForms, QDialogs, QStdCtrls, + QExtCtrls, QComCtrls, QButtons, +{$ENDIF} +{$IFDEF DBTOOLS} + DBToolsClient, +{$ENDIF} + SysUtils, DB, Classes, + DBAccess, MemUtils, + CREditor, CRTabEditor, CRFrame, DASQLFrame, DAParamsFrame, DAMacrosFrame, DASPCallFrame; + +type + TDASQLEditorForm = class(TCRTabEditorForm) + shSQL: TTabSheet; + shParameters: TTabSheet; + shMacros: TTabSheet; + shGeneratorSPC: TTabSheet; + btExecute: TButton; + procedure btExecuteClick(Sender: TObject); + protected + FSQLFrame: TDASQLFrame; + FParamsFrame: TDAParamsFrame; + FMacrosFrame: TDAMacrosFrame; + FSPCallFrame: TDASPCallFrame; + + FLocalComponent, FComponent: TComponent; + FOldAfterExecute: TAfterExecuteEvent; + + procedure AfterExecute(Sender: TObject; Result: boolean); + + procedure DoInit; override; + procedure DoActivate; override; + procedure DoFinish; override; + procedure DoSave; override; + + procedure DoError(E: Exception); virtual; + + function GetSQL: TCustomDASQL; + procedure SetSQL(Value: TCustomDASQL); + function GetComponent: TComponent; override; + procedure SetComponent(Value: TComponent); override; + function GetLocalComponent: TComponent; override; + + function GetFrameByInitProp: TCRFrame; override; + + property SQL: TCustomDASQL read GetSQL write SetSQL; + + public + property SQLFrame: TDASQLFrame read FSQLFrame; + property ParamsFrame: TDAParamsFrame read FParamsFrame; + property MacrosFrame: TDAMacrosFrame read FMacrosFrame; + + end; + +implementation + +uses + DADesignUtils; + +{$IFDEF IDE} +{$R *.dfm} +{$ENDIF} +{$IFDEF MSWINDOWS} +{$R DASQLEditor.dfm} +{$ENDIF} +{$IFDEF LINUX} +{$R *.xfm} +{$ENDIF} + +procedure TDASQLEditorForm.DoInit; +begin + inherited; + + try + FLocalComponent := TComponentClass(FComponent.ClassType).Create(nil); + TDBAccessUtils.SetDesigning(FLocalComponent, csDesigning in FComponent.ComponentState); + FLocalComponent.Assign(FComponent); + FDADesignUtilsClass.SetDesignCreate(FLocalComponent, True); + finally + + Assert(FSQLFrame <> nil); + Assert(FParamsFrame <> nil); + Assert(FMacrosFrame <> nil); + Assert(FSPCallFrame <> nil); + FSPCallFrame.Mode := spSQL; + + Modified := False; + end; +end; + +procedure TDASQLEditorForm.DoActivate; +var + Frame: TCRFrame; +begin + inherited; + + Frame := GetFrameByInitProp; + if Frame <> nil then begin + PageControl.ActivePage := Frame.Page; + //Frame.SetFocus; // on Kylix control can be invisible in the form OnShow event + Frame.Activate; + end; + + if PageControl.ActivePage = FSQLFrame.Page then + ActiveControl := FSQLFrame.ActiveControl; +end; + +procedure TDASQLEditorForm.DoFinish; +begin + FLocalComponent.Free; + FLocalComponent := nil; + inherited; +end; + +procedure TDASQLEditorForm.AfterExecute(Sender:TObject; Result:boolean); +begin + btExecute.Enabled := True; + FDADesignUtilsClass.SetAfterExecute(FLocalComponent, FOldAfterExecute); +end; + +procedure TDASQLEditorForm.DoSave; +begin + inherited; + FComponent.Assign(FLocalComponent); +end; + +procedure TDASQLEditorForm.DoError(E: Exception); +begin + PageControl.ActivePage := FSQLFrame.Page; +{$IFDEF DBTOOLS} + if DBTools.HasDACSqlEditorFrame(FSQLFrame.meSQL) then + ActiveControl := DBTools.GetDACSqlEditorFrame(FSQLFrame.meSQL) + else +{$ENDIF} + ActiveControl := FSQLFrame.meSQL; +end; + +procedure TDASQLEditorForm.btExecuteClick(Sender: TObject); +begin + SaveControlData; + CheckConnection(FLocalComponent); + FOldAfterExecute := FDADesignUtilsClass.GetAfterExecute(FLocalComponent); + FDADesignUtilsClass.SetAfterExecute(FLocalComponent, AfterExecute); + btExecute.Enabled := False; + try + FDADesignUtilsClass.Execute(FLocalComponent); + FParamsFrame.SelectItem; + except + on E: Exception do begin + DoError(E); + AfterExecute(FLocalComponent, False); + raise; + end; + end; +end; + +function TDASQLEditorForm.GetSQL: TCustomDASQL; +begin + Result := FComponent as TCustomDASQL; +end; + +procedure TDASQLEditorForm.SetSQL(Value: TCustomDASQL); +begin + FComponent := Value; +end; + +function TDASQLEditorForm.GetComponent: TComponent; +begin + Result := SQL; +end; + +procedure TDASQLEditorForm.SetComponent(Value: TComponent); +begin + SQL := Value as TCustomDASQL; +end; + +function TDASQLEditorForm.GetLocalComponent: TComponent; +begin + Result := FLocalComponent; +end; + +function TDASQLEditorForm.GetFrameByInitProp: TCRFrame; +begin + if InitialProperty = 'SQL' then + Result := FSQLFrame + else + if InitialProperty = 'Params' then + Result := FParamsFrame + else + if InitialProperty = 'Macros' then + Result := FMacrosFrame + else + Result := inherited GetFrameByInitProp; +end; + +end. diff --git a/internal/4.10.0.10/1/Source/Design/DASQLEditor.xfm b/internal/4.10.0.10/1/Source/Design/DASQLEditor.xfm new file mode 100644 index 0000000..a64cf38 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DASQLEditor.xfm @@ -0,0 +1,40 @@ +inherited DASQLEditorForm: TDASQLEditorForm + PixelsPerInch = 96 + TextHeight = 13 + inherited BtnPanel: TPanel + inherited btOk: TBitBtn + TabOrder = 1 + end + inherited btCancel: TBitBtn + TabOrder = 2 + end + object btExecute: TButton + Left = 8 + Top = 8 + Width = 80 + Height = 25 + Anchors = [akLeft, akBottom] + Caption = 'Execute' + TabOrder = 0 + OnClick = btExecuteClick + end + end + inherited PageControl: TPageControl + ActivePage = shSQL + object shSQL: TTabSheet + Caption = 'S&QL' + end + object shParameters: TTabSheet + Caption = '&Parameters' + ImageIndex = 1 + end + object shMacros: TTabSheet + Caption = '&Macros' + ImageIndex = 2 + end + object shGeneratorSPC: TTabSheet + Caption = 'S&tored Proc Call Generator' + ImageIndex = 3 + end + end +end diff --git a/internal/4.10.0.10/1/Source/Design/DASQLFrame.dfm b/internal/4.10.0.10/1/Source/Design/DASQLFrame.dfm new file mode 100644 index 0000000..ee27db2 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DASQLFrame.dfm @@ -0,0 +1,31 @@ +inherited DASQLFrame: TDASQLFrame + object Panel1: TPanel + Left = 0 + Top = 0 + Width = 481 + Height = 229 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object meSQL: TMemo + Left = 8 + Top = 8 + Width = 465 + Height = 213 + Anchors = [akLeft, akTop, akRight, akBottom] + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'Courier New' + Font.Pitch = fpVariable + Font.Style = [] + Lines.Strings = ( + '') + ParentFont = False + ScrollBars = ssBoth + TabOrder = 0 + WordWrap = False + OnExit = meSQLExit + end + end +end diff --git a/internal/4.10.0.10/1/Source/Design/DASQLFrame.pas b/internal/4.10.0.10/1/Source/Design/DASQLFrame.pas new file mode 100644 index 0000000..5ea135f --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DASQLFrame.pas @@ -0,0 +1,149 @@ + +////////////////////////////////////////////////// +// DB Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +// SQL Editor Frame +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I Dac.inc} + +unit DASQLFrame; +{$ENDIF} + +interface + +uses +{$IFDEF MSWINDOWS} + Windows, Messages, Graphics, Controls, Forms, + Dialogs, StdCtrls, ExtCtrls, +{$ENDIF} +{$IFDEF LINUX} + QForms, QControls, QExtCtrls, QStdCtrls, +{$ENDIF} +{$IFDEF DBTOOLS} + DBToolsClient, +{$ENDIF} + Classes, SysUtils, + CRFrame, CRTabEditor; + +type + TDASQLFrame = class(TCRFrame) + meSQL: TMemo; + Panel1: TPanel; + procedure meSQLExit(Sender: TObject); + + protected + function GetSQLText: string; + procedure SetSQLText(const Value: string); + + procedure LoadMemo; virtual; + procedure SaveMemo; virtual; + procedure DoActivate; override; + function GetLocalComponentSQL: TStrings; virtual; + procedure SetLocalComponentSQL(Value: TStrings); virtual; + + property SQLText: string read GetSQLText write SetSQLText; + property LocalComponentSQL: TStrings read GetLocalComponentSQL write SetLocalComponentSQL; + public + {$IFDEF USE_SYNEDIT} + constructor Create(Owner: TComponent); override; + {$ENDIF} + + function ActiveControl: TWinControl; override; + end; + +implementation + +{$IFDEF IDE} +{$R *.dfm} +{$ENDIF} +{$IFDEF MSWINDOWS} +{$R DASQLFrame.dfm} +{$ENDIF} +{$IFDEF LINUX} +{$R *.xfm} +{$ENDIF} + +uses + CREditor; + +{$IFDEF USE_SYNEDIT} +constructor TDASQLFrame.Create(Owner: TComponent); +var + WinControl: TWinControl; +begin + inherited; + +{$IFDEF DBTOOLS} + if TCREditorForm(Owner).DADesignUtilsClass.DBToolsAvailable then + Exit; +{$ENDIF} + WinControl := meSQL; + Assert(Owner is TCREditorForm); + TCREditorForm(Owner).ReplaceMemo(WinControl, True); + meSQL := TMemo(WinControl); +end; +{$ENDIF} + +function TDASQLFrame.GetSQLText: string; +begin + Result := GetMemoText(meSQL); +end; + +procedure TDASQLFrame.SetSQLText(const Value: string); +begin + if Trim(SQLText) <> Trim(Value) then + SetMemoText(meSQL, Value); +end; + +function TDASQLFrame.GetLocalComponentSQL: TStrings; +begin + Assert(Editor <> nil); + Result := Editor.DADesignUtilsClass.GetSQL(Editor.LocalComponent); +end; + +procedure TDASQLFrame.SetLocalComponentSQL(Value: TStrings); +begin + Assert(Editor <> nil); + Editor.DADesignUtilsClass.SetSQL(Editor.LocalComponent, Value); +end; + +procedure TDASQLFrame.meSQLExit(Sender: TObject); +begin + if TrimRight(LocalComponentSQL.Text) <> TrimRight(SQLText) then begin + SaveMemo; + Modified := True; + end; +end; + +function TDASQLFrame.ActiveControl: TWinControl; +begin +{$IFDEF DBTOOLS} + if DBTools.HasDACSqlEditorFrame(meSQL) then + Result := DBTools.GetDACSqlEditorFrame(meSQL) + else +{$ENDIF} + Result := meSQL; +end; + +procedure TDASQLFrame.LoadMemo; +begin + SQLText := LocalComponentSQL.Text; +end; + +procedure TDASQLFrame.SaveMemo; +begin + LocalComponentSQL.Text := Trim(SQLText); +end; + +procedure TDASQLFrame.DoActivate; +begin +{$IFDEF DBTOOLS} + DBTools.ReplaceMemo(meSQL, Editor.DADesignUtilsClass, Editor.Component); +{$ENDIF} + LoadMemo; +end; + +end. diff --git a/internal/4.10.0.10/1/Source/Design/DASQLFrame.xfm b/internal/4.10.0.10/1/Source/Design/DASQLFrame.xfm new file mode 100644 index 0000000..3c434eb --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DASQLFrame.xfm @@ -0,0 +1,31 @@ +inherited DASQLFrame: TDASQLFrame + object Panel1: TPanel + Left = 0 + Top = 0 + Width = 481 + Height = 229 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object meSQL: TMemo + Left = 8 + Top = 8 + Width = 465 + Height = 213 + Anchors = [akLeft, akTop, akRight, akBottom] + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'Courier New' + Font.Pitch = fpVariable + Font.Style = [] + Lines.Strings = ( + '') + ParentFont = False + ScrollBars = ssBoth + TabOrder = 0 + WordWrap = False + OnExit = meSQLExit + end + end +end diff --git a/internal/4.10.0.10/1/Source/Design/DASQLGeneratorFrame.dfm b/internal/4.10.0.10/1/Source/Design/DASQLGeneratorFrame.dfm new file mode 100644 index 0000000..4d66b76 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DASQLGeneratorFrame.dfm @@ -0,0 +1,137 @@ +inherited DASQLGeneratorFrame: TDASQLGeneratorFrame + Height = 245 + object pnSQLGenerator: TPanel + Left = 8 + Top = 6 + Width = 465 + Height = 229 + Anchors = [akLeft, akTop, akRight, akBottom] + TabOrder = 0 + OnResize = pnSQLGeneratorResize + object lbTableName: TLabel + Left = 13 + Top = 13 + Width = 61 + Height = 13 + Caption = 'Table Name:' + end + object lbKeyFieldsLabel: TLabel + Left = 182 + Top = 12 + Width = 51 + Height = 13 + Caption = 'Key Fields:' + end + object lbUpdateFieldsLabel: TLabel + Left = 321 + Top = 11 + Width = 68 + Height = 13 + Anchors = [akTop, akRight] + Caption = 'Update Fields:' + end + object cbTables: TComboBox + Left = 13 + Top = 29 + Width = 156 + Height = 21 + ItemHeight = 13 + TabOrder = 0 + OnChange = cbTablesChange + OnDropDown = cbTablesDropDown + end + object btGenerate: TButton + Left = 13 + Top = 82 + Width = 155 + Height = 22 + Caption = 'Generate SQL' + TabOrder = 2 + OnClick = btGenerateClick + end + object lbKeyFields: TListBox + Left = 180 + Top = 28 + Width = 133 + Height = 188 + Anchors = [akLeft, akTop, akBottom] + ItemHeight = 13 + MultiSelect = True + TabOrder = 8 + OnClick = lbUpdateFieldsClick + end + object lbUpdateFields: TListBox + Left = 321 + Top = 28 + Width = 133 + Height = 188 + Anchors = [akTop, akRight, akBottom] + ItemHeight = 13 + MultiSelect = True + TabOrder = 9 + OnClick = lbUpdateFieldsClick + end + object btGetFields: TButton + Left = 13 + Top = 56 + Width = 155 + Height = 22 + Caption = 'Get Fields' + Enabled = False + TabOrder = 1 + OnClick = btGetFieldsClick + end + object cbInsert: TCheckBox + Left = 15 + Top = 109 + Width = 146 + Height = 17 + Caption = 'Insert' + Checked = True + State = cbChecked + TabOrder = 3 + OnClick = cbIUDRClick + end + object cbUpdate: TCheckBox + Left = 15 + Top = 125 + Width = 146 + Height = 17 + Caption = 'Update' + Checked = True + State = cbChecked + TabOrder = 4 + OnClick = cbIUDRClick + end + object cbDelete: TCheckBox + Left = 15 + Top = 141 + Width = 146 + Height = 17 + Caption = 'Delete' + Checked = True + State = cbChecked + TabOrder = 5 + OnClick = cbIUDRClick + end + object cbRefresh: TCheckBox + Left = 15 + Top = 157 + Width = 146 + Height = 17 + Caption = 'Refresh' + Checked = True + State = cbChecked + TabOrder = 6 + OnClick = cbIUDRClick + end + object cbQuoteFields: TCheckBox + Left = 15 + Top = 173 + Width = 146 + Height = 17 + Caption = 'Quote names' + TabOrder = 7 + end + end +end diff --git a/internal/4.10.0.10/1/Source/Design/DASQLGeneratorFrame.pas b/internal/4.10.0.10/1/Source/Design/DASQLGeneratorFrame.pas new file mode 100644 index 0000000..f8817d1 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DASQLGeneratorFrame.pas @@ -0,0 +1,628 @@ + +////////////////////////////////////////////////// +// DB Access Components +// Copyright © 1998-2005 Core Lab. All right reserved. +// SQLGenerator Frame +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I Dac.inc} + +unit DASQLGeneratorFrame; +{$ENDIF} + +interface + +uses +{$IFDEF MSWINDOWS} + Windows, Messages, Graphics, Controls, Forms, + Dialogs, StdCtrls, ExtCtrls, Buttons, +{$ENDIF} +{$IFDEF LINUX} + QStdCtrls, QExtCtrls, QButtons, QControls, +{$ENDIF} + Classes, SysUtils, + DBAccess, CRAccess, + CRFrame, CRTabEditor; + +type + TDASQLGeneratorFrame = class(TCRFrame) + pnSQLGenerator: TPanel; + lbTableName: TLabel; + lbKeyFieldsLabel: TLabel; + lbUpdateFieldsLabel: TLabel; + cbTables: TComboBox; + btGenerate: TButton; + lbKeyFields: TListBox; + lbUpdateFields: TListBox; + btGetFields: TButton; + cbInsert: TCheckBox; + cbUpdate: TCheckBox; + cbDelete: TCheckBox; + cbRefresh: TCheckBox; + cbQuoteFields: TCheckBox; + procedure pnSQLGeneratorResize(Sender: TObject); + procedure btGetFieldsClick(Sender: TObject); + procedure cbTablesChange(Sender: TObject); + procedure cbIUDRClick(Sender: TObject); + procedure btGenerateClick(Sender: TObject); + procedure lbUpdateFieldsClick(Sender: TObject); + procedure cbTablesDropDown(Sender: TObject); + + protected + FLocalDataSet: TCustomDADataSet; + FOnChange: TNotifyEvent; + FLockUpdateControlsState: boolean; + FLastGeneratedSQL, + FLastOriginSQL, + FOldSQL, + FOldFilterSQL: string; + FOldUpdatingTable: string; + Fcb: array[TStatementType] of TCheckBox; + + FPromptlyServerRead, + FParseTableNames: boolean; + FActivated: boolean; + + procedure GenerateSelectFromAllFields; virtual; + procedure SetFilterSQL(Value: string; Open: boolean = False); + function OpenDataSet(RaiseException: boolean = False): boolean; + procedure InitTables(DeleteBadTableNames: boolean = False); + procedure ClearFields; + procedure GetFields(Forced: boolean = False); + procedure UpdateControlsState; virtual; + + function GetOriginLocalDataSet: TCustomDADataSet; + function GetLocalDataSet: TCustomDADataSet; + + function GetTablesInfo: TCRTablesInfo; virtual; + function SelectedTableName: string; virtual; + function NormSelectedTableName: string; virtual; + function UnqSelectedTableName: string; + + procedure SetControlEnabled(Control: TControl; Value: boolean); + function cbChecked(StatementType: TStatementType): boolean; + + property LocalDataSet: TCustomDADataSet read GetLocalDataSet; + property OriginLocalDataSet: TCustomDADataSet read GetOriginLocalDataSet; + property TablesInfo: TCRTablesInfo read GetTablesInfo; + + procedure DoActivate; override; + procedure DoFinish; override; + + function GenerateSQLforUpdTable(TableInfo: TCRTableInfo; + const KeyAndDataFields: TKeyAndDataFields; + const StatementType: TStatementType; + const ModifiedFieldsOnly: boolean): string; virtual; + public + constructor Create(AOwner: TComponent); override; + + function ActiveControl: TWinControl; override; + property OnChange: TNotifyEvent read FOnChange write FOnChange; + + end; + +implementation + +{$IFDEF IDE} +{$R *.dfm} +{$ENDIF} +{$IFDEF MSWINDOWS} +{$R DASQLGeneratorFrame.dfm} +{$ENDIF} +{$IFDEF LINUX} +{$R *.xfm} +{$ENDIF} + +uses + DB, DAQueryEditor, DAUpdateSQLEditor, DAUpdateSQLFrame, MemData; + +constructor TDASQLGeneratorFrame.Create(AOwner: TComponent); +var + st: TStatementType; +begin + inherited; + for st := Low(TStatementType) to High(TStatementType) do + Fcb[st] := nil; + Fcb[stInsert] := cbInsert; + Fcb[stUpdate] := cbUpdate; + Fcb[stDelete] := cbDelete; + Fcb[stRefresh] := cbRefresh; + FPromptlyServerRead := True; + FParseTableNames := False; + FActivated := False; +end; + +procedure TDASQLGeneratorFrame.SetControlEnabled(Control: TControl; Value: boolean); +begin +{$IFNDEF LINUX} + if not Value and (Editor.ActiveControl = Control) then + Editor.ActiveControl := Control.Parent; +{$ENDIF} + + Control.Enabled := Value; +end; + +function TDASQLGeneratorFrame.cbChecked(StatementType: TStatementType): boolean; +begin + Result := (Fcb[StatementType] <> nil) and Fcb[StatementType].Enabled + and Fcb[StatementType].Checked and Fcb[StatementType].Visible; +end; + +function TDASQLGeneratorFrame.GetOriginLocalDataSet: TCustomDADataSet; +begin + Result := nil; + if FEditor is TDAQueryEditorForm then + Result := TDAQueryEditorForm(FEditor).LocalComponent as TCustomDADataSet + else + if FEditor is TDAUpdateSQLEditorForm then + Result := TDAUpdateSQLEditorForm(FEditor).LocalDataSet + else + Assert(False); +end; + +function TDASQLGeneratorFrame.GetLocalDataSet: TCustomDADataSet; +begin + if FLocalDataSet = nil then begin + FLocalDataSet := TComponentClass(OriginLocalDataSet.ClassType).Create(nil) as TCustomDADataSet; + FLocalDataSet.Assign(OriginLocalDataSet); + TDBAccessUtils.SetDesigning(FLocalDataSet, csDesigning in OriginLocalDataSet.ComponentState); + end; + Result := FLocalDataSet; +end; + +function TDASQLGeneratorFrame.GetTablesInfo: TCRTablesInfo; +begin + Result := TDBAccessUtils.GetTablesInfo(LocalDataSet); +end; + +function TDASQLGeneratorFrame.SelectedTableName: string; +begin + Result := TablesInfo.TableInfoClass.NormalizeName(Trim(cbTables.Text), LocalDataSet.Options.QuoteNames); +end; + +function TDASQLGeneratorFrame.NormSelectedTableName: string; +begin + Result := TablesInfo.TableInfoClass.NormalizeName(Trim(cbTables.Text)); // Without QuoteName! +end; + +function TDASQLGeneratorFrame.UnqSelectedTableName: string; +begin + Result := TablesInfo.TableInfoClass.UnQuote(Trim(cbTables.Text)); +end; + +function TDASQLGeneratorFrame.ActiveControl: TWinControl; +begin + Result := cbTables; +end; + +procedure TDASQLGeneratorFrame.GenerateSelectFromAllFields; +begin + LocalDataSet.SQL.Text := 'SELECT * FROM ' + SelectedTableName; +end; + +procedure TDASQLGeneratorFrame.SetFilterSQL(Value: string; Open: boolean = False); +var + OldDebug: boolean; +begin + OldDebug := LocalDataSet.Debug; + try + LocalDataSet.Debug := False; + LocalDataSet.FilterSQL := Value; + if Open then + LocalDataSet.Open; + finally + LocalDataSet.Debug := OldDebug; + end; +end; + +function TDASQLGeneratorFrame.OpenDataSet(RaiseException: boolean = False): boolean; +begin + Result := True; + try + Editor.CheckConnection(LocalDataSet); + SetFilterSQL('1=0', True); + except + Result := False; + if RaiseException then + raise; + end; +end; + +procedure TDASQLGeneratorFrame.InitTables(DeleteBadTableNames: boolean = False); +var + i, n, ItemIndex: integer; + s: string; +begin + cbTables.Items.BeginUpdate; + try + {$IFDEF LINUX} + if (cbTables.Items.Count = 1) and (cbTables.Items[0] = '') then + cbTables.Items.Clear; + {$ENDIF} + if DeleteBadTableNames then begin + i := 0; + while i < cbTables.Items.Count do + if cbTables.Items.Objects[i] = nil then + cbTables.Items.Delete(i) + else + Inc(i); + end; + + SetFilterSQL('1=0'); + ItemIndex := -1; + if FParseTableNames or OpenDataSet then + for i := 0 to TablesInfo.Count - 1 do begin + s := Trim(TablesInfo[i].TableName); + n := cbTables.Items.IndexOf(s); + if n = -1 then + n := cbTables.Items.Add(s); + if i = 0 then + ItemIndex := n; + end; + + if (Trim(cbTables.Text) = '') and (FOldUpdatingTable <> '') then + cbTables.Text := FOldUpdatingTable + else + if (ItemIndex <> -1) and (Trim(OriginLocalDataSet.SQL.Text) <> FLastOriginSQL) + and (cbTables.Items[ItemIndex] <> cbTables.Text) then begin + FLastOriginSQL := Trim(OriginLocalDataSet.SQL.Text); + ClearFields; + cbTables.ItemIndex := ItemIndex; + end; + finally + {$IFDEF LINUX} + if cbTables.Items.Count = 0 then + cbTables.Items.Add(''); + {$ENDIF} + cbTables.Items.EndUpdate; + end; +end; + +procedure TDASQLGeneratorFrame.ClearFields; +begin + lbKeyFields.Items.Clear; + lbUpdateFields.Items.Clear; +end; + +procedure TDASQLGeneratorFrame.GetFields(Forced: boolean = False); +var + KeyAndDataFields: TKeyAndDataFields; + OriginKeyList, + OriginDataList: TStringList; + + function EmptyLists: boolean; + begin + Result := (lbKeyFields.Items.Count = 0) and (lbUpdateFields.Items.Count = 0); + end; + + procedure GetFieldNames; + var + j: integer; + Empty: boolean; + + procedure AddFieldName(LB: TListBox; Name: string; const FieldList: TStringList; Selected: boolean); + begin + if LB.Items.IndexOf(Name) < 0 then begin + if Selected and (FieldList.Count <> 0) then + Selected := FieldList.IndexOf(Name) >= 0; + LB.Selected[LB.Items.Add(Name)] := Selected; + end; + end; + + begin + try + Empty := EmptyLists; + for j := 0 to High(KeyAndDataFields.KeyFieldDescs) do begin + AddFieldName(lbKeyFields, KeyAndDataFields.KeyFieldDescs[j].ActualName, OriginKeyList, Empty); + end; + for j := 0 to High(KeyAndDataFields.DataFieldDescs) do begin + AddFieldName(lbKeyFields, KeyAndDataFields.DataFieldDescs[j].ActualName, OriginKeyList, False); + AddFieldName(lbUpdateFields, KeyAndDataFields.DataFieldDescs[j].ActualName, OriginDataList, Empty); + end; + + except + ClearFields; + raise; + end; + end; + + procedure InitFields(OriginFields: boolean); + var + i: integer; + + begin + if OriginFields then begin + SetLength(KeyAndDataFields.KeyFieldDescs, 0); + SetLength(KeyAndDataFields.DataFieldDescs, 0); + end; + if not OpenDataSet(not OriginFields) or (OriginFields and not EmptyLists) then + Exit; + + if TablesInfo.IndexByName(SelectedTableName) = -1 then begin + ClearFields; + Exit; + end; + + TDBAccessUtils.SetUpdatingTable(LocalDataSet, SelectedTableName); + TDBAccessUtils.GetKeyAndDataFields(LocalDataSet, KeyAndDataFields, False); + + if OriginFields then begin + for i := 0 to High(KeyAndDataFields.KeyFieldDescs) do + OriginKeyList.Add(KeyAndDataFields.KeyFieldDescs[i].ActualName); + for i := 0 to High(KeyAndDataFields.DataFieldDescs) do + OriginDataList.Add(KeyAndDataFields.DataFieldDescs[i].ActualName); + end + else + if not Forced then + try + GetFieldNames; + finally + UpdateControlsState; + end; + end; + +var + i: integer; + +begin + if not (EmptyLists or Forced) or (UnqSelectedTableName = '') then + Exit; + + if (TDBAccessUtils.UsedConnection(LocalDataSet) <> nil) then + Editor.CheckConnection(LocalDataSet); + + try + OriginKeyList := TStringList.Create; + OriginDataList := TStringList.Create; + if FOldSQL <> LocalDataSet.SQL.Text then + LocalDataSet.SQL.Text := FOldSQL; + InitFields(True); + if EmptyLists then begin + GenerateSelectFromAllFields; + FLastGeneratedSQL := LocalDataSet.SQL.Text; + end + else + LocalDataSet.SQL.Text := FLastGeneratedSQL; + + InitFields(False); + i := cbTables.Items.IndexOf(SelectedTableName); + if i < 0 then + i := cbTables.Items.Add(SelectedTableName); + cbTables.Items.Objects[i] := Self; // Mark good table + finally + OriginKeyList.Free; + OriginDataList.Free; + end; +end; + +procedure TDASQLGeneratorFrame.UpdateControlsState; +var + TableName: string; + sts: TStatementTypes; + st: TStatementType; + IsEnabled: boolean; +begin + if FLockUpdateControlsState then + Exit; + + Assert(LocalDataSet <> nil); + + sts := TDBAccessUtils.GetUpdateSQLStatementTypes(LocalDataSet); + + TableName := SelectedTableName; + IsEnabled := TableName <> ''; + SetControlEnabled(btGetFields, IsEnabled and (lbUpdateFields.Items.Count + lbUpdateFields.Items.Count = 0)); + + SetControlEnabled(cbInsert, IsEnabled and (lbUpdateFields.SelCount > 0)); + SetControlEnabled(cbUpdate, IsEnabled and (lbKeyFields.SelCount > 0) and (lbUpdateFields.SelCount > 0)); + SetControlEnabled(cbDelete, IsEnabled and (lbKeyFields.SelCount > 0)); + SetControlEnabled(cbRefresh, IsEnabled and (lbKeyFields.SelCount > 0) and (lbUpdateFields.SelCount > 0) {and TableNameSelectedFromList}); + + if IsEnabled then + for st := Low(TStatementType) to High(TStatementType) do + if st in sts then begin + IsEnabled := cbChecked(st); + if IsEnabled then + Break; + end; + SetControlEnabled(btGenerate, IsEnabled); + SetControlEnabled(cbQuoteFields, IsEnabled); +end; + +procedure TDASQLGeneratorFrame.pnSQLGeneratorResize(Sender: TObject); +begin + lbKeyFields.Width := (lbUpdateFields.Left + lbUpdateFields.Width - lbKeyFields.Left - 8) div 2; + lbUpdateFields.Left := lbUpdateFields.Left - (lbKeyFields.Width - lbUpdateFields.Width); + lbUpdateFields.Width := lbKeyFields.Width; + lbUpdateFieldsLabel.Left := lbUpdateFields.Left; +end; + +procedure TDASQLGeneratorFrame.btGetFieldsClick(Sender: TObject); +begin + GetFields; +end; + +procedure TDASQLGeneratorFrame.cbTablesChange(Sender: TObject); +begin + ClearFields; + if FPromptlyServerRead and (cbTables.Items.IndexOf(SelectedTableName) <> -1) then + GetFields; + UpdateControlsState; +end; + +procedure TDASQLGeneratorFrame.DoActivate; +var + OldSQL: string; +begin + FOldUpdatingTable := TDBAccessUtils.GetUpdatingTable(LocalDataSet); + OldSQL := LocalDataSet.SQL.Text; + FOldFilterSQL := LocalDataSet.FilterSQL; + try + inherited; + if OriginLocalDataSet.SQL.Text <> LocalDataSet.SQL.Text then + LocalDataSet.SQL := OriginLocalDataSet.SQL; + + if not FActivated then + cbQuoteFields.Checked := LocalDataSet.Options.QuoteNames; + + if ((TDBAccessUtils.UsedConnection(LocalDataSet) <> nil) and + TDBAccessUtils.UsedConnection(LocalDataSet).Connected and + (FOldSQL <> LocalDataSet.SQL.Text) and + FPromptlyServerRead) or FParseTableNames then + InitTables(FParseTableNames); + + FActivated := True; + finally + FOldSQL := OldSQL; // always call; see DoFinish for details + UpdateControlsState; + end; + if FPromptlyServerRead then + GetFields; +end; + +procedure TDASQLGeneratorFrame.DoFinish; +begin + inherited; + + LocalDataSet.Close; + if FOldSQL <> LocalDataSet.SQL.Text then + LocalDataSet.SQL.Text := FOldSQL; + if FOldFilterSQL <> LocalDataSet.FilterSQL then + SetFilterSQL(FOldFilterSQL); + + if FOldUpdatingTable <> TDBAccessUtils.GetUpdatingTable(LocalDataSet) then + TDBAccessUtils.SetUpdatingTable(LocalDataSet, FOldUpdatingTable); + + FLocalDataSet.Free; + FLocalDataSet := nil; +end; + +procedure TDASQLGeneratorFrame.cbIUDRClick(Sender: TObject); +begin + inherited; + UpdateControlsState; +end; + +function TDASQLGeneratorFrame.GenerateSQLforUpdTable( + TableInfo: TCRTableInfo; const KeyAndDataFields: TKeyAndDataFields; + const StatementType: TStatementType; const ModifiedFieldsOnly: boolean): string; +begin + Result := TDBAccessUtils.SQLGenerator(LocalDataSet).GenerateSQLforUpdTable(TableInfo, KeyAndDataFields, StatementType, ModifiedFieldsOnly, nil); +end; + +procedure TDASQLGeneratorFrame.btGenerateClick(Sender: TObject); +var + i, j: integer; + KeyAndDataFields: TKeyAndDataFields; + + TableInfo: TCRTableInfo; + UpdateSQLFrame: TDAUpdateSQLFrame; + + OldSQL: string; + OldActive: boolean; + st: TStatementType; + sts: TStatementTypes; + stSQL: array[TStatementType] of string; + OldQuoteNames: boolean; + +begin + GetFields(True); + OldSQL := LocalDataSet.SQL.Text; + OldActive := LocalDataSet.Active; + OldQuoteNames := LocalDataSet.Options.QuoteNames; + try + if LocalDataSet.SQL.Text <> FLastGeneratedSQL then + LocalDataSet.SQL.Text := FLastGeneratedSQL; + OpenDataSet(True); + TableInfo := TablesInfo.TableInfoClass.Create(nil); + try + TableInfo.IsView := False; // Use to generate only specified fields + TableInfo.TableName := NormSelectedTableName; + TableInfo.TableNameFull := TableInfo.TableName; + TableInfo.TableAlias := ''; + + SetLength(KeyAndDataFields.KeyFieldDescs, lbKeyFields.SelCount); + j := 0; + for i := 0 to lbKeyFields.Items.Count - 1 do + if lbKeyFields.Selected[i] then begin + KeyAndDataFields.KeyFieldDescs[j] := LocalDataSet.GetFieldDesc(lbKeyFields.Items[i]) as TCRFieldDesc; + Inc(j); + end; + + SetLength(KeyAndDataFields.DataFieldDescs, lbUpdateFields.SelCount); + j := 0; + for i := 0 to lbUpdateFields.Items.Count - 1 do + if lbUpdateFields.Selected[i] then begin + KeyAndDataFields.DataFieldDescs[j] := LocalDataSet.GetFieldDesc(lbUpdateFields.Items[i]) as TCRFieldDesc; + Inc(j); + end; + + LocalDataSet.Options.QuoteNames := cbQuoteFields.Checked; + + sts := Editor.DADesignUtilsClass.GetStatementTypes; + try + for st := Low(TStatementType) to High(TStatementType) do + if (st in sts) and cbChecked(st) then begin + stSQL[st] := GenerateSQLforUpdTable(TableInfo, KeyAndDataFields, st, False); + Modified := True; + end; + + // after setting SQL Fields[] may be destroyed + SetLength(KeyAndDataFields.KeyFieldDescs, 0); // Just in case + SetLength(KeyAndDataFields.DataFieldDescs, 0); + for st := Low(TStatementType) to High(TStatementType) do + if (st in sts) and cbChecked(st) then + Editor.DADesignUtilsClass.SetSQL(Editor.LocalComponent, stSQL[st], st); + + finally + UpdateSQLFrame := nil; + if FEditor is TDAUpdateSQLEditorForm then + UpdateSQLFrame := TDAUpdateSQLEditorForm(FEditor).UpdateSQLFrame + else + if FEditor is TDAQueryEditorForm then + UpdateSQLFrame := TDAQueryEditorForm(FEditor).UpdateSQLFrame + else + Assert(False); + + for st := Low(TStatementType) to High(TStatementType) do + if (st in sts) and cbChecked(st) then begin + UpdateSQLFrame.SetStatementType(st); + Break; + end; + + if FEditor is TDAUpdateSQLEditorForm then + TDAUpdateSQLEditorForm(FEditor).ActivateFrame(UpdateSQLFrame) + else + TDAQueryEditorForm(FEditor).ActivateFrame(UpdateSQLFrame); + end; + finally + TableInfo.Free; + end; + finally + LocalDataSet.Options.QuoteNames := OldQuoteNames; + if not OldActive then + LocalDataSet.SQL.Text := OldSQL; + end; +end; + +procedure TDASQLGeneratorFrame.lbUpdateFieldsClick(Sender: TObject); +begin + UpdateControlsState; +end; + +procedure TDASQLGeneratorFrame.cbTablesDropDown(Sender: TObject); +begin + if FParseTableNames then + InitTables + else + if ((TDBAccessUtils.UsedConnection(LocalDataSet) <> nil) and + ((cbTables.Items.Count = 0) {$IFDEF LINUX}or (cbTables.Items.Count = 1) and + (cbTables.Items[0] = ''){$ENDIF})) then begin + InitTables; + cbTablesChange(nil); + end; +end; + +end. diff --git a/internal/4.10.0.10/1/Source/Design/DASQLGeneratorFrame.xfm b/internal/4.10.0.10/1/Source/Design/DASQLGeneratorFrame.xfm new file mode 100644 index 0000000..b99b99d --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DASQLGeneratorFrame.xfm @@ -0,0 +1,140 @@ +inherited DASQLGeneratorFrame: TDASQLGeneratorFrame + Height = 245 + object pnSQLGenerator: TPanel + Left = 8 + Top = 6 + Width = 465 + Height = 229 + Anchors = [akLeft, akTop, akRight, akBottom] + TabOrder = 0 + OnResize = pnSQLGeneratorResize + object lbTableName: TLabel + Left = 13 + Top = 13 + Width = 61 + Height = 13 + Caption = 'Table Name:' + end + object lbKeyFieldsLabel: TLabel + Left = 182 + Top = 12 + Width = 51 + Height = 13 + Caption = 'Key Fields:' + end + object lbUpdateFieldsLabel: TLabel + Left = 321 + Top = 11 + Width = 68 + Height = 13 + Anchors = [akTop, akRight] + Caption = 'Update Fields:' + end + object cbTables: TComboBox + Left = 13 + Top = 29 + Width = 156 + Height = 21 + ItemHeight = 13 + TabOrder = 0 + Items.Strings = ( + '') + OnChange = cbTablesChange + OnDropDown = cbTablesDropDown + end + object btGenerate: TButton + Left = 13 + Top = 82 + Width = 155 + Height = 22 + Caption = 'Generate SQL' + TabOrder = 2 + OnClick = btGenerateClick + end + object lbKeyFields: TListBox + Left = 180 + Top = 28 + Width = 133 + Height = 188 + Anchors = [akLeft, akTop, akBottom] + ItemHeight = 13 + MultiSelect = True + TabOrder = 8 + OnClick = lbUpdateFieldsClick + end + object lbUpdateFields: TListBox + Left = 321 + Top = 28 + Width = 133 + Height = 188 + Anchors = [akTop, akRight, akBottom] + ItemHeight = 13 + MultiSelect = True + TabOrder = 9 + OnClick = lbUpdateFieldsClick + end + object btGetFields: TButton + Left = 13 + Top = 56 + Width = 155 + Height = 22 + Caption = 'Get Fields' + Enabled = False + TabOrder = 1 + OnClick = btGetFieldsClick + end + object cbInsert: TCheckBox + Left = 15 + Top = 109 + Width = 146 + Height = 17 + Caption = 'Insert' + Checked = True + State = cbChecked + TabOrder = 3 + OnClick = cbIUDRClick + end + object cbUpdate: TCheckBox + Left = 15 + Top = 125 + Width = 146 + Height = 17 + Caption = 'Update' + Checked = True + State = cbChecked + TabOrder = 4 + OnClick = cbIUDRClick + end + object cbDelete: TCheckBox + Left = 15 + Top = 141 + Width = 146 + Height = 17 + Caption = 'Delete' + Checked = True + State = cbChecked + TabOrder = 5 + OnClick = cbIUDRClick + end + object cbRefresh: TCheckBox + Left = 15 + Top = 157 + Width = 146 + Height = 17 + Caption = 'Refresh' + Checked = True + State = cbChecked + TabOrder = 6 + OnClick = cbIUDRClick + end + object cbQuoteFields: TCheckBox + Left = 15 + Top = 173 + Width = 146 + Height = 17 + Caption = 'Quote names' + Enabled = False + TabOrder = 7 + end + end +end diff --git a/internal/4.10.0.10/1/Source/Design/DAScriptEditor.dfm b/internal/4.10.0.10/1/Source/Design/DAScriptEditor.dfm new file mode 100644 index 0000000..9c10692 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DAScriptEditor.dfm @@ -0,0 +1,61 @@ +inherited DAScriptEditorForm: TDAScriptEditorForm + PixelsPerInch = 96 + TextHeight = 13 + inherited BtnPanel: TPanel + inherited btOk: TBitBtn + TabOrder = 4 + end + inherited btCancel: TBitBtn + TabOrder = 5 + end + object btExecute: TButton + Left = 8 + Top = 8 + Width = 80 + Height = 25 + Anchors = [akLeft, akBottom] + Caption = 'Execute' + TabOrder = 0 + OnClick = btExecuteClick + end + object cbDebug: TCheckBox + Left = 269 + Top = 12 + Width = 62 + Height = 17 + Caption = '&Debug' + TabOrder = 3 + OnClick = cbDebugClick + end + object btOpen: TButton + Left = 94 + Top = 8 + Width = 80 + Height = 25 + Hint = 'Load from file' + Caption = '&Load...' + TabOrder = 1 + OnClick = btOpenClick + end + object btSave: TButton + Left = 180 + Top = 8 + Width = 80 + Height = 25 + Hint = 'Save to file' + Caption = '&Save...' + TabOrder = 2 + OnClick = btSaveClick + end + end + inherited PageControl: TPageControl + ActivePage = shSQL + object shSQL: TTabSheet + Caption = 'S&QL' + end + object shMacros: TTabSheet + Caption = '&Macros' + ImageIndex = 2 + end + end +end diff --git a/internal/4.10.0.10/1/Source/Design/DAScriptEditor.pas b/internal/4.10.0.10/1/Source/Design/DAScriptEditor.pas new file mode 100644 index 0000000..d8b9d48 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DAScriptEditor.pas @@ -0,0 +1,246 @@ + +////////////////////////////////////////////////// +// Data Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +// Script Editor +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I Dac.inc} + +unit DAScriptEditor; +{$ENDIF} +interface +uses +{$IFDEF MSWINDOWS} + Windows, Messages, Graphics, Controls, Forms, Dialogs, + ComCtrls, StdCtrls, ExtCtrls, Buttons, +{$ENDIF} +{$IFDEF LINUX} + Types, QGraphics, QControls, QForms, QDialogs, QStdCtrls, + QExtCtrls, QComCtrls, QButtons, +{$ENDIF} + SysUtils, DB, Classes, + DBAccess, MemUtils, DAScript, + CREditor, CRTabEditor, CRFrame, DASQLFrame, DAMacrosFrame; + +type + TDAScriptEditorForm = class(TCRTabEditorForm) + shSQL: TTabSheet; + shMacros: TTabSheet; + btExecute: TButton; + cbDebug: TCheckBox; + btOpen: TButton; + btSave: TButton; + procedure btExecuteClick(Sender: TObject); + procedure cbDebugClick(Sender: TObject); + procedure btOpenClick(Sender: TObject); + procedure btSaveClick(Sender: TObject); + protected + FSQLFrame: TDASQLFrame; + FMacrosFrame: TDAMacrosFrame; + + FComponent: TComponent; + FLocalScript: TDAScript; + FOldAfterExecute: TAfterStatementExecuteEvent; + FOldDebug: boolean; + + procedure AfterExecute(Sender: TObject; SQL: string); + procedure OnError(Sender: TObject; E: Exception; SQL: string; var Action: TErrorAction); + + procedure DoInit; override; + procedure DoActivate; override; + procedure DoFinish; override; + procedure DoSave; override; + + function GetScript: TDAScript; + procedure SetScript(Value: TDAScript); + function GetComponent: TComponent; override; + procedure SetComponent(Value: TComponent); override; + function GetLocalComponent: TComponent; override; + + function GetFrameByInitProp: TCRFrame; override; + + public + property Script: TDAScript read GetScript write SetScript; + + property SQLFrame: TDASQLFrame read FSQLFrame; + property MacrosFrame: TDAMacrosFrame read FMacrosFrame; + + end; + +implementation + +uses + DADesignUtils; + +{$IFDEF IDE} +{$R *.dfm} +{$ENDIF} +{$IFDEF MSWINDOWS} +{$R DAScriptEditor.dfm} +{$ENDIF} +{$IFDEF LINUX} +{$R *.xfm} +{$ENDIF} + +const + SFileFilter = 'All SQL files|*.sql; *.qry|SQL files (*.sql)|*.sql|Query files (*.qry)|*.qry|All files (*.*)|*.*'; + +procedure TDAScriptEditorForm.DoInit; +begin + FSQLFrame := AddTab(TDASQLFrame, shSQL) as TDASQLFrame; + //FParamsFrame := AddTab(TMyParamsFrame, shParameters) as TDAParamsFrame; + FMacrosFrame := AddTab(TDAMacrosFrame, shMacros) as TDAMacrosFrame; + + inherited; + + FLocalScript := TComponentClass(FComponent.ClassType).Create(nil) as TDAScript; + FLocalScript.Assign(FComponent); + FDADesignUtilsClass.SetDesignCreate(FLocalScript, True); + FLocalScript.OnError := OnError; + + FOldDebug := FLocalScript.Debug; + cbDebug.Checked := FOldDebug; + + Assert(FSQLFrame <> nil); + Assert(FMacrosFrame <> nil); + + Modified := False; +end; + +procedure TDAScriptEditorForm.DoActivate; +var + Frame: TCRFrame; +begin + inherited; + + Frame := GetFrameByInitProp; + if Frame <> nil then begin + PageControl.ActivePage := Frame.Page; + Frame.SetFocus; + Frame.Activate; + end; + + if PageControl.ActivePage = FSQLFrame.Page then + ActiveControl := FSQLFrame.ActiveControl; +end; + +procedure TDAScriptEditorForm.DoFinish; +begin + FLocalScript.Free; + FLocalScript := nil; + inherited; +end; + +procedure TDAScriptEditorForm.AfterExecute(Sender: TObject; SQL: string); +begin + btExecute.Enabled := True; + //FParamsFrame.InitParams; + + FLocalScript.AfterExecute := FOldAfterExecute; +end; + +procedure TDAScriptEditorForm.OnError(Sender: TObject; E: Exception; SQL: string; var Action: TErrorAction); +begin + if MessageDlg(E.Message, mtError, [mbAbort, mbIgnore], 0) <> mrIgnore then + Action := eaAbort + else + Action := eaContinue; +end; + +procedure TDAScriptEditorForm.DoSave; +begin + inherited; + FLocalScript.Debug := FOldDebug; + FComponent.Assign(FLocalScript); +end; + +procedure TDAScriptEditorForm.btExecuteClick(Sender: TObject); +begin + SaveControlData; + CheckConnection(FLocalScript); + FOldAfterExecute := FLocalScript.AfterExecute; + FLocalScript.AfterExecute := AfterExecute; + FLocalScript.Execute; +end; + +function TDAScriptEditorForm.GetScript: TDAScript; +begin + Result := FComponent as TDAScript; +end; + +procedure TDAScriptEditorForm.SetScript(Value: TDAScript); +begin + FComponent := Value; +end; + +function TDAScriptEditorForm.GetComponent: TComponent; +begin + Result := Script; +end; + +procedure TDAScriptEditorForm.SetComponent(Value: TComponent); +begin + Script := Value as TDAScript; +end; + +function TDAScriptEditorForm.GetLocalComponent: TComponent; +begin + Result := FLocalScript; +end; + +function TDAScriptEditorForm.GetFrameByInitProp: TCRFrame; +begin + if InitialProperty = 'SQL' then + Result := FSQLFrame + else +{ if InitialProperty = 'Params' then + Result := FParamsFrame + else} + if InitialProperty = 'Macros' then + Result := FMacrosFrame + else + Result := inherited GetFrameByInitProp; +end; + +procedure TDAScriptEditorForm.cbDebugClick(Sender: TObject); +begin + FLocalScript.Debug := cbDebug.Checked; +end; + +procedure TDAScriptEditorForm.btOpenClick(Sender: TObject); +begin + with TOpenDialog.Create(nil) do + try + Filter := SFileFilter; + if Execute then begin + TDAScript(LocalComponent).SQL.LoadFromFile(FileName); + if ActiveFrame = SQLFrame then + SQLFrame.ReActivate + else + ActivateFrame(SQLFrame); + Modified := True; + end; + finally + Free; + end; +end; + +procedure TDAScriptEditorForm.btSaveClick(Sender: TObject); +begin + SaveControlData; + with TSaveDialog.Create(nil) do + try + Options := Options + [ofOverwritePrompt]; + DefaultExt := 'sql'; + Filter := SFileFilter; + if Execute then + TDAScript(LocalComponent).SQL.SaveToFile(FileName); + finally + Free; + end; +end; + +end. diff --git a/internal/4.10.0.10/1/Source/Design/DAScriptEditor.xfm b/internal/4.10.0.10/1/Source/Design/DAScriptEditor.xfm new file mode 100644 index 0000000..a161f6e --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DAScriptEditor.xfm @@ -0,0 +1,61 @@ +inherited DAScriptEditorForm: TDAScriptEditorForm + PixelsPerInch = 96 + TextHeight = 13 + inherited BtnPanel: TPanel + inherited btOk: TBitBtn + TabOrder = 4 + end + inherited btCancel: TBitBtn + TabOrder = 5 + end + object btExecute: TButton + Left = 8 + Top = 8 + Width = 80 + Height = 25 + Anchors = [akLeft, akBottom] + Caption = 'Execute' + TabOrder = 0 + OnClick = btExecuteClick + end + object cbDebug: TCheckBox + Left = 269 + Top = 12 + Width = 62 + Height = 17 + Caption = '&Debug' + TabOrder = 3 + OnClick = cbDebugClick + end + object btOpen: TButton + Left = 94 + Top = 8 + Width = 80 + Height = 25 + Hint = 'Load from file' + Caption = '&Load...' + TabOrder = 1 + OnClick = btOpenClick + end + object btSave: TButton + Left = 180 + Top = 8 + Width = 80 + Height = 25 + Hint = 'Save to file' + Caption = '&Save...' + TabOrder = 2 + OnClick = btSaveClick + end + end + inherited PageControl: TPageControl + ActivePage = shSQL + object shSQL: TTabSheet + Caption = 'S&QL' + end + object shMacros: TTabSheet + Caption = '&Macros' + ImageIndex = 2 + end + end +end \ No newline at end of file diff --git a/internal/4.10.0.10/1/Source/Design/DAStoredProcEditor.dfm b/internal/4.10.0.10/1/Source/Design/DAStoredProcEditor.dfm new file mode 100644 index 0000000..e938760 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DAStoredProcEditor.dfm @@ -0,0 +1,2 @@ +inherited DAStoredProcEditorForm: TDAStoredProcEditorForm +end diff --git a/internal/4.10.0.10/1/Source/Design/DAStoredProcEditor.pas b/internal/4.10.0.10/1/Source/Design/DAStoredProcEditor.pas new file mode 100644 index 0000000..f27d35a --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DAStoredProcEditor.pas @@ -0,0 +1,79 @@ + +////////////////////////////////////////////////// +// Data Access Components +// Copyright © 1998-2005 Core Lab. All right reserved. +// StoredProc Editor +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I Dac.inc} + +unit DAStoredProcEditor; +{$ENDIF} +interface +uses +{$IFDEF MSWINDOWS} + Windows, Messages, Graphics, Controls, Forms, Dialogs, + ComCtrls, StdCtrls, ExtCtrls, Buttons, +{$ENDIF} +{$IFDEF LINUX} + Types, QGraphics, QControls, QForms, QDialogs, QStdCtrls, + QExtCtrls, QComCtrls, QButtons, +{$ENDIF} + SysUtils, DB, Classes, + DBAccess, MemUtils, + CREditor, CRTabEditor, DASQLFrame, DAParamsFrame, DAMacrosFrame, DASPCallFrame, + DASQLEditor, DAUpdateSQLFrame, DASQLGeneratorFrame, DAQueryEditor; + +type + TDAStoredProcEditorForm = class(TDAQueryEditorForm) + protected + procedure DoInit; override; + + function GetStoredProc: TCustomDADataSet; + procedure SetStoredProc(Value: TCustomDADataSet); + + property StoredProc: TCustomDADataSet read GetStoredProc write SetStoredProc; + + end; + +implementation + +uses + DADesignUtils; + +{$IFDEF IDE} +{$R *.dfm} +{$ENDIF} +{$IFDEF MSWINDOWS} +{$R DAStoredProcEditor.dfm} +{$ENDIF} +{$IFDEF LINUX} +{$R *.xfm} +{$ENDIF} + +procedure TDAStoredProcEditorForm.DoInit; +begin + try + inherited; + finally + Assert(FSQLFrame is TDASPCallFrame); + TDASPCallFrame(FSQLFrame).Mode := spSQLSP; + FSPCallFrame.Mode := spQuerySP; + + TDASPCallFrame(FSQLFrame).SetSPName(FDADesignUtilsClass.GetStoredProcName(LocalComponent as TCustomDADataSet)); + end; +end; + +function TDAStoredProcEditorForm.GetStoredProc: TCustomDADataSet; +begin + Result := FComponent as TCustomDADataSet; +end; + +procedure TDAStoredProcEditorForm.SetStoredProc(Value: TCustomDADataSet); +begin + FComponent := Value; +end; + +end. diff --git a/internal/4.10.0.10/1/Source/Design/DAStoredProcEditor.xfm b/internal/4.10.0.10/1/Source/Design/DAStoredProcEditor.xfm new file mode 100644 index 0000000..56dbee4 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DAStoredProcEditor.xfm @@ -0,0 +1,2 @@ +inherited DAStoredProcEditorForm: TDAStoredProcEditorForm +end diff --git a/internal/4.10.0.10/1/Source/Design/DATableEditor.dfm b/internal/4.10.0.10/1/Source/Design/DATableEditor.dfm new file mode 100644 index 0000000..d64c184 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DATableEditor.dfm @@ -0,0 +1,114 @@ +inherited DATableEditorForm: TDATableEditorForm + Left = 294 + Top = 203 + Height = 340 + HorzScrollBar.Visible = False + VertScrollBar.Visible = False + ActiveControl = cbTableName + BorderIcons = [biSystemMenu] + Constraints.MinHeight = 332 + Constraints.MinWidth = 512 + Font.Height = -11 + PixelsPerInch = 96 + TextHeight = 13 + inherited BtnPanel: TPanel + Top = 272 + TabOrder = 1 + inherited btOk: TBitBtn + TabOrder = 1 + end + inherited btCancel: TBitBtn + TabOrder = 2 + end + object btnDataEditor: TBitBtn + Left = 8 + Top = 8 + Width = 80 + Height = 25 + Anchors = [akLeft, akBottom] + Caption = '&Data Editor...' + TabOrder = 0 + OnClick = btnDataEditorClick + end + end + object Panel1: TPanel + Left = 8 + Top = 8 + Width = 489 + Height = 257 + Anchors = [akLeft, akTop, akRight, akBottom] + TabOrder = 0 + object Label2: TLabel + Left = 8 + Top = 20 + Width = 58 + Height = 13 + Caption = 'Table Name' + end + object Label4: TLabel + Left = 8 + Top = 44 + Width = 56 + Height = 13 + Caption = 'Order Fields' + end + object Label1: TLabel + Left = 8 + Top = 67 + Width = 43 + Height = 13 + Caption = 'FilterSQL' + end + object edFilter: TEdit + Left = 96 + Top = 64 + Width = 388 + Height = 21 + Anchors = [akLeft, akTop, akRight] + TabOrder = 2 + OnExit = edFilterExit + end + object meSQL: TMemo + Left = 5 + Top = 88 + Width = 479 + Height = 164 + Anchors = [akLeft, akTop, akRight, akBottom] + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'Courier New' + Font.Pitch = fpVariable + Font.Style = [] + Lines.Strings = ( + '') + ParentFont = False + ReadOnly = True + ScrollBars = ssBoth + TabOrder = 3 + WordWrap = False + end + object cbTableName: TComboBox + Left = 96 + Top = 16 + Width = 388 + Height = 21 + Anchors = [akLeft, akTop, akRight] + DropDownCount = 16 + ItemHeight = 13 + TabOrder = 0 + OnDropDown = cbTableNameDropDown + OnExit = cbTableNameExit + end + object edOrderFields: TEdit + Left = 96 + Top = 40 + Width = 388 + Height = 21 + Anchors = [akLeft, akTop, akRight] + TabOrder = 1 + OnExit = edOrderFieldsExit + end + end +end diff --git a/internal/4.10.0.10/1/Source/Design/DATableEditor.pas b/internal/4.10.0.10/1/Source/Design/DATableEditor.pas new file mode 100644 index 0000000..6fa03e7 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DATableEditor.pas @@ -0,0 +1,231 @@ + +////////////////////////////////////////////////// +// Data Access Components +// Copyright © 1998-2005 Core Lab. All right reserved. +// Table Editor +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I Dac.inc} + +unit DATableEditor; +{$ENDIF} +interface +uses +{$IFDEF MSWINDOWS} + Windows, Messages, Graphics, Controls, Forms, Dialogs, + ComCtrls, StdCtrls, ExtCtrls, Buttons, +{$ENDIF} +{$IFDEF LINUX} + Types, QGraphics, QControls, QForms, QDialogs, QStdCtrls, + QExtCtrls, QComCtrls, QButtons, +{$ENDIF} + SysUtils, DB, Classes, + DBAccess, MemUtils, CREditor; + +type + TDATableEditorForm = class(TCREditorForm) + Label2: TLabel; + Label4: TLabel; + Label1: TLabel; + edFilter: TEdit; + meSQL: TMemo; + cbTableName: TComboBox; + edOrderFields: TEdit; + Panel1: TPanel; + btnDataEditor: TBitBtn; + procedure cbTableNameDropDown(Sender: TObject); + procedure cbTableNameExit(Sender: TObject); + procedure edOrderFieldsExit(Sender: TObject); + procedure edFilterExit(Sender: TObject); + procedure btnDataEditorClick(Sender: TObject); + + protected + FListGot: boolean; + FLocalTable, FTable: TCustomDADataSet; + + procedure DoInit; override; + procedure DoFinish; override; + procedure DoSave; override; + + procedure InitSQL; + function GetComponent: TComponent; override; + procedure SetComponent(Value: TComponent); override; + function GetLocalComponent: TComponent; override; + + procedure GetTableNames(Connection: TCustomDAConnection; Items: TStrings); virtual; + public + property Table: TCustomDADataSet read FTable write FTable; + + end; + +implementation + +uses + DADesignUtils, DADataEditor; + +{$IFDEF IDE} +{$R *.dfm} +{$ENDIF} +{$IFDEF MSWINDOWS} +{$R DATableEditor.dfm} +{$ENDIF} +{$IFDEF LINUX} +{$R *.xfm} +{$ENDIF} + +procedure TDATableEditorForm.DoInit; +begin + inherited; + + FLocalTable := TComponentClass(Table.ClassType).Create(nil) as TCustomDADataSet; + FLocalTable.Assign(Table); + TDBAccessUtils.SetDesignCreate(FLocalTable, True); + + InitSQL; + + FListGot := False; + +{$IFDEF LINUX} + cbTableName.Items.Text := ' '; // bug in TComboBox + meSQL.Height := meSQL.Parent.ClientHeight - meSQL.Top - cbTableName.Top; +{$ENDIF} + + cbTableName.Text := FDADesignUtilsClass.GetTableName(FLocalTable); + edFilter.Text := FLocalTable.FilterSQL; + edOrderFields.Text := FDADesignUtilsClass.GetOrderFields(FLocalTable); +end; + +procedure TDATableEditorForm.DoFinish; +begin + FLocalTable.Free; + FLocalTable := nil; + inherited; +end; + +procedure TDATableEditorForm.DoSave; +var + OldActive: boolean; + OldDebug: boolean; +begin + OldActive := Table.Active; + OldDebug := Table.Debug; + + try + Table.Assign(FLocalTable); + inherited; + Table.Debug := False; + try + Table.Active := OldActive; + except + end; + finally + Table.Debug := OldDebug; + end; +end; + +procedure TDATableEditorForm.InitSQL; +begin + meSQL.Lines.Text := ''; + try + if FDADesignUtilsClass.GetTableName(FLocalTable) <> '' then begin + FDADesignUtilsClass.PrepareSQL(FLocalTable); + meSQL.Lines.Text := FLocalTable.FinalSQL; + end; + except + on E: Exception do + if not (E is EOutOfResources) then + raise; // TMemo bug (see TMemoStrings.Insert) + end; +end; + +procedure TDATableEditorForm.GetTableNames(Connection: TCustomDAConnection; + Items: TStrings); +begin + Connection.GetTableNames(Items); +end; + +procedure TDATableEditorForm.cbTableNameDropDown(Sender: TObject); +var + UsedConnection: TCustomDAConnection; +begin + UsedConnection := TDBAccessUtils.UsedConnection(Table); + if TDBAccessUtils.UsedConnection(Table) = nil then + Exit; + + try + if not FListGot then begin + GetTableNames(UsedConnection, cbTableName.Items); + FListGot := True; + end; + except + Application.HandleException(Self); + end; +end; + +procedure TDATableEditorForm.cbTableNameExit(Sender: TObject); +var + s: string; +begin + try + s := TDBAccessUtils.UnQuoteName(FLocalTable, Trim(cbTableName.Text)); + if s <> FDADesignUtilsClass.GetTableName(FLocalTable) then begin + FDADesignUtilsClass.SetTableName(FLocalTable, cbTableName.Text); + InitSQL; + Modified:= True; + end; + except + cbTableName.SetFocus; + raise; + end; +end; + +procedure TDATableEditorForm.edOrderFieldsExit(Sender: TObject); +begin + if edOrderFields.Text <> FDADesignUtilsClass.GetOrderFields(FLocalTable) then begin + FDADesignUtilsClass.SetOrderFields(FLocalTable, edOrderFields.Text); + InitSQL; + Modified:= True; + end; +end; + +procedure TDATableEditorForm.edFilterExit(Sender: TObject); +begin + if edFilter.Text <> FLocalTable.FilterSQL then begin + FLocalTable.FilterSQL:= edFilter.Text; + InitSQL; + Modified:= True; + end; +end; + +function TDATableEditorForm.GetComponent: TComponent; +begin + Result := Table; +end; + +procedure TDATableEditorForm.SetComponent(Value: TComponent); +begin + Table := Value as TCustomDADataSet; +end; + +function TDATableEditorForm.GetLocalComponent: TComponent; +begin + Result := FLocalTable; +end; + +procedure TDATableEditorForm.btnDataEditorClick(Sender: TObject); +begin + inherited; + SaveControlData; + DoSave; + with TDADataEditorForm.Create(nil, FDADesignUtilsClass) do + try + Component := Self.FLocalTable; + ShowModal; + finally + Free; + end; +end; + +end. diff --git a/internal/4.10.0.10/1/Source/Design/DATableEditor.xfm b/internal/4.10.0.10/1/Source/Design/DATableEditor.xfm new file mode 100644 index 0000000..38652d0 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DATableEditor.xfm @@ -0,0 +1,117 @@ +inherited DATableEditorForm: TDATableEditorForm + Left = 294 + Top = 203 + Height = 340 + HorzScrollBar.Visible = False + VertScrollBar.Visible = False + ActiveControl = cbTableName + BorderIcons = [biSystemMenu] + Constraints.MinHeight = 332 + Constraints.MinWidth = 512 + Font.Height = -11 + PixelsPerInch = 96 + TextHeight = 13 + inherited BtnPanel: TPanel + Top = 265 + TabOrder = 1 + inherited btOk: TBitBtn + TabOrder = 1 + end + inherited btCancel: TBitBtn + TabOrder = 2 + end + object btnDataEditor: TBitBtn + Left = 8 + Top = 8 + Width = 80 + Height = 25 + Anchors = [akLeft, akBottom] + Caption = '&Data Editor...' + TabOrder = 0 + OnClick = btnDataEditorClick + end + end + object Panel1: TPanel + Left = 8 + Top = 8 + Width = 497 + Height = 285 + Anchors = [akLeft, akTop, akRight, akBottom] + BevelWidth = 2 + TabOrder = 0 + object Label2: TLabel + Left = 8 + Top = 20 + Width = 58 + Height = 13 + Caption = 'Table Name' + end + object Label4: TLabel + Left = 8 + Top = 44 + Width = 56 + Height = 13 + Caption = 'Order Fields' + end + object Label1: TLabel + Left = 8 + Top = 67 + Width = 43 + Height = 13 + Caption = 'FilterSQL' + end + object edFilter: TEdit + Left = 96 + Top = 64 + Width = 388 + Height = 20 + Anchors = [akLeft, akTop, akRight] + TabOrder = 2 + OnExit = edFilterExit + end + object meSQL: TMemo + Left = 5 + Top = 88 + Width = 479 + Height = 164 + Anchors = [akLeft, akTop, akRight, akBottom] + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'Courier New' + Font.Pitch = fpVariable + Font.Style = [] + Lines.Strings = ( + '') + ParentFont = False + ReadOnly = True + ScrollBars = ssBoth + TabOrder = 3 + WordWrap = False + end + object cbTableName: TComboBox + Left = 96 + Top = 16 + Width = 388 + Height = 26 + Anchors = [akLeft, akTop, akRight] + DropDownCount = 16 + ItemHeight = 13 + TabOrder = 0 + Items.Strings = ( + '') + OnDropDown = cbTableNameDropDown + OnExit = cbTableNameExit + end + object edOrderFields: TEdit + Left = 96 + Top = 40 + Width = 388 + Height = 20 + Anchors = [akLeft, akTop, akRight] + TabOrder = 1 + OnExit = edOrderFieldsExit + end + end +end diff --git a/internal/4.10.0.10/1/Source/Design/DAUpdateSQLEditor.dfm b/internal/4.10.0.10/1/Source/Design/DAUpdateSQLEditor.dfm new file mode 100644 index 0000000..a0b25db --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DAUpdateSQLEditor.dfm @@ -0,0 +1,15 @@ +inherited DAUpdateSQLEditorForm: TDAUpdateSQLEditorForm + Caption = 'DAUpdateSQLEditorForm' + PixelsPerInch = 96 + TextHeight = 13 + inherited PageControl: TPageControl + ActivePage = shEditSQL + object shEditSQL: TTabSheet + Caption = '&Update SQLs' + end + object shGenerator: TTabSheet + Caption = 'SQL &Generator' + ImageIndex = 1 + end + end +end diff --git a/internal/4.10.0.10/1/Source/Design/DAUpdateSQLEditor.pas b/internal/4.10.0.10/1/Source/Design/DAUpdateSQLEditor.pas new file mode 100644 index 0000000..fe145bf --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DAUpdateSQLEditor.pas @@ -0,0 +1,164 @@ + +////////////////////////////////////////////////// +// Data Access Components +// Copyright © 1998-2005 Core Lab. All right reserved. +// UpdateSQL Editor +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I Dac.inc} + +unit DAUpdateSQLEditor; +{$ENDIF} +interface +uses +{$IFDEF MSWINDOWS} + Windows, Messages, Graphics, Controls, Forms, Dialogs, + ComCtrls, StdCtrls, ExtCtrls, Buttons, +{$ENDIF} +{$IFDEF LINUX} + Types, QGraphics, QControls, QForms, QDialogs, QStdCtrls, + QExtCtrls, QComCtrls, QButtons, +{$ENDIF} + SysUtils, Classes, DBAccess, CREditor, CRFrame, CRTabEditor, DAUpdateSQLFrame, + DASQLGeneratorFrame; + +type + TDAUpdateSQLEditorForm = class(TCRTabEditorForm) + shEditSQL: TTabSheet; + shGenerator: TTabSheet; + protected + FUpdateSQLFrame: TDAUpdateSQLFrame; + FSQLGeneratorFrame: TDASQLGeneratorFrame; + FLocalComponent, FComponent: TComponent; + FLocalDataSet: TCustomDADataSet; + + procedure DoInit; override; + procedure DoActivate; override; + procedure DoFinish; override; + procedure DoSave; override; + + function GetComponent: TComponent; override; + procedure SetComponent(Value: TComponent); override; + function GetLocalComponent: TComponent; override; + + function GetFrameByInitProp: TCRFrame; override; + + function GetUpdateSQL: TCustomDAUpdateSQL; + procedure SetUpdateSQL(const Value: TCustomDAUpdateSQL); + public + property UpdateSQL: TCustomDAUpdateSQL read GetUpdateSQL write SetUpdateSQL; + property UpdateSQLFrame: TDAUpdateSQLFrame read FUpdateSQLFrame; + property LocalDataSet: TCustomDADataSet read FLocalDataSet; + end; + +implementation + +{$IFDEF IDE} +{$R *.dfm} +{$ENDIF} +{$IFDEF MSWINDOWS} +{$R DAUpdateSQLEditor.dfm} +{$ENDIF} +{$IFDEF LINUX} +{$R *.xfm} +{$ENDIF} + +{ TDAUpdateSQLEditorForm } + +function TDAUpdateSQLEditorForm.GetComponent: TComponent; +begin + Result := UpdateSQL; +end; + +procedure TDAUpdateSQLEditorForm.SetComponent(Value: TComponent); +begin + UpdateSQL := Value as TCustomDAUpdateSQL; +end; + +function TDAUpdateSQLEditorForm.GetLocalComponent: TComponent; +begin + Result := FLocalComponent; +end; + +function TDAUpdateSQLEditorForm.GetFrameByInitProp: TCRFrame; +begin + if InitialProperty = 'DeleteSQL' then begin + FUpdateSQLFrame.SetStatementType(stDelete); + Result := FUpdateSQLFrame; + end + else + if InitialProperty = 'InsertSQL' then begin + FUpdateSQLFrame.SetStatementType(stInsert); + Result := FUpdateSQLFrame; + end + else + if InitialProperty = 'RefreshSQL' then begin + FUpdateSQLFrame.SetStatementType(stRefresh); + Result := FUpdateSQLFrame; + end + else + if InitialProperty = 'ModifySQL' then begin + FUpdateSQLFrame.SetStatementType(stUpdate); + Result := FUpdateSQLFrame; + end + else + Result := inherited GetFrameByInitProp; +end; + +function TDAUpdateSQLEditorForm.GetUpdateSQL: TCustomDAUpdateSQL; +begin + Result := FComponent as TCustomDAUpdateSQL; +end; + +procedure TDAUpdateSQLEditorForm.SetUpdateSQL(const Value: TCustomDAUpdateSQL); +begin + FComponent := Value; +end; + +procedure TDAUpdateSQLEditorForm.DoInit; +begin + inherited; + + FLocalComponent := TComponentClass(UpdateSQL.ClassType).Create(nil); + FLocalComponent.Assign(UpdateSQL); + FDADesignUtilsClass.SetDesignCreate(FLocalComponent, True); + + if UpdateSQL.DataSet <> nil then begin + shGenerator.TabVisible := True; + FLocalDataSet := TCustomDADataSet(TComponentClass(UpdateSQL.DataSet.ClassType).Create(nil)); + FLocalDataSet.Assign(UpdateSQL.DataSet); + FDADesignUtilsClass.SetDesignCreate(FLocalDataSet, True); + TDBAccessUtils.SetDesigning(FLocalDataSet, csDesigning in UpdateSQL.DataSet.ComponentState); + end + else + shGenerator.TabVisible := False; + + Assert(FUpdateSQLFrame <> nil); + Assert(FSQLGeneratorFrame <> nil); + + Modified := False; +end; + +procedure TDAUpdateSQLEditorForm.DoActivate; +begin + inherited; + + GetFrameByInitProp; +end; + +procedure TDAUpdateSQLEditorForm.DoFinish; +begin + FreeAndNil(FLocalDataSet); + FreeAndNil(FLocalComponent); + inherited; +end; + +procedure TDAUpdateSQLEditorForm.DoSave; +begin + inherited; + FComponent.Assign(FLocalComponent); +end; + +end. diff --git a/internal/4.10.0.10/1/Source/Design/DAUpdateSQLEditor.xfm b/internal/4.10.0.10/1/Source/Design/DAUpdateSQLEditor.xfm new file mode 100644 index 0000000..bc1682b --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DAUpdateSQLEditor.xfm @@ -0,0 +1,15 @@ +inherited DAUpdateSQLEditorForm: TDAUpdateSQLEditorForm + Caption = 'DAUpdateSQLEditorForm' + PixelsPerInch = 96 + TextHeight = 13 + inherited PageControl: TPageControl + ActivePage = shEditSQL + object shEditSQL: TTabSheet + Caption = '&Update SQLs' + end + object shGenerator: TTabSheet + Caption = 'SQL &Generator' + ImageIndex = 1 + end + end +end diff --git a/internal/4.10.0.10/1/Source/Design/DAUpdateSQLFrame.dfm b/internal/4.10.0.10/1/Source/Design/DAUpdateSQLFrame.dfm new file mode 100644 index 0000000..5a5ed7f --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DAUpdateSQLFrame.dfm @@ -0,0 +1,57 @@ +inherited DAUpdateSQLFrame: TDAUpdateSQLFrame + Width = 450 + Height = 230 + inherited Panel1: TPanel + Top = 42 + Width = 450 + Height = 188 + TabOrder = 1 + inherited meSQL: TMemo + Width = 434 + Height = 172 + OnChange = meSQLChange + end + end + object pnlTop: TPanel + Left = 0 + Top = 0 + Width = 450 + Height = 42 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object btClear: TSpeedButton + Left = 420 + Top = 9 + Width = 21 + Height = 31 + Hint = 'Clear' + Anchors = [akTop, akRight] + Flat = True + Glyph.Data = { + 4E010000424D4E01000000000000760000002800000012000000120000000100 + 040000000000D800000000000000000000001000000010000000000000000000 + 8000008000000080800080000000800080008080000080808000C0C0C0000000 + FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00888888888888 + 888888FFFFFF888888888888888888FFFFFF888888888888881F88FFFFFF8888 + 1F888888888888FFFFFF888111F8888881F888FFFFFF888111F888881F8888FF + FFFF8888111F88811F8888FFFFFF88888111F811F88888FFFFFF88888811111F + 888888FFFFFF8888888111F8888888FFFFFF88888811111F888888FFFFFF8888 + 8111F811888888FFFFFF8881111F88811F8888FFFFFF881111F8888811F888FF + FFFF8811F8888888811F88FFFFFF888888888888888888FFFFFF888888888888 + 888888FFFFFF888888888888888888FFFFFF} + ParentShowHint = False + ShowHint = True + OnClick = btClearClick + end + object gbStatementType: TGroupBox + Left = 7 + Top = 3 + Width = 410 + Height = 37 + Anchors = [akLeft, akTop, akRight] + Caption = ' Statement Type ' + TabOrder = 0 + end + end +end diff --git a/internal/4.10.0.10/1/Source/Design/DAUpdateSQLFrame.pas b/internal/4.10.0.10/1/Source/Design/DAUpdateSQLFrame.pas new file mode 100644 index 0000000..4aadf58 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DAUpdateSQLFrame.pas @@ -0,0 +1,261 @@ + +////////////////////////////////////////////////// +// DB Access Components +// Copyright © 1998-2005 Core Lab. All right reserved. +// UpdateSQL Frame +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I Dac.inc} + +unit DAUpdateSQLFrame; +{$ENDIF} + +interface + +uses +{$IFDEF MSWINDOWS} + Windows, Messages, Graphics, Controls, Forms, + Dialogs, StdCtrls, ExtCtrls, Buttons, +{$ENDIF} +{$IFDEF LINUX} + QGraphics, QStdCtrls, QExtCtrls, QButtons, QControls, +{$ENDIF} +{$IFDEF DBTOOLS} + DBToolsClient, +{$ENDIF} + Classes, SysUtils, DBAccess, CRFrame, CRTabEditor, + DASQLFrame; + +type + TDAUpdateSQLFrame = class(TDASQLFrame) + pnlTop: TPanel; + btClear: TSpeedButton; + gbStatementType: TGroupBox; + procedure rbClick(Sender: TObject); + procedure btClearClick(Sender: TObject); + procedure meSQLChange(Sender: TObject); + protected + FStatementType: TStatementType; + FStatementTypeSetted: boolean; + Frb: array[TStatementType] of TRadioButton; + + {$IFDEF DBTOOLS} + procedure LoadMemo; override; + {$ENDIF} + function GetStatementTypes: TStatementTypes; virtual; + + function GetLocalComponentSQL: TStrings; override; + procedure SetLocalComponentSQL(Value: TStrings); override; + + procedure CreateStatementIndicators; + procedure RefreshEmptyIndicators; + procedure SetEmpty(st: TStatementType; Empty: boolean); + procedure DoActivate; override; + + public + procedure SetStatementType(StatementType: TStatementType); + end; + +implementation + +{$IFDEF IDE} +{$R *.dfm} +{$ENDIF} +{$IFDEF MSWINDOWS} +{$R DAUpdateSQLFrame.dfm} +{$ENDIF} +{$IFDEF LINUX} +{$R *.xfm} +{$ENDIF} + +uses + DB, DAQueryEditor, DASQLEditor, DAUpdateSQLEditor, CREditor; + +procedure TDAUpdateSQLFrame.SetStatementType(StatementType: TStatementType); +begin + FStatementTypeSetted := True; + FStatementType := StatementType; + CreateStatementIndicators; + Assert(Frb[FStatementType] <> nil); + Frb[FStatementType].Checked := True; + LoadMemo; +end; + +procedure TDAUpdateSQLFrame.DoActivate; +var + st: TStatementType; + sts: TStatementTypes; +begin + if not FStatementTypeSetted then begin + CreateStatementIndicators; + sts := GetStatementTypes; + for st := Low(TStatementType) to High(TStatementType) do + if (st in sts) and (TrimRight(Editor.DADesignUtilsClass.GetSQL(Editor.LocalComponent, st).Text) <> '') then begin + SetStatementType(st); + Break; + end; + + if not FStatementTypeSetted then begin + for st := Low(TStatementType) to High(TStatementType) do + if (Frb[st] <> nil) and Frb[st].Visible and Frb[st].Enabled then begin + SetStatementType(st); + Break; + end; + end; + end; + + inherited; + + RefreshEmptyIndicators; +end; + +procedure TDAUpdateSQLFrame.SetEmpty(st: TStatementType; + Empty: boolean); +begin + Assert(Frb[st] <> nil); + if Empty then + Frb[st].Font.Style := [] + else + Frb[st].Font.Style := [fsBold]; +end; + +procedure TDAUpdateSQLFrame.CreateStatementIndicators; +var + st: TStatementType; + sts: TStatementTypes; + rbCount, dW, i: integer; + rb: TRadioButton; +begin + for st := Low(TStatementType) to High(TStatementType) do + if Frb[st] <> nil then + Exit; + + Assert(Owner is TCREditorForm); + rbCount := 0; + sts := GetStatementTypes; + for st := Low(TStatementType) to High(TStatementType) do begin + Frb[st].Free; + Frb[st] := nil; + if st in sts then begin + Inc(rbCount); + rb := TRadioButton.Create(Self); + with rb do + begin + Parent := gbStatementType; + Top := 15; + Width := 75; + Height := 17; + case st of + stQuery: + Caption := 'Query'; + stInsert: + Caption := 'Insert'; + stUpdate: + Caption := 'Update'; + stDelete: + Caption := 'Delete'; + stLock: + Caption := 'Lock'; + stRefresh: + Caption := 'Refresh'; + else + Assert(False); + end; + //TabStop := True; ??? + OnClick := rbClick; + end; + Frb[st] := rb; + end; + end; + + i := 0; + dW := (gbStatementType.Width - 8 {rbInsert.Left} * 2) div rbCount; + for st := Low(TStatementType) to High(TStatementType) do + if st in sts then begin + Assert(Frb[st] <> nil); + Frb[st].Left := 8 {rbInsert.Left} + dW * i; + Inc(i); + end; +end; + +procedure TDAUpdateSQLFrame.RefreshEmptyIndicators; +var + st: TStatementType; + sts: TStatementTypes; +begin + sts := GetStatementTypes; + for st := Low(TStatementType) to High(TStatementType) do + if st in sts then + SetEmpty(st, TrimRight(Editor.DADesignUtilsClass.GetSQL(Editor.LocalComponent, st).Text) = ''); +end; + +procedure TDAUpdateSQLFrame.rbClick(Sender: TObject); +var + st: TStatementType; +begin +{$IFDEF DBTOOLS} + DBTools.CheckDBToolsChanges(Self); +{$ENDIF} + for st := Low(TStatementType) to High(TStatementType) do + if (Frb[st] <> nil) and Frb[st].Checked then begin + if FStatementType <> st then begin + SaveMemo; + FStatementType := st; + LoadMemo; + end; + Exit; + end; + Assert(False); +end; + +procedure TDAUpdateSQLFrame.btClearClick(Sender: TObject); +begin + SQLText := ' '; + SaveMemo; + meSQLChange(nil); +end; + +procedure TDAUpdateSQLFrame.meSQLChange(Sender: TObject); +begin + if FStatementTypeSetted then + SetEmpty(FStatementType, TrimRight(SQLText) = ''); +end; + +{$IFDEF DBTOOLS} +procedure TDAUpdateSQLFrame.LoadMemo; +begin + if DBTools.HasDACSqlEditorFrame(meSQL) then + DBTools.GetDACSqlEditorFrame(meSQL).StatementType := FStatementType; + + inherited; +end; +{$ENDIF} + +function TDAUpdateSQLFrame.GetStatementTypes: TStatementTypes; +begin + Result := Editor.DADesignUtilsClass.GetStatementTypes - [stQuery]; + if Editor.LocalComponent is TCustomDAUpdateSQL then + Result := Result - [stLock]; +end; + +function TDAUpdateSQLFrame.GetLocalComponentSQL: TStrings; +begin + Assert(Editor <> nil); + if FStatementType = stQuery then + Result := inherited GetLocalComponentSQL + else + Result := Editor.DADesignUtilsClass.GetSQL(Editor.LocalComponent, FStatementType); +end; + +procedure TDAUpdateSQLFrame.SetLocalComponentSQL(Value: TStrings); +begin + Assert(Editor <> nil); + if FStatementType = stQuery then + inherited SetLocalComponentSQL(Value) + else + Editor.DADesignUtilsClass.SetSQL(Editor.LocalComponent, Value, FStatementType); +end; + +end. diff --git a/internal/4.10.0.10/1/Source/Design/DAUpdateSQLFrame.xfm b/internal/4.10.0.10/1/Source/Design/DAUpdateSQLFrame.xfm new file mode 100644 index 0000000..8ed490e --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DAUpdateSQLFrame.xfm @@ -0,0 +1,57 @@ +inherited DAUpdateSQLFrame: TDAUpdateSQLFrame + Width = 450 + Height = 230 + inherited Panel1: TPanel + Top = 42 + Width = 450 + Height = 188 + TabOrder = 1 + inherited meSQL: TMemo + Width = 434 + Height = 172 + OnChange = meSQLChange + end + end + object pnlTop: TPanel + Left = 0 + Top = 0 + Width = 450 + Height = 42 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object btClear: TSpeedButton + Left = 420 + Top = 9 + Width = 21 + Height = 31 + Hint = 'Clear' + Anchors = [akTop, akRight] + Flat = True + Glyph.Data = { + 4E010000424D4E01000000000000760000002800000012000000120000000100 + 040000000000D800000000000000000000001000000010000000000000000000 + 8000008000000080800080000000800080008080000080808000C0C0C0000000 + FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00888888888888 + 888888FFFFFF888888888888888888FFFFFF888888888888881F88FFFFFF8888 + 1F888888888888FFFFFF888111F8888881F888FFFFFF888111F888881F8888FF + FFFF8888111F88811F8888FFFFFF88888111F811F88888FFFFFF88888811111F + 888888FFFFFF8888888111F8888888FFFFFF88888811111F888888FFFFFF8888 + 8111F811888888FFFFFF8881111F88811F8888FFFFFF881111F8888811F888FF + FFFF8811F8888888811F88FFFFFF888888888888888888FFFFFF888888888888 + 888888FFFFFF888888888888888888FFFFFF} + ParentShowHint = False + ShowHint = True + OnClick = btClearClick + end + object gbStatementType: TGroupBox + Left = 7 + Top = 3 + Width = 410 + Height = 37 + Anchors = [akLeft, akTop, akRight] + Caption = ' Statement Type ' + TabOrder = 0 + end + end +end diff --git a/internal/4.10.0.10/1/Source/Design/DBToolsClient.pas b/internal/4.10.0.10/1/Source/Design/DBToolsClient.pas new file mode 100644 index 0000000..b390886 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DBToolsClient.pas @@ -0,0 +1,2145 @@ + +{$IFNDEF CLR} +{$I Dac.inc} + +unit DBToolsClient; +{$ENDIF} + +interface + +uses +{$IFDEF WIN32} + CLRClasses, + VarUtils, + DesignIntf, + ToolsApi, +{$ELSE} + System.Runtime.InteropServices, + Borland.Vcl.Design.DesignIntf, + Borland.Studio.ToolsAPI, + System.Reflection, + System.Diagnostics, + CoreLab.DbTools, + System.Text, +{$ENDIF} + ActiveX, + DADesignUtils, + Windows, Classes, Controls, StdCtrls, ExtCtrls, DB, DBAccess, + DBToolsIntf, ActnMan, ActnList, Graphics, Menus, Forms, Messages; + +type +{$IFDEF CLR} + TString = string; + IIDEServices = IOTAService; + IModuleServices = IOTAModuleServices; +{$ELSE} + TString = PWideChar; + PConnectionInfo = ^ConnectionInfo; + IIDEServices = IOTAServices; + IModuleServices = IOTAModuleServices70; +{$ENDIF} + + TParamTypeMap = record + DACType: TFieldType; + DBToolsType: integer; + end; + + TSqlSource = class; + + TDBToolsVerb = (dbtEditSql, dbtQueryBuilder, + dbtFindInDatabaseExplorer, dbtEditDatabaseObject, dbtExecuteSql, + dbtDebugSql, dbtRetrieveData, dbtCompile, dbtCompileDebug); + + TDBToolsVerbs = set of TDBToolsVerb; + + TCompareFlag = (cfNormal, cfCaseSensitive, cfNone); + + TDBToolsService = class(TObject) + protected + FUsedConnectionStrList: TStringList; + FUsedConnectionCompareFlags: array of TCompareFlag; + + FConnectionStrList: TStringList; + FConnectionsList: TStringList; + FDefaultConnectionList: TStringList; + FDADesignUtils: TDADesignUtilsClass; + FSqlService: IDbToolsService; + FSqlEditors: array of ISqlEditor; + FParamTypeMaps: array of TParamTypeMap; + + FCurrentDesigner: IDesigner; + FCurrentComponent: TComponent; + + function GetSqlEditor: ISqlEditor; + procedure ReturnSqlEditor(ASqlEditor: ISqlEditor); + function GetSqlSource(Component: TComponent; Designer: IDesigner; SqlTextPrefix: string = ''): TSqlSource; + {$IFDEF WIN32} + class function AccessData(const V: PSafeArray): pointer; + class procedure UnaccessData(const V: PSafeArray); + class function DataHigh(const V: PSafeArray): integer; + {$ENDIF} + class function GetConnectionParamStr(const ParamName, ParamValue: string): string; + function GetConnectionValueStr(ConnectionName: string): string; + procedure ConnStrToList(ConnStr: string; const ConnList: TStrings); + procedure CheckConnection(const Component: TComponent); + + procedure BeginConnectionStrGetting(const ConnectionStrList: TStringList); + public + constructor Create(ADADesignUtils: TDADesignUtilsClass; ASqlService: {$IFDEF WIN32}IUnknown{$ELSE}TObject{$ENDIF};ADefaultConnectionStr: string); + destructor Destroy; override; + function DBToolsTypeToDataType(AType: integer; OldType: TFieldType): TFieldType; + function DataTypeToDBToolsType(AType: TFieldType): integer; + + function GetConnection(const Component: TComponent): TCustomDAConnection; + function GetNativeConnectionString(const Component: TComponent): string; + function GetConnectionString(const Component: TComponent): TString; + function GetConnectionStringObjectTypeAndFullName(const Component: TComponent; out ConnectionString, ObjectType, FullName: TString): boolean; + + procedure GetConnections(NameList: TStrings; Condition: string = ''); + function FindConnectionName(AConnection: TCustomDAConnection): string; //Call GetConnections + function GetConnectionStrList(ConnectionName: string): TStringList; //before! + + procedure FindInDatabaseExplorer; + procedure EditDatabaseObject; + procedure ExecuteSql(Debug: boolean); + procedure Compile(Debug: boolean); + procedure RetrieveData(AsDocument: boolean); + procedure EditSql(AsQuery: boolean); + + procedure AddParamTypeMap(ADACType: TFieldType; ADBToolsType: integer); + + procedure PutConnectionParam(const ConnectionParam: string; const CompareFlag: TCompareFlag = cfNormal); + procedure SkipConnectionParams(const Count: integer); + + property DADesignUtils: TDADesignUtilsClass read FDADesignUtils; + property SqlService: IDbToolsService read FSqlService; + end; + + TDACSqlEditorFrame = class(TPanel) + private + FReadOnly: boolean; + FOnExit: TNotifyEvent; + FOnChange: TNotifyEvent; + FDBToolsService: TDBToolsService; + FSqlEditors: array[TStatementType] of ISqlEditor; + FStatementType: TStatementType; + FComponent: TComponent; + FLastConnectionString: string; + FInInit: boolean; + + function GetSqlEditor: ISqlEditor; + procedure SetStatementType(const Value: TStatementType); + function GetText: string; + procedure SetText(const Value: string); {$IFDEF CLR} reintroduce; {$ENDIF} + procedure SetReadOnly(Value: boolean); + procedure InternalResize; + protected + procedure Resize; override; + function GetSqlEditorHandle: HWND; + procedure CheckModified; + procedure WndProc(var Message: TMessage); override; + public + constructor Create(AOwner: TComponent; Component: TComponent; DBToolsService: TDBToolsService); reintroduce; + destructor Destroy; override; + procedure SetFocus; override; + procedure CheckConnectionChange; + procedure EndInit; + + property SqlEditor: ISqlEditor read GetSqlEditor; + property Text: string read GetText write SetText; + property OnExit: TNotifyEvent read FOnExit write FOnExit; + property OnChange: TNotifyEvent read FOnChange write FOnChange; + property ReadOnly: boolean read FReadOnly write SetReadOnly; + property StatementType: TStatementType write SetStatementType; + end; + + TDBToolsDesignNotification = class; + + TDBTools = class(TObject) + private + FIDEServices: IIDEServices; + FModuleServices: IModuleServices; + FDBToolsServices: array of TDBToolsService; + FDesignNotification: TDBToolsDesignNotification; + FCurrentDADesignUtils: TDADesignUtilsClass; + FCurrentDBToolsService: TDBToolsService; + {$IFDEF WIN32} + FNeedUninitialize: boolean; + {$ENDIF} + FMenuManager: TActionManager; + FMenuActions: array [TDBToolsVerb] of TAction; + FLastDACSqlEditorFrame: TDACSqlEditorFrame; + FLastMemo: TWinControl; + FDACSqlEditorFrames: array of TDACSqlEditorFrame; + + function MenuItemsAvailable: boolean; + procedure DebugSql(Sender: TObject); + procedure EditDatabaseObject(Sender: TObject); + procedure EditSql(Sender: TObject); + procedure ExecuteSql(Sender: TObject); + procedure Compile(Sender: TObject); + procedure CompileDebug(Sender: TObject); + procedure FindInDatabaseExplorer(Sender: TObject); + procedure QueryBuilder(Sender: TObject); + procedure RetrieveData(Sender: TObject); + + procedure CreateMenuActions; + function GetMenuActions(Index: TDBToolsVerb): TAction; + public + property DesignNotification: TDBToolsDesignNotification read FDesignNotification; + property IDEServices: IIDEServices read FIDEServices; + property ModuleServices: IModuleServices read FModuleServices; + + constructor Create; + destructor Destroy; override; + function CreateDBToolsService(const DADesignUtils: TDADesignUtilsClass; + const ClassID: TGUID;{$IFDEF CLR} const ServiceShortName: string; {$ENDIF} + const DefaultConnectionStr: string; const ProviderKey: string; + out ServiceVersion: int64; out NeedToCheck: TNeedToCheckDbTools): TObject; + function CheckDevTools(const ClassID: TGUID; const ProviderKey: string; const DADesignUtils: TDADesignUtilsClass; out ServiceVersion: int64): TNeedToCheckDbTools; + procedure CheckDBToolsChanges(Control: TWinControl); + procedure ReplaceMemo(var Memo: TMemo; DADesignUtils: TDADesignUtilsClass; Component: TComponent); + procedure DesignerClosing(const FileName: string); + function GetDesignerName(Designer: IDesigner): string; + procedure PrepareMenu(Designer: IDesigner; Component: TComponent; DADesignUtils: TDADesignUtilsClass); + function HasDACSqlEditorFrame(Memo: TWinControl): boolean; + function GetDACSqlEditorFrame(Memo: TWinControl): TDACSqlEditorFrame; + procedure CheckConnectionChanges; + function GetActiveDACSqlEditorFrame: TWinControl; + + property MenuActions[Index: TDBToolsVerb]: TAction read GetMenuActions; + end; + + TSqlSource = class(TInterfacedObject, ISqlSource) + protected + FParameterCount: integer; + FParameterSetted: array of boolean; + FDesigner: IDesigner; + FDesignerName: string; + FComponent: TComponent; + FLastName: string; + FComponentSQL: string; + FSqlSourceNotifier: ISqlSourceNotifier; + FStatementType: TStatementType; + FDBToolsService: TDBToolsService; + FLastConnection: TCustomDAConnection; + FLastConnectionString: string; + FSqlTextPrefix: string; + + function GetParams: TDAParams; + function GetSqlText: string; + procedure SetSqlText(Value: string); + + function Get_Name: TString; {$IFDEF WIN32}stdcall;{$ENDIF} + function Get_ConnectionString: TString; {$IFDEF WIN32}stdcall;{$ENDIF} + function Get_DesignerName: TString; {$IFDEF WIN32}stdcall;{$ENDIF} + function Get_Sql: TString; {$IFDEF WIN32}stdcall;{$ENDIF} + procedure Set_Sql({$IFDEF WIN32}const {$ENDIF}Param1: TString); {$IFDEF WIN32}stdcall;{$ENDIF} + procedure GetParameter({$IFDEF WIN32}const {$ENDIF}Index: integer; out Info: CommandParameterInfo); {$IFDEF WIN32}stdcall;{$ENDIF} + procedure SetParameter({$IFDEF WIN32}const {$ENDIF}Index: integer; Info: CommandParameterInfo); {$IFDEF WIN32}stdcall;{$ENDIF} + procedure Set_ParameterCount({$IFDEF WIN32}const {$ENDIF}Value: integer); {$IFDEF WIN32}stdcall;{$ENDIF} + function Get_ParameterCount: integer; {$IFDEF WIN32}stdcall;{$ENDIF} + + procedure Close; {$IFDEF WIN32}stdcall;{$ENDIF} + + property Params: TDAParams read GetParams; + public + constructor Create(DBToolsService: TDBToolsService; Component: TComponent; Designer: IDesigner); + destructor Destroy; override; + procedure CheckRename; + procedure CheckConnectionChange(InternalCheck: boolean); + procedure CheckChanges; + + property SqlSourceNotifier: ISqlSourceNotifier read FSqlSourceNotifier; + property Designer: IDesigner read FDesigner; + property SqlTextPrefix: string read FSqlTextPrefix write FSqlTextPrefix; + end; + + TSqlSourceList = class(TList) + private + FNotifiersToDelete: array of ISqlSourceNotifier; + public + function IndexOf(Component: TComponent): integer; reintroduce; + function Find(Component: TComponent): TSqlSource; overload; + function Find(Component: TComponent; SqlTextPrefix: string): TSqlSource; overload; + function FindDesigner(FileName: string): IDesigner; + procedure CheckSubordinated(AComponent: TComponent); + procedure Delete(Index: integer; WithNotification: boolean = False); reintroduce; overload; + procedure Delete(Component: TComponent; WithNotification: boolean = True); overload; + procedure Delete(SqlSource: TSqlSource); overload; + procedure Add(SqlSource: TSqlSource); + procedure DeleteDesigner(Designer: IDesigner); + procedure CheckDeletedComponents(Designer: IDesigner); + end; + + TModuleNotifier = class({$IFDEF CLR}TObject{$ELSE}TInterfacedObject, IOTANotifier, IOTAModuleNotifier, IOTAModuleNotifier80{$ENDIF}) + private + FModule : IOTAModule; + {$IFDEF WIN32} + AllowSaveSwitch : boolean; + FIndex : integer; + {$ELSE} + procedure BeforeSave(Sender: TObject; e: EventArgs); + {$ENDIF} + procedure RemoveNotifier; + public + constructor Create(const Module: IOTAModule); + destructor Destroy; override; + {$IFDEF WIN32} + {IOTANotifier} + procedure AfterSave; + procedure BeforeSave; + procedure Destroyed; + procedure Modified; + {IOTAModuleNotifier} + function CheckOverwrite: Boolean; + procedure ModuleRenamed(const NewName: string); + {IOTAModuleNotifier80} + function AllowSave: Boolean; + function GetOverwriteFileNameCount: Integer; + function GetOverwriteFileName(Index: Integer): string; + procedure SetSaveFileName(const FileName: string); + {$ENDIF} + property Module: IOTAModule read FModule; + end; + + TModuleList = class(TList) + public + function IndexOf(Module: IOTAModule): integer; reintroduce; + procedure Add(Module: IOTAModule); + procedure Delete(Index: integer); reintroduce; overload; + procedure Delete(Module: IOTAModule); overload; + end; + + TDBToolsDesignNotification = class(TInterfacedObject, IDesignNotification) + protected + FSqlSourceList: TSqlSourceList; + FModuleList: TModuleList; + FDebugStr: string; + public + constructor Create; + destructor Destroy; override; + procedure ItemDeleted(const ADesigner: IDesigner; AItem: TPersistent); + procedure ItemInserted(const ADesigner: IDesigner; AItem: TPersistent); + procedure ItemsModified(const ADesigner: IDesigner); + procedure SelectionChanged(const ADesigner: IDesigner; const ASelection: IDesignerSelections); + procedure DesignerOpened(const ADesigner: IDesigner; AResurrecting: Boolean); + procedure DesignerClosed(const ADesigner: IDesigner; AGoingDormant: Boolean); + + property SqlSourceList: TSqlSourceList read FSqlSourceList; + property ModuleList: TModuleList read FModuleList; + end; + +var + DBTools: TDBTools; + +function GetDBToolsService(DADesignUtilsClass: TDADesignUtilsClass): TDBToolsService; + +implementation + +{$IFDEF WIN32} +{$R DBToolsClient.res} +{$ENDIF} +uses + DADesign, Registry, Download, DAConsts, + Variants, SysUtils, ComObj, TypInfo; + +const + SConnectionName = '_ConnName_'; + SConnStrError = 'ConnectionString error'; + SCompilePrefix = 'compile'; + SEditPrefix = 'edit'; + +{$IFDEF WIN32} + function ToWideChar(s: WideString): PWideChar; + begin + if s = '' then + Result := nil + else + Result := SysAllocString(PWideChar(s)); + end; +{$ENDIF} + +{ TSqlSourceList } + +procedure TSqlSourceList.Add(SqlSource: TSqlSource); +var + ModuleFileName, s: string; + Module: IOTAModule; +begin + SqlSource.Designer.ModuleFileNames(ModuleFileName, s, s); + + inherited Add(SqlSource); + + Module := DBTools.ModuleServices.FindModule(ModuleFileName); + DBTools.DesignNotification.ModuleList.Add(Module) +end; + +function TSqlSourceList.IndexOf(Component: TComponent): integer; +var + i: integer; +begin + Result := -1; + for i := 0 to Count - 1 do + if TSqlSource(Items[i]).FComponent = Component then begin + Result := i; + Break; + end; +end; + +function TSqlSourceList.Find(Component: TComponent): TSqlSource; +var + i: integer; +begin + i := IndexOf(Component); + if i < 0 then + Result := nil + else + Result := TSqlSource(Items[i]); +end; + +function TSqlSourceList.Find(Component: TComponent; SqlTextPrefix: string): TSqlSource; +var + i: integer; +begin + for i := 0 to Count - 1 do + if (TSqlSource(Items[i]).FComponent = Component) and + (TSqlSource(Items[i]).SqlTextPrefix = SqlTextPrefix) then begin + Result := TSqlSource(Items[i]); + Exit; + end; + Result := nil; +end; + +procedure TSqlSourceList.CheckSubordinated(AComponent: TComponent); +var + i: integer; +begin + if AComponent is TCustomDAConnection then begin + for i := 0 to Count - 1 do + with TSqlSource(Items[i]) do + if FDBToolsService.GetConnection(FComponent) = AComponent then + CheckConnectionChange(False); + end + else + for i := 0 to Count - 1 do + if TSqlSource(Items[i]).FComponent.Owner = AComponent then + TSqlSource(Items[i]).CheckRename; +end; + +procedure TSqlSourceList.Delete(Index: integer; WithNotification: boolean = False); +var + n: integer; + SqlSource: TSqlSource; +begin + SqlSource := TSqlSource(Items[Index]); + if WithNotification and (SqlSource.FSqlSourceNotifier <> nil) then begin + n := Length(FNotifiersToDelete); + SetLength(FNotifiersToDelete, n + 1); + FNotifiersToDelete[n] := SqlSource.FSqlSourceNotifier; + SqlSource.FSqlSourceNotifier := nil; + inherited Delete(Index); + end + else + inherited Delete(Index); +end; + +procedure TSqlSourceList.Delete(Component: TComponent; WithNotification: boolean = True); +var + Index: integer; +begin + Index := IndexOf(Component); + if Index >= 0 then + Delete(Index, WithNotification); +end; + +procedure TSqlSourceList.Delete(SqlSource: TSqlSource); +var + i: integer; +begin + for i := 0 to Count - 1 do + if TSqlSource(Items[i]) = SqlSource then begin + inherited Delete(i); + Break; + end; +end; + +procedure TSqlSourceList.DeleteDesigner(Designer: IDesigner); +var + i: integer; + SqlSource: TSqlSource; +begin + i := 0; + while i < Count do begin + SqlSource := TSqlSource(Items[i]); + if SqlSource.Designer = Designer then begin + if SqlSource.FSqlSourceNotifier <> nil then begin + SqlSource.FSqlSourceNotifier.OnSqlSourceDeleted; + SqlSource.FSqlSourceNotifier := nil; + end; + inherited Delete(i); + end + else + Inc(i); + end; +end; + +procedure TSqlSourceList.CheckDeletedComponents(Designer: IDesigner); +var + i, n: integer; + Notifier: ISqlSourceNotifier; + Sel: IDesignerSelections; +begin + n := Length(FNotifiersToDelete); + if n <= 0 then + Exit; + Sel := CreateSelectionList; + Sel.Add(Designer.Root); + Designer.SetSelections(Sel); + Designer.Activate; + for i := n - 1 downto 0 do begin + Notifier := FNotifiersToDelete[i]; + SetLength(FNotifiersToDelete, i); + Notifier.OnSqlSourceDeleted; + end; +end; + +function TSqlSourceList.FindDesigner(FileName: string): IDesigner; +var + i: integer; + ModuleFileName, s: string; +begin + for i := 0 to Count - 1 do begin + TSqlSource(Items[i]).Designer.ModuleFileNames(ModuleFileName, s, s); + if ModuleFileName = FileName then begin + Result := TSqlSource(Items[i]).Designer; + Exit; + end; + end; + Result := nil; +end; + +{ TDBToolsDesignNotification } + +constructor TDBToolsDesignNotification.Create; +begin + inherited; + FSqlSourceList := TSqlSourceList.Create; + FModuleList := TModuleList.Create; +end; + +procedure TDBToolsDesignNotification.DesignerClosed(const ADesigner: IDesigner; + AGoingDormant: Boolean); +begin + if ADesigner <> nil then + DBTools.DesignNotification.SqlSourceList.DeleteDesigner(ADesigner); +end; + +procedure TDBToolsDesignNotification.DesignerOpened(const ADesigner: IDesigner; + AResurrecting: Boolean); +begin +end; + +destructor TDBToolsDesignNotification.Destroy; +var + i, n: integer; +begin + n := FSqlSourceList.Count; + for i := n - 1 downto 0 do + FSqlSourceList.Delete(i); + FSqlSourceList.Free; + + n := FModuleList.Count; + for i := n - 1 downto 0 do begin + {$IFDEF CLR} + TModuleNotifier(FModuleList.Items[i]).Free; + {$ENDIF} + FModuleList.Delete(i); + end; + FModuleList.Free; +end; + +procedure TDBToolsDesignNotification.ItemDeleted(const ADesigner: IDesigner; + AItem: TPersistent); +begin + if AItem is TComponent then + FSqlSourceList.Delete(TComponent(AItem)); + FSqlSourceList.CheckDeletedComponents(ADesigner); +end; + +procedure TDBToolsDesignNotification.ItemInserted(const ADesigner: IDesigner; + AItem: TPersistent); +begin +end; + +procedure TDBToolsDesignNotification.ItemsModified(const ADesigner: IDesigner); +var + i: Integer; + SqlSource: TSqlSource; + SelectionList: IDesignerSelections; + Component: TComponent; +begin + if ADesigner = nil then + Exit; + SelectionList := CreateSelectionList; + ADesigner.GetSelections(SelectionList); + for i := 0 to SelectionList.Count - 1 do begin + if SelectionList.Items[i] is TComponent then begin + Component := TComponent(SelectionList.Items[i]); + SqlSource := FSqlSourceList.Find(Component); + if SqlSource <> nil then + SqlSource.CheckChanges + else + FSqlSourceList.CheckSubordinated(Component); + end; + end; +end; + +procedure TDBToolsDesignNotification.SelectionChanged(const ADesigner: IDesigner; + const ASelection: IDesignerSelections); +begin +end; + +{ TSqlSource } + +procedure TSqlSource.Close; +begin + Assert(DBTools.DesignNotification <> nil); + DBTools.DesignNotification.SqlSourceList.Delete(FComponent, False); +end; + +constructor TSqlSource.Create(DBToolsService: TDBToolsService; Component: TComponent; Designer: IDesigner); +begin + inherited Create; + Assert(DBToolsService <> nil); + FComponent := Component; + FDBToolsService := DBToolsService; + FStatementType := stQuery; + FLastName := Get_Name; + FComponentSQL := GetSqlText; + FDesigner := Designer; + FDesignerName := DBTools.GetDesignerName(FDesigner); + FLastConnection := FDBToolsService.GetConnection(Component); + FLastConnectionString := FDBToolsService.GetNativeConnectionString(FLastConnection); +end; + +destructor TSqlSource.Destroy; +begin + inherited; +end; + +function TSqlSource.GetParams: TDAParams; +begin + with FDBToolsService.DADesignUtils do + if HasParams(FComponent) then + Result := GetParams(FComponent) + else + Result := nil; +end; + +function TSqlSource.Get_ConnectionString: TString; +begin + Result := {$IFDEF WIN32}ToWideChar({$ENDIF} + FLastConnectionString + {$IFDEF WIN32}){$ENDIF}; +end; + +function TSqlSource.Get_DesignerName: TString; +begin + Result := {$IFDEF WIN32}ToWideChar(FDesignerName){$ELSE}FDesignerName{$ENDIF}; +end; + +function TSqlSource.Get_Name: TString; +begin + Result := {$IFDEF WIN32}ToWideChar({$ENDIF} + FComponent.Owner.Name + '-' + FComponent.Name + {$IFDEF WIN32}){$ENDIF}; +end; + +function TSqlSource.GetSqlText: string; +var + SQL: TStrings; + Macros: TMacros; + NewMacros: TDesignMacros; +begin + with FDBToolsService.DADesignUtils do + if IsStoredProc(FComponent) then begin + Result := Trim(GetFullName(FComponent)); + if Result <> '' then + Result := GetObjectType(FComponent) + ':' + Result; + end + else begin + SQL := GetSQL(FComponent); + Macros := GetMacros(FComponent); + NewMacros := TDesignMacros.Create(nil); + try + NewMacros.SetParserClass(TDBAccessUtils.GetParserClass(Macros)); + NewMacros.Assign(Macros); + Result := SQL.Text; + NewMacros.Expand(Result); + finally + NewMacros.Free; + end; + end; + if (FSqlTextPrefix <> '') and (FSqlTextPrefix <> SEditPrefix) then + Result := FSqlTextPrefix + ':' + Result; +end; + +procedure TSqlSource.SetSqlText(Value: string); +var + SQL: TStrings; + Macros: TMacros; + NewMacros: TDesignMacros; +begin + with FDBToolsService.DADesignUtils do + if not IsStoredProc(FComponent) then begin + SQL := GetSQL(FComponent); + Macros := GetMacros(FComponent); + NewMacros := TDesignMacros.Create(nil); + try + NewMacros.SetParserClass(TDBAccessUtils.GetParserClass(Macros)); + NewMacros.Scan(Value); + SQL.Text := Value; + Macros.Assign(NewMacros); + finally + NewMacros.Free; + end; + end; +end; + +function TSqlSource.Get_Sql: TString; +begin + Result := {$IFDEF WIN32}ToWideChar({$ENDIF} + WideString(GetSqlText) + {$IFDEF WIN32}){$ENDIF}; +end; + +procedure TSqlSource.Set_Sql({$IFDEF WIN32}const {$ENDIF}Param1: TString); +begin + SetSqlText(Param1); +end; + +procedure TSqlSource.GetParameter({$IFDEF WIN32}const {$ENDIF}Index: integer; out Info: CommandParameterInfo); +begin + Assert(Index < Get_ParameterCount); + Info.Name := {$IFDEF WIN32}ToWideChar({$ENDIF}Params[Index].Name + {$IFDEF WIN32}){$ENDIF}; + Info.DataType := FDBToolsService.DataTypeToDBToolsType(Params[Index].DataType); + Info.Value := Params[Index].Value; + case Params[Index].ParamType of + ptUnknown, + ptInput: + Info.ParameterType := ParameterType_Input; + ptOutput: + Info.ParameterType := ParameterType_Output; + ptInputOutput: + Info.ParameterType := ParameterType_InputOutput; + ptResult: + Info.ParameterType := ParameterType_ReturnValue; + end; +end; + +function TSqlSource.Get_ParameterCount: integer; +begin + if (Params <> nil) and (Params.Count > FParameterCount) then + Set_ParameterCount(Params.Count); + Result := FParameterCount; +end; + +procedure TSqlSource.Set_ParameterCount({$IFDEF WIN32}const {$ENDIF}Value: integer); +var + i, n: integer; +begin + if Params = nil then + Exit; + FParameterCount := Value; + SetLength(FParameterSetted, Value); + n := Params.Count; + for i := 0 to Value - 1 do begin + if i >= n then + Params.Add; + FParameterSetted[i] := False; + end; +end; + +procedure TSqlSource.SetParameter({$IFDEF WIN32}const {$ENDIF}Index: integer; Info: CommandParameterInfo); +var + i, j: integer; + TempParam: TDAParam; +begin + Assert(Index < Get_ParameterCount); + for i := 0 to Params.Count - 1 do + if Params[i].Name = Info.Name then begin + if i <> Index then begin + TempParam := Params[Index]; + Params[Index] := Params[i]; + Params[i] := TempParam; + end; + Break; + end; + with TDAParam(Params[Index]) do begin + Name := Info.Name; + DataType := FDBToolsService.DBToolsTypeToDataType(Info.DataType, DataType); + Value := Variant(Info.Value); + case Info.ParameterType of + ParameterType_Input: + ParamType := ptInput; + ParameterType_Output: + ParamType := ptOutput; + ParameterType_InputOutput: + ParamType := ptInputOutput; + ParameterType_ReturnValue: + ParamType := ptResult; + end; + end; + for i := FParameterCount - 1 downto 0 do + if not FParameterSetted[i] then + Break + else + if i = 0 then + for j := Params.Count - 1 downto FParameterCount do + Params.Delete(j); +end; + +procedure TSqlSource.CheckRename; +begin + if (FLastName <> Get_Name) then begin + if FSqlSourceNotifier <> nil then + FSqlSourceNotifier.OnSqlSourceRenamed(Get_Name); + FLastName := Get_Name; + end; +end; + +procedure TSqlSource.CheckConnectionChange(InternalCheck: boolean); +var + NewConnection: TCustomDAConnection; + NewConnectionString: string; +begin + NewConnection := FDBToolsService.GetConnection(FComponent); + if InternalCheck and (FLastConnection = NewConnection) then + Exit; + NewConnectionString := FDBToolsService.GetNativeConnectionString(NewConnection); + if NewConnectionString <> FLastConnectionString then begin + FLastConnectionString := NewConnectionString; + if not InternalCheck and (FSqlSourceNotifier <> nil) then + FSqlSourceNotifier.OnSqlSourceChanged; + end; +end; + +procedure TSqlSource.CheckChanges; +begin + CheckRename; + CheckConnectionChange(True); + if GetSqlText <> FComponentSQL then begin + if FSqlSourceNotifier <> nil then + FSqlSourceNotifier.OnSqlSourceChanged; + FComponentSQL := GetSqlText; + end; +end; + +{ TDACSqlEditorFrame } + +procedure TDACSqlEditorFrame.CheckModified; +begin + if (SqlEditor <> nil) and (SqlEditor.Modified) then begin + if Assigned(FOnChange) then + FOnChange(Self); + if Assigned(FOnExit) then + FOnExit(Self); + SqlEditor.Modified := False; + end; +end; + +constructor TDACSqlEditorFrame.Create(AOwner: TComponent; Component: TComponent; DBToolsService: TDBToolsService); +var + i: integer; +begin + inherited Create(AOwner); + + FInInit := True; + FComponent := Component; + FDBToolsService := DBToolsService; + BevelOuter := bvNone; + FStatementType := stQuery; + TabStop := True; + i := Length(DBTools.FDACSqlEditorFrames); + SetLength(DBTools.FDACSqlEditorFrames, i + 1); + DBTools.FDACSqlEditorFrames[i] := Self; +end; + +destructor TDACSqlEditorFrame.Destroy; +var + st: TStatementType; + i, j, n: integer; +begin + for st := Low(TStatementType) to High(TStatementType) do + if FSqlEditors[st] <> nil then + FDBToolsService.ReturnSqlEditor(FSqlEditors[st]); + n := High(DBTools.FDACSqlEditorFrames); + for i := 0 to n do + if DBTools.FDACSqlEditorFrames[i] = Self then begin + for j := i to n - 1 do + DBTools.FDACSqlEditorFrames[j] := DBTools.FDACSqlEditorFrames[j + 1]; + SetLength(DBTools.FDACSqlEditorFrames, n); + Break; + end; + + inherited; +end; + +procedure TDACSqlEditorFrame.EndInit; +begin + FInInit := False; +end; + +procedure TDACSqlEditorFrame.InternalResize; +begin + if SqlEditor <> nil then + Windows.SetWindowPos(GetSqlEditorHandle, 0, 0, 0, ClientWidth, ClientHeight, SWP_NOZORDER or SWP_SHOWWINDOW); +end; + +procedure TDACSqlEditorFrame.Resize; +begin + InternalResize; + inherited; +end; + +procedure TDACSqlEditorFrame.SetFocus; +begin + inherited; + + if SqlEditor <> nil then + Windows.SetFocus(GetSqlEditorHandle); +end; + +procedure TDACSqlEditorFrame.WndProc(var Message: TMessage); +begin + if not FInInit and (Message.Msg = WM_SETFOCUS) and (SqlEditor <> nil) then + Windows.SetFocus(GetSqlEditorHandle) + else + inherited; +end; + +procedure TDACSqlEditorFrame.CheckConnectionChange; +var + NewConnectionString: string; + st: TStatementType; +begin + Assert(SqlEditor <> nil); + + NewConnectionString := FDBToolsService.GetNativeConnectionString(FComponent); + if NewConnectionString <> FLastConnectionString then begin + FLastConnectionString := NewConnectionString; + + if FLastConnectionString <> '' then + for st := Low(TStatementType) to High(TStatementType) do + if FSqlEditors[st] <> nil then + FSqlEditors[st].SetConnection({$IFDEF WIN32}ToWideChar({$ENDIF} + FLastConnectionString + {$IFDEF WIN32}){$ENDIF}); + end; +end; + +function TDACSqlEditorFrame.GetSqlEditorHandle: HWND; +begin + Assert(SqlEditor <> nil); + + Result := SqlEditor.Handle{$IFDEF CLR}.ToInt32{$ENDIF}; +end; + +function TDACSqlEditorFrame.GetText: string; +begin + if SqlEditor <> nil then + Result := SqlEditor.Text + else + Result := ''; +end; + +procedure TDACSqlEditorFrame.SetText(const Value: string); +begin + if SqlEditor <> nil then + SqlEditor.Text := {$IFDEF WIN32}ToWideChar(Value){$ELSE}Value{$ENDIF}; +end; + +procedure TDACSqlEditorFrame.SetReadOnly(Value: boolean); +var + st: TStatementType; +begin + if Value <> FReadOnly then begin + FReadOnly := Value; + for st := Low(TStatementType) to High(TStatementType) do + if FSqlEditors[st] <> nil then + FSqlEditors[st].ReadOnly := Value; + SetStatementType(FStatementType); + end; +end; + +function TDACSqlEditorFrame.GetSqlEditor: ISqlEditor; +begin + if (not ReadOnly) or (FSqlEditors[FStatementType] <> nil) then + Result := FSqlEditors[FStatementType] + else + Result := FSqlEditors[stQuery]; +end; + +procedure TDACSqlEditorFrame.SetStatementType(const Value: TStatementType); +var + NewStatementType: TStatementType; + FHide, FShow, FFocused: boolean; +begin + if FReadOnly and (FSqlEditors[Value] = nil) then + NewStatementType := stQuery + else + NewStatementType := Value; + FHide := NewStatementType <> FStatementType; + FShow := FHide; + if FSqlEditors[NewStatementType] = nil then + if (FSqlEditors[stQuery] <> nil) and (FSqlEditors[stQuery].Text = '') then begin + FSqlEditors[NewStatementType] := FSqlEditors[stQuery]; + FSqlEditors[stQuery] := nil; + FHide := False; + FShow := False; + end + else begin + FSqlEditors[NewStatementType] := FDBToolsService.GetSqlEditor; + if FLastConnectionString <> '' then + FSqlEditors[NewStatementType].SetConnection({$IFDEF WIN32}ToWideChar({$ENDIF} + FLastConnectionString + {$IFDEF WIN32}){$ENDIF}); + FSqlEditors[NewStatementType].Text := {$IFDEF WIN32}nil{$ELSE}''{$ENDIF}; + FShow := True; + end; + if FHide and (FSqlEditors[NewStatementType] <> nil) then begin + Windows.SetParent(GetSqlEditorHandle, MAXDWORD - 2{HWND_MESSAGE}); + FFocused := Windows.GetFocus = GetSqlEditorHandle; + end + else + FFocused := False; + + FStatementType := Value; + if FShow then begin + Windows.SetParent(GetSqlEditorHandle, Handle); + FSqlEditors[NewStatementType].ReadOnly := FReadOnly; + InternalResize; + if FFocused then + Windows.SetFocus(GetSqlEditorHandle); + end; +end; + +{ TDBTools } + +procedure TDBTools.CheckDBToolsChanges(Control: TWinControl); +var + i: integer; +begin + if Control <> nil then + for i := 0 to Control.ComponentCount - 1 do + if Control.Components[i] is TDACSqlEditorFrame then + TDACSqlEditorFrame(Control.Components[i]).CheckModified; +end; + +function TDBTools.CreateDBToolsService(const DADesignUtils: TDADesignUtilsClass; + const ClassID: TGUID;{$IFDEF CLR} const ServiceShortName: string; {$ENDIF} + const DefaultConnectionStr: string; const ProviderKey: string; + out ServiceVersion: int64; out NeedToCheck: TNeedToCheckDbTools): TObject; +var + n: integer; +{$IFDEF CLR} + ServiceType: System.Type; + Obj: TObject; +{$ELSE} + Obj: IUnknown; +{$ENDIF} + DBToolsService: TDBToolsService; + +{$IFDEF CLR} + function FindType(const TypeFullName, AssemblyNameFilter: string; out AType: System.Type): boolean; + var + i, j: integer; + LoadedAssemblies: array of Assembly; + Types: array of System.Type; + begin + Result := False; + LoadedAssemblies := System.AppDomain.CurrentDomain.GetAssemblies; + for i := 0 to Length(LoadedAssemblies) - 1 do + if (LoadedAssemblies[i].FullName.ToLower.IndexOf(AssemblyNameFilter.ToLower) >= 0) then begin + Types := LoadedAssemblies[i].GetExportedTypes; + for j := 0 to Length(Types) - 1 do + if Types[j].FullName = TypeFullName then begin + AType := Types[j]; + Result := True; + Exit; + end; + end; + end; +{$ENDIF} + +begin + Result := nil; + Obj := nil; + try + NeedToCheck := ncNoAddin; + ServiceVersion := 0; + DADesignUtils.SetDBToolsDownloadParams(False, False); + if FIDEServices = nil then begin + {$IFDEF WIN32} + Supports(BorlandIDEServices, IIDEServices, FIDEServices); + Supports(BorlandIDEServices, IModuleServices, FModuleServices); + {$ELSE} + FIDEServices := BorlandIDE.OTAService; + FModuleServices := BorlandIDE.ModuleServices; + {$ENDIF} + end; + + NeedToCheck := CheckDevTools(ClassID, ProviderKey, DADesignUtils, ServiceVersion); + if NeedToCheck <> ncNone then + Exit; + {$IFDEF CLR} + if FindType('CoreLab.DbTools.' + ServiceShortName + '.' + ServiceShortName + 'DbToolsService', ServiceShortName, ServiceType) then + {$ENDIF} + begin + {$IFDEF WIN32} + if not FNeedUninitialize then + FNeedUninitialize := Succeeded(CoInitialize(nil)); + Obj := CreateComObject(ClassID); + {$ELSE} + Obj := BorlandIDE.GetService(ServiceType); + {$ENDIF} + end; + if Obj = nil then begin + NeedToCheck := ncExpired; + Exit; + end + else begin + if FDesignNotification = nil then begin + FDesignNotification := TDBToolsDesignNotification.Create; + RegisterDesignNotification(FDesignNotification); + end; + DBToolsService := TDBToolsService.Create(DADesignUtils, Obj, DefaultConnectionStr); + Result := DBToolsService; + n := Length(FDBToolsServices); + SetLength(FDBToolsServices, n + 1); + FDBToolsServices[n] := DBToolsService; + end; + except + NeedToCheck := ncExpired; + end; +end; + +function TDBTools.CheckDevTools(const ClassID: TGUID; const ProviderKey: string; const DADesignUtils: TDADesignUtilsClass; out ServiceVersion: int64): TNeedToCheckDbTools; + + function GetFileVersion(Filename: string): int64; + var + {$IFDEF CLR} + VersionInfo: FileVersionInfo; + {$ELSE} + Handle, + FixedFileInfoLen, + VersionDataLen: DWORD; + VersionData: TBytes; + FixedFileInfo: ^VS_FIXEDFILEINFO; + {$ENDIF} + begin + Result := 0; + if FileExists(Filename) then begin + {$IFDEF CLR} + VersionInfo := FileVersionInfo.GetVersionInfo(Filename); + Result := + VersionInfo.FileMajorPart * $1000000000000 + + VersionInfo.FileMinorPart * $100000000 + + VersionInfo.FileBuildPart * $10000 + + VersionInfo.FilePrivatePart; + {$ELSE} + VersionDataLen := GetFileVersionInfoSize(PChar(Filename), Handle); + SetLength(VersionData, VersionDataLen); + if GetFileVersionInfo(PChar(Filename), Handle, VersionDataLen, VersionData) and + VerQueryValue(VersionData, '\', Pointer(FixedFileInfo), FixedFileInfoLen) then + Result := FixedFileInfo.dwFileVersionMS * $100000000 + FixedFileInfo.dwFileVersionLS; + {$ENDIF} + end; + end; + +begin + Result := ncNoAddin; + ServiceVersion := 0; + with TRegistry.Create do + try + try + RootKey := HKEY_CLASSES_ROOT; + if OpenKey({$IFDEF WIN32}'CLSID\' + GUIDToString(ClassID) + '\InprocServer32' + {$ELSE}'CLSID\{' + GUIDToString(ClassID) + '}\InprocServer32'{$ENDIF}, False) + and ValueExists('CodeBase') then begin + Result := ncIncompatible; + ServiceVersion := GetFileVersion(ReadString('CodeBase')); + CloseKey; + if ServiceVersion <> 0 then + Result := ncNone; + end + else begin + RootKey := HKEY_LOCAL_MACHINE; + if OpenKey('SOFTWARE\CoreLab\Database Developer Tools\DatabaseProviders\' + ProviderKey, False) + and ValueExists('Assembly') then begin + Result := ncIncompatible; + ServiceVersion := GetFileVersion(ReadString('Assembly')); + CloseKey; + end; + end; + except + //Silent + end; + finally + Free; + if Result <> ncNone then begin + DADesignUtils.SetDBToolsDownloadParams(False, Result = ncIncompatible); + CheckForTools(Result = ncIncompatible); + end; + end; +end; + +function TDBTools.MenuItemsAvailable: boolean; +var + Incompatible: boolean; +begin + Result := FCurrentDADesignUtils.DBToolsAvailable; + Incompatible := FCurrentDADesignUtils.NeedToCheckDbTools = ncIncompatible; + if not Result then begin + FCurrentDADesignUtils.SetDBToolsDownloadParams(True, Incompatible); + CheckForTools(Incompatible); + end; +end; + +procedure TDBTools.EditSql(Sender: TObject); +begin + if MenuItemsAvailable then + FCurrentDBToolsService.EditSql(False); +end; + +procedure TDBTools.QueryBuilder(Sender: TObject); +begin + if MenuItemsAvailable then + FCurrentDBToolsService.EditSql(True); +end; + +procedure TDBTools.FindInDatabaseExplorer(Sender: TObject); +begin + if MenuItemsAvailable then + FCurrentDBToolsService.FindInDatabaseExplorer; +end; + +procedure TDBTools.EditDatabaseObject(Sender: TObject); +begin + if MenuItemsAvailable then + FCurrentDBToolsService.EditDatabaseObject; +end; + +procedure TDBTools.ExecuteSql(Sender: TObject); +begin + if MenuItemsAvailable then + FCurrentDBToolsService.ExecuteSql(False); +end; + +procedure TDBTools.Compile(Sender: TObject); +begin + if MenuItemsAvailable then + FCurrentDBToolsService.Compile(False); +end; + +procedure TDBTools.CompileDebug(Sender: TObject); +begin + if MenuItemsAvailable then + FCurrentDBToolsService.Compile(True); +end; + +procedure TDBTools.DebugSql(Sender: TObject); +begin + if MenuItemsAvailable then + FCurrentDBToolsService.ExecuteSql(True); +end; + +procedure TDBTools.RetrieveData(Sender: TObject); +begin + if MenuItemsAvailable then + FCurrentDBToolsService.RetrieveData(True); +end; + +procedure TDBTools.PrepareMenu(Designer: IDesigner; Component: TComponent; DADesignUtils: TDADesignUtilsClass); +begin + FCurrentDADesignUtils := DADesignUtils; + FCurrentDBToolsService := GetDBToolsService(DADesignUtils); + if FCurrentDBToolsService <> nil then + with FCurrentDBToolsService do begin + FCurrentDesigner := Designer; + FCurrentComponent := Component; + end; +end; + +function TDBTools.HasDACSqlEditorFrame(Memo: TWinControl): boolean; +begin + FLastMemo := Memo; + FLastDACSqlEditorFrame := TDACSqlEditorFrame(Memo.Owner.FindComponent(Memo.Name + '_dbt')); + Result := FLastDACSqlEditorFrame <> nil; +end; + +function TDBTools.GetDACSqlEditorFrame(Memo: TWinControl): TDACSqlEditorFrame; +begin + if Memo <> FLastMemo then + HasDACSqlEditorFrame(Memo); + Result := FLastDACSqlEditorFrame; +end; + +procedure TDBTools.CheckConnectionChanges; +var + i: integer; +begin + for i := 0 to High(FDACSqlEditorFrames) do + FDACSqlEditorFrames[i].CheckConnectionChange; +end; + +function TDBTools.GetActiveDACSqlEditorFrame: TWinControl; +var + i: integer; + Handle: HWND; + ClassName: {$IFDEF WIN32}PChar{$ELSE}StringBuilder{$ENDIF}; +begin + Result := nil; +{$IFDEF WIN32} + GetMem(ClassName, 1024); +{$ELSE} + ClassName := StringBuilder.Create; + ClassName.Capacity := 1024; +{$ENDIF} + try + Handle := GetFocus; + repeat + Handle := GetParent(Handle); + if Handle = 0 then + Exit; + GetClassName(Handle, ClassName, 1024); + {$IFDEF WIN32} + until ClassName = TDACSqlEditorFrame.ClassName; + {$ELSE} + until Pos(TDACSqlEditorFrame.ClassName, ClassName.ToString) <> 0; + {$ENDIF} + + for i := 0 to High(FDACSqlEditorFrames) do + if FDACSqlEditorFrames[i].Handle = Handle then begin + Result := FDACSqlEditorFrames[i]; + Break; + end; + finally + {$IFDEF WIN32} + FreeMem(ClassName); + {$ELSE} + ClassName.Free; + {$ENDIF} + end; +end; + +procedure TDBTools.CreateMenuActions; +var + VerbIdx: TDBToolsVerb; +{$IFDEF WIN32} + Bitmap: TBitmap; + MenuImages: TImageList; +{$ENDIF} +begin +{$IFDEF WIN32} + MenuImages := TImageList.Create(nil); + Bitmap := TBitmap.Create; + Bitmap.LoadFromResourceName(HInstance, 'MENUICONS'); + MenuImages.AddMasked(BitMap, $ff00ff); + Bitmap.Free; + (BorlandIDEServices as INTAServices).AddImages(MenuImages); + MenuImages.Free; +{$ENDIF} + FMenuManager := TActionManager.Create(nil); + for VerbIdx := Low(TDBToolsVerb) to High(TDBToolsVerb) do begin + FMenuActions[VerbIdx] := TAction.Create(FMenuManager); + with FMenuActions[VerbIdx] do + case VerbIdx of + dbtEditSql: begin + Caption := 'Edit SQL'; + OnExecute := EditSql; + end; + dbtQueryBuilder: begin + Caption := 'Query Builder'; + OnExecute := QueryBuilder; + end; + dbtFindInDatabaseExplorer: begin + Caption := 'Find in Database Explorer'; + OnExecute := FindInDatabaseExplorer; + end; + dbtEditDatabaseObject: begin + Caption := 'Edit object'; + OnExecute := EditDatabaseObject; + end; + dbtExecuteSql: begin + Caption := 'Execute'; + OnExecute := ExecuteSql; + end; + dbtDebugSql: begin + Caption := 'Step Into'; + OnExecute := DebugSql; + end; + dbtRetrieveData: begin + Caption := 'Retreive data'; + OnExecute := RetrieveData; + end; + dbtCompile: begin + Caption := 'Recompile'; + OnExecute := Compile; + end; + dbtCompileDebug: begin + Caption := 'Recompile with debug info'; + OnExecute := CompileDebug; + end; + end; + {$IFDEF WIN32} + FMenuActions[VerbIdx].ImageIndex := Ord(VerbIdx); + (BorlandIDEServices as INTAServices).AddActionMenu('', FMenuActions[VerbIdx], nil); + {$ENDIF} + end; +end; + +constructor TDBTools.Create; +begin + inherited; + CreateMenuActions; +end; + +destructor TDBTools.Destroy; +begin + FMenuManager.Free; + if FDesignNotification <> nil then + UnregisterDesignNotification(FDesignNotification); +{$IFDEF WIN32} + if FNeedUninitialize then + CoUninitialize; +{$ENDIF} + + inherited; +end; + +function TDBTools.GetDesignerName(Designer: IDesigner): string; +{$IFDEF CLR} +var + Ptr: IntPtr; +{$ENDIF} +begin +{$IFDEF CLR} + Ptr := Marshal.GetIUnknownForObject(Designer); +{$ENDIF} + Result := 'Designer_' + IntToHex(Integer({$IFDEF WIN32}Designer{$ELSE}Ptr{$ENDIF}), 8) + FDesignNotification.FDebugStr; +{$IFDEF CLR} + Marshal.Release(Ptr); +{$ENDIF} +end; + +function TDBTools.GetMenuActions(Index: TDBToolsVerb): TAction; +begin + Result := FMenuActions[Index]; +end; + +procedure TDBTools.ReplaceMemo(var Memo: TMemo; DADesignUtils: TDADesignUtilsClass; Component: TComponent); +var + NewMemo: TWinControl; + OldName: string; + C: TComponent; + DBToolsService: TDBToolsService; +begin + DBToolsService := GetDBToolsService(DADesignUtils); + if (DBToolsService = nil) or HasDACSqlEditorFrame(Memo) then + Exit; + + NewMemo := TDACSqlEditorFrame.Create(Memo.Owner, Component, DBToolsService); + with TDACSqlEditorFrame(NewMemo) do begin + Parent := Memo.Parent; + Left := Memo.Left; + Top := Memo.Top; + Width := Memo.Width; + Height := Memo.Height; + Align := Memo.Align; + TabOrder := Memo.TabOrder; + Anchors := Memo.Anchors; + HelpContext := Memo.HelpContext; + ReadOnly := Memo.ReadOnly; + OnChange := Memo.OnChange; + OnExit := Memo.OnExit; + //OnKeyDown, OnKeyPress + + StatementType := stQuery; + CheckConnectionChange; + end; + + if Memo.Owner <> nil then begin + Memo.OnExit := nil; + C := NewMemo.Owner; + while C <> nil do begin + if C is TCustomForm then begin + if TCustomForm(C).ActiveControl = Memo then begin + TCustomForm(C).ActiveControl := NewMemo; + NewMemo.SetFocus; + end; + Break; + end; + C := C.Owner; + end; + end; + OldName := Memo.Name; + Memo.Hide; + + NewMemo.Name := OldName + '_dbt'; + TDACSqlEditorFrame(NewMemo).EndInit; +end; + +procedure TDBTools.DesignerClosing(const FileName: string); +var + i: integer; + Designer: IDesigner; + DesignerName: string; +begin + Designer := FDesignNotification.SqlSourceList.FindDesigner(FileName); + if Designer = nil then + Exit; + DesignerName := GetDesignerName(Designer); + for i := 0 to Length(FDBToolsServices) - 1 do + FDBToolsServices[i].SqlService.DesignerClosing(DesignerName); +end; + +{ TDBToolsService } + +constructor TDBToolsService.Create(ADADesignUtils: TDADesignUtilsClass; ASqlService: {$IFDEF WIN32}IUnknown{$ELSE}TObject{$ENDIF}; ADefaultConnectionStr: string); +begin + inherited Create; + + FConnectionStrList := TStringList.Create; + FConnectionsList := TStringList.Create; + FDefaultConnectionList := TStringList.Create; + FDADesignUtils := ADADesignUtils; + +{$IFDEF WIN32} + ASqlService.QueryInterface(IDbToolsService, FSqlService); +{$ELSE} + FSqlService := ASqlService as IDbToolsService; +{$ENDIF} + ConnStrToList(ADefaultConnectionStr, FDefaultConnectionList); +end; + +destructor TDBToolsService.Destroy; +begin +{$IFDEF WIN32} + PInteger(@FSqlService)^ := 0; // To prevent _Release calling +{$ENDIF} + FDefaultConnectionList.Free; + FConnectionStrList.Free; + FConnectionsList.Free; + + inherited; +end; + +function TDBToolsService.DataTypeToDBToolsType(AType: TFieldType): integer; +var + i: integer; +begin + Assert(Length(FParamTypeMaps) > 0); + Result := FParamTypeMaps[0].DBToolsType; + for i := 0 to High(FParamTypeMaps) do + if FParamTypeMaps[i].DACType = AType then begin + Result := FParamTypeMaps[i].DBToolsType; + Break; + end; +end; + +function TDBToolsService.DBToolsTypeToDataType(AType: integer; OldType: TFieldType): TFieldType; +var + i: integer; +begin + Result := ftUnknown; + for i := 0 to High(FParamTypeMaps) do + if FParamTypeMaps[i].DBToolsType = AType then begin + if (Result = ftUnknown) or (FParamTypeMaps[i].DACType = OldType) then + Result := FParamTypeMaps[i].DACType; + if Result = OldType then + Break; + end + else + if Result <> ftUnknown then + Break; +end; + +procedure TDBToolsService.BeginConnectionStrGetting(const ConnectionStrList: TStringList); +begin + FUsedConnectionStrList := ConnectionStrList; + SetLength(FUsedConnectionCompareFlags, 0); +end; + +procedure TDBToolsService.PutConnectionParam(const ConnectionParam: string; const CompareFlag: TCompareFlag = cfNormal); +var + i: integer; +begin + i := Length(FUsedConnectionCompareFlags); + Assert (i < FDefaultConnectionList.Count); + FUsedConnectionStrList.Values[FDefaultConnectionList.Names[i]] := ConnectionParam; + SetLength(FUsedConnectionCompareFlags, i + 1); + FUsedConnectionCompareFlags[i] := CompareFlag; +end; + +procedure TDBToolsService.SkipConnectionParams(const Count: integer); +var + i, j: integer; +begin + i := Length(FUsedConnectionCompareFlags); + Assert (i + Count <= FDefaultConnectionList.Count); + SetLength(FUsedConnectionCompareFlags, i + Count); + for j := i to i + Count - 1 do + FUsedConnectionCompareFlags[j] := cfNone; +end; + +class function TDBToolsService.GetConnectionParamStr(const ParamName, ParamValue: string): string; +var + i: integer; + QuoteChar: char; +begin + Result := ParamName + '='; + if Pos('''', ParamValue) > 0 then + QuoteChar := '"' + else + if Pos('"', ParamValue) > 0 then + QuoteChar := '''' + else + if (Pos(' ', ParamValue) > 0) or (Pos(';', ParamValue) > 0) then + QuoteChar := '"' + else + QuoteChar := #0; + if QuoteChar <> #0 then + Result := Result + QuoteChar; + for i := 1 to Length(ParamValue) do begin + if (QuoteChar <> #0) and (ParamValue[i] = QuoteChar) then + Result := Result + QuoteChar; + Result := Result + ParamValue[i]; + end; + if QuoteChar <> #0 then + Result := Result + QuoteChar; + Result := Result + ';'; +end; + +function TDBToolsService.GetConnection(const Component: TComponent): TCustomDAConnection; +begin + if Component = nil then + Result := nil + else + if Component is TCustomDAConnection then + Result := TCustomDAConnection(Component) + else + Result := DADesignUtils.UsedConnection(Component); +end; + +function TDBToolsService.GetNativeConnectionString(const Component: TComponent): string; +var + i, n: integer; + DefStr: string; + Connection: TCustomDAConnection; + ConnectionList: TStringList; +begin + Result := ''; + Connection := GetConnection(Component); + if Connection <> nil then begin + ConnectionList := TStringList.Create; + try + BeginConnectionStrGetting(ConnectionList); + DADesignUtils.GetDBToolsConnectionList(Connection); + n := ConnectionList.Count - 1; + for i := n downto 0 do begin + DefStr := FDefaultConnectionList.Values[ConnectionList.Names[i]]; + if (DefStr <> '') and (DefStr = ConnectionList.ValueFromIndex[i]) then + ConnectionList.Delete(i); + end; + for i := 0 to ConnectionList.Count - 1 do + Result := Result + GetConnectionParamStr(ConnectionList.Names[i], ConnectionList.ValueFromIndex[i]); + finally + ConnectionList.Free; + end; + end; +end; + +function TDBToolsService.GetConnectionString(const Component: TComponent): TString; +begin + Result := {$IFDEF WIN32}ToWideChar({$ENDIF} + GetNativeConnectionString(Component) + {$IFDEF WIN32}){$ENDIF}; +end; + +function TDBToolsService.GetConnectionStringObjectTypeAndFullName(const Component: TComponent; out ConnectionString, ObjectType, FullName: TString): boolean; +begin + ConnectionString := GetConnectionString(Component); + Result := ConnectionString <> ''; + if Result then begin + FullName := {$IFDEF WIN32}ToWideChar({$ENDIF} + DADesignUtils.GetFullName(Component){$IFDEF WIN32}){$ENDIF}; + ObjectType := {$IFDEF WIN32}ToWideChar({$ENDIF} + DADesignUtils.GetObjectType(Component){$IFDEF WIN32}){$ENDIF}; + if not(Component is TCustomDAConnection) then + Result := Length(FullName) > 0; + end + else begin + FullName := {$IFDEF WIN32}nil{$ELSE}''{$ENDIF}; + ObjectType := {$IFDEF WIN32}nil{$ELSE}''{$ENDIF}; + end; +end; + +procedure TDBToolsService.GetConnections(NameList: TStrings; Condition: string = ''); +var + ConnectionInfoArray: TConnectionInfoArray; + i: integer; + Connection: {$IFDEF WIN32}PConnectionInfo{$ELSE}ConnectionInfo{$ENDIF}; +begin + ConnectionInfoArray := FSqlService.GetConnections; + NameList.BeginUpdate; + FConnectionsList.BeginUpdate; +{$IFDEF WIN32} + Connection := AccessData(ConnectionInfoArray); +{$ENDIF} + try + FConnectionsList.Clear; + NameList.Clear; + for i := 0 to {$IFDEF WIN32}DataHigh{$ELSE}High{$ENDIF}(ConnectionInfoArray) do begin + {$IFDEF CLR} + Connection := ConnectionInfoArray[i]; + {$ENDIF} + if (Condition = '') or (Pos(Condition, Connection.ConnectionString) > 0) then begin + NameList.Add(Connection.Name); + FConnectionsList.Add(GetConnectionValueStr(Connection.Name) + Connection.ConnectionString); + end; + {$IFDEF WIN32} + Inc(Connection); + {$ENDIF} + end; + finally + NameList.EndUpdate; + FConnectionsList.EndUpdate; + {$IFDEF WIN32} + UnaccessData(ConnectionInfoArray); + {$ENDIF} + end; +end; + +function TDBToolsService.FindConnectionName(AConnection: TCustomDAConnection): string; +var + i, j: integer; + AConnectionStrList: TStringList; + Str1, Str2, DefStr: string; + + function ToCommonCase(const s: string): string; + var + ts: string; + begin + Result := s; + if FUsedConnectionCompareFlags[j] = cfNormal then begin + ts := Trim(Result); + if (Length(ts) < 2) or (ts[1] <> '"') or (ts[Length(ts)] <> '"') then + Result := UpperCase(Result); + end; + end; + +begin + AConnectionStrList := TStringList.Create; + try + BeginConnectionStrGetting(AConnectionStrList); + DADesignUtils.GetDBToolsConnectionList(AConnection); + i := Length(FUsedConnectionCompareFlags); + SetLength(FUsedConnectionCompareFlags, FDefaultConnectionList.Count); + for j := i to FDefaultConnectionList.Count - 1 do + FUsedConnectionCompareFlags[j] := cfNormal; + for i := 0 to FConnectionsList.Count - 1 do begin + ConnStrToList(FConnectionsList[i], FConnectionStrList); + for j := 0 to FDefaultConnectionList.Count - 1 do begin + if FUsedConnectionCompareFlags[j] = cfNone then + Continue; + + DefStr := FDefaultConnectionList.ValueFromIndex[j]; + Str1 := ToCommonCase(AConnectionStrList.Values[FDefaultConnectionList.Names[j]]); + Str2 := ToCommonCase(FConnectionStrList.Values[FDefaultConnectionList.Names[j]]); + if (Str1 <> Str2) and (DefStr <> '') then begin + if Str1 = '' then + Str1 := ToCommonCase(DefStr); + if Str2 = '' then + Str2 := ToCommonCase(DefStr); + end; + if Str1 <> Str2 then + Break + else + if j = FDefaultConnectionList.Count - 1 then begin + Result := FConnectionStrList.Values[SConnectionName]; + Exit; + end; + end; + end; + Result := ''; + finally + AConnectionStrList.Free; + end; +end; + +function TDBToolsService.GetConnectionStrList(ConnectionName: string): TStringList; +var + i, j, k: integer; + s: string; +begin + Result := FConnectionStrList; + s := GetConnectionValueStr(ConnectionName); + for i := 0 to FConnectionsList.Count - 1 do + if (Length(FConnectionsList[i]) >= Length(s)) and + (Copy(FConnectionsList[i], 1, Length(s)) = s) then begin + ConnStrToList(Copy(FConnectionsList[i], Length(s) + 1, Length(FConnectionsList[i]) - Length(s)), Result); + + for j := 0 to FDefaultConnectionList.Count - 1 do begin + k := Result.IndexOfName(FDefaultConnectionList.Names[j]); + if k < 0 then + Result.Add(FDefaultConnectionList[j]) + else + if Result.ValueFromIndex[k] = '' then + Result[k] := FDefaultConnectionList[j]; + end; + Exit; + end; + Result.Clear; +end; + +procedure TDBToolsService.CheckConnection(const Component: TComponent); +var + Connection: TCustomDAConnection; +begin + Connection := GetConnection(Component); + if Connection = nil then + DatabaseError(SConnectionNotDefined); +end; + +procedure TDBToolsService.FindInDatabaseExplorer; +var + ConnectionString, ObjectType, FullName: TString; +begin + CheckConnection(FCurrentComponent); + if GetConnectionStringObjectTypeAndFullName(FCurrentComponent, ConnectionString, ObjectType, FullName) then + SqlService.FindInDatabaseExplorer(ConnectionString, ObjectType, FullName); +end; + +procedure TDBToolsService.EditDatabaseObject; +var + ConnectionString, ObjectType, FullName: TString; +begin + CheckConnection(FCurrentComponent); + if GetConnectionStringObjectTypeAndFullName(FCurrentComponent, ConnectionString, ObjectType, FullName) then + SqlService.EditDatabaseObject(ConnectionString, ObjectType, FullName); +end; + +procedure TDBToolsService.ExecuteSql(Debug: boolean); +var + SqlSource: TSqlSource; +begin + CheckConnection(FCurrentComponent); + SqlSource := GetSqlSource(FCurrentComponent, FCurrentDesigner); + SqlService.ExecuteSql(SqlSource, Debug); +end; + +procedure TDBToolsService.Compile(Debug: boolean); +var + SqlSource: TSqlSource; +begin + CheckConnection(FCurrentComponent); + SqlSource := GetSqlSource(FCurrentComponent, FCurrentDesigner, SCompilePrefix); + SqlService.ExecuteSql(SqlSource, Debug); +end; + +procedure TDBToolsService.RetrieveData(AsDocument: boolean); +var + SqlSource: TSqlSource; +begin + CheckConnection(FCurrentComponent); + SqlSource := GetSqlSource(FCurrentComponent, FCurrentDesigner); + SqlService.RetrieveData(SqlSource, AsDocument); +end; + +procedure TDBToolsService.EditSql(AsQuery: boolean); +var + SqlSource: TSqlSource; +begin + SqlSource := GetSqlSource(FCurrentComponent, FCurrentDesigner, SEditPrefix); + SqlService.EditSql(SqlSource, AsQuery, SqlSource.FSqlSourceNotifier); + if SqlSource.FSqlSourceNotifier = nil then + DBTools.DesignNotification.SqlSourceList.Delete(SqlSource); +end; + +function TDBToolsService.GetSqlEditor: ISqlEditor; +var + n: integer; +begin + n := Length(FSqlEditors) - 1; + if n >= 0 then begin + Result := FSqlEditors[n]; + SetLength(FSqlEditors, n); + end + else + SqlService.CreateSqlEditor(Result); +end; + +function TDBToolsService.GetSqlSource(Component: TComponent; Designer: IDesigner; SqlTextPrefix: string = ''): TSqlSource; +begin + Assert(DBTools.DesignNotification <> nil); + Result := DBTools.DesignNotification.SqlSourceList.Find(Component, SqlTextPrefix); + if Result = nil then begin + Result := TSqlSource.Create(Self, Component, Designer); + Result.SqlTextPrefix := SqlTextPrefix; + DBTools.DesignNotification.SqlSourceList.Add(Result); + end; +end; + +procedure TDBToolsService.ReturnSqlEditor(ASqlEditor: ISqlEditor); +var + n: integer; +begin + Windows.SetParent(ASqlEditor.Handle{$IFDEF CLR}.ToInt32{$ENDIF}, MAXDWORD - 2{HWND_MESSAGE}); + n := Length(FSqlEditors); + SetLength(FSqlEditors, n + 1); + FSqlEditors[n] := ASqlEditor; +end; + +procedure TDBToolsService.AddParamTypeMap(ADACType: TFieldType; ADBToolsType: integer); +var + n: integer; +begin + n := Length(FParamTypeMaps); + SetLength(FParamTypeMaps, n + 1); + with FParamTypeMaps[n] do begin + DACType := ADACType; + DBToolsType := ADBToolsType; + end; +end; + +{$IFDEF WIN32} +class function TDBToolsService.AccessData(const V: PSafeArray): pointer; +begin + if V = nil then + Result := nil + else + SafeArrayCheck(SafeArrayAccessData(V, Result)); +end; + +class procedure TDBToolsService.UnaccessData(const V: PSafeArray); +begin + if V <> nil then + SafeArrayCheck(SafeArrayUnaccessData(V)); +end; + +class function TDBToolsService.DataHigh(const V: PSafeArray): integer; +begin + if V = nil then + Result := -1 + else + SafeArrayGetUBound(V, 1, Result); +end; +{$ENDIF} + +function TDBToolsService.GetConnectionValueStr(ConnectionName: string): string; +begin + Result := SConnectionName + '=' + ConnectionName + ';'; +end; + +procedure TDBToolsService.ConnStrToList(ConnStr: string; const ConnList: TStrings); +var + ParamName, ParamValue: string; + QuoteChar: char; + Quoted: boolean; + i, l: integer; +begin + ConnStr := Trim(ConnStr); + ConnList.BeginUpdate; + ConnList.Clear; + try + if ConnStr = '' then + Exit; + if ConnStr[Length(ConnStr)] <> ';' then + ConnStr := ConnStr + ';'; + repeat + i := Pos('=', ConnStr); + if i <= 0 then + Break; + ParamName := Copy(ConnStr, 1, i); //with '=' + Inc(i); + QuoteChar := ConnStr[i]; + Quoted := {$IFDEF CLR}AnsiChar{$ENDIF}(QuoteChar) in ['''', '"']; + if Quoted then + Inc(i); + ParamValue := ''; + repeat + if i + Ord(Quoted) > Length(ConnStr) then + raise Exception.Create(SConnStrError); + + if Quoted then + if ConnStr[i] = QuoteChar then + if (ConnStr[i + 1] = QuoteChar) or (ConnStr[i + 1] = ';') then + Inc(i) + else + raise Exception.Create(SConnStrError); + + if ConnStr[i] = ';' then + Break + else + ParamValue := ParamValue + ConnStr[i]; + Inc(i); + until False; + ConnList.Add(ParamName + ParamValue); + l := Length(ConnStr) - i; + if l > 0 then + ConnStr := Copy(ConnStr, i + 1, l) + else + Break; + until False; + finally + ConnList.EndUpdate; + end; +end; + +{ TModuleNotifier} + +constructor TModuleNotifier.Create(const Module : IOTAModule); +begin + inherited Create; + + FModule := Module; +{$IFDEF WIN32} + FIndex := Module.AddNotifier(Self); +{$ELSE} + Include(Module.BeforeSave, BeforeSave); +{$ENDIF} +end; + +procedure TModuleNotifier.RemoveNotifier; +begin +{$IFDEF WIN32} + if Findex >= 0 then + begin + FModule.RemoveNotifier(FIndex); + FIndex := -1; + end; +{$ELSE} + Exclude(FModule.BeforeSave, BeforeSave); +{$ENDIF} + DBTools.DesignNotification.ModuleList.Delete(FModule); +end; + +destructor TModuleNotifier.Destroy; +begin + RemoveNotifier; + + inherited; +end; + +{$IFDEF WIN32} +procedure TModuleNotifier.Destroyed; +begin + RemoveNotifier; + FModule := nil; +end; + +procedure TModuleNotifier.AfterSave; +begin +end; + +procedure TModuleNotifier.BeforeSave; +begin +end; + +procedure TModuleNotifier.Modified; +begin +end; + +function TModuleNotifier.CheckOverwrite: Boolean; +begin + Result := True; +end; + +procedure TModuleNotifier.ModuleRenamed(const NewName: string); +begin +end; + +function TModuleNotifier.AllowSave: Boolean; +begin + if AllowSaveSwitch then + DBTools.DesignerClosing(FModule.FileName); + AllowSaveSwitch := not AllowSaveSwitch; + Result := True; +end; + +function TModuleNotifier.GetOverwriteFileNameCount: Integer; +begin + Result := 0; +end; + +function TModuleNotifier.GetOverwriteFileName(Index: Integer): string; +begin + Result := ''; +end; + +procedure TModuleNotifier.SetSaveFileName(const FileName: string); +begin +end; + +{$ELSE} +procedure TModuleNotifier.BeforeSave(Sender: TObject; e: EventArgs); +begin + DBTools.DesignerClosing(FModule.FileName); +end; +{$ENDIF} + +{ TModuleList } + +function TModuleList.IndexOf(Module: IOTAModule): integer; +var + i: integer; +begin + Result := -1; + for i := 0 to Count - 1 do + if TModuleNotifier(Items[i]).Module = Module then begin + Result := i; + Break; + end; +end; + +procedure TModuleList.Add(Module: IOTAModule); +begin + if IndexOf(Module) < 0 then + inherited Add(TModuleNotifier.Create(Module)); +end; + +procedure TModuleList.Delete(Module: IOTAModule); +var + Index: integer; +begin + Index := IndexOf(Module); + if Index >= 0 then + Delete(Index); +end; + +procedure TModuleList.Delete(Index: integer); +var + ModuleNotifier: TModuleNotifier; +begin + ModuleNotifier := TModuleNotifier(Items[Index]); + inherited Delete(Index); +{$IFDEF WIN32} + ModuleNotifier.Destroyed; +{$ENDIF} +end; + +function GetDBToolsService(DADesignUtilsClass: TDADesignUtilsClass): TDBToolsService; +begin + Result := TDBToolsService(DADesignUtilsClass.DBToolsService); +end; + +initialization + DBTools := TDBTools.Create; + +finalization + DBTools.Free; + +end. \ No newline at end of file diff --git a/internal/4.10.0.10/1/Source/Design/DBToolsClient.res b/internal/4.10.0.10/1/Source/Design/DBToolsClient.res new file mode 100644 index 0000000..54d2e5f Binary files /dev/null and b/internal/4.10.0.10/1/Source/Design/DBToolsClient.res differ diff --git a/internal/4.10.0.10/1/Source/Design/DBToolsIntf.pas b/internal/4.10.0.10/1/Source/Design/DBToolsIntf.pas new file mode 100644 index 0000000..4a90b85 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DBToolsIntf.pas @@ -0,0 +1,131 @@ +{$IFNDEF CLR} +unit DBToolsIntf; +{$ENDIF} +interface + +uses +{$IFDEF CLR} + System.Runtime.InteropServices, + Variants, + CoreLab.DbTools; +{$ELSE} + Windows, ActiveX; +{$ENDIF} + +type +{$IFDEF WIN32} + ParameterType = TOleEnum; +{$ELSE} + TConnectionInfoArray = array of ConnectionInfo; +{$ENDIF} +// Constants for enum ParameterType +const + ParameterType_Input = ParameterType(0); + ParameterType_InputOutput = ParameterType(1); + ParameterType_Output = ParameterType(2); + ParameterType_ReturnValue = ParameterType(3); + + CoreLab_DbTools_InterfacesMajorVersion = 2; + CoreLab_DbTools_InterfacesMinorVersion = 0; + +// *********************************************************************// +// Declaration of structures, unions and aliases. +// *********************************************************************// +{$IFDEF WIN32} +type + ConnectionInfo = packed record + Name: WideString; + ConnectionString: WideString; + end; + + CommandParameterInfo = packed record + Name: PWideChar; + ParameterType: ParameterType; + DataType: Integer; + _slack_space: dword; // Align by 16 bytes + Value: OleVariant; + end; + + TConnectionInfoArray = PSafeArray; + +// *********************************************************************// +// Interface: ISqlEditor +// Flags: (256) OleAutomation +// GUID: {471AE99C-AE21-491B-89E3-A2C717C81CA9} +// Simple interface of the SQL editor. +// *********************************************************************// + ISqlEditor = interface(IUnknown) + ['{471AE99C-AE21-491B-89E3-A2C717C81CA9}'] + function Get_Handle: integer; stdcall; + function Get_text: PWideChar; stdcall; + procedure Set_text(const Param1: PWideChar); stdcall; + function Get_Modified: LongBool; stdcall; + procedure Set_Modified(Param1: LongBool); stdcall; + function Get_ReadOnly: LongBool; stdcall; + procedure Set_ReadOnly(Param1: LongBool); stdcall; + + procedure SetConnection(const ConnectionString: WideString); stdcall; + property Modified: LongBool read Get_Modified write Set_Modified; + property Handle: integer read Get_Handle; + property ReadOnly: LongBool read Get_ReadOnly write Set_ReadOnly; + property Text: PWideChar read Get_text write Set_text; + end; + +// *********************************************************************// +// Interface: ISqlSource +// Flags: (256) OleAutomation +// GUID: {471AE99C-AE21-491B-89E3-A2C717C81CA8} +// Describes any component with editable SQL query on the designer. A 'Command' for example. +// *********************************************************************// + ISqlSource = interface(IUnknown) + ['{471AE99C-AE21-491B-89E3-A2C717C81CA8}'] + function Get_Name: PWideChar; stdcall; + function Get_ConnectionString: PWideChar; stdcall; + function Get_DesignerName: PWideChar; stdcall; + function Get_ParameterCount: Integer; stdcall; + procedure Set_ParameterCount(const Param1: Integer); stdcall; + function Get_Sql: PWideChar; stdcall; + procedure Set_Sql(const Param1: PWideChar); stdcall; + procedure Close; stdcall; + procedure GetParameter(const index: Integer; out Info: CommandParameterInfo); stdcall; + procedure SetParameter(const index: Integer; Info: CommandParameterInfo); stdcall; + end; + +// *********************************************************************// +// Interface: ISqlSourceNotifier +// Flags: (256) OleAutomation +// GUID: {D4858B82-70FB-4E30-8BE5-30CF625A37E2} +// Feedback interface for the SQL service. Allows to notify about any componet changings. +// *********************************************************************// + ISqlSourceNotifier = interface(IUnknown) + ['{D4858B82-70FB-4E30-8BE5-30CF625A37E2}'] + procedure OnSqlSourceChanged; stdcall; + procedure OnSqlSourceDeleted; stdcall; + procedure OnSqlSourceRenamed(const prevName: WideString); stdcall; + end; + +// *********************************************************************// +// Interface: IDbToolsService +// Flags: (256) OleAutomation +// GUID: {7FB8EF3F-AB68-48D1-9DD5-F85C05DF4A90} +// An interface of the service, that provides basics functionalities of editing or executing an SQL query. +// *********************************************************************// + IDbToolsService = interface(IUnknown) + ['{7FB8EF3F-AB68-48D1-9DD5-F85C05DF4A90}'] + procedure CreateSqlEditor(out editor: ISqlEditor); stdcall; + procedure DesignerClosing(const DesignerName: WideString); stdcall; + procedure EditDatabaseObject(const ConnectionString: WideString; const objectType: WideString; + const fullName: WideString); stdcall; + procedure EditSql(const sqlSource: ISqlSource; asQuery: LongBool; + out notifier: ISqlSourceNotifier); stdcall; + procedure ExecuteSql(const sqlSource: ISqlSource; debug: LongBool); stdcall; + procedure FindInDatabaseExplorer(const ConnectionString: WideString; + const objectType: WideString; const fullName: WideString); stdcall; + function GetConnections: PSafeArray; stdcall; + procedure RetrieveData(const sqlSource: ISqlSource; asDocument: LongBool); stdcall; + end; +{$ENDIF} + +implementation + +end. diff --git a/internal/4.10.0.10/1/Source/Design/DacReg.pas b/internal/4.10.0.10/1/Source/Design/DacReg.pas new file mode 100644 index 0000000..ecb3745 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/DacReg.pas @@ -0,0 +1,48 @@ +{$IFNDEF CLR} +{$I Dac.inc} + +unit DacReg; +{$ENDIF} + +interface + +procedure Register; +procedure RegisterCRBatchMove; + +implementation + +{$IFNDEF CLR} + {$IFDEF VER9} + {$R DADesign9.res} + {$ELSE} + {$R DADesign.res} + {$ENDIF} + {$IFDEF VER10P} + {$R DADesign10p.res} + {$ENDIF} +{$ELSE} + {$R DADesign.res} +{$ENDIF} + +uses + Classes, CRBatchMove, VirtualTable; + +var + CRBatchMoveRegistered: boolean; + +procedure Register; +begin + RegisterComponents('Data Access', [TVirtualTable]); +end; + +procedure RegisterCRBatchMove; +begin + if not CRBatchMoveRegistered then begin + RegisterComponents('Data Access', [TCRBatchMove]); + CRBatchMoveRegistered := True; + end; +end; + +initialization + CRBatchMoveRegistered := False; +end. diff --git a/internal/4.10.0.10/1/Source/Design/Download.dfm b/internal/4.10.0.10/1/Source/Design/Download.dfm new file mode 100644 index 0000000..e4d6d50 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/Download.dfm @@ -0,0 +1,137 @@ +object DownloadForm: TDownloadForm + Left = 306 + Top = 112 + BorderIcons = [biSystemMenu] + BorderStyle = bsDialog + Caption = 'DownloadForm' + ClientHeight = 126 + ClientWidth = 347 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + OnMouseMove = FormMouseMove + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 13 + object lblText3Wrap: TLabel + Left = 52 + Top = 29 + Width = 284 + Height = 39 + AutoSize = False + Caption = 'lblText3Wrap' + Visible = False + WordWrap = True + end + object lblQuestion: TLabel + Left = 52 + Top = 48 + Width = 292 + Height = 26 + Anchors = [akLeft, akBottom] + AutoSize = False + Caption = 'lblQuestion' + WordWrap = True + end + object Bevel1: TBevel + Left = 5 + Top = 80 + Width = 337 + Height = 9 + Anchors = [akLeft, akBottom] + Shape = bsTopLine + end + object Image: TImage + Left = 8 + Top = 16 + Width = 32 + Height = 32 + AutoSize = True + Transparent = True + end + object lblProduct: TLabel + Left = 136 + Top = 16 + Width = 47 + Height = 13 + Cursor = crHandPoint + Caption = 'lblProduct' + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlue + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsUnderline] + ParentFont = False + OnClick = lblProductClick + OnMouseMove = lblProductMouseMove + end + object lblText2: TLabel + Left = 192 + Top = 16 + Width = 38 + Height = 13 + Caption = 'lblText2' + end + object lblText1: TLabel + Left = 52 + Top = 16 + Width = 38 + Height = 13 + Caption = 'lblText1' + end + object lblText3: TLabel + Left = 52 + Top = 29 + Width = 38 + Height = 13 + Caption = 'lblText3' + end + object OKBtn: TButton + Left = 137 + Top = 92 + Width = 65 + Height = 25 + Anchors = [akLeft, akBottom] + Caption = '&Download' + Default = True + ModalResult = 6 + TabOrder = 1 + OnClick = OKBtnClick + end + object CancelBtn: TButton + Left = 205 + Top = 92 + Width = 65 + Height = 25 + Anchors = [akLeft, akBottom] + Cancel = True + Caption = '&Close' + ModalResult = 7 + TabOrder = 2 + end + object chkDontAsk: TCheckBox + Left = 8 + Top = 96 + Width = 113 + Height = 17 + Anchors = [akLeft, akBottom] + Caption = 'Don'#39't &ask me again' + TabOrder = 0 + end + object btHelp: TButton + Left = 273 + Top = 92 + Width = 65 + Height = 25 + Anchors = [akLeft, akBottom] + Cancel = True + Caption = '&Help' + TabOrder = 3 + OnClick = btHelpClick + end +end diff --git a/internal/4.10.0.10/1/Source/Design/Download.pas b/internal/4.10.0.10/1/Source/Design/Download.pas new file mode 100644 index 0000000..a93c6f8 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/Download.pas @@ -0,0 +1,277 @@ +{$IFNDEF CLR} + +{$I Dac.inc} + +unit Download; +{$ENDIF} +interface + +uses + Windows, SysUtils, Classes, Graphics, Forms, Controls, StdCtrls, + Buttons, ExtCtrls, Registry; + +type + TDownloadForm = class(TForm) + OKBtn: TButton; + CancelBtn: TButton; + Bevel1: TBevel; + chkDontAsk: TCheckBox; + Image: TImage; + lblQuestion: TLabel; + btHelp: TButton; + lblText1: TLabel; + lblText3: TLabel; + lblProduct: TLabel; + lblText2: TLabel; + lblText3Wrap: TLabel; + procedure FormShow(Sender: TObject); + procedure OKBtnClick(Sender: TObject); + procedure btHelpClick(Sender: TObject); + procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X, + Y: Integer); + procedure lblProductMouseMove(Sender: TObject; Shift: TShiftState; X, + Y: Integer); + procedure lblProductClick(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + end; + +procedure SetToolsCheckingParams(const ADialogCaptionStr, AToolsNameStr, + AProjectVersionStr, AAskIncompatibleStr, AAskNoAddinStr, ARegKeyStr, + AHelpProjectStr, AHelpTopicStr, AUrlStr, AUrlExeStr, AAtomName: string; + const ADeveloperProjectNameStr: string = ''); +function NoCheckForTools(Incompatible: boolean; ARegIniFile: TRegIniFile = nil): boolean; +procedure CheckForTools(Incompatible: boolean); +function DownloadTools(ProVersion: boolean): boolean; + +implementation + +uses + ShellApi, DacVcl, HelpUtils; + +{$IFDEF IDE} +{$R *.dfm} +{$ENDIF} +{$IFNDEF LINUX} +{$R Download.dfm} +{$ENDIF} + +resourcestring + sToolsWrongVersion1 = 'Current version of '; + sToolsWrongVersion2 = ' is incompatible with'; + sNoTools1 = 'You don''t have '; + sNoTools2 = ' installed.'; + sToolsDownloadQuestion = 'Do you wish to download the latest %s version?'; + + sDeveloperEdition1 = 'If you have '; + sDeveloperEdition2 = ', you can'; + sDeveloperEdition3 = 'download full version of %s. ' + + 'Please consult your order confirmation email for more information.'; + sDeveloperEditionQuestion = 'Do you wish download a trial version of %s?'; + +var + DialogCaptionStr, + ToolsNameStr, + ProjectVersionStr, + AskIncompatibleStr, + AskNoAddinStr, + + RegKeyStr, + HelpProjectStr, + HelpTopicStr, + UrlStr, + UrlExeStr, + AtomName, + DeveloperProjectNameStr: string; + + AddedAtoms: array of ATOM; + +procedure SetToolsCheckingParams(const ADialogCaptionStr, AToolsNameStr, + AProjectVersionStr, AAskIncompatibleStr, AAskNoAddinStr, ARegKeyStr, + AHelpProjectStr, AHelpTopicStr, AUrlStr, AUrlExeStr, AAtomName: string; + const ADeveloperProjectNameStr: string = ''); +begin + DialogCaptionStr := ADialogCaptionStr; + ToolsNameStr := AToolsNameStr; + ProjectVersionStr := AProjectVersionStr; + AskIncompatibleStr := AAskIncompatibleStr; + AskNoAddinStr := AAskNoAddinStr; + RegKeyStr := ARegKeyStr; + HelpProjectStr := AHelpProjectStr; + HelpTopicStr := AHelpTopicStr; + UrlStr := AUrlStr; + UrlExeStr := 'http://' + AUrlStr + '/' + AUrlExeStr; + AtomName := AAtomName; + DeveloperProjectNameStr := ADeveloperProjectNameStr; +end; + +function NoCheckForTools(Incompatible: boolean; ARegIniFile: TRegIniFile = nil): boolean; +var + RegIniFile: TRegIniFile; +begin + if ARegIniFile = nil then + RegIniFile := TRegIniFile.Create(RegKeyStr) + else + RegIniFile := ARegIniFile; + if Incompatible then + Result := not RegIniFile.ReadBool('', AskIncompatibleStr, True) + else + Result := not RegIniFile.ReadBool('', AskNoAddinStr, True); + if ARegIniFile = nil then + RegIniFile.Free; +end; + +procedure CheckForTools(Incompatible: boolean); +var + RegIniFile: TRegIniFile; +begin + RegIniFile := TRegIniFile.Create(RegKeyStr); + with TDownloadForm.Create(Application) do + try + try + if AtomName <> '' then + if FindAtom({$IFDEF WIN32}PChar(AtomName){$ELSE}AtomName{$ENDIF}) = 0 then begin + SetLength(AddedAtoms, Length(AddedAtoms) + 1); + AddedAtoms[High(AddedAtoms)] := AddAtom({$IFDEF WIN32}PChar(AtomName){$ELSE}AtomName{$ENDIF}); + end + else + Exit; + if not NoCheckForTools(Incompatible, RegIniFile) then begin + if Incompatible then begin + lblText1.Caption := sToolsWrongVersion1; + lblText2.Caption := sToolsWrongVersion2; + lblText3.Caption := ProjectVersionStr + '.'; + end + else begin + lblText1.Caption := sNoTools1; + lblText2.Caption := sNoTools2; + lblText3.Caption := ''; + end; + lblProduct.Left := lblText1.Left + lblText1.Width; + lblProduct.Caption := ToolsNameStr; + if lblProduct.Left + lblProduct.Width + lblText2.Width > ClientWidth - 8 then begin + lblText2.Caption := Trim(lblText2.Caption) + ' '; + lblText2.Top := lblText1.Top + 13; + lblText2.Left := lblText1.Left; + lblText3.Left := lblText2.Left + lblText2.Width; + end + else begin + lblText2.Top := lblText1.Top; + lblText2.Left := lblProduct.Left + lblProduct.Width; + lblText3.Left := lblText1.Left; + end; + lblQuestion.Caption := Format(sToolsDownloadQuestion, [ToolsNameStr]); + ShowModal; + if Incompatible then + RegIniFile.WriteBool('', AskIncompatibleStr, not chkDontAsk.Checked) + else + RegIniFile.WriteBool('', AskNoAddinStr, not chkDontAsk.Checked); + end; + finally + Free; + RegIniFile.Free; + end; + except + on E: Exception do + MessageBox(0, {$IFDEF WIN32}PChar(E.Message){$ELSE}E.Message{$ENDIF}, + 'Add-in ñheck error!', 0); + end; +end; + +function DownloadTools(ProVersion: boolean): boolean; +begin + if ProVersion then + with TDownloadForm.Create(Application) do + try + chkDontAsk.Visible := False; + Result := ShowModal = mrYes; + finally + Free; + end + else begin + Result := True; + OpenUrl(UrlExeStr); + end; +end; + +procedure TDownloadForm.FormShow(Sender: TObject); +begin + Caption := DialogCaptionStr; + Image.Picture.Icon.Handle := LoadIcon(0, IDI_QUESTION); + if (DeveloperProjectNameStr = '') or not chkDontAsk.Visible then + OKBtn.ModalResult := mrYes + else + OKBtn.ModalResult := mrNone; + if not chkDontAsk.Visible then begin + lblText3.Visible := False; + lblText3Wrap.Visible := True; + lblProduct.ParentFont := True; + lblProduct.Font.Style := [fsBold]; + Height := Height + 26; + lblText1.Caption := sDeveloperEdition1; + lblProduct.Cursor := crDefault; + lblProduct.Left := lblText1.Left + lblText1.Width; + lblProduct.Caption := DeveloperProjectNameStr; + lblText2.Caption := sDeveloperEdition2; + lblText2.Left := lblProduct.Left + lblProduct.Width; + lblText3Wrap.Caption := Format(sDeveloperEdition3, [ToolsNameStr]); + lblQuestion.Caption := Format(sDeveloperEditionQuestion, [ToolsNameStr]); + end; +end; + +procedure TDownloadForm.OKBtnClick(Sender: TObject); +begin + if OKBtn.ModalResult = mrYes then + OpenUrl(UrlExeStr) + else + if DownloadTools(True) then + Close; +end; + +procedure TDownloadForm.btHelpClick(Sender: TObject); +begin + if HelpTopicStr <> '' then + {$IFDEF VER8P} + ShowHelp('ms-help://CoreLab.' + HelpProjectStr, Format('ms-help://CoreLab.%s/%s/%s.htm', [HelpProjectStr, HelpProjectStr, HelpTopicStr])); + {$ELSE} + ShowHelp(GetHelpFileName(HelpProjectStr), HelpTopicStr); + {$ENDIF} +end; + +procedure TDownloadForm.FormMouseMove(Sender: TObject; Shift: TShiftState; + X, Y: Integer); +begin + if chkDontAsk.Visible then + lblProduct.Font.Color := $FF0000; +end; + +procedure TDownloadForm.lblProductMouseMove(Sender: TObject; + Shift: TShiftState; X, Y: Integer); +begin + if chkDontAsk.Visible then + lblProduct.Font.Color := $4080FF; +end; + +procedure TDownloadForm.lblProductClick(Sender: TObject); +begin + if chkDontAsk.Visible then begin + OpenUrl('http://' + UrlStr); + lblProduct.Font.Color := $FF0000; + end; +end; + +procedure DeleteAddedAtoms; +var + i: integer; +begin + for i := 0 to High(AddedAtoms) do + DeleteAtom(AddedAtoms[i]); +end; + +initialization + +finalization + DeleteAddedAtoms; +end. diff --git a/internal/4.10.0.10/1/Source/Design/HelpUtils.pas b/internal/4.10.0.10/1/Source/Design/HelpUtils.pas new file mode 100644 index 0000000..1c43400 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/HelpUtils.pas @@ -0,0 +1,140 @@ +{$IFNDEF CLR} + +{$I Dac.inc} + +unit HelpUtils; +{$ENDIF} + +interface +{$IFDEF MSWINDOWS} +uses +{$IFDEF VER8P} + Dialogs, +{$ELSE} + Forms, +{$ENDIF} + SysUtils; +{$ENDIF} + + procedure ShowHelp(HelpFile, JumpID: string); + procedure OpenUrl(Url: string); + procedure MailTo(Address: string); + +implementation + +{$IFDEF MSWINDOWS} +uses +{$IFDEF VER8P} +{$IFDEF CLR} + System.ComponentModel.Design, + Borland.Studio.ToolsAPI, + Borland.Vcl.HelpIntfs, +{$ELSE} + HelpIntfs, +{$ENDIF} +{$ENDIF} + Registry, ShellAPI, ShlObj, Windows; +{$ENDIF} + +{$IFDEF VER8P} +type + IApiHelpSystem = {$IFDEF CLR}IHelpService{$ELSE}IHelpSystem{$ENDIF}; +{$ENDIF} + +procedure ShowHelp(HelpFile, JumpID: string); +{$IFDEF MSWINDOWS} +var +{$IFDEF VER8P} + HelpSystem: IApiHelpSystem; +{$ELSE} + OldFile: string; +{$ENDIF} +{$ENDIF} +begin +{$IFDEF MSWINDOWS} +{$IFDEF VER8P} +{$IFDEF CLR} + HelpSystem := BorlandIDE.GetService(typeof(IHelpService)) as IHelpService; +{$ELSE} + GetHelpSystem(HelpSystem); +{$ENDIF} + if Assigned(HelpSystem) then +{$IFDEF CLR} + try + HelpSystem.ShowHelpFromUrl(JumpID) + except on E: Exception do +{$IFNDEF VER9} + MessageDlg(e.Message, mtError, [mbOk], 0); +{$ENDIF} + end +{$ELSE} + HelpSystem.ShowTopicHelp(JumpID, HelpFile) +{$ENDIF} + else + MessageDlg('Failed to use IDE HelpSystem', mtError, [mbOk], 0); +{$ELSE} + OldFile := Application.HelpFile; + try + Application.HelpFile := HelpFile; + Application.HelpJump(JumpID); + finally + Application.HelpFile := OldFile; + end; +{$ENDIF} +{$ENDIF} +end; + +procedure OpenUrl(Url: string); +{$IFDEF MSWINDOWS} +var + htmlDescription: string; + shellcommand: string; + i: integer; + Path: {$IFDEF WIN32}array[0..MAX_PATH] of char{$ELSE}string{$ENDIF}; + Filename: string; +{$ENDIF} +begin +{$IFDEF MSWINDOWS} + Filename := ''; + with TRegistry.Create do begin + RootKey := HKEY_CLASSES_ROOT; + if OpenKey('.htm', False) and KeyExists('') then begin + htmlDescription := ReadString(''); + CloseKey; + if OpenKey(htmlDescription + '\shell\open\Command', False) and KeyExists('') then begin + shellcommand := ReadString(''); + for i := Length(shellcommand) downto 1 do + if shellcommand[i] = ' ' then begin + FileName := Copy(shellcommand, 2, i - 3); + if not FileExists(Filename) then + Filename := ''; + break; + end; + end; + end; + end; + if Filename = '' then begin + {$IFDEF WIN32} + SHGetSpecialFolderPath(0, Path, $26{CSIDL_PROGRAM_FILES}, False); + {$ELSE} + Path := Environment.GetFolderPath(System.Environment.SpecialFolder.ProgramFiles); + {$ENDIF} + FileName := Path + '\Internet Explorer\iexplore.exe'; + end; +{$IFDEF WIN32} + ShellExecute(0, 'open', PChar(Filename), PChar(Url), '', SW_SHOW); +{$ELSE} + ShellExecute(0, 'open', Filename, Url, '', SW_SHOW); +{$ENDIF} +{$ENDIF} +end; + +procedure MailTo(Address: string); +begin +{$IFDEF MSWINDOWS} + ShellExecute(0, 'open', {$IFDEF WIN32}PChar('mailto:' + Address){$ELSE}'mailto:' + Address{$ENDIF}, + '', '', SW_SHOW); +{$ENDIF} +end; + +end. diff --git a/internal/4.10.0.10/1/Source/Design/MSConnectionEditor.dfm b/internal/4.10.0.10/1/Source/Design/MSConnectionEditor.dfm new file mode 100644 index 0000000..bafe9af --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/MSConnectionEditor.dfm @@ -0,0 +1,76 @@ +inherited MSConnectionEditorForm: TMSConnectionEditorForm + Caption = 'MSConnectionEditorForm' + PixelsPerInch = 96 + TextHeight = 13 + inherited PageControl: TPageControl + inherited shConnect: TTabSheet + inherited Panel: TPanel + object lbDatabase: TLabel [3] + Left = 16 + Top = 118 + Width = 46 + Height = 13 + Caption = 'Database' + end + object edDatabase: TComboBox + Left = 104 + Top = 114 + Width = 153 + Height = 21 + ItemHeight = 13 + TabOrder = 3 + OnChange = edDatabaseChange + OnDropDown = edDatabaseDropDown + OnExit = edDatabaseExit + OnKeyUp = edDatabaseKeyUp + end + end + object rgAuth: TRadioGroup + Left = 296 + Top = 32 + Width = 121 + Height = 65 + Caption = 'Authentication' + Items.Strings = ( + 'Windows' + 'SQL Server') + TabOrder = 4 + OnClick = rgAuthClick + end + end + inherited shAbout: TTabSheet + inherited Label1: TLabel + Width = 351 + Caption = 'SQL Server Data Access Components' + end + inherited lbWeb: TLabel + Width = 101 + Caption = 'www.crlab.com/sdac' + end + inherited lbMail: TLabel + Width = 80 + Caption = 'sdac@crlab.com' + end + end + end + object btQueryAnalyzer: TButton + Left = 8 + Top = 249 + Width = 99 + Height = 25 + Anchors = [akLeft, akBottom] + Caption = 'Query Analyzer' + TabOrder = 3 + OnClick = btQueryAnalyzerClick + end + object btManagementStudio: TButton + Left = 112 + Top = 249 + Width = 99 + Height = 25 + Anchors = [akLeft, akBottom] + Caption = 'Management Studio' + TabOrder = 4 + OnClick = btManagementStudioClick + end +end diff --git a/internal/4.10.0.10/1/Source/Design/MSConnectionEditor.pas b/internal/4.10.0.10/1/Source/Design/MSConnectionEditor.pas new file mode 100644 index 0000000..3c15a8e --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/MSConnectionEditor.pas @@ -0,0 +1,459 @@ +////////////////////////////////////////////////// +// SQL Server Data Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +// MSConnection Editor +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I SDac.inc} + +unit MSConnectionEditor; +{$ENDIF} + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, + Dialogs, StdCtrls, Mask, ExtCtrls, ComCtrls, Buttons, + DAConnectionEditor, MSAccess, OLEDBAccess; + +const + WM_SETDATABASETEXT = WM_USER + 1; + +type + TMSConnectionEditorForm = class(TDAConnectionEditorForm) + lbDatabase: TLabel; + edDatabase: TComboBox; + rgAuth: TRadioGroup; + btQueryAnalyzer: TButton; + btManagementStudio: TButton; + procedure edDatabaseDropDown(Sender: TObject); + procedure rgAuthClick(Sender: TObject); + procedure btQueryAnalyzerClick(Sender: TObject); + procedure edDatabaseExit(Sender: TObject); + procedure edDatabaseKeyUp(Sender: TObject; var Key: Word; + Shift: TShiftState); + procedure edDatabaseChange(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); + procedure btManagementStudioClick(Sender: TObject); + procedure edServerDropDown(Sender: TObject); override; + private + FDataBaseText: string; + FCurrItemIndex: Integer; + FListGot: boolean; + procedure WMSetDataBaseText(var Message: TMessage); message WM_SETDATABASETEXT; + protected + function GetConnection: TMSConnection; + procedure SetConnection(Value: TMSConnection); + + procedure DoInit; override; + procedure FillInfo; override; + + procedure ConnToControls; override; + + procedure AddServerToList; override; + + procedure GetServerList(List: TStrings); override; + procedure GetDatabaseList(List: TStrings); + function IsValidKeyValue(Value: string; Name: string): boolean; + public + property Connection: TMSConnection read GetConnection write SetConnection; + end; + +implementation + +{$IFDEF IDE} +{$R *.dfm} +{$ENDIF} +{$IFDEF MSWINDOWS} +{$R MSConnectionEditor.dfm} +{$ENDIF} + +uses + DacVcl{$IFDEF SDAC}, MSDesign{$ENDIF}, Registry; + +{ TMSConnectionEditorForm } + +function TMSConnectionEditorForm.GetConnection: TMSConnection; +begin + Result := FConnection as TMSConnection; +end; + +procedure TMSConnectionEditorForm.SetConnection(Value: TMSConnection); +begin + FConnection := Value; +end; + +procedure TMSConnectionEditorForm.DoInit; +begin + inherited; + + FInDoInit := True; + try + lbVersion.Caption := SDACVersion; + {$IFDEF SDAC} + btQueryAnalyzer.Visible := IsServerToolInstalled(stQueryAnalyser) and (Connection.Options.Provider <> prCompact); + btManagementStudio.Visible := IsServerToolInstalled(stManagementStudio) and (Connection.Options.Provider <> prCompact); + {$ENDIF} + FCurrItemIndex := -1; + if Connection.Options.Provider = prCompact then begin + cbLoginPrompt.Enabled := False; + rgAuth.Enabled := False; + lbUsername.Enabled := False; + edUserName.Enabled := False; + lbServer.Enabled := False; + edServer.Enabled := False; + end; + FListGot := False; + finally + FInDoInit := False; + end; +end; + +procedure TMSConnectionEditorForm.FillInfo; +var + OldLoginPrompt: boolean; + OldConnectionTimeout: integer; + OLEDBConnection: TOLEDBConnection; + St: string; +begin + OldLoginPrompt := Connection.LoginPrompt; + OldConnectionTimeout := Connection.ConnectionTimeout; + try + Connection.LoginPrompt := False; + if not Connection.Connected then + try + ShowState(True); + Connection.ConnectionTimeout := 1; + Connection.Connect; + except + on E: Exception do + begin + //Application.ShowException(E); - silent exception. Please see CR MyDAC 3443 + end; + end; + meInfo.Lines.Clear; + OLEDBConnection := TMSAccessUtils.FIConnection(Connection); + if OLEDBConnection <> nil then + begin + if Connection.Connected then begin + St := OLEDBConnection.DBMSName + ': ' + OLEDBConnection.DBMSVer; + if st <> ':' then + meInfo.Lines.Add(St); + end; + St := OLEDBConnection.ProviderFriendlyName + ': ' + OLEDBConnection.ProviderVer; + if St <> ': ' then + meInfo.Lines.Add(St); + end; + finally + Connection.LoginPrompt := OldLoginPrompt; + Connection.ConnectionTimeout := OldConnectionTimeout; + ShowState(False); + end; +end; + +procedure TMSConnectionEditorForm.ConnToControls; +begin + inherited; + + edDatabase.Text := Connection.Database; + rgAuth.ItemIndex := Ord(Connection.Authentication); +end; + +procedure TMSConnectionEditorForm.edServerDropDown(Sender: TObject); +begin + if FListGot then + Exit; + + FListGot := True; + + inherited; +end; + +procedure TMSConnectionEditorForm.GetServerList(List: TStrings); +begin + MSAccess.GetServerList(List); +end; + +procedure TMSConnectionEditorForm.AddServerToList; +var + ConnectKey: string; + ValueNames, Values: TStringList; + i: integer; + s: string; +begin + if Connection.Options.Provider = prCompact then begin + if FRegistry <> nil then begin + ValueNames := nil; + Values := nil; + ConnectKey := FRegistry.CurrentPath; + try + ValueNames := TStringList.Create; + Values := TStringList.Create; + + Values.Add(Connection.Database); // Add current database at first position + + FRegistry.CloseKey; + FRegistry.OpenKey(ConnectKey + '\Everywhere', True); + + FRegistry.GetValueNames(ValueNames); + ValueNames.Sort; + + for i := 0 to ValueNames.Count - 1 do begin + s := Trim(FRegistry.ReadString(ValueNames[i])); + if (s <> '') and (Values.IndexOf(s) = -1) then + Values.Add(s); + FRegistry.DeleteValue(ValueNames[i]); // Clear old list + end; + + // Store updated list in registry + for i := 0 to Values.Count - 1 do begin + s := Format('Database %d', [i]); + FRegistry.WriteString(s, Values[i]); + end; + + finally + ValueNames.Free; + Values.Free; + end; + end; + end + else + inherited; +end; + +procedure TMSConnectionEditorForm.GetDatabaseList(List: TStrings); +var + ConnectKey: string; + ValueNames, Values: TStringList; + i: integer; +begin + List.Clear; + if FRegistry <> nil then begin + ValueNames := nil; + Values := nil; + try + ValueNames := TStringList.Create; + Values := TStringList.Create; + ConnectKey := FRegistry.CurrentPath; + try + FRegistry.CloseKey; + if FRegistry.OpenKey(ConnectKey + '\Everywhere', False) then begin + FRegistry.GetValueNames(ValueNames); + ValueNames.Sort; + for i := 0 to ValueNames.Count - 1 do + if IsValidKeyValue(ValueNames[i], 'Database') then + List.Add(FRegistry.ReadString(ValueNames[i])); + end; + finally + FRegistry.CloseKey; + FRegistry.OpenKey(ConnectKey, False); + end; + finally + ValueNames.Free; + Values.Free; + end; + end; + List.Add(''); +end; + +function TMSConnectionEditorForm.IsValidKeyValue(Value: string; Name: string): boolean; +var + p: integer; +begin + p := Pos(AnsiUpperCase(Name), AnsiUpperCase(Value)); + if p <> 0 then begin + Inc(p, Length(Name) - 1); + if p < Length(Value) then + Inc(p); + while (Byte(Value[p]) in [$30..$30+9, $20]) and (p <> Length(Value)) do + Inc(p); + Result := p = Length(Value); + end + else + Result := False; +end; + +procedure TMSConnectionEditorForm.edDatabaseDropDown(Sender: TObject); +var + List: TStringList; + OldLoginPrompt: Boolean; +begin + StartWait; + try + if Connection.Options.Provider = prCompact then begin + GetDatabaseList(edDatabase.Items); + if edDatabase.Items.Count < 20 then + edDatabase.DropDownCount := edDatabase.Items.Count + else + edDatabase.DropDownCount := 20; + end + else begin + edDatabase.Items.Clear; + OldLoginPrompt := Connection.LoginPrompt; + List := TStringList.Create; + try + Connection.LoginPrompt := False; + MSAccess.GetDatabasesList(Connection, List); + List.Sort; + edDatabase.Items.Assign(List); + if edDatabase.Items.Count < 20 then + edDatabase.DropDownCount := edDatabase.Items.Count + else + edDatabase.DropDownCount := 20; + finally + edDatabase.Text := Connection.Database; + List.Free; + Connection.LoginPrompt := OldLoginPrompt; + end; + end; + finally + StopWait; + end; +end; + +procedure TMSConnectionEditorForm.rgAuthClick(Sender: TObject); +begin + try + Connection.Authentication := TMSAuthentication(rgAuth.ItemIndex); + + case Connection.Authentication of + auWindows: + begin + edUsername.Enabled := False; + edPassword.Enabled := False; + lbUsername.Enabled := False; + lbPassword.Enabled := False; + cbLoginPrompt.Enabled := False; + end; + auServer: + begin + edUsername.Enabled := True; + edPassword.Enabled := True; + lbUsername.Enabled := True; + lbPassword.Enabled := True; + cbLoginPrompt.Enabled := True; + end; + end; + finally + ShowState; + end; +end; + +procedure TMSConnectionEditorForm.btQueryAnalyzerClick(Sender: TObject); +begin + SaveControlData; +{$IFDEF SDAC} + RunServerTool(stQueryAnalyser, Connection); +{$ENDIF} +end; + +procedure TMSConnectionEditorForm.btManagementStudioClick(Sender: TObject); +begin + SaveControlData; +{$IFDEF SDAC} + RunServerTool(stManagementStudio, Connection); +{$ENDIF} +end; + +procedure TMSConnectionEditorForm.edDatabaseExit(Sender: TObject); +begin + if FInDoInit then + Exit; + + try + Connection.Database := edDatabase.Text; + finally + ShowState; + end; +end; + +procedure TMSConnectionEditorForm.edDatabaseKeyUp(Sender: TObject; + var Key: Word; Shift: TShiftState); +begin + if Key ={$IFDEF MSWINDOWS}VK_RETURN{$ELSE}KEY_RETURN{$ENDIF} then + edDatabaseExit(Sender); +end; + +procedure TMSConnectionEditorForm.edDatabaseChange(Sender: TObject); +var + Dialog: TOpenDialog; + OldConnected: boolean; +begin + if FInDoInit then + Exit; + + if Connection.Options.Provider <> prCompact then + Exit; + + try + if edDatabase.Text = '' then begin + Dialog := nil; + try + Dialog := TOpenDialog.Create(nil); + {$IFDEF LINUX} + Dialog.Filter := 'All Files (*)|*'; + {$ELSE} + Dialog.Filter := 'SQL Server Database Files (*.sdf)|*.sdf|All Files (*.*)|*.*'; + {$ENDIF} + Dialog.Options := Dialog.Options + [ofPathMustExist]; + if Dialog.Execute then begin + Connection.Connected := False; + FDataBaseText := Dialog.FileName; + {$IFDEF MSWINDOWS} + PostMessage(Handle, WM_SETDATABASETEXT, 0, 0); + {$ENDIF} + end + else + edDatabase.ItemIndex := FCurrItemIndex; + finally + Dialog.Free; + end; + end + else + FCurrItemIndex := edDatabase.Items.IndexOf(edDatabase.Text); + OldConnected := Connection.Connected; + try + Connection.Connected := False; + Connection.Database := edDatabase.Text; + finally + Connection.Connected := OldConnected; + end; + finally + ShowState; + end; +end; + +procedure TMSConnectionEditorForm.WMSetDataBaseText(var Message: TMessage); +var + OldConnected: boolean; +begin + edDatabase.SetFocus; + edDatabase.Text := FDataBaseText; + OldConnected := Connection.Connected; + try + Connection.Connected := False; + Connection.Database := edDatabase.Text; + finally + Connection.Connected := OldConnected; + end; + edDatabase.SelectAll; +end; + +procedure TMSConnectionEditorForm.FormShow(Sender: TObject); +begin + inherited; + TMSAccessUtils.SetLockLoginPromt(Connection, True); +end; + +procedure TMSConnectionEditorForm.FormCloseQuery(Sender: TObject; + var CanClose: Boolean); +begin + inherited; + if CanClose then + TMSAccessUtils.SetLockLoginPromt(Connection, False); +end; + +end. diff --git a/internal/4.10.0.10/1/Source/Design/MSDesign.pas b/internal/4.10.0.10/1/Source/Design/MSDesign.pas new file mode 100644 index 0000000..1a13b3e --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/MSDesign.pas @@ -0,0 +1,1098 @@ +////////////////////////////////////////////////// +// SQL Server Data Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +// SDAC Design +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I Sdac.inc} + +unit MSDesign; +{$ENDIF} + +interface + +uses +{$IFDEF MSWINDOWS} + Windows, Messages, Graphics, Controls, Forms, Dialogs, + Registry, StdCtrls, +{$IFDEF CLR} + Borland.Vcl.Design.DesignEditors, Borland.Vcl.Design.DesignIntf, + Borland.Vcl.Design.FldLinks, +{$ELSE} + {$IFDEF VER6P}DesignIntf, DesignEditors,{$ELSE}DsgnIntf,{$ENDIF} + {$IFNDEF BCB}{$IFDEF VER5P}FldLinks,{$ENDIF} ColnEdit,{$ENDIF} +{$ENDIF} +{$ENDIF} + SysUtils, Classes, TypInfo, DADesign, DBAccess, MSAccess, SdacVcl; + +type + +{ ------------ SDac property editors ----------- } + + TMSConnectStringPropertyEditor = class(TStringProperty) + protected + FForm: TForm; + FSucceeded: boolean; + FConnectString: string; + procedure DoActivate(Sender: TObject); + public + function GetAttributes: TPropertyAttributes; override; + procedure Edit; override; + end; + + TMSServerNamePropertyEditor = class (TStringProperty) + public + function GetAttributes: TPropertyAttributes; override; + procedure GetValues(Proc: TGetStrProc); override; + function AutoFill: Boolean; override; + end; + + TMSDatabaseNamePropertyEditor = class (TStringProperty) + protected + procedure GetDialogOptions(Dialog: TOpenDialog); virtual; + public + procedure Edit; override; + function GetAttributes: TPropertyAttributes; override; + procedure GetValues(Proc: TGetStrProc); override; + end; + +{$IFNDEF STD} + TMSQueuePropertyEditor = class(TStringProperty) + public + function GetAttributes: TPropertyAttributes; override; + procedure GetValues(Proc: TGetStrProc); override; + end; + + TMSServicePropertyEditor = class(TStringProperty) + public + function GetAttributes: TPropertyAttributes; override; + procedure GetValues(Proc: TGetStrProc); override; + end; + + TMSContractPropertyEditor = class(TStringProperty) + public + function GetAttributes: TPropertyAttributes; override; + procedure GetValues(Proc: TGetStrProc); override; + end; + + TMSTargetDatabaseNamePropertyEditor = class(TStringProperty) + public + function GetAttributes: TPropertyAttributes; override; + procedure GetValues(Proc: TGetStrProc); override; + end; + + TMSTableNamesEditor = class(TStringProperty) + public + function GetAttributes: TPropertyAttributes; override; + procedure Edit; override; + end; +{$ENDIF} + + TMSConnectDialogPropertyEditor = class(TComponentProperty) + private + FCheckProc: TGetStrProc; + procedure CheckComponent(const Value: string); + public + procedure GetValues(Proc: TGetStrProc); override; + end; + +{ ------------ SDac component editors ----------- } + + TMSConnectionEditor = class(TDAConnectionEditor) + protected + FQueryAnalyserIndex: integer; + FManagementStudioIndex: integer; + procedure InitVerbs; override; + public + procedure ExecuteVerb(Index: integer); override; + end; + + TMSDataSetEditor = class(TDADataSetEditor); + + TMSQueryEditor = class(TMSDataSetEditor) + protected + FQueryAnalyserIndex: integer; + FManagementStudioIndex: integer; + procedure InitVerbs; override; + public + procedure ExecuteVerb(Index: integer); override; + end; + + TMSSQLEditor = class(TDASQLEditor) + protected + procedure InitVerbs; override; + end; + + TMSTableEditor = class(TMSDataSetEditor) + protected + procedure InitVerbs; override; + end; + + TMSStoredProcEditor = class(TMSDataSetEditor) + protected + procedure InitVerbs; override; + public + procedure ExecuteVerb(Index: integer); override; + end; + + TMSUpdateSQLEditor = class(TDAUpdateSQLEditor) + protected + procedure InitVerbs; override; + end; + + TMSScriptEditor = class(TDASQLEditor) + protected + procedure InitVerbs; override; + end; + +{$IFNDEF STD} + TMSDumpEditor = class(TDAComponentEditor) + protected + procedure InitVerbs; override; + end; +{$ENDIF} + + TMSConnectionList = class (TDAConnectionList) + protected + function GetConnectionType: TCustomDAConnectionClass; override; + end; + +{$IFDEF VER6P} + TMSDesignNotification = class(TDADesignNotification) + public + procedure ItemInserted(const ADesigner: IDesigner; AItem: TPersistent); override; + function CreateConnectionList: TDAConnectionList; override; + procedure SelectionChanged(const ADesigner: IDesigner; + const ASelection: IDesignerSelections); override; + function GetConnectionPropertyName: string; override; + end; +{$ENDIF} + +procedure Register; + +type + TServerTool = (stQueryAnalyser, stManagementStudio); + +procedure RunServerTool(ServerTool: TServerTool; Connection: TMSConnection; const SQL: TStrings = nil); +procedure RunServerToolConnection(ServerTool: TServerTool; Connection: TMSConnection; const SQLText: string); +procedure RunServerToolDataSet(ServerTool: TServerTool; DataSet: TCustomMSDataSet); +procedure RunServerToolMSSQL(ServerTool: TServerTool; MSSQL: TMSSQL); + +function IsServerToolInstalled(ServerTool: TServerTool): boolean; + +implementation + +uses + {$IFDEF CLR}System.Text, WinUtils, {$ENDIF} + {$IFNDEF CLR} ToolsAPI,{$ENDIF} + MSMenu, ShellAPI, ActiveX, ComObj, DB, DAConsts, OLEDBIntf, OLEDBC, OLEDBAccess, + MSDesignUtils, MSConnectionEditor, MSQueryEditor, MSSQLEditor, MSStoredProcEditor, + DATableEditor, MSUpdateSQLEditor, DAScriptEditor, MSScript{$IFNDEF STD}, MSLoader, MSDump, + MSServiceBroker, MSDumpEditor, MSNamesEditor{$ENDIF}; + +var + TmpFiles: TStringList; + +function GetServerToolCommand(ServerTool: TServerTool): string; +type + TRegKeyString = record + Root: HKEY; + Path, KeyName: string; + AdditionalPath: string; + end; + TRegKeyArray = array[0..1] of TRegKeyString; +const + QAKeyPaths: TRegKeyArray = + ((Root: HKEY_LOCAL_MACHINE; Path: 'SOFTWARE\Microsoft\Microsoft SQL Server\80\Tools\ClientSetup'; KeyName: 'SQLPath'; AdditionalPath: '\Binn\isqlw'), + (Root: HKEY_CLASSES_ROOT; Path: 'SQLFile\Shell\open\command'; KeyName: ''; AdditionalPath: '\isqlw')); + MMSKeyPaths: TRegKeyArray = + ((Root: HKEY_LOCAL_MACHINE; Path: 'SOFTWARE\Microsoft\Microsoft SQL Server\90\Tools\ClientSetup'; KeyName: 'SQLPath'; AdditionalPath: '\Binn\VSShell\Common7\IDE\sqlwb'), + (Root: HKEY_CLASSES_ROOT; Path: 'sqlwb.sql.9.0\Shell\Open\Command'; KeyName: ''; AdditionalPath: '\sqlwb')); +var + Reg: TRegistry; + i: integer; + KeyPaths: TRegKeyArray; +begin + case ServerTool of + stQueryAnalyser: begin + Result := 'isqlw'; + KeyPaths := QAKeyPaths; + end; + stManagementStudio: begin + Result := 'sqlwb'; + KeyPaths := MMSKeyPaths; + end + else + Assert(False); + end; + + Reg := TRegistry.Create{$IFDEF VER5P}(KEY_READ){$ENDIF}; + try + for i := Low(KeyPaths) to High(KeyPaths) do begin + Reg.RootKey := KeyPaths[i].Root; + if Reg.OpenKeyReadOnly(KeyPaths[i].Path) then begin + Result := Reg.ReadString(KeyPaths[i].KeyName); + Reg.CloseKey; + if Result <> '' then begin + Result := Result + KeyPaths[i].AdditionalPath; + Break; + end; + end; + end; + finally + Reg.Free; + end; +end; + +function IsServerToolInstalled(ServerTool: TServerTool): boolean; +var + Cmd: string; +begin + Cmd := GetServerToolCommand(ServerTool); + Result := FileExists(Cmd + '.exe'); +end; + +procedure RunServerTool(ServerTool: TServerTool; Connection: TMSConnection; const SQL: TStrings = nil); +var + Cmd, CmdParam: string; +{$IFDEF CLR} + TmpPath, TmpFileName: StringBuilder; + SqlFileHandle: TOpenedFile; +{$ELSE} + TmpPath, TmpFileName: array[0..MAX_PATH] of char; + SqlFileHandle: integer; +{$ENDIF} + SqlFileName: string; + Code: integer; +begin + if Connection = nil then + DatabaseError(SConnectionNotDefined); + + CmdParam := ''; //'-1'; + + if Connection.Server <> '' then + CmdParam := CmdParam + ' -S ' + Connection.Server; + + if Connection.Database <> '' then + CmdParam := CmdParam + ' -d ' + Connection.Database; + + if Connection.Authentication = auWindows then + CmdParam := CmdParam + ' -E' + else begin + if Connection.Username <> '' then + CmdParam := CmdParam + ' -U ' + Connection.Username; + CmdParam := CmdParam + ' -P ' + Connection.Password; + end; + + if (SQL <> nil) and (SQL.Count > 0) then begin + {$IFDEF CLR} + TmpPath := StringBuilder.Create(MAX_PATH); + TmpFileName := StringBuilder.Create(MAX_PATH); + + Assert(GetTempPath(MAX_PATH, TmpPath) <> 0, 'Error in call GetTempPath'); + Assert(GetTempFileName(TmpPath.ToString, 'sql'#0, 0, TmpFileName) <> 0, 'Error in call GetTempFileName'); + + if ServerTool = stManagementStudio then begin + SqlFileName := ChangeFileExt(TmpFileName.ToString, '.sql'); + SqlFileHandle := FileCreate(SqlFileName); + //Assert(SqlFileHandle > 0); + FileClose(SqlFileHandle); + TmpFiles.Add(SqlFileName); + SQl.SaveToFile(SqlFileName); + end + else + SQl.SaveToFile(TmpFileName.ToString); + + TmpFiles.Add(TmpFileName.ToString); + case ServerTool of + stQueryAnalyser: + CmdParam := CmdParam + ' -f ' + TmpFileName.ToString; + stManagementStudio: + CmdParam := '"' + SqlFileName + '" ' + CmdParam; + else + Assert(False); + end; + {$ELSE} + Assert(GetTempPath(MAX_PATH, TmpPath) <> 0, 'Error in call GetTempPath'); + + Assert(GetTempFileName(TmpPath, 'sql'#0, 0, TmpFileName) <> 0, 'Error in call GetTempFileName'); + + if ServerTool = stManagementStudio then begin + SqlFileName := ChangeFileExt(TmpFileName, '.sql'); + SqlFileHandle := FileCreate(SqlFileName); + Assert(SqlFileHandle > 0); + FileClose(SqlFileHandle); + TmpFiles.Add(SqlFileName); + SQl.SaveToFile(SqlFileName); + end + else + SQl.SaveToFile(TmpFileName); + + TmpFiles.Add(TmpFileName); + case ServerTool of + stQueryAnalyser: + CmdParam := CmdParam + ' -f ' + StrPas(TmpFileName); + stManagementStudio: + CmdParam := '"' + SqlFileName + '" ' + CmdParam; + else + Assert(False); + end; + {$ENDIF} + end; + + Cmd := GetServerToolCommand(ServerTool); + +{$IFDEF CLR} + Code := ShellExecute(0, '', Cmd, CmdParam, '', SW_SHOWNORMAL); +{$ELSE} + Code := ShellExecute(0, nil, @Cmd[1], @CmdParam[1], nil, SW_SHOWNORMAL); +{$ENDIF} + if Code <= 32 then + raise Exception.CreateFmt('Error executing "%s %s". Code = %d', [Cmd, CmdParam, Code]); +end; + +procedure RunServerToolConnection(ServerTool: TServerTool; Connection: TMSConnection; const SQLText: string); +var + SQL: TStringList; +begin + SQL := TStringList.Create; + try + SQL.Add(SQLtext); + RunServerTool(ServerTool, Connection, SQL); + finally + SQL.Free; + end; +end; + +procedure RunServerToolDataSet(ServerTool: TServerTool; DataSet: TCustomMSDataSet); +begin + RunServerToolConnection(ServerTool, DataSet.Connection, TMSAccessUtils.GetOLEDBSQL(DataSet)); +end; + +procedure RunServerToolMSSQL(ServerTool: TServerTool; MSSQL: TMSSQL); +begin + RunServerToolConnection(ServerTool, MSSQL.Connection, TMSAccessUtils.GetOLEDBSQL(MSSQL)); +end; + +{ TMSConnectStringProperty } + +function TMSConnectStringPropertyEditor.GetAttributes: TPropertyAttributes; +begin + Result := [paDialog]; +end; + +procedure TMSConnectStringPropertyEditor.DoActivate(Sender: TObject); +var + DataInit: IDataInitialize; + DBPrompt: IDBPromptInitialize; + DataSource: IUnknown; + InitStr: {$IFDEF CLR}string{$ELSE}PWideChar{$ENDIF}; + InitialString: WideString; +begin + FSucceeded := False; + DataInit := CreateComObject(CLSID_DataLinks) as IDataInitialize; + InitialString := FConnectString; + + if Pos('Provider=', FConnectString) = 0 then begin + if InitialString <> '' then + InitialString := InitialString + ';'; + InitialString := InitialString + 'Provider=SQLOLEDB.1'; + end; + + DataInit.GetDataSource(nil, CLSCTX_INPROC_SERVER, + {$IFDEF CLR} + InitialString, + {$ELSE} + PWideChar(InitialString), + {$ENDIF} + IID_IUnknown, DataSource); + DBPrompt := CreateComObject(CLSID_DataLinks) as IDBPromptInitialize; + + if Succeeded(DBPrompt.PromptDataSource(nil, FForm.Handle, + DBPROMPTOPTIONS_PROPERTYSHEET + DBPROMPTOPTIONS_DISABLE_PROVIDER_SELECTION, 0, nil, nil, IID_IUnknown, DataSource)) then + begin + InitStr := nil; + DataInit.GetInitializationString(DataSource, True, InitStr ); + FConnectString := InitStr; + FSucceeded := True; + end; + + PostMessage(FForm.Handle, WM_CLOSE, 0, 0); +end; + +procedure TMSConnectStringPropertyEditor.Edit; +begin + FConnectString := TMSConnection(GetComponent(0)).ConnectString; + FForm := TForm.Create(nil); + try + FForm.BorderStyle := bsNone; + FForm.Position := poScreenCenter; + FForm.Width := 10; + FForm.Height := 10; + FForm.OnActivate := DoActivate; + FForm.ShowModal; + finally + FForm.Free; + end; + if FSucceeded then begin {Cannot move to DoActivate} + TMSConnection(GetComponent(0)).ConnectString := FConnectString; + Modified; + end; +end; + +{ TMSServerNamePropertyEditor } + +function TMSServerNamePropertyEditor.GetAttributes: TPropertyAttributes; +begin + Result := [paValueList]; +end; + +function TMSServerNamePropertyEditor.AutoFill: Boolean; +begin + Result := False; +end; + +procedure TMSServerNamePropertyEditor.GetValues(Proc: TGetStrProc); +var + List: TStringList; + i: integer; + OldCursor: TCursor; + Connection: TMSConnection; + IsEverywhere: boolean; +begin + List := TStringList.Create; + OldCursor := Screen.Cursor; + Screen.Cursor := crSQLWait; + try + Connection := nil; + if GetComponent(0) is TMSConnection then + Connection := GetComponent(0) as TMSConnection; + + IsEverywhere := (Connection <> nil) and (Connection.Options.Provider = prCompact); + if not IsEverywhere then + GetServerList(List); + + for i := 0 to List.Count - 1 do + Proc(List[i]); + finally + List.Free; + Screen.Cursor := OldCursor; + end; +end; + +{ TMSDatabaseNamePropertyEditor } + +procedure TMSDatabaseNamePropertyEditor.GetDialogOptions(Dialog: TOpenDialog); +begin +{$IFDEF LINUX} + Dialog.Filter := 'All Files (*)|*'; +{$ENDIF} +{$IFDEF MSWINDOWS} + Dialog.Filter := 'MS SQL Database Files (*.sdf)|*.sdf|All Files (*.*)|*.*'; +{$ENDIF} + Dialog.Options := Dialog.Options + [ofPathMustExist]; +end; + +function TMSDatabaseNamePropertyEditor.GetAttributes: TPropertyAttributes; +var + Connection: TMSConnection; +begin + Connection := nil; + if GetComponent(0) is TMSConnection then + Connection := GetComponent(0) as TMSConnection + else + if GetComponent(0) is TCustomMSDataset then + Connection := TCustomMSDataset(GetComponent(0)).Connection as TMSConnection; + if Connection = nil then + Exit; + + if Connection.Options.Provider <> prCompact then + Result := [paValueList] + else + Result := [paRevertable, paDialog, paMultiSelect]; +end; + +procedure TMSDatabaseNamePropertyEditor.Edit; +var + OpenDialog: TOpenDialog; +begin + OpenDialog := TOpenDialog.Create(nil); + GetDialogOptions(OpenDialog); + if OpenDialog.Execute then + SetValue(OpenDialog.FileName); + OpenDialog.Free; +end; + +procedure TMSDatabaseNamePropertyEditor.GetValues(Proc: TGetStrProc); +var + List: TStringList; + Connection: TMSConnection; + i: integer; + OldConnected: boolean; +begin + Connection := nil; + if GetComponent(0) is TMSConnection then + Connection := GetComponent(0) as TMSConnection + else + if GetComponent(0) is TCustomMSDataset then + Connection := TCustomMSDataset(GetComponent(0)).Connection as TMSConnection; + if Connection = nil then + Exit; + + OldConnected := Connection.Connected; + List := TStringList.Create; + try + try + GetDatabasesList(Connection, List); + except + Designer.Modified; + raise; + end; + List.Sort; + + for i := 0 to List.Count - 1 do + Proc(List[i]); + finally + List.Free; + + if (OldConnected <> Connection.Connected) and (Designer <> nil) then + Designer.Modified; + end; +end; + +{ TMSQueuePropertyEditor } +{$IFNDEF STD} +function TMSQueuePropertyEditor.GetAttributes: TPropertyAttributes; +begin + Result := [paValueList]; +end; + +procedure TMSQueuePropertyEditor.GetValues(Proc: TGetStrProc); +var + List: TStringList; + Connection: TMSConnection; + ServiceBroker: TMSServiceBroker; + i: integer; + OldConnected: boolean; +begin + ServiceBroker := nil; + Connection := nil; + if GetComponent(0) is TMSServiceBroker then begin + ServiceBroker := TMSServiceBroker(GetComponent(0)); + Connection := ServiceBroker.Connection; + end; + if Connection = nil then + Exit; + + OldConnected := Connection.Connected; + List := TStringList.Create; + try + try + ServiceBroker.GetQueueNames(List); + except + Designer.Modified; + raise; + end; + List.Sort; + + for i := 0 to List.Count - 1 do + Proc(List[i]); + finally + List.Free; + + if (OldConnected <> Connection.Connected) and (Designer <> nil) then + Designer.Modified; + end; +end; + +{ TMSServicePropertyEditor } + +function TMSServicePropertyEditor.GetAttributes: TPropertyAttributes; +begin + Result := [paValueList, paSortList, paMultiSelect]; +end; + +procedure TMSServicePropertyEditor.GetValues(Proc: TGetStrProc); +var + List: TStringList; + Connection: TMSConnection; + ServiceBroker: TMSServiceBroker; + i: integer; + OldConnected: boolean; +begin + ServiceBroker := nil; + Connection := nil; + if GetComponent(0) is TMSServiceBroker then begin + ServiceBroker := TMSServiceBroker(GetComponent(0)); + Connection := ServiceBroker.Connection; + end; + if Connection = nil then + Exit; + + OldConnected := Connection.Connected; + List := TStringList.Create; + try + try + ServiceBroker.GetServiceNames(List); + except + Designer.Modified; + raise; + end; + + for i := 0 to List.Count - 1 do + Proc(List[i]); + finally + List.Free; + + if (OldConnected <> Connection.Connected) and (Designer <> nil) then + Designer.Modified; + end; +end; + +{ TMSContractPropertyEditor } + +function TMSContractPropertyEditor.GetAttributes: TPropertyAttributes; +begin + Result := [paValueList]; +end; + +procedure TMSContractPropertyEditor.GetValues(Proc: TGetStrProc); +var + List: TStringList; + Connection: TMSConnection; + ServiceBroker: TMSServiceBroker; + i: integer; + OldConnected: boolean; +begin + ServiceBroker := nil; + Connection := nil; + if GetComponent(0) is TMSServiceBroker then begin + ServiceBroker := TMSServiceBroker(GetComponent(0)); + Connection := ServiceBroker.Connection; + end; + if Connection = nil then + Exit; + + OldConnected := Connection.Connected; + List := TStringList.Create; + try + try + ServiceBroker.GetContractNames(List); + except + Designer.Modified; + raise; + end; + List.Sort; + + for i := 0 to List.Count - 1 do + Proc(List[i]); + finally + List.Free; + + if (OldConnected <> Connection.Connected) and (Designer <> nil) then + Designer.Modified; + end; +end; + +{ TMSTargetDatabaseNamePropertyEditor } + +function TMSTargetDatabaseNamePropertyEditor.GetAttributes: TPropertyAttributes; +begin + Result := [paValueList]; +end; + +procedure TMSTargetDatabaseNamePropertyEditor.GetValues(Proc: TGetStrProc); +var + List: TStringList; + Connection: TMSConnection; + i: integer; + OldConnected: boolean; +begin + Connection := nil; + if GetComponent(0) is TMSServiceBroker then + Connection := TMSServiceBroker(GetComponent(0)).Connection as TMSConnection; + if Connection = nil then + Exit; + + OldConnected := Connection.Connected; + List := TStringList.Create; + try + try + GetDatabasesList(Connection, List); + except + Designer.Modified; + raise; + end; + List.Sort; + + for i := 0 to List.Count - 1 do + Proc(List[i]); + finally + List.Free; + + if (OldConnected <> Connection.Connected) and (Designer <> nil) then + Designer.Modified; + end; +end; + +{ TMSTableNamesEditor } + +function TMSTableNamesEditor.GetAttributes: TPropertyAttributes; +begin + Result := [paDialog]; +end; + +procedure TMSTableNamesEditor.Edit; +var + Comp: TComponent; + Conn: TCustomDAConnection; + +begin + Comp := TComponent(GetComponent(0)); + Conn := TMSDesignUtils.GetConnection(Comp); + if Conn = nil then + Exit; + + with TMSNamesEditorForm.Create(nil, TMSDesignUtils) do + try + Connection := Conn as TMSConnection; + if Comp is TMSDump then + Names := TMSDump(Comp).TableNames + else + Assert(False); + + ShowModal; + if ModalResult = mrOk then begin + if Comp is TMSDump then + TMSDump(Comp).TableNames := Names + else + Assert(False); + end; + finally + Free; + end; +end; +{$ENDIF} + +{ TMSConnectDialogPropertyEditor } + +procedure TMSConnectDialogPropertyEditor.CheckComponent(const Value: string); +var + Component: TComponent; +begin + Component := Designer.GetComponent(Value); + if Component <> nil then begin + if not (Component is TMSConnectDialog) then + Exit; + end; + FCheckProc(Value); +end; + +procedure TMSConnectDialogPropertyEditor.GetValues(Proc: TGetStrProc); +begin + FCheckProc := Proc; + inherited GetValues(CheckComponent); +end; + +{ TMSConnectionEditor } + +procedure TMSConnectionEditor.ExecuteVerb(Index: integer); +begin + if (Index = FQueryAnalyserIndex) and (FQueryAnalyserIndex <> -1) then + RunServerTool(stQueryAnalyser, Component as TMSConnection) + else + if (Index = FManagementStudioIndex) and (FManagementStudioIndex <> -1) then + RunServerTool(stManagementStudio, Component as TMSConnection) + else + inherited ExecuteVerb(Index); +end; + +procedure TMSConnectionEditor.InitVerbs; +var + ServerToolMethod: TVerbMethod; + Connection: TMSConnection; +begin + AddVerb('Connection Editor...', TMSConnectionEditorForm, TMSDesignUtils); + + Connection := Component as TMSConnection; + ServerToolMethod := nil; + FQueryAnalyserIndex := -1; + FManagementStudioIndex := -1; + if (Connection <> nil) and (Connection.Options.Provider <> prCompact) then begin + if IsServerToolInstalled(stQueryAnalyser) then + FQueryAnalyserIndex := AddVerb('Query Analyzer...', ServerToolMethod); + if IsServerToolInstalled(stManagementStudio) then + FManagementStudioIndex := AddVerb('Management Studio...', ServerToolMethod); + end; +end; + +{ TMSQueryEditor } + +procedure TMSQueryEditor.ExecuteVerb(Index: integer); +begin + if (Index = FQueryAnalyserIndex) and (FQueryAnalyserIndex <> -1) then + RunServerToolDataSet(stQueryAnalyser, Component as TCustomMSDataSet) + else + if (Index = FManagementStudioIndex) and (FManagementStudioIndex <> -1) then + RunServerToolDataSet(stManagementStudio, Component as TCustomMSDataSet) + else + inherited ExecuteVerb(Index); +end; + +procedure TMSQueryEditor.InitVerbs; +var + Connection: TMSConnection; + ServerToolMethod: TVerbMethod; +begin + AddVerb('Fields &Editor...', ShowFieldsEditor); + AddVerb('MSQuery E&ditor...', TMSQueryEditorForm, TMSDesignUtils); + AddVerb('Data Editor...', ShowDataEditor); + + Connection := (Component as TCustomMSDataSet).Connection; + ServerToolMethod := nil; + FQueryAnalyserIndex := -1; + FManagementStudioIndex := -1; + if (Connection <> nil) and (Connection.Options.Provider <> prCompact) then begin + if IsServerToolInstalled(stQueryAnalyser) then + FQueryAnalyserIndex := AddVerb('Query Analyzer...', ServerToolMethod); + if IsServerToolInstalled(stManagementStudio) then + FManagementStudioIndex := AddVerb('Management Studio...', ServerToolMethod); + end; + + inherited; +end; + +{ TMSSQLEditor } + +procedure TMSSQLEditor.InitVerbs; +begin + AddVerb('MSSQL E&ditor...', TMSSQLEditorForm, TMSDesignUtils); +end; + +{ TMSStoredProcEditor } + +procedure TMSStoredProcEditor.ExecuteVerb(Index: integer); +begin + if Index = GetVerbCount - 1 then + ConvertToClass(Designer, Component, TMSQuery) + else + inherited ExecuteVerb(Index); +end; + +procedure TMSStoredProcEditor.InitVerbs; +begin + AddVerb('Fields &Editor...', ShowFieldsEditor); + AddVerb('MSStoredProc E&ditor...', TMSStoredProcEditorForm, TMSDesignUtils); + AddVerb('Data Editor...', ShowDataEditor); + AddVerb('Convert to TMSQuery', ShowDataEditor); + + inherited; +end; + +{ TMSTableEditor } + +procedure TMSTableEditor.InitVerbs; +begin + AddVerb('Fields &Editor...', ShowFieldsEditor); + AddVerb('MSTable E&ditor...', TDATableEditorForm, TMSDesignUtils); + AddVerb('Data Editor...', ShowDataEditor); + + inherited; +end; + +{ TMSUpdateSQLEditor } + +procedure TMSUpdateSQLEditor.InitVerbs; +begin + inherited; + AddVerb('MSUpdateSQL E&ditor...', TMSUpdateSQLEditorForm, TMSDesignUtils); +end; + +{ TMSScriptEditor } + +procedure TMSScriptEditor.InitVerbs; +begin + inherited; + AddVerb('MSScript E&ditor...', TDAScriptEditorForm, TMSDesignUtils); +end; + +{ TMSDumpEditor } +{$IFNDEF STD} +procedure TMSDumpEditor.InitVerbs; +begin + inherited; + AddVerb('MSDump E&ditor...', TMSDumpEditorForm, TMSDesignUtils); +end; +{$ENDIF} + +{ TMSConnectionList } + +function TMSConnectionList.GetConnectionType: TCustomDAConnectionClass; +begin + Result := TMSConnection; +end; + +{$IFDEF VER6P} + +{ TMSDesignNotification } + +function TMSDesignNotification.CreateConnectionList: TDAConnectionList; +begin + Result := TMSConnectionList.Create; +end; + +function TMSDesignNotification.GetConnectionPropertyName: string; +begin + Result := 'Connection'; +end; + +procedure TMSDesignNotification.ItemInserted(const ADesigner: IDesigner; AItem: TPersistent); +begin + if (AItem <> nil) and ((AItem is TCustomMSDataSet) or (AItem is TMSSQL) or + (AItem is TMSScript) {$IFNDEF STD}or (AItem is TMSLoader) or (AItem is TMSDump) or (AItem is TMSServiceBroker){$ENDIF} or + (AItem is TMSDataSource)) then + FItem := AItem; +end; + +procedure TMSDesignNotification.SelectionChanged(const ADesigner: IDesigner; + const ASelection: IDesignerSelections); +{$IFDEF CLR} +begin +end; +{$ELSE} +var + ModuleServices: IOTAModuleServices; + CurrentModule: IOTAModule; + Project: IOTAProject; + ProjectOptions: IOTAProjectOptions; + DelphiPath: string; + s: string; +begin + CurrentProjectOutputDir := ''; + +{$IFDEF CLR} + ModuleServices := BorlandIDE.ModuleServices; +{$ELSE} + ModuleServices :=BorlandIDEServices as IOTAModuleServices; +{$ENDIF} + + CurrentModule := ModuleServices.CurrentModule; + + if CurrentModule.OwnerCount = 0 then + Exit; + + Project := CurrentModule.Owners[0]; + + ProjectOptions := Project.ProjectOptions; + + CurrentProjectOutputDir := Trim(ProjectOptions.Values['OutputDir']); + + if (CurrentProjectOutputDir <> '') then begin + if (CurrentProjectOutputDir[1] = '.') then begin // relative path + s := Trim(ExtractFilePath(Project.FileName)); + if s = '' then + CurrentProjectOutputDir := '' + else + CurrentProjectOutputDir := IncludeTrailingBackslash(s) + CurrentProjectOutputDir; + end + else + if Pos('$(DELPHI)', UpperCase(CurrentProjectOutputDir)) > 0 then begin + DelphiPath := GetEnvironmentVariable('DELPHI'); + CurrentProjectOutputDir := StringReplace(CurrentProjectOutputDir, '$(DELPHI)', DelphiPath, [rfReplaceAll, rfIgnoreCase]); + end; + end + else + CurrentProjectOutputDir := Trim(ExtractFilePath(Project.FileName)); +end; +{$ENDIF} +{$ENDIF} + +procedure Register; +begin + // Register property editors + RegisterPropertyEditor(TypeInfo(String), TMSConnection, 'ConnectString', TMSConnectStringPropertyEditor); + RegisterPropertyEditor(TypeInfo(String), TMSConnection, 'Server', TMSServerNamePropertyEditor); + RegisterPropertyEditor(TypeInfo(String), TMSConnection, 'Database', TMSDatabaseNamePropertyEditor); + RegisterPropertyEditor(TypeInfo(TCustomConnectDialog), TMSConnection, 'ConnectDialog', TMSConnectDialogPropertyEditor); + + RegisterPropertyEditor(TypeInfo(TStrings), TMSQuery, 'SQL', TDAPropertyEditor); + RegisterPropertyEditor(TypeInfo(TStrings), TMSQuery, 'SQLDelete', TDAPropertyEditor); + RegisterPropertyEditor(TypeInfo(TStrings), TMSQuery, 'SQLInsert', TDAPropertyEditor); + RegisterPropertyEditor(TypeInfo(TStrings), TMSQuery, 'SQLRefresh', TDAPropertyEditor); + RegisterPropertyEditor(TypeInfo(TStrings), TMSQuery, 'SQLUpdate', TDAPropertyEditor); + + RegisterPropertyEditor(TypeInfo(TStrings), TMSSQL, 'SQL', TDAPropertyEditor); + + RegisterPropertyEditor(TypeInfo(TStrings), TMSStoredProc, 'SQL', nil); + RegisterPropertyEditor(TypeInfo(TStrings), TMSStoredProc, 'SQLDelete', TDAPropertyEditor); + RegisterPropertyEditor(TypeInfo(TStrings), TMSStoredProc, 'SQLInsert', TDAPropertyEditor); + RegisterPropertyEditor(TypeInfo(TStrings), TMSStoredProc, 'SQLRefresh', TDAPropertyEditor); + RegisterPropertyEditor(TypeInfo(TStrings), TMSStoredProc, 'SQLUpdate', TDAPropertyEditor); + + RegisterPropertyEditor(TypeInfo(TStrings), TMSUpdateSQL, 'InsertSQL', TDAPropertyEditor); + RegisterPropertyEditor(TypeInfo(TStrings), TMSUpdateSQL, 'ModifySQL', TDAPropertyEditor); + RegisterPropertyEditor(TypeInfo(TStrings), TMSUpdateSQL, 'DeleteSQL', TDAPropertyEditor); + RegisterPropertyEditor(TypeInfo(TStrings), TMSUpdateSQL, 'RefreshSQL', TDAPropertyEditor); + + RegisterPropertyEditor(TypeInfo(String), TMSMetadata, 'DatabaseName', TMSDatabaseNamePropertyEditor); + + RegisterPropertyEditor(TypeInfo(TStrings), TMSScript, 'SQL', TDAPropertyEditor); + +{$IFNDEF STD} + RegisterPropertyEditor(TypeInfo(String), TMSServiceBroker, 'Service', TMSServicePropertyEditor); + + RegisterPropertyEditor(TypeInfo(String), TMSDump, 'TableNames', TMSTableNamesEditor); +{$ENDIF} + + // Register component editors + DARegisterComponentEditor(TMSConnection, TMSConnectionEditor, TMSConnectionEditorForm, TMSDesignUtils); + DARegisterComponentEditor(TMSQuery, TMSQueryEditor, TMSQueryEditorForm, TMSDesignUtils); + DARegisterComponentEditor(TMSSQL, TMSSQLEditor, TMSSQLEditorForm, TMSDesignUtils); + DARegisterComponentEditor(TMSTable, TMSTableEditor, TDATableEditorForm, TMSDesignUtils); + DARegisterComponentEditor(TMSStoredProc, TMSStoredProcEditor, TMSStoredProcEditorForm, TMSDesignUtils); + DARegisterComponentEditor(TMSUpdateSQL, TMSUpdateSQLEditor, TMSUpdateSQLEditorForm, TMSDesignUtils); + DARegisterComponentEditor(TMSScript, TMSScriptEditor, TDAScriptEditorForm, TMSDesignUtils); +{$IFNDEF STD} + DARegisterComponentEditor(TMSDump, TMSDumpEditor, TMSDumpEditorForm, TMSDesignUtils); +{$ENDIF} + + RegisterComponentEditor(TMSDataSource, TCRDataSourceEditor); + + Menu.AddItems({$IFDEF CLR}WinUtils{$ELSE}SysInit{$ENDIF}.HInstance); +end; + +procedure ClearTmpFiles; +var + i: integer; +begin + if TmpFiles = nil then + exit; + + for i := 0 to TmpFiles.Count - 1 do + DeleteFile(TmpFiles[i]); +end; + +{$IFDEF VER6P} +var + Notificator: TMSDesignNotification; +{$ENDIF} + +initialization + + TmpFiles := nil; + TmpFiles := TStringList.Create; + +{$IFDEF VER6P} + Notificator := TMSDesignNotification.Create; + RegisterDesignNotification(Notificator); +{$ENDIF} + + ClearTmpFiles; + +{$IFDEF VER6P} + UnRegisterDesignNotification(Notificator); +{$ENDIF} + +end. diff --git a/internal/4.10.0.10/1/Source/Design/MSDesign.res b/internal/4.10.0.10/1/Source/Design/MSDesign.res new file mode 100644 index 0000000..acad9b3 Binary files /dev/null and b/internal/4.10.0.10/1/Source/Design/MSDesign.res differ diff --git a/internal/4.10.0.10/1/Source/Design/MSDesign10p.res b/internal/4.10.0.10/1/Source/Design/MSDesign10p.res new file mode 100644 index 0000000..465cc6e Binary files /dev/null and b/internal/4.10.0.10/1/Source/Design/MSDesign10p.res differ diff --git a/internal/4.10.0.10/1/Source/Design/MSDesign9.res b/internal/4.10.0.10/1/Source/Design/MSDesign9.res new file mode 100644 index 0000000..d6732b5 Binary files /dev/null and b/internal/4.10.0.10/1/Source/Design/MSDesign9.res differ diff --git a/internal/4.10.0.10/1/Source/Design/MSDesignUtils.pas b/internal/4.10.0.10/1/Source/Design/MSDesignUtils.pas new file mode 100644 index 0000000..48a9349 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/MSDesignUtils.pas @@ -0,0 +1,129 @@ + +////////////////////////////////////////////////// +// SQL Server Data Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I SDac.inc} + +unit MSDesignUtils; +{$ENDIF} + +interface + +uses + Classes, SysUtils, DBAccess, DADesignUtils; + +type + TMSDesignUtilsAlias = class(TDADesignUtilsAlias) + {$IFNDEF VER8}class{$ENDIF} function GetProjectName: string; override; + + {$IFNDEF VER8}class{$ENDIF} function GetConnectionList: TObject; override; + + { TDATable support } + {$IFNDEF VER8}class{$ENDIF} function GetTableName(Obj: TCustomDADAtaSet): string; override; + {$IFNDEF VER8}class{$ENDIF} procedure SetTableName(Obj: TCustomDADAtaSet; Value: string); override; + {$IFNDEF VER8}class{$ENDIF} function GetOrderFields(Obj: TCustomDADAtaSet): string; override; + {$IFNDEF VER8}class{$ENDIF} procedure SetOrderFields(Obj: TCustomDADAtaSet; Value: string); override; + {$IFNDEF VER8}class{$ENDIF} procedure PrepareSQL(Obj: TCustomDADAtaSet); override; + {$IFNDEF VER8}class{$ENDIF} function GetStoredProcName(Obj: TCustomDADataSet): string; override; + {$IFNDEF VER8}class{$ENDIF} procedure SetStoredProcName(Obj: TCustomDADataSet; Value: string); override; + + {$IFDEF USE_SYNEDIT} + {$IFNDEF VER8}class{$ENDIF} function SQLDialect: integer ; override; // SynHighlighterSQL TSQLDialect = (sqlStandard, sqlInterbase6, sqlMSSQL7, sqlMySQL, sqlOracle, sqlSybase, sqlIngres, sqlMSSQL2K); + {$ENDIF} + end; + +{$IFDEF VER8} + TMSDesignUtilsClass = TMSDesignUtilsAlias; + +var + TMSDesignUtils: TMSDesignUtilsAlias; +{$ELSE} + TMSDesignUtils = TMSDesignUtilsAlias; + TMSDesignUtilsClass = class of TMSDesignUtils; +{$ENDIF} + +implementation + +uses + MSAccess{$IFDEF SDAC}, MSDesign{$ENDIF}; + +{ TMSDesignUtils } + +{$IFNDEF VER8}class{$ENDIF} function TMSDesignUtilsAlias.GetProjectName: string; +begin + Result := 'SDAC'; +end; + +{$IFNDEF VER8}class{$ENDIF} function TMSDesignUtilsAlias.GetConnectionList: TObject; +begin +{$IFDEF SDAC} + Result := TMSConnectionList.Create; +{$ELSE} + Result := nil; +{$ENDIF} +end; + +{$IFNDEF VER8}class{$ENDIF} function TMSDesignUtilsAlias.GetTableName(Obj: TCustomDADAtaSet): string; +begin + Assert(Obj is TCustomMSTable, Obj.ClassName); + Result := TCustomMSTable(Obj).TableName; +end; + +{$IFNDEF VER8}class{$ENDIF} procedure TMSDesignUtilsAlias.SetTableName(Obj: TCustomDADAtaSet; + Value: string); +begin + Assert(Obj is TCustomMSTable, Obj.ClassName); + TCustomMSTable(Obj).TableName := Value; +end; + +{$IFNDEF VER8}class{$ENDIF} procedure TMSDesignUtilsAlias.PrepareSQL(Obj: TCustomDADAtaSet); +begin + Assert(Obj is TCustomMSTable, Obj.ClassName); + TCustomMSTable(Obj).PrepareSQL; +end; + +{$IFNDEF VER8}class{$ENDIF} function TMSDesignUtilsAlias.GetOrderFields(Obj: TCustomDADAtaSet): string; +begin + Assert(Obj is TCustomMSTable, Obj.ClassName); + Result := TCustomMSTable(Obj).OrderFields; +end; + +{$IFNDEF VER8}class{$ENDIF} procedure TMSDesignUtilsAlias.SetOrderFields(Obj: TCustomDADAtaSet; + Value: string); +begin + Assert(Obj is TCustomMSTable, Obj.ClassName); + TCustomMSTable(Obj).OrderFields := Value; +end; + +{$IFNDEF VER8}class{$ENDIF} function TMSDesignUtilsAlias.GetStoredProcName(Obj: TCustomDADataSet): string; +begin + Assert(Obj is TMSStoredProc, Obj.ClassName); + Result := TMSStoredProc(Obj).StoredProcName; +end; + +{$IFNDEF VER8}class{$ENDIF} procedure TMSDesignUtilsAlias.SetStoredProcName(Obj: TCustomDADataSet; Value: string); +begin + Assert(Obj is TMSStoredProc, Obj.ClassName); + TMSStoredProc(Obj).StoredProcName := Value; +end; + +{$IFDEF USE_SYNEDIT} +{$IFNDEF VER8}class{$ENDIF} function TMSDesignUtilsAlias.SQLDialect: integer; +begin + Result := 7; // sqlMSSQL2K +end; +{$ENDIF} + +{$IFDEF VER8} +initialization + TMSDesignUtils := TMSDesignUtilsAlias.Create; + +finalization + TMSDesignUtils.Free; +{$ENDIF} + +end. diff --git a/internal/4.10.0.10/1/Source/Design/MSDumpEditor.dfm b/internal/4.10.0.10/1/Source/Design/MSDumpEditor.dfm new file mode 100644 index 0000000..03aa736 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/MSDumpEditor.dfm @@ -0,0 +1,49 @@ +inherited MSDumpEditorForm: TMSDumpEditorForm + Caption = 'MSDumpEditorForm' + PixelsPerInch = 96 + TextHeight = 13 + inherited ClientPanel: TPanel + inherited LeftPanel: TPanel + inherited gbBackupOptions: TGroupBox + Height = 148 + inherited cbTableNames: TComboBox + TabOrder = 2 + end + inherited cbGenerateHeader: TCheckBox + Top = 83 + OnClick = cbDataClick + end + object cbIdentityInsert: TCheckBox + Left = 8 + Top = 120 + Width = 169 + Height = 17 + Caption = 'Use Identity Insert' + TabOrder = 1 + OnClick = cbDataClick + end + object cbAddDrop: TCheckBox + Left = 8 + Top = 101 + Width = 193 + Height = 17 + Caption = 'Add TRUNCATE statements' + TabOrder = 3 + OnClick = cbDataClick + end + end + inherited btBackup: TBitBtn + Top = 166 + end + inherited btRestore: TBitBtn + Top = 166 + end + inherited btImport: TBitBtn + Top = 197 + end + inherited btExport: TBitBtn + Top = 197 + end + end + end +end diff --git a/internal/4.10.0.10/1/Source/Design/MSDumpEditor.pas b/internal/4.10.0.10/1/Source/Design/MSDumpEditor.pas new file mode 100644 index 0000000..72ed474 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/MSDumpEditor.pas @@ -0,0 +1,129 @@ +////////////////////////////////////////////////// +// SQL Server Data Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +// MSDump Editor +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I Sdac.inc} + +unit MSDumpEditor; +{$ENDIF} + +interface + +uses +{$IFDEF MSWINDOWS} + Dialogs, Controls, StdCtrls, Buttons, Graphics, ExtCtrls, + Classes, Windows, Messages, SysUtils, Forms, DacVcl, + ComCtrls, Grids, DBGrids, DBCtrls, +{$ENDIF} +{$IFDEF LINUX} + SysUtils, Types, Classes, QGraphics, QControls, QForms, QDialogs, QStdCtrls, + QComCtrls, QGrids, QDBGrids, QDBCtrls, QButtons, QExtCtrls, DacClx, +{$ENDIF} + DBAccess, MSAccess, CREditor, DB, MSDump, DADesignUtils, DADumpEditor; + +type + TMSDumpEditorForm = class(TDADumpEditorForm) + cbAddDrop: TCheckBox; + cbIdentityInsert: TCheckBox; + procedure cbDataClick(Sender: TObject); + private + function GetLocalDump: TMSDump; + procedure SetLocalDump(const Value: TMSDump); + protected + procedure EditTableNames(Sender: TObject); override; + procedure DoInit; override; + + procedure GetButtons; override; + procedure SetButtons; override; + + property LocalDump: TMSDump read GetLocalDump write SetLocalDump; + end; + +implementation + +uses + DAConsts, MSNamesEditor; + +{$IFDEF IDE} +{$R *.dfm} +{$ENDIF} +{$IFDEF MSWINDOWS} +{$R MSDumpEditor.dfm} +{$ENDIF} +{$IFDEF LINUX} +{$R *.xfm} +{$ENDIF} + +{ TMSDumpEditorForm } + +function TMSDumpEditorForm.GetLocalDump: TMSDump; +begin + Result := TMSDump(FLocalDump); +end; + +procedure TMSDumpEditorForm.SetLocalDump(const Value: TMSDump); +begin + FLocalDump := Value; +end; + +procedure TMSDumpEditorForm.EditTableNames(Sender: TObject); +begin + if FLocalDump.Connection = nil then + DatabaseError(SConnectionNotDefined); + + with TMSNamesEditorForm.Create(nil, DADesignUtilsClass) do + try + Connection := FLocalDump.Connection as TMSConnection; + Names := LocalDump.TableNames; + ShowModal; + if ModalResult = mrOk then + LocalDump.TableNames := Names; + finally + Free; + end; + cbTableNames.Text := LocalDump.TableNames; + cbTableNames.Update; +end; + +procedure TMSDumpEditorForm.DoInit; +begin + inherited; + + // cbData.Checked := doData in LocalDump.Objects; + + cbTableNames.Text := LocalDump.TableNames; + cbAddDrop.Checked := LocalDump.Options.AddDrop; + cbIdentityInsert.Checked := LocalDump.Options.IdentityInsert; +end; + +procedure TMSDumpEditorForm.GetButtons; +begin + inherited; + + {if cbData.Checked then + LocalDump.Objects := LocalDump.Objects + [doData];} + + LocalDump.TableNames := cbTableNames.Text; + LocalDump.Options.AddDrop := cbAddDrop.Checked; + LocalDump.Options.IdentityInsert := cbIdentityInsert.Checked; +end; + +procedure TMSDumpEditorForm.SetButtons; +begin + inherited; + + // cbIdentityInsert.Enabled := cbData.Checked; + + // btBackup.Enabled := cbData.Checked; +end; + +procedure TMSDumpEditorForm.cbDataClick(Sender: TObject); +begin + SetButtons; +end; + +end. diff --git a/internal/4.10.0.10/1/Source/Design/MSMenu.pas b/internal/4.10.0.10/1/Source/Design/MSMenu.pas new file mode 100644 index 0000000..2457d35 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/MSMenu.pas @@ -0,0 +1,276 @@ + +////////////////////////////////////////////////// +// SQL Server Data Access Components +// Copyright © 2001-2007 Core Lab. All right reserved. +// SDAC IDE Menu +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I Sdac.inc} + +unit MSMenu; +{$ENDIF} +interface + +{$IFDEF VER7P} + {$WARN UNIT_DEPRECATED OFF} +{$ENDIF} + +uses + DAMenu, Windows; + +type + TMSMenu = class (TDAProductMenu) + private + FEmFile: string; + FQaFile: string; + FMsFile: string; + + procedure EnterpriseManagerItemClick(Sender: TDAMenuClickSender{$IFDEF CLR}; E: EventArgs{$ENDIF}); + procedure QueryAnalyzerItemItemClick(Sender: TDAMenuClickSender{$IFDEF CLR}; E: EventArgs{$ENDIF}); + procedure ManagementStudioItemItemClick(Sender: TDAMenuClickSender{$IFDEF CLR}; E: EventArgs{$ENDIF}); + + procedure HomePageItemClick(Sender: TDAMenuClickSender{$IFDEF CLR}; E: EventArgs{$ENDIF}); + procedure SdacPageItemClick(Sender: TDAMenuClickSender{$IFDEF CLR}; E: EventArgs{$ENDIF}); + procedure AboutItemClick(Sender: TDAMenuClickSender{$IFDEF CLR}; E: EventArgs{$ENDIF}); + procedure DBMonitorItemClick(Sender: TDAMenuClickSender{$IFDEF CLR}; E: EventArgs{$ENDIF}); + procedure DBMonitorPageItemClick(Sender: TDAMenuClickSender{$IFDEF CLR}; E: EventArgs{$ENDIF}); + public + constructor Create; + + function AddItems(Instance: HINST): boolean; override; + end; + +var + Menu: TMSMenu; + +implementation + +uses +{$IFDEF CLR} + MemUtils, WinUtils, +{$ELSE} + ToolIntf, CLRClasses, +{$ENDIF} + Classes, Registry, MSDesign, + SysUtils, Forms, ShellApi, SdacAbout, DBMonitorIntf, DBMonitorClient, + HelpUtils; + +resourcestring + sCRMenuName = 'SDACMenu'; + sSDACMenu = 'S&QL Server'; + + sEmItemCaption = 'Enterprise Manager'; + sEmItemName = 'SDACEmItem'; + sQaItemCaption = 'Query Analyzer'; + sQaItemName = 'SDACQaItem'; + SMsItemCaption = 'Management Studio'; + sMsItemName = 'SDACMsItem'; + sHelpItemCaption = 'SDAC Help'; + sHelpItemName = 'SDACHelpItem'; + sAboutItemCaption = 'About SDAC...'; +{$IFDEF CLR} + sAboutItemName = 'CRMSAboutItemCLR'; +{$ELSE} + sAboutItemName = 'CRMSAboutItemWin32'; +{$ENDIF} +//sMSDesSeparator = 'MSDesSeparator'; + sHomePageCaption = 'Core Lab Home Page'; + sHomePageName = 'CRSDACHomePageItem'; + sFAQCaption = 'SDAC FAQ'; + sFAQName = 'CRSDACFAQItem'; + sSdacPageCaption = 'SDAC Home Page'; + sSdacPageName = 'CRSDACPageItem'; + sDBMonitorItemCaption = 'DBMonitor'; + sDBMonitorItemName = 'SDACDBMonitorItem'; + //sMigWizardItemCaption = 'BDE/ADO Migration Wizard...'; + sDBMonitorPageCaption = 'Download DBMonitor'; + sDBMonitorPageName = 'SDACDBMonitorPageItem'; + +{ TMSMenu } + +constructor TMSMenu.Create; +begin + inherited Create (sCRMenuName, sAboutItemCaption, sAboutItemName, sSDACMenu); + FAboutClickEvent := AboutItemClick; +end; + +function TMSMenu.AddItems(Instance: HINST): boolean; + function IsEmAvaible: boolean; + type + TRegKeyString = record + Root: HKEY; + Path, KeyName: string; + end; + const + KeyPaths: array [0..3] of TRegKeyString = + ((Root: HKEY_CLASSES_ROOT; Path: 'TypeLib\{10010001-E260-11CF-AE68-00AA004A34D5}\8.0\HELPDIR'; KeyName: ''), + (Root: HKEY_LOCAL_MACHINE; Path: 'SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\sqlservr.exe'; KeyName: 'Path'), + (Root: HKEY_CLASSES_ROOT; Path: 'TypeLib\{10010001-EB1C-11CF-AE6E-00AA004A34D5}\2.0\HELPDIR'; KeyName: ''), + (Root: HKEY_CLASSES_ROOT; Path: 'TypeLib\{10010200-740B-11D0-AE7B-00AA004A34D5}\2.0\HELPDIR'; KeyName: '')); + var + Reg: TRegistry; + i: integer; + begin + Result := False; + FEmFile := ''; + Reg := TRegistry.Create{$IFDEF VER5P}(KEY_READ){$ENDIF}; + try + for i := Low(KeyPaths) to High(KeyPaths) do begin + Reg.RootKey := KeyPaths[i].Root; + if Reg.OpenKeyReadOnly(KeyPaths[i].Path) then begin + FEmFile := Reg.ReadString(KeyPaths[i].KeyName); + Reg.CloseKey; + if FEmFile <> '' then begin + FEmFile := FEmFile + '\SQL Server Enterprise Manager.MSC'; + Result := FileExists(FEmFile); + Break; + end; + end; + end; + finally + Reg.Free; + end; + end; + + function IsQaAvaible: boolean; + var + p: IntPtr; + begin + FQaFile := 'isqlw.exe'; + {$IFDEF CLR} + Result := SearchPath(nil, FQaFile, nil, 0, nil, p) <> 0; + {$ELSE} + Result := SearchPath(nil, @FQaFile[1], nil, 0, nil, PAnsiChar(p)) <> 0; + {$ENDIF} + end; + + function IsMsAvaible: boolean; + var + p: IntPtr; + begin + FMsFile := 'sqlwb.exe'; + {$IFDEF CLR} + Result := SearchPath(nil, FMsFile, nil, 0, nil, p) <> 0; + {$ELSE} + Result := SearchPath(nil, @FMsFile[1], nil, 0, nil, PAnsiChar(p)) <> 0; + {$ENDIF} + end; + +var + QaAvaible, EmAvaible, MsAvaible: boolean; + +begin + Result := inherited AddItems(Instance); + if not Result then + Exit; + + with FCRMenu.SubMenu do begin + EmAvaible := IsEmAvaible; + QaAvaible := IsQaAvaible; + MsAvaible := IsMsAvaible; + + + if EmAvaible or QaAvaible or MsAvaible then begin + if EmAvaible then + Add(sEmItemCaption, sEmItemName, EnterpriseManagerItemClick); + if QaAvaible then + Add(sQaItemCaption, sQaItemName, QueryAnalyzerItemItemClick); + if MsAvaible then + Add(SMsItemCaption, sMsItemName, ManagementStudioItemItemClick); + + AddSeparator; + end; + + if HasMonitor then begin + Add(sDBMonitorItemCaption, sDBMonitorItemName, DBMonitorItemClick); + end; + + AddWizards; + AddSeparator; + + AddHelp(sHelpItemCaption, sHelpItemName, 'Sdac'); + AddFAQ(sFAQCaption, sFAQName, 'Sdac'); + AddSeparator; + + Add(sHomePageCaption, sHomePageName, HomePageItemClick); + Add(sSdacPageCaption, sSdacPageName, SdacPageItemClick); + Add(sDBMonitorPageCaption, sDBMonitorPageName, DBMonitorPageItemClick); + AddSeparator; + AddAbout; + end; +end; + +procedure TMSMenu.DBMonitorItemClick(Sender: TDAMenuClickSender{$IFDEF CLR}; E: EventArgs{$ENDIF}); +begin + ShellExecute(0, 'open', PChar(WhereMonitor), '', '', SW_SHOW); +end; + +procedure TMSMenu.DBMonitorPageItemClick(Sender: TDAMenuClickSender{$IFDEF CLR}; E: EventArgs{$ENDIF}); +begin + OpenUrl('http://www.crlab.com/dbmonitor/dbmon.exe'); +end; + +procedure TMSMenu.EnterpriseManagerItemClick(Sender: TDAMenuClickSender{$IFDEF CLR}; E: EventArgs{$ENDIF}); +var + i: integer; +begin +{$IFDEF CLR} + i := ShellExecute(0, '', FEmFile, '', '', SW_SHOWNORMAL); +{$ELSE} + i := ShellExecute(0, nil, @FEmFile[1], nil, nil, SW_SHOWNORMAL); +{$ENDIF} + if i <= 32 then + TAPIMenuItem(Sender).Enabled := False; +end; + +procedure TMSMenu.QueryAnalyzerItemItemClick(Sender: TDAMenuClickSender{$IFDEF CLR}; E: EventArgs{$ENDIF}); +var + i: integer; + s: string; +begin + s := '-1'; +{$IFDEF CLR} + i := ShellExecute(0, '', FQaFile, s, '', SW_SHOWNORMAL); +{$ELSE} + i := ShellExecute(0, nil, @FQaFile[1], @s[1], nil, SW_SHOWNORMAL); +{$ENDIF} + if i <= 32 then + TAPIMenuItem(Sender).Enabled := False; +end; + +procedure TMSMenu.ManagementStudioItemItemClick(Sender: TDAMenuClickSender{$IFDEF CLR}; E: EventArgs{$ENDIF}); +var + i: integer; +begin +{$IFDEF CLR} + i := ShellExecute(0, '', FMsFile, nil, '', SW_SHOWNORMAL); +{$ELSE} + i := ShellExecute(0, nil, @FMsFile[1], nil, nil, SW_SHOWNORMAL); +{$ENDIF} + if i <= 32 then + TAPIMenuItem(Sender).Enabled := False; +end; + +procedure TMSMenu.HomePageItemClick(Sender: TDAMenuClickSender{$IFDEF CLR}; E: EventArgs{$ENDIF}); +begin + OpenUrl('http://www.crlab.com'); +end; + +procedure TMSMenu.SdacPageItemClick(Sender: TDAMenuClickSender{$IFDEF CLR}; E: EventArgs{$ENDIF}); +begin + OpenUrl('http://www.crlab.com/sdac'); +end; + +procedure TMSMenu.AboutItemClick(Sender: TDAMenuClickSender{$IFDEF CLR}; E: EventArgs{$ENDIF}); +begin + ShowAbout; +end; + +initialization + Menu := TMSMenu.Create; +finalization + Menu.Free; +end. + diff --git a/internal/4.10.0.10/1/Source/Design/MSNamesEditor.dfm b/internal/4.10.0.10/1/Source/Design/MSNamesEditor.dfm new file mode 100644 index 0000000..18debc8 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/MSNamesEditor.dfm @@ -0,0 +1,5 @@ +inherited MSNamesEditorForm: TMSNamesEditorForm + Caption = 'MSNamesEditorForm' + PixelsPerInch = 96 + TextHeight = 13 +end diff --git a/internal/4.10.0.10/1/Source/Design/MSNamesEditor.pas b/internal/4.10.0.10/1/Source/Design/MSNamesEditor.pas new file mode 100644 index 0000000..a41422d --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/MSNamesEditor.pas @@ -0,0 +1,105 @@ +////////////////////////////////////////////////// +// SQL Server Data Access Components +// Copyright © 1998-2005 Core Lab. All right reserved. +// MSNames Editor +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I Sdac.inc} + +unit MSNamesEditor; +{$ENDIF} + +interface + +uses +{$IFDEF MSWINDOWS} + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + ComCtrls, Grids, DBGrids, DBCtrls, Buttons, ExtCtrls, StdCtrls, +{$ENDIF} +{$IFDEF LINUX} + Qt, SysUtils, Types, Classes, QGraphics, QControls, QForms, QDialogs, QStdCtrls, + QComCtrls, QGrids, QDBGrids, QDBCtrls, QButtons, QExtCtrls, +{$ENDIF} + CREditor, DADualListEditor, MSAccess; + +type + TMSNamesEditorForm = class(TDADualListEditorForm) + protected + FConnection: TMSConnection; + FNames: string; + + procedure DoInit; override; + procedure DoSave; override; + + function GetComponent: TComponent; override; + procedure SetComponent(Value: TComponent); override; + + function GetSrcLabelCaption: string; override; + procedure GetSrcListItems(Items: TStrings); override; + function GetDestLabelCaption: string; override; + procedure GetDstListItems(Items: TStrings); override; + public + property Connection: TMSConnection read FConnection write FConnection; + property Names: string read FNames write FNames; + end; + +implementation + +{$IFDEF IDE} +{$R *.dfm} +{$ENDIF} +{$IFDEF MSWINDOWS} +{$R MSNamesEditor.dfm} +{$ENDIF} +{$IFDEF LINUX} +{$R *.xfm} +{$ENDIF} + +{ TMSNamesEditorForm } + +procedure TMSNamesEditorForm.DoInit; +begin + if Connection = nil then + Abort; + + inherited; +end; + +procedure TMSNamesEditorForm.DoSave; +begin + Names := TableNamesFromList(DstList.Items); +end; + +function TMSNamesEditorForm.GetComponent: TComponent; +begin + Result := FConnection; +end; + +procedure TMSNamesEditorForm.SetComponent(Value: TComponent); +begin + FConnection := Value as TMSConnection; +end; + +function TMSNamesEditorForm.GetDestLabelCaption: string; +begin + Result := 'Selected tables'; +end; + +procedure TMSNamesEditorForm.GetDstListItems(Items: TStrings); +begin + TableNamesToList(Names, DstList.Items); +end; + +function TMSNamesEditorForm.GetSrcLabelCaption: string; +begin + Result := 'Available tables'; +end; + +procedure TMSNamesEditorForm.GetSrcListItems(Items: TStrings); +begin + Connection.GetTableNames(Items); +end; + +end. diff --git a/internal/4.10.0.10/1/Source/Design/MSParamsFrame.dfm b/internal/4.10.0.10/1/Source/Design/MSParamsFrame.dfm new file mode 100644 index 0000000..947283d --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/MSParamsFrame.dfm @@ -0,0 +1,2 @@ +inherited MSParamsFrame: TMSParamsFrame +end diff --git a/internal/4.10.0.10/1/Source/Design/MSParamsFrame.pas b/internal/4.10.0.10/1/Source/Design/MSParamsFrame.pas new file mode 100644 index 0000000..e4c6c5f --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/MSParamsFrame.pas @@ -0,0 +1,76 @@ + +////////////////////////////////////////////////// +// SQL Server Access Components +// Copyright © 1998-2005 Core Lab. All right reserved. +// SDAC Params Frame +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I SDac.inc} + +unit MSParamsFrame; +{$ENDIF} + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, + Dialogs, StdCtrls, ExtCtrls, DAParamsFrame, MSAccess; + +type + TMSParamsFrame = class(TDAParamsFrame) + public + constructor Create(AOwner: TComponent); override; + end; + +implementation + +{$IFDEF IDE} +{$R *.dfm} +{$ENDIF} +{$IFDEF MSWINDOWS} +{$R MSParamsFrame.dfm} +{$ENDIF} + +uses + DB; + +{ TMSParamsFrame } + +constructor TMSParamsFrame.Create(AOwner: TComponent); +begin + inherited; + + AddDataType('Unknown', ftUnknown, True, False, False, ''); + AddDataType('String', ftString, False, True, True, ''); + AddDataType('WideString', ftWideString, False, True, True, ''); + AddDataType('Smallint', ftSmallint, True, True, False, '0'); + AddDataType('Integer', ftInteger, True, True, False, '0'); + AddDataType('Word', ftWord, True, True, False, '0'); + AddDataType('LargeInt', ftLargeInt, True, True, False, '0'); + AddDataType('Boolean', ftBoolean, False, True, True, 'False'); + AddDataType('Float', ftFloat, True, True, False, '0'); + AddDataType('Currency', ftCurrency, True, True, False, '0'); + AddDataType('BCD', ftBCD, True, True, False, '0'); +{$IFDEF VER6P} + AddDataType('FMTBcd', ftFMTBcd, True, True, False, '0'); +{$ENDIF} + AddDataType('DateTime', ftDateTime, True, True, False, ''); + AddDataType('Memo', ftMemo, False, True, False, ''); +{$IFDEF VER10P} + AddDataType('WideMemo', ftWideMemo, False, True, False, ''); +{$ENDIF} + AddDataType('Bytes', ftBytes, False, False, True, ''); + AddDataType('VarBytes', ftVarBytes, False, False, True, ''); + AddDataType('Blob', ftBlob, False, False, False, ''); + AddDataType('GUID', ftGuid, False, False, False, ''); + AddDataType('Variant', ftVariant, False, False, False, ''); + AddDataType('XML', TFieldType(ftMSXML), False, True, False, ''); + + AddParamType('IN', ptInput); + AddParamType('IN/OUT', ptInputOutput); + AddParamType('RESULT', ptResult); +end; + +end. diff --git a/internal/4.10.0.10/1/Source/Design/MSQueryEditor.dfm b/internal/4.10.0.10/1/Source/Design/MSQueryEditor.dfm new file mode 100644 index 0000000..cd25f30 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/MSQueryEditor.dfm @@ -0,0 +1,48 @@ +inherited MSQueryEditorForm: TMSQueryEditorForm + Width = 599 + Caption = 'MSQueryEditorForm' + PixelsPerInch = 96 + TextHeight = 13 + inherited BtnPanel: TPanel + Width = 591 + inherited imCorner: TImage + Left = 579 + end + inherited btOk: TBitBtn + Left = 427 + end + inherited btCancel: TBitBtn + Left = 508 + end + inherited btExecute: TButton + Width = 99 + end + inherited btnDataEditor: TBitBtn + Left = 110 + Width = 99 + end + object btQueryAnalyzer: TBitBtn + Left = 212 + Top = 8 + Width = 99 + Height = 25 + Anchors = [akLeft, akBottom] + Caption = 'Query Analyzer' + TabOrder = 4 + OnClick = btQueryAnalyzerClick + end + object btManagementStudio: TBitBtn + Left = 314 + Top = 8 + Width = 99 + Height = 25 + Anchors = [akLeft, akBottom] + Caption = 'Management Studio' + TabOrder = 5 + OnClick = btManagementStudioClick + end + end + inherited PageControl: TPageControl + Width = 575 + end +end diff --git a/internal/4.10.0.10/1/Source/Design/MSQueryEditor.pas b/internal/4.10.0.10/1/Source/Design/MSQueryEditor.pas new file mode 100644 index 0000000..0399944 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/MSQueryEditor.pas @@ -0,0 +1,102 @@ + +////////////////////////////////////////////////// +// SQL Server Data Access Components +// Copyright © 1998-2005 Core Lab. All right reserved. +// MSQuery Editor +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I SDac.inc} + +unit MSQueryEditor; +{$ENDIF} + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, + Dialogs, DAQueryEditor, ComCtrls, StdCtrls, Buttons, ExtCtrls; + +type + + TMSQueryEditorForm = class(TDAQueryEditorForm) + btQueryAnalyzer: TBitBtn; + btManagementStudio: TBitBtn; + procedure btQueryAnalyzerClick(Sender: TObject); + procedure btManagementStudioClick(Sender: TObject); + protected + procedure DoInit; override; + procedure DoError(E: Exception); override; + public + property Query; + end; + +implementation + +{$IFDEF IDE} +{$R *.dfm} +{$ENDIF} +{$IFDEF MSWINDOWS} +{$R MSQueryEditor.dfm} +{$ENDIF} + +uses + DASQLFrame, DAParamsFrame, MSParamsFrame, DAMacrosFrame, DASPCallFrame, + MSSPCallFrame, DAUpdateSQLFrame, DASQLGeneratorFrame, MSSQLEditor, + MSAccess, OLEDBAccess{$IFDEF SDAC}, MSDesign{$ENDIF}; + +{ TMSQueryEditorForm } + +procedure TMSQueryEditorForm.DoInit; +begin + FSQLFrame := AddTab(TDASQLFrame, shSQL) as TDASQLFrame; + FParamsFrame := AddTab(TMSParamsFrame, shParameters) as TDAParamsFrame; + FMacrosFrame := AddTab(TDAMacrosFrame, shMacros) as TDAMacrosFrame; + FSPCallFrame := AddTab(TMSSPCallFrame, shGeneratorSPC) as TDASPCallFrame; + FUpdateSQLFrame := AddTab(TDAUpdateSQLFrame, shEditSQL) as TDAUpdateSQLFrame; + FSQLGeneratorFrame := AddTab(TDASQLGeneratorFrame, shGenerator) as TDASQLGeneratorFrame; + + inherited; +{$IFDEF SDAC} + btQueryAnalyzer.Visible := IsServerToolInstalled(stQueryAnalyser); +{$ENDIF} + if btQueryAnalyzer.Visible and (Query.Connection <> nil) then + btQueryAnalyzer.Visible := TMSConnection(Query.Connection).Options.Provider <> prCompact; + +{$IFDEF SDAC} + btManagementStudio.Visible := IsServerToolInstalled(stManagementStudio); +{$ENDIF} + if btManagementStudio.Visible and (Query.Connection <> nil) then + btManagementStudio.Visible := TMSConnection(Query.Connection).Options.Provider <> prCompact; + + if btQueryAnalyzer.Visible and btManagementStudio.Visible then + Constraints.MinWidth := 619; +end; + +procedure TMSQueryEditorForm.DoError(E: Exception); +begin + if E is EMSError then + MSSQLEditor.DoError(Self, EMSError(E)) + else + if E is EOLEDBError then + MSSQLEditor.DoError(Self, EOLEDBError(E)) + else + inherited; +end; + +procedure TMSQueryEditorForm.btQueryAnalyzerClick(Sender: TObject); +begin +{$IFDEF SDAC} + RunServerToolDataSet(stQueryAnalyser, LocalComponent as TCustomMSDataSet); +{$ENDIF} +end; + +procedure TMSQueryEditorForm.btManagementStudioClick(Sender: TObject); +begin +{$IFDEF SDAC} + RunServerToolDataSet(stManagementStudio, LocalComponent as TCustomMSDataSet); +{$ENDIF} +end; + +end. diff --git a/internal/4.10.0.10/1/Source/Design/MSReg.pas b/internal/4.10.0.10/1/Source/Design/MSReg.pas new file mode 100644 index 0000000..079d403 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/MSReg.pas @@ -0,0 +1,69 @@ + +////////////////////////////////////////////////// +// SQL Server Data Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +// SDAC registration +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I Sdac.inc} + +unit MSReg; +{$ENDIF} + +interface +uses + Classes, MSAccess, MSSQLMonitor, SdacVcl, MSScript{$IFNDEF STD}, MSLoader, MSDump, MSServiceBroker{$ENDIF}; + +procedure Register; + +implementation + +uses +{$IFDEF CLR} + CoreLab.Sdac.DataAdapter, +{$ENDIF} + DBAccess, DacReg; + +{$IFNDEF CLR} + {$IFDEF VER9} + {$R MSDesign9.res} + {$ELSE} + {$R MSDesign.res} + {$ENDIF} + {$IFDEF VER10P} + {$R MSDesign10p.res} + {$ENDIF} +{$ELSE} + {$R MSDesign.res} +{$ENDIF} + +procedure Register; +begin +{$IFNDEF STD} + RegisterCRBatchMove; +{$ENDIF} + + RegisterComponents('SQL Server Access', [TMSConnection]); + RegisterComponents('SQL Server Access', [TMSQuery]); + RegisterComponents('SQL Server Access', [TMSTable]); + RegisterComponents('SQL Server Access', [TMSStoredProc]); + RegisterComponents('SQL Server Access', [TMSSQL]); + RegisterComponents('SQL Server Access', [TMSScript]); + RegisterComponents('SQL Server Access', [TMSUpdateSQL]); + RegisterComponents('SQL Server Access', [TMSDataSource]); + +{$IFNDEF STD} + RegisterComponents('SQL Server Access', [TMSLoader]); + RegisterComponents('SQL Server Access', [TMSDump]); + RegisterComponents('SQL Server Access', [TMSServiceBroker]); + RegisterComponents('SQL Server Access', [TMSMetadata]); +{$ENDIF} + + RegisterComponents('SQL Server Access', [TMSSQLMonitor]); + RegisterComponents('SQL Server Access', [TMSConnectDialog]); +end; + +end. + diff --git a/internal/4.10.0.10/1/Source/Design/MSSPCallFrame.dfm b/internal/4.10.0.10/1/Source/Design/MSSPCallFrame.dfm new file mode 100644 index 0000000..4858117 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/MSSPCallFrame.dfm @@ -0,0 +1,19 @@ +inherited MSSPCallFrame: TMSSPCallFrame + inherited pnSQLSP: TPanel + inherited cbStoredProcNameSP: TComboBox + Width = 304 + end + object cbSystem: TCheckBox + Left = 411 + Top = 16 + Width = 58 + Height = 17 + Anchors = [akTop, akRight] + Caption = 'System' + Checked = True + State = cbChecked + TabOrder = 1 + OnClick = cbSystemClick + end + end +end diff --git a/internal/4.10.0.10/1/Source/Design/MSSPCallFrame.pas b/internal/4.10.0.10/1/Source/Design/MSSPCallFrame.pas new file mode 100644 index 0000000..d4cabcd --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/MSSPCallFrame.pas @@ -0,0 +1,79 @@ + +////////////////////////////////////////////////// +// SQL Server Access Components +// Copyright © 1998-2005 Core Lab. All right reserved. +// SDAC Stored Proc Call Generator Frame +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I SDac.inc} + +unit MSSPCallFrame; +{$ENDIF} + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, + Dialogs, DASPCallFrame, StdCtrls, Buttons, ExtCtrls, DBAccess; + +type + TMSSPCallFrame = class(TDASPCallFrame) + cbSystem: TCheckBox; + procedure cbStoredProcNameDropDown(Sender: TObject); + procedure cbSystemClick(Sender: TObject); + protected + function CreateProcCall(SPName: string; SPParams: TDAParams): string; override; + end; + +implementation + +{$IFDEF IDE} +{$R *.dfm} +{$ENDIF} +{$IFDEF MSWINDOWS} +{$R MSSPCallFrame.dfm} +{$ENDIF} + +uses + MSAccess; + +{ TMSSPCallFrame } + +function TMSSPCallFrame.CreateProcCall(SPName: string; SPParams: TDAParams): string; +var + MSSQL: TMSSQL; +begin + MSSQL := TMSSQL.Create(nil); + try + MSSQL.Connection := TMSConnection(UsedConnection); + Assert(MSSQL.Connection <> nil); + MSSQL.CreateProcCall(SPName); + SPParams.Assign(MSSQL.Params); + Result := MSSQL.SQL.Text; + finally + MSSQL.Free; + end; +end; + +procedure TMSSPCallFrame.cbStoredProcNameDropDown(Sender: TObject); +begin + try + if not FListGot and (UsedConnection <> nil) then begin + Editor.CheckConnection(UsedConnection); + TMSConnection(UsedConnection).GetStoredProcNames(cbStoredProcName.Items, cbSystem.Checked); + cbStoredProcNameSP.Items.Assign(cbStoredProcName.Items); + FListGot := True; + end; + except + Application.HandleException(Self); + end; +end; + +procedure TMSSPCallFrame.cbSystemClick(Sender: TObject); +begin + FListGot := False; +end; + +end. diff --git a/internal/4.10.0.10/1/Source/Design/MSSQLEditor.dfm b/internal/4.10.0.10/1/Source/Design/MSSQLEditor.dfm new file mode 100644 index 0000000..f33dd66 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/MSSQLEditor.dfm @@ -0,0 +1,30 @@ +inherited MSSQLEditorForm: TMSSQLEditorForm + Caption = 'MSSQLEditorForm' + PixelsPerInch = 96 + TextHeight = 13 + inherited BtnPanel: TPanel + inherited btExecute: TButton + Width = 99 + end + object btQueryAnalyzer: TButton + Left = 112 + Top = 8 + Width = 99 + Height = 25 + Anchors = [akLeft, akBottom] + Caption = 'Query Analyzer' + TabOrder = 3 + OnClick = btQueryAnalyzerClick + end + object btManagementStudio: TButton + Left = 216 + Top = 8 + Width = 99 + Height = 25 + Anchors = [akLeft, akBottom] + Caption = 'Management Studio' + TabOrder = 4 + OnClick = btManagementStudioClick + end + end +end diff --git a/internal/4.10.0.10/1/Source/Design/MSSQLEditor.pas b/internal/4.10.0.10/1/Source/Design/MSSQLEditor.pas new file mode 100644 index 0000000..f03b311 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/MSSQLEditor.pas @@ -0,0 +1,98 @@ + +////////////////////////////////////////////////// +// SQL Server Data Access Components +// Copyright © 1998-2005 Core Lab. All right reserved. +// MSSQL Editor +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I SDac.inc} + +unit MSSQLEditor; +{$ENDIF} +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, + Dialogs, DASQLEditor, ComCtrls, StdCtrls, Buttons, ExtCtrls, + OLEDBAccess; + +type + TMSSQLEditorForm = class(TDASQLEditorForm) + btQueryAnalyzer: TButton; + btManagementStudio: TButton; + procedure btQueryAnalyzerClick(Sender: TObject); + procedure btManagementStudioClick(Sender: TObject); + protected + procedure DoInit; override; + procedure DoError(E: Exception); override; + public + property SQL; + end; + +procedure DoError(Sender: TDASQLEditorForm; E: EOLEDBError); + +implementation + +{$IFDEF IDE} +{$R *.dfm} +{$ENDIF} +{$IFDEF MSWINDOWS} +{$R MSSQLEditor.dfm} +{$ENDIF} + +uses + MSAccess, DASQLFrame, DAParamsFrame, MSParamsFrame, DAMacrosFrame, DASPCallFrame, + MSSPCallFrame{$IFDEF SDAC}, MSDesign{$ENDIF}; + +procedure DoError(Sender: TDASQLEditorForm; E: EOLEDBError); +begin + Sender.ActivateFrame(Sender.SQLFrame); + Sender.ActiveControl := Sender.SQLFrame.meSQL; +end; + +{ TMSSQLEditorForm } + +procedure TMSSQLEditorForm.DoError(E: Exception); +begin + if E is EOLEDBError then + {$IFDEF CLR}CoreLab.SDac.Design.{$ENDIF}MSSQLEditor.DoError(Self, EOLEDBError(E)) + else + inherited; +end; + +procedure TMSSQLEditorForm.DoInit; +begin + FSQLFrame := AddTab(TDASQLFrame, shSQL) as TDASQLFrame; + FParamsFrame := AddTab(TMSParamsFrame, shParameters) as TDAParamsFrame; + FMacrosFrame := AddTab(TDAMacrosFrame, shMacros) as TDAMacrosFrame; + FSPCallFrame := AddTab(TMSSPCallFrame, shGeneratorSPC) as TDASPCallFrame; + + inherited; + +{$IFDEF SDAC} + btQueryAnalyzer.Visible := IsServerToolInstalled(stQueryAnalyser); + btManagementStudio.Visible := IsServerToolInstalled(stManagementStudio); + if btQueryAnalyzer.Visible and (SQL.Connection <> nil) then + btQueryAnalyzer.Visible := TMSConnection(SQL.Connection).Options.Provider <> prCompact; + if btManagementStudio.Visible and (SQL.Connection <> nil) then + btManagementStudio.Visible := TMSConnection(SQL.Connection).Options.Provider <> prCompact; +{$ENDIF} +end; + +procedure TMSSQLEditorForm.btQueryAnalyzerClick(Sender: TObject); +begin +{$IFDEF SDAC} + RunServerToolMSSQL(stQueryAnalyser, LocalComponent as TMSSQL); +{$ENDIF} +end; + +procedure TMSSQLEditorForm.btManagementStudioClick(Sender: TObject); +begin +{$IFDEF SDAC} + RunServerToolMSSQL(stManagementStudio, LocalComponent as TMSSQL); +{$ENDIF} +end; + +end. diff --git a/internal/4.10.0.10/1/Source/Design/MSStoredProcEditor.dfm b/internal/4.10.0.10/1/Source/Design/MSStoredProcEditor.dfm new file mode 100644 index 0000000..c05eeb9 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/MSStoredProcEditor.dfm @@ -0,0 +1,48 @@ +inherited MSStoredProcEditorForm: TMSStoredProcEditorForm + Width = 619 + Caption = 'MSStoredProcEditorForm' + PixelsPerInch = 96 + TextHeight = 13 + inherited BtnPanel: TPanel + Width = 611 + inherited imCorner: TImage + Left = 599 + end + inherited btOk: TBitBtn + Left = 447 + end + inherited btCancel: TBitBtn + Left = 528 + end + inherited btExecute: TButton + Width = 99 + end + inherited btnDataEditor: TBitBtn + Left = 110 + Width = 99 + end + object btnQuertAnalyzer: TBitBtn + Left = 212 + Top = 8 + Width = 99 + Height = 25 + Anchors = [akLeft, akBottom] + Caption = 'Query Analyzer' + TabOrder = 4 + OnClick = btnQuertAnalyzerClick + end + object btManagementStudio: TBitBtn + Left = 315 + Top = 8 + Width = 99 + Height = 25 + Anchors = [akLeft, akBottom] + Caption = 'Management Studio' + TabOrder = 5 + OnClick = btManagementStudioClick + end + end + inherited PageControl: TPageControl + Width = 595 + end +end diff --git a/internal/4.10.0.10/1/Source/Design/MSStoredProcEditor.pas b/internal/4.10.0.10/1/Source/Design/MSStoredProcEditor.pas new file mode 100644 index 0000000..7c875b5 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/MSStoredProcEditor.pas @@ -0,0 +1,80 @@ +////////////////////////////////////////////////// +// SQL Server Data Access Components +// Copyright © 1998-2005 Core Lab. All right reserved. +// MSStoredProc Editor +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I SDac.inc} + +unit MSStoredProcEditor; +{$ENDIF} +interface +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, + Dialogs, DAStoredProcEditor, ComCtrls, StdCtrls, Buttons, ExtCtrls; + +type + TMSStoredProcEditorForm = class(TDAStoredProcEditorForm) + btnQuertAnalyzer: TBitBtn; + btManagementStudio: TBitBtn; + procedure btnQuertAnalyzerClick(Sender: TObject); + procedure btManagementStudioClick(Sender: TObject); + protected + procedure DoInit; override; + public + property StoredProc; + end; + +implementation + +{$IFDEF IDE} +{$R *.dfm} +{$ENDIF} +{$IFDEF MSWINDOWS} +{$R MSStoredProcEditor.dfm} +{$ENDIF} + +uses + MSAccess, DASQLFrame, DASPCallFrame, MSSPCallFrame, DAParamsFrame, MSParamsFrame, + DAMacrosFrame, DAUpdateSQLFrame, DASQLGeneratorFrame{$IFDEF SDAC}, MSDesign, OLEDBAccess{$ENDIF}; + +{ TMSStoredProcEditorForm } + +procedure TMSStoredProcEditorForm.DoInit; +begin + FSQLFrame := AddTab(TMSSPCallFrame, shSQL) as TDASQLFrame; + FParamsFrame := AddTab(TMSParamsFrame, shParameters) as TDAParamsFrame; + FMacrosFrame := AddTab(TDAMacrosFrame, shMacros) as TDAMacrosFrame; + FSPCallFrame := AddTab(TMSSPCallFrame, shGeneratorSPC) as TDASPCallFrame; + FUpdateSQLFrame := AddTab(TDAUpdateSQLFrame, shEditSQL) as TDAUpdateSQLFrame; + FSQLGeneratorFrame := AddTab(TDASQLGeneratorFrame, shGenerator) as TDASQLGeneratorFrame; + + inherited; +{$IFDEF SDAC} + btnQuertAnalyzer.Visible := IsServerToolInstalled(stQueryAnalyser); + if btnQuertAnalyzer.Visible and (StoredProc.Connection <> nil) then + btnQuertAnalyzer.Visible := TMSConnection(StoredProc.Connection).Options.Provider <> prCompact; + + btManagementStudio.Visible := IsServerToolInstalled(stManagementStudio); + if btManagementStudio.Visible and (StoredProc.Connection <> nil) then + btManagementStudio.Visible := TMSConnection(StoredProc.Connection).Options.Provider <> prCompact; +{$ENDIF} +end; + +procedure TMSStoredProcEditorForm.btnQuertAnalyzerClick(Sender: TObject); +begin +{$IFDEF SDAC} + RunServerToolDataSet(stQueryAnalyser, LocalComponent as TCustomMSDataSet); +{$ENDIF} +end; + +procedure TMSStoredProcEditorForm.btManagementStudioClick(Sender: TObject); +begin +{$IFDEF SDAC} + RunServerToolDataSet(stManagementStudio, LocalComponent as TCustomMSDataSet); +{$ENDIF} +end; + +end. diff --git a/internal/4.10.0.10/1/Source/Design/MSUpdateSQLEditor.dfm b/internal/4.10.0.10/1/Source/Design/MSUpdateSQLEditor.dfm new file mode 100644 index 0000000..266ec15 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/MSUpdateSQLEditor.dfm @@ -0,0 +1,5 @@ +inherited MSUpdateSQLEditorForm: TMSUpdateSQLEditorForm + Caption = 'MSUpdateSQLEditorForm' + PixelsPerInch = 96 + TextHeight = 13 +end diff --git a/internal/4.10.0.10/1/Source/Design/MSUpdateSQLEditor.pas b/internal/4.10.0.10/1/Source/Design/MSUpdateSQLEditor.pas new file mode 100644 index 0000000..53fa479 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/MSUpdateSQLEditor.pas @@ -0,0 +1,43 @@ +////////////////////////////////////////////////// +// SQL Server Data Access Components +// Copyright © 1998-2005 Core Lab. All right reserved. +// MSStoredProc Editor +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I SDac.inc} + +unit MSUpdateSQLEditor; +{$ENDIF} +interface +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, + Dialogs, DAUpdateSQLEditor, ComCtrls, StdCtrls, Buttons, ExtCtrls; + +type + TMSUpdateSQLEditorForm = class(TDAUpdateSQLEditorForm) + protected + procedure DoInit; override; + end; + +implementation + +{$IFDEF IDE} +{$R *.dfm} +{$ENDIF} +{$IFDEF MSWINDOWS} +{$R MSUpdateSQLEditor.dfm} +{$ENDIF} + +uses + DAUpdateSQLFrame, DASQLGeneratorFrame; + +procedure TMSUpdateSQLEditorForm.DoInit; +begin + FUpdateSQLFrame := AddTab(TDAUpdateSQLFrame, shEditSQL) as TDAUpdateSQLFrame; + FSQLGeneratorFrame := AddTab(TDASQLGeneratorFrame, shGenerator) as TDASQLGeneratorFrame; + inherited; +end; + +end. diff --git a/internal/4.10.0.10/1/Source/Design/SdacAbout.dfm b/internal/4.10.0.10/1/Source/Design/SdacAbout.dfm new file mode 100644 index 0000000..8653052 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/SdacAbout.dfm @@ -0,0 +1,3148 @@ +object SdacAboutForm: TSdacAboutForm + Left = 389 + Top = 167 + BorderIcons = [biSystemMenu] + BorderStyle = bsDialog + Caption = 'About SDAC' + ClientHeight = 280 + ClientWidth = 390 + Color = clBtnFace + ParentFont = True + OldCreateOrder = True + Position = poScreenCenter + OnMouseMove = FormMouseMove + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 13 + object Bevel1: TBevel + Left = 8 + Top = 8 + Width = 123 + Height = 263 + end + object Image1: TImage + Left = 9 + Top = 9 + Width = 120 + Height = 260 + AutoSize = True + Picture.Data = { + 07544269746D6170D66D0100424DD66D01000000000036000000280000007800 + 0000040100000100180000000000A06D0100C30E0000C30E0000000000000000 + 0000020000020000020000020000020000020000020000020000020000020000 + 0200000200000200000200000200000200000200000200000200000200000200 + 0002000002000002000002000002000002000002000002000002000002000002 + 0000020000020000020000020000020000020000020000020000020000020000 + 0200000200000200000200000200000200000200000200000200000200000200 + 0002000002000002000002000002000002000002000002000002000002000002 + 0000020000020000020000020000020000020000020000020000020000020000 + 0200000200000200000200000200000200000200000200000200000200000200 + 0002000002000002000002000002000002000002000002000002000002000002 + 0000020000020000020000020000020000020000020000020000020000020000 + 0200000200000200000200000200000200000200000200000200000200000200 + 0002000002000002000002000025258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C02000002000025258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C02000002000025258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C02 + 000002000025258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C02000002000025258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C02000002000025258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C02000002000025258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C02 + 000002000025258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C26268C26268C26268C26268C27278D27278D27278D27278D27278D27278D27 + 278D26268C26268C26268C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C02000002000025258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C26268C26268C + 27278D28288D28288E29298E2A2A8F2B2B8F2C2C902D2D902D2D902E2E912E2E + 912E2E912E2E912E2E912D2D902C2C902B2B8F29298E28288E28288D27278D26 + 268C26268C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C02000002000025258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C26268C27278D28 + 288D28288E29298E2A2A8F2C2C902D2D902E2E91303092323293333393343494 + 3636953737953939963A3A973A3A973A3A973A3A973838963636953434943232 + 933030922E2E912B2B8F29298E28288D27278D26268C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C02000002000025258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C26268C26268C2727 + 8D28288D28288E29298E2A2A8F2B2B8F2C2C902D2D902E2E9130309232329334 + 34943737953A3A973C3C9840409A42429B45459D47479E49499F4A4A9F49499F + 48489E46469E43439C40409A3C3C983838963434943030922D2D902A2A8F2828 + 8E27278D26268C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C02 + 000002000025258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C26268C + 26268C27278D27278D27278D26268C26268C25258C25258C25258C25258C2525 + 8C25258C26268C28288E2C2C902F2F913434943A3A9740409A45459D4B4BA051 + 51A35555A55858A75959A85A5AA85858A75555A55151A34B4BA046469E40409A + 3A3A973535953030922D2D9029298E28288D26268C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C02000002000025258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C26268C26268C26268C + 27278D27278D27278D27278D27278D27278D27278D26268C26268C25258C2525 + 8C2E2E9139399644449C4D4DA15757A65E5EAA6363AD6767AF6868AF6767AF63 + 63AD5E5EAA5757A75050A348489E40409A3A3A973434942E2E912B2B8F28288E + 27278D26268C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C02000002000025258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C26268C27278D27278D28288D28 + 288E29298E29298E2A2A8F2B2B8F2B2B8F2B2B8F2B2B8F2B2B8F2B2B8F2A2A8F + 2A2A8F29298E28288E28288D27278D25258C28288E39399648489E5656A66262 + AC6A6AB17171B47474B57373B56F6FB36969B06262AC5858A74F4FA245459D3D + 3D993535952F2F912B2B8F28288E27278D26268C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C02000002000025258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C26268C27278D28288D28288E2929 + 8E2B2B8F2C2C902D2D902E2E912F2F9130309231319231319232329332329331 + 31923131923030922F2F912E2E912E2E912D2D902B2B8F2A2A8F28288E27278D + 26268C2A2A8F3F3F9A5151A36262AC6F6FB37878B87C7CBA7D7DBA7A7AB97373 + B56969B05E5EAA5353A448489E3F3F9A3636953030922C2C9028288E27278D26 + 268C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C02 + 000002000025258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C26268C27278D28288D28288E29298E + 2B2B8F2D2D902E2E913030923232933434943535953636953737953838963838 + 963838963838963838963737953636953535953434943333933232933030922F + 2F912E2E912C2C902A2A8F28288E27278D25258C3636954D4DA16262AC7272B5 + 7E7EBB8484BE8686BF8181BD7A7AB96F6FB36363AC5656A649499F3F3F9A3636 + 952F2F912B2B8F28288D26268C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C02000002000025258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C26268C27278D28288D29298E2B + 2B8F2D2D902F2F913131923434943636953838963A3A973B3B983C3C983E3E99 + 3E3E993E3E993E3E993E3E993D3D993C3C983B3B983A3A973A3A973838963737 + 953535953434943333933232933030922E2E912D2D902B2B8F29298E28288D26 + 268C3030924B4BA06363AC7575B68383BE8B8BC28C8CC28787C07E7EBB7272B5 + 6363AD5656A649499F3D3D993434942E2E912A2A8F28288D26268C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C02000002000025258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C26268C27278D28288D2929 + 8E2C2C902E2E913030923434943636953939963B3B983E3E9940409A41419B42 + 429B43439C43439C43439C3E3E963333872929772424711C1C651B1B6317175E + 12125612125617175E1919631A1A6520206F2323742A2A822F2F8F3030922E2E + 912E2E912C2C902A2A8F28288D26268C2E2E914C4CA16666AE7B7BBA8989C191 + 91C59191C58B8BC28080BC7272B56363AC5353A446469E3B3B983333932D2D90 + 29298E27278D26268C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C02000002000025258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C26268C27278D28288D + 29298E2C2C902E2E913131923434943838963B3B983E3E9941419B43439C4545 + 9D46469E46469E44449B35358725257119196012125612125612125612125612 + 1256121256121256121256121256121256121256121256121256121256121256 + 1212561717601F1F6F26267F2D2D902D2D902B2B8F29298E28288D26268C3333 + 935151A36D6DB28181BD9090C49696C89494C78C8CC38080BC6F6FB35F5FAB50 + 50A342429B3838963030922B2B8F28288D26268C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C02 + 000002000025258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C26268C27278D28 + 288D29298E2B2B8F2E2E913131923535953939963D3D9940409A43439C46469E + 48489E49499F4A4A9F3A3A8A26267115155A1212561212561212561212561212 + 5612125612125612125612125612125612125612125612125612125612125612 + 125612125612125612125612125612125612125614145A1D1D6C2727822D2D90 + 2B2B8F29298E28288D25258C3A3A975A5AA87575B68A8AC19696C89A9ACA9696 + C88C8CC27C7CBA6B6BB15A5AA84B4BA03E3E993434942E2E9129298E27278D26 + 268C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C02000002000025258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2626 + 8C27278D28288E2B2B8F2E2E913131923434943939963D3D9941419B45459D48 + 489E4B4BA04B4BA048489B2E2E7A17175D121256121256121256121256121256 + 12125612125612125613135814145A15155B16165C16165D17175D17175D1616 + 5D16165C15155B14145A13135812125612125612125612125612125612125612 + 125612125615155C2020742B2B8D2A2A8F28288E27278D25258C45459D6464AD + 7F7FBB9292C69C9CCB9D9DCB9696C88888C07777B76464AD5353A444449C3939 + 963030922B2B8F28288D26268C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C02000002000025258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 26268C27278D28288E2A2A8F2D2D903030923434943838963D3D9941419B4545 + 9D49499F4C4CA14E4EA247479A2C2C7714145912125612125612125612125612 + 125612125714145A16165D1818601A1A621B1B641D1D661D1D671E1E681E1E69 + 1F1F691F1F691E1E691E1E681D1D671C1C651B1B6419196118186016165D1414 + 5A1212571212561212561212561212561212561313591E1E7129298B29298E28 + 288D26268C3030925252A47272B58B8BC29A9ACAA0A0CD9E9ECC9292C68282BD + 6F6FB35C5CA94B4BA03E3E993434942D2D9028288E27278D25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C02000002000025258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C26268C27278D28288D29298E2C2C902E2E913333933737953C3C9840409A + 45459D4A4A9F4D4DA14F4FA249499B2A2A731313571212561212561212561212 + 5612125715155B17175E1A1A621C1C651E1E6820206B21216D23236F24247125 + 257225257326267427277527277526267425257325257224247123236F21216D + 20206A1E1E681C1C651A1A6217175E15155B1212571212561212561212561212 + 561313581C1C6E28288A28288E27278D25258C40409A6363AC8080BC9696C8A1 + A1CDA3A3CE9B9BCA8C8CC27979B86565AE5252A443439C3737952F2F912A2A8F + 27278D26268C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C02 + 000002000025258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C26268C27278D28288E2A2A8F2E2E913131923535953A3A9740 + 409A44449C49499F4C4CA15050A35050A1343480141459121256121256121256 + 12125614145917175D1919611D1D661F1F6921216D2323702525732727752929 + 782A2A7A2B2B7B2C2C7D2D2D7E2D2D7E2D2D7F2D2D7F2D2D7E2D2D7E2C2C7D2B + 2B7B2A2A7A29297827277525257323237021216D1F1F691C1C6519196117175D + 1313581212561212561212561212561313591F1F7429298D28288D26268C2E2E + 915252A47474B58E8EC39F9FCCA6A6D0A2A2CE9595C78282BD6E6EB25A5AA849 + 499F3B3B983232932C2C9028288D26268C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C02000002000025258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C26268C27278D28288D29298E2C2C902F2F913434943939 + 963E3E9943439C48489E4C4CA15050A35151A34343921D1D6312125612125612 + 125612125614145A18185F1B1B631E1E6821216C2323702626742828772B2B7B + 2D2D7E2E2E803030823131843232863333873434883434883434893434893434 + 883434883333873232863131843030822E2E802D2D7E2B2B7B28287726267423 + 237021216C1E1E681B1B6318185F14145A12125612125612125612125615155E + 22227D28288E27278D25258C43439C6767AF8686BF9B9BCAA6A6D0A6A6D09C9C + CB8B8BC27676B76262AC4F4FA240409A3434942E2E9128288E27278D25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C02000002000025258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C26268C27278D28288E2B2B8F2E2E91323293 + 3636953B3B9840409A46469E4B4BA04F4FA25151A34E4E9E2A2A721212561212 + 5612125612125614145A18185F1B1B641F1F6922226E2525722828762B2B7B2D + 2D7E2F2F8131318433338735358A36368C37378D39398F3939903A3A913A3A92 + 3B3B933B3B933A3A923A3A9139399039398F37378D36368C35358A3333873131 + 842F2F812E2E7E2C2C7B28287625257222226E1F1F691B1B6418185F14145A12 + 125612125612125612125618186525258728288D26268C3535955A5AA87B7BBA + 9595C7A5A5D0AAAAD2A2A2CE9292C67F7FBB6969B05555A545459D3838962F2F + 912A2A8F27278D26268C25258C25258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C02000002000025258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C26268C28288D29298E2C2C902F + 2F913434943939963F3F9A44449C49499F4E4EA25151A35353A43A3A8516165A + 12125612125612125614145918185F1B1B641F1F6923236F2626742929782C2C + 7D2F2F8131318434348836368B38388E3939903B3B933C3C953E3E973F3F983F + 3F9940409A41419B41419B41419B40409A40409A3F3F993F3F983E3E973C3C95 + 3B3B9339399038388E3C3C8D43438F3E3E8A3232822C2C7D2929782626742222 + 6E1F1F691B1B6418185F14145912125612125612125613135821217728288D27 + 278D28288E4C4CA17070B48E8EC3A2A2CEAAAAD2A7A7D19999C98686BF7070B4 + 5C5CA94A4A9F3B3B983232932C2C9028288D26268C25258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C02 + 000002000025258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C25258C25258C26268C27278D28288D2A2A + 8F2E2E913131923636953B3B9841419B47479E4C4CA15151A35353A44949971F + 1F6612125612125612125613135817175D1A1A631F1F6922226E252574292979 + 2C2C7E2F2F8232328634348A37378D3939913B3B943D3D973F3F9940409C4242 + 9D43439F4343A04444A14545A24545A24545A34545A34545A24545A24444A143 + 43A042429E42429D40409C40409948489B54549F55559D505099474793383889 + 2F2F822C2C7D28287825257422226E1E1E691A1A6317175D1313581212561212 + 561616591D1D6825258527278D25258C40409A6565AE8686BF9E9ECCAAAAD2AA + AAD29F9FCC8D8DC37878B86363AC4F4FA240409A3434942E2E9128288E27278D + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C25258C25258C02000002000025258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C25258C26268C27278D + 28288E2B2B8F2E2E913333933838963E3E9944449C4A4A9F4F4FA25353A45454 + A332327C12125612125612125612125615155C1A1A621D1D6821216D25257328 + 28782C2C7E2F2F8232328735358B38388F3A3A933D3D963F3F9941419C43439F + 4444A14646A44747A54848A74848A74949A94A4AAA4A4AAA4A4AAA4A4AAA4A4A + AA4A4AAA4949A94848A74848A74646A54646A45151A76060AC6060AA4E4EA04B + 4B9C55559F4F4F9A3B3B8D3232872F2F822C2C7D28287825257221216D1D1D67 + 19196115155B12125616165919195C16165A1F1F7627278D26268C3434945959 + A87B7BBA9797C8A7A7D1ABABD3A4A4CF9494C78080BC6969B05555A544449C38 + 38962F2F912A2A8F27278D26268C25258C25258C25258C25258C25258C25258C + 25258C25258C25258C25258C25258C02000002000025258C25258C25258C2525 + 8C25258C25258C25258C25258C25258C25258C25258C25258C25258C26268C26 + 268C28288D29298E2C2C903030923434943A3A9740409A46469E4C4CA15151A3 + 5555A54E4E9C21216812125612125612125614145A1818601C1C6620206C2424 + 722828772B2B7D2F2F8232328735358B3838903B3B943E3E9840409C42429E44 + 44A14646A44848A74949A94A4AAA4B4BAC4C4CAD4D4DAF4E4EB04E4EB04E4EB1 + 4E4EB14E4EB14E4EB14E4EB04E4EB04D4DAF4C4CAD4B4BAC5757AF6B6BB76A6A + B55656AA4545A142429E5050A25A5AA452529E41419435358B3232872F2F822B + 2B7D28287724247121216C2020681C1C611C1C5F1A1A5D141458121256191968 + 27278A26268C29298E4D4DA17171B49090C4A4A4CFACACD3A8A8D19A9ACA8686 + BF7070B45B5BA849499F3A3A973131922B2B8F28288D26268C25258C25258C25 + 258C25258C25258C25258C25258C25258C25258C25258C02000002000025258C + 25258C25258C25258C25258C25258C25258C25258C25258C25258C25258C2525 + 8C26268C27278D28288E2A2A8F2E2E913232933737953D3D9943439C49499F4F + 4FA25353A45656A641418D16165A12125612125612125616165D1A1A631F1F69 + 2323702727752A2A7B2F2F8132328635358B3838903B3B943E3E9840409C4343 + A04545A34747A64949A94B4BAB4C4CAD4E4EAF4F4FB15050B35151B45252B552 + 52B65252B65353B75353B75353B75353B75252B65252B65252B55151B45A5AB7 + 7373C07474BF5B5BB34D4DAC4949A94747A64545A34F4FA45E5EA85757A44444 + 9738389035358B32328630308133337F34347C3131782C2C712424691B1B6013 + 135612125612125615155D23238127278D25258C42429B6666AE8787C09F9FCC + ABABD3ABABD3A0A0CD8D8DC37777B76161AC4D4DA13E3E993333932C2C902828 + 8E26268C25258C25258C25258C25258C25258C25258C25258C25258C25258C02 + 000002000025258C25258C25258C25258C25258C25258C25258C25258C25258C + 25258C25258C26268C27278D28288E2B2B8F2E2E913434943939963F3F9A4545 + 9D4B4BA05151A35555A55555A42E2E7612125512125512125514145918185F1D + 1D6621216C2525722929782D2D7E30308334348938388E3B3B923E3E9740409B + 43439F4646A34848A64A4AA94C4CAC4E4EAE4F4FB15050B25252B55353B65454 + B75454B85555B95656BA5656BB5656BB5656BB5656BB5656BB5656BB5656BA55 + 55B95C5CBC7676C67C7CC76262BB5252B34F4FB14E4EAE4C4CAC4A4AA94848A6 + 5454A96262AC5A5AA649499B3E3E9440409248489346468E40408736367F2C2C + 7624246D1D1D6618185E1313571212551212551212561E1E7227278D26268C37 + 37955C5CA97E7EBB9999C9AAAAD2ADADD4A4A4CF9393C67E7EBB6767AF5252A4 + 41419B3535952E2E9129298E27278D25258C25258C25258C25258C25258C2525 + 8C25258C25258C02000002000025258C25258C25258C25258C25258C25258C25 + 258C25258C25258C25258C26268C28288D29298E2C2C903030923535953A3A97 + 41419B47479E4D4DA15252A45656A64C4C991D1D631212551212551212551616 + 5B1A1A621F1F6823236F2727752B2B7C2F2F8133338736368C3A3A923D3D9640 + 409B43439F4646A34848A64A4AA94C4CAC4E4EAF5050B25252B55353B65454B8 + 5555BA5656BB5757BC5858BE5858BE5959BF5959BF5959C05959C05959C05959 + C05959BF5959BF5959BF6C6CC68787D06E6EC55555BA5454B85353B65252B450 + 50B24E4EAF4C4CAC4C4CAA5454AB6464B06161AC5757A45858A254549D464694 + 3A3A8A3131822B2B7A27277522226E1F1F681A1A6215155A1212561212551212 + 5518186526268A26268C2D2D905151A37575B69393C6A7A7D1AEAED4A9A9D199 + 99C98484BE6D6DB25757A745459D3838962F2F912A2A8F27278D26268C25258C + 25258C25258C25258C25258C25258C02000002000025258C25258C25258C2525 + 8C25258C25258C25258C25258C26268C27278D28288D2A2A8F2E2E9131319237 + 37953D3D9943439C4A4A9F5050A35454A55757A73C3C86141458121255121255 + 13135718185F1D1D6621216C2525722A2A792D2D7E32328535358A39398F3C3C + 943F3F9942429D4545A24848A64A4AA94D4DAD4E4EB05050B25252B55454B755 + 55BA5656BB5858BD5858BE5959C05A5AC15B5BC25B5BC35C5CC35C5CC45C5CC4 + 5C5CC45C5CC45C5CC45C5CC45C5CC35B5BC26E6EC98C8CD57474CA5A5ABF5858 + BD5656BB5555BA5454B75252B55050B24E4EB04D4DAD5656AE6666B36464AF58 + 58A745459B3F3F9638388F3535893131832D2D7E29297929297326266E222268 + 1C1C6016165916165915155816165E23238127278D25258C46469E6C6CB18C8C + C3A4A4CFAEAED4ABABD39E9ECC8A8AC17373B55D5DA94A4A9F3B3B983131922B + 2B8F28288D26268C25258C25258C25258C25258C25258C02000002000025258C + 25258C25258C25258C25258C25258C25258C26268C27278D28288E2B2B8F2E2E + 913333933939963F3F9A45459D4B4BA05151A35656A65454A229297012125512 + 125512125515155A1A1A611F1F6823236F2727752B2B7C30308233338737378D + 3B3B923E3E9742429C4444A04747A54A4AA94C4CAC4E4EB05050B25252B55454 + B85656BA5757BC5858BE5959C05A5AC15B5BC35C5CC45D5DC45D5DC65E5EC65E + 5EC75E5EC75E5EC75E5EC75E5EC75E5EC75E5EC75E5EC75E5EC66565C87E7ED2 + 8B8BD67373CC5E5EC25959C05858BE5757BC5656BA5454B85252B55050B24E4E + AF5454AF5656AE4A4AA64444A041419C3E3E973D3D933C3C8F3D3D8B3F3F8938 + 388233337B2E2E7527276D2222661B1B5F17175A17175A17175A1F1F7427278D + 25258C3D3D996363AC8585BF9F9FCCADADD4AEAED4A3A3CE9090C47979B86262 + AC4E4EA23F3F9A3434942D2D9028288E26268C25258C25258C25258C25258C02 + 000002000025258C25258C25258C25258C25258C25258C26268C27278D29298E + 2C2C902F2F913434943A3A9740409A47479E4D4DA15353A45757A64F4F9C1E1E + 6312125512125512125617175C1B1B6420206B2525712929782D2D7E32328535 + 358A3939903D3D9540409A43439F4646A34949A84C4CAC4E4EAF5050B25252B5 + 5454B85656BB5757BC5959BF5A5AC05B5BC25C5CC45D5DC45E5EC65E5EC75E5E + C75F5FC86060C96060C96060C96060C96060C96060C96060C96060C96060C960 + 60C95F5FC86565CA8181D49292DA7575CE5E5EC55B5BC25A5AC05858BE5757BC + 5656BA5454B85252B55050B24E4EAF4B4BAB4949A74848A44E4EA35252A25353 + 9E4F4F9942428F3C3C893535812D2D7929297322226B1E1E641A1A5E16165917 + 175A19195C1C1C6A26268A26268C3434945959A87D7DBA9999C9AAAAD2AFAFD5 + A6A6D09595C77F7FBB6868AF5353A442429B3636952E2E9129298E27278D2525 + 8C25258C25258C02000002000025258C25258C25258C25258C25258C26268C28 + 288D29298E2D2D903030923535953C3C9842429B49499F4F4FA25454A55757A7 + 43438E15155A11115511115514145918185F1D1D6722226D2626742A2A7A2E2E + 8133338736368C3A3A923D3D9741419D4444A14747A64A4AAA4D4DAE4F4FB151 + 51B55353B75555BA5656BC5A5AC05F5FC36161C46262C66363C76464C96363C9 + 6464CA6565CB6464CB6565CD6464CC6363CC6161CC6060CC6060CC6060CC6060 + CC6060CC6060CB6060CB6060CB5F5FC96464CB8080D68F8FDB7A7AD15F5FC75B + 5BC45A5AC25959C15757BE5656BC5555BA5353B75151B54F4FB15252B06161B3 + 6262B15D5DAC5050A34242993C3C9338388D3232862E2E802A2A792525732020 + 6C1C1C6518185F13135812125615155819196125258526268C2C2C905050A374 + 74B59292C6A7A7D1AFAFD5AAAAD29A9ACA8585BF6E6EB25858A746469E3A3A97 + 3030922A2A8F28288D26268C25258C02000002000025258C25258C25258C2626 + 8C27278D28288E2A2A8F2E2E913232933737953E3E9944449C4B4BA05151A356 + 56A65858A733337C11115511115511115515155B1A1A621F1F69232370282876 + 2C2C7D30308334348938388F3C3C943F3F9A43439F4646A44949A84B4BAC4E4E + B05050B35252B65454B95656BC5757BE5D5DC16262C56464C76565C86565C966 + 66CA6565CB6666CB6767CD6666CD6666CE6767CE6666CE6666CE6565CE6262CD + 6161CD6161CD6161CD6161CD6161CC6161CC6161CC6060CC6060CB6767CE7C7C + D59393DD7A7AD26262C95D5DC65B5BC45A5AC25959C05757BE5656BB5656BA5E + 5EBB6F6FC06B6BBB5D5DB35050AB4646A342429E3F3F993B3B9437378E343489 + 3030822B2B7C27277522226E1D1D6719196014145912125612125616165B2222 + 7C26268C25258C45459D6A6AB18B8BC2A3A3CEADADD4ABABD39E9ECC8B8BC275 + 75B65E5EAA4B4BA03D3D993333932C2C9028288E26268C02000002000025258C + 25258C26268C27278D28288E2B2B8F2E2E9134349439399640409A46469E4C4C + A15252A45757A65454A225256C11115511115512125617175D1C1C6420206B25 + 25722929792E2E8032328636368C3A3A923D3D9741419C4444A14747A64A4AAA + 4D4DAE4F4FB25151B55353B85555BB5757BE5959C05C5CC36464C76565C86666 + CA6767CB6767CC6767CB6868CD6767CD6868CE6868CE6767CE6767CF6868CF67 + 67CF6767CF6666CE6363CE6262CE6262CD6262CD6262CD6262CD6161CD6161CC + 6161CC6161CC6868CE8282D88F8FDC7B7BD46565CB5D5DC75C5CC55B5BC45A5A + C25959C06969C57A7AC96F6FC35C5CB94F4FB14C4CAD4A4AA94747A54444A040 + 409B3D3D9639399035358B3131852D2D7E2828772424711F1F691A1A6216165B + 1111551111551313561E1E7227278D25258C3B3B986060AB8282BD9D9DCBABAB + D3ACACD3A3A3CE9191C57B7BBA6565AE5151A341419B3636952E2E9129298E02 + 000002000025258C26268C28288D29298E2C2C903030923535953A3A9741419B + 48489E4E4EA25353A45757A74B4B971A1A5F11115511115514145918185F1D1D + 6722226E2626742B2B7B2F2F8233338837378E3B3B943F3F9942429E4545A348 + 48A84B4BAC4E4EB05050B35353B75454BA5656BC5858BF5959C15B5BC36060C6 + 6767CA6767CA6868CC6868CC6969CE6969CE6868CE6969CE6868CE6868CF6969 + CF6868CF6868D06868D06767D06767D06464CF6262CE6262CE6262CE6262CE62 + 62CE6262CD6262CD6161CD6161CC6161CC6666CE8080D89595DF7878D35F5FC9 + 5D5DC75D5DC65E5EC56A6AC88282D17474CA5A5ABE5454B95252B65050B34D4D + AF4B4BAC4848A74545A342429D3E3E983A3A9236368C3232862E2E802A2A7A25 + 257320206C1C1C6517175E1313571111551212561A1A6726268A26268C323293 + 5656A67979B89595C7A7A7D1ACACD3A6A6D09797C88282BD6C6CB15757A74646 + 9E3A3A9731319202000002000027278D28288D2A2A8F2E2E913232933737953D + 3D9943439C4A4A9F5050A35454A55757A73E3E8814145811115511115515155B + 1A1A621F1F692323702828772C2C7D30308335358A3939903C3C9640409B4444 + A04747A54A4AA94D4DAE4F4FB25151B55353B85555BB5757BE5959C05A5AC25B + 5BC45C5CC66464C96969CB6969CC6969CD6A6ACE6969CF6A6ACF6A6ACF6969CF + 6A6ACF6969CF6969D06969D06868D06868D06868D06767D06565CF6262CE6262 + CE6262CE6262CE6262CE6262CE6262CE6262CD6262CD6161CD6161CC7979D597 + 97E18080D75F5FCA5F5FC95E5EC86E6ECD8383D57676CE6060C45959C05757BE + 5555BB5353B85151B54E4EB14C4CAD4949A94646A443439F3F3F9A3C3C943838 + 8F3434893030822B2B7C27277522226E1D1D6718185F14145911115512125517 + 175F24248426268C28288D4A4A9F6E6EB28C8CC3A2A2CEAAAAD2A8A8D19C9CCB + 8989C17474B55E5EAA4C4CA13F3F9A02000002000028288E2B2B8F2E2E913333 + 933939963F3F9A45459D4B4BA05151A35656A65555A42E2E7611115511115512 + 125617175D1C1C6420206B2525722929792E2E8032328636368C3A3A923D3D97 + 41419D4545A24848A64B4BAB4D4DAF5050B35252B65454BA5656BC5858BF5959 + C15B5BC35C5CC55D5DC75E5EC86565CB6B6BCD6B6BCE6A6ACF6B6BCF6B6BCF68 + 68CF6868CF6969CF6868CF6868D06868D06969D06969D06868D06868D06868D0 + 6565CF6262CE6262CE6262CE6262CE6262CE6262CE6262CE6262CE6262CD6262 + CD6B6BD18B8BDD8D8DDD6D6DD16060CC6060CB6B6BCE8484D87F7FD56464CA5C + 5CC45B5BC35959C15757BE5656BC5454B95252B65050B24D4DAE4A4AAA4747A6 + 4444A140409C3D3D9639399035358B3131842D2D7E2828772424701F1F691A1A + 6215155B11115512125617175B22227C27278D25258C3E3E996262AC8282BD9A + 9ACAA7A7D1A9A9D19F9FCC8F8FC47B7BBA6767AF5454A50200000200002C2C90 + 3030923434943A3A9740409A47479E4D4DA15252A45757A64C4C991D1D631111 + 5511115514145918185F1D1D6722226D2626742B2B7B2F2F8233338837378E3B + 3B943F3F9942429F4646A44949A94C4CAD4E4EB15151B55353B85555BB5757BE + 5959C05A5AC25B5BC45C5CC65D5DC75E5EC85F5FC96666CC6C6CCF6C6CD06C6C + CF6B6BD06B6BD06464CE6262CD6262CE6262CE6262CE6464CF6969D06969D069 + 69D06868D06868D06565CF6262CE6262CE6262CE6262CE6262CE6262CE6262CE + 6262CE6262CE6262CE7E7ED89898E27A7AD76363CE6161CC6060CC8181D88585 + D96A6ACD5E5EC85D5DC75C5CC65B5BC45A5AC25858BF5757BD5555BA5353B750 + 50B34E4EB04B4BAC4848A74545A342429D3E3E983A3A9236368C3232862E2E80 + 2A2A7925257220206B1C1C6417175D1212561212561616591F1F7127278C2626 + 8C3131925454A57575B69191C5A2A2CEA7A7D1A2A2CE9595C78383BE6F6FB302 + 00000200003232933737953C3C9843439C49499F4F4FA25353A45757A641418C + 15155A11115511115515155B1A1A621F1F692323702828772C2C7D3030833434 + 8A3939903C3C9640409B4444A04747A54A4AAA4D4DAE4F4FB25151B55454B956 + 56BC5757BE5959C15B5BC35C5CC45D5DC75E5EC85F5FC95F5FC96060CB6767CE + 6D6DD06D6DD06D6DD16D6DD06C6CD06464CF6262CE6262CE6262CE6262CE6464 + CF6969D06969D06969D06969D06868D06666CF6262CE6262CE6262CE6262CE62 + 62CE6262CE6262CE6262CE6262CE6464CF8D8DDE9292E06969D06262CD6161CD + 7070D28F8FDE7272D36060CB5F5FC95F5FC95D5DC75D5DC65C5CC45A5AC35959 + C05757BE5555BB5353B85151B54F4FB14C4CAD4949A94646A443439F3F3F9A3C + 3C9438388F3434892F2F822B2B7B26267422226D1D1D6718185F141459131356 + 18185B1A1A6425258826268C25258C45459D6767AF8484BE9898C9A3A3CEA2A2 + CE9999C98A8AC10200000200003939963F3F9A45459D4B4BA05050A35454A555 + 55A42D2D7611115511115512125717175E1B1B6420206B2424722929792D2D80 + 31318635358C3939923D3D9741419D4545A24848A64B4BAC4D4DB04F4FB35252 + B75454BA5656BD5757BF5959C25A5AC45B5BC65C5CC75D5DC85E5EC95E5ECA5F + 5FCB6060CC6868CE6D6DD16C6CD16D6DD16D6DD16C6CD16363CF6161CE6161CE + 6161CE6161CE6363CF6969D06969D06868D06868D06868D06565CF6161CE6161 + CE6161CE6161CE6161CE6161CE6161CE6161CE6262CE7070D49696E27F7FDA61 + 61CE6161CD6666CF8282DA8686DB6262CD6060CC5F5FCB5E5ECA5E5EC95D5DC8 + 5C5CC75B5BC55A5AC35858C15757BF5555BC5454BA5353B75151B34D4DAE4B4B + AB4747A64343A03F3F9B3C3C9638389034348A3030832C2C7D2727762323701E + 1E681A1A6215155B16165918185B16165D22227E27278D26268C3434945555A5 + 7474B58C8CC29A9ACA9E9ECC9A9ACA02000002000040409A46469E4C4CA15151 + A35555A54B4B991D1D6311115511115514145A1818601D1D6722226E2626742A + 2A7B2F2F8233338837378E3B3B943E3E994444A04D4DA65555AC5858B15A5AB5 + 5858B75353B85454BB5656BE5858C05959C25B5BC45C5CC65D5DC75E5EC95E5E + C95F5FCB6060CC6060CC6060CC6868CF6E6ED16E6ED16D6DD26D6DD26C6CD163 + 63CF6161CE6161CE6161CE6161CE6363CF6969D06969D06969D06868D06868D0 + 6565CF6161CE6161CE6161CE6161CE6161CE6161CE6161CE6161CE6464CF7B7B + D89595E27272D46161CE6262CE7272D48A8ADD7676D56161CD6161CC6060CC5F + 5FCB5F5FCB5E5EC95D5DC85D5DC75B5BC65A5AC45959C25D5DC26868C46A6AC2 + 6A6AC16B6BBF6262B85959B14F4FAA4646A441419D3D3D9739399235358C3131 + 862D2D8029297924247220206B1B1B641A1A6019195C1616591212561C1C7028 + 288C27278D25258C41419B5F5FAB7979B88C8CC29595C702000002000048489E + 4D4DA15252A45555A53B3B8613135811115512125616165C1A1A631F1F692323 + 702828772C2C7D30308334348A3838903C3C963F3F9B4747A25555AA5A5AB05E + 5EB46060B86262BB6464BE6161C05858BF5858C15A5AC35B5BC55C5CC75D5DC8 + 5E5EC95E5ECA5F5FCB6060CC6060CC6060CC6060CD6969CF6F6FD16E6ED26E6E + D26D6DD26D6DD26363CF6161CE6161CE6161CE6161CE6363CF6A6AD16A6AD169 + 69D06969D06868D06565CF6262CE6363CF6161CE6161CE6161CE6161CE6464CF + 6262CE6868D18989DE8D8DDF6969D16161CE6565CF8080D98B8BDE6969D06262 + CD6161CD6161CC6060CC6060CC5F5FCB5E5EC95E5EC95D5DC85D5DC86565C879 + 79CF8484D18686D18383CD8080CA7A7AC57575C26868B85858AF4646A442429F + 3E3E993B3B9437378E3333882F2F822A2A7B26267422226E1E1E681E1E641C1C + 6012125611115517176226268628288D26268C29298E46469E6161AC7575B602 + 00000200004F4FA25252A44F4F9E27276F11115511115514145918185F1C1C66 + 21216C2525732929792E2E8031318535358B3939913D3D9741419C4848A35656 + AB5C5CB05F5FB46161B86464BC6767BF6868C36969C46666C55B5BC35B5BC55C + 5CC65D5DC75E5EC95F5FCA5F5FCA6060CB6060CB6060CC6161CC6161CC6A6AD0 + 6F6FD26F6FD16E6ED16E6ED16D6DD16464CE6161CD6161CD6161CD6161CD6363 + CE6A6AD06A6AD06A6AD06969D06969D06A6AD07272D47676D57B7BD87A7AD77A + 7AD77D7DD87C7CD87878D68383DB9A9AE48383DB6363CE6363CE6A6AD18686DC + 8181D96565CF6262CC6262CC6161CC6161CC6060CB6060CB5F5FCA5E5EC95E5E + C96C6CCD8383D58F8FD98C8CD78989D48585D08484CE8282CB7D7DC77979C36F + 6FBD5B5BB14646A54343A03F3F9A3C3C9538388F3434893030832C2C7D282877 + 23237024246C25256919195E12125611115516165B23237D28288E28288D2626 + 8C28288E40409A0200000200005151A339398415155911115512125716165C1A + 1A621E1E6923236F2727762B2B7C2F2F8233338837378E3B3B933E3E9942429E + 4949A45959AD5D5DB16161B66363BA6666BD6868C06A6AC36C6CC66D6DC86D6D + C96969CA5D5DC65E5EC85E5EC95F5FCA6060CB6060CB6060CB6060CC6161CC61 + 61CC6161CD6A6AD06F6FD26F6FD26F6FD16E6ED16D6DD16464CE6161CD6161CD + 6161CD6161CD6363CE6A6AD06A6AD06A6AD06A6AD06B6BD08282DA9292E19B9B + E49393E19494E19494E19595E29393E19393E19A9AE48F8FDF7474D56464CE64 + 64CE7272D48B8BDE7777D66464CF6363CE6262CD6262CC6262CC6161CC6060CB + 6060CB5F5FCA6666CD8181D69292DD9191DC8A8AD77E7ED17070CA6969C67272 + C87C7CCA7F7FC97B7BC46E6EBD5454AE4747A64444A141419C3D3D9739399135 + 358B3131852E2E802929792929752C2C7323236A181860141459121256151558 + 1A1A6726268828288E28288D27278D0200000200002020671111551111551515 + 5B1919601D1D6621216D2525732929782D2D7E31318535358A3838903C3C953F + 3F9B4343A04A4AA65959AE5F5FB46262B86565BA6767BE6969C16B6BC46D6DC7 + 6E6EC97070CB7070CC7070CD6C6CCD6060CA5F5FCA6060CB6060CB6060CC6060 + CC6161CC6161CC6262CD6464CE6C6CD07070D26F6FD26F6FD26F6FD16E6ED164 + 64CE6161CD6161CD6161CD6161CD6363CE6B6BD06B6BD06A6AD06A6AD07070D3 + 9B9BE49393E06A6AD07777D67777D67878D67070D37474D47474D56969D06F6F + D26868D06565CE6565CE7878D68B8BDE7070D36363CE6363CE6363CE6262CD62 + 62CC6262CC6161CC6060CB6060CB7474D39090DD9393DE8F8FDB7676D15F5FC6 + 5C5CC35B5BC25C5CC16868C47A7AC98080CA7C7CC66767BA4E4EAD4848A74545 + A242429E3E3E993B3B9337378E3333882F2F822E2E7D32327C2D2D752020691B + 1B6316165D1313571111551313581F1F7529298E29298E020000020000121256 + 15155A18185F1C1C651F1F6A2424702727762B2B7C2F2F8233338737378D3A3A + 923D3D9741419D4444A14C4CA75C5CB06060B56464B96666BC6868C06B6BC26D + 6DC56E6EC76F6FCA7070CB7171CC7272CE7272CF7272CF6D6DCF6161CB6060CB + 6060CC6161CC6161CC6464CE6A6AD06E6ED17070D27070D27070D27070D26F6F + D26F6FD26E6ED16464CE6161CD6161CD6161CD6161CD6363CE6B6BD06B6BD06B + 6BD06A6AD07777D59C9CE48484DB6767CF6767CF6262CD6161CD6161CD6161CD + 6161CD6262CD6464CE6565CE6565CE6666CE7777D68F8FE06868CF6363CE6363 + CE6363CE6363CE6262CD6262CC6262CC6161CC6464CE8383D99595E19595E082 + 82D86262CA5D5DC75C5CC65B5BC45A5AC25858C06969C57F7FCD8080CA7474C3 + 5656B44C4CAD4949A94646A54343A03F3F9B3C3C9538389035358A3232853939 + 8536368028287421216D1E1E6719196116165C12125711115515155F23237C02 + 00000200001818601C1C651F1F6A22226F2626742929792E2E8031318535358A + 38388F3B3B943F3F9A42429E4545A34E4EAA5E5EB26363B76565BB6868BE6A6A + C16C6CC46D6DC66C6CC76767C87272CC7272CD7373CF7373CF7373D17474D274 + 74D16E6ED06161CC6161CC6565CD6C6CD17272D27272D27272D27272D27171D2 + 7070D27070D27070D26F6FD26F6FD16464CE6161CD6161CD6161CD6161CD6464 + CE6C6CD06C6CD06B6BD06B6BD07D7DD79898E38888DC6969D06868CF6868CF65 + 65CE6363CE6161CD6262CD6565CE6666CF6666CF6565CE6666CF7878D68F8FDF + 6A6AD16363CE6363CE6363CE6363CE6363CE6262CD6262CD6262CC6A6ACF8C8C + DE9797E19292DF7272D25F5FCA5E5EC95D5DC75C5CC65B5BC55A5AC36060C37D + 7DCE8585D07F7FCB5D5DBB4F4FB24D4DAE4A4AAA4747A64444A141419D3D3D97 + 3A3A9237378D40408E3E3E8A2F2F7F28287724247120206B1C1C661919611616 + 5C1313581111550200000200001F1F6A22226F2525742929792C2C7D2F2F8233 + 338836368D3939923D3D9740409C4343A14646A54B4BAA5E5EB36363B86666BB + 6868BF6B6BC26D6DC56E6EC86C6CC85F5FC55B5BC66767CB7373CF7373D07474 + D17474D27474D27474D27474D26E6ED16C6CD07373D37373D37373D37272D371 + 71D27171D27171D27070D27070D27070D26F6FD26E6ED16262CE6060CD6060CD + 6060CD6060CD6262CE6B6BD16B6BD16B6BD06A6AD07D7DD89B9BE48484DB6B6B + D16868D06767CF6767CF6767CF6464CE6464CE6666CF6666CF6565CF6565CF66 + 66CF7B7BD78888DD6E6ED36060CD6161CD6262CE6262CE6262CE6262CE6161CD + 6161CD6C6CD08D8DDF9797E38E8EDE6B6BD05F5FCB5E5ECA5D5DC95D5DC85C5C + C65B5BC55C5CC47C7CD08888D48282CF6262C05252B74F4FB34D4DB04A4AAB48 + 48A84444A342429F3E3E9A3B3B954646974848943333872D2D802A2A7B262676 + 2323701F1F6B1D1D661A1A6217175F0200000200002626742929792C2C7D2F2F + 8232328735358B3838903C3C953E3E9A41419E4444A34747A74A4AAB5757B365 + 65BB6868BE6A6AC06C6CC36D6DC56F6FC86E6ECA6060C65B5BC65C5CC75D5DC9 + 6868CD7575D17575D27575D27575D37575D37575D37575D37575D37474D37373 + D37373D37373D37272D37171D27171D27171D27070D27070D27070D26969D060 + 60CD6060CD6060CD6060CD6060CD6060CD6767CF6B6BD16B6BD16B6BD07373D4 + 9E9EE58686DB6B6BD16969D06868D06767CF6767CF6767CF6767CF6666CF6666 + CF6666CF6565CF6565CF7D7DD88484DB6B6BD16060CD6060CD6161CD6262CE62 + 62CE6262CE6262CE6161CD6A6AD18C8CDE9898E39292E07474D46060CB5F5FCB + 5E5ECA5D5DC95D5DC85C5CC76868CB8484D58B8BD78181D16262C35454BA5252 + B85050B44E4EB14B4BAE4848A94646A54343A141419C49499D51519D38388F33 + 33893030842D2D7F29297A26267624247121216D1E1E690200000200002D2D7F + 2F2F8232328735358B37378F3A3A943D3D9840409D4343A14646A54848A94B4B + AD4E4EB16262BA6969BF6B6BC26D6DC56F6FC67171C96E6ECA6161C75C5CC65C + 5CC75D5DC95E5ECA5E5ECA6A6ACF7676D27676D37676D37676D37575D47575D4 + 7575D37474D37474D37373D37373D37373D37272D37171D27171D26F6FD26D6D + D16969D06161CD6060CD6060CD6060CD6060CD6060CD6060CD6161CD6767CF69 + 69D06A6AD07272D39E9EE58585DB6B6BD16969D06969D06868D06868D06767CF + 6767CF6767CF6666CF6666CF6666CF6565CF7979D78989DD6969D06060CD6060 + CD6060CD6161CD6262CE6262CE6262CE6262CE6565CF8585DB9999E49797E286 + 86DC6969D05F5FCB5F5FCB5E5ECA5D5DC96161CA7777D28F8FDB8E8ED98080D2 + 5F5FC35656BE5555BC5353B95151B64F4FB34C4CAF4A4AAB4747A74747A55353 + A75555A43E3E9839399136368D3333883030842D2D802B2B7C29297826267402 + 000002000033338835358C3838903A3A943D3D9840409C4242A04545A44747A7 + 4A4AAB4C4CAF4E4EB25151B56767BF6D6DC36F6FC67070C97272CA7373CB6A6A + CB5C5CC75D5DC85D5DC95E5ECA5F5FCB5F5FCB5F5FCB6A6AD07777D37777D376 + 76D47676D47575D47575D47575D37474D37474D37373D37373D37171D26B6BD1 + 6767CF6363CE6161CD6060CD6060CD6060CD6060CD6060CD6060CD6060CD6060 + CD6060CD6060CD6060CD6262CE7272D49A9AE38D8DDE6A6AD06A6AD16C6CD16D + 6DD26C6CD16969D06B6BD16767CF6A6AD06666CF6666CF6262CE6A6AD18C8CDF + 6D6DD26060CD6060CD6060CD6060CD6262CE6262CE6262CE6262CE6262CE7575 + D59494E19999E49595E28383DA6C6CD16464CD6060CB6767CD7878D48D8DDB91 + 91DD9090DC7676D05B5BC45858C15757BF5555BD5353BA5252B75050B44E4EB1 + 4B4BAD4E4EAC5B5BAF5757AA43439E3E3E993D3D9641419543439341418F3F3F + 8C3B3B883838840200000200003939913B3B943D3D9840409C4242A04444A247 + 47A64949AA4B4BAE4E4EB15050B45252B75454BA6868C37171C77272C97373CB + 7474CD7575CE7575CF6969CC5D5DC95E5ECA5F5FCB5F5FCB5F5FCC5F5FCC6060 + CC6B6BD07777D47676D47676D47676D47575D47575D47575D37474D37070D268 + 68D06363CE6060CD6060CD6060CD6060CD6060CD6060CD6060CD6060CD6060CD + 6060CD6060CD6060CD6060CD6060CD6060CD6060CD6C6CD29191E19393E18383 + DB8686DB8B8BDD8787DC8888DC8686DC8B8BDE8D8DDE8484DB7373D46363CE60 + 60CD6D6DD28989DD7676D66060CD6060CD6060CD6262CE6363CE6363CE6262CE + 6262CE6262CE6868D08181DA9797E39999E49797E38E8EDF8080D97D7DD78484 + DA9292E09595DF9292DE8888D96767CC5B5BC65A5AC35959C25858C05656BD54 + 54BB5252B85151B54E4EB25757B36666B75757AE4646A44343A04848A05757A5 + 5B5BA353539E4F4F9A4D4D974A4A940200000200003E3E9940409D4242A04444 + A24646A64848A94B4BAC4D4DB04F4FB35151B55252B85454BB5656BD6363C373 + 73CA7474CB7575CE7676CF7676D07777D17878D16A6ACE5F5FCB5F5FCB5F5FCC + 6060CC6060CC6060CD6060CD6B6BD17777D47676D47676D47676D47575D47272 + D36969D06161CD6060CD6060CD6060CD6060CD6060CD6060CD6060CD6060CD60 + 60CD6060CD6060CD6060CD6060CD6060CD6060CD6060CD6060CD6060CD6262CE + 7575D58E8EDF9898E39797E39393E19898E39898E39E9EE59696E29797E29F9F + E58383DB6363CE6060CD6868D08484DB8181DA6161CE6060CD6262CE6464CE64 + 64CE6363CE6363CE6262CE6262CE6363CE6B6BD18787DD9595E29999E49898E3 + 9696E29696E29797E29696E19494E18A8ADC6E6ED05F5FC95C5CC75B5BC65A5A + C45959C35858C15656BE5555BC5353BA5252B75E5EBA7070C05555B24A4AAB47 + 47A75252AA6464AF5555A749499F48489C4747994242960200000200004343A1 + 4545A44747A64848A94A4AAC4C4CAF4E4EB25050B45252B75353BA5555BC5656 + BE5858C05B5BC36D6DCA7777CE7878D07878D17979D27878D27979D47A7AD36B + 6BCF5F5FCC6060CC6060CC6060CD6060CD6060CD6060CD6B6BD07676D47676D4 + 7575D46C6CD16262CE6060CD6060CD6060CD6060CD6060CD6060CD6060CD6060 + CD6060CD6060CD6060CD6060CD6060CD6060CD6060CD6060CD6060CD6060CD60 + 60CD6060CD6060CD6060CD6E6ED37171D46F6FD37171D47575D57676D67070D2 + 7373D47979D69393E18E8EDF6A6AD16060CD6363CE7B7BD88B8BDE6B6BD26262 + CE6464CE6464CE6464CE6363CE6363CE6363CE6262CE6161CD6161CD6C6CD27B + 7BD89090E09696E39999E49797E29696E28D8DDE8080D86B6BD05F5FCB5E5ECA + 5D5DC95C5CC75C5CC65B5BC55959C35959C25757C05656BD5656BC6A6AC26F6F + C25454B54D4DB04C4CAD6262B56767B54E4EA84343A141419E40409C3E3E9902 + 00000200004747A84848AA4A4AAC4C4CAF4D4DB24F4FB45151B75252B95454BC + 5555BD5757C05858C25858C35A5AC55C5CC77070CD7878D17979D27979D37979 + D47A7AD47A7AD57878D46C6CD05F5FCC5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F + 5FCD6363CE6565CF6363CE5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD + 5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5F + CD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD6060CD5F5FCD5F5FCD5F + 5FCD5F5FCD6161CE6262CE6161CD7A7AD89797E37575D65F5FCD5F5FCD6F6FD3 + 8C8CDF7C7CD86565CF6464CF6363CE6363CE6363CE6363CE6262CE6161CE5F5F + CD5F5FCD5F5FCD6161CE6767D07979D77B7BD87C7CD87A7AD66F6FD26363CE5E + 5ECB5E5ECB5E5ECB5D5DCA5C5CC95C5CC85B5BC75A5AC65959C45858C25858C1 + 6060C37979CB6666C25252B84F4FB55353B46F6FBE6969BB4C4CAD4747A84545 + A64343A24242A10200000200004B4BAE4C4CB04D4DB24F4FB45151B75252B953 + 53BB5454BD5656BF5757C15858C35959C45A5AC65B5BC75C5CC85F5FC97171D0 + 7A7AD47B7BD47A7AD47A7AD57B7BD57B7BD57A7AD56C6CD15F5FCD5F5FCD5F5F + CD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F + 5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD + 5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5F + CD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD6E6ED39696E38181DA63 + 63CF5F5FCD6363CE8484DC8C8CDE6F6FD46464CF6464CF6363CE6363CE6363CE + 6262CE5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD5F5FCD6060CE6363CE6363CF5F5F + CD5F5FCC5F5FCC5E5ECC5E5ECB5E5ECB5E5ECB5D5DCA5C5CC95C5CC95B5BC75A + 5AC65A5AC55C5CC57171CC7C7CCF5E5EC25454BC5353BA6262BE7B7BC76262BB + 4C4CB04B4BAE4949AB4848AA4747A80200000200004F4FB35050B55151B65252 + B95353BA5454BC5656BE5757BF5858C15959C35A5AC45B5BC55B5BC65C5CC85C + 5CC85D5DC96060CB7373D17B7BD37B7BD47B7BD47B7BD47B7BD57B7BD57A7AD5 + 6C6CD05F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5F + CC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F + 5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC + 5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC6565 + CE8787DC9393E16C6CD15F5FCC6262CD7171D39292E08080D86767CF6464CE64 + 64CE6363CD6262CD5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC + 5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCB5F5FCB5E5ECB5E5ECA5E5ECA5E5E + CA5D5DC95C5CC85C5CC75B5BC66A6ACB8181D27272CB5858C05656BF5B5BBF74 + 74C87C7CCA5D5DBB5050B54F4FB34D4DB14C4CAF4B4BAD0200000200005252B7 + 5353B95454BB5555BC5656BE5757BF5858C15959C35A5AC45A5AC55B5BC65C5C + C75C5CC85D5DC95E5ECA5E5ECA5E5ECA6060CC7373D27C7CD47C7CD47B7BD57B + 7BD57B7BD57B7BD57A7AD56C6CD05F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC + 5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5F + CC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F + 5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC + 5F5FCC5F5FCC6060CD7171D39A9AE38080D96464CD6666CE6666CE8383DA9494 + E06F6FD26565CE6464CE6262CD5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F + 5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCB5F5FCB + 5E5ECB5E5ECA5E5ECA5E5ECA5D5DC95C5CC86262C97E7ED47E7ED36363C85959 + C35858C16969C78383D07373C85858BD5353B95252B75151B64F4FB44F4FB302 + 00000200005454BC5555BD5656BF5757C05858C15959C35A5AC45A5AC55B5BC6 + 5C5CC75C5CC85D5DC95D5DC95E5ECA5E5ECA5E5ECA5E5ECB5F5FCB6262CC7474 + D37C7CD57C7CD57B7BD57B7BD57B7BD57B7BD57979D46464CE5F5FCC5F5FCC5F + 5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC + 5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5F + CC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F + 5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC6565CE8989DD9393E07676D46767CE + 6767CE6C6CD18888DC9090DE7171D36363CD6060CC5F5FCC5F5FCC5F5FCC5F5F + CC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F + 5FCC5F5FCC5F5FCB5F5FCB5E5ECB5E5ECB5E5ECA5E5ECA6161CB7C7CD58787DA + 6C6CCD5C5CC65A5AC55F5FC67E7ED28282D26464C65757BF5555BD5454BC5353 + BA5353B95252B80200000200005757C05858C15858C25959C35A5AC45A5AC55B + 5BC65C5CC75C5CC85C5CC85D5DC95E5ECA5E5ECA5E5ECA5E5ECB5E5ECB5F5FCB + 5F5FCB5F5FCC6262CD7474D37C7CD57C7CD57B7BD57B7BD57B7BD57B7BD56666 + CE5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F + 5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC + 5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5F + CC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC6060CC7373D496 + 96E18E8EDE6D6DD06767CE6767CE7272D39191DF8989DD6C6CD15F5FCC5F5FCC + 5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5F + CC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCB5F5FCB5E5ECB6161CB7A + 7AD58C8CDC7272D15E5EC95C5CC85C5CC76868CB8E8ED97B7BD25D5DC55858C2 + 5858C15757BF5656BF5555BD5454BC0200000200005959C35A5AC45A5AC55B5B + C55B5BC65C5CC75C5CC85C5CC85D5DC95E5ECA5E5ECA5E5ECA5E5ECB5E5ECB5F + 5FCB5F5FCB5F5FCC5F5FCC5F5FCC5F5FCC7171D27C7CD57C7CD57C7CD57B7BD5 + 7B7BD57979D46464CE5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5F + CC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F + 5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC + 5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5F + CC5F5FCC6B6BD19595E19898E27373D46767CF6767CE6767CE7676D58B8BDD89 + 89DC7272D36060CC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC + 5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5F + CB6363CC7E7ED78A8ADC7777D45E5ECA5E5ECA5D5DC95D5DC96666CB8888D981 + 81D66E6ECD5A5AC55A5AC45959C35858C25858C15757C00200000200005A5AC5 + 5A5AC65B5BC75B5BC85B5BC85C5CC95C5CC95D5DCA5D5DCA5D5DCA5D5DCA5D5D + CB5E5ECB5E5ECB5E5ECB5E5ECC5E5ECC5E5ECC5E5ECC6565CE7B7BD57C7CD57C + 7CD57B7BD57B7BD57A7AD56E6ED15E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC + 5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5E + CC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E + 5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC + 5E5ECC5E5ECC5E5ECC6464CE8686DC9797E27E7ED86C6CD16767CF6666CF6666 + CE6767CE7272D38B8BDE8A8ADE7171D36060CD5E5ECC5E5ECC5E5ECC5E5ECC5E + 5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC + 5E5ECC6161CD6C6CD28282DA8B8BDD7676D55D5DCB5D5DCB5D5DCA5D5DCA5D5D + CA5E5ECA6A6ACE8484D98B8BDA6D6DCE5B5BC65A5AC55959C55959C45858C302 + 00000200005B5BC85B5BC85C5CC95C5CC95C5CC95D5DCA5D5DCA5D5DCA5D5DCB + 5D5DCB5E5ECB5E5ECB5E5ECB5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC7171 + D27C7CD67C7CD67C7CD57C7CD57B7BD57777D46161CD5E5ECC5E5ECC5E5ECC5E + 5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC + 5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5E + CC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E + 5ECC5E5ECC5E5ECC5E5ECC5E5ECC6464CE8484DB9B9BE47A7AD76464CE6666CF + 6767CF6767CF6666CF6666CE6666CE7070D28181DA8E8EDF8383DA6E6ED26363 + CE5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E + 5ECC5E5ECC5E5ECC6C6CD17979D78989DD8686DC7171D46060CD5E5ECB5E5ECB + 5D5DCB5D5DCB5D5DCA5D5DCA5D5DCA6565CD8B8BDB8C8CDB7070D05E5EC95B5B + C75A5AC65A5AC60200000200005C5CC95D5DCA5D5DCA5D5DCA5D5DCA5D5DCA5D + 5DCB5D5DCB5E5ECB5E5ECB5E5ECB5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC + 5E5ECC6363CE7B7BD57C7CD67C7CD67C7CD57C7CD57C7CD56B6BD05E5ECC5E5E + CC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E + 5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC + 5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5E + CC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC6464CE8282DA9696E27E7ED860 + 60CD5E5ECC6262CD6767CF6767CF6666CF6666CF6666CE6565CE6767CF7272D4 + 8D8DDF8A8ADD8080D97474D56A6AD16464CE5F5FCC5E5ECC5E5ECC6060CD6161 + CD6060CD5F5FCC6666CF6E6ED27C7CD88585DB8C8CDE7D7DD86A6AD15E5ECC5E + 5ECC5E5ECC5E5ECC5E5ECB5E5ECB5D5DCB5D5DCB5D5DCA5D5DCA6666CD8787DB + 9191DF7474D35F5FCA5B5BC85B5BC80200000200005D5DCA5D5DCA5D5DCB5D5D + CB5D5DCB5E5ECB5E5ECB5E5ECB5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E + 5ECC5E5ECC5E5ECC5E5ECC6E6ED17D7DD67D7DD67C7CD67C7CD67C7CD67777D4 + 5F5FCC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5E + CC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E + 5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC + 5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC6464CE8181DA9898 + E37F7FD96161CD5E5ECC5E5ECC5F5FCC6666CF6767CF6767CF6767CF6666CF66 + 66CE6262CD5F5FCC6262CE7C7CD88484DB8A8ADD8585DB7F7FD97C7CD87272D4 + 7B7BD87979D67676D57373D48181DA8585DB8484DB8989DD7B7BD86F6FD36161 + CD5E5ECC5E5ECC5F5FCC6060CD5F5FCC5E5ECC5E5ECC5E5ECB5E5ECB5E5ECB5D + 5DCB5D5DCB6767CE8787DB8E8EDE7676D46161CC5D5DCA0200000200005E5ECB + 5E5ECB5E5ECB5E5ECB5E5ECB5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5E + CC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5F5FCC7777D47E7ED67D7DD67D7DD67C + 7CD67C7CD66B6BD05E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC + 5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5E + CC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E + 5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC6363CE + 8282DA9595E28282DA6464CE5E5ECC5E5ECC5E5ECC5E5ECC6262CD6767CF6767 + CF6868D07373D47070D26464CE5F5FCC5E5ECC6161CD6868D07171D47B7BD781 + 81DA8282DA8888DC8282DA8282DA8282DA8989DD7F7FD97979D67676D66969D0 + 5E5ECC5E5ECC5E5ECC5E5ECC6060CD7878D67676D66868D05E5ECC5E5ECC5E5E + CC5E5ECC5E5ECC5E5ECB5E5ECB5E5ECB6969CF8282D99292E07171D35F5FCC02 + 00000200005E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC + 5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC6666CF7C7CD57E7E + D67E7ED67D7DD67D7DD67979D56262CD5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E + 5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC + 5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5F5FCC6161CD6363CE6363CE6161CD5F5F + CC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E + 5ECC5E5ECC7676D59999E38282DA6464CE5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC + 5F5FCC6767CF6767CF7B7BD79696E29595E17A7AD66868D05E5ECC5E5ECC5E5E + CC5E5ECC5E5ECC6060CD6565CF6565CF6868D06969D06969D16161CD6161CD64 + 64CE6060CD5E5ECC5E5ECC5F5FCC6262CD6F6FD38585DB9494E19898E38282DA + 6060CD5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC6464CF9393 + E08484DA6363CD0200000200005E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC63 + 63CE6D6DD17272D27171D27171D27171D27171D27171D27171D27171D27070D2 + 7676D47E7ED67E7ED67E7ED67D7DD67D7DD67272D25F5FCC5E5ECC5E5ECC5E5E + CC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E + 5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC6262CD6969CF7070D27373D37373D3 + 7373D37272D26E6ED16767CF6161CD5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5E + CC5E5ECC5E5ECC5E5ECC6262CE8A8ADE9393E16C6CD25E5ECC5E5ECC5E5ECC5E + 5ECC5E5ECC5E5ECC5E5ECC6666CE7D7DD89797E29898E29898E29C9CE48E8EDE + 7A7AD66868CF6262CD6262CD6262CD6161CD6161CD6161CD6161CD6060CD5F5F + CC5E5ECC5E5ECC5E5ECC5E5ECC5F5FCC6666CF7070D38181DA9292E09595E281 + 81DA8383DB9393E18181DA6464CE5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC5E5ECC + 5F5FCC7272D49090E08181DA5E5ECC0200000200005D5DCC5D5DCC5D5DCC5D5D + CC5D5DCC6868D07A7AD57D7DD67D7DD67D7DD67D7DD67D7DD67D7DD67D7DD67D + 7DD67D7DD67D7DD67D7DD67D7DD67D7DD67D7DD67D7DD67C7CD66969D05D5DCC + 5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5D + CC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC6767CF7373D37575D475 + 75D37474D37474D37373D37373D37272D37272D36F6FD26565CF5D5DCC5D5DCC + 5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC6262CE7F7FD99999E47B7BD86161 + CE5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5E5ECC7070D39D9DE49595E17575D574 + 74D58888DC9696E29C9CE49191E18787DC7A7AD77070D36767D06363CE6363CE + 6262CE6161CD6161CD5E5ECC5D5DCC6363CE6E6ED37A7AD78585DC9292E19494 + E18585DC7171D46161CD6060CD7676D69494E28888DD6464CF5D5DCC5D5DCC5D + 5DCC5D5DCC5D5DCC7171D48F8FE08C8CDF6C6CD25D5DCC0200000200005D5DCC + 5D5DCC5D5DCC5D5DCC6464CE7C7CD67D7DD67D7DD67D7DD67D7DD67D7DD67D7D + D67D7DD67D7DD67D7DD67D7DD67D7DD67D7DD67D7DD67D7DD67D7DD67D7DD67A + 7AD56363CE5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC + 5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC6A6AD07676 + D47676D47575D47575D37575D37474D37474D37373D37373D37373D37272D371 + 71D26868CF5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC5D5DCC6868D1 + 8B8BDE9696E27B7BD86565CF5D5DCC5D5DCC5D5DCC5E5ECC7070D49292E09696 + E17878D66767CF6767CF6767CF7272D48080D99090E09595E19595E19494E07F + 7FD96666CF6363CE6363CE6262CE6161CD6161CD5E5ECC7D7DD98E8EDF9191E1 + 8E8EDF8181DA7070D46464CF5D5DCC5D5DCC5D5DCC5F5FCD7A7AD79494E28787 + DD6868D05D5DCC5D5DCC5D5DCC7171D48F8FE09191E17272D45D5DCC5D5DCC02 + 00000200005D5DCB5D5DCB5D5DCB5D5DCB7171D27D7DD57D7DD57D7DD57D7DD5 + 7D7DD57D7DD57D7DD57D7DD57D7DD57D7DD57D7DD57D7DD57D7DD57D7DD57D7D + D57D7DD57D7DD57777D35E5ECB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D + 5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB + 6868CE7777D37676D37676D37676D37575D37272D26F6FD16E6ED17171D17373 + D27373D27272D27272D27171D26565CE5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D + 5DCB5D5DCB5E5ECB6B6BD18A8ADE9898E37B7BD76060CC5D5DCB5D5DCB6F6FD3 + 8F8FDF9191E07373D36969CE6868CE6767CE6767CE6767CE6767CE6D6DD07676 + D58080D99B9BE39595E16C6CD16363CD6363CD6363CD6262CD6161CC6161CC87 + 87DC9696E37575D56363CD6262CD5E5ECC5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB + 6363CD7777D69393E18B8BDE6767CF5E5ECB6F6FD29090E09191E07373D45D5D + CB5D5DCB5D5DCB0200000200005D5DCB5D5DCB5D5DCB5D5DCB7A7AD47D7DD57D + 7DD57D7DD57D7DD57D7DD57D7DD57D7DD57D7DD57D7DD57D7DD57D7DD57D7DD5 + 7D7DD57D7DD57D7DD57D7DD57D7DD56F6FD15D5DCB5D5DCB5D5DCB5D5DCB5D5D + CB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D + 5DCB5D5DCB6161CC7575D37777D37777D37676D37474D26868CF6161CC5D5DCB + 5D5DCB6161CC6868CE7171D17373D27272D27272D26F6FD16060CC5D5DCB5D5D + CB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB6969D08B8BDE9999E47C7CD863 + 63CD7272D48F8FE08E8EDF6F6FD26464CD6868CF6868CE6868CE6767CE6767CE + 6767CE6666CE6565CE6767CF8888DC9696E16E6ED16363CD6363CD6363CD6363 + CD6262CD6868CF8888DC8D8DDF5E5ECB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D + 5DCB5D5DCB5D5DCB5D5DCB6060CC7979D69393E18686DC7B7BD78F8FDF9292E1 + 7272D45E5ECC5D5DCB5D5DCB5D5DCB0200000200005D5DCB5D5DCB5D5DCB5D5D + CB7B7BD57D7DD57D7DD57D7DD57D7DD57D7DD57C7CD57C7CD57C7CD57C7CD57C + 7CD57C7CD57C7CD57C7CD57C7CD57C7CD57C7CD57272D26060CC5D5DCB5D5DCB + 5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5D + CB5D5DCB5D5DCB5D5DCB5D5DCB6A6ACF7878D47878D47777D37474D26464CD5D + 5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB6363CD7171D27373D27272D27272D2 + 6767CE5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB6666 + CF8787DC9999E48C8CDE9393E19090E06E6ED25D5DCB5E5ECB6565CD6868CE68 + 68CE6767CE6767CE6767CE6666CE6666CE6969D08686DB9494E17070D26464CD + 6363CD6363CD6363CD6262CD6969CF8787DC8989DD6161CD5D5DCB5D5DCB5D5D + CB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB6262CD7474D58C8CDE98 + 98E38C8CDE7373D45D5DCB5D5DCB5D5DCB5D5DCB5D5DCB0200000200005D5DCB + 5D5DCB5D5DCB5D5DCB7B7BD57D7DD57D7DD57D7DD57D7DD57878D46565CE6565 + CD6565CD6565CD6565CD6565CD6565CD6565CD6565CD6565CE6262CD5D5DCB5D + 5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB + 5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5E5ECB7373D27878D47878D47777 + D36969CF5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB6868CE73 + 73D27373D27272D26E6ED05E5ECB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB + 5D5DCB5D5DCB5D5DCB6565CE7E7ED99090E08989DD6F6FD25D5DCB5D5DCB5D5D + CB5D5DCB5F5FCC6060CC6060CC6060CC6060CC6060CC5F5FCC6262CD8686DB8F + 8FDF6C6CD16363CD6464CD6363CD6363CD6363CD6565CE8787DC8C8CDE6464CE + 5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5D + CB5E5ECB6B6BD17272D46D6DD15E5ECB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB02 + 00000200005D5DCB5D5DCB5D5DCB5D5DCB7B7BD57D7DD57D7DD57D7DD57D7DD5 + 7676D35D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5D + CB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D + 5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB6161CC7878D4 + 7878D47878D47575D36161CC5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5D + CB5D5DCB6161CC7171D17373D27373D27171D26060CC5D5DCB5D5DCB5D5DCB5D + 5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB6363CD6868CF6666CF5E5ECB + 5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5D + CB5D5DCB8686DC8E8EDF6A6AD06363CD6565CD6464CD6363CD6363CD6363CD86 + 86DC8D8DDF6767CF5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB + 5D5DCB5D5DCB5D5DCB5D5DCB5D5DCB5E5ECC5E5ECB5D5DCB5D5DCB5D5DCB5D5D + CB5D5DCB5D5DCB0200000200005C5CCB5C5CCB5C5CCB5C5CCB7B7BD57D7DD57D + 7DD57D7DD57D7DD57575D35D5DCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB + 5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5C + CB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C + 5CCB6363CD7777D47878D47777D47171D25C5CCB5C5CCB5C5CCB5C5CCB5C5CCB + 5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB6D6DD17272D27272D27171D26161CD5C5C + CB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C + 5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB + 5C5CCB5C5CCB5C5CCB5C5CCB8181DA8F8FE06868D06262CD6464CD6464CD6363 + CD6262CD6464CE8787DD8B8BDE6666CF5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C + 5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB + 5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB0200000200005C5CCB5C5CCB5C5CCB5C5C + CB7B7BD57D7DD57D7DD57D7DD57D7DD57575D35D5DCB5C5CCB5C5CCB5C5CCB5C + 5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB + 5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5C + CB5C5CCB5C5CCB5C5CCB6363CD7878D47979D47878D47171D25C5CCB5C5CCB5C + 5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB6E6ED17373D27272D2 + 7272D26161CD5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5C + CB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C + 5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5F5FCC7D7DD99191E16969D06262CD + 6464CE6464CD6363CD6363CD6262CD8888DD8B8BDE6565CF5C5CCB5C5CCB5C5C + CB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C + 5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB0200000200005C5CCB + 5C5CCB5C5CCB5C5CCB7B7BD57D7DD57D7DD57D7DD57D7DD57575D35C5CCB5C5C + CB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C + 5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB + 5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB6060CC7878D47979D47979D47575 + D36060CC5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB6060CC71 + 71D27474D37373D27272D25F5FCC5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB + 5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5C + CB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB6161CD8181DA8E + 8EDF6868D06363CD6464CE6464CE6464CD6363CD6464CE7F7FDA9090E06363CE + 5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5C + CB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB02 + 00000200005C5CCB5C5CCB5C5CCB5C5CCB7B7BD57D7DD57D7DD57D7DD57D7DD5 + 7777D46464CE6464CD6464CD6464CD6464CD6464CD6464CD6464CD6464CD6464 + CE6161CD5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C + 5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5D5DCB7474D3 + 7979D47979D47878D46969CF5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5C + CB5C5CCB6868CF7474D37474D37474D36F6FD15D5DCB5C5CCB5C5CCB5C5CCB5C + 5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB + 5C5CCB5C5CCB5C5CCB5C5CCB5E5ECC5F5FCC5F5FCC5F5FCC5F5FCC5F5FCC5F5F + CC6161CD8181DA9797E27474D56969D07171D36E6ED16F6FD16C6CD17373D489 + 89DE9090E06363CE5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB + 5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5C + CB5C5CCB5C5CCB0200000200005C5CCB5C5CCB5C5CCB5C5CCB7B7BD57D7DD57D + 7DD57D7DD57D7DD57D7DD57B7BD57B7BD57B7BD57B7BD57B7BD57B7BD57B7BD5 + 7B7BD57B7BD57B7BD57B7BD57171D25F5FCC5C5CCB5C5CCB5C5CCB5C5CCB5C5C + CB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C + 5CCB5C5CCB6A6ACF7979D47979D47979D47676D36464CD5C5CCB5C5CCB5C5CCB + 5C5CCB5C5CCB5C5CCB6363CD7272D27575D37474D37474D36767CE5C5CCB5C5C + CB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C + 5CCB5C5CCB5C5CCB5C5CCB5C5CCB5D5DCB6666CE6A6ACF6A6ACF6969CF6969CF + 6868CF6868CF6868CF6767CE7A7AD69696E29999E49595E19090DF9191E09191 + E09797E39898E39393E17C7CD85E5ECC5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C + 5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB + 5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB0200000200005C5CCB5C5CCB5C5CCB5C5C + CB7979D47D7DD57D7DD57D7DD57D7DD57D7DD57D7DD57D7DD57D7DD57D7DD57D + 7DD57D7DD57D7DD57D7DD57D7DD57D7DD57D7DD57D7DD56F6FD15C5CCB5C5CCB + 5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5C + CB5C5CCB5C5CCB5C5CCB5C5CCB6060CC7777D47979D47979D47979D47676D369 + 69CF6060CC5C5CCB5C5CCB6060CC6868CF7474D37676D37575D37575D37272D2 + 6060CC5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5C + CB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB6565CE6B6BD06B6BD06B + 6BD06A6ACF6969CF6969CF6969CF6868CF6868CF6A6AD07B7BD78989DC8B8BDD + 8C8CDE8F8FDF8E8EDF8282DA8787DD7878D66363CE5C5CCB5C5CCB5C5CCB5C5C + CB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C + 5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB5C5CCB0200000200005B5BCB + 5B5BCB5B5BCB5B5BCB7070D27C7CD57C7CD57C7CD57C7CD57C7CD57C7CD57C7C + D57C7CD57C7CD57C7CD57C7CD57C7CD57C7CD57C7CD57C7CD57C7CD57C7CD575 + 75D35C5CCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB + 5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB6767CF7979D47979 + D47979D47878D47777D47474D37070D27070D27373D37676D47575D37575D375 + 75D37474D36565CE5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB + 5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5C5CCB6969 + CF6B6BD06A6AD06A6AD06A6AD06969CF6969CF6969CF6868CF6767CF6767CF68 + 68CF6B6BD06A6AD06D6DD16666CE6464CE6969D06565CF5D5DCC5B5BCB5B5BCB + 5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5B + CB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB5B5BCB02 + 00000200005B5BCA5B5BCA5B5BCA5B5BCA6262CC7B7BD47C7CD57C7CD57C7CD5 + 7C7CD57C7CD57C7CD57C7CD57C7CD57C7CD57C7CD57C7CD57C7CD57C7CD57C7C + D57C7CD57C7CD57979D46161CC5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B + 5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA + 5B5BCA6B6BCF7979D47979D47878D37878D37777D37777D37777D37777D37676 + D37676D37575D37575D26969CE5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B + 5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA + 5B5BCA5E5ECB6A6ACF6C6CCF6B6BCF6A6ACF6A6ACF6A6ACF6969CF6969CE6969 + CE6868CE6767CE6767CE6767CE6666CE6666CE6565CD6565CD6464CD5D5DCB5B + 5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA + 5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5B + CA5B5BCA5B5BCA0200000200005B5BCA5B5BCA5B5BCA5B5BCA5B5BCA6767CE79 + 79D47C7CD57C7CD57C7CD57C7CD57C7CD57C7CD57C7CD57C7CD57C7CD57C7CD5 + 7C7CD57C7CD57C7CD57C7CD57C7CD57B7BD46767CE5B5BCA5B5BCA5B5BCA5B5B + CA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B + 5BCA5B5BCA5B5BCA5B5BCA5B5BCA6767CE7575D37979D47878D37878D37777D3 + 7777D37777D37777D37676D37373D26666CE5B5BCA5B5BCA5B5BCA5B5BCA5B5B + CA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B + 5BCA5B5BCA5B5BCA5B5BCA6161CC6C6CCF6C6CCF6C6CCF6B6BCF6A6ACF6A6ACF + 6A6ACF6969CF6969CE6969CE6868CE6767CE6767CE6767CE6666CE6565CD6464 + CD5F5FCB5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B + 5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA + 5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA0200000200005B5BCA5B5BCA5B5BCA5B5B + CA5B5BCA5B5BCA6060CC6A6ACF6F6FD06E6ED06E6ED06E6ED06E6ED06E6ED06E + 6ED06E6ED06E6ED07373D27C7CD57C7CD57C7CD57C7CD57C7CD57070D15C5CCA + 5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5B + CA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA6060CB6969CE73 + 73D27777D37777D37777D37676D37272D16868CE6060CB5B5BCA5B5BCA5B5BCA + 5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5B + CA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA6767CE6D6DD06C6CD06C6CCF6C + 6CCF6B6BCF6767CE6363CD6464CD6363CD6363CD6363CC6363CC6262CC6262CC + 6262CC6060CC5D5DCB5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5B + CA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B + 5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA0200000200005B5BCA + 5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5B + CA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA6464CD7A7AD47C7CD57C7CD57C7CD57C + 7CD57878D36060CB5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA + 5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5B + CA5B5BCA5B5BCA5C5CCA5F5FCB6262CC6262CC5F5FCB5C5CCA5B5BCA5B5BCA5B + 5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA + 5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5E5ECB6C6CCF6D6D + D06D6DD06C6CD06C6CCF6A6ACF6060CB5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B + 5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA + 5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5B + CA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA02 + 00000200005B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA + 5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5C5CCA7575D27C7C + D57C7CD57C7CD57C7CD57C7CD56969CF5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B + 5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA + 5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5B + CA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B + 5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA + 6363CD6E6ED06E6ED06D6DD06D6DD06C6CD06969CE5C5CCA5B5BCA5B5BCA5B5B + CA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B + 5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA + 5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5BCA5B5B + CA5B5BCA5B5BCA0200000200005A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A + 5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA + 5A5ACA6B6BD07B7BD57B7BD57B7BD57B7BD57B7BD57575D35B5BCA5A5ACA5A5A + CA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A + 5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA + 5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5A + CA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A + 5ACA5A5ACA5B5BCA6B6BCF6D6DD06D6DD06D6DD06C6CD06C6CD06363CD5A5ACA + 5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5A + CA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A + 5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA + 5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA0200000200005A5ACA5A5ACA5A5ACA5A5A + CA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A + 5ACA5A5ACA5A5ACA5A5ACA5F5FCC7979D47B7BD57B7BD57B7BD57B7BD57B7BD5 + 6868CF5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5A + CA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A + 5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA + 5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5A + CA5A5ACA5A5ACA5A5ACA5A5ACA6363CD6F6FD16E6ED06E6ED06D6DD06D6DD06B + 6BD05D5DCB5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA + 5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5A + CA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A + 5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA0200000200005A5ACA + 5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5A + CA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA6F6FD17B7BD57B7BD57B + 7BD57B7BD57B7BD57676D35D5DCB5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA + 5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5A + CA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A + 5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA + 5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5D5DCB6C6CD06F6FD16F6FD16E6E + D06D6DD06D6DD06666CE5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A + 5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA + 5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5A + CA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA02 + 00000200005A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA + 5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA6262 + CD7A7AD47B7BD57B7BD57B7BD57B7BD57B7BD56C6CD05A5ACA5A5ACA5A5ACA5A + 5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA + 5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5A + CA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A + 5ACA5A5ACA5A5ACA5A5ACA5A5AC95959C85959C85959C75959C76565CC7070D0 + 6F6FD06F6FD16F6FD16E6ED06D6DD05F5FCC5A5ACA5A5ACA5A5ACA5A5ACA5A5A + CA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A + 5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA + 5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5A + CA5A5ACA5A5ACA0200000200005A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A + 5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA + 5A5ACA5A5ACA5A5ACA6E6ED07B7BD57B7BD57B7BD57B7BD57B7BD57979D46060 + CC5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A + 5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5AC95A5AC95A5ACA5A5ACA + 5A5ACA5A5ACA5A5AC95A5AC95A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5A + CA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5AC95959C75858C55757C45656C25A + 5AC36C6CCB6E6ECD6F6FCF6F6FD06F6FD16F6FD16666CE5A5AC95A5AC95A5ACA + 5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5A + CA5A5ACA5A5ACA5A5AC95A5AC95A5AC95A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A + 5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5AC95A5AC95A5AC95A5AC9 + 5A5AC95A5AC95A5AC95A5ACA5A5ACA0200000200005A5ACA5A5ACA5A5ACA5A5A + CA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A + 5ACA5A5ACA5A5ACA5A5ACA5A5ACA5D5DCB7171D17B7BD57B7BD57B7BD57B7BD5 + 7B7BD57B7BD56363CD5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5ACA5A5A + CA5A5ACA5A5ACA5A5ACA5A5ACA5A5AC95A5AC95959C85959C75858C55858C458 + 58C45858C55858C55858C55858C45858C45858C45858C55959C75959C75959C8 + 5959C85959C85959C85959C75959C75959C75959C85959C75858C45656C25555 + BF5353BB5252B95858BA6969C16A6AC56C6CC96D6DCC6D6DCE6D6DCE6666CB59 + 59C55858C45858C55858C65959C75959C85959C85959C85959C85959C85959C8 + 5959C85959C85959C75959C75858C55858C45858C45858C45858C45858C65959 + C75959C75959C75959C85959C85959C75959C75959C75959C75858C55858C458 + 58C45757C45757C35757C35757C45858C45858C55959C70200000200005959CA + 5959CA5959CA5959CA5959CA5959CA5959CA5959CA5959CA5959CA5959CA5959 + CA5959CA5959CA5959CA5959CA5959CA5959CA5C5CCB7070D17A7AD57A7AD57A + 7AD57A7AD57A7AD57A7AD57878D45F5FCC5959CA5959CA5959CA5959CA5959CA + 5959CA5959CA5959CA5959CA5959CA5959CA5959C95858C85757C65656C25454 + C05353BD5353BD5353BD5353BD5353BD5353BD5353BC5353BC5353BD5353BD54 + 54BF5555C05656C25555C15555C15656C25555C15555C15555C15656C25555C1 + 5353BD5252BA5050B54D4DB04B4BAB5050AC6161B56464BA6666BF6969C56969 + C66868C66868C56060C15454BD5353BD5454BE5555C05656C25656C25656C256 + 56C25656C25656C25555C15555C15555C05454BF5353BD5353BD5353BC5353BC + 5353BD5454BF5454C05555C05555C05656C25656C25555C15555C15555C15454 + C05454BE5353BD5353BD5252BB5252BB5252BB5353BC5353BD5454BF5555C102 + 00000200005959C95959C95959C95959C95959C95959C95959C95959C95959C9 + 5959C95959C95959C95959C95959C95959C95959C95959C95B5BCA7070D17A7A + D47A7AD47A7AD47A7AD47A7AD47A7AD47A7AD46969CE5959C95959C95959C959 + 59C95959C95959C95959C95959C95959C95959C95959C95959C95858C75757C3 + 5555C05252BA5050B54F4FB34F4FB24F4FB14F4FB24F4FB34E4EB14E4EB04D4D + AF4E4EB14E4EB14F4FB35151B65151B85151B75151B75151B85151B85151B751 + 51B75151B85151B74F4FB34D4DAE4B4BA94848A245459B45459B5050A35C5CAB + 6060B36363B86565BC6363BA6161B86161B75A5AB54F4FB14F4FB35050B55151 + B85252B85151B85151B85252B85151B85151B75151B75151B64F4FB34E4EB14E + 4EB14E4EB14E4EB14F4FB25050B55151B65151B65151B65151B85151B85151B8 + 5151B85151B85050B54F4FB34F4FB24F4FB14E4EB14E4EB14E4EB04E4EB04E4E + B14F4FB35151B80200000200005959C95959C95959C95959C95959C95959C959 + 59C95959C95959C95959C95959C95959C95959C95959C95959C95959C95C5CCA + 7070D17A7AD47A7AD47A7AD47A7AD47A7AD47A7AD47A7AD46969CE5959C95959 + C95959C95959C95959C95959C95959C95959C95959C95959C95959C95959C959 + 59C85757C55555C05252B94F4FB14B4BAA4A4AA84A4AA64949A64A4AA74A4AA7 + 4949A44848A24848A24848A24848A24949A64B4BA94C4CAB4B4BA94B4BAA4C4C + AC4C4CAC4B4BA94C4CAB4C4CAD4C4CAB4A4AA64848A246469E4242953E3E8D3E + 3E8D4141924C4C9A5757A35B5BAA5E5EAE5D5DAC5A5AA95959A85959A85454A7 + 4B4BA64B4BA94C4CAD4D4DAD4C4CAC4C4CAD4D4DAD4C4CAC4B4BA94B4BA94A4A + A84848A34747A04747A04747A04747A14848A34A4AA84B4BAA4B4BA94B4BA94C + 4CAC4C4CAC4C4CAB4C4CAB4C4CAC4B4BA94A4AA64949A54949A54949A44848A2 + 4747A14747A14848A24949A64D4DAD0200000200005959C95959C95959C95959 + C95959C95959C95959C95959C95959C95959C95959C95959C95959C95959C959 + 59C95C5CCA7070D17A7AD47A7AD47A7AD47A7AD47A7AD47A7AD47A7AD46969CE + 5959C95959C95959C95959C95959C95959C95959C95959C95959C95959C95959 + C95959C95959C95858C75656C25252BA4F4FB14A4AA646469E45459B44449A44 + 449944449A44449A42429540409141419241419241419242429444449A45459B + 44449A44449A46469E45459D44449A45459B46469E45459C4343974242944141 + 923D3D8A3939813939813B3B853C3C8846468F52529954549D53539A51519751 + 51975050985151994D4D9945459A46469E46469E45459D46469E46469E45459C + 4444994444994343974040913E3E8D3F3F8F40408F4040904141934444994545 + 9B44449944449A45459D45459D45459B45459B45459D44449A43439743439743 + 43984343974242944141924141924141934343984848A20200000200005959C9 + 5959C95959C95959C95959C95959C95959C95959C95959C95959C95959C95959 + C95959C95959C95C5CCA7070D17A7AD47A7AD47A7AD47A7AD47A7AD47A7AD47A + 7AD46969CE5959C95959C95959C95959C95959C95959C95959C95F5FCB6161CC + 5F5FCB5959C95959C95959C95959C95858C75454BF5050B54B4BAA46469E4242 + 9441419240409140408F4040914040903D3D8A3B3B853B3B853B3B863B3B853C + 3C883E3E8C3E3E8D3D3D8B3E3E8C3F3F8F3E3E8D3D3D8B3E3E8C40408F42428F + 4D4D926D6DA45D5D9A3A3A8236367A35357937377D37377D38387F4242874D4D + 8F4B4B8C4949884A4A8A4B4B8C4A4A8C4B4B8D4848914141924040913F3F8F40 + 408F4040913E3E8D3D3D8A3D3D8B3C3C883A3A8238387F3939813A3A843B3B84 + 3C3C883E3E8D40408F3E3E8C3E3E8C40408F3F3F8F3E3E8C3F3F8E40408F3E3E + 8D3D3D8B3E3E8C3F3F8F3E3E8D3D3D8B3C3C883C3C883C3C883F3F8E44449A02 + 00000200005959C95959C95959C95959C95959C95959C95959C95959C95959C9 + 5959C95959C95959C95959C95B5BCA7070D07A7AD47A7AD47A7AD47A7AD47A7A + D47A7AD47A7AD46969CE5959C95959C95959C95959C95959C95959C95959C969 + 69CE7878D37A7AD47878D36B6BCF5D5DCA5959C95959C95858C65454BE4F4FB3 + 4A4AA743439840408F3F3F8E3E3E8D3E3E8C3E3E8D3E3E8C3B3B8438387F3939 + 8039398038387F3939803B3B853B3B853939813939813B3B843A3A8338387F3B + 3B824646894C4C8A7777A3E8E8E8B7B7C939398035357835357736367A363679 + 35357837377D41418447478445458147478347478647478647478749498B4747 + 8E3D3D883B3B853B3B863C3C883A3A843939803A3A8239398036367934347636 + 367937377D37377D3939803C3C873C3C883A3A833A3A823B3B863B3B853A3A82 + 3A3A843C3C873A3A843A3A823B3B843C3C883C3C873A3A843939813939803939 + 813C3C884242950200000200005959C95959C95959C95959C95959C95959C959 + 59C95959C95959C95959C95959C95959C95959C96868CE7A7AD47A7AD47A7AD4 + 7A7AD47A7AD47A7AD47A7AD46969CE5959C95959C95959C95959C95959C95959 + C95959C96969CE7A7AD47A7AD47A7AD47A7AD47A7AD47575D26767CE5A5AC958 + 58C65454BD4F4FB35F5FAF6F6FAD6161A13E3E8D3E3E8D3E3E8C4949936A6AA3 + 67679D38387F38387F39398037377D38387F3A3A843A3A8438387F38387E3939 + 8138387E3E3E7D4747814C4C884C4C877777A2EBEBEBBBBBCC57579164649736 + 367A37377D36367A35357837377C5B5B946A6A9A5A5A8D464683484885474785 + 47478649498B4B4B8D4242893A3A823A3A833A3A8439398037377D3939805959 + 9262629362629135357735357936367A37377D3A3A843B3B8439398038387F3A + 3A8239398138387E39398068689D66669A4E4E8B39398051519167679C66669A + 38387E38387E3939803C3C884343970200000200005858C95858C95858C95858 + C95858C95858C95858C95858C95858C95858C95858C95858C95959C97070D179 + 79D47979D47979D47979D47979D47878D36868CE5858C95858C95858C95858C9 + 5858C95858C95858C96868CE7979D47979D47979D47979D47979D47979D47979 + D47979D47474D26464CB6363C5C5C5E0ECECECECECECEAEAEAB0B0CC3F3F8F83 + 83B4E6E6E6E3E3E3E3E3E3D7D7DC5B5B963A3A8466669DE3E3E3B4B4C93B3B88 + 66669DE2E2E2B6B6C848488573739DE9E9E9C0C0D04D4D8A7A7AA7F1F1F1E9E9 + E9E6E6E6E3E3E3C7C7D1505090393981434385C1C1CFE3E3E3E3E3E3E3E3E3A3 + A3BC4A4A8B4A4A8A9292B5E4E4E49393B848488E8A8AB2E3E3E38989B1393983 + 5B5B95CBCBD5E0E0E0E2E2E2E2E2E2E0E0E05A5A9366669BE4E4E4B5B5CA3C3C + 8967679EE3E3E3B5B5C9393983383880C4C4D3E7E7E7E9E9E9BCBCCEAFAFC7E9 + E9E9E6E6E6E4E4E4D6D6DB7D7DA93B3B883F3F8F44449C0200000200005858C9 + 5858C95858C95858C95858C95858C95858C95858C95858C95858C95858C95858 + C95959C97474D27979D47979D47979D47979D47979D46C6CD05858C95858C958 + 58C95858C95858C95858C95858C96868CE7979D37979D37979D37979D37979D3 + 7979D47979D47979D47979D47979D47878D2C6C6EAF8F8F8C0C0DE7979BA8A8A + BEB8B8D46666AAF6F6F6E5E5EB7B7BB49191BDECECECDDDDE23E3E8F6C6CA7E9 + E9E9BBBBD14949957676A8E7E7E7BDBDCE50508D7878A5EEEEEEC6C6D7525293 + 8080B1FBFBFBD5D5E38080B2B1B1CBE9E9E9ADADC83D3D8CB2B2CCECECECA7A7 + C76C6CA8CACADAE9E9E99696BB5050959999BFEAEAEA9999C04F4F999090BAE9 + E9E98E8EB83D3D8CD7D7E1EAEAEA8F8FBB6C6CA66B6BA59999BE60609F6D6DA7 + ECECECBBBBD14141946C6CA7E9E9E9BABACF3D3D8C6B6BA4ECECECD5D5DF4646 + 8C5252929090B860609E3D3D8C4A4A93E6E6E6D8D8DD4040924343984747A302 + 00000200005858C95858C95858C95858C95858C95858C95858C95858C95858C8 + 5858C85757C75757C65757C47070CD7676CF7676CF7777D07777D07777D07171 + CD5D5DC65656C45656C45656C55757C65757C66666CB7676CF7676CE7676CE76 + 76CE7676CE7676CE7676CE7676CE7777D07777D17878D27878D2FFFFFFFFFFFF + 7777C36464B45D5DAA5555A49D9DCBFFFFFFA7A7D14646A045459ED4D4E5F4F4 + F47474B27E7EB5F6F6F6C9C9DD5E5EA58484B7F2F2F2C6C6D857579A8080B1F7 + F7F7CDCDDF58589E8585BAFFFFFFD4D4E75C5CA56464A7F7F7F7F2F2F2424297 + FAFAFAF8F8F85151A344449B8282B9F5F5F5C9C9DC55559FA2A2CBF5F5F5A1A1 + CC5656A89999C8F5F5F59797C77575B5FBFBFBDEDEEA7575B77474B57373B472 + 72B25050A27474B5F7F7F7C4C4DD4747A27474B5F2F2F2C2C2DA44449B7272B2 + F2F2F2C2C2D83F3F913E3E8E3F3F8F8A8ABCBABAD6DCDCE7EFEFEFDFDFE54646 + 9F4848A54C4CAD0200000200005858C95858C95858C95858C95858C95858C958 + 58C95858C85757C75656C55555C35454BF5252BC6262C17171C67171C77171C7 + 7272C87272C87171C76D6DC45A5ABF5252BC5353BE5454BF6363C47373C97272 + C87171C77070C57070C57070C47070C47070C57171C77272C87373CA7575CD76 + 76CFFFFFFFFFFFFF6F6FC36A6AB96565B06262ABA6A6D0FFFFFF9D9DCE4848A6 + 4848A4CECEE6FFFFFF8585BE8A8AC0FFFFFFD5D5E96363AE8A8AC0FEFEFECFCF + E35B5BA28787BAFFFFFFD4D4E75D5DA58888BEFFFFFFD4D4E95F5FAA5E5EA9FF + FFFFFFFFFF5050A2FFFFFFFFFFFF4848A44C4CA58585BEFFFFFFD3D3E75A5AA7 + A8A8D2FFFFFFAAAAD75757B2A0A0D3FFFFFF9F9FD37B7BC2FFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFDFDFD7B7BC27B7BC2FFFFFFCFCFE94D4DB17C7CC3FEFEFECC + CCE64B4BAB7A7AC0FBFBFBC9C9E246469F44449C9C9CCBFFFFFFFFFFFFFFFFFF + C0C0E06D6DBA4C4CAE4E4EB25050B80200000200005858C95858C95858C95858 + C95858C95858C95858C95858C85656C55555C15252BC5050B64E4EB25252B167 + 67B96A6ABA6B6BBB6C6CBD6B6BBC6A6ABA6A6AB96767B85454B34E4EB35E5EBA + 6E6EC06D6DBF6C6CBD6B6BBB6A6ABA6A6AB96969B86161B55E5EB46A6ABA6C6C + BD6E6EC17272C87474CBDADAF1FFFFFFB2B2DF6A6AB97979BAABABD29595C5FF + FFFFE6E6F35454AC6D6DB8FFFFFFFFFFFF6B6BB08C8CC1FFFFFFE0E0EF6E6EB4 + ABABD2FFFFFFDFDFEE6868ABA9A9CFFFFFFFD4D4E85555A48484BEFFFFFFDFDF + EE6B6BB28A8AC2FFFFFFE9E9F35C5CA7DCDCEDFFFFFFA0A0D05B5BAAC9C9E2FF + FFFFB2B2D55B5BA8A8A8D3FFFFFFC0C0E35353B8C5C5E7FFFFFFA2A2D95D5DBD + F3F3FAE8E8F65252BC5252BCDCDCF1FFFFFF6868C37F7FCCFFFFFFDCDCF25E5E + C0A2A2DAFFFFFFD1D1EC5050B87F7FC9FFFFFFD0D0EA4C4CAE4B4BACCFCFE9FF + FFFF9595D14F4FB55050B87E7ECB5151BA5252BC5454BF0200000200005858C9 + 5858C95858C95858C95858C95858C95858C95757C65555C15252BC4F4FB44B4B + AB4848A54747A24E4EA55E5EAA6262AC6464AF6262AC6060A96060A96161AA5E + 5EAA5959AA6666B26666B46666B36565B06363AE6262AC6262AB5959A647479E + 45459E4D4DA25959A96565B36D6DBE7070C58D8DD2F6F6FBFFFFFFFFFFFFFFFF + FFD4D4E65C5CA1B7B7D7FFFFFFFFFFFFFFFFFFFFFFFF9494C76060A88A8AC0FF + FFFFF5F5F9FFFFFFFFFFFFFFFFFFD4D4E7FFFFFFFFFFFFFFFFFF9E9ECB434399 + 7676B5FFFFFFF4F4F9FFFFFFFFFFFFFFFFFFA7A7CD5959A17A7AB4F3F3F9FFFF + FFFFFFFFFFFFFFDEDEEC6363A75858A2A7A7D0FFFFFFF4F4FAFFFFFFFFFFFFFF + FFFF7777CE5555C29A9ADBFFFFFFE8E8F7DDDDF3FFFFFFBBBBE75555C38282D3 + FFFFFFF4F4FBFFFFFFFFFFFFFFFFFFA4A4DE5555C1FFFFFFFFFFFFFFFFFFFFFF + FFD1D1EC8B8BD0FFFFFFF4F4FBD1D1EEF4F4FBD2D2EE5555C15555C35656C302 + 00000200005757C85757C85757C85757C85757C85757C85757C75555C35252BC + 4E4EB44949A944449D4040943F3F913F3F9145459256569A5B5B9E59599C5656 + 9756569656569757579759599B5C5CA15D5DA35D5DA35C5CA15C5CA05B5B9E52 + 52994141913D3D8C3D3D8C3E3E8F3F3F9147479D5959AE6565BB6D6DC07979C5 + A6A6D6ACACD3A8A8CC6D6DA554549543438E7E7EB49999C59A9AC76666A94747 + 975B5BA16767A78787B97D7DB47272AEA6A6CB9B9BC455559D6666A79C9CC88D + 8DC03F3F913D3D8C4A4A947272AC7171A96C6CA6A5A5CA9A9AC3535396535395 + 5252956969A3A4A4C8A4A4CA9898C15D5D9D5151965252986A6AAA7C7CBE6565 + BB7F7FCDA4A4DE8383D55757C75757C75757C76D6DCEA5A5E1A5A5E18F8FDA57 + 57C75757C76262CB8484D67979D26D6DCEA5A5E19A9ADD5757C75757C7A5A5E1 + FFFFFFDDDDF38282D37676CD5454C26C6CCBA4A4E0A5A5E0A5A5E16D6DCE5757 + C75757C75757C70200000200005757C85757C85757C85757C85757C85757C857 + 57C75454C25151B94C4CAE4646A23F3F923B3B883A3A85393984393983414189 + 52529352528F4F4F8A4F4F894F4F8A4F4F8951518D5454935656975656975555 + 955555954E4E923F3F8C3B3B873939823838813838813A3A853F3F914747A24C + 4CAD5656B66464BA6868B65F5FA656569651518D4E4E8A3D3D823838813B3B88 + 3C3C8A3C3C8942428E5656985757985757975858995656974E4E9043438E3F3F + 8F3E3E8F3E3E8E3D3D8D3B3B873838813838813939823B3B844A4A8C52529351 + 51914E4E8D4D4D8B4D4D8B4D4D8B4E4E8E5050924E4E8F4C4C8B4C4C8D4B4B8F + 43439145459E4B4BAD5050B85454C15656C65757C85757C85757C85757C85757 + C85757C85757C85757C85757C85757C85757C85757C85757C85757C85757C857 + 57C85757C88484D7FFFFFFD2D2F05656C65656C65656C65757C75757C75757C7 + 5757C85757C85757C85757C85757C80200000200005757C85757C85757C85757 + C85757C85757C85757C75454C14F4FB74A4AAB44449D3D3D8C38388137377E36 + 367C36367B3838804040874C4C884B4B834A4A824A4A824A4A804B4B834F4F8A + 51518D51518D51518D4B4B8C3C3C883A3A8639398236367C35357A35357A3737 + 7D3C3C8A45459E4A4AAB4D4DB15E5EB76767B45D5DA35353914D4D8649498139 + 397934347837377F393983393982404088545494555594555594555594545492 + 47478A3B3B883C3C8B3C3C8B3C3C8A3B3B8838388135357935357935357A3636 + 7C39398148488A4D4D8A4A4A854949844949834949834A4A864C4C8B4A4A8648 + 48844646833D3D833C3C8A4343994A4AA94F4FB75454C05656C65757C85757C8 + 5757C85757C85757C85757C85757C85757C85757C85757C85757C85757C85757 + C85757C85757C85757C85757C85757C85757C85757C85757C85757C85757C857 + 57C85757C85757C85757C85757C85757C85757C85757C80200000200005757C8 + 5757C85757C85757C85757C85757C85757C75454C04F4FB77474BC5959A63C3C + 8B37377F36367B3535793434774D4D8B65659C3E3E834848824A4A814A4A8048 + 487E49497F56568C7777A27777A152528C3B3B845B5B975B5B9839398336367D + 35357A35357936367C3C3C8944449D4A4AAB4D4DB27575C18D8DC65E5EA45454 + 924C4C8548488038387734347737377E5E5E986A6AA057579553539355559454 + 549360609A8080AD7676A73B3B883C3C8B3C3C8A3C3C8A5E5E9C67679B656596 + 33337634347735357950508D6B6BA07272A14848814848824949834848826C6C + 9C7777A56B6B9B4545813B3B7F3939823C3C8A43439B4A4AAB5050B85454C156 + 56C65757C85757C85757C85757C85757C85757C85757C85757C85757C85757C8 + 5757C85757C85757C85757C85757C85757C85757C85757C85757C85757C85757 + C85757C85757C85757C85757C85757C85757C85757C85757C85757C85757C802 + 00000200005757C85757C85757C85757C85757C85757C85757C75454C2B2B2DC + ECECECE6E6E6B8B8CDE2E2E2B3B3C635357A70709EE7E7E7E3E3E3CCCCD6CBCB + D4DDDDDD7575A04C4C85616192DFDFE3EAEAEAECECEC8D8DB39999BCE8E8E8E3 + E3E3B4B4C9DDDDDDDBDBDB3838813939833E3E8F4646A14B4BAD8989CDFAFAFA + F2F2F2DADAE3D5D5DDE3E3E37575A13C3C7F5B5B94D4D4DEEFEFEFF1F1F1EFEF + EF9D9DC0565697A8A8C6EFEFEFF1F1F1F2F2F2E6E6EB3E3E8E6262A2D5D5DFE8 + E8E8E7E7E7E7E7E7E8E8E85B5B95B2B2CAEFEFEFECECECECECECDEDEE28B8BB0 + 4E4E8BE4E4E8EEEEEEECECECEAEAEAD0D0D95C5C983C3C893F3F914646A04C4C + AF5151BA5454C25757C75757C85757C85757C85757C85757C85757C85757C857 + 57C85757C85757C85757C85757C85757C85757C85757C85757C85757C85757C8 + 5757C85757C85757C85757C85757C85757C85757C85757C85757C85757C85757 + C85757C85757C80200000200005757C85757C85757C85757C85757C85757C857 + 57C78282D3FDFDFDDFDFEC8080BE9D9DC5EAEAEABABACE383880C0C0D3F1F1F1 + 7878AC4A4A95D2D2DDE5E5E57373A74F4F909999BBEFEFEFB7B7CF3C3C885353 + 95F6F6F6F2F2F24B4B976161A3E5E5E5E0E0E03D3D8C3E3E9043439A4949A94E + 4EB4D1D1ECFFFFFF9B9BD16F6FB6D9D9E2E7E7E77B7BAB42428DD6D6E1EDEDED + 9393BF7070AD9797C2A1A1C69999C1F4F4F4D3D3E18E8EBA8686B6D0D0E14141 + 96DEDEE9F1F1F19191BE6D6DA96B6BA59999BE6161A09292BC6262A34040934B + 4B97EDEDEDE0E0E54E4E94A6A6C76666A44C4C997A7AB0E6E6E6ADADC9404093 + 43439A4848A64E4EB35252BC5555C35757C75757C85757C85757C85757C85757 + C85757C85757C85757C85757C85757C85757C85757C85757C85757C85757C857 + 57C85757C85757C85757C85757C85757C85757C85757C85757C85757C85757C8 + 5757C85757C85757C85757C85757C80200000200005656C85656C85656C85656 + C85656C85656C85656C8A4A4E0FFFFFFA1A1D94C4CB07575BAF3F3F3C1C1D63C + 3C8CBCBCD7FBFBFB9696C44E4EA1C5C5DDEFEFEF7171B343439B9595C4F4F4F4 + 9595C33F3F933E3E91F2F2F8FEFEFE8080BB44449EEFEFEFE6E6E643439C4444 + 9F4747A64D4DB25050BAC5C5E9FFFFFFB3B3E07474BFD0D0E4F2F2F28484B977 + 77B5F7F7F7D2D2E44646A44646A24C4CA46060ABD4D4E8FCFCFC9494C66262AC + 5555A64545A17676BBFFFFFFE3E3EF7575B97373B57272B27070B24F4FA14343 + 9B8C8CC2BBBBDADFDFEBF6F6F6E9E9EF45459E5151A49999CAC6C6DFE6E6EDEE + EEEEB3B3D14545A14747A64C4CB05050B95353C05555C55656C75656C85656C8 + 5656C85656C85656C85656C85656C85656C85656C85656C85656C85656C85656 + C85656C85656C85656C85656C85656C85656C85656C85656C85656C85656C856 + 56C85656C85656C85656C85656C85656C85656C85656C80200000200005656C8 + 5656C85656C85656C85656C85656C85656C8A4A4E1FFFFFFA3A3DD5050B97C7C + C5FBFBFBC8C8E04242995A5AA5CDCDE4FFFFFFFFFFFFFFFFFFFEFEFE7979C24A + 4AAB9D9DD0FBFBFB9A9ACD44449F44449E7777B9E6E6F3FFFFFFFFFFFFFCFCFC + F2F2F24A4AAC4B4BAE4D4DB35050BA5252BF6B6BCBD6D6F0FFFFFFFFFFFFFFFF + FFFFFFFF8F8FC97F7FC3FFFFFFCFCFE94D4DB24C4CB05151B16767B9D7D7ECFF + FFFF9191CC6969B95C5CB34B4BAD7B7BC3FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FDFDFD7A7AC19E9ED2FFFFFFFFFFFFFFFFFFC3C3E36E6EBD4B4BADCFCFE9FFFF + FFFFFFFFF3F3FAB3B3DB5656B24C4CB04D4DB35050B95252BF5454C35555C656 + 56C85656C85656C85656C85656C85656C85656C85656C85656C85656C85656C8 + 5656C85656C85656C85656C85656C85656C85656C85656C85656C85656C85656 + C85656C85656C85656C85656C85656C85656C85656C85656C85656C85656C802 + 00000200005656C85656C85656C85656C85656C85656C85656C88E8EDAFFFFFF + E8E8F75E5EC47F7FCCFFFFFFCFCFE94848A85353AB5555AF4B4BAE7C7CC7E7E7 + F5FFFFFF7F7FCC4F4FB8A1A1D9FFFFFFA0A0D64B4BAE4A4AAD6363B84C4CB059 + 59B98A8ACFFFFFFFFEFEFE5050B95050BA5151BD5353C15454C46060C97272CE + 7575CE9898D9ECECF8FFFFFF9494D36363C0F3F3FAFFFFFF8080CE5252BB8585 + CFA7A7DBB2B2DEFFFFFFCFCFEB7979C76C6CC3ADADDE5B5BBDF3F3FAE8E8F650 + 50BA5050BADCDCF1FFFFFF6767C2D0D0ECFFFFFF9797D65050BB5050B97F7FCC + 5050B9FFFFFFFFFFFF6868C45050BA5C5CBE7272C65050BA5151BB5252BF5454 + C35555C55656C75656C85656C85656C85656C85656C85656C85656C85656C856 + 56C85656C85656C85656C85656C85656C85656C85656C85656C85656C85656C8 + 5656C85656C85656C85656C85656C85656C85656C85656C85656C85656C85656 + C85656C85656C80200000200005656C85656C85656C85656C85656C85656C856 + 56C85656C8D2D2F0FFFFFFFFFFFFFFFFFFFFFFFFD0D0EC4E4EB57C7CC7FFFFFF + D0D0ECDCDCF1FFFFFFE8E8F75E5EC48181D1FFFFFFFFFFFFFFFFFFFFFFFFA1A1 + D9A2A2DAF3F3FAD1D1EDE8E8F6FFFFFFC6C6EA5353C15353C25454C35555C555 + 55C68383D6FFFFFFDBDBF3E4E4F5FFFFFFECECF87D7DCF6E6ECAA7A7DFFFFFFF + FFFFFFFFFFFFFFFFFFB5B5E47C7CCEE3E3F5FFFFFFFFFFFFFFFFFFFFFFFF5353 + C19898DAFFFFFFE8E8F7DDDDF3FFFFFFBABAE65353C28C8CD6FFFFFFF4F4FBD1 + D1EFF4F4FBD1D1EE5353C1AFAFE2FFFFFFE8E8F7D1D1EFFFFFFFA3A3DE5353C1 + 5454C35454C35555C55656C75656C75656C85656C85656C85656C85656C85656 + C85656C85656C85656C85656C85656C85656C85656C85656C85656C85656C856 + 56C85656C85656C85656C85656C85656C85656C85656C85656C85656C85656C8 + 5656C85656C85656C85656C85656C80200000200005656C85656C85656C85656 + C85656C85656C85656C85656C85656C89A9ADEA5A5E1A4A4E1FFFFFFD1D1EE52 + 52BF5E5EC28C8CD4A3A3DDA4A4DF9898DC6060CA5656C76060CABBBBE8FFFFFF + BBBBE78282D36A6ACA6B6BCB9898DBA4A4E0A4A4E08E8ED95555C65656C75656 + C75656C75656C85656C86161CC9C9CDFB7B7E7B7B7E7AEAEE48181D57878D278 + 78D27878D28A8AD8B7B7E7B7B7E7AEAEE48181D57878D27878D2A5A5E1B7B7E7 + B0B0E57878D25656C75656C76D6DCEA5A5E1A5A5E18E8EDA5656C75656C75656 + C76D6DCEA5A5E1A5A5E1A5A5E16D6DCE5656C75656C77878D2A5A5E1A5A5E19A + 9ADD6161CB5656C75656C75656C75656C75656C85656C85656C85656C85656C8 + 5656C85656C85656C85656C85656C85656C85656C85656C85656C85656C85656 + C85656C85656C85656C85656C85656C85656C85656C85656C85656C85656C856 + 56C85656C85656C85656C85656C85656C85656C85656C80200000200005656C8 + 5656C85656C85656C85656C85656C85656C85656C85656C85656C85656C88383 + D6FFFFFFD2D2F05555C55454C45555C55555C55555C65656C75656C85656C856 + 56C8A5A5E2FFFFFFA5A5E15555C65555C65555C65656C75656C75656C85656C8 + 5656C85656C85656C85656C85656C85656C85656C86666CD7878D37878D37878 + D37878D37878D37878D37878D37878D37878D37878D37878D37878D37878D378 + 78D37878D37878D36666CD5656C85656C85656C85656C85656C85656C85656C8 + 5656C85656C85656C85656C85656C85656C85656C85656C85656C85656C85656 + C85656C85656C85656C85656C85656C85656C85656C85656C85656C85656C856 + 56C85656C85656C85656C85656C85656C85656C85656C85656C85656C85656C8 + 5656C85656C85656C85656C85656C85656C85656C85656C85656C85656C85656 + C85656C85656C85656C85656C85656C85656C85656C85656C85656C85656C802 + 00000200005555C75555C75555C75555C75555C75555C75555C75555C75555C7 + 5555C75555C76C6CCEA4A4E19898DC5555C55454C45454C45454C45454C55555 + C65555C65555C65555C75555C75555C75555C75555C75555C75555C75555C755 + 55C75555C75555C65555C65454C55454C55454C45454C45454C55454C55A5AC8 + 7474D07777D27777D27777D27777D27777D27777D27777D27777D27777D27777 + D27777D27777D27777D27777D27474D15A5AC95555C75555C75555C75555C755 + 55C75555C75555C75555C75555C75555C75555C65555C65555C75555C75555C7 + 5555C75555C75555C75555C75555C75555C75555C75555C75555C75555C75555 + C75555C65555C65454C55454C55454C45454C45454C55454C55555C65555C655 + 55C75555C75555C75555C75555C75555C75555C75555C75555C75555C75555C7 + 5555C75555C75555C75555C75555C75555C75555C75555C75555C75555C75555 + C75555C75555C70200000200005555C75555C75555C75555C75555C75555C755 + 55C75555C75555C75555C75555C65454C55454C45353C25252BF5151BE5151BD + 5151BD5151BD5151BE5252C05353C25454C45454C55555C65555C65555C75555 + C75555C75555C75555C65454C55353C35252C15151BE5151BD5050BB5050BB51 + 51BD5151BE5252C15F5FC77474D07777D17777D17777D17676D07575CF7575CE + 7575CE7575CE7474CD7474CD7575CE7575CE7373CE5F5FC85454C55555C65555 + C65555C75555C75555C75555C75555C75555C65454C55454C45353C35353C253 + 53C25353C35454C45454C55555C65555C75555C75555C75555C75555C75555C7 + 5555C75555C65454C55353C35252C15151BE5151BD5050BB5050BB5151BD5151 + BE5252C15353C35454C55555C65555C65555C65454C55454C45353C35353C353 + 53C35353C25353C25353C35353C35353C35454C45454C55555C65555C65555C7 + 5555C75555C75555C75555C75555C70200000200005555C75555C75555C75555 + C75555C75555C75555C75555C75555C75555C65454C45252C15151BD4F4FB84D + 4DB44C4CB24B4BB04B4BB04C4CB14D4DB34E4EB64F4FB85050BB5252BF5353C2 + 5454C45555C65555C65555C65454C55353C35252BF5050BB4E4EB74C4CB24B4B + AF4A4AAC4A4AAC4B4BAF4C4CB24E4EB75050BB5959C26767C87171CD7272CD71 + 71CB6F6FC86E6EC66E6EC56D6DC36C6CC26C6CC26B6BC26363C05858BE5151BE + 5252C15353C35454C55555C65555C75555C75555C75555C65454C55353C25252 + BF5050BB4F4FB94F4FB95050BB5151BE5353C25454C45555C65555C75555C755 + 55C75555C75555C65454C55353C35252BF5050BB4E4EB74C4CB24B4BAF4A4AAC + 4A4AAC4B4BAF4C4CB24E4EB75050BB5252BF5353C25353C35353C25252C15151 + BE5050BB5050BB4F4FB94F4FB84F4FB84F4FB94F4FBA5050BB5151BE5252C153 + 53C35454C55555C65555C75555C75555C75555C75555C70200000200005555C7 + 5555C75555C75555C75555C75555C75555C75555C75555C65454C45252BF4F4F + B94C4CB24949AB4747A54646A34545A24646A34646A54747A74848A94A4AAC4B + 4BB04D4DB54F4FBA5151BE5353C25454C45454C45353C25151BD4E4EB64B4BAF + 4747A64444A042429B41419942429A43439C4545A24848A84B4BAF4E4EB65050 + BB5151BD5151BD5050BB4E4EB64C4CB14A4AAE4949AB4848A94848A94949AB4A + 4AAD4C4CB14E4EB75050BC5252C15454C45555C65555C75555C75555C75454C5 + 5353C25151BD4E4EB64B4BAF4949AC4949AC4A4AAE4D4DB35050BB5252C05454 + C45555C65555C75555C75555C65454C55353C25151BD4E4EB64B4BAF4747A644 + 44A042429B41419942429A43439C4545A24848A84B4BAF4E4EB65050BB5151BD + 5151BD5050BB4E4EB64C4CB14A4AAE4949AB4848A94848A94949AB4A4AAD4C4C + B14E4EB75050BC5252C15454C45555C65555C75555C75555C75555C75555C702 + 00000200005555C75555C75555C75555C75555C75555C75555C75555C75454C5 + 5252C04F4FB94B4BB04646A542429B4040953E3E923E3E924040954141974242 + 9A43439C44449E4545A24848A84A4AAE4D4DB55050BB5151BE5151BE5050BB4C + 4CB24848A843439C3E3E913B3B893838833737823838843B3B893E3E9042429A + 4545A24949AB4C4CB14D4DB44D4DB54C4CB24949AC4747A544449E4141994040 + 9640409641419944449E4747A54B4BAF4E4EB75151BE5353C25454C55555C755 + 55C75555C65454C45151BD4D4DB54949AA44449F41419941419943439D4747A5 + 4C4CB15050BB5353C25454C55555C75555C65454C55353C25050BB4C4CB34848 + A843439C3E3E913B3B893838833737823838843B3B893E3E9042429A4545A249 + 49AB4C4CB14D4DB44D4DB54C4CB24949AC4747A544449E414199404096404096 + 41419944449E4747A54B4BAF4E4EB75151BE5353C25454C55555C75555C75555 + C75555C75555C70200000200005555C75555C75555C75555C75555C75555C755 + 55C75555C65353C35050BC4C4CB14646A44040953B3B8B393985383884393986 + 3B3B8B3D3D8E3E3E903E3E913E3E913F3F9341419744449E4747A74B4BAF4D4D + B44D4DB44B4BAF4646A34040953A3A8734347B3131722F2F6F30307031317334 + 347B3838833C3C8D4040974444A04747A74949AC4A4AAC4848A84545A1404097 + 3C3C8C38388336367E36367E3838833C3C8C4141994747A54C4CB15050BB5353 + C25454C55555C75555C75555C65252C14F4FB84949AB43439C3C3C8C38388338 + 38823A3A894040954747A54D4DB35151BD5454C45555C65454C55353C25050BB + 4C4CB14646A44040953A3A8734347B3131722F2F6F30307031317334347B3838 + 833C3C8D4040974444A04747A74949AC4A4AAC4848A84545A14040973C3C8C38 + 388336367E36367E3838833C3C8C4141994747A54C4CB15050BB5353C25454C5 + 5555C75555C75555C75555C75555C70200000200005454C75454C75454C75454 + C75454C75454C75454C75454C65151C14D4DB74848AA41419A3A3A8A36368035 + 357E36367F3838853B3B8C3D3D913E3E923C3C8F3B3B8B3939883939883C3C8D + 3F3F9643439F4646A54646A643439E3D3D913737823030722B2B672929622A2A + 622B2B672E2E6E3232773636803A3A893D3D904141994444A04646A54646A645 + 45A341419B3C3C8E3636803131732E2E6C2E2E6C3131733636813E3E924444A2 + 4A4AB04F4FBB5252C25353C55454C75454C75353C45050BD4B4BB14444A13C3C + 8D34347B2F2F702F2F7033337839398741419B4949AC4E4EB95252C25353C552 + 52C35050BD4C4CB34646A53E3E933737823030722B2B672929622A2A622B2B67 + 2E2E6E3232773636803A3A893D3D904141994444A04646A54646A64545A34141 + 9B3C3C8E3636803131732E2E6C2E2E6C3131733636813E3E924444A24A4AB04F + 4FBB5252C25353C55454C75454C75454C75454C75454C70200000200005454C7 + 5454C75454C75454C75454C75454C75454C75353C55050BE4C4CB34646A53E3E + 9338388535357E35357E3838853C3C8E40409742429C42429B3F3F953B3B8C37 + 378335357D35357E3838853B3B8C3E3E933F3F943B3B8C35357E2F2F6F292962 + 26265B26265B2929612D2D6A31317436367F3939873C3C8E3E3E934141994343 + 9E4545A24545A44545A241419A3B3B8C34347B2D2D6A2929622929622D2D6A34 + 347B3D3D904545A34B4BB35050BD5252C35454C65454C75454C65252C24E4EB8 + 4848AA3F3F953636802E2E6C2929622929622E2E6C35357E3E3E934646A54C4C + B55050BE5252C25151BF4D4DB74747A93F3F963737822F2F7029296226265B26 + 265B2929612D2D6A31317436367F3939873C3C8E3E3E9341419943439E4545A2 + 4545A44545A241419A3B3B8C34347B2D2D6A2929622929622D2D6A34347B3D3D + 904545A34B4BB35050BD5252C35454C65454C75454C75454C75454C75454C702 + 00000200005454C75454C75454C75454C75454C75454C75454C75353C55050BD + 4B4BB14444A26A6AA78888B18787AF8888B18B8BB87878B46666B24747A94646 + A643439E3D3D9037378232327630307231317433337936368036368033337839 + 39746F6F9084849BA7A7B4A7A7B69393AB75759E3838853D3D9040409742429C + 43439E4444A14545A34646A54646A64545A441419B3B3B8C3333782B2B652727 + 5B27275B2B2B6533337A3E3E924646A54C4CB55151BF5353C55454C65454C753 + 53C55151BF4C4CB37A7AB86565A03C3C7B2A2A6226265926265B2B2B67333379 + 3C3C8D4444A24B4BB14F4FBB5151BF4F4FBB4A4AAF43439E3939873C3C797070 + 9184849BA7A7B4A7A7B69393AB75759E3838853D3D9040409742429C43439E44 + 44A14545A34646A54646A64545A441419B3B3B8C3333782B2B6527275B27275B + 2B2B6533337A3E3E924646A54C4CB55151BF5353C55454C65454C75454C75454 + C75454C75454C70200000200005454C75454C75454C75454C75454C75454C754 + 54C75353C44F4FBC8E8ECBE4E4EAECECECECECECEFEFEFF2F2F2F5F5F5F5F5F5 + F2F2F2E1E1E8A7A7D05A5AAD4040973737833030722C2C692B2B662C2C692E2E + 6C2E2E6D8181A1D4D4D7E0E0E0E0E0E0E2E2E2E3E3E3E5E5E5E5E5E5CFCFDB85 + 85BD4747A94848AB4848AB4848AC7777C0F7F7F7F3F3F3CBCBDFB9B9D1B0B0C6 + AAAABDA7A7B6B4B4BEDDDDDDE5E5E56565993F3F954747A94E4EB85252C25454 + C65454C65454C65353C44F4FBB4949ACD2D2DEDDDDDDD5D5D5BABAC175759026 + 265B2C2C693333793B3B8C43439E4949AE4D4DB74F4FBB4D4DB64747A83E3E93 + 8686ABD4D4D8E0E0E0E0E0E0E2E2E2E3E3E3E5E5E5E5E5E5CFCFDB8585BD4747 + A94848AB4848AB4848AC7777C0F7F7F7F3F3F3CBCBDFB9B9D1B0B0C6AAAABDA7 + A7B6B4B4BEDDDDDDE5E5E56565993F3F954747A94E4EB85252C25454C65454C6 + 5454C75454C75454C75454C75454C70200000200005454C75454C75454C75454 + C75454C75454C75454C75353C46767C6FDFDFDFAFAFAFAFAFAFBFBFBF1F1F7B4 + B4D99D9DD2A0A0D8C5C5E9FEFEFEF2F2F2E5E5E59393BD42428A2F2F6F292962 + 26265B26265B27275D9C9CB1E9E9E9E9E9E9EBEBEBEFEFEFF3F3F3F7F7F7F8F8 + F8F9F9F9F7F7F7F4F4F4D1D1E67979C74D4DB74D4DB65959BB7C7CC9C4C4E7FC + FCFCF2F2F2E8E8E8E0E0E0DDDDDDDEDEDEA5A5B76C6C9543438841419A4949AE + 5050BD5353C55454C75454C75454C65151C14D4DB66A6AB6EFEFEFE5E5E5DDDD + DDD7D7D7BDBDC32929602F2F7036367F3C3C8D42429D4848AB4C4CB34D4DB64A + 4AB04444A1A5A5C4E9E9E9E9E9E9EBEBEBEFEFEFF3F3F3F7F7F7F8F8F8F9F9F9 + F7F7F7F4F4F4D1D1E67979C74D4DB74D4DB65959BB7C7CC9C4C4E7FCFCFCF2F2 + F2E8E8E8E0E0E0DDDDDDDEDEDEA5A5B76C6C9543438841419A4949AE5050BD53 + 53C55454C75454C75454C75454C75454C75454C75454C70200000200005353C6 + 5353C65353C65353C65353C65353C65353C65252C4A1A1DCFFFFFFFFFFFFFFFF + FF9B9BCC5151AB4848AC4C4CB54F4FBD5252C37474CEF3F3FAF2F2F2E2E2E2B7 + B7C638387126265C2323532222519A9AAEEDEDEDEFEFEFF2F2F2F6F6F6FCFCFC + FFFFFFF2F2F6BFBFDB9C9CCF9F9FD6B8B8E3E7E7F6FEFEFEB8B8E36666C34D4D + B94D4DB94D4DB9CFCFEBFFFFFFF5F5F5EBEBEBE4E4E4B1B1C028285F2D2D6A36 + 368241419B4A4AAF4F4FBD5252C45353C65353C65252C34F4FBC4949AFB1B1D6 + F6F6F6EFEFEFE6E6E6E0E0E0DCDCDC4F4F7F3232783838863D3D9041419B4646 + A74949AE4949AF4747A9ABABCFF1F1F1F0F0F0F2F2F2F6F6F6FCFCFCFFFFFFF2 + F2F6BFBFDB9C9CCF9F9FD6B8B8E3E7E7F6FEFEFEB8B8E36666C34D4DB94D4DB9 + 4D4DB9CFCFEBFFFFFFF5F5F5EBEBEBE4E4E4B1B1C028285F2D2D6A3636824141 + 9B4A4AAF4F4FBD5252C45353C65353C65353C65353C65353C65353C65353C602 + 00000200005353C65353C65353C65353C65353C65353C65353C65252C4A2A2DD + FFFFFFFFFFFF9292CE4848AC4A4AB04C4CB64E4EBB5151C15252C35050BE7C7C + C9FEFEFEECECECDEDEDEA9A9B824245722225070708BECECECF2F2F2F7F7F7FB + FBFBFFFFFFFFFFFF8F8FB13737833F3F974646A74A4AB14C4CB54C4CB69494D3 + E7E7F5FFFFFF4C4CB54C4CB64D4DB7A0A0D7FFFFFFFFFFFFF4F4F4EAEAEA8181 + 9E28285F2D2D6B37378241419C4A4AAF4F4FBD5353C55353C65353C55151C14D + 4DB75353AEF2F2F8FDFDFDF8F8F8F0F0F09B9BB0CDCDD58F8FAF3737833C3C8E + 3E3E9541419B4444A34747A94747A98D8DC6F8F8F8F7F7F7F8F8F8FBFBFBFFFF + FFFFFFFF8F8FB13737833F3F974646A74A4AB14C4CB54C4CB69494D3E7E7F5FF + FFFF4C4CB54C4CB64D4DB7A0A0D7FFFFFFFFFFFFF4F4F4EAEAEA81819E28285F + 2D2D6B37378241419C4A4AAF4F4FBD5353C55353C65353C65353C65353C65353 + C65353C65353C60200000200005353C65353C65353C65353C65353C65353C653 + 53C65353C5B9B9E7FFFFFFD0D0ED4D4DB74C4CB64D4DB94F4FBC5050BE5151C1 + 5050BE4D4DB74747AAE6E6F1F6F6F6E8E8E8DEDEDE6D6D8A222250CFCFD6F1F1 + F1F7F7F7FBFBFBFEFEFEFFFFFF51517C2E2E6E3838853F3F974545A44848AB48 + 48AC4848AB4747A85252ADC1C1E24747A94949AE4A4AB17A7AC5FFFFFFFFFFFF + FBFBFBEFEFEF5B5B842828602D2D6B37378341419C4A4AAF4F4FBD5252C45353 + C55252C34F4FBD4B4BB28E8EC6FFFFFFFFFFFFFFFFFFF9F9F9797999A3A3BCD4 + D4DD3B3B8D3F3F9740409A41419B43439F4545A44545A5E6E6F2FEFEFEFDFDFD + FDFDFDFEFEFEFFFFFF51517C2E2E6E3838853F3F974545A44848AB4848AC4848 + AB4747A85252ADC1C1E24747A94949AE4A4AB17A7AC5FFFFFFFFFFFFFBFBFBEF + EFEF5B5B842828602D2D6B37378341419C4A4AAF4F4FBD5252C45353C55353C5 + 5353C55353C65353C65353C65353C60200000200005353C65353C65353C65353 + C65353C65353C65353C65353C5D1D1EFFFFFFF8A8AD55050BE4F4FBD5050BE50 + 50BF5050BE4F4FBC4C4CB54747AA41419BCACAE0FEFEFEF2F2F2E9E9E99898AC + 666687F1F1F1F5F5F5F9F9F9FBFBFBFBFBFB8989A226265C2E2E6D3737833E3E + 9442429E4444A24343A141419C3F3F973E3E943E3E943F3F9742429E4646A678 + 78C0FFFFFFFFFFFFFEFEFEF1F1F15B5B8428285F2D2D6A37378241419B4949AE + 4E4EBB5151C25252C35050BF4D4DB74747A9D9D9EAFFFFFFFFFFFFFFFFFFFEFE + FE454576676798F4F4F46E6EAE42429E42429E41419B41419B42429E8181BEFF + FFFFFFFFFFFFFFFFFDFDFDFBFBFB8989A326265C2E2E6D3737833E3E9442429E + 4444A24343A141419C3F3F973E3E943E3E943F3F9742429E4646A67878C0FFFF + FFFFFFFFFEFEFEF1F1F15B5B8428285F2D2D6A37378241419B4949AE4E4EBB51 + 51C25252C35252C35252C45252C45353C55353C65353C60200000200005353C6 + 5353C65353C65353C65353C65353C65353C65353C6D1D1F0FFFFFF5252C45252 + C35151C15151C15050BE4E4EBA4B4BB24646A7404099393988E4E4EDFFFFFFFA + FAFAF3F3F3BBBBC98888A6F8F8F8F9F9F9F9F9F9F7F7F7E4E4E823235526265B + 2D2D6B35357F3B3B8D3F3F963F3F973E3E943A3A8B36368234347C34347B3636 + 803A3A8B3F3F977575B9FFFFFFFFFFFFFBFBFBEEEEEE5A5A8127275C2C2C6835 + 357F4040984747AA4C4CB64F4FBD4F4FBC4C4CB64949AE6868B1FFFFFFFFFFFF + FFFFFFFFFFFFD3D3DE2B2B6735357EE2E2EDADADD24545A54444A241419B3F3F + 963F3F979999C8FFFFFFFFFFFFFFFFFFF8F8F8E4E4E824245526265B2D2D6B35 + 357F3B3B8D3F3F963F3F973E3E943A3A8B36368234347C34347B3636803A3A8B + 3F3F977575B9FFFFFFFFFFFFFBFBFBEEEEEE5A5A8127275C2C2C6835357F4040 + 984747AA4C4CB64F4FBD4F4FBD5050BE5050C05151C15252C35353C55353C602 + 00000200005353C65353C65353C65353C65353C65353C65353C65353C69898DD + A3A3E15353C55252C45151C25050BE4D4DB74949AF4444A23E3E943737846767 + 99FFFFFFFFFFFFFFFFFFFEFEFEC5C5D5C8C8D9FFFFFFFEFEFEF9F9F9F3F3F39D + 9DB225255927275D2D2D6B35357E3B3B8D3E3E953E3E953C3C8E373782313174 + 2D2D6B2C2C6A2F2F6F34347B3B3B8C7272B3FFFFFFFFFFFFFAFAFAECECEC5858 + 7F26265A2A2A6533337B3D3D924444A24949AD4B4BB24949AF4747A843439FB1 + B1D3FFFFFFFFFFFFFEFEFEFEFEFE8B8BA82E2E6D3838869A9ACAECECF35252AE + 4545A44040993C3C903B3B8DCBCBE1FFFFFFFFFFFFFFFFFFF5F5F59E9EB42525 + 5927275D2D2D6B35357E3B3B8D3E3E953E3E953C3C8E3737823131742D2D6B2C + 2C6A2F2F6F34347B3B3B8C7272B3FFFFFFFFFFFFFAFAFAECECEC58587F26265A + 2A2A6533337B3D3D924444A24949AD4B4BB34B4BB34C4CB44D4DB74F4FBC5151 + C15252C45353C60200000200005252C65252C65252C65252C65252C65252C652 + 52C65252C65252C65252C65252C55151C34F4FBE4C4CB64747AC42429F3B3B90 + 35357F2E2E70D3D3DFFFFFFFFFFFFFFFFFFFFFFFFF9191B5C9C9DEFFFFFFFFFF + FFFBFBFBF2F2F28484A42828612929632E2E6E35357F3B3B8E3E3E963E3E953A + 3A8D34347D2D2D6C28286127275F2A2A653030733737846F6FAEFFFFFFFFFFFF + F8F8F8EAEAEA57577D24245728286131317639398A3F3F974242A04343A24141 + 9E3E3E96474795F2F2F6FFFFFFFEFEFEFBFBFBFBFBFB4444722F2F713A3A8B5B + 5BADFDFDFD9898CE4444A33E3E95393989373784CACADEFFFFFFFFFFFFFFFFFF + F2F2F28383A32828602929632E2E6E35357F3B3B8E3E3E963E3E953A3A8D3434 + 7D2D2D6C28286127275F2A2A653030733737846F6FAEFFFFFFFFFFFFF8F8F8EA + EAEA57577D24245728286131317639398A3F3F974242A04444A34444A34444A5 + 4747AC4B4BB44D4DBB5050C15252C50200000200005252C65252C65252C65252 + C65252C65252C65252C65252C65252C65252C55151C34F4FBE4C4CB64747AB41 + 419C3A3A8C33337B2D2D6CA3A3B9FBFBFBFFFFFFFFFFFFFFFFFFFFFFFF60609E + CCCCE3FFFFFFFFFFFFFEFEFEF1F1F16161942D2D6D2C2C6B3030733535813B3B + 8E3D3D943D3D933939893232782B2B6727275D26265C2929632F2F723636836F + 6FABFFFFFFFFFFFFF7F7F7E8E8E856567B2424562828602F2F713636823A3A8D + 3C3C913C3C9139398A3636828585B0FFFFFFFFFFFFFCFCFCF8F8F8CECED82929 + 633232783C3C904444A5CECEE9E0E0ED4343A23D3D9437378434347DC9C9DCFF + FFFFFFFFFFFFFFFFF1F1F16060902C2C6A2C2C6A3030733535813B3B8E3D3D94 + 3D3D933939893232782B2B6727275D26265C2929632F2F723636836F6FABFFFF + FFFFFFFFF7F7F7E8E8E856567B2424562828602F2F713636823A3A8D3C3C913D + 3D933C3C923E3E9642429F4747AB4B4BB64F4FBE5151C40200000200005252C6 + 5252C65252C65252C65252C65252C65252C65252C65252C65151C44F4FBF4C4C + B74747AC40409B3939893232783838719F9FB5F5F5F5FCFCFCFFFFFFFFFFFFFF + FFFFCACAE03F3F999C9CD0FFFFFFFFFFFFFFFFFFF5F5F5C6C6D5B6B6C9B9B9CC + E3E3E8F4F4F4F4F4F4EFEFEFE6E6E6DDDDDDD4D4D4BBBBC3A4A4B3ABABBA2C2C + 6A3232793838886F6FAEFFFFFFFFFFFFF5F5F5E6E6E657577E26265B2929632F + 2F7234347E37378437378636368333337B303074D5D5E2FFFFFFFEFEFEF9F9F9 + F4F4F48787A52D2D6D3535813E3E974545A89292CFF8F8F88888C13D3D943737 + 8433337B9292B9FFFFFFFFFFFFFFFFFFF5F5F5C5C5D3B6B6C9B9B9CCE3E3E8F4 + F4F4F4F4F4EFEFEFE6E6E6DDDDDDD4D4D4BBBBC3A4A4B3ABABBA2C2C6A323279 + 3838886F6FAEFFFFFFFFFFFFF5F5F5E6E6E657577E26265B2929632F2F723434 + 7E3737843838863737863737843939893E3E954444A44949B14E4EBC5151C302 + 00000200005252C65252C65252C65252C65252C65252C65252C65252C65252C5 + 5050C14D4DBA4848AF41419E3A3A8B323278515181C4C4CFF2F2F2FAFAFAFFFF + FFFFFFFFFFFFFFF2F2F75A5AA94646A98787CDFFFFFFFFFFFFFFFFFFFDFDFDCD + CDDF9A9AC08F8FB99393BD9696C29898C5B1B1D5EAEAEFECECECE2E2E2DBDBDB + D8D8D8C6C6CF33337B3838863C3C917171B1FFFFFFFFFFFFF4F4F4E5E5E55959 + 852A2A662D2D6D32327835358036368235358033337B30307456568AFCFCFCFE + FEFEFBFBFBF5F5F5EFEFEF3A3A7632327939398A40409B4646AA5555B5F9F9F9 + D8D8E53E3E9638388735357F7878AAFFFFFFFFFFFFFFFFFFFCFCFCCCCCDC9999 + BE8F8FB89393BD9696C29898C5B1B1D5EAEAEFECECECE2E2E2DBDBDBD8D8D8C6 + C6CF33337B3838863C3C917171B1FFFFFFFFFFFFF4F4F4E5E5E55959852A2A66 + 2D2D6D32327835358036368235358134347F34347D3636823B3B904242A04848 + AF4D4DBA5151C30200000200005252C65252C65252C65252C65252C65252C652 + 52C65252C65151C44F4FBE4B4BB44444A53C3C9033337B77779CDEDEE1F1F1F1 + F9F9F9FFFFFFFFFFFFFFFFFFF2F2F86868B24747AC4B4BB54D4DBBE8E8F6FFFF + FFFFFFFFFFFFFF9898CC41419E3E3E963D3D933D3D943E3E973E3E97CBCBE2F8 + F8F8F0F0F0E9E9E9E4E4E4A0A0BF3B3B8D3E3E9741419E9A9ACBFFFFFFFFFFFF + F6F6F6E8E8E85F5F9232327834347D38388639398A8888B37C7CAB35357F3232 + 78A9A9C4FEFEFEFFFFFFFCFCFCF5F5F5B0B0C835358139398A3E3E974444A448 + 48AE4A4AB3CECEE9F3F3F39292C43C3C923A3A8B39398AE5E5F0FFFFFFFFFFFF + FFFFFF9696C73F3F993D3D943D3D933D3D943E3E973E3E97CBCBE2F8F8F8F0F0 + F0E9E9E9E4E4E4A0A0BF3B3B8D3E3E9741419E9A9ACBFFFFFFFFFFFFF6F6F6E8 + E8E85F5F9232327834347D38388639398A8787B27A7AA936368235357F373784 + 3C3C904242A04848AF4D4DBA5151C30200000200005252C65252C65252C65252 + C65252C65252C65252C65252C65151C34D4DBB4848AE40409B43438BABABC1EC + ECECF2F2F2FAFAFAFFFFFFFFFFFFFFFFFFF2F2F86969B54848AD4B4BB54D4DBA + 4E4EBC8A8AD4FFFFFFFFFFFFFFFFFFC3C3E64747AC4545A64343A242429F4141 + 9E41419DF2F2F8FFFFFFFFFFFFF8F8F8F2F2F27B7BB74242A04545A74747AC9C + 9CD2FFFFFFFFFFFFFEFEFEF0F0F0C5C5D54646933C3C913E3E973F3F999898C1 + D0D0DC3B3B8D515195FFFFFFFFFFFFFFFFFFFFFFFFFAFAFA8585BA3F3F984141 + 9E4545A64848AE4B4BB64D4DB9CFCFECFBFBFBF5F5F56767B341419E41419C81 + 81BFFFFFFFFFFFFFFFFFFFC1C1E34646A94444A54343A242429F41419E41419D + F2F2F8FFFFFFFFFFFFF8F8F8F2F2F27B7BB74242A04545A74747AC9C9CD2FFFF + FFFFFFFFFEFEFEF0F0F0C5C5D54646933C3C913E3E973F3F999595BEC8C8D33B + 3B8F3A3A8D3B3B9040409A4545A74A4AB34E4EBD5151C30200000200005151C5 + 5151C55151C55151C55151C55151C55151C55151C54F4FC04B4BB64545A86060 + A5C8C8D6EFEFEFF5F5F5FBFBFBFFFFFFFFFFFFFFFFFFD8D8EA5D5DB24848AF4A + 4AB54B4BB74C4CB84C4CB84D4DBAB8B8E5FFFFFFFFFFFFFFFFFF6363C04949B2 + 4747AE4646AB4646A97777BEFFFFFFFFFFFFFFFFFFFFFFFFCDCDE74646AA4848 + AF4A4AB44A4AB5DBDBF0FFFFFFFFFFFFFFFFFFFEFEFED1D1E4E7E7EE8989C35C + 5CB17E7EC0E6E6EDF2F2F29696C8D9D9EBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + 6969B74646AA4747AD4949B24B4BB64D4DBB4D4DBCDBDBF1FFFFFFFFFFFFF2F2 + F96C6CBD4646AB4747ADB6B6DFFFFFFFFFFFFFFFFFFF6262BF4949B24747AE46 + 46AB4646A97777BEFFFFFFFFFFFFFFFFFFFFFFFFCDCDE74646AA4848AF4A4AB4 + 4A4AB5DBDBF0FFFFFFFFFFFFFFFFFFFEFEFED1D1E4E7E7EE8989C35C5CB17D7D + BFDEDEE5E4E4E48181BA40409D4242A04444A64848AF4C4CB84E4EBF5050C302 + 00000200005151C55151C55151C55151C55151C55151C55151C55151C44F4FC0 + 4A4AB46767B4E6E6EBF3F3F3F7F7F7FEFEFEFFFFFFFFFFFFFFFFFFA4A4CE5151 + AD4A4AB34B4BB74B4BB74A4AB54949B24848B04A4AB34C4CB8ACACE0FFFFFFFF + FFFFDCDCF25959C04C4CB94B4BB65656B9DBDBF0FFFFFFFFFFFFFFFFFFF3F3FA + 5656B96363C1A0A0DAA0A0DBC4C4E8FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5252 + AFCECEE9FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFC3C3E79E9ED74C4CB94D4DBB4E4EBD7E7ED1C4C4EAFFFFFF + FFFFFFFFFFFFFFFFFFF3F3FAABABDE4C4CB94D4DBBACACE0FFFFFFFFFFFFDCDC + F25959C04C4CB94B4BB65656B9DBDBF0FFFFFFFFFFFFFFFFFFF3F3FA5656B963 + 63C1A0A0DBA1A1DCC4C4E9FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5555B7CECEEA + FFFFFFFFFFFFFEFEFEF9F9F9F1F1F1E1E1E85252B14848AF4949B24C4CB94E4E + BD4F4FC15151C40200000200005151C55151C55151C55151C55151C55151C551 + 51C55151C44E4EBF5656B9E1E1EDF8F8F8FBFBFBFEFEFEFFFFFFFFFFFFF1F1F6 + 7B7BB24242A14949B14C4CB94C4CB94A4AB44747AE4545A84444A54646AA4949 + B24C4CB97D7DD0DCDCF3FFFFFFE8E8F7ADADE2A1A1DCE7E7F6FFFFFFFFFFFFFF + FFFFC4C4E85959C04E4EBD7171CAD0D0EDD0D0EDDBDBF1FFFFFFFFFFFFFFFFFF + FFFFFFFFFFFF4646AA4747AC9D9DD4FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFD0D0EDD0D0EDD0D0EDD0D0EED0D0EED0D0EED0D0EE5050C25050C25050C396 + 96DBD0D0EFD0D0EFD0D0EFD0D0EFD0D0EFD0D0EFD0D0EE5050C25050C25050C3 + 7F7FD3DCDCF3FFFFFFE8E8F7ADADE2A1A1DCE7E7F6FFFFFFFFFFFFFFFFFFC4C4 + E85A5AC14E4EBE7272CDD0D0EFD0D0EFDCDCF3FFFFFFFFFFFFFFFFFFFFFFFFFF + FFFF4E4EBD4E4EBDA1A1DCFFFFFFFFFFFFFFFFFFFFFFFFFAFAFA9B9BD64D4DBB + 4E4EBD4F4FC05050C25050C35151C40200000200005151C55151C55151C55151 + C55151C55151C55151C55151C44F4FC09E9ED7FFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFD5D5E14D4D8B3B3B904343A44949B24B4BB74949B24646AB4343A240409B + 3F3F9A4242A14747AC4A4AB54E4EBE5151C47474D1A2A2E0C5C5EBD1D1EFD0D0 + EFC5C5EBA2A2DE6767CA5050C24F4FC14F4FC04E4EBD4C4CB94A4AB44848AF46 + 46AB5050AC7575BC9B9BCED9D9EC4343A44444A64646AB6060BAB7B7E2F3F3FA + F3F3FBA1A1DE5050C25050C25050C35151C45151C45151C55151C55151C55151 + C55151C55151C55151C55151C55151C55151C55151C55151C55151C55151C551 + 51C55151C55151C55151C55151C57474D1A2A2E0C5C5EBD1D1EFD0D0EFC5C5EB + A2A2DE6767CA5050C25050C35151C45151C45151C55151C55151C55151C55D5D + C97F7FD4A2A2E0DCDCF35151C45151C45151C46868CCB9B9E7F3F3FBF3F3FBA2 + A2DF5050C25050C25050C35151C45151C45151C55151C50200000200005151C5 + 5151C55151C55151C55151C55151C55151C55151C54F4FC0F3F3FAFFFFFFFFFF + FFFFFFFFFFFFFFAAAAC32C2C6C33337C3B3B8F41419F4646AB4848AF4545A841 + 419F3E3E963B3B903B3B9040409B4545A74A4AB34E4EBD5151C45151C55151C5 + 5151C55151C55151C55151C55151C55151C45050C34F4FC04D4DBB4A4AB44747 + AD4444A641419F3F3F9A3E3E973E3E963E3E963E3E963E3E973F3F9941419E44 + 44A54747AD4B4BB64E4EBD5050C25151C45151C55151C55151C55151C55151C5 + 5151C55151C55151C55151C55151C55151C55151C55151C55151C55151C55151 + C55151C55151C55151C55151C55151C55151C55151C55151C55151C55151C551 + 51C55151C55151C55151C55151C55151C55151C55151C55151C55151C55151C5 + 5151C55151C55151C55151C55151C55151C55151C55151C55151C55151C55151 + C55151C55151C55151C55151C55151C55151C55151C55151C55151C55151C502 + 00000200005151C55151C55151C55151C55151C55151C55151C55151C57373CE + FFFFFFFFFFFFFFFFFFFFFFFFD4D4E33D3D7B2F2F7233337D3A3A8D3F3F9A4343 + A34444A541419E6C6CAD52529A38388839398B3E3E974444A64949B24E4EBD50 + 50C35151C45151C45050C35050C35151C45151C45050C34F4FC14E4EBD4C4CB8 + 4848AF4444A640409D3D3D943A3A8D39398A38388839398A39398A39398B3939 + 8B39398C3B3B8F3E3E964242A04747AC4B4BB64E4EBF5050C35151C55151C551 + 51C55151C55151C55151C55151C55151C55151C55151C55151C55151C55151C5 + 5151C55151C55151C55151C55151C55151C55151C55151C55151C55151C55151 + C55151C55151C55151C55151C55151C55151C55151C55151C55151C55151C551 + 51C55151C55151C55151C55151C55151C55151C55151C55151C55151C55151C5 + 5151C55151C55151C55151C55151C55151C55151C55151C55151C55151C55151 + C55151C55151C50200000200005050C55050C55050C55050C55050C55050C550 + 50C55050C57E7ED3FFFFFFFFFFFFFFFFFFFDFDFD7676AC33337E32327C343481 + 38388A3C3C943F3F9B3F3F9B5555A2E9E9E97D7DAE37378639398C3E3E994444 + A84949B44D4DBD4F4FC24F4FC24E4EC04E4EC04D4DBF4E4EC04E4EC04D4DBE4C + 4CBB4949B54646AC4242A13D3D9639398C35358334347F34347F353583373788 + 38388A38388B37378836368636368638388B3D3D964343A44848B24D4DBD4F4F + C25050C55050C55050C55050C55050C55050C55050C55050C55050C55050C550 + 50C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050C5 + 5050C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050 + C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050C550 + 50C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050C5 + 5050C55050C55050C55050C55050C50200000200005050C55050C55050C55050 + C55050C55050C55050C55050C57F7FD4FFFFFFFFFFFFFFFFFFFBFBFB3E3E9839 + 398D37378837378839398C3B3B913C3C943D3D958282B6E9E9E96666A338388B + 3B3B9141419F4646AC4A4AB74D4DBE4E4EC04D4DBF4C4CBB4B4BB94A4AB64A4A + B64A4AB64949B44747AF4444A840409D3B3B9137378733337F32327B32327B34 + 34803737873A3A8F3C3C943C3C9339398D3737883535833737863B3B9141419F + 4747AE4C4CBA4F4FC25050C55050C55050C55050C55050C55050C55050C55050 + C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050C550 + 50C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050C5 + 5050C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050 + C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050C550 + 50C55050C55050C55050C55050C55050C55050C55050C50200000200005050C5 + 5050C55050C55050C55050C55050C55050C55050C55050C5F3F3FBFFFFFFFFFF + FFFFFFFF4F4FAD41419F3E3E983D3D963D3D963D3D973E3E983E3E98C1C1D9EC + ECEC6A6AAB3D3D9740409E4444A84848B24C4CBB4E4EC04E4EC04C4CBB4A4AB6 + 4848B14646AD4646AD4646AC4444A84343A43F3F9B3B3B9137378633337F3232 + 7A3E3E8263639B8A8AB58C8CBA8D8DBE7777B640409D3D3D963A3A8E37378738 + 38893B3B9141419F4646AD4B4BB94F4FC25050C55050C55050C55050C55050C5 + 5050C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050 + C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050C550 + 50C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050C5 + 5050C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050 + C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050C502 + 00000200005050C55050C55050C55050C55050C55050C55050C55050C55050C5 + A2A2E0FFFFFFFFFFFFFFFFFF9A9AD34646AD4444A74242A34242A14242A14242 + A17F7FBFF7F7F7F2F2F27070B74343A64545AB4848B24B4BB94D4DBF4E4EC04D + 4DBD4B4BB94848B24545AB4343A54343A44242A140409E3E3E983B3B90373787 + 3434807B7BA6B8B8CBEBEBEBEFEFEFF3F3F3F4F4F4F1F1F1EBEBEBD9D9E08080 + B93E3E983B3B913B3B913E3E984343A44848B04C4CBB4F4FC25050C55050C550 + 50C55050C55050C55050C45050C45050C44F4FC34F4FC34F4FC34F4FC34F4FC3 + 5050C45050C45050C55050C55050C55050C55050C55050C55050C55050C55050 + C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050C550 + 50C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050C5 + 5050C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050 + C55050C55050C50200000200005050C55050C55050C55050C55050C55050C550 + 50C55050C55050C55C5CC8DCDCF3FFFFFFFFFFFFFFFFFF9999D14646AC4444A8 + 4343A64343A58E8EC9F3F3F9FFFFFFFBFBFB7676C14848B24A4AB64C4CBB4D4D + BF4F4FC24E4EC14D4DBD4A4AB64747AF4343A641419F3F3F9B3D3D973B3B9239 + 398D36368665659DD4D4DEF0F0F0F4F4F4F9F9F9FFFFFFB3B3DA7777C38686CE + DADAF0F3F3F3E9E9E97878BA41419F40409E4242A14444A84848B24B4BB94D4D + BE4E4EC04E4EC04E4EC04E4EC04E4EC04D4DBF4D4DBD4D4DBD4C4CBC4C4CBB4C + 4CBB4C4CBC4D4DBD4D4DBF4E4EC14F4FC35050C45050C55050C55050C55050C5 + 5050C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050 + C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050C550 + 50C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050C5 + 5050C55050C55050C55050C55050C50200000200005050C55050C55050C55050 + C55050C55050C55050C55050C55050C55050C44F4FC2A0A0DCFFFFFFFFFFFFFF + FFFFF2F2F8CBCBE6CDCDE7F2F2F9FFFFFFFFFFFFFFFFFFFFFFFF7979C74A4AB7 + 4C4CBB4E4EC04F4FC24F4FC34F4FC34D4DBE4B4BB84747AF4343A53F3F9C3D3D + 953A3A8E37378842428AA6A6C4F5F5F5F9F9F9FDFDFDFFFFFFD8D8E95959AA44 + 44A84848B24B4BB95858C0FFFFFFF6F6F6E3E3EA4545AB4444A84444A84646AC + 4747AF4848B24949B54A4AB64A4AB64A4AB64A4AB64949B44949B44848B24848 + B24848B04747AF4747AF4747AF4848B24A4AB64B4BB94D4DBE4E4EC15050C450 + 50C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050C5 + 5050C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050 + C55050C55050C55050C55050C55050C55050C55050C55050C55050C55050C550 + 50C55050C55050C55050C55050C55050C55050C55050C50200000200005050C4 + 5050C45050C45050C45050C45050C45050C45050C45050C34F4FC14D4DBC4A4A + B65454B48F8FCBA7A7D4CCCCE5CCCCE5CCCCE5C0C0DF9A9ACD9B9BCE8F8FCA77 + 77C15454B44A4AB54C4CBA4E4EBF4F4FC15050C34F4FC24E4EBF8383CB4848B1 + 4444A63F3F9B3C3C9338388A5C5C9ADEDEE8FCFCFCFFFFFFFFFFFFFFFFFF9595 + C13C3C933F3F9A4343A34646AB4848B14A4AB5FFFFFFFFFFFFFAFAFA7777C448 + 48AF4646AC4545AA4545A84444A84444A74444A64343A54343A54343A54343A5 + 4444A64343A54343A54343A44242A24242A14242A14343A44545A84747AE4A4A + B64D4DBC4F4FC15050C35050C45050C45050C45050C45050C45050C45050C450 + 50C45050C45050C45050C45050C45050C45050C45050C45050C45050C45050C4 + 5050C45050C45050C45050C45050C45050C45050C45050C45050C45050C45050 + C45050C45050C45050C45050C45050C45050C45050C45050C45050C45050C402 + 00000200004F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44E4EC2 + 4C4CBD4949B64646AD4141A23E3E993B3B933A3A903A3A903B3B933C3C953D3D + 973E3E9A3F3F9C4040A04343A54545AB4848B24A4AB84D4DBE4E4EC14E4EC1AA + AADFBCBCE14747AF4242A43D3D9839398D8282B1EBEBF0FCFCFCFFFFFFFFFFFF + C9C9DD5E5E9D37378A39398E3B3B933D3D9740409E4242A45E5EB6FFFFFFFFFF + FFCFCFEC6D6DC54848B34646AE4343A74040A03E3E9A3C3C953B3B923B3B913B + 3B923B3B933C3C953D3D973E3E993E3E9A3D3D983C3C963B3B943B3B933C3C95 + 3E3E9A4242A34646AE4A4AB74D4DBE4E4EC24F4FC44F4FC44F4FC44F4FC44F4F + C44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F + 4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC4 + 4F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4F + C44F4FC44F4FC40200000200004F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F + 4FC44F4FC34D4DC04B4BB94646AE4141A13B3B93373789353583343482353584 + 37378938388C39398E3A3A8F3A3A8F3A3A913C3C953F3F9C4343A54646AE4A4A + B74C4CBC7C7CD0FFFFFFFCFCFC9898CE40409E52529EB3B3CEF6F6F6FBFBFBFE + FEFEC8C8DB6969A034348236368537378737378737378737378939398D3B3B93 + 9999CACDCDE77777C44949B54949B64848B34545AB4040A03C3C943737893333 + 8031317A31317931317933337E35358337378A39398D3A3A913A3A9139398E38 + 388A37378837378939398D3D3D974242A44747B04B4BBA4E4EC14F4FC34F4FC4 + 4F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4F + C44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F + 4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC4 + 4F4FC44F4FC44F4FC44F4FC44F4FC40200000200004F4FC44F4FC44F4FC44F4F + C44F4FC44F4FC44F4FC44F4FC34D4DBE4949B54444A83D3D9737378833337E32 + 327C32327D35358338388A3A3A8F3A3A9039398D37378936368636368638388B + 3C3C954141A14545AC4949B54A4AB89292D3E6E6F4FFFFFFFBFBFBF8F8F8F9F9 + F9E0E0E9ABABC768689D33337F36368538388A39398D38388C37378735358333 + 337E33337E3434814444923C3C954141A24545AC4848B24747B14444AA3F3F9C + 39398D32327D2D2D6F2A2A672929652A2A682D2D6F31317A36368539398D3B3B + 933C3C943B3B9238388C3737873636853737873A3A8F3F3F9C4444AA4949B54D + 4DBF4F4FC34F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC4 + 4F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4F + C44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F + 4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC40200000200004F4FC4 + 4F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44E4EC24C4CBC4747B14141A23A3A + 9135358332327C32327C35358338388C3C3C953E3E9A3E3E993B3B9338388A34 + 348132327B32327C3535843B3B914040A04545AB4646AE4545AB4040A05555A0 + 6B6BA467679B3C3C7B2E2E7330307834348038388A3B3B933D3D983E3E9A3D3D + 973A3A9036368732327D3030762F2F743131793535833B3B9140409F4444AA46 + 46AE4444A93F3F9D38388C30307829296625255B24245825255D2A2A69313179 + 3737893C3C943F3F9C40409F3F3F9D3C3C963A3A8F38388A37378939398D3E3E + 994343A74848B34C4CBC4E4EC24F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F + 4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC4 + 4F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4F + C44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC402 + 00000200004F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44E4EC24B4BBA + 4646AE40409F6868A68787B08686AF8888B28C8CB87777B36363B04343A74242 + A43F3F9B39398E3434802F2F742D2D702F2F763434823A3A9140409E4141A13F + 3F9C3A3A8F3333802E2E732B2B6B3939756565979191B99393C09696C69595C9 + 7171B94E4EAA4242A33F3F9B3A3A903434822F2F752C2C6D2B2B6C2E2E733333 + 803A3A9040409F4444A84444A840409E39398D30307727276222225521215123 + 235850508063639A7676AE9191C39191C79090C78D8DC36060AE3E3E9A3B3B94 + 3A3A903A3A913E3E9A4343A64848B24C4CBC4E4EC24F4FC44F4FC44F4FC44F4F + C44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F + 4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC4 + 4F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4F + C44F4FC44F4FC40200000200004F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F + 4FC44E4EC14B4BB98B8BCAE3E3EAECECECECECECEFEFEFF2F2F2F5F5F5F5F5F5 + F2F2F2E1E1E8A5A5CE5757AC3C3C943434812D2D702A2A682A2A692F2F743535 + 833A3A8F3B3B9138388A32327D2D2D6F7C7CA0C1C1D1FBFBFBFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFF8F8F8EFEFEFC6C6DB8181BD3F3F9C38388C32327B2B2B6C + 2828642929652D2D6F6969A2FFFFFFF8F8F8D7D7E4B8B8D1AFAFC6A9A9BCA5A5 + B5B3B3BDDDDDDDE6E6E6EFEFEFF7F7F7FCFCFCFEFEFEFBFBFBF5F5F5EEEEEEE6 + E6E68D8DC34141A13E3E9A3E3E9940409E4444A94848B34C4CBC4E4EC24F4FC4 + 4F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4F + C44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F + 4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC44F4FC4 + 4F4FC44F4FC44F4FC44F4FC44F4FC40200000200004E4EC44E4EC44E4EC44E4E + C44E4EC44E4EC44E4EC44D4DC16262C3FDFDFDFAFAFAFAFAFAFBFBFBF1F1F7B2 + B2D89B9BD19D9DD6C3C3E9FEFEFEF2F2F2E5E5E59191BC3F3F882B2B6D272762 + 2727612A2A692E2E753333803434823030796F6F9BDADAE1F9F9F9FEFEFEFFFF + FFFFFFFFD8D8EAA7A7D69D9DD6B7B7E3F3F3FBFFFFFFF7F7F7E9E9E9C8C8D56F + 6FAD3535852D2D7127276225255D272762494984A1A1C6D8D8EBFEFEFEF3F3F3 + E7E7E7E0E0E0DEDEDEE0E0E0E9E9E9D8D8E0B8B8CE9494C19999CD9C9CD5ABAB + E0E7E7F7FFFFFFF6F6F6E1E1E84545AE4343A84141A44242A74545AE4848B54B + 4BBC4D4DC24E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC4 + 4E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4E + C44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E + 4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC40200000200004E4EC4 + 4E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44D4DC29E9EDBFFFFFFFFFFFFFFFF + FF9999CB4E4EA94444AA4747B34B4BBC4D4DC17070CDF3F3FAF2F2F2E2E2E2B6 + B6C635357025255D24245B2626602B2B6B2E2E742E2E739393B1F0F0F0F4F4F4 + F9F9F9FFFFFFD6D6E56F6FAE4242A54747B34B4BBC4D4DC14E4EC3A1A1DFFFFF + FFFCFCFCEBEBEBDBDBDB9494B730307928286423235923235928286530307939 + 398ECCCCE5FFFFFFF5F5F5ECECECE8E8E8E8E8E89D9DB125255E2E2E7339398E + 4141A44848B54C4CBF4E4EC4A1A1DFFFFFFFF9F9F97575C74747B34646AF4646 + B04848B54A4ABA4C4CBF4D4DC24E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E + 4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC4 + 4E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4E + C44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC402 + 00000200004E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44D4DC29F9FDC + FFFFFFFFFFFF8F8FCD4444AA4545AE4848B44A4AB94C4CBF4D4DC14B4BBC7878 + C7FEFEFEECECECDDDDDDA6A6B623235923235724245B2828652B2B6B9F9FB7EF + EFEFF1F1F1F5F5F5FBFBFBABABC53636873E3E9D4545AE4A4ABB4D4DC14E4EC3 + 4E4EC44E4EC49595DBFFFFFFFEFEFEE9E9E9D9D9D99191B02A2A692323582222 + 5524245B2B2B6D3434839696C6FFFFFFFFFFFFF6F6F6EFEFEFECECEC30306026 + 265F2E2E733939904242A54848B54C4CC04E4EC44E4EC4C4C4EBFFFFFF9D9DD9 + 4A4ABA4949B84949B84A4ABB4C4CBE4D4DC14E4EC34E4EC44E4EC44E4EC44E4E + C44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E + 4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC4 + 4E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4E + C44E4EC44E4EC40200000200004E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E + 4EC44E4EC3B7B7E6FFFFFFCECEEC4848B54848B54949B74A4ABA4B4BBC4C4CBF + 4B4BBC4848B54343A8E5E5F1F5F5F5E5E5E5D9D9D96A6A8822225624245B2727 + 629E9EB7F0F0F0F2F2F2F5F5F5F9F9F9A8A8C03030783A3A914242A54848B54C + 4CBF4E4EC34E4EC44E4EC44E4EC44E4EC4A1A1DFFFFFFFFBFBFBE6E6E6D6D6D6 + 8383A224245A20205122225528286431317A6D6DABFFFFFFFFFFFFFEFEFEF5F5 + F5B8B8C622225626265F2E2E743939904242A54848B54C4CC04E4EC44E4EC45A + 5AC7F3F3FBD0D0EE4C4CBF4C4CBF4C4CBE4C4CBF4D4DC14D4DC24E4EC34E4EC4 + 4E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4E + C44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E + 4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC4 + 4E4EC44E4EC44E4EC44E4EC44E4EC40200000200004E4EC44E4EC44E4EC44E4E + C44E4EC44E4EC44E4EC44E4EC3D0D0EFFFFFFF8888D44B4BBC4B4BBC4B4BBC4B + 4BBD4B4BBC4A4ABA4747B34343A83D3D99C9C9DFFBFBFBECECECE0E0E09090A5 + 23235826265F696992F0F0F0F4F4F4F6F6F6F8F8F8DEDEE53737703333803D3D + 984545AC4A4ABA4D4DC24E4EC44E4EC44E4EC44E4EC44E4EC44E4EC4E7E7F6FF + FFFFF4F4F4E0E0E0D3D3D352527A20205020205125255E2E2E736C6CA7FFFFFF + FFFFFFFFFFFFF5F5F5B6B6C522225626265F2E2E743939904242A54848B54C4C + C04E4EC44E4EC44E4EC4B8B8E7FFFFFF4D4DC24D4DC24D4DC24D4DC24E4EC34E + 4EC34E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC4 + 4E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4E + C44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E + 4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC44E4EC40200000200004E4EC3 + 4E4EC34E4EC34E4EC34E4EC34E4EC34E4EC34E4EC3D0D0EFFFFFFF4D4DC14D4D + C04C4CBE4C4CBE4B4BBB4949B74646AF4242A43C3C97363686E3E3ECFDFDFDF2 + F2F2E9E9E9B0B0BE26265F36366FE3E3E7F4F4F4F7F7F7F8F8F8F8F8F8797999 + 2B2B6A3535853F3F9D4646AF4B4BBB4E4EC24E4EC34E4EC34E4EC34E4EC34E4E + C34E4EC3A0A0DDFFFFFFFFFFFFECECECDADADAAFAFBA2020501F1F4E2323592B + 2B6D6969A2FFFFFFFFFFFFFFFFFFF2F2F2B3B3C122225626265F2E2E7339398F + 4242A44848B44C4CBF4E4EC34E4EC34E4EC35A5AC77D7DD34E4EC34E4EC35858 + C69999DC8383D55656C64E4EC34E4EC34E4EC34E4EC34E4EC34E4EC35F5FC97A + 7AD26565CB4E4EC34E4EC34E4EC34E4EC34E4EC34E4EC34E4EC34E4EC34E4EC3 + 4E4EC34E4EC34E4EC34E4EC34E4EC34E4EC34E4EC34E4EC34E4EC34E4EC34E4E + C34E4EC34E4EC34E4EC34E4EC34E4EC34E4EC34E4EC34E4EC34E4EC34E4EC302 + 00000200004D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC39494DB + A0A0DF4D4DC24C4CC14B4BBF4A4ABB4747B44444AC3F3FA03A3A923333826565 + 98FFFFFFFEFEFEF8F8F8F2F2F2B8B8C82A2A6A8989AEF6F6F6F8F8F8F8F8F8F7 + F7F7D8D8DF2323592B2B6D3636893F3FA14646B24B4BBE4D4DC34D4DC34D4DC3 + 4D4DC34D4DC34D4DC34D4DC36464C8FFFFFFFFFFFFF6F6F6E3E3E3D5D5D55050 + 741E1E4D2222562929696969A0FFFFFFFFFFFFFEFEFEEFEFEFB0B0BE22225625 + 255F2E2E7338388F4141A44747B44B4BBF4D4DC34D4DC34D4DC34D4DC34D4DC3 + 4D4DC34D4DC35757C79A9ADD9B9BDD8F8FD95D5DC84E4EC34D4DC34D4DC34D4D + C34D4DC35E5EC97979D27878D26B6BCD4F4FC44D4DC34D4DC34D4DC34D4DC34D + 4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC3 + 4D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4D + C34D4DC34D4DC30200000200004D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D + 4DC34D4DC34D4DC34D4DC34D4DC24C4CC04A4ABB4747B44343A93E3E9D38388D + 32327D2B2B6ED3D3DFFFFFFFFEFEFEFCFCFCF9F9F98B8BAF303079E2E2ECFBFB + FBFAFAFAF8F8F8F3F3F381819B24245A2C2C7037378C4040A24747B34B4BBE4D + 4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34C4CC0F3F3FAFFFFFFFEFEFE + EBEBEBDBDBDB8E8EA21E1E4C21215428286668689EFFFFFFFFFFFFFCFCFCEFEF + EFB0B0BE22225625255F2E2E7338388F4141A44747B44B4BBF4D4DC34D4DC34D + 4DC34D4DC34D4DC34D4DC34D4DC35757C79B9BDD8E8ED99D9DDE9A9ADD7272CF + 5252C54D4DC34D4DC34D4DC35F5FC97A7AD27373D07A7AD27373D05A5AC74E4E + C34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D + 4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC3 + 4D4DC34D4DC34D4DC34D4DC34D4DC30200000200004D4DC34D4DC34D4DC34D4D + C34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC24C4CC04A4ABB4747B44242A83D + 3D9A36368A3030792A2A6AA2A2B9FBFBFBFEFEFEFFFFFFFFFFFFFFFFFF5C5C9B + 5E5EA1FFFFFFFFFFFFFBFBFBF6F6F6EFEFEF48486F24245B2C2C7038388D4040 + A34747B44B4BBE4D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34C4CC0CE + CEECFFFFFFFFFFFFF2F2F2E2E2E2C3C3C91E1E4C22225529296768689FFFFFFF + FFFFFFFCFCFCEEEEEEAFAFBD22225625255F2E2E7338388F4141A44747B44B4B + BF4D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC35858C79C9CDE7878D265 + 65CB9494DB9E9EDE8383D55A5AC74D4DC34D4DC36060C97979D26161CA6060C9 + 7B7BD37878D16565CB4E4EC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4D + C34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D + 4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC30200000200004D4DC3 + 4D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34C4CC14A4ABC4747 + B44343A93C3C993535872F2F7735356F9E9EB4F5F5F5FCFCFCFFFFFFFFFFFFFF + FFFFC9C9DF3B3B949797C9FFFFFFFFFFFFFCFCFCF4F4F4ECECEC1F1F5024245A + 2C2C7037378C4040A34747B44B4BBE4D4DC34D4DC34D4DC34D4DC34D4DC34D4D + C34D4DC34C4CC0AAAADDFFFFFFFFFFFFF7F7F7E7E7E7E0E0E02B2B5722225629 + 29696969A0FFFFFFFFFFFFFCFCFCEEEEEEAFAFBD22225625255F2E2E7338388F + 4141A44747B44B4BBF4D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC35858 + C79C9CDE7474D04E4EC35B5BC88585D6A0A0DF9191DA6363CA4D4DC36161CA79 + 79D25B5BC84D4DC35C5CC87373D07C7CD36D6DCE5353C54D4DC34D4DC34D4DC3 + 4D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4D + C34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC302 + 00000200004D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC2 + 4B4BBE4848B84444AC3D3D9B3636892F2F764F4F80C4C4CFF2F2F2FAFAFAFFFF + FFFFFFFFFFFFFFF2F2F75757A74141A4A7A7D6FFFFFFFFFFFFFBFBFBF1F1F1BF + BFC92020502323592B2B6E37378A4040A14646B24B4BBE4D4DC34D4DC34D4DC3 + 4D4DC34D4DC34D4DC34D4DC34B4BBE9D9DD7FFFFFFFFFFFFFAFAFAECECECE3E3 + E35555772323592B2B6D6969A3FFFFFFFFFFFFFCFCFCEEEEEEAFAFBD22225625 + 255F2E2E7338388F4141A44747B44B4BBF4D4DC34D4DC34D4DC34D4DC34D4DC3 + 4D4DC34D4DC35858C79C9CDE7575D14F4FC44D4DC35656C67676D19B9BDD9A9A + DD7373D06666CC7979D25C5CC84D4DC34E4EC35757C66A6ACD7C7CD37474D05D + 5DC84E4EC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC3 + 4D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4D + C34D4DC34D4DC30200000200004D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D + 4DC34D4DC34C4CC14A4ABB4646B14040A238388E30307975759BDEDEE1F1F1F1 + F9F9F9FFFFFFFFFFFFFFFFFFF2F2F76565B14343A94545B0CDCDE9FFFFFFFFFF + FFFBFBFBEEEEEEB0B0BE2020512323592A2A6B3535873F3F9E4545B04A4ABC4D + 4DC24D4DC34D4DC34D4DC34D4DC34D4DC34D4DC24B4BBD9C9CD5FFFFFFFFFFFF + FCFCFCEFEFEFE6E6E656567A25255D2E2E736B6BA7FFFFFFFFFFFFFCFCFCEEEE + EEAFAFBD22225625255F2E2E7338388F4141A44747B44B4BBF4D4DC34D4DC34D + 4DC34D4DC34D4DC34D4DC34D4DC35858C79D9DDE7575D14F4FC44D4DC34D4DC3 + 4E4EC36868CC9595DBA3A3E09292DA8585D65C5CC84D4DC34D4DC34D4DC35050 + C46363CB7B7BD37A7AD26767CC5252C54D4DC34D4DC34D4DC34D4DC34D4DC34D + 4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC34D4DC3 + 4D4DC34D4DC34D4DC34D4DC34D4DC30200000200004C4CC34C4CC34C4CC34C4C + C34C4CC34C4CC34C4CC34C4CC34B4BC04848B84343AB3C3C993F3F89AAAAC0EC + ECECF2F2F2FAFAFAFFFFFFFFFFFFFFFFFFF2F2F86565B44242AB4545B24747B5 + CDCDEAFFFFFFFFFFFFFBFBFBECECECAEAEBD2020532222572929683333823C3C + 9A4444AE4949BB4B4BC14C4CC34C4CC34C4CC34C4CC34C4CC34B4BC14848BA9B + 9BD4FFFFFFFFFFFFFDFDFDF1F1F1EAEAEA58587D27276430307B6C6CABFFFFFF + FFFFFFFCFCFCEEEEEEAFAFBD21215625255F2D2D7338388F4040A44646B44B4B + BF4C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC35757C79D9DDE7575D14E + 4EC44C4CC34C4CC34C4CC34C4CC35E5EC98A8AD8ADADE4AEAEE47171CF4C4CC3 + 4C4CC34C4CC34C4CC34C4CC35C5CC87575D17E7ED46D6DCE5454C64C4CC34C4C + C34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C + 4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC30200000200004C4CC3 + 4C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34A4ABE4646B44141A65D5D + A4C7C7D6EFEFEFF5F5F5FBFBFBFFFFFFFFFFFFFFFFFFD8D8EA5959B04444AE46 + 46B34747B54646B4CDCDEAFFFFFFFFFFFFFBFBFBECECECAEAEBE222256222257 + 27276430307C3A3A944242A84747B74B4BC04C4CC24C4CC34C4CC34C4CC34C4C + C24A4ABE4747B59A9AD0FFFFFFFFFFFFFDFDFDF2F2F2ECECEC4C4C782B2B6D34 + 34846F6FB1FFFFFFFFFFFFFCFCFCEEEEEEAFAFBD21215625255F2D2D7338388F + 4040A44646B44B4BBF4C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC35757 + C79D9DDE7575D14E4EC44C4CC34C4CC34C4CC34C4CC34C4CC35656C68989D8B8 + B8E7A6A6E17171CF5454C64C4CC34C4CC34C4CC34C4CC35555C66C6CCE7E7ED4 + 7474D05B5BC84E4EC44C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4C + C34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC302 + 00000200004D4DC34D4DC34D4DC34D4DC34E4EC34E4EC34E4EC34E4EC24C4CBE + 4747B26464B3E6E6EBF3F3F3F7F7F7FEFEFEFFFFFFFFFFFFFFFFFFA4A4CD4F4F + AB4646B14848B54848B54747B34646B0C1C1E3FFFFFFFFFFFFFDFDFDECECECBA + BAC725255D2323592727622E2E7538388C4141A14747B14B4BBC4D4DC14E4EC3 + 4D4DC34D4DC24C4CC04949BA4646AEBFBFDFFFFFFFFFFFFFFDFDFDF3F3F3EFEF + EF2828643131793A3A8F7272B6FFFFFFFFFFFFFCFCFCEEEEEEAFAFBD22225526 + 265F2F2F743A3A904343A54A4AB54E4EC05050C45050C45050C45050C45050C4 + 5050C44E4EC35A5AC79E9EDE7676D14F4FC44D4DC34D4DC34D4DC34D4DC34D4D + C34C4CC36262CA9090DAA2A2E0A3A3E08080D45959C74D4DC34C4CC34C4CC34C + 4CC34E4EC46565CB7D7DD37B7BD36363CB5050C44C4CC34C4CC34C4CC34C4CC3 + 4C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4C + C34C4CC34C4CC30200000200005656C65757C75858C75B5BC85D5DC95D5DC95E + 5EC95E5EC85C5CC36161BDE1E1EEF8F8F8FBFBFBFEFEFEFFFFFFFFFFFFF2F2F6 + 8484B45151A65858B55858BD5858BC5656B85454B15656AEA4A4D1FFFFFFFFFF + FFFFFFFFEEEEEEDEDEDE3030692A2A602C2C643333724646895454A05E5EB366 + 66C06A6AC86969CB6464C96363C76161C36060BB5E5EAFDDDDEBFFFFFFFFFFFF + FDFDFDF5F5F5D9D9DF42427850508F5C5CA48C8CC4FFFFFFFFFFFFFCFCFCEEEE + EEB4B4BF34345B3A3A6447477B5959996767B17171C27878CE7C7CD37D7DD37D + 7DD37D7DD37E7ED47E7ED47E7ED38585D6A8A8E28585D66161CA6060CA6060CA + 6060CA6060CA6060CA5E5EC96C6CCE7878D26868CC8F8FDAA7A7E19696DC6262 + CB4F4FC44C4CC34C4CC34C4CC34C4CC35C5CC87878D28080D46E6ECE5252C54C + 4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC3 + 4C4CC34C4CC34C4CC34C4CC34C4CC30200000200006262CB6464CB6868CC6F6F + CF6F6FCF7070CF7171D07272CF7070CAB0B0DCFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFD9D9E26464935A5A9A6868B07070BE6E6EC26868BC6464B46363AD6767A8 + 8F8FBDFFFFFFFFFFFFFFFFFFF2F2F2E0E0E059598835356D33336A3B3B725A5A + 8A68689D7474B07F7FBF8787CB8A8ACE7F7FCB7A7AC87676C07777B77E7EB0FF + FFFFFFFFFFFFFFFFFDFDFDF6F6F6ACACBD66668F7777A68484B9A8A8CFFFFFFF + FFFFFFFCFCFCEEEEEEB9B9C046465E4E4E696060817777A08B8BB99A9ACDA5A5 + DAABABE1ADADE3AEAEE4AEAEE4AFAFE4B0B0E4B1B1E5B2B2E5ACACE39191DA77 + 77D17777D17777D17777D17878D27878D27979D27979D27171CF5A5AC85252C5 + 7C7CD3A4A4E0A7A7E16F6FCF5454C64D4DC34C4CC34C4CC34C4CC35454C66F6F + CF8080D47878D25858C74E4EC44C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C + 4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC34C4CC30200000200005151C4 + 5151C45656C65B5BC75757C65353C45555C55555C55656C1F5F5FBFFFFFFFFFF + FFFFFFFFFFFFFFB0B0C439396F38387C3E3E8F4B4BA25858AF4F4FB04848A844 + 449F4444974C4C95454592F3F3F8FFFFFFFFFFFFFAFAFAE5E5E57676A4313177 + 2E2E6F3434725050824B4B8C4646974A4AA25B5BB06161B65353B24D4DAC4949 + A54E4E9D9797BDFFFFFFFFFFFFFFFFFFFDFDFDF8F8F86363974646914E4EA253 + 53AE8181C4FFFFFFFFFFFFFBFBFBEDEDEDB1B1BE2A2A572F2F6038387345458C + 4F4FA25858B45E5EC06161C76363C96363CA6363CA6363CA6464CA6565CA6666 + CB6464CA5858C65555C55555C55555C55555C55555C55656C55656C55757C654 + 54C54D4DC24C4CC24E4EC36767CB9D9DDEA9A9E28686D65757C64C4CC24C4CC2 + 4C4CC24C4CC24F4FC36565CB8181D47F7FD36464CA4D4DC24C4CC24C4CC24C4C + C24C4CC24C4CC24C4CC24C4CC24C4CC24C4CC24C4CC24C4CC24C4CC24C4CC202 + 00000200004C4CC24C4CC25151C45757C65151C44C4CC24C4CC24C4CC27272CD + FFFFFFFFFFFFFFFFFFFFFFFFD4D4E24A4A7F38387531317B36368A42429A4E4E + A54444A43D3D9B6D6DAE55559B42428B3B3B8A9696C6FFFFFFFFFFFFFFFFFFED + EDEDA1A1C234348631317C3434794F4F8442428637378A3A3A944C4CA25252A8 + 4444A33D3D9D3B3B9641418ECDCDDFFFFFFFFFFFFFFFFFFFFEFEFEC5C5D93737 + 8D3D3D9C4242A84444AD7474C1FFFFFFFFFFFFFAFAFAECECECAEAEBD23235B26 + 26612C2C713535873C3C9A4242AA4747B64A4ABD4B4BC04C4CC24C4CC24C4CC2 + 4C4CC24C4CC24C4CC24C4CC24C4CC24C4CC24C4CC24C4CC24C4CC24C4CC24C4C + C24C4CC24C4CC24C4CC24C4CC24C4CC24C4CC24D4DC25656C59292DAAAAAE29B + 9BDD6565CA4C4CC24C4CC24C4CC24C4CC24C4CC25A5AC77C7CD28181D47171CF + 5151C44C4CC24C4CC24C4CC24C4CC24C4CC24C4CC24C4CC24C4CC24C4CC24C4C + C24C4CC24C4CC20200000200004B4BC24B4BC25050C45656C65050C44B4BC24B + 4BC24B4BC27D7DD2FFFFFFFFFFFFFFFFFFFDFDFD7676AB4444833D3D7E32327F + 3535883E3E9449499D40409A5252A0F1F1F18585B44141893B3B8C48489DE5E5 + F3FFFFFFFFFFFFFAFAFAE5E5E546469C36368D39398655558D43438835358737 + 378E4747984C4C9C3F3F9738389236368B7171A7FFFFFFFFFFFFFFFFFFFFFFFF + FFFFFF6D6DAD3D3D9D4242AA4444B14545B17474C1FFFFFFFFFFFFF8F8F8EAEA + EAADADBF2828672A2A6D2E2E783535893B3B994141A84545B44949BC4A4AC04B + 4BC14B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC2 + 4B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24C4C + C24C4CC27979D2A5A5E1AAAAE27474D04C4CC24B4BC24B4BC24B4BC24B4BC251 + 51C46E6ECE8181D47B7BD25858C74C4CC24B4BC24B4BC24B4BC24B4BC24B4BC2 + 4B4BC24B4BC24B4BC24B4BC24B4BC20200000200004B4BC24B4BC25151C45656 + C65151C44B4BC24B4BC24B4BC27E7ED2FFFFFFFFFFFFFFFFFFFBFBFB3D3D974D + 4D9343438B34348635358A3D3D914646973D3D948181B5EEEEEE6B6BA643438E + 3D3D913D3D9D7474C0FFFFFFFFFFFFFFFFFFF4F4F49797C73D3D9F4141985E5E + 9C49499337378C37378E4545934949963C3C9136368C424290E5E5EFFFFFFFFF + FFFFFFFFFFFFFFFFA3A3CE3E3EA14343AD4545B44747B74646B48282C8FFFFFF + FFFFFFFCFCFCEEEEEEB2B2C62F2F7A30307D3333853838913D3D9D4141A84545 + B44848BA4A4ABF4B4BC14B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B + 4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC2 + 4B4BC24B4BC24B4BC24B4BC24C4CC26767CC9D9DDEACACE38888D75858C64B4B + C24B4BC24B4BC24B4BC24F4FC36363CA8181D48181D46666CB4F4FC34B4BC24B + 4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC20200000200004B4BC2 + 4B4BC25151C45656C65151C44B4BC24B4BC24B4BC24F4FC3F5F5FCFFFFFFFFFF + FFFFFFFF4E4EAB5656A64B4B9B3B3B9439399440409749499B3F3F97C1C1D9EF + EFEF6D6DAD4A4A9A42429E4141A64444B09191D4FFFFFFFFFFFFFFFFFFF2F2F2 + 6E6EBC4848A86A6AAF5050A23C3C983A3A9748489B4C4C9B3E3E95383891BCBC + DAFFFFFFFFFFFFFFFFFFFFFFFFD8D8EC4141A74444B04747B74848BA4848BB47 + 47B89C9CD6FFFFFFFFFFFFFFFFFFF7F7F7BABAD23838913939933B3B973D3D9E + 4040A64343AE4646B64949BC4A4AC04B4BC14B4BC24B4BC24B4BC24B4BC24B4B + C24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B + 4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24C4CC25959C79090D9 + ADADE39B9BDD6767CC4B4BC24B4BC24B4BC24B4BC24D4DC35959C77C7CD38383 + D57272CF5454C54B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC202 + 00000200004B4BC24B4BC25151C45656C65151C44B4BC24B4BC24B4BC24F4FC3 + B1B1E4FFFFFFFFFFFFFFFFFF9999D25E5EB55454AD4141A43E3EA14545A44E4E + A67F7FBFF8F8F8F4F4F47272B85151A94848AB4545B04747B74949BC9E9EDDF6 + F6FCFFFFFFFFFFFFE9E9F18282C87474BE5757B14141A63F3FA44D4DA65252A7 + 4E4EA7CBCBE5FFFFFFFFFFFFFFFFFFFFFFFFCCCCE85050B44646B44848BA4949 + BD4A4ABF4A4ABE4848BBC2C2E7FFFFFFFFFFFFFFFFFFFFFFFFE7E7EE4B4BA940 + 40A54141A74242AA4444AF4646B44848BA4949BD4A4AC04B4BC24B4BC24B4BC2 + 4B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4B + C24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B + 4BC24B4BC25353C57F7FD3ABABE3A7A7E17575D04B4BC24B4BC24B4BC24B4BC2 + 4B4BC25353C57070CF8383D57B7BD25B5BC74B4BC24B4BC24B4BC24B4BC24B4B + C24B4BC24B4BC20200000200004B4BC24B4BC25151C45656C65151C44B4BC24B + 4BC24B4BC24F4FC37676D0DEDEF4FFFFFFFFFFFFFFFFFFA8A8D95A5ABA4646B1 + 4343AD4A4AAF9797D0F3F3FAFFFFFFFBFBFB7777C35757B64D4DB64848B84949 + BC4A4ABF6060C88A8AD7D5D5F0FFFFFFFFFFFFFBFBFBC3C3E38E8ECE4646B244 + 44AF7373BFA4A4D4F3F3F9FFFFFFFFFFFFFFFFFFFFFFFFA0A0D74646B64848BA + 4949BD4A4ABF4B4BC14B4BC17A7AD19E9EDCFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFBCBCE17373C55C5CBC4646B54747B74848BA4949BD4A4ABF4B4BC14B + 4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC2 + 4B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4B + C24B4BC24B4BC24B4BC24B4BC24B4BC25050C46E6ECE9D9DDEAFAFE48888D755 + 55C54B4BC24B4BC24B4BC24B4BC25151C46666CB7F7FD48181D46666CB4D4DC3 + 4B4BC24B4BC24B4BC24B4BC24B4BC20200000200004B4BC24B4BC25151C45656 + C65151C44B4BC24B4BC24B4BC24F4FC36D6DCD5D5DC8A0A0DEFFFFFFFFFFFFFF + FFFFF3F3FACDCDEBCECEECF3F3FAFFFFFFFFFFFFFFFFFFFFFFFF7C7CCC5C5CC1 + 5050BF4B4BBE4A4AC04B4BC16060C97878D16161C97B7BD2C3C3EAFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF3F3FABBBBE57979CB52 + 52BF4A4ABE4A4AC04B4BC14B4BC14B4BC24B4BC2FFFFFFFFFFFFF3F3FBCFCFEE + CECEEDCECEEDCECEEDDBDBF2FFFFFFFEFEFE9C9CD94949BD4949BD4A4ABF4A4A + C04B4BC14B4BC14B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B + 4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC2 + 4B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC26161 + C99494DBB0B0E49494DB6868CC4B4BC24B4BC24B4BC24B4BC24C4CC25D5DC87C + 7CD38585D66E6ECE5454C54B4BC24B4BC24B4BC24B4BC20200000200004B4BC2 + 4B4BC25151C45656C65151C44B4BC24B4BC24B4BC24F4FC36E6ECE5D5DC84C4C + C25757C69595DBBABAE7D5D5F1CFCFEECFCFEEC5C5EBA9A9E1A2A2DE9292D97A + 7AD05C5CC66060C75353C44C4CC14B4BC24B4BC26060C97878D16161C94B4BC2 + 4B4BC25F5FC9ABABE2ACACE3C3C3EACFCFEED4D4F0D5D5F0A2A2DE8686D45656 + C35A5AC66868CA5555C44B4BC14B4BC24B4BC24B4BC24B4BC24B4BC27B7BD26F + 6FCE4B4BC24B4BC24B4BC24B4BC24B4BC24B4BC26363CA7B7BD26363CA4B4BC2 + 4B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4B + C24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B + 4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC24B4BC2 + 4B4BC24B4BC24B4BC25858C78787D6AFAFE4A6A6E17575D05050C44B4BC24B4B + C24B4BC24B4BC25858C67575D08585D67777D15B5BC74B4BC24B4BC24B4BC202 + 00000200004A4AC24A4AC25050C45656C65050C44A4AC24A4AC24A4AC24E4EC3 + 6D6DCE5C5CC84B4BC24A4AC24E4EC36C6CCD6161CA4C4CC34A4AC25353C55E5E + C95151C44A4AC24A4AC25050C46060C95353C54B4BC24A4AC24A4AC26060C978 + 78D26161CA4A4AC24A4AC25353C58181D56464CB4B4BC24A4AC25D5DC86363CA + 5050C44A4AC24A4AC25A5AC86969CC5454C54A4AC24A4AC24A4AC24A4AC24A4A + C24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A + 4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC2 + 4A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4A + C24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A + 4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24F4FC47676D1A2A2E0B1B1E5 + 8383D55A5AC84B4BC24A4AC24A4AC24A4AC25050C46B6BCD8282D58080D46161 + CA4E4EC34A4AC20200000200004A4AC24A4AC25050C45656C65050C44A4AC24A + 4AC24A4AC24E4EC36D6DCE5C5CC84B4BC24A4AC24E4EC36D6DCE6262CA4C4CC3 + 4A4AC25353C55F5FC95151C44A4AC24A4AC25050C46161CA5353C54B4BC24A4A + C24A4AC26060C97878D26161CA4A4AC24A4AC25353C58282D56464CB4B4BC24A + 4AC25D5DC86464CB5050C44A4AC24A4AC25A5AC86969CD5454C54A4AC24A4AC2 + 4A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4A + C24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A + 4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC2 + 4A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4A + C24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24B + 4BC26060C99191DAB2B2E59696DC6363CA4A4AC24A4AC24A4AC24A4AC24C4CC3 + 5F5FC97A7AD28484D66B6BCD5252C50200000200004A4AC24A4AC25050C45656 + C65050C44A4AC24A4AC24A4AC24E4EC36E6ECE5C5CC84B4BC24A4AC24E4EC36D + 6DCE6262CA4C4CC34A4AC25353C55F5FC95151C44A4AC24A4AC25050C46161CA + 5353C54B4BC24A4AC24A4AC26060C97979D26161CA4A4AC24A4AC25454C58383 + D56464CB4B4BC24A4AC25D5DC86464CB5050C44A4AC24A4AC25A5AC86969CD54 + 54C54A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC2 + 4A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4A + C24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A + 4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC2 + 4A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4A + C24A4AC24A4AC24A4AC24B4BC26060C9ABABE3B3B3E58080D44A4AC24A4AC24A + 4AC24A4AC24A4AC24B4BC26262CA8686D68282D55E5EC90200000200004A4AC2 + 4A4AC25050C45656C65050C44A4AC24A4AC24A4AC24E4EC36E6ECE5C5CC84B4B + C24A4AC24E4EC36D6DCE6262CA4C4CC34A4AC25353C55F5FC95151C44A4AC24A + 4AC25050C46161CA5353C54B4BC24A4AC24A4AC26161CA7A7AD26161CA4A4AC2 + 4A4AC25454C58383D56464CB4B4BC24A4AC25D5DC86464CB5151C44A4AC24A4A + C25A5AC86969CD5454C54A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A + 4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC2 + 4A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4A + C24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A + 4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC2 + 4A4AC24A4AC24A4AC24A4AC24A4AC24D4DC36262CA9E9EDEAEAEE49999DD5959 + C74A4AC24A4AC24A4AC24A4AC24C4CC36262CA8080D48181D56C6CCD4B4BC202 + 00000200004A4AC24A4AC25050C45757C65050C44A4AC24A4AC24A4AC24E4EC3 + 6F6FCE5C5CC84B4BC24A4AC24F4FC46D6DCE6363CA4C4CC34A4AC25353C55F5F + C95151C44A4AC24A4AC25050C46161CA5353C54B4BC24A4AC24A4AC26161CA7A + 7AD26161CA4A4AC24A4AC25454C58383D56464CB4B4BC24A4AC25E5EC96464CB + 5151C44A4AC24A4AC25B5BC86A6ACD5454C54A4AC24A4AC24A4AC24A4AC24A4A + C24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A + 4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC2 + 4A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4A + C24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A + 4AC24A4AC24A4AC24A4AC24A4AC24A4AC24A4AC25050C47070CFAEAEE4B0B0E4 + 8383D55050C44A4AC24A4AC24A4AC24A4AC24F4FC46B6BCD8686D67F7FD46060 + C94A4AC24A4AC20200000200004A4AC14A4AC15050C35757C55050C34A4AC14A + 4AC14A4AC14E4EC27070CE5D5DC84B4BC14A4AC14F4FC36D6DCD6363CA4C4CC2 + 4A4AC15353C45F5FC85151C34A4AC14A4AC15050C36161C95353C44B4BC14A4A + C14A4AC16161C97A7AD26161C94A4AC14A4AC15454C48484D56565CA4B4BC14A + 4AC15E5EC86464CA5151C34A4AC14A4AC15B5BC76A6ACC5454C44A4AC14A4AC1 + 4A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4A + C14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A + 4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC1 + 4A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4A + C14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC15656C58A8AD7B2 + B2E4A6A6E16969CB4B4BC14A4AC14A4AC14A4AC14A4AC15757C57777D08585D5 + 7575D05353C44A4AC14A4AC14A4AC10200000200004A4AC14A4AC15050C35757 + C55050C34A4AC14A4AC14A4AC14E4EC27070CE5E5EC84B4BC14A4AC14F4FC36F + 6FCE6464CA4C4CC24A4AC15353C45F5FC85252C44A4AC14A4AC15050C36262C9 + 5353C44B4BC14A4AC14A4AC16161C97B7BD26262C94A4AC14A4AC15454C48585 + D56565CA4B4BC14A4AC15E5EC86565CA5151C34A4AC14A4AC15B5BC76B6BCC54 + 54C44A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC1 + 4A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4A + C14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A + 4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC1 + 4A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC14A4AC16464 + CAA1A1DFB2B2E49797DB5656C54B4BC14A4AC14A4AC14A4AC14A4AC16161C980 + 80D38585D56B6BCC4B4BC14A4AC14A4AC14A4AC14A4AC10200000200004949C1 + 4949C14F4FC35757C64F4FC34949C14949C14949C14D4DC27070CE5D5DC84A4A + C14949C14E4EC36E6ECE6363CA4B4BC24949C15252C45F5FC95151C44949C14A + 4AC14F4FC36161C95252C44A4AC14949C14949C16060C97B7BD26161C94949C1 + 4949C15353C48484D56464CA4A4AC14949C15D5DC86464CA5050C34949C14949 + C15A5AC76A6ACC5454C54949C14949C14949C14949C14949C14949C14949C149 + 49C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949C1 + 4949C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949 + C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949C149 + 49C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949C1 + 4949C17272CFADADE3ACACE37E7ED34C4CC24949C14949C14949C14949C14A4A + C16C6CCD8484D57D7DD35E5EC84949C14949C14949C14949C14949C14949C102 + 00000200004949C14949C15050C35757C65050C34949C14949C14949C14D4DC2 + 7070CE5D5DC84A4AC14949C14E4EC36F6FCE6363CA4B4BC24949C15252C45F5F + C95151C44949C14A4AC14F4FC36161C95252C44A4AC14949C14949C16161C97B + 7BD26161C94949C14949C15353C48585D56565CA4A4AC14949C15E5EC86464CA + 5050C34949C14949C15A5AC76A6ACC5454C54949C14949C14949C14949C14949 + C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949C149 + 49C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949C1 + 4949C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949 + C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949C149 + 49C14949C15757C68B8BD7B0B0E4A0A0DF6868CC4C4CC24949C14949C14949C1 + 4949C15656C57777D18484D57272CF5656C54A4AC14949C14949C14949C14949 + C14949C14949C10200000200004949C14949C15050C35757C65050C34949C149 + 49C14949C14D4DC27070CE5D5DC84A4AC14949C14E4EC36F6FCE6363CA4B4BC2 + 4949C15252C45F5FC95151C44949C14A4AC14F4FC36262CA5252C44A4AC14949 + C14949C16161C97C7CD26161C94949C14949C15353C48686D66565CA4A4AC149 + 49C15E5EC86565CA5050C34949C14949C15A5AC76B6BCC5454C54949C14949C1 + 4949C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949 + C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949C149 + 49C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949C1 + 4949C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949 + C14949C14949C14949C16565CA9999DCB0B0E49696DB5C5CC74A4AC14949C149 + 49C14949C14949C16262CA7C7CD28484D56A6ACC5050C34949C14949C14949C1 + 4949C14949C14949C14949C14949C10200000200004949C14949C15050C35757 + C65050C34949C14949C14949C14D4DC27171CF5E5EC84A4AC14949C14E4EC370 + 70CE6363CA4B4BC24949C15353C46060C95151C44949C14A4AC15050C36262CA + 5252C44A4AC14949C14949C16161C97C7CD26262CA4949C14949C15353C48686 + D66666CB4A4AC14949C15E5EC86565CA5050C34949C14949C15B5BC76B6BCC54 + 54C54949C14949C14949C14949C14949C14949C14949C14949C14949C14949C1 + 4949C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949 + C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949C149 + 49C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949C1 + 4949C14949C14949C14949C14949C17676D0A9A9E2ADADE37F7FD35252C44949 + C14949C14949C14949C14D4DC26C6CCD8484D57D7DD35F5FC94C4CC24949C149 + 49C14949C14949C14949C14949C14949C14949C14949C10200000200004949C1 + 4949C15050C35757C65050C34949C14949C14949C14D4DC27171CF5E5EC84A4A + C14949C14E4EC37070CE6363CA4B4BC24949C15353C46060C95151C44949C14A + 4AC15050C36262CA5252C44A4AC14949C14949C16161C97C7CD26262CA4949C1 + 4949C15353C48686D66666CB4A4AC14949C15E5EC86565CA5050C34949C14949 + C15B5BC76B6BCC5454C54949C14949C14949C14949C14949C14949C14949C149 + 49C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949C1 + 4949C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949 + C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949C149 + 49C14949C14949C14949C14949C14949C15959C78787D6AEAEE49E9EDE6E6ECE + 4E4EC34949C14949C14949C14A4AC15959C77575D08484D57171CF5858C64A4A + C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949C102 + 00000200004949C14949C15050C35757C65050C34949C14949C14949C14D4DC2 + 7272CF5E5EC84A4AC14949C14E4EC37171CF6262CA4A4AC14949C15353C46060 + C95151C44949C14A4AC15050C36363CA5151C44A4AC14949C14949C16161C97C + 7CD26262CA4949C14949C15454C58686D66363CA4A4AC14949C15E5EC86565CA + 5050C34949C14949C15B5BC76B6BCC5353C44949C14949C14949C14949C14949 + C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949C149 + 49C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949C1 + 4949C14949C14949C14949C14949C14949C14949C14949C14949C14949C14949 + C14949C14949C14949C14949C14949C14949C14A4AC16666CB9595DBAFAFE492 + 92DA6161C94A4AC14949C14949C14949C14D4DC26262CA7C7CD28383D56969CC + 5050C34949C14949C14949C14949C14949C14949C14949C14949C14949C14949 + C14949C14949C10200000200005454C55454C55C5CC86262CA5F5FC95959C65B + 5BC75B5BC75F5FC87777D16464CA5050C34F4FC35555C57676D07171CE6060C8 + 5D5DC86565CB6E6ECE6262C95959C75A5AC76060C87272CF6868CC6363CA6363 + CA6060C97474D08686D66B6BCD5252C45353C45D5DC78E8ED87979D16767CB66 + 66CB7575D07979D16565CB5F5FC95F5FC96F6FCE7F7FD37070CF6969CC6B6BCD + 6B6BCD6C6CCD6C6CCD6C6CCD6C6CCD6D6DCD6D6DCD6D6DCD6E6ECD6F6FCE6F6F + CE6F6FCE6F6FCE7070CE7070CE7070CE7070CE7171CF7171CF7171CF7272CF72 + 72CF7373CF7373CF7373CF7373CF7474CF7171CE6363CA5A5AC75959C75959C7 + 5959C75959C75959C75A5AC75A5AC75656C54D4DC24949C14E4EC37575D0A8A8 + E1AAAAE28383D55252C44949C14949C14949C14949C15050C36C6CCD8383D57B + 7BD26161C94949C14949C14949C14949C14949C14949C14949C14949C14949C1 + 4949C14949C14949C14949C14949C10200000200006767CB6767CB6D6DCE7474 + D07878D17777D17878D17979D27A7AD27C7CD36969CC5B5BC75B5BC75E5EC979 + 79D28383D58282D58282D58585D68282D57979D27676D17777D17B7BD28989D7 + 8A8AD78B8BD88C8CD88C8CD89191DA8C8CD97373CF6363CA6363CA6B6BCD9898 + DC9696DB9595DB9595DB9999DC9494DB8888D78484D58585D69090D99F9FDE9D + 9DDE9D9DDE9E9EDE9F9FDEA0A0DEA0A0DFA1A1DFA2A2E0A3A3E0A4A4E0A4A4E0 + A6A6E1A7A7E1A7A7E1A7A7E1A8A8E2A9A9E2AAAAE2ABABE2ABABE3ACACE3ADAD + E3AEAEE4AEAEE4AFAFE4AFAFE4B0B0E4B0B0E4B2B2E5B2B2E5B3B3E59292DA75 + 75D07575D07575D07575D07676D17676D17676D17A7AD27272CF5757C65B5BC7 + 8484D5AEAEE49C9CDD6D6DCE4C4CC24848C14848C14848C14949C15757C67373 + D08282D57171CF5555C54848C14848C14848C14848C14848C14848C14848C148 + 48C14848C14848C14848C14848C14848C14848C14848C10200000200005B5BC8 + 5C5CC85D5DC86262CA6666CB6767CB6767CB6868CB6969CC6565CB5858C75454 + C55353C55454C56363CA6C6CCD6E6ECE6E6ECE6E6ECE6C6CCD6666CB6565CB65 + 65CB6767CC7171CF7272D07474D07474D07575D07878D16D6DCE5D5DC85959C7 + 5959C75D5DC87575D07A7AD27B7BD27C7CD27C7CD27474D06F6FCE6F6FCE6F6F + CE7474D07E7ED38181D48181D48181D48383D58383D58383D58484D68484D685 + 85D68585D68686D68787D68787D68888D78989D78989D78989D78989D78B8BD8 + 8B8BD88B8BD88C8CD88C8CD88E8ED98E8ED98E8ED98E8ED98E8ED98E8ED99595 + DBB3B3E58D8DD86666CB6565CB6565CB6565CB6565CB6565CB6363CA7171CF7C + 7CD37474D09595DBAEAEE49191DA5A5AC74949C14848C14848C14848C14B4BC2 + 5F5FC97A7AD28181D46868CC4C4CC24848C14848C14848C14848C14848C14848 + C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848C102 + 00000200004848C14848C14848C14848C14848C14848C14848C14848C14848C1 + 4848C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848 + C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848C148 + 48C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848C1 + 4848C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848 + C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848C148 + 48C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848C1 + 4848C14848C15656C6A6A6E17777D14A4AC24848C14848C14848C14848C14848 + C14848C16464CB9B9BDEB0B0E4A9A9E27F7FD44949C14848C14848C14848C148 + 48C14D4DC36A6ACC8181D47C7CD35E5EC84848C14848C14848C14848C14848C1 + 4848C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848 + C14848C14848C10200000200004848C14848C14848C14848C14848C14848C148 + 48C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848C1 + 4848C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848 + C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848C148 + 48C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848C1 + 4848C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848 + C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848C148 + 48C14848C14848C14848C14848C15656C6A7A7E17878D14A4AC24848C14848C1 + 4848C14848C14848C15252C49191DAC4C4EBA9A9E26B6BCD4848C14848C14848 + C14848C14949C15151C47373D08181D47272CF5555C54848C14848C14848C148 + 48C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848C1 + 4848C14848C14848C14848C14848C10200000200004848C14848C14848C14848 + C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848C148 + 48C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848C1 + 4848C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848 + C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848C148 + 48C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848C1 + 4848C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848 + C14848C14848C14848C14848C14848C14848C14848C15656C6A7A7E17878D14A + 4AC24848C14848C14848C14848C16060C99898DCB7B7E7AFAFE46868CB4848C1 + 4848C14848C14848C14848C15D5DC87C7CD38181D46767CB4C4CC24848C14848 + C14848C14848C14848C14848C14848C14848C14848C14848C14848C14848C148 + 48C14848C14848C14848C14848C14848C14848C14848C10200000200004848C0 + 4848C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848 + C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848C048 + 48C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848C0 + 4848C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848 + C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848C048 + 48C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848C0 + 4848C04848C04848C04848C04848C04848C04848C04848C04848C04848C05656 + C5A7A7E17878D14A4AC14848C04848C04848C07272CFA5A5E0ACACE38D8DD87E + 7ED25B5BC64848C04848C04848C04B4BC16B6BCC7F7FD37E7ED35C5CC74848C0 + 4848C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848 + C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848C002 + 00000200004848C04848C04848C04848C04848C04848C04848C04848C04848C0 + 4848C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848 + C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848C048 + 48C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848C0 + 4848C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848 + C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848C048 + 48C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848C0 + 4848C04848C05656C5A7A7E17878D14A4AC14848C04B4BC18585D5ABABE29E9E + DE6868CB5F5FC87D7DD25B5BC64848C04949C05050C37474CF8181D47373CF53 + 53C44848C04848C04848C04848C04848C04848C04848C04848C04848C04848C0 + 4848C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848 + C04848C04848C00200000200004848C04848C04848C04848C04848C04848C048 + 48C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848C0 + 4848C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848 + C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848C048 + 48C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848C0 + 4848C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848 + C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848C048 + 48C04848C04848C04848C04848C05656C5A8A8E17878D14949C05F5FC89797DB + ACACE28C8CD75B5BC64848C06060C87E7ED35A5AC64848C05F5FC87C7CD28181 + D46565CA4F4FC24848C04848C04848C04848C04848C04848C04848C04848C048 + 48C04848C04848C04848C04848C04848C04848C04848C04848C04848C04848C0 + 4848C04848C04848C04848C04848C00200000200004747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C05555C5A8A8E17878D178 + 78D19F9FDEABABE27878D15151C34747C04747C05F5FC87C7CD26060C86868CB + 7F7FD37C7CD25959C64B4BC14747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C00200000200004747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C05555 + C5A8A8E19E9EDEAAAAE29D9DDD6A6ACC4B4BC14747C04747C04747C05D5DC87F + 7FD37A7AD17F7FD36F6FCE5353C44747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C002 + 00000200004747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C05454C4A9A9E2A9A9E28888D65F5FC84949C14747C04747C04747 + C04747C05D5DC87F7FD37B7BD26464CA4E4EC24747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C00200000200004747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C05050C38F8FD97A7AD15252C44848C04747C0 + 4747C04747C04747C04747C05858C67070CE5D5DC84848C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C00200000200004747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04848C05555C54747C047 + 47C04747C04747C04747C04747C04747C04747C04B4BC14D4DC24747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C00200000200004747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C002 + 00000200004747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C00200000200004747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747 + C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C047 + 47C04747C04747C04747C04747C04747C04747C04747C04747C04747C04747C0 + 4747C04747C04747C04747C04747C00200000200004646C04646C04646C04646 + C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646C046 + 46C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646C0 + 4646C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646 + C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646C046 + 46C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646C0 + 4646C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646 + C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646C046 + 46C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646C0 + 4646C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646 + C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646C046 + 46C04646C04646C04646C04646C04646C04646C04646C00200000200004646C0 + 4646C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646 + C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646C046 + 46C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646C0 + 4646C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646 + C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646C046 + 46C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646C0 + 4646C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646 + C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646C046 + 46C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646C0 + 4646C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646 + C04646C04646C04646C04646C04646C04646C04646C04646C04646C04646C002 + 00000200004545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD + 4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545 + BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD45 + 45BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD + 4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545 + BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD45 + 45BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD + 4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545 + BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD45 + 45BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD + 4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545BD4545 + BD4545BD4545BD0200000200004242B84242B84242B84242B84242B84242B842 + 42B84242B84242B84242B84242B84242B84242B84242B84242B84242B84242B8 + 4242B84242B84242B84242B84242B84242B84242B84242B84242B84242B84242 + B84242B84242B84242B84242B84242B84242B84242B84242B84242B84242B842 + 42B84242B84242B84242B84242B84242B84242B84242B84242B84242B84242B8 + 4242B84242B84242B84242B84242B84242B84242B84242B84242B84242B84242 + B84242B84242B84242B84242B84242B84242B84242B84242B84242B84242B842 + 42B84242B84242B84242B84242B84242B84242B84242B84242B84242B84242B8 + 4242B84242B84242B84242B84242B84242B84242B84242B84242B84242B84242 + B84242B84242B84242B84242B84242B84242B84242B84242B84242B84242B842 + 42B84242B84242B84242B84242B84242B84242B84242B84242B84242B84242B8 + 4242B84242B84242B84242B84242B80200000200003F3FB13F3FB13F3FB13F3F + B13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F + 3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB1 + 3F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3F + B13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F + 3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB1 + 3F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3F + B13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F + 3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB1 + 3F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3F + B13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F + 3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB13F3FB10200000200003A3AA6 + 3A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3A + A63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A + 3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA6 + 3A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3A + A63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A + 3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA6 + 3A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3A + A63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A + 3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA6 + 3A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3A + A63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA63A3AA602 + 0000020000333399333399333399333399333399333399333399333399333399 + 3333993333993333993333993333993333993333993333993333993333993333 + 9933339933339933339933339933339933339933339933339933339933339933 + 3399333399333399333399333399333399333399333399333399333399333399 + 3333993333993333993333993333993333993333993333993333993333993333 + 9933339933339933339933339933339933339933339933339933339933339933 + 3399333399333399333399333399333399333399333399333399333399333399 + 3333993333993333993333993333993333993333993333993333993333993333 + 9933339933339933339933339933339933339933339933339933339933339933 + 3399333399333399333399333399333399333399333399333399333399333399 + 3333993333993333993333993333993333993333993333993333993333993333 + 993333993333990200000200002C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C + 2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A + 2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C + 8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C + 2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A + 2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C + 8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C + 2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A + 2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C + 8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C + 2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A + 2C2C8A2C2C8A2C2C8A2C2C8A2C2C8A0200000200002323782323782323782323 + 7823237823237823237823237823237823237823237823237823237823237823 + 2378232378232378232378232378232378232378232378232378232378232378 + 2323782323782323782323782323782323782323782323782323782323782323 + 7823237823237823237823237823237823237823237823237823237823237823 + 2378232378232378232378232378232378232378232378232378232378232378 + 2323782323782323782323782323782323782323782323782323782323782323 + 7823237823237823237823237823237823237823237823237823237823237823 + 2378232378232378232378232378232378232378232378232378232378232378 + 2323782323782323782323782323782323782323782323782323782323782323 + 7823237823237823237823237823237823237823237823237823237823237823 + 2378232378232378232378232378232378232378232378020000020000191964 + 1919641919641919641919641919641919641919641919641919641919641919 + 6419196419196419196419196419196419196419196419196419196419196419 + 1964191964191964191964191964191964191964191964191964191964191964 + 1919641919641919641919641919641919641919641919641919641919641919 + 6419196419196419196419196419196419196419196419196419196419196419 + 1964191964191964191964191964191964191964191964191964191964191964 + 1919641919641919641919641919641919641919641919641919641919641919 + 6419196419196419196419196419196419196419196419196419196419196419 + 1964191964191964191964191964191964191964191964191964191964191964 + 1919641919641919641919641919641919641919641919641919641919641919 + 6419196419196419196419196419196419196419196419196419196419196402 + 00000200000E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C + 0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E + 4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E + 0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C + 0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E + 4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E + 0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C + 0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E + 4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E + 0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C + 0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E4C0E0E + 4C0E0E4C0E0E4C02000002000008083F08083F08083F08083F08083F08083F08 + 083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F + 08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F0808 + 3F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08 + 083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F + 08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F0808 + 3F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08 + 083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F + 08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F0808 + 3F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08 + 083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F + 08083F08083F08083F08083F08083F02000002000008083F08083F08083F0808 + 3F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08 + 083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F + 08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F0808 + 3F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08 + 083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F + 08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F0808 + 3F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08 + 083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F + 08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F0808 + 3F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08 + 083F08083F08083F08083F08083F08083F08083F08083F02000002000008083F + 08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F0808 + 3F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08 + 083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F + 08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F0808 + 3F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08 + 083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F + 08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F0808 + 3F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08 + 083F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F + 08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F0808 + 3F08083F08083F08083F08083F08083F08083F08083F08083F08083F08083F02 + 00000200005E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB0 + 5E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5E + B05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E + 5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB0 + 5E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5E + B05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E + 5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB0 + 5E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5E + B05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E + 5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB0 + 5E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5EB05E5E + B05E5EB05E5EB00200000200005757AC5757AC5757AC5757AC5757AC5757AC57 + 57AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC + 5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757 + AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC57 + 57AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC + 5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757 + AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC57 + 57AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC + 5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757 + AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC57 + 57AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC5757AC + 5757AC5757AC5757AC5757AC5757AC0200000200004A4AA64A4AA64A4AA64A4A + A64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A + 4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA6 + 4A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4A + A64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A + 4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA6 + 4A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4A + A64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A + 4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA6 + 4A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4A + A64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A + 4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA64A4AA60200000200003B3B9F + 3B3B9F3B3B9F3B3B9F3B3B9F3B3B9F3B3B9F3B3B9F3B3B9F3B3B9F3B3B9F3B3B + 9E3A3A9C39399A38389838389738389738389738389839399B3A3A9D3B3B9E3B + 3B9F3B3B9F3B3B9F3B3B9F3B3B9F3B3B9E3A3A9C39399A383898383898383898 + 39399A3A3A9D3B3B9E3B3B9F3B3B9E3B3B9E3A3A9C39399B39399A39399A3939 + 9A39399A39399B3A3A9C3B3B9E3B3B9E3B3B9F3B3B9F3B3B9F3B3B9F3B3B9E3A + 3A9D39399A38389838389738389839399A39399B3A3A9D3B3B9E3B3B9F3B3B9F + 3B3B9F3B3B9F3B3B9E3A3A9D39399B39399A39399A39399A39399A39399A3939 + 9A39399A39399A39399A39399A39399A39399A39399A39399B3A3A9C3A3A9D3B + 3B9E3A3A9D39399A38389838389838389939399A39399B39399B39399A39399A + 39399A3A3A9C3B3B9E3B3B9E3B3B9E3A3A9D3A3A9D3A3A9D3A3A9D3A3A9C3939 + 9A38389838389838389939399B3A3A9D3B3B9E3B3B9F3B3B9F3B3B9F3B3B9F02 + 00000200002C2C972C2C972C2C972C2C972C2C972C2C972C2C972C2C972C2C96 + 2B2B952A2A9229298D2727872525832525812424802525812525822525832626 + 8628288B2A2A902B2B952C2C962C2C972B2B952A2A9229298D27278725258225 + 258125258125258226268427278829298D2A2A922B2B942A2A9229298D272787 + 25258325258225258225258327278729298D2A2A922C2C962C2C972C2C972C2C + 962B2B9429298F27278926268425258124248025258126268427278729298D2A + 2A922B2B952C2C972C2C972C2C962B2B942A2A9028288A262686252583252582 + 2525812525822525832626842626852626852626842525822525822525822626 + 8528288A29298F29298F28288A26268424248024248025258226268526268626 + 268525258225258125258327278829298F2A2A922A2A9229298E28288A28288A + 28288927278726268425258124247F25258126268528288B2A2A912B2B952C2C + 972C2C972C2C970200000200001F1F911F1F911F1F911F1F911F1F911F1F911F + 1F911F1F901E1E8D1D1D871B1B7E18187416166C15156815156916166B16166D + 17176E17176F1717711818751A1A7D1C1C861E1E8C1E1E8D1D1D881B1B7F1818 + 7416166C15156815156916166A16166A16166A16166E1818751B1B801D1D871D + 1D871B1B7E1818731515691414631414631515691818731B1B7F1D1D891F1F8F + 1F1F911F1F901E1E8D1C1C8519197A17176E15156715156615156916166C1717 + 701818731919791B1B811D1D891F1F8F1F1F911F1F901E1E8D1C1C861A1A7C18 + 187216166A14146514146214146315156817176F18187318187417177116166C + 15156814146516166A1818741A1A7D1A1A7B1717711515661313611414631616 + 6A17176F17176F16166A1414641414621515681818731B1B801D1D871C1C841A + 1A7B18187317177017177017177016166E16166A151566141463151568181872 + 1B1B7F1D1D8A1F1F8F1F1F911F1F9102000002000016168C16168C16168C1616 + 8C16168C16168C16168C1515881414801212730F0F630D0D570C0C520C0C550E + 0E5D0F0F6610106B10106B1010690F0F640F0F6310106812127313137D141480 + 1212760F0F660D0D570C0C510C0C560E0E5E0F0F630E0E5F0C0C560C0C530D0D + 580F0F6712127613137D1212760F0F670C0C540A0A490A0A490C0C540F0F6712 + 127815158516168A16168C1515891414811111710E0E5F0C0C520B0B4E0C0C55 + 0E0E5E0F0F650F0F660F0F6610106911117113137D15158716168C16168C1515 + 881414811212761010680D0D580B0B4C0909450A0A490C0C530F0F6210106B11 + 116E1010690E0E620D0D580B0B500C0C540E0E6010106D1010690D0D5A0A0A4B + 0A0A470B0B4E0D0D5A0E0E5E0D0D5A0B0B500A0A480A0A490C0C530F0F641212 + 7413137E13137910106A0D0D5A0C0C530C0C560D0D5C0E0E610E0E600D0D580B + 0B4E0B0B4D0D0D5710106913137A15158616168C16168C0200000200000F0F89 + 0F0F890F0F890F0F890F0F890F0F890F0F860E0E7E0C0C6E09095B4545778383 + A1A3A3BAC2C2D5C2C2D9C3C3DCA5A5CC7777B22A2A840B0B6A0A0A610A0A5E0B + 0B660C0C710C0C710A0A635555868383A1C1C1D1C2C2D4A4A4C58585B5383881 + 0808510606440606430808516767A08686BB8686BA8585B28383A582829D8282 + 9D64648F0B0B650D0D780E0E850F0F880F0F890E0E820C0C7438387C8383A4A2 + A2B7C1C1D0C2C2D49494B867679F0A0A640A0A5F0A0A5D0A0A640C0C720E0E80 + 0F0F882D2D988787C38787C18686BC8585B58484AA8383A182829B82829D8383 + A58585B18686B88686BB8686B98585B58585AF65659308085009095B39398485 + 85B2A3A3BFC1C1D19393AB8383A336367328286C8484A8C1C1D082829C54547A + 08084D0A0A640C0C754A4A9E7777B119196907074A54547D8383A4A3A3C1C3C3 + D9A4A4C77575A426266006063F0606420808540B0B6B0E0E7D0F0F870F0F8902 + 00000200000C0C870C0C870C0C870C0C870C0C870C0C870B0B800A0A7265659A + E1E1E9FFFFFFFFFFFFF0F0F4A3A3C38585B88585BEA4A4D0F1F1F8FFFFFF7676 + B209096B08086409096709096B565697F0F0F5FFFFFFFFFFFFE1E1E87474A0C2 + C2DBFFFFFFFFFFFFE1E1EA53537B0404380505436464989494C2FFFFFFFFFFFF + FFFFFFFFFFFF9292A864648E0909650A0A770B0B800B0B800B0B800B0B7AA3A3 + C7FFFFFFFFFFFFFFFFFFC1C1D08383A8B2B2CDF0F0F6E1E1EC55558C07075408 + 085C09096D0B0B7C0C0C852A2A968686C39595CAF1F1F7FFFFFFFFFFFFFFFFFF + FFFFFF9292A88383A59494BCC3C3DEF1F1F8FFFFFFFFFFFFFFFFFFC2C2D70808 + 5B555593FFFFFFFFFFFFFFFFFFFFFFFFA2A2B8B2B2C6FFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFE0E0E7B2B2C81818710B0B798585BFFFFFFFD1D1E1C1C1D0FFFFFF + E1E1E8A3A3C2FFFFFFFFFFFFFFFFFFF0F0F433335F04043705054608085E0A0A + 760C0C830C0C870200000200000B0B870B0B870B0B870B0B870B0B870B0B8619 + 1984B2B2D1FFFFFFFFFFFFFFFFFFD1D1DB1616580808680A0A7B0B0B860B0B87 + 1A1A8FD2D2E9FFFFFFC2C2DE18187E0909756666A8FFFFFFFFFFFFFFFFFFB1B1 + C0040441070758090971E1E1EFFFFFFFFFFFFFFFFFFF52527504044107075809 + 0972FFFFFFFFFFFFFFFFFFFFFFFF04043705054807076109096F090973090972 + 090973A3A3CAFFFFFFFFFFFFFFFFFF81819A04044006065307075E171769B2B2 + CAFFFFFF44447706065508086A0A0A7B0B0B850B0B870B0B870B0B879595C9FF + FFFFFFFFFFFFFFFFFFFFFF04043806064C0808690A0A7D1A1A8F6767B4FFFFFF + FFFFFFC2C2DD0909707575B0FFFFFFFFFFFFFFFFFFE1E1EA05054805054B7373 + 9FFFFFFFFFFFFFFFFFFFC1C1CD14144944447E09096E0A0A7F8585C1FFFFFFFF + FFFFFFFFFFA1A1B505054307075C282884FFFFFFFFFFFFFFFFFFF0F0F323234E + 05054307075C0909740B0B820B0B870200000200000B0B870B0B870B0B870B0B + 870B0B870B0B859494C5FFFFFFFFFFFFFFFFFFFFFFFF43436D06065109096D0A + 0A7F0B0B870B0B870B0B871A1A8FD2D2E9FFFFFF8585BF0A0A7DF1F1F7FFFFFF + FFFFFFFFFFFF82829D0404400606520808668484B7FFFFFFFFFFFFFFFFFFC1C1 + CF05054807075E090972FFFFFFFFFFFFFFFFFFFFFFFF03033505054306065507 + 075D07075B07075836367DFFFFFFFFFFFFFFFFFFFFFFFF62628444447144447F + 45458645458344447763638924245C07075709096E0A0A7E0B0B860B0B870B0B + 870B0B878585C1FFFFFFFFFFFFFFFFFFFFFFFF04043806064C0808690A0A7D0B + 0B870B0B878585C3FFFFFFC2C2E00A0A7F191988C2C2E0FFFFFFFFFFFFFFFFFF + B2B2C744447A454581FFFFFFFFFFFFFFFFFFC1C1CE0505410707580909720A0A + 818585C1FFFFFFFFFFFFFFFFFF53537604043F060654080866D1D1E4FFFFFFFF + FFFFFFFFFFA1A1B605054A0808630A0A780B0B840B0B870200000200000B0B87 + 0B0B870B0B870B0B870B0B872A2A93FFFFFFFFFFFFFFFFFFFFFFFFD1D1D90404 + 3C06065209096D0A0A800B0B870B0B870B0B870B0B870B0B840A0A7E0A0A790A + 0A79FFFFFFFFFFFFFFFFFFFFFFFF63638D05054606064F07075D8484B1FFFFFF + FFFFFFFFFFFFC1C1D207075908086B090977FFFFFFFFFFFFFFFFFFFFFFFF0404 + 3C05054506064F06065106064D06064C444480FFFFFFFFFFFFFFFFFFFFFFFFC1 + C1D2C1C1D2C1C1D5FFFFFFFFFFFFFFFFFFFFFFFF73739B0808610909750B0B82 + 0B0B870B0B870B0B870B0B878585C1FFFFFFFFFFFFFFFFFFFFFFFF0404380606 + 4C0808690A0A7D0B0B870B0B870B0B874848A539399E0B0B860B0B860B0B8438 + 38959393BFC2C2D6FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC1C1D006064D + 0808620A0A770B0B838585C1FFFFFFFFFFFFFFFFFF43436804043B06064C0707 + 5AC2C2D7FFFFFFFFFFFFFFFFFFC1C1D207075A09096F0A0A7E0B0B860B0B8702 + 00000200000B0B870B0B870B0B870B0B870B0B876767B3FFFFFFFFFFFFFFFFFF + FFFFFFC1C1CC04043A06064F08086B0A0A7D0B0B870B0B870B0B870B0B840A0A + 7C09096F080866080869C2C2DDFFFFFFFFFFFFFFFFFF9393B907075706065607 + 075AB2B2CDFFFFFFFFFFFFFFFFFFA3A3C409096E0A0A780A0A7AFFFFFFFFFFFF + FFFFFFFFFFFF35356F252569C2C2D5E1E1EAB2B2C9353572171766F0F0F6FFFF + FFFFFFFFFFFFFF17176707075907075CC2C2D7FFFFFFFFFFFFE1E1EB17176C09 + 09720A0A7E0B0B850B0B870B0B870B0B870B0B878585C1FFFFFFFFFFFFFFFFFF + FFFFFF04043806064C0808690A0A7D0B0B870B0B870B0B870B0B870B0B870B0B + 870B0B875858ACC2C2E0E1E1EE9393BC07075B07075B64649CFFFFFFFFFFFFFF + FFFFC1C1D50707600909700A0A7E0B0B858585C1FFFFFFFFFFFFFFFFFF72728E + 04043A050549060656F0F0F5FFFFFFFFFFFFFFFFFF64649A09096C0A0A7B0B0B + 840B0B870B0B870200000200000B0B870B0B870B0B870B0B870B0B877676BCFF + FFFFFFFFFFFFFFFFFFFFFFC1C1CE04043A0505480707610909740A0A800B0B83 + 0A0A810A0A7A09096D07075B06065307075A282881D2D2E7FFFFFFFFFFFFF1F1 + F76666A508086B6565A1FFFFFFFFFFFFFFFFFFD2D2E51818800A0A7E0B0B8229 + 2990FFFFFFFFFFFFFFFFFFFFFFFFD1D1E3B2B2D1FFFFFFFFFFFFFFFFFFA3A3C7 + 0909706666ABFFFFFFFFFFFFFFFFFF7575B009096E27277EFFFFFFFFFFFFFFFF + FF6666A50909760A0A7F0B0B840B0B870B0B870B0B870B0B870B0B858585BFFF + FFFFFFFFFFFFFFFFFFFFFF0404370505490808650A0A790B0B850B0B860B0B87 + 0B0B870B0B870B0B870B0B879595CBFFFFFFFFFFFFF1F1F709097009096D7575 + ADFFFFFFFFFFFFFFFFFF9494BF0909750A0A7E0B0B840B0B868585C0FFFFFFFF + FFFFFFFFFFE0E0E7727292545486C2C2D8FFFFFFFFFFFFFFFFFFB2B2D1090974 + 0A0A7C0B0B830B0B870B0B870B0B870200000200000B0B870B0B870B0B870B0B + 870B0B8739399EFFFFFFFFFFFFFFFFFFFFFFFFC1C1D104044005054606065608 + 08670909730A0A7709097509096DB2B2CDC1C1D405054906065409096C191986 + 8585C3E1E1F0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD2D2E66666AE0A0A800B0B + 830B0B86C3C3E1FFFFFFFFFFFFFFFFFFFFFFFFB3B3D7C2C2DFFFFFFFFFFFFFFF + FFFFF1F1F747479D0A0A7F0B0B832A2A95A4A4D2F1F1F8FFFFFFD2D2E7FFFFFF + FFFFFFE1E1EF8585BE0A0A7F0B0B820B0B850B0B870B0B870B0B870B0B870B0B + 850A0A818585BBFFFFFFFFFFFFFFFFFFFFFFFF04043A0505490707600909730A + 0A800B0B840B0B870B0B870B0B870B0B870B0B870B0B877676BCE1E1F0FFFFFF + C2C2E0D2D2E7FFFFFFFFFFFFFFFFFF8585BD0A0A7E0B0B820B0B850B0B860B0B + 858585BEFFFFFFFFFFFFFFFFFFD1D1DAF0F0F4FFFFFFFFFFFFFFFFFFFFFFFFA4 + A4CE1919860A0A810B0B850B0B870B0B870B0B870B0B870200000200000B0B87 + 0B0B870B0B870B0B870B0B870B0B87C3C3E1FFFFFFFFFFFFFFFFFFFFFFFF1616 + 5C06064E06065307075D08086708086B08086B8484B2FFFFFFFFFFFF06065107 + 075D0909710A0A800B0B870B0B871A1A8F4848A54848A54848A40B0B850B0B86 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B8739399E2A2A960B0B + 870B0B8739399E39399E0B0B870B0B870B0B870B0B870B0B870B0B870B0B8739 + 399E4848A54848A42A2A940B0B850B0B860B0B870B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B830A0A7D8484B8FFFFFFFFFFFFFFFFFFFFFFFF0505460606 + 4F07075E09096D0A0A7A0B0B820B0B860B0B870B0B870B0B870B0B870B0B870B + 0B870B0B871A1A8F4848A54848A54848A439399C0B0B850B0B860B0B870B0B87 + 0B0B870B0B860B0B828585BCFFFFFFFFFFFFFFFFFF8282A106064C0707604747 + 982A2A920B0B860B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B8702 + 00000200000B0B870B0B870B0B870B0B870B0B870B0B871A1A8FD2D2E9FFFFFF + FFFFFFFFFFFFA3A3C70808620707600808620808660808697474ABFFFFFFFFFF + FFFFFFFF08086609096D0A0A7A0B0B830B0B870B0B870B0B870B0B870B0B870B + 0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B + 0B870B0B870B0B870B0B870B0B870B0B830A0A7D9494C2FFFFFFFFFFFFFFFFFF + FFFFFF07075D0707600808680909710A0A7A0B0B820B0B860B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B + 0B870B0B870B0B870B0B870B0B860A0A818585BCFFFFFFFFFFFFFFFFFF8383AB + 07075C08086B0A0A7A0B0B840B0B870B0B870B0B870B0B870B0B870B0B870B0B + 870B0B870B0B870200000200000B0B870B0B870B0B870B0B870B0B870B0B870B + 0B871A1A8F9595CBFFFFFFFFFFFFFFFFFFE1E1EE7575B14747956666A8C2C2DD + FFFFFFFFFFFFFFFFFFF1F1F70A0A790A0A7D0A0A810B0B850B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B + 0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B872A2A968585C2A4A4D0F1F1F7FF + FFFFFFFFFFFFFFFFFFFFFFC2C2DC8484BA4747990A0A7A0A0A800B0B840B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B872A2A964848A2C2C2DFFFFFFFFF + FFFFFFFFFF8484B70909720A0A790A0A810B0B860B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B870B0B870B0B870200000200000B0B870B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B871A1A8F6767B49595CAC3C3E1C3C3E0C2 + C2E0C2C2E08585C05757A90B0B827676BA6767B30B0B850B0B850B0B860B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B + 0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B872A2A968585 + C38585C28585C28585C18585C18585C18585C18585C18585C14848A10B0B830B + 0B850B0B860B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B876767B4C3C3 + E1C3C3E1C2C2E0C2C2E0F1F1F88585C00A0A800B0B820B0B850B0B870B0B870B + 0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870200000200000B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B + 0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B + 0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B + 0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B8702 + 00000200000B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B + 0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B + 0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B + 0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B + 870B0B870B0B870200000200000B0B870B0B870B0B870B0B870B0B870B0B870B + 0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B + 0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B + 0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B + 0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B870B0B870B0B870200000200000B0B870B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B + 0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B + 0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B + 0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B87 + 0B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B + 870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B870B + 0B870B0B870B0B870B0B870B0B870B0B870B0B870B0B87020000020000020000 + 0200000200000200000200000200000200000200000200000200000200000200 + 0002000002000002000002000002000002000002000002000002000002000002 + 0000020000020000020000020000020000020000020000020000020000020000 + 0200000200000200000200000200000200000200000200000200000200000200 + 0002000002000002000002000002000002000002000002000002000002000002 + 0000020000020000020000020000020000020000020000020000020000020000 + 0200000200000200000200000200000200000200000200000200000200000200 + 0002000002000002000002000002000002000002000002000002000002000002 + 0000020000020000020000020000020000020000020000020000020000020000 + 0200000200000200000200000200000200000200000200000200000200000200 + 0002000002000002000002000002000002000002000002000002000002000002 + 0000} + end + object Label1: TLabel + Left = 138 + Top = 6 + Width = 225 + Height = 23 + Caption = 'SQL Server Data Access' + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Height = -19 + Font.Name = 'Tahoma' + Font.Pitch = fpVariable + Font.Style = [fsBold] + ParentFont = False + end + object Label2: TLabel + Left = 146 + Top = 92 + Width = 38 + Height = 13 + Caption = 'Version ' + end + object lbVersion: TLabel + Left = 232 + Top = 92 + Width = 43 + Height = 13 + Caption = 'lbVersion' + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Height = 13 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [] + ParentFont = False + end + object lbIDE: TLabel + Left = 286 + Top = 92 + Width = 54 + Height = 13 + Caption = 'for Delphi 6' + end + object Label3: TLabel + Left = 146 + Top = 112 + Width = 156 + Height = 13 + Caption = 'Copyright '#169' 1997-2007 Core Lab' + end + object Label5: TLabel + Left = 146 + Top = 132 + Width = 26 + Height = 13 + Caption = 'Web:' + end + object Label6: TLabel + Left = 146 + Top = 153 + Width = 31 + Height = 13 + Caption = 'E-mail:' + end + object lbMail: TLabel + Left = 232 + Top = 153 + Width = 80 + Height = 13 + Cursor = crHandPoint + Caption = 'sdac@crlab.com' + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlue + Font.Height = 13 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [fsUnderline] + ParentColor = False + ParentFont = False + OnClick = lbMailClick + OnMouseMove = lbMailMouseMove + end + object lbWeb: TLabel + Left = 232 + Top = 132 + Width = 101 + Height = 13 + Cursor = crHandPoint + Caption = 'www.crlab.com/sdac' + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlue + Font.Height = 13 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [fsUnderline] + ParentFont = False + OnClick = lbWebClick + OnMouseMove = lbWebMouseMove + end + object Label4: TLabel + Left = 139 + Top = 29 + Width = 120 + Height = 23 + Caption = 'Components' + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Height = -19 + Font.Name = 'Tahoma' + Font.Pitch = fpVariable + Font.Style = [fsBold] + ParentFont = False + end + object Label8: TLabel + Left = 146 + Top = 195 + Width = 50 + Height = 13 + Caption = 'DBMonitor' + end + object lblDBMonitorVer: TLabel + Left = 232 + Top = 195 + Width = 60 + Height = 13 + Caption = 'not available' + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + ParentFont = False + end + object lbForum: TLabel + Left = 232 + Top = 174 + Width = 109 + Height = 13 + Cursor = crHandPoint + Caption = 'www.crlab.com/forums' + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlue + Font.Height = 13 + Font.Name = 'MS Sans Serif' + Font.Pitch = fpVariable + Font.Style = [fsUnderline] + ParentFont = False + OnClick = lbForumClick + OnMouseMove = lbForumMouseMove + end + object Label10: TLabel + Left = 146 + Top = 174 + Width = 32 + Height = 13 + Caption = 'Forum:' + end + object lbEdition: TLabel + Left = 159 + Top = 55 + Width = 121 + Height = 18 + Caption = 'Standard Edition' + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Height = -15 + Font.Name = 'Verdana' + Font.Pitch = fpVariable + Font.Style = [] + ParentFont = False + end + object Bevel2: TBevel + Left = 130 + Top = 240 + Width = 260 + Height = 9 + Shape = bsTopLine + end + object OKBtn: TButton + Left = 308 + Top = 248 + Width = 75 + Height = 24 + Cancel = True + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 0 + end +end diff --git a/internal/4.10.0.10/1/Source/Design/SdacAbout.pas b/internal/4.10.0.10/1/Source/Design/SdacAbout.pas new file mode 100644 index 0000000..9569ec4 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/SdacAbout.pas @@ -0,0 +1,181 @@ + +////////////////////////////////////////////////// +// SQL Server Data Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +// SDAC About Window +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I Sdac.inc} + +unit SdacAbout; +{$ENDIF} +interface +uses + Windows, SysUtils, Classes, Graphics, Forms, Controls, StdCtrls, + Buttons, ExtCtrls, HelpUtils; + +type + TSdacAboutForm = class(TForm) + OKBtn: TButton; + Image1: TImage; + Label1: TLabel; + Label2: TLabel; + lbVersion: TLabel; + lbIDE: TLabel; + Label3: TLabel; + Label5: TLabel; + Label6: TLabel; + lbMail: TLabel; + lbWeb: TLabel; + Label4: TLabel; + Bevel1: TBevel; + Label8: TLabel; + lblDBMonitorVer: TLabel; + lbForum: TLabel; + Label10: TLabel; + lbEdition: TLabel; + Bevel2: TBevel; + procedure FormShow(Sender: TObject); + procedure lbWebClick(Sender: TObject); + procedure lbMailClick(Sender: TObject); + procedure lbWebMouseMove(Sender: TObject; Shift: TShiftState; X, + Y: Integer); + procedure lbMailMouseMove(Sender: TObject; Shift: TShiftState; X, + Y: Integer); + procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X, + Y: Integer); + procedure lbForumClick(Sender: TObject); + procedure lbForumMouseMove(Sender: TObject; Shift: TShiftState; X, + Y: Integer); + private + { Private declarations } + public + { Public declarations } + end; + +procedure ShowAbout; + +implementation + +uses + ShellApi, MSDesign, DBMonitorClient; + +{$I SdacVer.inc} + +{$IFDEF IDE} +{$R *.dfm} +{$ENDIF} +{$IFDEF MSWINDOWS} +{$R SdacAbout.dfm} +{$ENDIF} + +procedure ShowAbout; +begin + with TSdacAboutForm.Create(Application) do + try + ShowModal; + finally + Free; + end; +end; + +procedure TSdacAboutForm.FormShow(Sender: TObject); +var + IDE: string; +begin +{$IFDEF D3} + IDE := 'Delphi 3'; +{$ENDIF} +{$IFDEF D4} + IDE := 'Delphi 4'; +{$ENDIF} +{$IFDEF D5} + IDE := 'Delphi 5'; +{$ENDIF} +{$IFDEF D6} + IDE := 'Delphi 6'; +{$ENDIF} +{$IFDEF D7} + IDE := 'Delphi 7'; +{$ENDIF} +{$IFDEF D8} + IDE := 'Delphi 8'; +{$ENDIF} +{$IFDEF D9} + IDE := 'Delphi 2005'; +{$ENDIF} +{$IFDEF D10} + IDE := 'Delphi 2006'; +{$ENDIF} +{$IFDEF D11} + IDE := 'Delphi 2007'; +{$ENDIF} +{$IFDEF CB3} + IDE := 'C++Builder 3'; +{$ENDIF} +{$IFDEF CB4} + IDE := 'C++Builder 4'; +{$ENDIF} +{$IFDEF CB5} + IDE := 'C++Builder 5'; +{$ENDIF} +{$IFDEF CB6} + IDE := 'C++Builder 6'; +{$ENDIF} + lbVersion.Caption := SDACVersion + ' '; + lbIDE.Caption := ' for ' + IDE; + lbIDE.Left := lbVersion.Left + lbVersion.Width; + + + lblDBMonitorVer.Caption := GetDBMonitorVersion; +end; + +procedure TSdacAboutForm.lbWebClick(Sender: TObject); +begin + OpenUrl('http://www.crlab.com/sdac'); + lbWeb.Font.Color := $FF0000; +end; + +procedure TSdacAboutForm.lbMailClick(Sender: TObject); +begin + MailTo('sdac@crlab.com'); + lbMail.Font.Color := $FF0000; +end; + +procedure TSdacAboutForm.lbWebMouseMove(Sender: TObject; Shift: TShiftState; X, + Y: Integer); +begin + lbWeb.Font.Color := $4080FF; +end; + +procedure TSdacAboutForm.lbMailMouseMove(Sender: TObject; Shift: TShiftState; + X, Y: Integer); +begin + lbMail.Font.Color := $4080FF; +end; + +procedure TSdacAboutForm.FormMouseMove(Sender: TObject; Shift: TShiftState; X, + Y: Integer); +begin + lbWeb.Font.Color := $FF0000; + lbMail.Font.Color := $FF0000; + lbForum.Font.Color := $FF0000; +end; + +procedure TSdacAboutForm.lbForumClick(Sender: TObject); +begin +{$IFDEF MSWINDOWS} + OpenUrl('http://crlab.com/forums/viewforum.php?f=6'); + lbForum.Font.Color := $FF0000; +{$ENDIF} +end; + +procedure TSdacAboutForm.lbForumMouseMove(Sender: TObject; + Shift: TShiftState; X, Y: Integer); +begin + lbForum.Font.Color := $4080FF; +end; + +end. diff --git a/internal/4.10.0.10/1/Source/Design/VTDataEditor.dfm b/internal/4.10.0.10/1/Source/Design/VTDataEditor.dfm new file mode 100644 index 0000000..3092b43 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/VTDataEditor.dfm @@ -0,0 +1,81 @@ +inherited VTDataEditorForm: TVTDataEditorForm + Width = 671 + Caption = 'VTDataEditorForm' + PixelsPerInch = 96 + TextHeight = 13 + inherited BtnPanel: TPanel + Width = 663 + inherited imCorner: TImage + Left = 651 + end + inherited btOk: TBitBtn + Left = 499 + end + inherited btCancel: TBitBtn + Left = 580 + end + end + inherited StatusBar: TStatusBar + Width = 663 + end + inherited pnlToolBar: TPanel + Width = 663 + inherited btClose: TSpeedButton + OnClick = CloseClick + end + object btSave: TSpeedButton [1] + Left = 0 + Top = 0 + Width = 75 + Height = 23 + Caption = 'Save' + OnClick = SaveClick + end + object btClear: TSpeedButton [2] + Left = 162 + Top = 0 + Width = 75 + Height = 23 + Caption = 'Clear' + OnClick = btClearClick + end + object btLoadFromFile: TSpeedButton [3] + Left = 237 + Top = 0 + Width = 75 + Height = 23 + Caption = 'Load from file' + OnClick = btLoadFromFileClick + end + object btSaveToFile: TSpeedButton [4] + Left = 312 + Top = 0 + Width = 75 + Height = 23 + Caption = 'Save to file' + OnClick = btSaveToFileClick + end + inherited DBNavigator: TDBNavigator + Left = 399 + Hints.Strings = () + end + end + inherited DBGrid: TDBGrid + Width = 663 + end + object OpenDialog: TOpenDialog + Filter = + 'Virtual Table Data (*.vtd)|*.vtd|XML (*.xml)|*.xml|Any File (*.*' + + ')|*.*' + Left = 352 + Top = 34 + end + object SaveDialog: TSaveDialog + FileName = 'Data1' + Filter = + 'Virtual Table Data (*.vtd)|*.vtd|XML (*.xml)|*.xml|Any File (*.*' + + ')|*.*' + Left = 384 + Top = 34 + end +end diff --git a/internal/4.10.0.10/1/Source/Design/VTDataEditor.pas b/internal/4.10.0.10/1/Source/Design/VTDataEditor.pas new file mode 100644 index 0000000..b532714 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/VTDataEditor.pas @@ -0,0 +1,223 @@ +////////////////////////////////////////////////// +// DB Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +// Base Component Editor +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I Dac.inc} + +unit VTDataEditor; +{$ENDIF} + +interface +uses +{$IFDEF MSWINDOWS} + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, DBGrids, Dialogs, + StdCtrls, ExtCtrls, Buttons, ComCtrls, Grids, DBCtrls, +{$ENDIF} +{$IFDEF LINUX} + SysUtils, Types, Classes, QGraphics, QControls, QForms, QDBGrids, QDialogs, QStdCtrls, + QExtCtrls, QButtons, QDBCtrls, QComCtrls, QGrids, +{$ENDIF} + DB, CRDataEditor, DADesignUtils, VirtualTable; + +type + TVTDataEditorForm = class(TCRDataEditorForm) + btSave: TSpeedButton; + btClear: TSpeedButton; + btLoadFromFile: TSpeedButton; + btSaveToFile: TSpeedButton; + OpenDialog: TOpenDialog; + SaveDialog: TSaveDialog; + procedure btLoadFromFileClick(Sender: TObject); + procedure btSaveToFileClick(Sender: TObject); + procedure btClearClick(Sender: TObject); + procedure DataSourceDataChange(Sender: TObject; Field: TField); + private + LocalDataSet: TVirtualTable; + + procedure AfterPost(DataSet: TDataSet); + procedure AfterDelete(DataSet: TDataSet); + + function LoadDefaultExt: integer; + procedure SaveDefaultExt(Value: integer); + protected + procedure DoInit; override; + procedure DoSave; override; + procedure DoFinish; override; + end; + +implementation + +{$IFDEF IDE} +{$R *.dfm} +{$ENDIF} +{$IFDEF MSWINDOWS} +{$R VTDataEditor.dfm} +{$ENDIF} +{$IFDEF LINUX} +{$R *.xfm} +{$ENDIF} + +uses +{$IFDEF CLR} + Variants, +{$ENDIF} +{$IFDEF MSWINDOWS} + Registry, +{$ENDIF} + TypInfo; + +{ TDADataEditorForm } + +procedure TVTDataEditorForm.DoInit; +var + Filtered: boolean; +begin + inherited; + + DataSource.DataSet := nil; + + LocalDataSet:= TVirtualTable.Create(Self); + Filtered := FDataSet.Filtered; + try + FDataSet.Filtered := False; + LocalDataSet.Assign(FDataSet); + finally + FDataSet.Filtered := Filtered; + end; + + LocalDataSet.Filter := FDataSet.Filter; + LocalDataSet.Filtered := Filtered; + Caption := FDataSet.Owner.Name + '.' + FDataSet.Name; + + DataSource.DataSet:= LocalDataSet; + LocalDataSet.Open; + LocalDataSet.AfterPost := AfterPost; + LocalDataSet.AfterDelete:= AfterDelete; + + Modified:= False; +end; + +procedure TVTDataEditorForm.DoSave; +var + OldFiltered: boolean; +begin + OldFiltered := LocalDataSet.Filtered; + try + LocalDataSet.Filtered := False; + FDataSet.Assign(LocalDataSet); + LocalDataSet.Close; + finally + LocalDataSet.Filtered := OldFiltered; + end; +end; + +procedure TVTDataEditorForm.DoFinish; +begin + LocalDataSet.Free; + inherited; +end; + +procedure TVTDataEditorForm.AfterDelete(DataSet: TDataSet); +begin + Modified := True; +end; + +procedure TVTDataEditorForm.AfterPost(DataSet: TDataSet); +begin + Modified := True; +end; + +function TVTDataEditorForm.LoadDefaultExt: integer; +{$IFDEF MSWINDOWS} +var + Registry: TRegistry; +{$ENDIF} +begin + Result := 1; +{$IFDEF MSWINDOWS} + Registry := TRegistry.Create; + try + with Registry do begin + OpenKey(KeyPath + '\' + FolderName, True); + if ValueExists('DefaultExt') then + Result := ReadInteger('DefaultExt'); + end; + finally + Registry.Free; + end; +{$ENDIF} +end; + +procedure TVTDataEditorForm.SaveDefaultExt(Value: integer); +{$IFDEF MSWINDOWS} +var + Registry: TRegistry; +{$ENDIF} +begin +{$IFDEF MSWINDOWS} + Registry := TRegistry.Create; + try + with Registry do begin + OpenKey(KeyPath + '\' + FolderName, True); + WriteInteger('DefaultExt', Value); + end; + finally + Registry.Free; + end; +{$ENDIF} +end; + +procedure TVTDataEditorForm.btLoadFromFileClick(Sender: TObject); +begin + OpenDialog.FilterIndex := LoadDefaultExt; + if OpenDialog.Execute then + LocalDataSet.LoadFromFile(OpenDialog.FileName); +end; + +procedure TVTDataEditorForm.btSaveToFileClick(Sender: TObject); +var + FileName: string; +begin + SaveDialog.FilterIndex := LoadDefaultExt; + if SaveDialog.Execute then begin + FileName := SaveDialog.FileName; + SaveDefaultExt(SaveDialog.FilterIndex); + if ExtractFileExt(FileName) = '' then + case SaveDialog.FilterIndex of + 1: FileName := FileName + '.vtd'; + 2: FileName := FileName + '.xml'; + end; + case SaveDialog.FilterIndex of + 1: LocalDataSet.SaveToFile(FileName); + 2: LocalDataSet.SaveToXML(FileName); + end; + end; +end; + +procedure TVTDataEditorForm.btClearClick(Sender: TObject); +begin + LocalDataSet.Clear; + Modified:= True; +end; + +procedure TVTDataEditorForm.DataSourceDataChange(Sender: TObject; + Field: TField); +begin + if LocalDataSet <> nil then begin // event first occurs before assigning value to LocalDataSet + StatusBar.Panels[0].Text := 'RecordCount: ' + IntToStr(LocalDataSet.RecordCount); + StatusBar.Panels[1].Text := 'RecordNo: ' + IntToStr(LocalDataSet.RecNo); + end; +end; + +{$IFDEF CLR} + +initialization + + RegisterClass(TDBGrid); +{$ENDIF} + +end. diff --git a/internal/4.10.0.10/1/Source/Design/VTDataEditor.xfm b/internal/4.10.0.10/1/Source/Design/VTDataEditor.xfm new file mode 100644 index 0000000..15dbd7e --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/VTDataEditor.xfm @@ -0,0 +1,80 @@ +inherited VTDataEditorForm: TVTDataEditorForm + Width = 671 + Caption = 'VTDataEditorForm' + PixelsPerInch = 96 + TextHeight = 13 + inherited BtnPanel: TPanel + Width = 663 + inherited imCorner: TImage + Left = 651 + end + inherited btOk: TBitBtn + Left = 499 + end + inherited btCancel: TBitBtn + Left = 580 + end + end + inherited StatusBar: TStatusBar + Width = 663 + end + inherited pnlToolBar: TPanel + Width = 663 + inherited btClose: TSpeedButton + OnClick = CloseClick + end + object btSave: TSpeedButton [1] + Left = 0 + Top = 0 + Width = 75 + Height = 23 + Caption = 'Save' + OnClick = SaveClick + end + object btClear: TSpeedButton [2] + Left = 162 + Top = 0 + Width = 75 + Height = 23 + Caption = 'Clear' + OnClick = btClearClick + end + object btLoadFromFile: TSpeedButton [3] + Left = 237 + Top = 0 + Width = 75 + Height = 23 + Caption = 'Load from file' + OnClick = btLoadFromFileClick + end + object btSaveToFile: TSpeedButton [4] + Left = 312 + Top = 0 + Width = 75 + Height = 23 + Caption = 'Save to file' + OnClick = btSaveToFileClick + end + inherited DBNavigator: TDBNavigator + Left = 399 + Hints.Strings = () + end + end + inherited DBGrid: TDBGrid + Width = 663 + end + object OpenDialog: TOpenDialog + DefaultExt = '' + FileName = '' + Filter = 'Virtual Table Data (*.vtd)|*.vtd|Any File (*.*)|*.*' + Left = 352 + Top = 34 + end + object SaveDialog: TSaveDialog + DefaultExt = '' + FileName = 'Data1' + Filter = 'Virtual Table Data (*.vtd)|*.vtd|Any File (*.*)|*.*' + Left = 384 + Top = 34 + end +end diff --git a/internal/4.10.0.10/1/Source/Design/VTDesign.pas b/internal/4.10.0.10/1/Source/Design/VTDesign.pas new file mode 100644 index 0000000..b899fab --- /dev/null +++ b/internal/4.10.0.10/1/Source/Design/VTDesign.pas @@ -0,0 +1,275 @@ + +////////////////////////////////////////////////// +// Copyright © 1998-2007 Core Lab. All right reserved. +// Virtual table design +// Created: 23.08.99 +////////////////////////////////////////////////// + +{$IFNDEF CLR} +{$I Dac.inc} + +unit VTDesign; +{$ENDIF} +interface +uses + Classes, Forms, +{$IFDEF CLR} + Borland.Vcl.Design.DesignIntf, Borland.Vcl.Design.DesignEditors, +{$ELSE} +{$IFDEF VER6P} + DesignIntf, DesignEditors, +{$ELSE} + DsgnIntf, +{$ENDIF} +{$ENDIF} + DADesign, DADesignUtils; + +type + TVTFieldsEditor = class(TDAFieldsEditor); + + TVirtualTableEditor = class (TDADataSetEditor) + private + Items: TStrings; + + procedure StrProc(const S: string); + procedure DataSetsDblClick(Sender: TObject); + + procedure ShowVTDataEditor; + procedure ShowAssignDataSet; + procedure LoadData; + procedure SaveData; + procedure ShowAbout; + protected + procedure InitVerbs; override; + public + procedure Edit; override; + end; + +procedure Register; + +implementation +uses +{$IFDEF CLR} + Borland.VCL.Design.DSDesign, +{$ELSE} +{$IFNDEF BCB} +{$IFNDEF LINUX} + DSDesign, +{$ENDIF} +{$ENDIF} +{$ENDIF} + Windows, DB, VirtualTable, Controls, Dialogs, Buttons, StdCtrls, + TypInfo, Graphics, VTDataEditor, SysUtils; + +//{$R DADesign.res} + +{$IFDEF LINUX} + {$DEFINE OLDDESIGNER} +{$ENDIF} +{$IFDEF BCB} + {$DEFINE OLDDESIGNER} +{$ENDIF} + +{$I DacVer.inc} + +{$IFDEF OLDDESIGNER} +var + DataSetEditorClass: TComponentEditorClass; +{$ENDIF} + + + +procedure TVirtualTableEditor.InitVerbs; +begin + AddVerb('Fields &Editor...', ShowFieldsEditor); + AddVerb('VirtualTable E&ditor...', ShowVTDataEditor); + AddVerb('Assign DataSet...', ShowAssignDataSet); + AddVerb('Load from file...', LoadData); + AddVerb('Save to file...', SaveData); + AddVerb('&About...', ShowAbout); + + inherited; +end; + +procedure TVirtualTableEditor.Edit; +begin + if GetVerbCount > 1 then + ExecuteVerb(1); +end; + +procedure TVirtualTableEditor.ShowVTDataEditor; +begin + {$IFDEF CLR}CoreLab.Dac.Design.{$ENDIF}DADesign.ShowEditor(TVTDataEditorForm, TDADesignUtils, Component, Designer); +end; + +procedure TVirtualTableEditor.LoadData; +var + OpenDialog: TOpenDialog; +begin + OpenDialog := TOpenDialog.Create(nil); + try + OpenDialog.DefaultExt := 'vtd'; + OpenDialog.Filter := + 'Virtual Table Data (*.vtd)|*.vtd|' + + 'XML File (*.xml)|*.xml|' + + 'Any File (*.*)|*.*'; + OpenDialog.FileName := '*.vtd'; + if OpenDialog.Execute then + TVirtualTable(Component).LoadFromFile(OpenDialog.FileName); + finally + OpenDialog.Free; + end; +end; + +procedure TVirtualTableEditor.SaveData; +var + SaveDialog: TSaveDialog; +begin + SaveDialog := TSaveDialog.Create(nil); + try + SaveDialog.DefaultExt := 'vtd'; + SaveDialog.Filter := + 'Virtual Table Data (*.vtd)|*.vtd|' + + 'XML File (*.xml)|*.xml|' + + 'Any File (*.*)|*.*'; + SaveDialog.FileName := 'Data1'; + if SaveDialog.Execute then + if LowerCase(ExtractFileExt(SaveDialog.FileName)) = '.xml' then + TVirtualTable(Component).SaveToXML(SaveDialog.FileName) + else + TVirtualTable(Component).SaveToFile(SaveDialog.FileName); + finally + SaveDialog.Free; + end; +end; + +procedure TVirtualTableEditor.ShowAbout; +begin + Application.MessageBox( + 'VirtualTable component'#13 + + 'Version ' + DacVersion + ' free'#13 + + 'Copyright © 1998-2007 Core Lab.'#13 + + 'All right reserved.'#13#13 + + + 'Web: www.crlab.com'#13 + + 'eMail: support@crlab.com'#13#13 + , 'About', MB_OK or MB_ICONINFORMATION); +end; + +procedure TVirtualTableEditor.DataSetsDblClick(Sender: TObject); +begin + TForm(TListBox(Sender).Owner).ModalResult := mrOk; +end; + +procedure TVirtualTableEditor.StrProc(const S: string); +begin + if S <> Component.Name then + Items.Add(S); +end; + +procedure TVirtualTableEditor.ShowAssignDataSet; +var + Form: TForm; + List: TListBox; + TypeData: TTypeData; +begin + Form := TForm.Create(nil); + try + Form.BorderStyle := bsDialog; + Form.Height := 250; + Form.Width := 300; + Form.Position := poScreenCenter; + Form.Caption := 'Available DataSets'; + + List := TListBox.Create(Form); + with List do begin + Parent := Form; + Left := 8; + Top := 8; + Width := Form.ClientWidth - 16; + Height := Form.ClientHeight - 53; + Sorted := True; + OnDblClick := DataSetsDblClick; + end; + Items := List.Items; + + with TButton.Create(Form) do begin + Parent := Form; + Left := 128; + Top := 192; + Caption := 'Ok'; + Font.Style := [fsBold]; + ModalResult := mrOk; + Default := True; + end; + + with TButton.Create(Form) do begin + Parent := Form; + Left := 208; + Top := 192; + Caption := 'Cancel'; + Font.Style := [fsBold]; + ModalResult := mrCancel; + Cancel := True; + end; + + {$IFDEF CLR} + TypeData := TTypeData.Create(TypeOf(TDataSet)); + Designer.GetComponentNames(TypeData, StrProc); + {$ELSE} + TypeData.ClassType := TDataSet; + Designer.GetComponentNames(@TypeData, StrProc); + {$ENDIF} + if List.Items.Count > 0 then + List.ItemIndex := 0; + + if (Form.ShowModal = mrOk) and (List.ItemIndex >= 0) then + TVirtualTable(Component).Assign( + TDataSet(Designer.GetComponent(List.Items[List.ItemIndex]))); + finally + Form.Free; + end; +end; + +procedure Register; +{$IFDEF OLDDESIGNER} +var + DataSet: TDataSet; + DataSetEditor: TComponentEditor; +{$ENDIF} +begin +// WAR need before register TOraQuery, TOraSmartQuery + +{$IFDEF OLDDESIGNER} +{$WARNINGS OFF} +{$IFDEF VER6P} + DataSet := nil; + try + DataSet := TDataSet.Create(nil); + DataSetEditor := Pointer(Integer(GetComponentEditor(DataSet, nil)) - 20); + DataSetEditorClass := TComponentEditorClass(DataSetEditor.ClassType); + finally + DataSet.Free; + end; +{$ELSE} + DataSet := nil; + DataSetEditor := nil; + try + DataSet := TDataSet.Create(nil); + DataSetEditor := GetComponentEditor(DataSet, nil); + DataSetEditorClass := TComponentEditorClass(DataSetEditor.ClassType); + finally + DataSetEditor.Free; + DataSet.Free; + end; +{$ENDIF} +{$WARNINGS ON} +{$ENDIF} + + RegisterPropertyEditor(TypeInfo(DB.TFields), TVirtualTable, 'Fields', + TVTFieldsEditor); + + RegisterComponentEditor(TVirtualTable, TVirtualTableEditor); +end; + +end. diff --git a/internal/4.10.0.10/1/Source/MSAccess.pas b/internal/4.10.0.10/1/Source/MSAccess.pas new file mode 100644 index 0000000..acbc440 --- /dev/null +++ b/internal/4.10.0.10/1/Source/MSAccess.pas @@ -0,0 +1,5787 @@ + +////////////////////////////////////////////////// +// SQL Server Data Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +// MSAccess +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I Sdac.inc} + +unit MSAccess; +{$ENDIF} + +{ $R MSAccess.res} + +interface + +uses +{$IFDEF CLR} + Variants, System.XML, System.Text, +{$ELSE} + CLRClasses, CRXml, +{$ENDIF} + Classes, MemDS, DBAccess, MemData, CRAccess, OLEDBAccess, SysUtils, DB, CRParser, + OLEDBC, OLEDBIntf, MSConsts, MemUtils, DASQLMonitor, Windows, DAConsts, Win32Timer; + +{$I SdacVer.inc} + +const + ftMSXML = 50; + +{ TMSParam } +const + /// WAR Need to sync with EdMSParams.FieldTypesWithSize on change + FieldTypesWithSize: set of TFieldType = [ftString, ftFixedChar, {ftMemo - BLOB, }ftBytes, ftVarBytes, ftWideString]; + +type + TMSParam = class (TDAParam) + private + FOLEDBType: DBTYPE; + protected + function GetSize: integer; override; + procedure SetSize(Value: integer); override; + + procedure SetAsString(Value: string); override; + procedure SetAsWideString(Value: WideString); override; + procedure SetAsVariant(const Value: Variant); override; + + procedure CreateObject; override; + + function IsObjectDataType: boolean; overload; + property ParamObject; + property OLEDBType: DBTYPE read FOLEDBType write FOLEDBType; + public + constructor Create(Collection: TCollection); override; + + procedure AssignFieldValue(Field: TField; const Value: Variant); override; + + property AsString: string read GetAsString write SetAsString; + property AsWideString: WideString read GetAsWideString write SetAsWideString; + + end; + +{ TMSParams } + TMSParams = class (TDAParams) + private + function GetItem(Index: Integer): TMSParam; + procedure SetItem(Index: Integer; Value: TMSParam); + + public + constructor Create(Owner: TPersistent); + + procedure Assign(Source: TPersistent); override; + + function ParamByName(const Value: string): TMSParam; + function FindParam(const Value: string): TMSParam; + property Items[Index: integer]: TMSParam read GetItem write SetItem; default; + + end; + +{ TMSConnection } + + TMSConnection = class; + TMSConnectionOptions = class (TDAConnectionOptions) + protected + FQuotedIdentifier: boolean; + FLanguage: string; + FEncrypt: boolean; + FPersistSecurityInfo: boolean; + FAutoTranslate: boolean; + FNetworkLibrary: string; + FApplicationName: string; + FWorkstationID: string; + FPacketSize: integer; + FNumericType: TDANumericType; + FProvider: TOLEDBProvider; + FInitialFileName: string; + FMultipleActiveResultSets: boolean; + //FMaxDatabaseSize: integer; + FFailoverPartner: string; + + procedure SetQuotedIdentifier(const Value: boolean); + procedure SetLanguage(const Value: string); + procedure SetEncrypt(const Value: boolean); + procedure SetPersistSecurityInfo(const Value: boolean); + procedure SetAutoTranslate(const Value: boolean); + procedure SetNetworkLibrary(const Value: string); + procedure SetApplicationName(const Value: string); + procedure SetWorkstationID(const Value: string); + procedure SetPacketSize(const Value: integer); + procedure SetNumericType(Value: TDANumericType); + procedure SetProvider(const Value: TOLEDBProvider); + procedure SetInitialFileName(const Value: string); + procedure SetMultipleActiveResultSets(const Value: boolean); + //procedure SetMaxDatabaseFile(const Value: integer); + procedure SetFailoverPartner(const Value: string); + + protected + procedure AssignTo(Dest: TPersistent); override; + + public + constructor Create(Owner: TMSConnection); + + published + property QuotedIdentifier: boolean read FQuotedIdentifier write SetQuotedIdentifier default True; + property Language: string read FLanguage write SetLanguage; + property Encrypt: boolean read FEncrypt write SetEncrypt default False; + property PersistSecurityInfo: boolean read FPersistSecurityInfo write SetPersistSecurityInfo default False; + property AutoTranslate: boolean read FAutoTranslate write SetAutoTranslate default True; + property NetworkLibrary: string read FNetworkLibrary write SetNetworkLibrary; + property ApplicationName: string read FApplicationName write SetApplicationName; + property WorkstationID: string read FWorkstationID write SetWorkstationID; + property PacketSize: integer read FPacketSize write SetPacketSize default 4096; + property NumericType: TDANumericType read FNumericType write SetNumericType default ntFloat; + property Provider: TOLEDBProvider read FProvider write SetProvider default prAuto; + property InitialFileName: string read FInitialFileName write SetInitialFileName; + property MultipleActiveResultSets: boolean read FMultipleActiveResultSets write SetMultipleActiveResultSets default False; + //property MaxDatabaseSize: integer read FMaxDatabaseSize write SetMaxDatabaseFile default 128; + property FailoverPartner: string read FFailoverPartner write SetFailoverPartner; + property KeepDesignConnected; + property DisconnectedMode; + property LocalFailover; + end; + + TMSConnectionInfoMessageEvent = procedure (Sender: TObject; E: EMSError) of object; + TMSSQL = class; + + TMSConnection = class (TCustomDAConnection) + protected + FLoginPrompt: boolean; + FLockLoginPrompt: boolean; + + FDatabase: string; + FIsolationLevel: TIsolationLevel; + FAuthentication: TMSAuthentication; + + FConnectionTimeout: integer; + // FMultipleConnections: boolean; + FOptions: TMSConnectionOptions; + + FMSSQL: TMSSQL; + + FOnInfoMessage: TMSConnectionInfoMessageEvent; + + function GetIConnectionClass: TCRConnectionClass; override; + function GetICommandClass: TCRCommandClass; override; + function GetIRecordSetClass: TCRRecordSetClass; override; + + procedure CreateIConnection; override; + procedure SetIConnection(Value: TCRConnection); override; + procedure SetOptions(Value: TMSConnectionOptions); + + function GetOLEDBConnection: TOLEDBConnection; + + function SQLMonitorClass: TClass; override; + function ConnectDialogClass: TConnectDialogClass; override; + + procedure AssignTo(Dest: TPersistent); override; + + procedure SetDatabase(Value: string); + + procedure SetIsolationLevel(const Value: TIsolationLevel); + // procedure SetMultipleConnections(const Value: boolean); + + procedure SetAuthentication(const Value: TMSAuthentication); + procedure SetConnectionTimeout(const Value: integer); + function NeedPrompt: boolean; override; + + function IsFatalError(E: EDAError): boolean; override; + procedure DoError(E: Exception; var Fail, Reconnect, Reexecute: boolean; ReconnectAttempt: integer; + var ConnLostCause: TConnLostCause); override; + procedure DoInfoMessage(E: EMSError); + function IsKeyViolation(E: EDAError): boolean; override; + + procedure Check(const Status: HRESULT; Sender: TObject); + procedure CheckInactive; + + { Transaction control } + procedure InternalStartTransaction; override; + + function CommitOnDisconnect: boolean; override; + + function GetConnectString: string; override; + procedure SetConnectString(Value: string); override; + function GetClientVersion: string; + function GetServerVersion: string; + + + function CreateOptions: TDAConnectionOptions; override; + + function IConnection: TOLEDBConnection; + function IsCaseSensitive: boolean; override; + public + constructor Create(Owner: TComponent); override; + destructor Destroy; override; + + function CreateDataSet: TCustomDADataSet; override; + function CreateSQL: TCustomDASQL; override; + + procedure ChangePassword(NewPassword: string); + function ExecSQL(Text: string; const Params: array of variant): variant; override; + + procedure GetTableNames(List: TStrings); override; + procedure GetDatabaseNames(List: TStrings); override; + procedure GetStoredProcNames(List: TStrings); overload; override; + procedure GetStoredProcNames(List: TStrings; System: boolean); reintroduce; overload; + + property ClientVersion: string read GetClientVersion; + property ServerVersion: string read GetServerVersion; + + published + property Database: string read FDatabase write SetDatabase; + property IsolationLevel: TIsolationLevel read FIsolationLevel write SetIsolationLevel default ilReadCommitted; + property Authentication: TMSAuthentication read FAuthentication write SetAuthentication default auServer; + property ConnectionTimeout: integer read FConnectionTimeout write SetConnectionTimeout default 15; + // property MultipleConnections: boolean read FMultipleConnections write SetMultipleConnections; {without default!} + + property Options: TMSConnectionOptions read FOptions write SetOptions; + + property PoolingOptions; + property Pooling; + + property Username; + property Password; + property Server; + property Connected stored IsConnectedStored; + + property AfterConnect; + property BeforeConnect; + property AfterDisconnect; + property BeforeDisconnect; + property OnLogin; + property OnError; + property ConnectDialog; + property LoginPrompt; + property ConnectString; + + property OnInfoMessage: TMSConnectionInfoMessageEvent read FOnInfoMessage write FOnInfoMessage; + property OnConnectionLost; + end; + +{ TCustomMSDataSet } + + TMSDataSetOptions = class (TDADataSetOptions) + private + FEnableBCD: boolean; + FUniqueRecords: boolean; + FCursorUpdate: boolean; + FQueryIdentity: boolean; + FCheckRowVersion: boolean; + FDMLRefresh: boolean; + FAutoRefresh: boolean; + FAutoRefreshInterval: integer; + FSmartRefresh: boolean; + FDefaultValues: boolean; + FNonBlocking: boolean; + + procedure SetEnableBCD(Value: boolean); + procedure SetUniqueRecords(Value: boolean); + procedure SetCursorUpdate(Value: boolean); + function GetAllFieldsEditable: boolean; + procedure SetAllFieldsEditable(const Value: boolean); + procedure SetAutoRefresh(Value: boolean); + procedure SetAutoRefreshInterval(Value: integer); + //procedure SetSmartRefresh(Value: boolean); + procedure SetNonBlocking(Value: boolean); + protected + procedure AssignTo(Dest: TPersistent); override; + + public + constructor Create(Owner: TCustomDADataSet); + + published + property AllFieldsEditable: boolean read GetAllFieldsEditable write SetAllFieldsEditable stored False; + property EnableBCD: boolean read FEnableBCD write SetEnableBCD default False; + property UniqueRecords: boolean read FUniqueRecords write SetUniqueRecords default False; + property CursorUpdate: boolean read FCursorUpdate write SetCursorUpdate default True; + property QueryIdentity: boolean read FQueryIdentity write FQueryIdentity default True; + property CheckRowVersion: boolean read FCheckRowVersion write FCheckRowVersion default False; + property FullRefresh default False; + property DMLRefresh: boolean read FDMLRefresh write FDMLRefresh default False; + property AutoRefresh: boolean read FAutoRefresh write SetAutoRefresh default False; + property AutoRefreshInterval: integer read FAutoRefreshInterval write SetAutoRefreshInterval default 60; /// Seconds dac6.txt + //property SmartRefresh: boolean read FSmartRefresh write SetSmartRefresh default False; + property DefaultValues: boolean read FDefaultValues write FDefaultValues default False; + property NonBlocking: boolean read FNonBlocking write SetNonBlocking default False; + + property LongStrings; + property RequiredFields default False; + property StrictUpdate; + property NumberRange; + property ReturnParams; + property TrimFixedChar; + property TrimVarChar; + property QueryRecCount; + property AutoPrepare; + property RemoveOnRefresh; + property FlatBuffers; + property QuoteNames; + property DetailDelay; + {$IFDEF HAVE_COMPRESS} + property CompressBlobMode; + {$ENDIF} + property LocalMasterDetail; + property CacheCalcFields; + property UpdateBatchSize; + property UpdateAllFields; + end; + + TCustomMSDataSet = class; + TMSUpdateExecuteEvent = procedure (Sender: TCustomMSDataSet; + StatementTypes: TStatementTypes; Params: TMSParams) of object; + + TMSSQLGenerator = class (TDASQLGenerator) + protected + function AssembleSB(const StatementType: TStatementType): string; override; + function GetActualFieldNameEx(FieldDesc: TCRFieldDesc; TableInfo: TCRTableInfo): string; overload; override; + procedure GenerateInsertSQL( + const KeyAndDataFields: TKeyAndDataFields; + const ModifiedFieldsOnly: boolean; + const Index: integer = -1); override; + procedure GenerateUpdateSQL( + const KeyAndDataFields: TKeyAndDataFields; + const ModifiedFieldsOnly: boolean; + const Index: integer = -1); override; + procedure GenerateRefreshSQLSelectPart(const KeyAndDataFields: TKeyAndDataFields); override; + procedure GenerateRefreshSQL( + const KeyAndDataFields: TKeyAndDataFields; + const ModifiedFieldsOnly: boolean); override; + function GetActualFieldName(FldDesc: TCRFieldDesc; IsRefresh: boolean): string; override; + procedure AddFieldToCondition(SB: StringBuilder; FieldDesc: TCRFieldDesc; + const StatementType: TStatementType; + const ModifiedFieldsOnly: boolean; + const Index: integer = -1); override; + + procedure GenerateConditions(SB: StringBuilder; const StatementType: TStatementType; + const ModifiedFieldsOnly: boolean; + const KeyAndDataFields: TKeyAndDataFields; + const Index: integer = -1); override; + end; + + TMSUpdateSQL = class; + + TCustomMSDataSet = class (TCustomDADataSet) + private + function GetConnection: TMSConnection; + procedure SetConnection(Value: TMSConnection); + procedure SetCursorType(const Value: TMSCursorType); + procedure SetCommandTimeout(const Value: integer); + + function GetUpdateObject: TMSUpdateSQL; + procedure SetUpdateObject(Value: TMSUpdateSQL); + protected + { IProviderSupport } + function PSGetKeyFields: string; override; + + protected + FIRecordSet: TOLEDBRecordSet; + FICommand: TOLEDBCommand; + + FLockInitFieldDefs: boolean; //Used to prevent multiple calls to OLE DB Execute on FieldDefs.Update in DT generators + + FBeforeUpdateExecute: TMSUpdateExecuteEvent; + FAfterUpdateExecute: TMSUpdateExecuteEvent; + + FIsAnyFieldDescCanBeModified: boolean; + FTimestampField: TField; + + FOptions: TMSDataSetOptions; + FCursorType: TMSCursorType; + + FCommandTimeout: integer; + + FIsInInitFieldDefs: boolean; + FUseParamType: boolean; + + FCanOpenNext: boolean; + + FAutoRefreshTimer: TWin32Timer; + + { Smart Refresh} + {$IFNDEF STD} + FRefreshServiceBroker: TComponent; + FRefreshQueue: string; + FRefreshService: string; + FAfterSmartRefresh: TDataSetNotifyEvent; + FNeedSmartRefresh: boolean; + {$ENDIF} + + procedure AutoRefreshTimer(Sender: TObject); + + function QuoteName(const AName: string): string; overload; override; + function QuoteName(const AName: string; const LeftQuote, RightQuote: string): string; reintroduce; overload; + + function GetParams: TMSParams; + procedure SetParams(Value: TMSParams); + + procedure CreateIRecordSet; override; + procedure SetIRecordSet(Value: TData); override; + procedure SetNumericType; + + procedure CreateCommand; override; + + function CreateOptions: TDADataSetOptions; override; + procedure SetOptions(Value: TMSDataSetOptions); + + procedure AssignTo(Dest: TPersistent); override; + + procedure BeginConnection(NoConnectCheck: boolean = True); override; + procedure EndConnection; override; + + { Smart Refresh} + {$IFDEF SMART_REFRESH} + {$IFNDEF STD} + procedure RegisterNotification; + procedure UnregisterNotification; + {$ENDIF} + {$ENDIF} + + { Open/Close } + procedure SetActive(Value: Boolean); override; + procedure DataReopen; override; + procedure InternalExecute; override; + procedure InternalOpen; override; + procedure InternalClose; override; + procedure OpenCursor(InfoQuery: boolean); override; + procedure GetFieldsInfo; + function GetRecCount: longint; override; + function GetRecordCount: integer; override; + procedure DoCursorTypeChanged; // Callback from internal level. Called if CursorType or ReadOnly is changed on OLEDB execute + procedure SetFetchAll(Value: boolean); override; + procedure UpdateExecute(const StatementTypes: TStatementTypes); override; + + procedure CheckInactive; override; + + { Fields } + procedure InitFieldDefs; override; + procedure InternalInitFieldDefs; override; + function GetFieldType(DataType: word): TFieldType; override; + function GetFieldClass(FieldType: TFieldType): TFieldClass; override; + {$IFDEF USE_FTAUTOINC} + function GetFieldType(FieldDesc: TFieldDesc): TFieldType; override; + {$ENDIF} + procedure SetNumberRange(FieldDef: TFieldDef); override; + procedure DetectIdentityField; override; + + { Edit } + procedure CreateSQLGenerator; override; + procedure SetReadOnly(Value: boolean); override; + procedure InternalBeforeEdit; override; + procedure GetKeyAndDataFields( + out KeyAndDataFields: TKeyAndDataFields; + const ForceUseAllKeyFields: boolean); override; + + procedure InternalRefreshRecord; override; + procedure CheckUpdateQuery(const StatementType: TStatementType); override; + function UseParamType: boolean; override; //This function indicates ParamType using in PerformSQL + function PerformSQL(const SQL: string; const StatementTypes: TStatementTypes): boolean; override; + + procedure InternalCreateProcCall(Name: string; NeedDescribe: boolean); + + { RefreshQuick} + function IsRefreshQuickField(FieldDesc: TFieldDesc): boolean; override; + procedure SaveMaxRefreshQuickValue(FieldDesc: TFieldDesc; const Value: variant); override; + + function GetCanModify: boolean; override; + + function GetRecord(Buffer: TRecordBuffer; GetMode: TGetMode; DoCheck: boolean): TGetResult; override; + + function NeedReturnParams: boolean; override; + + procedure AssignFieldValue(Param: TDAParam; Field: TField; Old: boolean); override; + { Smart Refresh} + {$IFNDEF STD} + procedure DoSmartRefresh; + {$ENDIF} + + { Navigation } + procedure InternalSetToRecord(Buffer: TRecordBuffer); override; + + procedure DoAfterExecute(Result: boolean); override; + + { Before / After UpdateExecute } + function AssignedBeforeUpdateExecute: boolean; override; + procedure DoBeforeUpdateExecute(Sender: TDataSet; StatementTypes: TStatementTypes; + Params: TDAParams); override; + function AssignedAfterUpdateExecute: boolean; override; + procedure DoAfterUpdateExecute(Sender: TDataSet; StatementTypes: TStatementTypes; + Params: TDAParams); override; + + { SQL Modifications } + function SQLAddWhere(SQLText, Condition: string): string; override; + function SQLDeleteWhere(SQLText: string): string; override; + function SQLGetWhere(SQLText: string): string; override; + function SQLSetOrderBy(SQLText: string; Fields: string): string; override; + function SQLGetOrderBy(SQLText: string): string; override; + +(* procedure SetBeforeFetch(Value: TBeforeFetchEvent); override; + procedure SetAfterFetch(Value: TAfterFetchEvent); override;*) + + procedure SetRefreshOptions(Value: TRefreshOptions); override; + + { XML } + procedure WriteFieldXMLDataType(Field: TField; FieldDesc: TFieldDesc; const FieldAlias: string; + XMLWriter: XMLTextWriter); override; + procedure WriteFieldXMLAttributeType(Field: TField; FieldDesc: TFieldDesc; const FieldAlias: string; + XMLWriter: XMLTextWriter); override; + + public + constructor Create(Owner: TComponent); override; + destructor Destroy; override; + + { Open/Close } + function Fetched: boolean; override; + procedure UnPrepare; override; + function OpenNext: boolean; // Open next rowset in statement. if rowset not returne theh OpenNext return False. If statement has error, then raised exception + procedure BreakExec; + procedure RefreshQuick(const CheckDeleted: boolean); + + function FindParam(const Value: string): TMSParam; + function ParamByName(const Value: string): TMSParam; + + { Edit} + procedure CreateProcCall(Name: string); + + procedure Post; override; + procedure Cancel; override; + + { SQL Modify } + property Connection: TMSConnection read GetConnection write SetConnection; + + property Options: TMSDataSetOptions read FOptions write SetOptions; + + { Edit } + property Params: TMSParams read GetParams write SetParams stored False; + + property CursorType: TMSCursorType read FCursorType write SetCursorType default ctDefaultResultSet; + property CommandTimeout: integer read FCommandTimeout write SetCommandTimeout default 0; + + property BeforeUpdateExecute: TMSUpdateExecuteEvent read FBeforeUpdateExecute write FBeforeUpdateExecute; + property AfterUpdateExecute: TMSUpdateExecuteEvent read FAfterUpdateExecute write FAfterUpdateExecute; + property BeforeFetch; + property AfterFetch; + + property FetchAll: boolean read FFetchAll write SetFetchAll default True; + + property UpdateObject: TMSUpdateSQL read GetUpdateObject write SetUpdateObject; + end; + +{ TMSUpdateSQL } + + TMSUpdateSQL = class (TCustomDAUpdateSQL) + protected + function DataSetClass: TCustomDADataSetClass; override; + function SQLClass: TCustomDASQLClass; override; + end; + +{ TMSQuery } + + TMSQuery = class (TCustomMSDataSet) + protected + procedure SetIRecordSet(Value: TData); override; + + published + property SQLInsert; + property SQLDelete; + property SQLUpdate; + property SQLRefresh; + + property Connection; + property ParamCheck; + property SQL; + property Debug; + property Macros; + property Params; + property FetchRows; + property ReadOnly; + property UniDirectional; + property CachedUpdates; + + property AfterExecute; + property BeforeUpdateExecute; + property AfterUpdateExecute; + property OnUpdateError; + property OnUpdateRecord; + + property UpdateObject; + property RefreshOptions; + + property AutoCalcFields; + property Filtered; + property Filter; + property FilterOptions; + + property BeforeOpen; + property AfterOpen; + property BeforeClose; + property AfterClose; + property BeforeInsert; + property AfterInsert; + property BeforeEdit; + property AfterEdit; + property BeforePost; + property AfterPost; + property BeforeCancel; + property AfterCancel; + property BeforeDelete; + property AfterDelete; + property BeforeScroll; + property AfterScroll; + property OnCalcFields; + property OnDeleteError; + property OnEditError; + property OnFilterRecord; + property OnNewRecord; + property OnPostError; + {$IFNDEF VER4} + property AfterRefresh; + property BeforeRefresh; + {$ENDIF} + + property Options; + property FilterSQL; + + property MasterSource; + property MasterFields; + property DetailFields; + + property UpdatingTable; + + property FetchAll; + property CursorType; + property CommandTimeout; + + property IndexFieldNames; + property Active; /// CR DAC 13049 + property BeforeFetch; + property AfterFetch; + end; + +{ TMSTable } + + TCustomMSTable = class (TCustomMSDataSet) + protected + { IProviderSupport } + function PSGetTableName: string; override; + procedure PSSetParams(AParams: DB.TParams); override; + {$IFDEF VER5P} + procedure PSSetCommandText(const CommandText: string); override; + {$ENDIF} + + protected + FTableName: string; + FOrderFields: string; + + procedure SetTableName(const Value: string); + + procedure SetOrderFields(Value: string); + procedure AssignTo(Dest: TPersistent); override; + + { Open/Close } + procedure OpenCursor(InfoQuery: boolean); override; + + public + { Open/Close } + procedure Prepare; override; + procedure PrepareSQL; + procedure Execute; override; + + property TableName: string read FTableName write SetTableName; + property OrderFields: string read FOrderFields write SetOrderFields; + end; + + TMSTable = class (TCustomMSTable) + published + property TableName; + property OrderFields; + property MasterFields; + property DetailFields; + property MasterSource; + property ReadOnly; + + property Connection; + + property Debug; + property FetchRows; + property UniDirectional; + property CachedUpdates; + + property OnUpdateError; + property OnUpdateRecord; + + property UpdateObject; + property RefreshOptions; + + property Active; + property AutoCalcFields; + property Filtered; + property Filter; + property FilterOptions; + + property BeforeOpen; + property AfterOpen; + property BeforeClose; + property AfterClose; + property BeforeInsert; + property AfterInsert; + property BeforeEdit; + property AfterEdit; + property BeforePost; + property AfterPost; + property BeforeCancel; + property AfterCancel; + property BeforeDelete; + property AfterDelete; + property BeforeScroll; + property AfterScroll; + property OnCalcFields; + property OnDeleteError; + property OnEditError; + property OnFilterRecord; + property OnNewRecord; + property OnPostError; + {$IFNDEF VER4} + property AfterRefresh; + property BeforeRefresh; + {$ENDIF} + property Options; + property FilterSQL; + + property FetchAll; + property CursorType; + property CommandTimeout; + + property IndexFieldNames; + + property BeforeFetch; + property AfterFetch; + end; + +{ TMSStoredProc } + + TCustomMSStoredProc = class (TCustomMSDataSet) + protected + { IProviderSupport } + {$IFDEF VER5P} + procedure PSSetCommandText(const CommandText: string); override; + {$ENDIF} + + protected + FStoredProcName: string; + FIsInPrepare: boolean; + + procedure SetIRecordSet(Value: TData); override; + procedure SetStoredProcName(const Value: string); + procedure AssignTo(Dest: TPersistent); override; + + procedure BeforeOpenCursor(InfoQuery: boolean); override; + procedure BeforeExecute; override; + procedure CreateFieldDefs; override; + + public + procedure ExecProc; // for BDE compatibility + + procedure Prepare; override; + procedure PrepareSQL; + + property UpdatingTable; + property StoredProcName: string read FStoredProcName write SetStoredProcName; + end; + + TMSStoredProc = class(TCustomMSStoredProc) + published + property StoredProcName; + + property SQLInsert; + property SQLDelete; + property SQLUpdate; + property SQLRefresh; + + property Connection; + property ParamCheck stored False; + property SQL; + property Debug; + property Params; + property FetchRows; + property ReadOnly; + property UniDirectional; + property CachedUpdates; + + property AfterExecute; + property BeforeUpdateExecute; + property AfterUpdateExecute; + property OnUpdateError; + property OnUpdateRecord; + + property Options; + property UpdateObject; + property RefreshOptions; + + property Active; + property AutoCalcFields; + property Filtered; + property Filter; + property FilterOptions; + property BeforeOpen; + property AfterOpen; + property BeforeClose; + property AfterClose; + property BeforeInsert; + property AfterInsert; + property BeforeEdit; + property AfterEdit; + property BeforePost; + property AfterPost; + property BeforeCancel; + property AfterCancel; + property BeforeDelete; + property AfterDelete; + property BeforeScroll; + property AfterScroll; + property OnCalcFields; + property OnDeleteError; + property OnEditError; + property OnFilterRecord; + property OnNewRecord; + property OnPostError; + {$IFNDEF VER4} + property AfterRefresh; + property BeforeRefresh; + {$ENDIF} + + property UpdatingTable; + + property FetchAll; + property CursorType; + property CommandTimeout; + end; + +{ TMSSQL } + + TMSSQL = class (TCustomDASQL) + private + function GetConnection: TMSConnection; + procedure SetConnection(Value: TMSConnection); + + function GetParams: TMSParams; + procedure SetParams(Value: TMSParams); + + protected + FICommand: TOLEDBCommand; + FCommandTimeout: integer; + FNonBlocking: boolean; + + function GetPermitPrepare: boolean; + procedure SetPermitPrepare(Value: boolean); + + procedure CreateICommand; override; + procedure SetICommand(Value: TCRCommand); override; + procedure InternalPrepare; override; + procedure InternalExecute(Iters: integer); override; + procedure AssignTo(Dest: TPersistent); override; + + function ParseSQL(const SQL: string; Params: TDAParams; RenamePrefix: string = ''): string; override; + function CreateParser(const Text: string): TParser; override; + procedure AssembleSQL; override; + function CreateParamsObject: TDAParams; override; + procedure CreateParams; override; + procedure WriteParams(WriteValue: boolean = True); override; + procedure ReadParams; override; + + procedure SetCommandTimeout(const Value: integer); + procedure SetNonBlocking(const Value: boolean); + public + constructor Create(Owner: TComponent); override; + procedure Execute(Iters: integer); override; + procedure BreakExec; + + procedure CreateProcCall(Name: string); + published + function FindParam(const Value: string): TMSParam; + function ParamByName(const Value: string): TMSParam; + + property Connection: TMSConnection read GetConnection write SetConnection; + property Params: TMSParams read GetParams write SetParams stored False; + + property ParamCheck; + property SQL; + property Macros; + property Debug; + + property AfterExecute; + property CommandTimeout: integer read FCommandTimeout write SetCommandTimeout; + property NonBlocking: boolean read FNonBlocking write SetNonBlocking default False; + + property PermitPrepare: boolean write SetPermitPrepare stored False; + + end; + +{ TMSMetadata } + + TMSObjectType = (otDatabases, + otColumnPrivileges, otColumns, + otForeignKeys, otPrimaryKeys, + otIndexes, + otServerTypes, + otSchemata, otStatistics, + otStoredProcs, otStoredProcParams, + otAliases, otTables, otSynonyms, otSystemTables, otViews, otGlobalTempTables, otLocalTempTables, otSystemViews, + otAliasesInfo, otTablesInfo, otSynonymsInfo, otSystemTablesInfo, otViewsInfo, otGlobalTempTablesInfo, otLocalTempTablesInfo, otExternalTablesInfo, otSystemViewsInfo, + otTableConstraints, otTablePrivileges, + otLinkedServers, + otAssemblies, + otAssemblyDependencies, + otUserTypes, + otXMLCollections); + + TMSMetadata = class (TCustomMSDataSet) + protected + FObjectType: TMSObjectType; + + FDatabaseName: string; + FSchemaName: string; + FTableName: string; + FStoredProcName: string; + FColumnName: string; + FIndexName: string; + FConstraintName: string; + FLinkedServer: string; + FAssemblyName: string; + FAssemblyID: integer; + FReferencedAssemblyID: integer; + FUDTName: string; + FSchemaCollectionName: string; + FTargetNamespaceURI: string; + + procedure SetDatabaseName(Value: string); + procedure SetSchemaName(Value: string); + procedure SetObjectType(Value: TMSObjectType); + procedure SetTableName(Value: string); + procedure SetStoredProcName(Value: string); + procedure SetColumnName(Value: string); + procedure SetIndexName(Value: string); + procedure SetConstraintName(Value: string); + procedure SetLinkedServer(Value: string); + procedure SetAssemblyName(Value: string); + procedure SetAssemblyID(Value: integer); + procedure SetReferencedAssemblyID(Value: integer); + procedure SetUDTName(Value: string); + procedure SetSchemaCollectionName(Value: string); + procedure SetTargetNamespaceURI(Value: string); + + function RequestIRowset: IRowset; + procedure InternalExecute; override; + procedure OpenCursor(InfoQuery: boolean); override; + + public + constructor Create(Owner: TComponent); override; + + published + property ObjectType: TMSObjectType read FObjectType write SetObjectType default otDatabases; + + property DatabaseName: string read FDatabaseName write SetDatabaseName; + property SchemaName: string read FSchemaName write SetSchemaName; + property TableName: string read FTableName write SetTableName; + property StoredProcName: string read FStoredProcName write SetStoredProcName; + property ColumnName: string read FColumnName write SetColumnName; + property IndexName: string read FIndexName write SetIndexName; + property ConstraintName: string read FConstraintName write SetConstraintName; + + property LinkedServer: string read FLinkedServer write SetLinkedServer; + property AssemblyName: string read FAssemblyName write SetAssemblyName; + property AssemblyID: integer read FAssemblyID write SetAssemblyID default 0; + property ReferencedAssemblyID: integer read FReferencedAssemblyID write SetReferencedAssemblyID default 0; + property UDTName: string read FUDTName write SetUDTName; + property SchemaCollectionName: string read FSchemaCollectionName write SetSchemaCollectionName; + property TargetNamespaceURI: string read FTargetNamespaceURI write SetTargetNamespaceURI; + + property Active; + property Connection; + end; + + TMSSchemaCollection = record + Name: string; + CatalogName: string; + SchemaName: string; + end; + + TMSXMLField = class(TField) + protected + FTyped: boolean; + FSchemaCollection: TMSSchemaCollection; + procedure GetText(var Text: string; DisplayText: Boolean); override; + procedure SetSchemaCollection(Name, CatalogName, SchemaName: string); + + function GetBlobSize: Integer; + // function GetModified: Boolean; + // procedure SetModified(Value: Boolean); + public + constructor Create(AOwner: TComponent); override; + + // Copied from TBlobField + // procedure Assign(Source: TPersistent); override; + procedure Clear; override; + class function IsBlob: Boolean; override; + procedure LoadFromFile(const FileName: string); + procedure LoadFromStream(Stream: TStream); + procedure SaveToFile(const FileName: string); + procedure SaveToStream(Stream: TStream); + procedure SetFieldType(Value: TFieldType); override; + property BlobSize: Integer read GetBlobSize; + // property Modified: Boolean read GetModified write SetModified; + property Value: string read GetAsString write SetAsString; + + property XML: string read GetAsString write SetAsString; + property Typed: boolean read FTyped; + property SchemaCollection: TMSSchemaCollection read FSchemaCollection; + published + // property Transliterate: Boolean read FTransliterate write FTransliterate default True; + // property Size default 0; + end; + +{ TMSDataSource } + + TMSDataSource = class(TCRDataSource) + end; + + TMSAccessUtils = class + public + class procedure GetKeyAndDataFields( + Obj: TCustomMSDataSet; + out KeyAndDataFields: TKeyAndDataFields; + const ForceUseAllKeyFields: boolean); + class procedure SetDesigning(Obj: TCustomMSDataSet; Value: Boolean; SetChildren: Boolean = True); + class procedure SetLockLoginPromt(Obj: TMSConnection; Value: Boolean); + + class function FIConnection(Obj: TMSConnection): TOLEDBConnection; + class function FIRecordSet(Obj: TCustomMSDataSet): TOLEDBRecordSet; + + class function GetOLEDBSQL(Obj: TCustomMSDataSet): string; overload; + class function GetOLEDBSQL(Obj: TMSSQL): string; overload; + + class function FIDBCreateSession(Obj: TOLEDBConnection): IDBCreateSession; + + class procedure DoError(Obj: TMSConnection; E: Exception; var Fail: boolean); + end; + + procedure GetServerList(List: TStrings); + procedure GetDatabasesList(const Connection: TMSconnection; List: TStrings); + procedure GetTablesList(const Connection: TMSconnection; List: TStrings); + + function IsLargeDataTypeUsed(const Field: TField): boolean; overload; + + function TableNamesFromList(List: TStrings): string; + procedure TableNamesToList(Value: string; List: TStrings); + +var + DefConnectDialogClassProc: function: TClass = nil; + CurrentProjectOutputDir: string; + __UseUpdateOptimization: boolean; + + +implementation + +{ $DEFINE SMART_REFRESH} + +uses +{$IFDEF CLR} + System.Runtime.InteropServices, System.Reflection, +{$ENDIF} +{$IFDEF VER7P} + StrUtils, +{$ENDIF} +{$IFDEF VER6P} +{$IFNDEF CLR} + Variants, +{$ENDIF} +{$ELSE} + comobj, +{$ENDIF} + DBCommon, DBConsts, MSParser, Registry, ActiveX, MSSQLMonitor, Math, DBMonitorIntf, + MSConnectionPool, CRConnectionPool, +{$IFDEF SMART_REFRESH} +{$IFNDEF STD} + MSServiceBroker, +{$ENDIF} +{$ENDIF} + Messages; + +{$IFDEF SMART_REFRESH} +{$IFNDEF STD} +const + sSdacService = '__SdacNotificationService'; + sSdacQueue = '__SdacNotificationQueue'; + +type + TMSRefreshServiceBroker = class(TMSServiceBroker) + private + FDataSet: TCustomMSDataSet; + FErrorCount: integer; + protected + procedure OnThreadEvent(Sender: TObject; Event: TObject; var Cancel: boolean); override; + procedure OnThreadMessage(Sender: TObject; Event: TObject); override; + public + procedure Start; override; + end; + +{ TMSRefreshServiceBroker } + +procedure TMSRefreshServiceBroker.OnThreadEvent(Sender: TObject; Event: TObject; var Cancel: boolean); + + procedure CheckQNError(Source, Info: string); + begin + if Source = 'statement' then begin + if Info = 'query' then + DatabaseError(SInvalidQNStatement) + else + if Info = 'invalid' then + DatabaseError(SStatementNotSupported) + else + if Info = 'set options' then + DatabaseError(SInvalidQNSetOptions) + else + if Info = 'isolation' then + DatabaseError(SInvalidQNIsolation) + else + if Info = 'query template limit' then + DatabaseError(STemplateLimit); + end + else + if Source = 'timeout' then + DatabaseError(SSubscriptionTimedOut) + else + if Source = 'object' then begin + if Info = 'drop' then + DatabaseError(SQNObjectDropped) + else + if Info = 'alter' then + DatabaseError(SQNObjectAltered) + end + else + if Source = 'system' then begin + if Info = 'restart' then + DatabaseError(SSQLServerStarted) + else + if Info = 'error' then + DatabaseError(SSQLInternalError) + else + if Info = 'resource' then + DatabaseError(SSubscriptionRemoved) + end; + end; + +begin + inherited; + + if TMSServiceBrokerMsg(Event).MessageProperties.QNMessage <> GetComponentName(FDataSet) then + Cancel := True + else + try + // Check Query Notification Error + CheckQNError(TMSServiceBrokerMsg(Event).MessageProperties.QNSource, TMSServiceBrokerMsg(Event).MessageProperties.QNInfo); + except + if FErrorCount >= 1 then begin + // FDataSet.UnregisterNotification + raise; + end + else + Inc(FErrorCount); + Cancel := True; + end; +end; + +procedure TMSRefreshServiceBroker.OnThreadMessage(Sender: TObject; Event: TObject); +begin + Event.Free; + FDataSet.DoSmartRefresh; +end; + +procedure TMSRefreshServiceBroker.Start; +begin + FErrorCount := 0; + inherited; +end; +{$ENDIF} +{$ENDIF} + +{$IFNDEF VER6P} +const + varShortInt = $0010; { vt_i1 } + varWord = $0012; { vt_ui2 } + varLongWord = $0013; { vt_ui4 } + varInt64 = $0014; { vt_i8 } +{$ENDIF} + +function IsLargeDataTypeUsed(const Field: TField): boolean; overload; +begin + Result := + (Field is TBlobField) or + ((Field is TMemoField) and (TMemoField(Field).BlobSize > MaxNonBlobFieldLen)); +end; + +function IsLargeDataTypeUsed(const Param: TParam): boolean; overload; +begin + Result := + (Param.DataType = ftBlob) + or (Param.DataType = ftMemo) + {$IFDEF VER10P} + or (Param.DataType = ftWideMemo) + {$ENDIF}; +end; + +function TableNamesFromList(List: TStrings): string; +var + i: integer; +begin + for i := 0 to List.Count - 1 do + if i = 0 then + Result := BracketIfNeed(List[i]) + else + Result := Result + ', ' + BracketIfNeed(List[i]); +end; + +procedure TableNamesToList(Value: string; List: TStrings); +var + St: string; + i: integer; +begin + Value := Trim(Value); + List.Clear; + + St := ''; + for i := 1 to Length(Value) do + if (Value[i] = ',') or (Value[i] = ';') then begin + St := UnbracketIfPossible(Trim(St)); + if St <> '' then + List.Add(St); + St := ''; + end + else + St := St + Value[i]; + + St := UnbracketIfPossible(Trim(St)); + if St <> '' then + List.Add(St); +end; + +function GetFieldType(DataType: word): TFieldType; +begin + case DataType of + dtInt64: + Result := ftLargeInt; + dtWord: + Result := ftWord; + dtBoolean: + Result := ftBoolean; + dtCurrency: + Result := ftCurrency; + dtBytes: + Result := ftBytes; + dtVarBytes: + Result := ftVarBytes; + dtMSXML: + Result := TFieldType(ftMSXML); + {$IFDEF VER5P} +{ dtVariant: + Result := ftVariant;} +{ dtIUnknown: + Result := ftInterface;} + {$ENDIF} + else + Result := MemDS.GetFieldType(DataType); + end; +end; + +function GetDataType(FieldType: TFieldType): word; +begin + if Integer(FieldType) = ftMSXML then + Result := dtMSXML + else + Result := MemDS.GetDataType(FieldType); +end; + +function SetWhere(SQL: string; Condition: string): string; +begin + Result := _SetWhere(SQL, Condition, TMSParser, True, lxSELECT, lxWHERE); +end; + +function AddWhere(SQL: string; Condition: string): string; +begin + Result := _AddWhere(SQL, Condition, TMSParser, False, lxSELECT, lxWHERE); +end; + +function DeleteWhere(SQL: string): string; +begin + Result := SetWhere(SQL, ''); +end; + +function GetWhere(SQL: string): string; +begin + Result := _GetWhere(SQL, TMSParser, False, lxSELECT, lxWHERE); +end; + +function SetOrderBy(SQL: string; Fields: string): string; +begin + Result := _SetOrderBy(SQL, Fields, TMSParser, lxSELECT, lxORDER, lxBY); +end; + +function GetOrderBy(SQL: string): string; +begin + Result := _GetOrderBy(SQL, TMSParser, lxSELECT, lxORDER, lxBY); +end; + +procedure GetServerList(List: TStrings); + procedure GetServerListByReg; + var + Reg: TRegistry; + i: integer; + Value: string; + sl: tstringlist; + begin + Reg := TRegistry.Create; + sl := TStringList.Create; + try + Reg.RootKey := HKEY_Local_Machine; + if Reg.OpenKeyReadOnly('SOFTWARE\Microsoft\MSSQLServer\Client\ConnectTo') then begin + Reg.GetValueNames(sl); + + // Delete non-server occurences + for i := sl.Count - 1 downto 0 do begin + Value := Reg.ReadString(sl[i]); + if Pos(',', Value) = 0 then + sl.Delete(i); + end; + + sl.Sort; + List.AddStrings(sl); + end; + finally + Reg.Free; + sl.Free; + end; + end; + + procedure GetServerListByOleDBEnum; + var + SourcesRowset: ISourcesRowset; + Rowset: IRowset; + ds: TCustomMSDataset; + iu: IUnknown; + begin + if CoCreateInstance(CLSID_SQLOLEDB_ENUMERATOR, + nil, + CLSCTX_INPROC_SERVER, + IID_ISourcesRowset, + SourcesRowset) <> S_OK then + Exit; + + if SourcesRowset.GetSourcesRowset(nil, IID_IRowset, 0, nil, iu) <> S_OK then + Exit; + + Rowset := IRowset(iu); + ds := TCustomMSDataSet.Create(nil); + try + TDBAccessUtils.SetLockDebug(ds, True); // To prevent AV on TCustomDADataSet.OpenCursor -> UsedConnection.SQLMonitorClass + ds.FIRecordSet.SetIRowset(Rowset, False); + ds.Open; + + while not ds.Eof do begin + List.Add(ds.Fields[0].AsString); + ds.Next; + end; + finally + ds.Free; + end; + end; + +begin + List.Clear; + GetServerListByOleDBEnum; + GetServerListByReg; +end; + +procedure GetDatabasesList(const Connection: TMSconnection; List: TStrings); +begin + if Connection = nil then + Exit; + + Connection.GetDatabaseNames(List); +end; + +procedure GetTablesList(const Connection: TMSconnection; List: TStrings); +begin + if Connection = nil then + Exit; + + Connection.GetTableNames(List); +end; + +{ TMSParam } + +constructor TMSParam.Create(Collection: TCollection); +begin + inherited Create(Collection); + + Bound := True; +end; + +procedure TMSParam.SetAsString(Value: string); +begin + if not (DataType in [ftBytes, ftVarBytes]) then + inherited + else + Self.Value := Value; +end; + +procedure TMSParam.SetAsWideString(Value: WideString); +begin + if not (DataType in [ftBytes, ftVarBytes]) then + inherited + else + Self.Value := Value; +end; + +function TMSParam.GetSize: integer; +begin + if DataType in FieldTypesWithSize then begin + if inherited GetSize > 0 then + Result := inherited GetSize + else + if (DataType in [ftBytes, ftVarBytes]) and VarIsArray(Value) then + {$IFDEF CLR} + Result := VarArrayHighBound(Value, 1) - VarArrayLowBound(Value, 1) + 1 + {$ELSE} + Result := TVarData(Value).VArray.Bounds[0].ElementCount + {$ENDIF} + else + Result := Length(GetAsString); + end + else + Result := 0; +end; + +procedure TMSParam.SetSize(Value: integer); +begin + if DataType in FieldTypesWithSize then + inherited; +end; + +procedure TMSParam.SetAsVariant(const Value: Variant); +var + l, lold: integer; +begin + inherited; + if (DataType in FieldTypesWithSize) and not (VarIsNull(Value) or VarIsEmpty(Value)) then begin + lold := inherited GetSize; + if lold > 0 then begin + {$IFDEF CLR} + if VarType(Value) = varArray + varByte then + l := Length(TBytes(Value)) + else + {$ENDIF} + l := Length(Value); + if l > lold then + inherited SetSize(l); + end; + end; + Bound := True; +end; + +procedure TMSParam.CreateObject; +begin + Assert(FParamObject = nil); + if (DataType in [ftBlob, ftMemo{$IFDEF VER10P}, ftWideMemo{$ENDIF}]) or (DataType = TFieldType(ftMSXML)) then + {$IFDEF HAVE_COMPRESS} + FParamObject := TCompressedBlob.Create; + {$ELSE} + FParamObject := {$IFDEF CLR}CoreLab.Dac.MemData.{$ENDIF}TBlob.Create; + {$ENDIF} +end; + +function TMSParam.IsObjectDataType: boolean; +begin + Result := inherited IsObjectDataType; +end; + +procedure TMSParam.AssignFieldValue(Field: TField; const Value: Variant); +var + FieldDesc: TOLEDBFieldDesc; +begin + inherited AssignFieldValue(Field, Value); + + if IsClass(Field.DataSet, TCustomMSDataSet) then begin + FieldDesc := TOLEDBFieldDesc(TCustomDADataSet(Field.DataSet).GetFieldDesc(Field)); + OLEDBType := FieldDesc.OLEDBType; + end; +end; + +{ TMSParams } + +constructor TMSParams.Create(Owner: TPersistent); +begin + inherited Create(TMSParam); + + FOwner := Owner; + FNeedsUpdateItem := True; +end; + +procedure TMSParams.Assign(Source: TPersistent); +var + i: integer; +begin + inherited; + + if Source is TMSParams then + for i := 0 to Count - 1 do + TMSParams(Source)[i].Assign(Items[i]); +end; + +function TMSParams.GetItem(Index: Integer): TMSParam; +begin + Result := inherited Items[Index] as TMSParam; +end; + +procedure TMSParams.SetItem(Index: Integer; Value: TMSParam); +begin + inherited SetItem(Index, Value); +end; + +function TMSParams.ParamByName(const Value: string): TMSParam; +begin + Result := TMSParam(inherited ParamByName(GetParamNameWODog(Value))); +end; + +function TMSParams.FindParam(const Value: string): TMSParam; +begin + Result := TMSParam(inherited FindParam(GetParamNameWODog(Value))); +end; + +{ TMSConnectionOptions } + +procedure TMSConnectionOptions.AssignTo(Dest: TPersistent); +begin + inherited; + + if Dest is TMSConnectionOptions then begin + TMSConnectionOptions(Dest).QuotedIdentifier := QuotedIdentifier; + TMSConnectionOptions(Dest).Language := Language; + TMSConnectionOptions(Dest).Encrypt := Encrypt; + TMSConnectionOptions(Dest).PersistSecurityInfo := PersistSecurityInfo; + TMSConnectionOptions(Dest).AutoTranslate := AutoTranslate; + TMSConnectionOptions(Dest).NetworkLibrary := NetworkLibrary; + TMSConnectionOptions(Dest).PacketSize := PacketSize; + TMSConnectionOptions(Dest).ApplicationName := ApplicationName; + TMSConnectionOptions(Dest).WorkstationID := WorkstationID; + TMSConnectionOptions(Dest).Provider := Provider; + TMSConnectionOptions(Dest).FailoverPartner := FailoverPartner; + end; +end; + +constructor TMSConnectionOptions.Create(Owner: TMSConnection); +begin + inherited Create(Owner); + + FQuotedIdentifier := True; + FPacketSize := DefaultPacketSize; + FAutoTranslate := True; + FProvider := prAuto; + //FMaxDatabaseSize := 128; + FFailoverPartner := ''; +end; + +procedure TMSConnectionOptions.SetEncrypt(const Value: boolean); +begin + if FEncrypt <> Value then begin + TMSConnection(FOwner).CheckInactive; + FEncrypt := Value; + if TMSConnection(FOwner).IConnection <> nil then + TMSConnection(FOwner).IConnection.SetProp(prEncrypt, Value); + end; +end; + +procedure TMSConnectionOptions.SetPersistSecurityInfo(const Value: boolean); +begin + if FPersistSecurityInfo <> Value then begin + TMSConnection(FOwner).CheckInactive; + FPersistSecurityInfo := Value; + if TMSConnection(FOwner).IConnection <> nil then + TMSConnection(FOwner).IConnection.SetProp(prPersistSecurityInfo, Value); + end; +end; + +procedure TMSConnectionOptions.SetAutoTranslate(const Value: boolean); +begin + if FAutoTranslate <> Value then begin + TMSConnection(FOwner).CheckInactive; + FAutoTranslate := Value; + if TMSConnection(FOwner).IConnection <> nil then + TMSConnection(FOwner).IConnection.SetProp(prAutoTranslate, Value); + end; +end; + +procedure TMSConnectionOptions.SetLanguage(const Value: string); +begin + if FLanguage <> Value then begin + TMSConnection(FOwner).CheckInactive; + FLanguage := Value; + if TMSConnection(FOwner).IConnection <> nil then + TMSConnection(FOwner).IConnection.SetProp(prLanguage, Value); + end; +end; + +procedure TMSConnectionOptions.SetNetworkLibrary( + const Value: string); +begin + if FNetworkLibrary <> Value then begin + TMSConnection(FOwner).CheckInactive; + FNetworkLibrary := Value; + if TMSConnection(FOwner).IConnection <> nil then + TMSConnection(FOwner).IConnection.SetProp(prNetworkLibrary, Value); + end; +end; + +procedure TMSConnectionOptions.SetApplicationName( + const Value: string); +begin + if FApplicationName <> Value then begin + TMSConnection(FOwner).CheckInactive; + FApplicationName := Value; + if TMSConnection(FOwner).IConnection <> nil then + TMSConnection(FOwner).IConnection.SetProp(prApplicationName, Value); + end; +end; + +procedure TMSConnectionOptions.SetWorkstationID( + const Value: string); +begin + if FWorkstationID <> Value then begin + TMSConnection(FOwner).CheckInactive; + FWorkstationID := Value; + if TMSConnection(FOwner).IConnection <> nil then + TMSConnection(FOwner).IConnection.SetProp(prWorkstationID, Value); + end; +end; + +procedure TMSConnectionOptions.SetPacketSize(const Value: integer); +begin + if FPacketSize <> Value then begin + TMSConnection(FOwner).CheckInactive; + FPacketSize := Value; + if TMSConnection(FOwner).IConnection <> nil then + TMSConnection(FOwner).IConnection.SetProp(prPacketSize, Value); + end; +end; + +procedure TMSConnectionOptions.SetProvider(const Value: TOLEDBProvider); +begin + if FProvider <> Value then begin + TMSConnection(FOwner).CheckInactive; + FProvider := Value; + if TMSConnection(FOwner).IConnection <> nil then + TMSConnection(FOwner).IConnection.SetProp(prProvider, Integer(Value)); + if (Value = prCompact) and (TMSConnection(FOwner).Database = DefaultSDACDatabase) then + TMSConnection(FOwner).Database := '' + else + if (Value <> prCompact) and (TMSConnection(FOwner).Database = '') then + TMSConnection(FOwner).Database := DefaultSDACDatabase; + end; +end; + +procedure TMSConnectionOptions.SetNumericType(Value: TDANumericType); +begin + if FNumericType <> Value then begin + TMSConnection(FOwner).CheckInactive; + FNumericType := Value; + end; +end; + +procedure TMSConnectionOptions.SetQuotedIdentifier(const Value: boolean); +begin + if FQuotedIdentifier <> Value then begin + // CheckInactive is not need + + FQuotedIdentifier := Value; + if TMSConnection(FOwner).IConnection <> nil then + TMSConnection(FOwner).IConnection.SetProp(prQuotedIdentifier, Value); + end; +end; + +procedure TMSConnectionOptions.SetInitialFileName(const Value: string); +begin + if FInitialFileName <> Value then begin + TMSConnection(FOwner).CheckInactive; + FInitialFileName := Value; + if TMSConnection(FOwner).IConnection <> nil then + TMSConnection(FOwner).IConnection.SetProp(prInitialFileName, Value); + end; +end; + +procedure TMSConnectionOptions.SetMultipleActiveResultSets(const Value: boolean); +begin + if FMultipleActiveResultSets <> Value then begin + TMSConnection(FOwner).CheckInactive; + FMultipleActiveResultSets := Value; + if TMSConnection(FOwner).IConnection <> nil then + TMSConnection(FOwner).IConnection.SetProp(prMARS, Value); + end; +end; + +(*procedure TMSConnectionOptions.SetMaxDatabaseFile(const Value: integer); +begin + if FMaxDatabaseSize <> Value then begin + TMSConnection(FOwner).CheckInactive; + FMaxDatabaseSize := Value; + if TMSConnection(FOwner).IConnection <> nil then + TMSConnection(FOwner).IConnection.SetProp(prMaxDatabaseSize, Value); + end; +end;*) + +procedure TMSConnectionOptions.SetFailoverPartner(const Value: string); +begin + if FFailoverPartner <> Value then begin + TMSConnection(FOwner).CheckInactive; + FFailoverPartner := Value; + if TMSConnection(FOwner).IConnection <> nil then + TMSConnection(FOwner).IConnection.SetProp(prFailoverPartner, Value); + end; +end; + +{ TMSConnection } + +constructor TMSConnection.Create(Owner: TComponent); +begin + inherited; + + FLockLoginPrompt := False; + + Database := DefaultSDACDatabase; + IsolationLevel := ilReadCommitted; + Authentication := auServer; + // MultipleConnections := True; + + ConnectionTimeout := DefaultConnectionTimeout; + FOptions := inherited Options as TMSConnectionOptions; +end; + +destructor TMSConnection.Destroy; +begin + FMSSQL.Free; + + inherited; +end; + +function TMSConnection.CreateOptions: TDAConnectionOptions; +begin + Result := TMSConnectionOptions.Create(Self); +end; + +function TMSConnection.IConnection: TOLEDBConnection; +begin + Result := TOLEDBConnection(FIConnection); +end; + +function TMSConnection.IsCaseSensitive: boolean; +begin + Result := False; +end; + +procedure TMSConnection.Check(const Status: HRESULT; Sender: TObject); +begin + Assert(FIConnection <> nil); + TOLEDBConnection(FIConnection).Check(Status, Sender); +end; + +procedure TMSConnection.CheckInactive; +begin + if Connected then + if ([csUpdating, csDesigning] * ComponentState) <> [] then + Close + else + DatabaseError(SConnectionOpen, Self); +end; + +procedure TMSConnection.InternalStartTransaction; +begin + inherited; + + if {Assigned(OnConnectionLost) and} + ((TOLEDBCOnnection(FIConnection).DBMSPrimaryVer <= 8) or (TOLEDBCOnnection(FIConnection).ProviderPrimaryVer <= 8))and + not (Options.Provider = prCompact) then begin + FTransactionID := ''; + ExecSQL(SCheckConnection, []); + end; + FTransactionID := 'Local'; +end; + + +function TMSConnection.CommitOnDisconnect: boolean; +begin + Result := False; +end; + +function TMSConnection.GetConnectString: string; + + procedure AddParam(const ParamName: string; const Value: string; const DefValue: string); + begin + if Value <> DefValue then begin + if Result <> '' then + Result := Result + ';'; + Result := Result + ParamName + '=' + Value; + end; + end; + +begin + Result := ''; + + /// list of supported parameters must be syncronized with SetConnectString (ProcessParam and set param to default) + if Options.FProvider <> prAuto then + AddParam('Provider', GetProviderName(Options.FProvider), ''); + AddParam('User ID', UserName, ''); + AddParam('Password', Password, ''); + if Options.Provider <> prCompact then begin + AddParam('Data Source', Server, ''); + AddParam('Initial Catalog', Database, DefaultSDACDatabase); + end + else + AddParam('Data Source', '"' + Database + '"', ''); + AddParam('Connect Timeout', IntToStr(ConnectionTimeout), IntToStr(DefaultConnectionTimeout)); + AddParam('Use Encryption for Data', BoolToStr(Options.Encrypt, True), 'False'); + AddParam('Persist Security Info', BoolToStr(Options.PersistSecurityInfo, True), 'False'); + AddParam('Auto Translate', BoolToStr(Options.AutoTranslate, True), 'True'); + AddParam('Packet Size', IntToStr(Options.PacketSize), IntToStr(DefaultPacketSize)); + AddParam('Application Name', Options.ApplicationName, ''); + AddParam('Workstation ID', Options.WorkstationID, ''); + AddParam('Current Language', Options.Language, ''); + AddParam('Network Library', Options.NetworkLibrary, ''); + if Options.InitialFileName <> '' then + AddParam('AttachDBFileName', Options.InitialFileName, ''); + AddParam('MultipleActiveResultSets', BoolToStr(Options.MultipleActiveResultSets, True), 'False'); + //AddParam('Max Database Size', IntToStr(Options.MaxDatabaseSize), '128'); + if Options.FailoverPartner <> '' then + AddParam('Failover Partner', Options.FailoverPartner, ''); + + if Authentication = auWindows then + Result := Result + ';Integrated Security=SSPI'; + +{ if Password <> '' then + Result := Result + ';Persist Security Info=True';} + +end; + +procedure TMSConnection.SetConnectString(Value: string); +var + IntegratedSecuritySSPI: boolean; + + procedure ParseIniString; + procedure ProcessParam(const paramName, paramValue: string); + function Recognized(const Args: array of string): boolean; + var + i: integer; + begin + Result := False; + for i := 0 to Length(Args) - 1 do begin + Result := SameText(paramName, Args[i]); + if Result then + Break; + end; + end; + + var + s: string; + + begin + /// list of supported parameters must be syncronized with GetConnectString and dbxsda.ParseIniString + if Recognized(['Provider']) then begin + s := UpperCase(paramValue); + if (s <> SSQLOLEDB) and (s <> SSQLNativeClient) and (s <> SSQLEverywhere) then + raise Exception.CreateFmt(SBadParamValue, [paramName, paramValue]); + Options.Provider := GetProvider(s); + end + else + if Recognized(['User ID', 'UID', 'Username']) then + UserName := paramValue + else + if Recognized(['Password', 'PWD']) then + Password := paramValue + else + if Recognized(['Data Source', 'Server']) then begin + if Options.Provider <> prCompact then + Server := paramValue + else + Database := paramValue; + end + else + if Recognized(['Initial Catalog', 'Database']) then + Database := paramValue + else + if Recognized(['Connect Timeout', 'ConnectTimeout', 'Timeout']) then + ConnectionTimeout := StrToInt(paramValue) + else + if Recognized(['Use Encryption for Data', 'Encryption', 'Encrypt']) then + Options.Encrypt := {$IFDEF VER6}MemUtils.{$ENDIF}StrToBool(paramValue) + else + if Recognized(['PersistSecurityInfo', 'Persist Security Info']) then + Options.PersistSecurityInfo := {$IFDEF VER6}MemUtils.{$ENDIF}StrToBool(paramValue) + else + if Recognized(['AutoTranslate', 'Auto Translate']) then + Options.AutoTranslate := {$IFDEF VER6}MemUtils.{$ENDIF}StrToBool(paramValue) + else + if Recognized(['Packet Size', 'PacketSize']) then + Options.PacketSize := StrToInt(paramValue) + else + if Recognized(['Current Language', 'Language']) then + Options.Language := paramValue + else + if Recognized(['Network Library', 'Network', 'NetworkLibrary', 'NetLibrary']) then + Options.NetworkLibrary := paramValue + else + if Recognized(['ApplicationName', 'Application Name', 'AppName']) then + Options.ApplicationName := paramValue + else + if Recognized(['WorkstationID', 'Workstation ID', 'WSID']) then + Options.WorkstationID := paramValue + else + if Recognized(['Integrated Security', 'Trusted_Connection']) then begin + if paramValue = 'SSPI' then + IntegratedSecuritySSPI := True + else + if not TryStrToBool(paramValue, IntegratedSecuritySSPI) then + raise Exception.CreateFmt(SBadParamValue, [paramName, paramValue]); + end + else + if Recognized(['AttachDBFileName', 'InitialFileName', 'InitFileName']) then + Options.InitialFileName := paramValue + else + if Recognized(['MultipleActiveResultSets', 'Multiple Active Result Sets', 'MARS Connection', 'MARS']) then + Options.MultipleActiveResultSets := {$IFDEF VER6}MemUtils.{$ENDIF}StrToBool(paramValue) + else + //if Recognized(['Max Database Size']) then + // Options.MaxDatabaseSize := StrToInt(paramValue) + //else + if Recognized(['Failover Partner', 'Failover_Partner']) then + Options.FailoverPartner := paramValue + else + if Recognized([ + 'Persist Security Info', + 'Use Procedure for Prepare', + 'Asynchronous Connection', + 'Client Failover', + 'Tag with column collation when possible']) then + // ignored + else + raise Exception.CreateFmt(SParamNameUnknown, [paramName]); + end; + + var + i, l: integer; + cs: string; + inString, inValue, allowSpaces: boolean; + newIndex, startIndex: integer; + paramName, paramValue: string; + csLength: integer; + + begin + cs := Trim(Value); + + // parse connection string + startIndex := 1; + paramName := ''; + paramValue := ''; + + csLength := Length(cs); + + while startIndex < csLength do begin + // look for param name + newIndex := PosEx('=', cs, startIndex); + if newIndex > 0 then begin + paramName := Trim(Copy(cs, startIndex, newIndex - startIndex)); + if paramName = '' then + raise Exception.Create(SParamNameMissing); + end; + + // look for param value + inString := False; + inValue := False; // Shows that we are parsing non-quoted value. Must be single word. + allowSpaces := True; // Brought in to avoid two-word non-quoted values. + + for i := newIndex + 1 to csLength do begin + if cs[i] = '"' then + inString := not inString + else + if not inString then begin + if cs[i] = ';' then begin + paramValue := Trim(Copy(cs, newIndex + 1, i - newIndex - 1)); + break; + end + else + if cs[i] <= ' ' then begin + if inValue then + // no more spaces are allowed + allowSpaces := False; + end + else + // check whether char is valid for non-quoted param value + case cs[i] of + '!'..'/', '\', '_', '@', '0'..'9', 'a'..'z', 'A'..'Z': + begin + inValue := True; + if not allowSpaces then + raise Exception.Create(SInvalidChar); + end + else + raise Exception.Create(SInvalidChar); + end; + end; + + if i = csLength then + paramValue := Trim(Copy(cs, newIndex + 1, i - newIndex)); + end; + + if paramValue = '' then + raise Exception.Create(SParamValueMissing); + + l := Length(paramValue); + if (l >= 2) and (paramValue[1] = '"') and (paramValue[l] = '"') then + paramValue := Trim(Copy(paramValue, 2, l - 2)); + + ProcessParam(paramName, paramValue); + + startIndex := i + 1; + end; + end; + +var + OldCS: string; + +begin + OldCS := ConnectString; + try + UserName := ''; + Password := ''; + Server := ''; + Database := DefaultSDACDatabase; + // bug in editor - ConnectionTimeout is not returned; + // ConnectionTimeout := DefaultConnectionTimeout; + Options.Encrypt := False; + Options.PersistSecurityInfo := False; + Options.AutoTranslate := True; + Options.PacketSize := DefaultPacketSize; + Options.Language := ''; + Options.NetworkLibrary := ''; + Options.Provider := prAuto; + Options.InitialFileName := ''; + Options.MultipleActiveResultSets := False; + Authentication := auServer; + //Options.MaxDatabaseSize := 128; + Options.FailoverPartner := ''; + + IntegratedSecuritySSPI := False; + ParseIniString; + + if IntegratedSecuritySSPI then + Authentication := auWindows; + except + ConnectString := OldCS; + raise; + end; +end; + +procedure TMSConnection.CreateIConnection; +var + CRConnection: TCRConnection; +begin + if FIConnection <> nil then + Exit; + + CRConnection := GetOLEDBConnection; + SetIConnection(CRConnection); +end; + +procedure TMSConnection.SetIConnection(Value: TCRConnection); +begin + inherited; + + FIConnection := Value as TOLEDBConnection; + + Database := FDatabase; // To prevent empty value + if FIConnection <> nil then + TOLEDBConnection(FIConnection).OnInfoMessage := DoInfoMessage; +end; + +function TMSConnection.GetIConnectionClass: TCRConnectionClass; +begin + Result := TOLEDBConnection; +end; + +function TMSConnection.GetICommandClass: TCRCommandClass; +begin + Result := TOLEDBCommand; +end; + +function TMSConnection.GetIRecordSetClass: TCRRecordSetClass; +begin + Result := TOLEDBRecordSet; +end; + +procedure TMSConnection.SetOptions(Value: TMSConnectionOptions); +begin + FOptions.Assign(Value); +end; + +function TMSConnection.GetOLEDBConnection: TOLEDBConnection; +var + ConnectionParameters: TMSConnectionParameters; +begin + if Pooling then begin + ConnectionParameters := TMSConnectionParameters.Create; + try + ConnectionParameters.MinPoolSize := PoolingOptions.MinPoolSize; + ConnectionParameters.MaxPoolSize := PoolingOptions.MaxPoolSize; + ConnectionParameters.ConnectionLifeTime := PoolingOptions.ConnectionLifetime; + ConnectionParameters.Validate := PoolingOptions.Validate; + ConnectionParameters.Username := Username; + ConnectionParameters.Server := Server; + ConnectionParameters.Password := Password; + + ConnectionParameters.Database := Database; + ConnectionParameters.IsolationLevel := IsolationLevel; + ConnectionParameters.Authentication := Authentication; + + ConnectionParameters.QuotedIdentifier := Options.QuotedIdentifier; + ConnectionParameters.Language := Options.Language; + ConnectionParameters.Encrypt := Options.Encrypt; + ConnectionParameters.PersistSecurityInfo := Options.PersistSecurityInfo; + ConnectionParameters.AutoTranslate := Options.AutoTranslate; + ConnectionParameters.NetworkLibrary := Options.NetworkLibrary; + ConnectionParameters.ApplicationName := Options.ApplicationName; + ConnectionParameters.WorkstationID := Options.WorkstationID; + ConnectionParameters.PacketSize := Options.PacketSize; + ConnectionParameters.Provider := Options.FProvider; + Result := TMSConnectionPoolManager.GetConnection(ConnectionParameters) as TOLEDBConnection; + finally + ConnectionParameters.Free; + end; + end + else + begin + Result := TOLEDBConnection.Create; + Result.SetProp(prDatabase, FDatabase); + Result.SetProp(prIsolationLevel, Integer(FIsolationLevel)); + Result.SetProp(prAuthentication, Integer(FAuthentication)); + Result.SetProp(prConnectionTimeout, FConnectionTimeout); + + if FOptions <> nil then begin + Result.SetProp(prQuotedIdentifier, FOptions.FQuotedIdentifier); + Result.SetProp(prLanguage, FOptions.FLanguage); + Result.SetProp(prEncrypt, FOptions.FEncrypt); + Result.SetProp(prPersistSecurityInfo, FOptions.FPersistSecurityInfo); + Result.SetProp(prAutoTranslate, FOptions.FAutoTranslate); + Result.SetProp(prNetworkLibrary, FOptions.FNetworkLibrary); + Result.SetProp(prApplicationName, FOptions.FApplicationName); + Result.SetProp(prWorkstationID, FOptions.FWorkstationID); + Result.SetProp(prPacketSize, FOptions.FPacketSize); + Result.SetProp(prProvider, Integer(FOptions.FProvider)); + Result.SetProp(prInitialFileName, FOptions.FInitialFileName); + Result.SetProp(prMARS, FOptions.FMultipleActiveResultSets); + //Result.SetProp(prMaxDatabaseSize, FOptions.FMaxDatabaseSize); + Result.SetProp(prFailoverPartner, FOptions.FFailoverPartner); + end; + + // FIConnection.SetProp(prMultipleConnections, @FMultipleConnections); + end; + + if FIConnection <> nil then + Result.Assign(FIConnection as TOLEDBConnection); +end; + +procedure TMSConnection.AssignTo(Dest: TPersistent); +begin + inherited AssignTo(Dest); + + if Dest is TMSConnection then begin + TMSConnection(Dest).Database := Database; + TMSConnection(Dest).IsolationLevel := IsolationLevel; + TMSConnection(Dest).Authentication := Authentication; + end; +end; + +procedure TMSConnection.SetDatabase(Value: string); +begin + if (Value <> Database) and (Options <> nil) and (Options.Provider = prCompact) then + Disconnect; + + if Value = '' then + if (Options <> nil) and (Options.Provider = prCompact) then + Value := '' + else + Value := DefaultSDACDatabase; + + if Value <> Database then begin + FDatabase := Value; + + if (Options <> nil) and (Options.Provider = prCompact) and + (csDesigning in ComponentState) and (Value <> '') and (Value[1] = '.') and (CurrentProjectOutputDir <> '') then + Value := IncludeTrailingBackslash(CurrentProjectOutputDir) + Value; + + if FIConnection <> nil then + FIConnection.SetProp(prDatabase, Value); + end; +end; + +function TMSConnection.CreateDataSet: TCustomDADataSet; +begin + Result := TCustomMSDataSet.Create(nil); + TCustomMSDataSet(Result).SetDesigning(csDesigning in ComponentState); + Result.Connection := Self; +end; + +function TMSConnection.CreateSQL: TCustomDASQL; +begin + Result := TMSSQL.Create(nil); + TMSSQL(Result).SetDesigning(csDesigning in ComponentState); + Result.Connection := Self; +end; + +function TMSConnection.GetClientVersion: string; +begin + Connect; + Assert(FIConnection <> nil); + Result := IConnection.ProviderVer; +end; + +function TMSConnection.GetServerVersion: string; +begin + Connect; + Assert(FIConnection <> nil); + Result := IConnection.DBMSVer; +end; + +procedure TMSConnection.ChangePassword(NewPassword: string); +var + OldConnected: boolean; + OldPassword: string; + OldLoginPrompt: boolean; +begin + OldConnected := Connected; + OldPassword := Password; + OldLoginPrompt := LoginPrompt; + try + if not Connected then + CreateIConnection + else + Disconnect; + LoginPrompt := False; + Assert(FIConnection <> nil); + FIConnection.SetProp(prOldPassword, Password); + Password := NewPassword; + try + Connect; + except + Password := OldPassword; + raise; + end; + finally + Assert(FIConnection <> nil); + FIConnection.SetProp(prOldPassword, ''); + LoginPrompt := OldLoginPrompt; + if not OldConnected then + Disconnect; + end; +end; + +function TMSConnection.ExecSQL(Text: string; const Params: array of variant): variant; +var + i: integer; + Param: TParam; +begin + if FMSSQL = nil then + FMSSQL := CreateSQL as TMSSQL; + + FMSSQL.SQL.Text := ''; // drop params from previous sql + FMSSQL.SQL.Text := Text; + + for i := 0 to FMSSQL.ParamCount - 1 do + if i <= High(Params) then + FMSSQL.Params[i].Value := Params[i] + else + FMSSQL.Params[i].Value := Null; + + Param := FMSSQL.FindParam('Result'); + if Param <> nil then + if Param.DataType = ftUnknown then + Param.DataType := ftInteger; + + FMSSQL.Execute; + + if Param <> nil then + Result := Param.Value + else + Result := Null; +end; + +procedure TMSConnection.GetTableNames(List: TStrings); +var + MDDS: TMSMetadata; + + procedure AddNamesToList; + var + NameFld: TStringField; + SchemaFld: TStringField; + begin + MDDS.Open; + + NameFld := MDDS.FieldByName('TABLE_NAME') as TStringField; + SchemaFld := nil; + if Options.Provider <> prCompact then + SchemaFld := MDDS.FieldByName('TABLE_SCHEMA') as TStringField; + while not MDDS.Eof do begin + if (SchemaFld <> nil) and (SchemaFld.Value <> '') then + List.Add(SchemaFld.Value + '.' + NameFld.Value) + else + List.Add(NameFld.Value); + MDDS.Next; + end; + end; + +begin + List.Clear; + MDDS := nil; + try + MDDS := TMSMetadata.Create(nil); + MDDS.Connection := Self; + MDDS.DatabaseName := MDDS.Connection.Database; + + MDDS.ObjectType := otTables; + AddNamesToList; + + if Options.Provider <> prCompact then begin + MDDS.ObjectType := otViews; + AddNamesToList; + end; + + if List is TStringList then + TStringList(List).Sort; + finally + MDDS.Free; + end; +end; + +procedure TMSConnection.GetDatabaseNames(List: TStrings); +var + MDDS: TMSMetadata; + NameFld: TStringField; +begin + List.Clear; + + if Options.Provider = prCompact then + Exit; + + MDDS := nil; + try + MDDS := TMSMetadata.Create(nil); + MDDS.Connection := Self; + MDDS.ObjectType := otDatabases; + + try + MDDS.Open; + except + on E: EMSError do begin + if E.ErrorCode = 4060 then + Database := ''; + raise; + end; + end; + + NameFld := MDDS.FieldByName('CATALOG_NAME') as TStringField; + while not MDDS.Eof do begin + List.Add(NameFld.Value); + MDDS.Next + end; + + if List is TStringList then + TStringList(List).Sort; + finally + MDDS.Free; + end; +end; + +procedure TMSConnection.GetStoredProcNames(List: TStrings); +var + MDDS: TMSMetadata; + NameFld: TStringField; +begin + List.Clear; + + if Options.Provider = prCompact then + Exit; + + MDDS := nil; + try + MDDS := TMSMetadata.Create(nil); + MDDS.Connection := Self; + MDDS.ObjectType := otStoredProcs; + + try + MDDS.Open; + except + on E: EMSError do begin + if E.ErrorCode = 4060 then + Database := ''; + raise; + end; + end; + + NameFld := MDDS.FieldByName('PROCEDURE_NAME') as TStringField; + while not MDDS.Eof do begin + List.Add(NameFld.Value); + MDDS.Next + end; + + if List is TStringList then + TStringList(List).Sort; + finally + MDDS.Free; + end; +end; + +procedure TMSConnection.GetStoredProcNames(List: TStrings; System: boolean); +var + Query: TMSQuery; + NameFld: TStringField; +begin + if System then + GetStoredProcNames(List) + else + begin + List.Clear; + + if Options.Provider = prCompact then + Exit; + + Query := TMSQuery.Create(nil); + try + Query.Connection := Self; + Query.SQL.Clear; + Query.SQL.Add('SELECT name FROM sysobjects'); + Query.SQL.Add('WHERE OBJECTPROPERTY(id, N''IsProcedure'') = 1 or OBJECTPROPERTY(id, N''IsExtendedProc'') = 1'); + Query.SQL.Add('ORDER BY name'); + try + Query.Open; + except + on E: EMSError do begin + if E.ErrorCode = 4060 then + Database := ''; + raise; + end; + end; + + NameFld := Query.FieldByName('name') as TStringField; + while not Query.Eof do begin + List.Add(NameFld.Value); + Query.Next; + end; + finally + Query.Free; + end; + end; +end; + +function TMSConnection.SQLMonitorClass: TClass; +begin + Result := TMSSQLMonitor; +end; + +function TMSConnection.ConnectDialogClass: TConnectDialogClass; +begin + if Assigned(DefConnectDialogClassProc) then + Result := TConnectDialogClass(DefConnectDialogClassProc) + else + Result := nil; +end; + +procedure TMSConnection.SetIsolationLevel(const Value: TIsolationLevel); +begin + if FIsolationLevel <> Value then begin + FIsolationLevel := Value; + if FIConnection <> nil then + FIConnection.SetProp(prIsolationLevel, Integer(Value)); + end; +end; +{ +procedure TMSConnection.SetMultipleConnections(const Value: boolean); +begin + if FMultipleConnections <> Value then begin + FMultipleConnections := Value; + Assert(TOLEDBConnection(FIConnection) <> nil); + FIConnection.SetProp(prMultipleConnections, @Value); + end; +end;} + +procedure TMSConnection.SetAuthentication(const Value: TMSAuthentication); +begin + if FAuthentication <> Value then begin + Disconnect; + FAuthentication := Value; + if FIConnection <> nil then + FIConnection.SetProp(prAuthentication, Integer(Value)); + end; +end; + +procedure TMSConnection.SetConnectionTimeout(const Value: integer); +begin + if FConnectionTimeout <> Value then begin + FConnectionTimeout := Value; + if FIConnection <> nil then + FIConnection.SetProp(prConnectionTimeout, Value); + end; +end; + +function TMSConnection.NeedPrompt: boolean; +begin + Result := False; + if Authentication = auWindows then + Exit; + + if Options.Provider = prCompact then + Exit; + + Result := not FLockLoginPrompt and + (LoginPrompt or (csDesigning in ComponentState) and + ((Username = '') and (Password = ''))) and + not ((csDesigning in ComponentState) and ((csReading in ComponentState) or FStreamedConnected)) +end; + +function TMSConnection.IsFatalError(E: EDAError): boolean; +begin + if E is EMSError then + with EMSError(E) do begin + Result := SeverityClass >= 20; {fatal error} + if not Result then + Result := + ((SeverityClass = 16) and (State = 1) and (MSSQLErrorCode <= NE_MAX_NETERROR)) // Network Library + or + ((SeverityClass = 10) and (State = 1) and (MSSQLErrorCode = WSAECONNRESET)) // Win sockets + or + ((SeverityClass = 16) and (State = 1) and (MSSQLErrorCode = WSAECONNRESET)) // Win sockets + or + ((SeverityClass = 16) and (State = 1) and (MSSQLErrorCode = ERROR_PIPE_NOT_CONNECTED)) // Named pipes + or + ((SeverityClass = 16) and (State = 1) and (MSSQLErrorCode = ERROR_NETNAME_DELETED)); // Named pipes + end + else + Result := inherited IsFatalError(E); +end; + +procedure TMSConnection.DoError(E: Exception; var Fail, Reconnect, Reexecute: boolean; + ReconnectAttempt: integer; var ConnLostCause: TConnLostCause); +var + i: integer; +begin + inherited; + + if Reconnect then + for i := 0 to DataSetCount - 1 do begin // Check underfetched data + Assert(DataSets[i] is TCustomMSDataSet); + if TCustomMSDataSet(DataSets[i]).FIRecordSet.GetIRowset <> nil then begin + Reconnect := False; + Exit; + end; + end; +end; + +procedure TMSConnection.DoInfoMessage(E: EMSError); +begin + TMSSQLMonitorClass(SQLMonitorClass).InfoMessage(Self, E.Message); + + if Assigned(FOnInfoMessage) then + FOnInfoMessage(Self, E); +end; + +function TMSConnection.IsKeyViolation(E: EDAError): boolean; +begin + if E is EMSError then + Result := (E.ErrorCode = 2627{Violation of %ls constraint '%.*ls'. Cannot insert duplicate key in object '%.*ls'.}) + else + Result := inherited IsKeyViolation(E); +end; + +{TMSDataSetOptions} + +constructor TMSDataSetOptions.Create(Owner: TCustomDADataSet); +begin + inherited Create(Owner); + + LongStrings := True; + RequiredFields := False; + EnableBCD := False; + UniqueRecords := False; + CursorUpdate := True; + QueryIdentity := True; + CheckRowVersion := False; + FullRefresh := False; + DMLRefresh := False; + FAutoRefresh := False; + FAutoRefreshInterval := 60; + FSmartRefresh := False; + FDefaultValues := False; + FNonBlocking := False; +end; + +procedure TMSDataSetOptions.SetEnableBCD(Value: boolean); +begin + if FEnableBCD <> Value then begin + TCustomMSDataSet(FOwner).CheckInactive; + FEnableBCD := Value; + TCustomMSDataSet(FOwner).SetNumericType; + end; +end; + +procedure TMSDataSetOptions.SetUniqueRecords(Value: boolean); +begin + if FUniqueRecords <> Value then begin + TCustomMSDataSet(FOwner).CheckInactive; + TCustomMSDataSet(FOwner).FieldDefs.Updated := False; + FUniqueRecords := Value; + TCustomMSDataSet(FOwner).FIRecordSet.SetProp(prUniqueRecords, FUniqueRecords); + TCustomMSDataSet(FOwner).FIRecordSet.SetProp(prRequestSQLObjects, FUniqueRecords or not FOwner.ReadOnly); + FOwner.FieldDefs.Updated := False; + end; +end; + +procedure TMSDataSetOptions.SetCursorUpdate(Value: boolean); +begin + if FCursorUpdate <> Value then begin + TCustomMSDataSet(FOwner).CheckInactive; + TCustomMSDataSet(FOwner).FieldDefs.Updated := False; + FCursorUpdate := Value; + TCustomMSDataSet(FOwner).FIRecordSet.SetProp(prCursorUpdate, FCursorUpdate); + end; +end; + +function TMSDataSetOptions.GetAllFieldsEditable: boolean; +begin + Result := not SetFieldsReadOnly; +end; + +procedure TMSDataSetOptions.SetAllFieldsEditable(const Value: boolean); +begin + SetFieldsReadOnly := not Value; +end; + +procedure TMSDataSetOptions.SetAutoRefresh(Value: boolean); +begin + if FAutoRefresh <> Value then begin + FAutoRefresh := Value; + if not (csDesigning in FOwner.ComponentState) then + TCustomMSDataSet(FOwner).FAutoRefreshTimer.Enabled := Value; + end; +end; + +procedure TMSDataSetOptions.SetAutoRefreshInterval(Value: integer); +begin + if FAutoRefreshInterval <> Value then begin + FAutoRefreshInterval := Value; + TCustomMSDataSet(FOwner).FAutoRefreshTimer.Interval := Value * MSecsPerSec; + end; +end; + +(*procedure TMSDataSetOptions.SetSmartRefresh(Value: boolean); +begin + if FSmartRefresh <> Value then begin + TCustomMSDataSet(FOwner).CheckInactive; + + FSmartRefresh := Value; + + TCustomMSDataSet(FOwner).FIRecordSet.SetProp(prSmartRefresh, FSmartRefresh); + if FSmartRefresh then + TCustomMSDataSet(FOwner).FIRecordSet.SetProp(prSmartRefreshMsg, GetComponentName(FOwner)); + end; +end;*) + +procedure TMSDataSetOptions.SetNonBlocking(Value: boolean); +begin + if FNonBlocking <> Value then begin + TCustomMSDataSet(FOwner).CheckInactive; + FNonBlocking := Value; + TCustomMSDataSet(FOwner).FIRecordSet.SetProp(prNonBlocking, FNonBlocking); + end; +end; + +procedure TMSDataSetOptions.AssignTo(Dest: TPersistent); +begin + inherited; + + if Dest is TMSDataSetOptions then begin + TMSDataSetOptions(Dest).LongStrings := LongStrings; + TMSDataSetOptions(Dest).EnableBCD := EnableBCD; + TMSDataSetOptions(Dest).UniqueRecords := UniqueRecords; + TMSDataSetOptions(Dest).AllFieldsEditable := AllFieldsEditable; + TMSDataSetOptions(Dest).CursorUpdate := CursorUpdate; + TMSDataSetOptions(Dest).FullRefresh := FullRefresh; + TMSDataSetOptions(Dest).DMLRefresh := DMLRefresh; + TMSDataSetOptions(Dest).AutoRefresh := AutoRefresh; + TMSDataSetOptions(Dest).AutoRefreshInterval := AutoRefreshInterval; + //TMSDataSetOptions(Dest).SmartRefresh := SmartRefresh; + end; +end; + +{ TMSSQLGenerator } + +function TMSSQLGenerator.GetActualFieldNameEx(FieldDesc: TCRFieldDesc; TableInfo: TCRTableInfo): string; +var + p: integer; +begin + Result := TOLEDBFieldDesc(FieldDesc).BaseColumnName; + if (FieldDesc.TableInfo = TableInfo) or (FieldDesc.TableInfo.TableName = TableInfo.TableName) then begin + p := Pos('.', Result); + if p <> 0 then + Result := Copy(Result, p + 1, MaxInt);{Delete table name from fieldname} + end; +end; + +function TMSSQLGenerator.AssembleSB(const StatementType: TStatementType): string; +begin + if TCustomMSDataSet(FOwner).Options.DMLRefresh and (StatementType = stInsert) then + Result := + FHeaderSB.ToString + + FFldSB.ToString + + FMiddleSB.ToString + + FFldParamSB.ToString + + FFooterSB.ToString + + FCondSB.ToString + else + Result := inherited AssembleSB(StatementType); +end; + +procedure TMSSQLGenerator.GenerateInsertSQL( + const KeyAndDataFields: TKeyAndDataFields; + const ModifiedFieldsOnly: boolean; + const Index: integer = -1); +var + Field, IdentityField: TField; + FieldDesc: TCRFieldDesc; + i: integer; + ActualName: string; + AIConnection: TOLEDBConnection; + IsFirstParam: boolean; +begin + inherited; + + if FFldSB.Length = 0 then begin + AIConnection := TMSAccessUtils.FIConnection(TMSConnection(FOwner.Connection)); + if (AIConnection <> nil) and (AIConnection.ProviderPrimaryVer <> 3) then begin + Clear; + FHeaderSB.Append('INSERT INTO '); + FHeaderSB.Append(FTableInfo.NormalizeName(FTableInfo.TableNameFull, FOwner.Options.QuoteNames)); + FHeaderSB.Append(' DEFAULT VALUES'); + end + else begin + for i := 0 to High(KeyAndDataFields.DataFieldDescs) do begin + FieldDesc := KeyAndDataFields.DataFieldDescs[i]; + Field := FOwner.GetField(FieldDesc); + Assert(Field <> nil); + if not Field.ReadOnly then begin + ActualName := GetActualFieldName(FieldDesc, False); + + if FFldSB.Length > 0 then begin + FFldSB.Append(', '); + FFldParamSB.Append(', '); + end; + FFldSB.Append(ActualName); + FFldParamSB.Append('DEFAULT'); + end; + end; + end; + end; + + if TCustomMSDataSet(FOwner).CursorType = ctDefaultResultSet then begin + { Getting Identity value } + if TCustomMSDataSet(FOwner).Options.QueryIdentity and (TOLEDBConnection(TCustomMSDataSet(FOwner).Connection.IConnection).DBMSPrimaryVer <> 3) then begin + IdentityField := TDBAccessUtils.GetIdentityField(FOwner); + if IdentityField <> nil then begin + // Warning - Identity param must be last in param list, see SetIdentityParam + // Warning - If in 'INSERT ...' statement present sql_variant value then adding 'SET ...' fails statement + // Warning - TOLEDBFieldDesc(GetFieldDescByField(FIdentityField)).BaseColumnName cannot be used (for example see gettting identity on INSERT into View) + + FFooterSB.Append(#$D#$A'SET '); + TCustomMSDataSet(FOwner).FUseParamType := True; + AddParam(FFooterSB, FOwner.GetFieldDesc(IdentityField), stInsert, ptInputOutput); + + if TOLEDBConnection(TCustomMSDataSet(FOwner).Connection.IConnection).DBMSPrimaryVer > 7 then + FFooterSB.Append(' = SCOPE_IDENTITY()') + else + FFooterSB.Append(' = @@Identity'); + end; + end; + + { DMLRefresh } + if TCustomMSDataSet(FOwner).Options.DMLRefresh then begin + IsFirstParam := True; + for i := 0 to High(KeyAndDataFields.DataFieldDescs) do begin + FieldDesc := KeyAndDataFields.DataFieldDescs[i]; + Field := FOwner.GetField(FieldDesc); + Assert(Field <> nil); + if not Field.ReadOnly then begin + if not IsFirstParam then + FFooterSB.Append(', ') + else + FFooterSB.Append(LineSeparator + 'SELECT '); + IsFirstParam := False; + TCustomMSDataSet(FOwner).FUseParamType := True; + AddParam(FFooterSB, FieldDesc, stRefresh, ptInputOutput); + FFooterSB.Append(' = ' + QuoteName(TOLEDBFieldDesc(FieldDesc).BaseColumnName)); + end; + end; + if not IsFirstParam then begin + FFooterSB.Append(' FROM ' + FTableInfo.NormalizeName(FTableInfo.TableNameFull, FOwner.Options.QuoteNames) + + LineSeparator + 'WHERE' + LineSeparator + ' '); + GenerateConditions(FCondSB, stInsert, ModifiedFieldsOnly, KeyAndDataFields); + end; + end; + end; +end; + +procedure TMSSQLGenerator.GenerateUpdateSQL( + const KeyAndDataFields: TKeyAndDataFields; + const ModifiedFieldsOnly: boolean; + const Index: integer = -1); +var + Field: TField; + FieldDesc: TCRFieldDesc; + i: integer; + IsFirstParam: boolean; + OldCondSB: StringBuilder; +begin + inherited; + + if TCustomMSDataSet(FOwner).CursorType = ctDefaultResultSet then begin + { DMLRefresh } + if (FFldSB.Length > 0) and TCustomMSDataSet(FOwner).Options.DMLRefresh then begin + FFooterSB.Append(LineSeparator); + FFooterSB.Append('SELECT '); + IsFirstParam := True; + for i := 0 to High(KeyAndDataFields.DataFieldDescs) do begin + FieldDesc := KeyAndDataFields.DataFieldDescs[i]; + Field := FOwner.GetField(FieldDesc); + if not Field.ReadOnly then begin + if not IsFirstParam then + FFooterSB.Append(', '); + IsFirstParam := False; + TCustomMSDataSet(FOwner).FUseParamType := True; + AddParam(FFooterSB, FieldDesc, stRefresh, ptInputOutput); + FFooterSB.Append(' = ' + QuoteName(TOLEDBFieldDesc(FieldDesc).BaseColumnName)); + end; + end; + FFooterSB.Append(' FROM '); + FFooterSB.Append(FTableInfo.NormalizeName(FTableInfo.TableNameFull, FOwner.Options.QuoteNames)); + FFooterSB.Append(LineSeparator); + FFooterSB.Append('WHERE'); + FFooterSB.Append(LineSeparator); + FFooterSB.Append(' '); + OldCondSB := FCondSB; + try + FCondSB := StringBuilder.Create; + try + GenerateConditions(FCondSB, stUpdate, ModifiedFieldsOnly, KeyAndDataFields); + FFooterSB.Append(FCondSB.ToString); + finally + FCondSB.Free; + end; + finally + FCondSB := OldCondSB; + end; + end; + end; +end; + +procedure TMSSQLGenerator.GenerateRefreshSQLSelectPart(const KeyAndDataFields: TKeyAndDataFields); +var + Field: TField; + FieldDesc: TOLEDBFieldDesc; + TableName: string; + UseDataFields: boolean; + FieldArrHigh: integer; +begin + inherited; + + if TCustomMSDataSet(FOwner).FTimestampField <> nil then begin + UseDataFields := Length(KeyAndDataFields.DataFieldDescs) + Length(KeyAndDataFields.DataFieldDescs) > 0; + if UseDataFields then + FieldArrHigh := Length(KeyAndDataFields.DataFieldDescs) + Length(KeyAndDataFields.DataFieldDescs) - 1 + else + FieldArrHigh := High(KeyAndDataFields.KeyFieldDescs); + + if FieldArrHigh >= 0 then + FFldSB.Append(', '); + Field := TCustomMSDataSet(FOwner).FTimestampField; + FieldDesc := TOLEDBFieldDesc(FOwner.GetFieldDesc(Field)); + TableName := GenerateTableName(FieldDesc.BaseCatalogName, FieldDesc.BaseSchemaName, FieldDesc.BaseTableName, TCustomMSDataSet(FOwner).Connection.Database); + if TableName = '' then + FFldSB.Append(QuoteName(FieldDesc.ActualName)) + else + if FieldDesc.TableInfo.TableAlias <> '' then + FFldSB.Append(FieldDesc.TableInfo.NormalizeName(FieldDesc.TableInfo.TableAlias, FOwner.Options.QuoteNames) + + '.' + QuoteName(FieldDesc.BaseColumnName)) + else + FFldSB.Append(FieldDesc.TableInfo.NormalizeName(FieldDesc.TableInfo.TableName, FOwner.Options.QuoteNames) + + '.' + QuoteName(FieldDesc.BaseColumnName)); + + if not (csDesigning in FOwner.ComponentState) then + FFldSB.Append(' AS ' + GenerateIndexName(IntToStr(TCustomMSDataSet(FOwner).FIRecordSet.Fields.IndexOf(FieldDesc)))); + end; +end; + +procedure TMSSQLGenerator.GenerateRefreshSQL( + const KeyAndDataFields: TKeyAndDataFields; + const ModifiedFieldsOnly: boolean); + + procedure GenerateSPFullRefreshSQL; + var + i: integer; + Field: TField; + FieldDesc: TOLEDBFieldDesc; + TableName: string; + TblNames: TStringList; + begin + TblNames := TStringList.Create; + try + // SELECT ... FROM ... WHERE ... {WITH NOLOCK} + // Add SELECT section + FHeaderSB.Append('SELECT '); + for i := 0 to FOwner.Fields.Count - 1 do begin + Field := FOwner.Fields[i]; + if Field.FieldKind = fkData then begin + FieldDesc := TOLEDBFieldDesc(FOwner.GetFieldDesc(Field)); + + TableName := GenerateTableName(FieldDesc.BaseCatalogName, FieldDesc.BaseSchemaName, FieldDesc.BaseTableName, TCustomMSDataSet(FOwner).Connection.Database); + if TblNames.IndexOf(TableName) = - 1 then + TblNames.Add(TableName); + + FHeaderSB.Append(TableName + '.' + FieldDesc.Name); + if not (csDesigning in FOwner.ComponentState) then + FHeaderSB.Append(' AS _' + IntToStr(TCustomMSDataSet(FOwner).FIRecordSet.Fields.IndexOf(FieldDesc))); + FHeaderSB.Append(', '); + end; + end; + FHeaderSB.Length := FHeaderSB.Length - 2; + + // Add FROM section + FHeaderSB.Append(' FROM '); + for i := 0 to TblNames.Count - 1 do + FHeaderSB.Append(QuoteName(TblNames[i]) + ', '); // Table name without aliases + FHeaderSB.Length := FHeaderSB.Length - 2; + + // Add WHERE section + GenerateConditions(FCondSB, stRefresh, ModifiedFieldsOnly, (*False {Refresh does not need to testing changes applied by other users},*) KeyAndDataFields); + if FCondSB.Length > 0 then + FMiddleSB.Append(' WHERE '); + finally + TblNames.Free; + end; + end; + +begin + if (FOwner is TCustomMSStoredProc) and TCustomMSDataSet(FOwner).Options.FullRefresh then + GenerateSPFullRefreshSQL + else + if TCustomMSDataSet(FOwner).Options.FullRefresh or (FOwner.ReadOnly and not TCustomMSDataSet(FOwner).Options.UniqueRecords) then begin + GenerateConditions(FCondSB, stRefresh, ModifiedFieldsOnly, KeyAndDataFields); + if FCondSB.Length = 0 then + FHeaderSB.Append(FOwner.SQL.Text) + else begin + FHeaderSB.Append(AddWhere(FOwner.SQL.Text, FCondSB.ToString)); + FCondSB.Length := 0; // WHERE clause already added to FHeaderSB + end; + end + else + inherited; +end; + +function TMSSQLGenerator.GetActualFieldName(FldDesc: TCRFieldDesc; IsRefresh: boolean): string; +var + TablesInfo: TCRTablesInfo; + TableInfo: TCRTableInfo; + IsView: boolean; + UpdatingTableIdx: integer; +begin + if not (((FldDesc.TableInfo <> nil) and (FldDesc.TableInfo.IsView)) or IsRefresh) then begin + Result := TOLEDBFieldDesc(FldDesc).BaseColumnName; + if Result = '' then + Result := FldDesc.ActualName; + Result := QuoteName(Result); + Exit; + end; + + IsView := False; + UpdatingTableIdx := TDBAccessUtils.GetUpdatingTableIdx(FOwner); + TablesInfo := TDBAccessUtils.GetTablesInfo(FOwner); + if (UpdatingTableIdx >= 0) and (UpdatingTableIdx < TablesInfo.Count) then begin + TableInfo := TablesInfo[UpdatingTableIdx]; + if TableInfo <> nil then + IsView := TableInfo.IsView; + end; + + if (FldDesc.TableInfo <> nil) and (not IsView) then + Result := inherited GetActualFieldName(FldDesc, IsRefresh) + else + Result := QuoteName(FldDesc.ActualName); +end; + +procedure TMSSQLGenerator.AddFieldToCondition(SB: StringBuilder; FieldDesc: TCRFieldDesc; + const StatementType: TStatementType; + const ModifiedFieldsOnly: boolean; + const Index: integer = -1); +var + ActualName: string; + IsIdentityField: boolean; + Field: TField; +begin + Assert(FieldDesc <> nil); + + if ModifiedFieldsOnly then begin + Field := FOwner.GetField(FieldDesc); + IsIdentityField := Field = TDBAccessUtils.GetIdentityField(FOwner); + if (StatementType = stInsert) and IsIdentityField then begin // DMLRefresh ? + ActualName := GetActualFieldName(FieldDesc, False); + FCondSB.Append(ActualName); + FCondSB.Append(' = '); + if TOLEDBConnection(TCustomMSDataSet(FOwner).Connection.IConnection).DBMSPrimaryVer > 7 then + FCondSB.Append('SCOPE_IDENTITY()') + else + FCondSB.Append('@@Identity'); + Exit; + end; + end; + + inherited; +end; + +procedure TMSSQLGenerator.GenerateConditions(SB: StringBuilder; + const StatementType: TStatementType; + const ModifiedFieldsOnly: boolean; + const KeyAndDataFields: TKeyAndDataFields; + const Index: integer = -1); + + procedure GenerateCondForRQ; + {SQL Server Books Online -> Accessing and Changing Relational Data -> + Transact-SQL Syntax Elements -> Using Data Types -> Using Special Data: + + In SQL Server version 7.0 and SQL Server 2000, @@DBTS is only incremented for use + in timestamp columns. If a table contains a timestamp column, every time a row is + modified by an INSERT, UPDATE, or DELETE statement, the timestamp value in the row + is set to the current @@DBTS value, and then @@DBTS is incremented by one...} + var + TimestampField: TField; + MaxTimestamp: Int64; + FieldDesc: TOLEDBFieldDesc; + begin + TimestampField := TCustomMSDataSet(FOwner).FTimestampField; + if TimestampField = nil then + DatabaseError(STimestampFieldRequired); + + FieldDesc := TOLEDBFieldDesc(FOwner.GetFieldDesc(TimestampField)); + MaxTimestamp := TOLEDBTableInfo(FieldDesc.TableInfo).MaxTimestamp; + FCondSB.Append(GetActualFieldName(FOwner.GetFieldDesc(TimestampField) as TCRFieldDesc, True) + ' > ' + '0x' + IntToHex(MaxTimestamp, SizeOf(MaxTimestamp) * 2)); + end; + +var + i: integer; + FldUsed: set of byte; + TestChanges: boolean; +begin + Assert(FOwner <> nil); + Assert(FOwner.Connection <> nil); + Assert(IsClass(FOwner.Connection, TMSConnection)); + + FCondSB.Length := 0; + + if StatementType = stRefreshQuick then + GenerateCondForRQ + else + begin + TestChanges := (StatementType = stInsert) and TCustomMSDataSet(FOwner).Options.DMLRefresh and + (TCustomMSDataSet(FOwner).CursorType = ctDefaultResultSet) and TCustomMSDataSet(FOwner).Options.CheckRowVersion; + + TestChanges := TestChanges or ((StatementType = stUpdate) and TCustomMSDataSet(FOwner).Options.DMLRefresh and + (TCustomMSDataSet(FOwner).CursorType = ctDefaultResultSet) and TCustomMSDataSet(FOwner).Options.CheckRowVersion); + + if not TestChanges then + inherited + else + begin + if (TCustomMSDataSet(FOwner).FTimestampField <> nil) and not TCustomMSDataSet(FOwner).FTimestampField.IsNull then + AddFieldToCondition(FCondSB, FOwner.GetFieldDesc(TCustomMSDataSet(FOwner).FTimestampField) as TCRFieldDesc, StatementType, ModifiedFieldsOnly, Index) + else + begin + FldUsed := []; + if Length(KeyAndDataFields.KeyFieldDescs) > 0 then + for i := 0 to High(KeyAndDataFields.KeyFieldDescs) do begin + AddFieldToCondition(FCondSB, KeyAndDataFields.KeyFieldDescs[i], StatementType, ModifiedFieldsOnly, Index); + FldUsed := FldUsed + [KeyAndDataFields.KeyFieldDescs[i].FieldNo]; + end; + + if Length(KeyAndDataFields.DataFieldDescs) = 0 then + DatabaseError(SNoKeyFields); + for i := 0 to High(KeyAndDataFields.DataFieldDescs) do + if not IsBlobDataType(KeyAndDataFields.DataFieldDescs[i].DataType) // not "text", "ntext", "image" + and not (KeyAndDataFields.DataFieldDescs[i].FieldNo in FldUsed) then + AddFieldToCondition(FCondSB, KeyAndDataFields.DataFieldDescs[i], StatementType, ModifiedFieldsOnly, Index); + end; + end; + end; +end; + +{ TCustomMSDataSet} + +procedure TCustomMSDataSet.AutoRefreshTimer(Sender: TObject); +begin + if State = dsBrowse then begin + try + if FTimestampField <> nil then + RefreshQuick(True) + else + Refresh; + except + Options.AutoRefresh := False; + raise; + end; + + // Reset timer + FAutoRefreshTimer.Enabled := False; + FAutoRefreshTimer.Enabled := True; + end; +end; + +function TCustomMSDataSet.QuoteName(const AName: string): string; +begin + Result := QuoteName(AName, FLeftQuote, FRightQuote); +end; + +function TCustomMSDataSet.QuoteName(const AName: string; const LeftQuote, RightQuote: string): string; +begin + if FOptions.QuoteNames and (AName <> '') + and ((AName[1] <> LeftQuote) and (AName[Length(AName)] <> RightQuote)) then + Result := Concat(LeftQuote, AName, RightQuote) + else + Result := BracketIfNeed(AName); +end; + +function TCustomMSDataSet.GetParams: TMSParams; +begin + Result := TMSParams(inherited Params); +end; + +procedure TCustomMSDataSet.SetParams(Value: TMSParams); +begin + inherited Params := Value; +end; + +constructor TCustomMSDataSet.Create(Owner: TComponent); +begin + inherited Create(Owner); + + FOptions := inherited Options as TMSDataSetOptions; + + FLeftQuote := OLEDBAccess.LeftQuote; + FRightQuote := OLEDBAccess.RightQuote; + + FLockInitFieldDefs := False; + CursorType := ctDefaultResultSet; + + FIdentityField := nil; + + FIsInInitFieldDefs := False; + + FCommandTimeout := 0; + FetchAll := True; + + FAutoRefreshTimer := TWin32Timer.Create(nil); + FAutoRefreshTimer.OnTimer := AutoRefreshTimer; + FAutoRefreshTimer.Interval := Options.AutoRefreshInterval * MSecsPerSec; + FAutoRefreshTimer.Enabled := Options.AutoRefresh; + +{$IFNDEF STD} + FNeedSmartRefresh := False; +{$ENDIF} +end; + +destructor TCustomMSDataSet.Destroy; +begin + if FAutoRefreshTimer <> nil then begin + FAutoRefreshTimer.Enabled := False; + FAutoRefreshTimer.Free; + end; + + inherited; +end; + +procedure TCustomMSDataSet.AssignTo(Dest: TPersistent); +begin + inherited; + + if Dest is TCustomMSDataSet then begin + TCustomMSDataSet(Dest).SQLInsert := SQLInsert; + TCustomMSDataSet(Dest).SQLDelete := SQLDelete; + TCustomMSDataSet(Dest).SQLUpdate := SQLUpdate; + TCustomMSDataSet(Dest).SQLRefresh := SQLRefresh; + TCustomMSDataSet(Dest).CursorType := CursorType; + + TCustomMSDataSet(Dest).Params.Assign(Params); + end; +end; + +{ Smart Refresh } +{$IFDEF SMART_REFRESH} +{$IFNDEF STD} +procedure TCustomMSDataSet.RegisterNotification; +var + CreateDML: string; + Guid: TGUID; + + function PrepareGuid(const Guid: string): string; + var + i: integer; + begin + Result := ''; //+++ StringBuilder + for i := 1 to Length(Guid) - 1 do + case Guid[i] of + '0'..'9', 'A'..'F', 'a'..'f': + Result := Result + Guid[i]; + end; + end; + +begin + Assert(FRefreshServiceBroker = nil); + + BeginConnection; + + if TOLEDBConnection(Connection.IConnection).DBMSPrimaryVer <= 8 then + DatabaseError(SInvalidServerVersion); + +{$IFDEF VER6P} + if CreateGuid(Guid) <> 0 then + RaiseLastOSError; +{$ELSE} + if CoCreateGuid(Guid) <> 0 then + RaiseLastWin32Error; +{$ENDIF} + + FRefreshQueue := sSdacQueue + PrepareGuid(GuidToString(Guid)); + FRefreshService := sSdacService + PrepareGuid(GuidToString(Guid)); + + CreateDML := 'IF NOT EXISTS (SELECT * FROM sys.service_queues WHERE name = N''' + FRefreshQueue + ''') ' + + 'CREATE QUEUE ' + FRefreshQueue + ';' + LineSeparator; + CreateDML := CreateDML + 'IF NOT EXISTS (SELECT * FROM sys.services WHERE name = N''' + FRefreshService + ''') ' + + 'CREATE SERVICE ' + FRefreshService + ' ON QUEUE ' + FRefreshQueue + ' ([http://schemas.microsoft.com/SQL/Notifications/PostQueryNotification])'; + Connection.ExecSQL(CreateDML, []); + + FIRecordSet.SetProp(prSmartRefreshService, FRefreshService); + + FRefreshServiceBroker := TMSRefreshServiceBroker.Create(nil); + TMSRefreshServiceBroker(FRefreshServiceBroker).FDataSet := Self; + TMSRefreshServiceBroker(FRefreshServiceBroker).Service := FRefreshService; + TMSRefreshServiceBroker(FRefreshServiceBroker).Connection := Connection; +end; + +procedure TCustomMSDataSet.UnregisterNotification; +var + DropDML: string; +begin + try + TMSRefreshServiceBroker(FRefreshServiceBroker).Free; + FRefreshServiceBroker := nil; + finally + try + DropDML := 'IF EXISTS (SELECT * FROM sys.services WHERE name = N''' + FRefreshService + ''') ' + + 'DROP SERVICE ' + FRefreshService + ';' + LineSeparator; + DropDML := DropDML + 'IF EXISTS (SELECT * FROM sys.service_queues WHERE name = N''' + FRefreshQueue + ''') ' + + 'DROP QUEUE ' + FRefreshQueue + ';'; + try + Connection.ExecSQL(DropDML, []); + except + on E: EOLEDBError do; // silent + end; + finally + EndConnection; + end; + end; +end; +{$ENDIF} +{$ENDIF} + +{ Open/Close } + +procedure TCustomMSDataSet.SetActive(Value: Boolean); +begin + if Value <> Active then begin + if Value then + SetNumericType; + + {$IFDEF SMART_REFRESH} + {$IFNDEF STD} + if Active and FOptions.FSmartRefresh then + UnregisterNotification; + {$ENDIF} + {$ENDIF} + end; + + try + + inherited; + + if Value and (FIRecordSet.FetchExecutor <> nil) then + FIRecordSet.FetchExecutor.Resume; + + except + on E: EDAError do begin + if (E.Message = SCursorTypeChanged) then + Unprepare; + raise; + end; + end; +end; + +procedure TCustomMSDataSet.DataReopen; +begin + if FCursorType in ServerCursorTypes then + ClearBuffers; + inherited; +end; + +procedure TCustomMSDataSet.InternalExecute; +begin + SetNumericType; + inherited; + if TCRRecordSet(Data).CommandType = ctCursor then + InternalInitFieldDefs + else + TCRRecordSet(Data).GetCommand.SetCursorState(csInactive); // To prevent blocking execute on second exec +end; + +procedure TCustomMSDataSet.InternalOpen; + function IsAnyFieldDescCanBeModified: boolean; + var + i: integer; + begin + Result := False; + for i := 0 to FIRecordSet.Fields.Count - 1 do + if not FIRecordSet.Fields[i].ReadOnly then begin + Result := True; + Break; + end; + end; + + procedure FillFieldsOrigin; + var + Field: TField; + FieldDesc: TOLEDBFieldDesc; + + TableName: string; + + i: integer; + begin + /// downto to correct set FIdentityField + for i := Fields.Count - 1 downto 0 do begin + Field := Fields[i]; + + if Field.FieldKind = fkData then begin + FieldDesc := TOLEDBFieldDesc(GetFieldDesc(Field)); + + if not (Self is TCustomMSTable) then begin + TableName := GenerateTableName(FieldDesc.BaseCatalogName, FieldDesc.BaseSchemaName, FieldDesc.BaseTableName, Connection.Database); + Field.Origin := TableName + '.' + BracketIfNeed(FieldDesc.BaseColumnName); + end + else + Field.Origin := TCustomMSTable(Self).FTableName + '.' + Field.FieldName; + + if FieldDesc.IsAutoIncrement then begin + if Options.SetFieldsReadOnly then + Field.ReadOnly := True; + + Assert((FUpdatingTableInfoIdx >= - 1) and (FUpdatingTableInfoIdx < TablesInfo.Count)); + + if (FUpdatingTableInfoIdx >= 0) + and (FIRecordSet.TablesInfo.IndexByName(GenerateTableName(FieldDesc.BaseCatalogName, FieldDesc.BaseSchemaName, FieldDesc.BaseTableName, Connection.Database)) = FUpdatingTableInfoIdx) then + FIdentityField := Field; + {$IFDEF VER5P} + Field.AutoGenerateValue := arAutoInc; + {$ENDIF} + end; + + if FieldDesc.IsTimestamp + and (FUpdatingTableInfoIdx >= 0) + and (FieldDesc.BaseTableName = FIRecordSet.TablesInfo[FUpdatingTableInfoIdx].TableName) then + FTimestampField := Field; + end; + if Field.DataType = TFieldType(ftMSXML) then begin + FieldDesc := TOLEDBFieldDesc(GetFieldDesc(Field)); + Assert(Field is TMSXMLField); + TMSXMLField(Field).SetSchemaCollection(FieldDesc.XMLSchemaCollectionName, + FieldDesc.XMLSchemaCollectionCatalogName, FieldDesc.XMLSchemaCollectionSchemaName); + end; + end; + end; + +var + i: integer; + FieldDesc: TFieldDesc; +begin + try + {$IFDEF SMART_REFRESH} + {$IFNDEF STD} + if FOptions.FSmartRefresh then + RegisterNotification; + {$ENDIF} + {$ENDIF} + finally + + if CachedUpdates and (FCursorType in ServerCursorTypes) then + DatabaseError(SCUandServerCursors); + + inherited; + //Assert(not FIRecordSet.NativeRowset or (Length(FSQLObjects) <> 0)); + + FNeedAddRef := FCursorType in ServerCursorTypes; + + FCanOpenNext := not FICommand.IUnknownNextIsNull; + + if FIRecordSet.NativeRowset then begin + FIsAnyFieldDescCanBeModified := IsAnyFieldDescCanBeModified; + + if Fields.Count > 0 then + FillFieldsOrigin; + end + else + FIsAnyFieldDescCanBeModified := False; + + // Set right precision for TFloatField + for i := 0 to Fields.Count - 1 do + if (Fields[i] is TFloatField) + and (TFloatField(Fields[i]).Precision = 15 {Default}) + and (Fields[i].FieldKind = fkData) then begin + FieldDesc := GetFieldDesc(Fields[i]); + case FieldDesc.DataType of + dtFloat, dtCurrency: // Precision cannot be greater then 15 + TFloatField(Fields[i]).Precision := FieldDesc.Length; + end; + end; + end; +end; + +procedure TCustomMSDataSet.InternalClose; +var + LockClearMultipleResults: boolean; + v: Variant; +begin + inherited; + + FTimestampField := nil; + + if FIsInInitFieldDefs then begin + FICommand.ClearIUnknown; + FIRecordSet.GetProp(prLockClearMultipleResults, v); + LockClearMultipleResults := v; + if not LockClearMultipleResults then begin + FICommand.ClearIMultipleResults; + FICommand.ClearIUnknownNext; + FCanOpenNext := True; + end; + end; +end; + +procedure TCustomMSDataSet.OpenCursor(InfoQuery: boolean); +begin + + FIRecordSet.SetProp(prReadOnly, ReadOnly); + + if FIRecordSet.NativeRowset and (SQL.Count = 0) then + DatabaseError(SEmptySQLStatement, Self); + + inherited; + + if Options.DefaultValues then + GetFieldsInfo; + + if InfoQuery then begin + TCRRecordSet(Data).GetCommand.SetCursorState(csInactive); // To prevent blocking excute on second exec + TCRRecordSet(Data).CommandType := CRAccess.ctUnknown; + end; +end; + +procedure TCustomMSDataSet.GetFieldsInfo; +var + MetaData: TMSMetadata; + Field: TField; + DefValue: string; +begin + MetaData := TMSMetadata.Create(nil); + try + MetaData.Connection := Connection; + MetaData.DatabaseName := Connection.Database; + MetaData.ObjectType := otColumns; + MetaData.TableName := TablesInfo[FUpdatingTableInfoIdx].TableName; + MetaData.Open; + while not MetaData.EOF do begin + Field := FindField(MetaData.FieldByName('COLUMN_NAME').AsString); + if (Field <> nil) and MetaData.FieldByName('COLUMN_HASDEFAULT').AsBoolean and not MetaData.FieldByName('COLUMN_DEFAULT').IsNull then begin + DefValue := MetaData.FieldByName('COLUMN_DEFAULT').AsString; + case Field.DataType of + ftBoolean: + Field.DefaultExpression := BoolToStr(DefValue <> '0', True); + ftFloat, ftBCD{$IFDEF VER6P}, ftFMTBCD{$ENDIF}: + Field.DefaultExpression := StringReplace(DefValue, '.', DecimalSeparator, [rfReplaceAll]); + else + Field.DefaultExpression := DefValue; + end; + end; + MetaData.Next; + end; + finally + MetaData.Free; + end; +end; + +procedure TCustomMSDataSet.InitFieldDefs; +begin + FIsInInitFieldDefs := True; + try + inherited; + finally + FIsInInitFieldDefs := False; + end; +end; + +procedure TCustomMSDataSet.InternalInitFieldDefs; +begin + if not FLockInitFieldDefs then + inherited; +end; + +function TCustomMSDataSet.GetFieldType(DataType: word): TFieldType; +begin + Result := {$IFDEF CLR}CoreLab.Sdac.{$ENDIF}MSAccess.GetFieldType(DataType); +end; + +function TCustomMSDataSet.GetFieldClass(FieldType: TFieldType): TFieldClass; +begin + if Integer(FieldType) = ftMSXML then + Result := TMSXMLField + else + Result := inherited GetFieldClass(Fieldtype); +end; + +{$IFDEF USE_FTAUTOINC} +function TCustomMSDataSet.GetFieldType(FieldDesc: TFieldDesc): TFieldType; +begin + Result := inherited GetFieldType(FieldDesc); + Assert(FieldDesc is TOLEDBFieldDesc); + if (Result = ftInteger) and TOLEDBFieldDesc(FieldDesc).IsAutoIncrement then + Result := ftAutoInc; +end; +{$ENDIF} + +procedure TCustomMSDataSet.CreateIRecordSet; +begin + inherited; + + if FIRecordSet = nil then + SetIRecordSet(TOLEDBRecordSet.Create); +end; + +procedure TCustomMSDataSet.SetIRecordSet(Value: TData); +begin + inherited; + + FIRecordSet := TOLEDBRecordSet(Value); + + if FIRecordSet <> nil then begin + FICommand := TOLEDBCommand(FIRecordSet.GetCommand); + if FOptions <> nil then begin + SetNumericType; + FIRecordSet.SetProp(prUniqueRecords, FOptions.FUniqueRecords); + FIRecordSet.SetProp(prCursorUpdate, FOptions.FCursorUpdate); + end; + + FIRecordSet.SetProp(prEnableEmptyStrings, True); + FIRecordSet.SetProp(prReadOnly, ReadOnly); + FIRecordSet.SetProp(prCursorType, Integer(CursorType)); + FIRecordSet.SetProp(prCommandTimeout, CommandTimeout); + FIRecordSet.SetProp(prRequestSQLObjects, True); + + FIRecordSet.SetProp(prRoAfterUpdate, roAfterUpdate in RefreshOptions); + + TOLEDBRecordSet(FIRecordSet).CursorTypeChanged := DoCursorTypeChanged; + end + else + FICommand := nil; +end; + +procedure TCustomMSDataSet.SetNumericType; +begin + if (FIRecordSet <> nil) and (FOptions <> nil) then begin + if FOptions.EnableBCD or (Connection = nil) or (Connection.Options = nil) then begin + Assert(FIRecordSet <> nil); + FIRecordSet.SetProp(prEnableBCD, FOptions.FEnableBCD); + {$IFDEF VER6P} + FIRecordSet.SetProp(prEnableFMTBCD, False); + {$ENDIF} + end + else + case Connection.Options.NumericType of + ntFloat: begin + FIRecordSet.SetProp(prEnableBCD, False); + {$IFDEF VER6P} + FIRecordSet.SetProp(prEnableFMTBCD, False); + {$ENDIF} + end; + ntBCD: begin + FIRecordSet.SetProp(prEnableBCD, True); + {$IFDEF VER6P} + FIRecordSet.SetProp(prEnableFMTBCD, False); + {$ENDIF} + end; + {$IFDEF VER6P} + ntFMTBCD: begin + FIRecordSet.SetProp(prEnableBCD, True); + FIRecordSet.SetProp(prEnableFMTBCD, True); + end; + {$ENDIF} + end; + end; + if FieldDefs <> nil then + FieldDefs.Updated := False; +end; + +function TCustomMSDataSet.GetCanModify: boolean; +begin + Assert(FIRecordSet <> nil, 'FIRecordSet must be setted to this time'); + + Result := inherited GetCanModify or + not (ReadOnly or UniDirectional) and + (FIsAnyFieldDescCanBeModified or + (SQLInsert.Count > 0) or + (SQLUpdate.Count > 0) or + (SQLDelete.Count > 0)) + and (FCursorType <> ctStatic); +end; + +procedure TCustomMSDataSet.CreateCommand; +begin + SetCommand(TMSSQL.Create(Self)); +end; + +function TCustomMSDataSet.CreateOptions: TDADataSetOptions; +begin + Result := TMSDataSetOptions.Create(Self); +end; + +function TCustomMSDataSet.GetConnection: TMSConnection; +begin + Result := TMSConnection(inherited Connection); +end; + +procedure TCustomMSDataSet.SetConnection(Value: TMSConnection); +begin + inherited Connection := Value; +end; + +function TCustomMSDataSet.PSGetKeyFields: string; +begin + if FIRecordSet.NativeRowset then + Result := inherited PSGetKeyFields + else + Result := ''; +end; + +procedure TCustomMSDataSet.CreateSQLGenerator; +begin + SetSQLGenerator(TMSSQLGenerator.Create(Self)); +end; + +procedure TCustomMSDataSet.SetReadOnly(Value: boolean); +begin + if ReadOnly <> Value then begin + if CursorType in ServerCursorTypes then + CheckInactive; + FieldDefs.Updated := False; + FIRecordSet.SetProp(prReadOnly, Value); + FIRecordSet.SetProp(prRequestSQLObjects, FOptions.FUniqueRecords or not Value); + inherited; + end; +end; + +procedure TCustomMSDataSet.InternalBeforeEdit; +begin + if roBeforeEdit in RefreshOptions then begin + InternalRefreshRecord; + if CursorType in ServerCursorTypes then + Resync([]); // CR 9097 + end; + + inherited; +end; + +procedure TCustomMSDataSet.UnPrepare; +var + v: variant; + LockClearMultipleResults: boolean; +begin + Close; + + if FICommand <> nil then begin + FICommand.ClearIUnknown; + FIRecordSet.GetProp(prLockClearMultipleResults, v); + LockClearMultipleResults := v; + if not LockClearMultipleResults then begin + FICommand.ClearIMultipleResults; + FICommand.ClearIUnknownNext; + FCanOpenNext := True; + end; + end; + + inherited; +end; + +function TCustomMSDataSet.OpenNext: boolean; // Open next rowset in statement. if rowset is not provided then OpenNext return False. If statement has error, then raised exception +begin + if Prepared then + DatabaseError(SOpenNextPreparedSQL); + + Result := FCanOpenNext; + if Result then + BeginConnection; + try + FIRecordSet.SetProp(prLockClearMultipleResults, True); + try + Close; + Unprepare; + finally + FIRecordSet.SetProp(prLockClearMultipleResults, False); + end; + + if Result then begin + FieldDefs.Updated := False; + Open; + end; + finally + if Result then + EndConnection; + end; +end; + +function TCustomMSDataSet.FindParam(const Value: string): TMSParam; +begin + Result := inherited FindParam(GetParamNameWODog(Value)) as TMSParam; +end; + +function TCustomMSDataSet.ParamByName(const Value: string): TMSParam; +begin + Result := inherited ParamByName(GetParamNameWODog(Value)) as TMSParam; +end; + +procedure TCustomMSDataSet.CreateProcCall(Name: string); +begin + InternalCreateProcCall(Name, True); +end; + +procedure TCustomMSDataSet.Post; +begin + inherited; + +{$IFNDEF STD} + if FNeedSmartRefresh then + DoSmartRefresh; +{$ENDIF} +end; + +procedure TCustomMSDataSet.Cancel; +begin + inherited; + +{$IFNDEF STD} + if FNeedSmartRefresh then + DoSmartRefresh; +{$ENDIF} +end; + +function TCustomMSDataSet.SQLAddWhere(SQLText, Condition: string): string; +begin + Result := {$IFDEF CLR}CoreLab.Sdac.{$ENDIF}MSAccess.AddWhere(SQLText, Condition); +end; + +function TCustomMSDataSet.SQLDeleteWhere(SQLText: string): string; +begin + Result := {$IFDEF CLR}CoreLab.Sdac.{$ENDIF}MSAccess.DeleteWhere(SQLText); +end; + +function TCustomMSDataSet.SQLGetWhere(SQLText: string): string; +begin + Result := {$IFDEF CLR}CoreLab.Sdac.{$ENDIF}MSAccess.GetWhere(SQLText); +end; + +function TCustomMSDataSet.SQLSetOrderBy(SQLText: string; Fields: string): string; +begin + Result := {$IFDEF CLR}CoreLab.Sdac.{$ENDIF}MSAccess.SetOrderBy(SQLText, Fields); +end; + +function TCustomMSDataSet.SQLGetOrderBy(SQLText: string): string; +begin + Result := {$IFDEF CLR}CoreLab.Sdac.{$ENDIF}MSAccess.GetOrderBy(SQLText); +end; + +(*procedure TCustomMSDataSet.SetBeforeFetch(Value: TBeforeFetchEvent); +begin + inherited; + FIRecordSet.SetProp(prBeforeFetch, Assigned(BeforeFetch)); +end; + +procedure TCustomMSDataSet.SetAfterFetch(Value: TAfterFetchEvent); +begin + inherited; + FIRecordSet.SetProp(prAfterFetch, Assigned(AfterFetch)); +end;*) + +procedure TCustomMSDataSet.SetRefreshOptions(Value: TRefreshOptions); +begin + inherited SetRefreshOptions(Value); + if FIRecordSet <> nil then + FIRecordSet.SetProp(prRoAfterUpdate, roAfterUpdate in RefreshOptions); +end; + +procedure TCustomMSDataSet.WriteFieldXMLDataType(Field: TField; FieldDesc: TFieldDesc; + const FieldAlias: string; XMLWriter: XMLTextWriter); +begin + inherited; + + if FieldDesc is TOLEDBFieldDesc then begin + if TOLEDBFieldDesc(FieldDesc).IsAutoIncrement + and not (Field.Required and not Field.ReadOnly) // Already writed in MemDS + then + XmlWriter.WriteAttributeString('rs:maybenull', 'false'); + end; +end; + +procedure TCustomMSDataSet.WriteFieldXMLAttributeType(Field: TField; FieldDesc: TFieldDesc; + const FieldAlias: string; XMLWriter: XMLTextWriter); +begin + inherited; + + if FieldDesc is TOLEDBFieldDesc then begin + if TOLEDBFieldDesc(FieldDesc).BaseCatalogName <> '' then + XmlWriter.WriteAttributeString('rs:basecatalog', XMLEncode(TOLEDBFieldDesc(FieldDesc).BaseCatalogName)); + + if TOLEDBFieldDesc(FieldDesc).BaseSchemaName <> '' then + XmlWriter.WriteAttributeString('rs:baseschema', XMLEncode(TOLEDBFieldDesc(FieldDesc).BaseSchemaName)); + + if TOLEDBFieldDesc(FieldDesc).IsTimestamp then + XmlWriter.WriteAttributeString('rs:rowver', 'true'); + end; +end; + +procedure TCustomMSDataSet.GetKeyAndDataFields( + out KeyAndDataFields: TKeyAndDataFields; + const ForceUseAllKeyFields: boolean); + + procedure ProcessField(FieldDesc: TOLEDBFieldDesc); + begin + if FieldDesc.IsKey or FieldDesc.IsAutoIncrement then begin + SetLength(KeyAndDataFields.KeyFieldDescs, Length(KeyAndDataFields.KeyFieldDescs) + 1); + KeyAndDataFields.KeyFieldDescs[High(KeyAndDataFields.KeyFieldDescs)] := FieldDesc; + end; + + if not FieldDesc.ReadOnly then begin + SetLength(KeyAndDataFields.DataFieldDescs, Length(KeyAndDataFields.DataFieldDescs) + 1); + KeyAndDataFields.DataFieldDescs[High(KeyAndDataFields.DataFieldDescs)] := FieldDesc; + end; + end; + +var + ByTable: boolean; + Field: TField; + FieldDesc: TOLEDBFieldDesc; + i: integer; + IsNeedProcessField: boolean; + +begin + if (Length(FCachedKeyAndDataFields[ForceUseAllKeyFields].KeyFieldDescs) = 0) and (Length(FCachedKeyAndDataFields[ForceUseAllKeyFields].DataFieldDescs) = 0) then begin + // Search fields + + SetLength(KeyAndDataFields.KeyFieldDescs, 0); + SetLength(KeyAndDataFields.DataFieldDescs, 0); + + if (Fields.Count = 0) or (FIRecordSet.Fields.Count = 0) then + Exit; + + ByTable := False; + if FUpdatingTableInfoIdx >= 0 then + if Self is TCustomMSTable then + ByTable := True + else + if not ForceUseAllKeyFields or not Options.FullRefresh then + ByTable := True; + + for i := 0 to Fields.Count - 1 do begin + Field := Fields[i]; + if Field.FieldKind = fkData then begin + FieldDesc := GetFieldDesc(Field) as TOLEDBFieldDesc; + if ByTable then + IsNeedProcessField := (Self is TCustomMSTable) or (FieldDesc.TableInfo = TablesInfo[FUpdatingTableInfoIdx]) + else + IsNeedProcessField := True; + if IsNeedProcessField then + ProcessField(FieldDesc); + end; + end; + + // Cache result + FCachedKeyAndDataFields[ForceUseAllKeyFields] := KeyAndDataFields; + end + else // Get fields from cache + KeyAndDataFields := FCachedKeyAndDataFields[ForceUseAllKeyFields]; +end; + +procedure TCustomMSDataSet.BeginConnection(NoConnectCheck: boolean = True); +begin + if FIRecordSet.NativeRowset then + inherited; +end; + +procedure TCustomMSDataSet.EndConnection; +begin + if FIRecordSet.NativeRowset then + inherited; +end; + +procedure TCustomMSDataSet.SetNumberRange(FieldDef: TFieldDef); +var + Field: TField; + FieldDesc: TOLEDBFieldDesc; +{$IFDEF VER6P} + mv: Extended; +{$ENDIF} + AIConnection: TOLEDBConnection; + ServerVersion: integer; +begin + AIConnection := TMSAccessUtils.FIConnection(Connection); + ServerVersion := 0; + if AIConnection <> nil then + ServerVersion := AIConnection.ProviderPrimaryVer; + Field := FindField(FieldDef.Name); + if Field <> nil then begin + FieldDesc := GetFieldDesc(Field) as TOLEDBFieldDesc; + case FieldDesc.OLEDBType of + DBTYPE_UI1: + begin + Assert(Field is TWordField); + TWordField(Field).MinValue := 0; + TWordField(Field).MaxValue := 255; + end; + else + case FieldDesc.DataType of + dtInt8: + begin + TIntegerField(Field).MinValue := -128; + TIntegerField(Field).MaxValue := 127; + end; + dtInt16: + begin + if ServerVersion = 3 then begin + TSmallIntField(Field).MinValue := -32768; + TSmallIntField(Field).MaxValue := 32767; + end + else begin + TIntegerField(Field).MinValue := -32768; + TIntegerField(Field).MaxValue := 32767; + end; + end; + dtInt32: + begin + TIntegerField(Field).MinValue := -2147483647; + TIntegerField(Field).MaxValue := 2147483647; + end; + dtInt64: + begin + TLargeintField(Field).MinValue := -9223372036854775807; + TLargeintField(Field).MaxValue := 9223372036854775807; + end; + dtWord: + begin + TWordField(Field).MinValue := 0; + TWordField(Field).MaxValue := 65535; + end; + dtFloat: + begin + if FieldDesc.Scale = 255 then begin + if FieldDesc.Length = 7 then begin + TFloatField(Field).MinValue := -3.40E38; + TFloatField(Field).MaxValue := 3.40E38; + end + else + begin + TFloatField(Field).MinValue := -1.79E308; + TFloatField(Field).MaxValue := 1.79E308; + end; + end + else + if (FieldDesc.Length > 0) then begin + TFloatField(Field).Precision := FieldDesc.Length; + TFloatField(Field).MaxValue := + IntPower(10, FieldDesc.Length - FieldDesc.Scale) - + IntPower(10, - Integer(FieldDesc.Scale)); + TFloatField(Field).MinValue := -TFloatField(Field).MaxValue; + end; + end; + dtBCD: + begin + TBCDField(Field).Precision := FieldDesc.Length; + if (FieldDesc.Length > 0) and (FieldDesc.Length <= 15) then begin + TBCDField(Field).MaxValue := + IntPower(10, FieldDesc.Length - FieldDesc.Scale) - + IntPower(10, - Integer(FieldDesc.Scale)); + TBCDField(Field).MinValue := -TBCDField(Field).MaxValue; + end; + end; + {$IFDEF VER6P} + dtFmtBCD: + begin + TFMTBCDField(Field).Precision := FieldDesc.Length; + if (FieldDesc.Length > 0) and (FieldDesc.Length <= 15) then begin + mv := + IntPower(10, FieldDesc.Length - FieldDesc.Scale) - + IntPower(10, - Integer(FieldDesc.Scale)); + TFMTBCDField(Field).MaxValue := FloatToStr(mv); + TFMTBCDField(Field).MinValue := FloatToStr(-mv); + end; + end; + {$ENDIF} + dtCurrency: + if ServerVersion <> 3 then begin + if FieldDesc.Length = 10 then begin + TFloatField(Field).MinValue := -214748.3648 ; + TFloatField(Field).MaxValue := 214748.3647; + end + else + if FieldDesc.Length = 19 then begin + TFloatField(Field).MinValue := -922337203685477.5808; + TFloatField(Field).MaxValue := 922337203685477.5807; + end; + end + else begin + TCurrencyField(Field).MinValue := -922337203685477.5808; + TCurrencyField(Field).MaxValue := 922337203685477.5807; + end; + end; + end; + end; +end; + +procedure TCustomMSDataSet.DetectIdentityField; +var + i: integer; + Field: TField; + FieldDesc: TOLEDBFieldDesc; +begin + inherited; + + //Search Identity Field + for i := FieldCount - 1 downto 0 do begin + Field := Fields[i]; + + if Field.FieldKind = fkData then begin + FieldDesc := TOLEDBFieldDesc(GetFieldDesc(Field)); + + if FieldDesc.IsAutoIncrement then begin + + Assert((FUpdatingTableInfoIdx >= - 1) and (FUpdatingTableInfoIdx < TablesInfo.Count)); + + if (FUpdatingTableInfoIdx >= 0) + and (FIRecordSet.TablesInfo.IndexByName(GenerateTableName(FieldDesc.BaseCatalogName, FieldDesc.BaseSchemaName, FieldDesc.BaseTableName, Connection.Database)) = FUpdatingTableInfoIdx) then + FIdentityField := Field; + end; + end; + end; +end; + +procedure TCustomMSDataSet.SetOptions(Value: TMSDataSetOptions); +begin + Options.Assign(Value); +end; + +{ +procedure TCustomMSDataSet.AssignFieldValue(Param: TParam; Field: TField; Old: boolean); +begin + inherited; + if Field.IsNull then + Param.Clear; +end; +} + +function TCustomMSDataSet.NeedReturnParams: boolean; +begin + Result := inherited NeedReturnParams or FOptions.FDMLRefresh; +end; + +procedure TCustomMSDataSet.AssignFieldValue(Param: TDAParam; Field: TField; Old: boolean); +var + FieldDesc: TOLEDBFieldDesc; +begin + if TDBAccessUtils.IsObjectDataType(Param, Field.DataType) then begin + FieldDesc := TOLEDBFieldDesc(GetFieldDesc(Field)); + TMSParam(Param).OLEDBType := FieldDesc.OLEDBType; + end; + + inherited AssignFieldValue(Param, Field, Old); +end; + +function TCustomMSDataSet.GetRecord(Buffer: TRecordBuffer; GetMode: TGetMode; DoCheck: boolean): TGetResult; +begin + Result := grError; + if (FCursorType = ctDynamic) and (BufferCount > 1) then + DatabaseError(SBookmarksRequired) + else + Result := inherited GetRecord(Buffer, GetMode, DoCheck); +end; + +procedure TCustomMSDataSet.InternalSetToRecord(Buffer: TRecordBuffer); +begin + inherited; + + if (FCursorType in ServerCursorTypes) and (GetBookmarkFlag(Buffer) <> bfInserted) then + GetRecord(Buffer, gmCurrent, True); +end; + +procedure TCustomMSDataSet.DoAfterExecute(Result: boolean); +begin + inherited; +{$IFDEF SMART_REFRESH} +{$IFNDEF STD} + if (FRefreshServiceBroker <> nil) and (not TMSServiceBroker(FRefreshServiceBroker).Active) then + TMSServiceBroker(FRefreshServiceBroker).Start; +{$ENDIF} +{$ENDIF} +end; + +{ Smart Refresh} +{$IFNDEF STD} +procedure TCustomMSDataSet.DoSmartRefresh; +begin + if State in [dsInsert,dsEdit] then + FNeedSmartRefresh := True + else begin + Refresh; + if Assigned(FAfterSmartRefresh) then + FAfterSmartRefresh(Self); + FNeedSmartRefresh := False; + end; +end; +{$ENDIF} + +{ Before / After UpdateExecute } + +function TCustomMSDataSet.AssignedBeforeUpdateExecute: boolean; +begin + Result := Assigned(FBeforeUpdateExecute); +end; + +procedure TCustomMSDataSet.DoBeforeUpdateExecute(Sender: TDataSet; StatementTypes: TStatementTypes; + Params: TDAParams); +begin + if AssignedBeforeUpdateExecute then + FBeforeUpdateExecute(Sender as TCustomMSDataSet, StatementTypes, Params as TMSParams); +end; + +function TCustomMSDataSet.AssignedAfterUpdateExecute: boolean; +begin + Result := Assigned(FAfterUpdateExecute); +end; + +procedure TCustomMSDataSet.DoAfterUpdateExecute(Sender: TDataSet; StatementTypes: TStatementTypes; + Params: TDAParams); +begin + if AssignedAfterUpdateExecute then + FAfterUpdateExecute(Sender as TCustomMSDataSet, StatementTypes, Params as TMSParams); +end; + +function TCustomMSDataSet.GetRecCount: longint; + function GetCount(const s: string): longint; + var + i: integer; + OldParamCheck: boolean; + UQ: TCustomMSDataSet; + AIConnection: TOLEDBConnection; + begin + CheckUpdateQuery(stCustom); + UQ := FUpdateQuery as TCustomMSDataSet; + + OldParamCheck := UQ.ParamCheck; + try + UQ.ParamCheck := ParamCheck; + UQ.SQL.Text := s; + if not ParamCheck then + for i := 0 to Params.Count {without -1!} do + UQ.Params.Add; + + if UQ.ParamCount > 0 then begin + UQ.Params[0].DataType := ftLargeint; + UQ.Params[0].ParamType := ptOutput; + end; + + UQ.Macros.Assign(Macros); + for i := 0 to Params.Count - 1 do + UQ.Params[i + 1].Assign(Params[i]); + + AIConnection := TMSAccessUtils.FIConnection(Connection); + if (AIConnection <> nil) and (AIConnection.ProviderPrimaryVer <> 3) then begin + UQ.Execute; + Result := UQ.Params[0].Value; + end + else begin + UQ.Open; + Result := UQ.Fields[0].Value; + end; + finally + UQ.ParamCheck := OldParamCheck; + end; + end; + +var + Parser: TMSParser; + SelectPos: integer; + FromPos: integer; + s: string; + CountParamName: string; + +begin + if ((not FetchAll or Options.NonBlocking) and FOptions.QueryRecCount) // Server cursors or DefaultResultSet with FetchAll = False + and not ((Params.Count > 0) and (Params[0].ParamType = ptResult)) then begin // Current SQL does not have RETURN parameter + s := FinalSQL; + s := {$IFDEF CLR}CoreLab.Sdac.{$ENDIF}MSAccess.SetOrderBy(s, ''); + Parser := TMSParser.Create(s); + Parser.OmitBlank := False; + Parser.OmitComment := True; + try + if Parser.ToLexem(lxSELECT) <> lcEnd then begin + SelectPos := Parser.CurrPos; + if Parser.ToLexem(lxFROM) <> lcEnd then begin + FromPos := Parser.CurrPos; + + if Connection.Options.Provider <> prCompact then begin + if ParamCheck then + CountParamName := ':SDAC_COUNT' + else + CountParamName := '?'; + s := 'SET ' + CountParamName + ' = (' + Copy(s, 1, SelectPos) + ' COUNT(*)' + Copy(s, FromPos - 4 {length('FROM')}, MaxInt) + ')'; + end + else begin + CountParamName := 'SDAC_COUNT'; + s := Copy(s, 1, SelectPos) + ' COUNT(*) AS ' + CountParamName + ' ' + Copy(s, FromPos - 4 {length('FROM')}, MaxInt); + end; + end; + end; + finally + Parser.Free; + end; + + if s <> '' then + Result := GetCount(s) + else + Result := 0; + end + else + Result := inherited GetRecCount; +end; + +function TCustomMSDataSet.GetRecordCount: integer; +begin + if (not FetchAll or Options.NonBlocking) and FOptions.QueryRecCount then // Server cursors or DefaultResultSet with FetchAll = False + Result := FRecordCount + else + Result := inherited GetRecordCount; +end; + +function TCustomMSDataSet.Fetched: boolean; +begin + if FCursorType in ServerCursorTypes then + Result := False + else + Result := inherited Fetched; +end; + +procedure TCustomMSDataSet.DoCursorTypeChanged; +var + v: Variant; +begin + // Does not need to read ReadOnly property (for changes to static cursor) + // FIRecordSet.GetProp(prReadOnly, @ReadOnly); + + FIRecordSet.GetProp(prCursorType, v); + FCursorType := TMSCursorType(v); + raise EDAError.Create(0, SCursorTypeChanged); +end; + +procedure TCustomMSDataSet.SetFetchAll(Value: boolean); +begin + if FetchAll <> Value then + UnPrepare; + + inherited; +end; + +procedure TCustomMSDataSet.UpdateExecute(const StatementTypes: TStatementTypes); +var + UserSQL, ROnly: boolean; + IdentityParamIdx: integer; + UQParams: TDAParams; + NewIdentityValue: variant; + AIConnection: TOLEDBConnection; +begin + IdentityParamIdx := - 1; + UQParams := TDBAccessUtils.GetParams(FUpdateQuery); + AIConnection := TMSAccessUtils.FIConnection(Connection); + if stInsert in StatementTypes then begin + if Assigned(UpdateObject) then + UserSQL := UpdateObject.SQL[DB.ukInsert].Count > 0 + else + UserSQL := FUpdateSQL[stInsert].Count > 0; + + if not UserSQL then begin // This is not custom user statement and last parameter is used for Identity + if Options.QueryIdentity and (FIdentityField <> nil) and (CursorType = ctDefaultResultSet) then begin + if (AIConnection <> nil) and (AIConnection.ProviderPrimaryVer = 3) then + IdentityParamIdx := 0 + else begin + IdentityParamIdx := UQParams.Count - 1; + Assert(IdentityParamIdx >= 0); + // UQParams[IdentityParamIdx].ParamType := ptInputOutput; - already setted by AddParam + end; + end; + end; + end; + + inherited; + + if (IdentityParamIdx >= 0) and not NeedReturnParams then begin + ROnly := FIdentityField.ReadOnly; + if ROnly then begin + SetTempState(State); // DisableControls + FIdentityField.ReadOnly := False; + end; + if (AIConnection <> nil) and (AIConnection.ProviderPrimaryVer = 3) then begin + TDBAccessUtils.GetSQL(FUpdateQuery).Text := 'SELECT @@IDENTITY'; + TDBAccessUtils.Open(FUpdateQuery); + NewIdentityValue := TCustomMSDataSet(FUpdateQuery).Fields[IdentityParamIdx].Value; + end + else + NewIdentityValue := UQParams[IdentityParamIdx].Value; + + FIdentityField.NewValue := NewIdentityValue; + + if ROnly then begin + FIdentityField.ReadOnly := True; + RestoreState(State); + end + end; +end; + +procedure TCustomMSDataSet.InternalRefreshRecord; +var + Bookmark: TBookmark; +begin + case FCursorType of + ctDefaultResultSet: + inherited; + ctStatic, ctKeySet: + begin + Bookmark := GetBookmark; + try + FIRecordSet.SetToBookmark(Bookmark); // ReFetch + finally + FreeBookmark(Bookmark); + end; + FRowsAffected := 1; // Must be always OK + end; + ctDynamic: + begin + if FIRecordSet.FetchToBookmarkValue then + FRowsAffected := 1 + else + FRowsAffected := 0; + end; + end; +end; + +procedure TCustomMSDataSet.CheckUpdateQuery(const StatementType: TStatementType); +var + UseMSSQL: boolean; +begin + FUpdateQuery := FUpdateComponents[StatementType]; + if FUpdateQuery = nil then begin + if not __UseUpdateOptimization then + UseMSSQL := False + else + case StatementType of + stInsert, stUpdate: + UseMSSQL := not Options.DMLRefresh; + stDelete: + UseMSSQL := True; + else + UseMSSQL := False; + end; + if UseMSSQL and (Connection.Options.Provider = prCompact) then + UseMSSQL := not (Options.QueryIdentity and (FIdentityField <> nil)); + if UseMSSQL then begin + Assert(UsedConnection <> nil); + FUpdateQuery := TMSSQL.Create(nil); + TMSSQL(FUpdateQuery).Connection := TMSConnection(UsedConnection); + end; + end; + FUpdateComponents[StatementType] := FUpdateQuery; + + inherited; + + Assert(FUpdateComponents[StatementType] = FUpdateQuery); + + if FUpdateQuery is TCustomMSDataSet then begin + TCustomMSDataSet(FUpdateQuery).FetchAll := True; + TCustomMSDataSet(FUpdateQuery).ReadOnly := True; + TCustomMSDataSet(FUpdateQuery).Options.FlatBuffers := True; + TCustomMSDataSet(FUpdateQuery).Options.NumberRange := False; + TCustomMSDataSet(FUpdateQuery).Options.QueryRecCount := False; + TCustomMSDataSet(FUpdateQuery).Options.QuoteNames := False; + TCustomMSDataSet(FUpdateQuery).Options.UniqueRecords := False; + TCustomMSDataSet(FUpdateQuery).Options.FullRefresh := Options.FullRefresh; + + TCustomMSDataSet(FUpdateQuery).FIRecordSet.SetProp(prRequestSQLObjects, False); + end; +end; + +function TCustomMSDataSet.UseParamType: boolean; +begin + Result := FUseParamType; +end; + +function TCustomMSDataSet.PerformSQL(const SQL: string; const StatementTypes: TStatementTypes): boolean; +begin + try + Result := inherited PerformSQL(SQL, StatementTypes); + finally + FUseParamType := False; + end; +end; + +function ConvertCRParamTypeToBDE(const Value: TParamDirection): TParamType; +begin + case Value of + pdInput: + Result := ptInput; + pdInputOutput: + Result := ptInputOutput; + pdResult: + Result := ptResult; + else + Assert(False, 'Invalid value in ConvertCRParamTypeToBDE(const Value: TParamDirection): TParamType'); + Result := ptUnknown; // To prevent compiler warning + end; +end; + +procedure TCustomMSDataSet.InternalCreateProcCall(Name: string; NeedDescribe: boolean); +var + i: integer; + ParamDescs: TParamDescs; + ParamDesc: CRAccess.TParamDesc; + + Param: TMSParam; + ParamType: TParamType; + IsNewParam: boolean; + ft: TFieldType; + + ProcCallSQL: string; +{$IFDEF VER6P} + EnableFmtBcd: variant; +{$ENDIF} +begin + BeginConnection; + try + if not NeedDescribe then + TMSSQL(FCommand).WriteParams(False); + + {$IFDEF VER6P} + EnableFmtBcd := FIRecordSet.GetProp(prEnableFMTBCD, EnableFmtBcd); + {$ENDIF} + ProcCallSQL := FICommand.CreateProcCall(Name, NeedDescribe, True, Options.EnableBCD, {$IFDEF VER6P}Boolean(EnableFmtBcd){$ELSE}False{$ENDIF}); + + if NeedDescribe then + TMSSQL(FCommand).CreateParams; + + if NeedDescribe and (Params <> nil) then begin + ParamDescs := TOLEDBCommand(FICommand).Params; + for i := 0 to ParamDescs.Count - 1 do begin + ParamDesc := ParamDescs[i]; + ParamType := ConvertCRParamTypeToBDE(ParamDesc.GetParamType); + + Param := Params.FindParam(ParamDesc.GetName); + IsNewParam := Param = nil; + if IsNewParam then + Param := TMSParam.Create(Params, ParamType); + + Param.ParamType := ParamType; + ft := GetFieldType(ParamDesc.GetDataType); + if ft <> Param.DataType then + Param.DataType := ft; // To prevent clearing Param.Value on set DataType + Param.Name := ParamDesc.GetName; + if IsNewParam then + Param.Value := ParamDesc.GetValue; + Param.Size := ParamDesc.GetSize; + end; + + FICommand.SetProp(prDisableParamScan, True); + try + FCommand.SQL.Text := ProcCallSQL; + finally + FICommand.SetProp(prDisableParamScan, False); + end; + end; + finally + EndConnection; + end; +end; + +function TCustomMSDataSet.IsRefreshQuickField(FieldDesc: TFieldDesc): boolean; +begin + Result := TOLEDBFieldDesc(FieldDesc).IsTimestamp; +end; + +procedure TCustomMSDataSet.SaveMaxRefreshQuickValue(FieldDesc: TFieldDesc; const Value: variant); +var + Field: TOLEDBFieldDesc; + Val: Int64; +{$IFDEF CLR} + Data: TBytes; +{$ENDIF} +begin + Field := TOLEDBFieldDesc(FIRecordSet.FindField(FieldDesc.Name)); + if (Field <> nil) and Field.IsTimestamp and (Field.TableInfo <> nil) then begin + {$IFDEF CLR} + Data := TBytes(Value); + System.Array.Reverse(Data, 0, SizeOf(Int64)); + Val := BitConverter.ToInt64(Data, 0); + {$ELSE} + Val := Int64(TVarData(Value).VArray.Data^); + Reverse8(@Val); + {$ENDIF} + if {$IFDEF VER7P}UInt64{$ENDIF}(TOLEDBTableInfo(Field.TableInfo).MaxTimestamp) < {$IFDEF VER7P}UInt64{$ENDIF}(Val) then + TOLEDBTableInfo(Field.TableInfo).MaxTimestamp := Val; + end; +end; + +{ TMSUpdateSQL } + +function TMSUpdateSQL.DataSetClass: TCustomDADataSetClass; +begin + Result := TCustomMSDataSet; +end; + +function TMSUpdateSQL.SQLClass: TCustomDASQLClass; +begin + Result := TMSSQL; +end; + +{ TMSQuery } + +procedure TMSQuery.SetIRecordSet(Value: TData); +begin + inherited; + + FIRecordSet := TOLEDBRecordSet(Value); +end; + +procedure TCustomMSDataSet.SetCursorType(const Value: TMSCursorType); +begin + if FCursorType <> Value then begin + CheckInactive; + FieldDefs.Updated := False; + FCursorType := Value; + if FIRecordSet <> nil then + FIRecordSet.SetProp(prCursorType, Integer(CursorType)); + end; +end; + +procedure TCustomMSDataSet.SetCommandTimeout(const Value: integer); +begin + if FCommandTimeout <> Value then begin + FCommandTimeout := Value; + if FIRecordSet <> nil then + FIRecordSet.SetProp(prCommandTimeout, FCommandTimeout); + end; +end; + +procedure TCustomMSDataSet.BreakExec; +begin + Assert(FICommand <> nil); + if FICommand.Executing then + FICommand.BreakExec; + FIRecordSet.BreakFetch; +end; + +procedure TCustomMSDataSet.RefreshQuick(const CheckDeleted: boolean); +begin + InternalRefreshQuick(CheckDeleted); +end; + +procedure TCustomMSDataSet.CheckInactive; +begin + inherited; +end; + +function TCustomMSDataSet.GetUpdateObject: TMSUpdateSQL; +begin + Result := TMSUpdateSQL(inherited UpdateObject); +end; + +procedure TCustomMSDataSet.SetUpdateObject(Value: TMSUpdateSQL); +begin + inherited UpdateObject := Value; +end; + +{ TMSTable } + +function TCustomMSTable.PSGetTableName: string; +begin + Result := TableName; +end; + +procedure TCustomMSTable.PSSetParams(AParams: DB.TParams); +var + St: string; + i: integer; +begin + if (Params.Count <> AParams.Count) then begin + SQL.Text := ''; + St := ''; + + for i := 0 to AParams.count - 1 do begin + if St <> '' then + St := St + ' AND '; + St := AParams[i].Name + ' = :' + AParams[i].Name; + end; + + PrepareSQL; + + if St <> '' then + AddWhere(St); + end; + + inherited; +end; + +{$IFDEF VER5P} + +procedure TCustomMSTable.PSSetCommandText(const CommandText: string); +begin + if CommandText <> '' then + TableName := CommandText; +end; + +{$ENDIF} + +procedure TCustomMSTable.SetTableName(const Value: string); +begin + if not (csReading in ComponentState) then + Active := False; + FTableName := UnbracketIfPossible(Trim(Value)); + + SQL.Clear; +end; + +procedure TCustomMSTable.SetOrderFields(Value: string); +var + OldActive: boolean; +begin + Value := Trim(Value); + if Value <> FOrderFields then begin + FOrderFields := Value; + OldActive := Active; + if not (csLoading in ComponentState) then + SQL.Text := ''; + + if OldActive then + Open; + end; +end; + +procedure TCustomMSTable.PrepareSQL; +var + St: string; + MasterPos: integer; + MasterName: string; + Param: TDAParam; +begin + //WAR TCustomMSStoredProc.PrepareSQL and TCustomMSTable.PrepareSQL is based on different principies and work in different ways + if TableName = '' then + DatabaseError(STableNameNotDefined); + + if SQL.Count = 0 then begin + St := 'SELECT * FROM ' + BracketIfNeed(TableName); + + if OrderFields <> '' then + St := St + ' ORDER BY ' + OrderFields; + + SQL.Text := St; + end; + + // CR 8883 + // for TMSQuery second MD-way is more useful + if (DataSource <> nil) and (FMasterFields <> '') and (FDetailFields <> '') and not DataSource.DataSet.Active// see TCustomDADataSet.GetFinalSQL + then begin + MasterPos := 1; + while True do begin + MasterName := ExtractFieldName(FMasterFields, MasterPos); + if MasterName <> '' then begin + Param := Params.FindParam(MasterName); + if Param <> nil then + Param.DataType := ftString; + end + else + break; + end; + end; +end; + +procedure TCustomMSTable.Prepare; +begin + PrepareSQL; + + inherited; +end; + +procedure TCustomMSTable.OpenCursor(InfoQuery: boolean); +begin + PrepareSQL; + + inherited; +end; + +procedure TCustomMSTable.Execute; +begin + PrepareSQL; + + inherited; +end; + +procedure TCustomMSTable.AssignTo(Dest: TPersistent); +begin + inherited; + + if Dest is TCustomMSTable then begin + TCustomMSTable(Dest).OrderFields := OrderFields; + TCustomMSTable(Dest).TableName := TableName; + TCustomMSTable(Dest).MasterSource := MasterSource; + TCustomMSTable(Dest).MasterFields := MasterFields; + TCustomMSTable(Dest).DetailFields := DetailFields; + end; +end; + +{ TCustomMSStoredProc } + +{$IFDEF VER5P} + +procedure TCustomMSStoredProc.PSSetCommandText(const CommandText: string); +begin + if CommandText <> '' then + StoredProcName := CommandText; +end; + +{$ENDIF} + +procedure TCustomMSStoredProc.SetIRecordSet(Value: TData); +begin + inherited; + + if FICommand <> nil then + FICommand.SetProp(prIsSProc, True); +end; + +procedure TCustomMSStoredProc.SetStoredProcName(const Value: string); +begin + if Value <> FStoredProcName then begin + SQL.Text := ''; + + FStoredProcName := Trim(Value); + + if (Connection <> nil) and Connection.Connected and (FStoredProcName <> '') then + PrepareSQL; + + if FICommand <> nil then + FICommand.SetProp(prIsSProc, True); + end; +end; + +procedure TCustomMSStoredProc.PrepareSQL; +begin + //WAR TCustomMSStoredProc.PrepareSQL and TCustomMSTable.PrepareSQL is based on different principies and work in different ways + + if SQL.Text = '' then begin + if StoredProcName = '' then + DatabaseError(SStoredProcNotDefined); + + InternalCreateProcCall(StoredProcName, Params.Count = 0); + end; +end; + +procedure TCustomMSStoredProc.Prepare; +begin + PrepareSQL; + + FIsInPrepare := True; + try + inherited; + finally + FIsInPrepare := False; + end; +end; + +procedure TCustomMSStoredProc.BeforeExecute; +begin + if not Prepared then + PrepareSQL; + + inherited; +end; + +procedure TCustomMSStoredProc.BeforeOpenCursor(InfoQuery: boolean); +begin + PrepareSQL; + + inherited; +end; + +procedure TCustomMSStoredProc.CreateFieldDefs; +begin + if not FIsInPrepare then + inherited; +end; + +procedure TCustomMSStoredProc.ExecProc; +begin + Execute; +end; + +procedure TCustomMSStoredProc.AssignTo(Dest:TPersistent); +var + I: Integer; + P: TMSParam; +begin + inherited; + + if Dest is TCustomMSStoredProc then begin + TCustomMSStoredProc(Dest).StoredProcName := FStoredProcName; + + for I := 0 to Params.Count - 1 do begin + P := TCustomMSStoredProc(Dest).FindParam(Params[I].Name); + if (P <> nil) and (P.DataType = Params[I].DataType) then begin + P.Assign(Params[I]); + end; + end; + end; +end; + +{ TMSMetadata } + +constructor TMSMetadata.Create(Owner: TComponent); +begin + inherited; + + Debug := False; + + ReadOnly := True; +end; + + +procedure TMSMetadata.SetDatabaseName(Value: string); +begin + Active := False; + FDatabaseName := Value; +end; + +procedure TMSMetadata.SetSchemaName(Value: string); +begin + Active := False; + FSchemaName := Value; +end; + +procedure TMSMetadata.SetObjectType(Value: TMSObjectType); +begin + Active := False; + FieldDefs.Updated := False; + FObjectType := Value; +end; + +procedure TMSMetadata.SetTableName(Value: string); +begin + Active := False; + FTableName := Value; +end; + +procedure TMSMetadata.SetStoredProcName(Value: string); +begin + Active := False; + FStoredProcName := Value; +end; + +procedure TMSMetadata.SetColumnName(Value: string); +begin + Active := False; + FColumnName := Value; +end; + +procedure TMSMetadata.SetIndexName(Value: string); +begin + Active := False; + FIndexName := Value; +end; + +procedure TMSMetadata.SetConstraintName(Value: string); +begin + Active := False; + FConstraintName := Value; +end; + +procedure TMSMetadata.SetLinkedServer(Value: string); +begin + Active := False; + FLinkedServer := Value; +end; + +procedure TMSMetadata.SetAssemblyName(Value: string); +begin + Active := False; + FAssemblyName := Value; +end; + +procedure TMSMetadata.SetAssemblyID(Value: integer); +begin + Active := False; + FAssemblyID := Value; +end; + +procedure TMSMetadata.SetReferencedAssemblyID(Value: integer); +begin + Active := False; + FReferencedAssemblyID := Value; +end; + +procedure TMSMetadata.SetUDTName(Value: string); +begin + Active := False; + FUDTName := Value; +end; + +procedure TMSMetadata.SetSchemaCollectionName(Value: string); +begin + Active := False; + FSchemaCollectionName := Value; +end; + +procedure TMSMetadata.SetTargetNamespaceURI(Value: string); +begin + Active := False; + FTargetNamespaceURI := Value; +end; + +function TMSMetadata.RequestIRowset: IRowset; + function GetTableType: string; + begin + case ObjectType of + otAliases, otAliasesInfo: + Result := 'ALIAS'; + otTables, otTablesInfo: + Result := 'TABLE'; + otSynonyms, otSynonymsInfo: + Result := 'SYNONYM'; + otSystemTables, otSystemTablesInfo: + Result := 'SYSTEM TABLE'; + otViews, otViewsInfo: + Result := 'VIEW'; + otGlobalTempTables, otGlobalTempTablesInfo: + Result := 'GLOBAL TEMPORARY'; + otLocalTempTables, otLocalTempTablesInfo: + Result := 'LOCAL TEMPORARY'; + otSystemViews, otSystemViewsInfo: + Result := 'SYSTEM VIEW'; + otExternalTablesInfo: + Result := 'EXTERNAL TABLE'; + end; + end; + +var + Schema: TGUID; + rgRestrictions: TRestrictions; +begin + BeginConnection; + try + case ObjectType of + otDatabases: + begin + SetLength(rgRestrictions, 1); + Schema := DBSCHEMA_CATALOGS; + rgRestrictions[0] := DatabaseName; + end; + otColumnPrivileges: + begin + SetLength(rgRestrictions, 6); + Schema := DBSCHEMA_COLUMN_PRIVILEGES; + rgRestrictions[0] := DatabaseName; + rgRestrictions[1] := SchemaName; + rgRestrictions[2] := TableName; + rgRestrictions[4 - 1] := ColumnName; + end; + otColumns: + begin + SetLength(rgRestrictions, 4); + Schema := DBSCHEMA_COLUMNS; + if Connection.Options.Provider <> prCompact then begin + rgRestrictions[0] := DatabaseName; + rgRestrictions[1] := SchemaName; + end; + rgRestrictions[2] := TableName; + rgRestrictions[4 - 1] := ColumnName; + end; + otForeignKeys: + begin + SetLength(rgRestrictions, 6); + rgRestrictions[3] := DatabaseName; + rgRestrictions[4] := SchemaName; + rgRestrictions[5] := TableName; + Schema := DBSCHEMA_FOREIGN_KEYS; + end; + otPrimaryKeys: + begin + if Connection.Options.Provider <> prCompact then begin + SetLength(rgRestrictions, 3); + rgRestrictions[0] := DatabaseName; + rgRestrictions[1] := SchemaName; + rgRestrictions[2] := TableName; + Schema := DBSCHEMA_PRIMARY_KEYS; + end + else begin + SetLength(rgRestrictions, 7); + rgRestrictions[2] := ConstraintName; + rgRestrictions[5] := TableName; + // Other Restriction columns not supported + Schema := DBSCHEMA_KEY_COLUMN_USAGE; + end; + end; + otIndexes: + begin + SetLength(rgRestrictions, 5); + if Connection.Options.Provider <> prCompact then begin + rgRestrictions[0] := DatabaseName; + rgRestrictions[1] := SchemaName; + end; + rgRestrictions[2] := IndexName; + rgRestrictions[4] := TableName; + Schema := DBSCHEMA_INDEXES; + end; + otServerTypes: + begin + SetLength(rgRestrictions, 0); + Schema := DBSCHEMA_PROVIDER_TYPES; + end; + otSchemata: + begin + SetLength(rgRestrictions, 2); + Schema := DBSCHEMA_SCHEMATA; + rgRestrictions[0] := DatabaseName; + rgRestrictions[1] := SchemaName; + end; + otStatistics: + begin + SetLength(rgRestrictions, 3); + Schema := DBSCHEMA_STATISTICS; + rgRestrictions[0] := DatabaseName; + rgRestrictions[1] := SchemaName; + rgRestrictions[2] := TableName; + end; + otStoredProcs: + begin + SetLength(rgRestrictions, 3); + Schema := DBSCHEMA_PROCEDURES; + rgRestrictions[0] := DatabaseName; + rgRestrictions[1] := SchemaName; + rgRestrictions[2] := StoredProcName; + end; + otStoredProcParams: + begin + SetLength(rgRestrictions, 3); + Schema := DBSCHEMA_PROCEDURE_PARAMETERS; + rgRestrictions[0] := DatabaseName; + rgRestrictions[1] := SchemaName; + rgRestrictions[2] := StoredProcName; + end; + otAliases, otTables, otSynonyms, otSystemTables, otViews, otGlobalTempTables, otLocalTempTables, otSystemViews, + otAliasesInfo, otTablesInfo, otSynonymsInfo, otSystemTablesInfo, otViewsInfo, otGlobalTempTablesInfo, otLocalTempTablesInfo, otExternalTablesInfo, otSystemViewsInfo: + begin + SetLength(rgRestrictions, 4); + + if ObjectType in [otAliases, otTables, otSynonyms, otSystemTables, otViews, otGlobalTempTables, otLocalTempTables, otSystemViews] then + Schema := DBSCHEMA_TABLES + else + Schema := DBSCHEMA_TABLES_INFO; + if Connection.Options.Provider <> prCompact then begin + rgRestrictions[0] := DatabaseName; + rgRestrictions[1] := SchemaName; + end; + rgRestrictions[2] := TableName; + rgRestrictions[3] := GetTableType; + end; + otTableConstraints: + begin + SetLength(rgRestrictions, 6); + Schema := DBSCHEMA_TABLE_CONSTRAINTS; + if Connection.Options.Provider <> prCompact then begin + rgRestrictions[0] := DatabaseName; + rgRestrictions[1] := SchemaName; + end; + rgRestrictions[2] := ConstraintName; + rgRestrictions[5] := TableName; + end; + otTablePrivileges: + begin + SetLength(rgRestrictions, 3); + Schema := DBSCHEMA_TABLE_PRIVILEGES; + rgRestrictions[0] := DatabaseName; + rgRestrictions[1] := SchemaName; + rgRestrictions[2] := TableName; + end; + otLinkedServers: begin + SetLength(rgRestrictions, CRESTRICTIONS_DBSCHEMA_LINKEDSERVERS{1}); + Schema := DBSCHEMA_LINKEDSERVERS; + rgRestrictions[0] := LinkedServer; + end; + otAssemblies: begin + SetLength(rgRestrictions, CRESTRICTIONS_DBSCHEMA_SQL_ASSEMBLIES{4}); + Schema := DBSCHEMA_SQL_ASSEMBLIES; + rgRestrictions[0] := DatabaseName; + rgRestrictions[1] := SchemaName; + rgRestrictions[2] := AssemblyName; + if AssemblyID <> 0 then + rgRestrictions[3] := AssemblyID; + end; + otAssemblyDependencies: begin + SetLength(rgRestrictions, CRESTRICTIONS_DBSCHEMA_SQL_ASSEMBLY_DEPENDENCIES{4}); + Schema := DBSCHEMA_SQL_ASSEMBLY_DEPENDENCIES; + rgRestrictions[0] := DatabaseName; + rgRestrictions[1] := SchemaName; + if AssemblyID <> 0 then + rgRestrictions[2] := AssemblyID; + if ReferencedAssemblyID <> 0 then + rgRestrictions[3] := ReferencedAssemblyID; + end; + otUserTypes: begin + SetLength(rgRestrictions, CRESTRICTIONS_DBSCHEMA_SQL_USER_TYPES{3}); + Schema := DBSCHEMA_SQL_USER_TYPES; + rgRestrictions[0] := DatabaseName; + rgRestrictions[1] := SchemaName; + rgRestrictions[2] := UDTName; + end; + otXMLCollections: begin + SetLength(rgRestrictions, CRESTRICTIONS_DBSCHEMA_XML_COLLECTIONS{4}); + Schema := DBSCHEMA_XML_COLLECTIONS; + rgRestrictions[0] := DatabaseName; + rgRestrictions[1] := SchemaName; + rgRestrictions[2] := SchemaCollectionName; + rgRestrictions[3] := TargetNamespaceURI; + end; + end; + + Result := FIRecordSet.GetSchemaRowset(Schema, rgRestrictions); + finally + EndConnection; + end; +end; + +procedure TMSMetadata.InternalExecute; +var + Rowset: IRowset; +begin + Rowset := RequestIRowset; + FIRecordSet.SetIRowset(Rowset, False); + inherited; +end; + +procedure TMSMetadata.OpenCursor(InfoQuery: boolean); +var + Rowset: IRowset; +begin + Rowset := RequestIRowset; + FIRecordSet.SetIRowset(Rowset, False); + inherited; +end; + +{ TMSSQL } + +constructor TMSSQL.Create(Owner: TComponent); +begin + inherited; + + FAutoCommit := True; + FCommandTimeout := 0; + Macros.SetParserClass(TMSParser); +end; + +function TMSSQL.GetPermitPrepare: boolean; +begin + Result := False; +end; + +procedure TMSSQL.SetPermitPrepare(Value: boolean); +begin +end; + +procedure TMSSQL.CreateICommand; +begin + inherited; + + if FICommand = nil then + SetICommand(TOLEDBCommand.Create); +end; + +procedure TMSSQL.SetICommand(Value: TCRCommand); +begin + FICommand := TOLEDBCommand(Value); + + if FICommand <> nil then begin + FICommand.SetProp(prCommandTimeout, CommandTimeout); + FICommand.ReadParams := ReadParams; + end; + + inherited; +end; + +procedure TMSSQL.InternalPrepare; +begin + if SQL.Count = 0 then + DatabaseError(SEmptySQLStatement, Self); + + WriteParams; + + inherited; +end; + +procedure TMSSQL.InternalExecute(Iters: integer); +begin + inherited; + FICommand.SetCursorState(csInactive); // To prevent blocking execute on second exec +end; + +function TMSSQL.GetConnection: TMSConnection; +begin + Result := TMSConnection(inherited Connection); +end; + +procedure TMSSQL.SetConnection(Value: TMSConnection); +begin + inherited Connection := Value; +end; + +function TMSSQL.GetParams: TMSParams; +begin + Result := TMSParams(inherited Params); +end; + +procedure TMSSQL.SetParams(Value: TMSParams); +begin + inherited Params := Value; +end; + +procedure TMSSQL.AssignTo(Dest: TPersistent); +begin + inherited; + + if Dest is TMSSQL then begin + TMSSQL(Dest).Params.Assign(Params); + TMSSQL(Dest).NonBlocking := NonBlocking; + TMSSQL(Dest).AfterExecute := AfterExecute; + end; +end; + +function TMSSQL.ParseSQL(const SQL: string; Params: TDAParams; RenamePrefix: string = ''): string; +begin +{$IFDEF CLR} + if SQL.IndexOf(Char(':')) = -1 then +{$ELSE} + if StrScan(PChar(SQL), ':') = nil then +{$ENDIF} + Result := SQL // query without parameters + else + Result := inherited ParseSQL(SQL, Params, RenamePrefix); +end; + +function TMSSQL.CreateParser(const Text: string): TParser; +begin + Result := TMSParser.Create(Text); +end; + +procedure TMSSQL.AssembleSQL; +begin + if ParamCheck or (csDesigning in ComponentState) then + inherited + else begin + FNativeSQL := SQL.Text; + FNativeSQL := ParseSQL(nil); + FICommand.SetSQL(FNativeSQL); + end; +end; + +function TMSSQL.CreateParamsObject: TDAParams; +begin + Result := TMSParams.Create(Self); +end; + +procedure TMSSQL.CreateParams; +var + ParamDesc: TOLEDBParamDesc; + i: integer; +begin + Params.BeginUpdate; + try + Params.Clear; + for i := 0 to FICommand.GetParamCount - 1 do begin + ParamDesc := FICommand.GetParam(i); + with Params.Add as TDAParam do begin + Name := ParamDesc.GetName; + DataType := GetFieldType(ParamDesc.GetDataType); + ParamType := TParamType(ParamDesc.GetParamType); + end; + end; + finally + Params.EndUpdate; + end; +end; + +procedure TMSSQL.WriteParams(WriteValue: boolean = True); +var + Param: TMSParam; + ParamDesc: TOLEDBParamDesc; + dt: word; + + procedure WriteParamValue; + var + Value: Variant; + {$IFDEF CLR} + Value1, Value2: TBytes; + {$ELSE} + Value1: Variant; + {$ENDIF} + i, l: integer; + s: string; + CurrentConnection: TMSConnection; + begin + if not Param.Bound then + TOLEDBParamDesc(ParamDesc).SetUseDefaultValue(True); + + if Param.IsObjectDataType then begin + ParamDesc.SetNull(Param.IsNull); + ParamDesc.SetObject(Param.ParamObject); + Exit; + end; + + Value := Param.Value; + if (Param.DataType = ftDate) and not (VarIsEmpty(Value) or VarIsNull(Value)) then + Value := Int(Value); // drop time info + + // SQL Server Everywhere + CurrentConnection := Connection; + if (CurrentConnection = nil) and (FDataSet <> nil) then + CurrentConnection := TMSConnection(FDataSet.Connection); + + Assert(CurrentConnection <> nil); + + if (CurrentConnection.Options.Provider = prCompact) and (Param.OLEDBType = DBTYPE_UI1) then + ParamDesc.SetDataType(dtInt8); + + // Convert param values if need + if (dt in [dtBytes, dtVarBytes, dtBlob]) + and (VarType(Value) <> varArray + varByte) then + case VarType(Value) of + varEmpty, varNull:; + varShortInt {1 byte}, + varSmallint {2 bytes}, + varInteger {4 bytes}, + varInt64 {8 bytes}, + varByte {1 byte}, + varWord {2 bytes}, + varLongWord {4 bytes}: begin + case VarType(Value) of + varShortInt, varByte: + l := 1; + varSmallint, varWord: + l := 2; + varInteger, varLongWord: + l := 4; + varInt64: + l := 8; + else + begin + Assert(False); + l := - 1; + end; + end; + + // reverse bytes order + {$IFDEF CLR} + Value1 := BitConverter.GetBytes(Int64(Value)); + //Assert(l = Length(Value1)); + SetLength(Value2, l); + for i := 0 to l - 1 do + Value2[i] := Value1[l - 1 - i]; + Value := Value2; + {$ELSE} + Value1 := VarArrayCreate([0, l - 1], varByte); + + for i := 0 to l - 1 do + PChar(TVarData(Value1).VArray.Data)[i] := PChar(@TVarData(Value).VInteger)[l - 1 - i]; + Value := Unassigned; + Value := Value1; + {$ENDIF} + end; + varString{$IFDEF CLR}, varChar{$ENDIF}: begin + s := Value; + Value := Encoding.Default.GetBytes(s); + end; + end; + ParamDesc.SetValue(Unassigned); + ParamDesc.SetValue(Value); + end; + +var + ft: TFieldType; + i, l: integer; +begin + for i := 0 to Params.Count - 1 do begin + Param := Params[i] as TMSParam; + if i < FICommand.GetParamCount then + ParamDesc := TOLEDBParamDesc(FICommand.GetParam(i)) + else + ParamDesc := TOLEDBParamDesc(FICommand.AddParam); + ParamDesc.SetName(Param.Name); + + ft := Param.DataType; + dt := GetDataType(ft); + if dt = dtUnknown then + case ft of + {$IFDEF VER5P} + ftGuid: + dt := dtGuid; + {$ENDIF} + ftUnknown: + dt := dtUnknown; + ftBCD: + dt := dtBCD; + ftWideString: + dt := dtWideString; + else + dt := dtString; + // Assert(False, Format('Invalid Param.DataType - %d', [Integer(ft)])); + end; + + Assert(Param is TMSParam, 'Param must be TMSParam'); + l := TMSParam(Param).Size; + ParamDesc.SetSize(l); + + ParamDesc.SetDataType(dt); + ParamDesc.SetParamType(TParamDirection(Param.ParamType)); + ParamDesc.SetOLEDBType(Param.OLEDBType); + + if WriteValue then + WriteParamValue; + end; + while Params.Count < FICommand.GetParamCount do + FICommand.DeleteParam(FICommand.GetParamCount - 1); +end; + +procedure TMSSQL.ReadParams; +var + v: Variant; +begin + if FICommand.IUnknownIsNull and FICommand.IMultipleResultsIsNull then begin + FICommand.GetProp(prCanReadParams, v); + if Boolean(v) then begin + inherited; + FICommand.SetProp(prCanReadParams, False); + end; + end; +end; + +function TMSSQL.FindParam(const Value: string): TMSParam; +begin + Result := inherited FindParam(GetParamNameWODog(Value)) as TMSParam; +end; + +function TMSSQL.ParamByName(const Value: string): TMSParam; +begin + Result := inherited ParamByName(GetParamNameWODog(Value)) as TMSParam; +end; + +procedure TMSSQL.SetCommandTimeout(const Value: integer); +begin + if FCommandTimeout <> Value then begin + FCommandTimeout := Value; + if FICommand <> nil then + FICommand.SetProp(prCommandTimeout, FCommandTimeout); + end; +end; + +procedure TMSSQL.SetNonBlocking(const Value: boolean); +begin + if FNonBlocking <> Value then begin + FNonBlocking := Value; + if FICommand <> nil then + FICommand.SetProp(prNonBlocking, FNonBlocking); + end; +end; + +procedure TMSSQL.Execute(Iters: integer); +begin + if NonBlocking and Executing then + DatabaseError(SAsynchExecuting); + + inherited Execute(Iters); +end; + +procedure TMSSQL.BreakExec; +begin + Assert(FICommand <> nil); + FICommand.BreakExec; +end; + +procedure TMSSQL.CreateProcCall(Name: string); +var + NeedDescribe: boolean; + ParamDescs: TParamDescs; + ParamDesc: CRAccess.TParamDesc; + + Param: TMSParam; + ParamType: TParamType; + IsNewParam: boolean; + ft: TFieldType; + i: integer; + + ProcCallSQL: string; +begin + BeginConnection; + try + NeedDescribe := Params.Count = 0; + if NeedDescribe then begin + ProcCallSQL := FICommand.CreateProcCall(Name, True, True, False, False); + CreateParams; + end + else begin + WriteParams(False); + ProcCallSQL := FICommand.CreateProcCall(Name, False, True, False, False); + end; + + if NeedDescribe and (Params <> nil) then begin + ParamDescs := TOLEDBCommand(FICommand).Params; + for i := 0 to ParamDescs.Count - 1 do begin + ParamDesc := ParamDescs[i]; + ParamType := ConvertCRParamTypeToBDE(ParamDesc.GetParamType); + + Param := Params.FindParam(ParamDesc.GetName); + IsNewParam := Param = nil; + if IsNewParam then + Param := TMSParam.Create(Params, ParamType); + + Param.ParamType := ParamType; + ft := GetFieldType(ParamDesc.GetDataType); + if ft <> Param.DataType then + Param.DataType := ft; // To prevent clearing Param.Value on set DataType + Param.Name := ParamDesc.GetName; + if IsNewParam then + Param.Value := ParamDesc.GetValue; + Param.Size := ParamDesc.GetSize; + end; + + FICommand.SetProp(prDisableParamScan, True); + try + SQL.Text := ProcCallSQL; + finally + FICommand.SetProp(prDisableParamScan, False); + end; + end; + finally + EndConnection; + end; +end; + +{ TMSXMLField } + +constructor TMSXMLField.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + + SetDataType(TFieldType(ftMSXML)); +end; + +procedure TMSXMLField.GetText(var Text: string; DisplayText: Boolean); +begin + Text := '(xml)'; + if not GetIsNull then + Text := AnsiUpperCase(Text); +end; + +procedure TMSXMLField.SetSchemaCollection(Name, CatalogName, SchemaName: string); +begin + FSchemaCollection.Name := Name; + FSchemaCollection.CatalogName := CatalogName; + FSchemaCollection.SchemaName := SchemaName; + FTyped := (FSchemaCollection.Name <> '') or (FSchemaCollection.CatalogName <> '') or + (FSchemaCollection.SchemaName <> ''); +end; + +function TMSXMLField.GetBlobSize: Integer; +begin + with DataSet.CreateBlobStream(Self, bmRead) do + try + Result := Size; + finally + Free; + end; +end; + +procedure TMSXMLField.Clear; +begin + DataSet.CreateBlobStream(Self, bmWrite).Free; +end; + +class function TMSXMLField.IsBlob: Boolean; +begin + Result := True; +end; + +procedure TMSXMLField.LoadFromFile(const FileName: string); +var + Stream: TStream; +begin + Stream := TFileStream.Create(FileName, fmOpenRead); + try + LoadFromStream(Stream); + finally + Stream.Free; + end; +end; + +procedure TMSXMLField.LoadFromStream(Stream: TStream); +begin + with DataSet.CreateBlobStream(Self, bmWrite) do + try + CopyFrom(Stream, 0); + finally + Free; + end; +end; + +procedure TMSXMLField.SaveToFile(const FileName: string); +var + Stream: TStream; +begin + Stream := TFileStream.Create(FileName, fmCreate); + try + SaveToStream(Stream); + finally + Stream.Free; + end; +end; + +procedure TMSXMLField.SaveToStream(Stream: TStream); +var + BlobStream: TStream; +begin + BlobStream := DataSet.CreateBlobStream(Self, bmRead); + try + Stream.CopyFrom(BlobStream, 0); + finally + BlobStream.Free; + end; +end; + +procedure TMSXMLField.SetFieldType(Value: TFieldType); +begin + SetDataType(Value); +end; + +{ TMSAccessUtils } + +class procedure TMSAccessUtils.GetKeyAndDataFields( + Obj: TCustomMSDataSet; + out KeyAndDataFields: TKeyAndDataFields; + const ForceUseAllKeyFields: boolean); +begin + Obj.GetKeyAndDataFields(KeyAndDataFields, ForceUseAllKeyFields); +end; + +class procedure TMSAccessUtils.SetDesigning(Obj: TCustomMSDataSet; Value: Boolean; SetChildren: Boolean = True); +begin + Obj.SetDesigning(Value, SetChildren); +end; + +class procedure TMSAccessUtils.SetLockLoginPromt(Obj: TMSConnection; Value: Boolean); +begin + Obj.FLockLoginPrompt := Value; +end; + +class function TMSAccessUtils.FIConnection(Obj: TMSConnection): TOLEDBConnection; +begin + Result := Obj.IConnection; +end; + +class function TMSAccessUtils.FIRecordSet(Obj: TCustomMSDataSet): TOLEDBRecordSet; +begin + Result := Obj.FIRecordSet; +end; + +class function TMSAccessUtils.GetOLEDBSQL(Obj: TCustomMSDataSet): string; +begin + Result := Obj.FICommand.SQL; +end; + +class function TMSAccessUtils.GetOLEDBSQL(Obj: TMSSQL): string; +begin + Result := Obj.FICommand.SQL; +end; + +type + _TOLEDBConnection = class(TOLEDBConnection); + +class function TMSAccessUtils.FIDBCreateSession(Obj: TOLEDBConnection): IDBCreateSession; +begin + Result := _TOLEDBConnection(Obj).FIDBCreateSession; +end; + +class procedure TMSAccessUtils.DoError(Obj: TMSConnection; E: Exception; var Fail: boolean); +begin + Assert(Obj.IConnection <> nil); + _TOLEDBConnection(Obj.IConnection).DoError(E, Fail); +end; + +initialization + __UseUpdateOptimization := True; + + try + TMSConnectionPoolManager.Clear; + except + end; + + if + {$IFDEF CLR} + CompareText(Assembly.GetCallingAssembly.GetName.Name, 'CoreLab.Sdac') = 0 + {$ELSE} + not IsLibrary + {$ENDIF} + then + Classes.RegisterClass(TMSXMLField); + +finalization + +end. diff --git a/internal/4.10.0.10/1/Source/MSConnectForm.dfm b/internal/4.10.0.10/1/Source/MSConnectForm.dfm new file mode 100644 index 0000000..b652187 --- /dev/null +++ b/internal/4.10.0.10/1/Source/MSConnectForm.dfm @@ -0,0 +1,132 @@ +object MSConnectForm: TMSConnectForm + Left = 269 + Top = 112 + ActiveControl = edUsername + BorderIcons = [] + BorderStyle = bsDialog + Caption = 'Connect' + ClientHeight = 210 + ClientWidth = 291 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + Scaled = False + PixelsPerInch = 96 + TextHeight = 13 + object Panel: TPanel + Left = 8 + Top = 8 + Width = 273 + Height = 156 + BevelInner = bvRaised + BevelOuter = bvLowered + FullRepaint = False + TabOrder = 0 + object lbUsername: TLabel + Left = 16 + Top = 20 + Width = 73 + Height = 13 + AutoSize = False + Caption = 'Username' + Layout = tlCenter + end + object lbPassword: TLabel + Left = 16 + Top = 54 + Width = 73 + Height = 13 + AutoSize = False + Caption = 'Password' + Layout = tlCenter + end + object lbServer: TLabel + Left = 16 + Top = 88 + Width = 73 + Height = 13 + AutoSize = False + Caption = 'Server' + Layout = tlCenter + end + object lbDatabase: TLabel + Left = 16 + Top = 123 + Width = 73 + Height = 13 + AutoSize = False + Caption = 'Database' + Layout = tlCenter + end + object edUsername: TEdit + Left = 104 + Top = 16 + Width = 153 + Height = 21 + AutoSelect = False + MaxLength = 32767 + TabOrder = 0 + end + object edPassword: TEdit + Left = 104 + Top = 50 + Width = 153 + Height = 21 + AutoSelect = False + MaxLength = 32767 + PasswordChar = '*' + TabOrder = 1 + end + object edServer: TComboBox + Left = 104 + Top = 84 + Width = 153 + Height = 21 + DropDownCount = 10 + ItemHeight = 13 + TabOrder = 2 + OnDropDown = edServerDropDown + end + object edDatabase: TComboBox + Left = 104 + Top = 119 + Width = 153 + Height = 21 + DropDownCount = 10 + ItemHeight = 13 + TabOrder = 3 + OnDropDown = edDatabaseDropDown + end + end + object btConnect: TButton + Left = 52 + Top = 176 + Width = 89 + Height = 25 + Caption = 'Connect' + Default = True + TabOrder = 1 + OnClick = btConnectClick + end + object btCancel: TButton + Left = 148 + Top = 176 + Width = 89 + Height = 25 + Cancel = True + Caption = 'Cancel' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + ModalResult = 2 + ParentFont = False + TabOrder = 2 + end +end diff --git a/internal/4.10.0.10/1/Source/MSConnectForm.pas b/internal/4.10.0.10/1/Source/MSConnectForm.pas new file mode 100644 index 0000000..26a186f --- /dev/null +++ b/internal/4.10.0.10/1/Source/MSConnectForm.pas @@ -0,0 +1,185 @@ + +////////////////////////////////////////////////// +// SQL Server Data Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +// Connect Form +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +unit MSConnectForm; +{$ENDIF} +interface +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, + StdCtrls, ExtCtrls, DBAccess, OLEDBAccess, OLEDBC, MSAccess, TypInfo; + +type + TMSConnectForm = class(TForm) + Panel: TPanel; + lbUsername: TLabel; + lbPassword: TLabel; + lbServer: TLabel; + edUsername: TEdit; + btConnect: TButton; + btCancel: TButton; + edPassword: TEdit; + edServer: TComboBox; + edDatabase: TComboBox; + lbDatabase: TLabel; + procedure btConnectClick(Sender: TObject); + procedure edServerDropDown(Sender: TObject); + procedure edDatabaseDropDown(Sender: TObject); + + private + FConnectDialog: TCustomConnectDialog; + FRetries: integer; + FOldCreateOrder: boolean; + FRetry: boolean; + + FListGot: boolean; + + procedure SetConnectDialog(Value: TCustomConnectDialog); + + protected + procedure DoInit; virtual; + procedure DoConnect; virtual; + + public + + published + property ConnectDialog: TCustomConnectDialog read FConnectDialog write SetConnectDialog; + + property OldCreateOrder: boolean read FOldCreateOrder write FOldCreateOrder; + end; + +implementation + +{$IFDEF IDE} +{$R *.dfm} +{$ENDIF} +{$R MSConnectForm.dfm} + +procedure TMSConnectForm.DoInit; +var + PropInfo: PPropInfo; +begin + FRetry := False; + FRetries := FConnectDialog.Retries; + Caption := FConnectDialog.Caption; + FListGot := False; + + with FConnectDialog do begin + lbUsername.Caption := UsernameLabel; + lbPassword.Caption := PasswordLabel; + lbServer.Caption := ServerLabel; + btConnect.Caption := ConnectButton; + btCancel.Caption := CancelButton; + + edUsername.Text := Connection.Username; + edPassword.Text := Connection.Password; + edServer.Text := Connection.Server; + + if (edUsername.Text <> '') and (edPassword.Text = '') then + ActiveControl := edPassword; + end; + + PropInfo := GetPropInfo(FConnectDialog, 'DatabaseLabel'); + if PropInfo <> nil then + lbDatabase.Caption := GetStrProp(FConnectDialog, PropInfo); + if FConnectDialog.Connection is TMSConnection then + edDatabase.Text := TMSConnection(FConnectDialog.Connection).Database; +end; + +procedure TMSConnectForm.DoConnect; +begin + FConnectDialog.Connection.Password := edPassword.Text; + FConnectDialog.Connection.Server := edServer.Text; + FConnectDialog.Connection.UserName := edUsername.Text; + if (FConnectDialog.Connection is TMSConnection) then + TMSConnection(FConnectDialog.Connection).Database := edDatabase.Text; + try + FConnectDialog.Connection.PerformConnect(FRetry); + ModalResult := mrOk; + except + on E: EMSError do begin + Dec(FRetries); + FRetry := True; + if FRetries = 0 then + ModalResult := mrCancel; + + if E.MSSQLErrorCode <= NE_MAX_NETERROR then + ActiveControl := edServer + else + if E.OLEDBErrorCode = DB_SEC_E_AUTH_FAILED then + if ActiveControl <> edUsername then + ActiveControl := edPassword; + raise; + end + else + raise; + end; +end; + +procedure TMSConnectForm.SetConnectDialog(Value: TCustomConnectDialog); +begin + FConnectDialog := Value; + DoInit; +end; + +procedure TMSConnectForm.btConnectClick(Sender: TObject); +begin + DoConnect; +end; + +procedure TMSConnectForm.edServerDropDown(Sender: TObject); +var + OldCursor: TCursor; +begin + if FListGot then + Exit; + + FListGot := True; + OldCursor := Screen.Cursor; + Screen.Cursor := crSQLWait; + try + FConnectDialog.GetServerList(edServer.Items); + finally + Screen.Cursor := OldCursor; + end; +end; + +procedure TMSConnectForm.edDatabaseDropDown(Sender: TObject); +var + OldCursor: TCursor; + OldLoginPrompt: boolean; + OldConnected: boolean; +begin + if not (FConnectDialog.Connection is TMSConnection) then + Exit; + + edDatabase.Items.Clear; + OldLoginPrompt := FConnectDialog.Connection.LoginPrompt; + OldCursor := Screen.Cursor; + OldConnected := FConnectDialog.Connection.Connected; + Screen.Cursor := crSQLWait; + + FConnectDialog.Connection.Password := edPassword.Text; + FConnectDialog.Connection.Server := edServer.Text; + FConnectDialog.Connection.UserName := edUsername.Text; + + try + FConnectDialog.Connection.LoginPrompt := False; + GetDatabasesList(TMSConnection(FConnectDialog.Connection), edDatabase.Items); + finally + FConnectDialog.Connection.Connected := OldConnected; + FConnectDialog.Connection.LoginPrompt := OldLoginPrompt; + Screen.Cursor := OldCursor; + end; +end; + +initialization +{ if GetClass('TMSConnectForm') = nil then + Classes.RegisterClass(TMSConnectForm);} +end. + diff --git a/internal/4.10.0.10/1/Source/MSConnectionPool.pas b/internal/4.10.0.10/1/Source/MSConnectionPool.pas new file mode 100644 index 0000000..ed55250 --- /dev/null +++ b/internal/4.10.0.10/1/Source/MSConnectionPool.pas @@ -0,0 +1,213 @@ + +////////////////////////////////////////////////// +// SQL Server Data Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I Sdac.inc} + +unit MSConnectionPool; + +{$ENDIF} + +interface + +uses +{$IFDEF VER6P} + Variants, +{$ENDIF} + Classes, CRConnectionPool, CRAccess, OLEDBAccess; + +type + TMSConnectionParameters = class(TCRConnectionParameters) + protected + procedure AssignTo(Dest: TPersistent); override; + + public + Database: string; + IsolationLevel: TIsolationLevel; + Authentication: TMSAuthentication; + Provider: TOLEDBProvider; + + QuotedIdentifier: boolean; + Language: string; + Encrypt: boolean; + PersistSecurityInfo: boolean; + AutoTranslate: boolean; + NetworkLibrary: string; + ApplicationName: string; + WorkstationID: string; + PacketSize: integer; + + function Equals(Obj: TCRConnectionParameters): boolean; override; + end; + + TMSLocalConnectionPool = class(TCRLocalConnectionPool) + protected + function CreateNewConnector: TCRConnection; override; + end; + + + TMSConnectionPoolManager = class(TCRConnectionPoolManager) + protected + function CreateCRConnectionPool(ConnectionParameters: TCRConnectionParameters): TCRConnectionPool; override; + public + class procedure Clear; {$IFDEF CLR}static;{$ENDIF} + class function GetConnection(ConnectionParameters: TCRConnectionParameters): TCRConnection; {$IFDEF CLR}static;{$ENDIF} + end; + +implementation + +uses +{$IFDEF MSWINDOWS} + Windows, +{$ENDIF} + SysUtils, MemData, SyncObjs; + +var + ConnectionPoolManager: TMSConnectionPoolManager; + LockPoolManagerCreate: TCriticalSection; + +{ TMSConnectionParameters} + +procedure TMSConnectionParameters.AssignTo(Dest: TPersistent); +begin + if Dest is TMSConnectionParameters then begin + TMSConnectionParameters(Dest).Database := Database; + TMSConnectionParameters(Dest).IsolationLevel := IsolationLevel; + TMSConnectionParameters(Dest).Authentication := Authentication; + TMSConnectionParameters(Dest).Provider := Provider; + + TMSConnectionParameters(Dest).QuotedIdentifier := QuotedIdentifier; + TMSConnectionParameters(Dest).Language := Language; + TMSConnectionParameters(Dest).Encrypt := Encrypt; + TMSConnectionParameters(Dest).PersistSecurityInfo := PersistSecurityInfo; + TMSConnectionParameters(Dest).AutoTranslate := AutoTranslate; + TMSConnectionParameters(Dest).NetworkLibrary := NetworkLibrary; + TMSConnectionParameters(Dest).ApplicationName := ApplicationName; + TMSConnectionParameters(Dest).WorkstationID := WorkstationID; + TMSConnectionParameters(Dest).PacketSize := PacketSize; + end; + + inherited; +end; + +function TMSConnectionParameters.Equals(Obj: TCRConnectionParameters): boolean; +var + O: TMSConnectionParameters; +begin + Result := inherited Equals(Obj); + if Result and (Obj is TMSConnectionParameters) then begin + O := TMSConnectionParameters(obj); + Result := + (AnsiCompareText(Database, O.Database) = 0) and + (O.IsolationLevel = IsolationLevel) and + (O.Authentication = Authentication) and + (O.Provider = Provider) and + (O.QuotedIdentifier = QuotedIdentifier) and + (AnsiCompareText(O.Language, Language) = 0)and + (O.Encrypt = Encrypt) and + (O.PersistSecurityInfo = PersistSecurityInfo) and + (O.AutoTranslate = AutoTranslate) and + (AnsiCompareText(O.NetworkLibrary, NetworkLibrary) = 0) and + (AnsiCompareText(O.ApplicationName, ApplicationName) = 0) and + (AnsiCompareText(O.WorkstationID, WorkstationID) = 0) and + (O.PacketSize = PacketSize); + end; +end; + +{ TMSLocalConnectionPool } + +function TMSLocalConnectionPool.CreateNewConnector: TCRConnection; +begin + Result := TOLEDBConnection.Create; + + Result.SetProp(prDatabase, TMSConnectionParameters(ConnectionParameters).Database); + Result.SetProp(prIsolationLevel, Integer(TMSConnectionParameters(ConnectionParameters).IsolationLevel)); + Result.SetProp(prAuthentication, Integer(TMSConnectionParameters(ConnectionParameters).Authentication)); + Result.SetProp(prProvider, Integer(TMSConnectionParameters(ConnectionParameters).Provider)); + + Result.SetProp(prQuotedIdentifier, TMSConnectionParameters(ConnectionParameters).QuotedIdentifier); + Result.SetProp(prLanguage, TMSConnectionParameters(ConnectionParameters).Language); + Result.SetProp(prEncrypt, TMSConnectionParameters(ConnectionParameters).Encrypt); + Result.SetProp(prPersistSecurityInfo, TMSConnectionParameters(ConnectionParameters).PersistSecurityInfo); + Result.SetProp(prAutoTranslate, TMSConnectionParameters(ConnectionParameters).AutoTranslate); + Result.SetProp(prNetworkLibrary, TMSConnectionParameters(ConnectionParameters).NetworkLibrary); + Result.SetProp(prApplicationName, TMSConnectionParameters(ConnectionParameters).ApplicationName); + Result.SetProp(prWorkstationID, TMSConnectionParameters(ConnectionParameters).WorkstationID); + Result.SetProp(prPacketSize, TMSConnectionParameters(ConnectionParameters).PacketSize); + + StartWait; + try + Result.SetUsername(ConnectionParameters.Username); + Result.SetPassword(ConnectionParameters.Password); + Result.SetServer(ConnectionParameters.Server); + + Result.Connect(''); + finally + StopWait + end; +end; + +{ TMSConnectionPoolManager } + +function TMSConnectionPoolManager.CreateCRConnectionPool(ConnectionParameters: TCRConnectionParameters): TCRConnectionPool; +begin + Result := TMSLocalConnectionPool.Create(Self, ConnectionParameters); +end; + +class procedure TMSConnectionPoolManager.Clear; +begin + if ConnectionPoolManager <> nil then + ConnectionPoolManager.InternalClear; +end; + +class function TMSConnectionPoolManager.GetConnection(ConnectionParameters: TCRConnectionParameters): TCRConnection; +begin + LockPoolManagerCreate.Enter; + try + if ConnectionPoolManager = nil then + ConnectionPoolManager := TMSConnectionPoolManager.Create; + finally + LockPoolManagerCreate.Leave; + end; + + Result := ConnectionPoolManager.InternalGetConnection(ConnectionParameters); +end; + +{$IFDEF WIN32} +{$IFNDEF VER6P} +type + TDLLProc = procedure (Reason: Integer); +{$ENDIF} + +var + OldDLLProc: TDLLProc; + +procedure LibraryProc(Reason: integer); +begin + if Reason = DLL_PROCESS_DETACH then begin + ConnectionPoolManager.Free; + ConnectionPoolManager := nil; + end; + if Assigned(OldDLLProc) then + OldDLLProc(Reason); +end; +{$ENDIF} + +initialization +{$IFDEF WIN32} + OldDLLProc := DLLProc; + DLLProc := @LibraryProc; +{$ENDIF} + ConnectionPoolManager := nil; + LockPoolManagerCreate := TCriticalSection.Create; + +finalization + ConnectionPoolManager.Free; + ConnectionPoolManager := nil; + LockPoolManagerCreate.Free; + +end. diff --git a/internal/4.10.0.10/1/Source/MSConsts.pas b/internal/4.10.0.10/1/Source/MSConsts.pas new file mode 100644 index 0000000..17e9a0f --- /dev/null +++ b/internal/4.10.0.10/1/Source/MSConsts.pas @@ -0,0 +1,126 @@ + +////////////////////////////////////////////////// +// SQL Server Data Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +// Contants and user messages +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I Sdac.inc} + +unit MSConsts; +{$ENDIF} + +interface + +const + {$EXTERNALSYM WSABASEERR} + WSABASEERR = 10000; + {$EXTERNALSYM WSAECONNRESET} + WSAECONNRESET = (WSABASEERR+54); + +{$IFDEF CLR} +const /// ??? Compiler Error +{$ELSE} +resourcestring +{$ENDIF} + SEmptySQLStatement = 'No SQL statement provided'; + SOLEDBError = 'OLE DB error occured. Code %Xh'; + SOLEDBNotFound = 'OLE DB not found'; + SMSSQLNotFound = 'Required provider is not installed'; + SNoResultSet = 'Query must return exactly one result set - use Execute'; + SBadStatementType = 'Bad statement type'; + SBadOutputParam = 'Bad parameter %s. Output parameters "text", "ntext" or "image" are not acceptable'; + SBadFieldType = 'Unknown field type "%s" (OLE DB code = %Xh)'; + SBadSQLObjectName = 'SQL Object name must be provided'; + SBookmarksRequired = 'Dataset does not support bookmarks, which are required for multi-record data controls'; + SCUandServerCursors = 'CachedUpdates not allowed for server cursors'; + SOpenNextPreparedSQL = 'Cannot OpenNext if statement is Prepared'; + SCursorTypeChanged = 'Cursor type changed for statement'; + SWrongMDACVer = 'Wrong MDAC version. Download latest MDAC version'; + SObjectOpen = 'Cannot execute command in current transaction context ' + + 'until previous opened DataSet (CursorType is ctDefaultResultSet) is fetched to end'; + SNoKeyFields = 'Key fields not found'; + SConnectionOpen = 'Cannot perform this operation on an open connection'; + SBadProviderName = 'Wrong provider name'; + + SBadDatabaseFile = 'Wrong Database file'; + SBadNetworkLibrary = 'Wrong NetworkLibrary value'; + SBadPacketSize = 'Wrong PacketSize value'; + SBadEncrypt = 'Wrong Encrypt value'; + + // see MSDN at oledb.chm::/htm/oledbstatus.htm + SInvalidParamType = 'invalid ParamType'; + SBadAccessor = 'bad accessor'; + SInvalidValue = 'invalid Value'; + SSignMismatch = 'sign mismatch'; + SDataOverflow = 'data overflow'; + SDataTruncated = 'data truncated'; + SOutOfMemory = 'could not allocate memory for return data'; + SCantCreate = 'the provider could not allocate memory in which to return data or a storage object was already open on the rowset. '; + SUnavaible = 'could not obtain the value'; + SPermissionDenied = 'user did not have permission to write to the column'; + SIntegrityViolation = 'the data value violates the integrity constraints for the column'; + SShemaViolation = 'the data value violates the schema''s constraint for the column'; + SBadStatus = 'bad status'; + SUnknownStatus = 'unknown status'; + + SParamNameMissing = 'Parameter name missing'; + SParamValueMissing = 'Parameter value missing'; + SInvalidChar = 'Invalid character in non-quoted parameter value'; + SParamNameUnknown = 'Parameter name is unknown - %s'; + SBadParamValue = 'Bad parameter value - %s=%s'; + + SCheckConnection = '/* Check connection */'; + + STimestampFieldRequired = 'Timestamp field required'; + SInvalidServerVersion = 'Invalid server version'; + SServiceNotDefined = 'Service not defined'; + STargetServiceNotDefined = 'Target service not defined'; + SServiceBrokerAsync = 'Cannot perform this operation in AsyncNotification mode'; + SDialogActive = 'Cannot perform this operation with open conversations'; + SConnectionClosed = 'Can''t perform operation on closed connection'; + + SLocalSortingServerCursor = 'Local sorting is not compatible with server cursor types'; + + // DBROWSTATUSENUM + SRowMultipleChanges = 'Updating or deleting a single row caused more than one row to be updated or deleted in the data store'; + SRowPendingChanges = 'A row had a pending change'; + SRowCanceled = 'Updating a row was canceled during notification'; + SRowConcurrencyViolation = 'A row was being updated or deleted, and the value of a column in that row has been changed since it was last fetched'; + SRowDeleted = 'A row was deleted'; + SRowIntegrityViolation = 'A row was being inserted, updated or deleted, and doing so violated the integrity constraints for the column or table'; + SRowPermissionDenied = 'The consumer did not have sufficient permission to update, delete, or insert a row'; + SRowLimitReached = 'The update, delete, or insert failed due to reaching a limit on the server, such as a query execution timing out'; + SRowSchemaViolation = 'A row was being inserted, no value was specified for a column, the column does not have a default, and the column is non-nullable'; + SRowFail = 'The consumer encountered a recoverable, provider-specific error, such as an RPC failure when transmitting the change to a remote server'; + + SInvalidQNStatement = 'SELECT statement does not meet the requirements for query notification'; + SStatementNotSupported = 'Statement does not support notifications'; + SInvalidQNSetOptions = 'The connection options were not set appropriately when the command was submitted'; + SInvalidQNIsolation = 'The isolation level is not valid for query notification'; + STemplateLimit = 'A table specified in the query has reached the maximum number of internal templates'; + SSubscriptionTimedOut = 'The subscription timeout expired'; + SQNObjectDropped = 'One of the underlying objects used by the query was dropped'; + SQNObjectAltered = 'One of the underlying objects used by the query was modified'; + SSQLServerStarted = 'SQL Server started'; + SSQLInternalError = 'An internal error occurred in SQL Server'; + SSubscriptionRemoved = 'The notification subscription was removed due to the state of SQL Server'; + + SSQLNCLINeeds = 'Provider must be SQL Native Client for nonblocking execute'; + SSQLNCLINeedsChangePwd = 'Provider must be SQL Native Client for changing password'; + + SAsynchExecuting = 'Operation cannot be performed while executing asynchronously'; + + SNumericOverflow = 'Numeric overflow'; + + SDMandServerCursors = 'DisconnectedMode not allowed for server cursors'; + + SSQLOLEDB = 'SQLOLEDB.1'; + SSQLNativeClient = 'SQLNCLI.1'; + SSQLEverywhere = 'MICROSOFT.SQLSERVER.MOBILE.OLEDB.3.0'; + +implementation + +end. diff --git a/internal/4.10.0.10/1/Source/MSDump.pas b/internal/4.10.0.10/1/Source/MSDump.pas new file mode 100644 index 0000000..5eb173a --- /dev/null +++ b/internal/4.10.0.10/1/Source/MSDump.pas @@ -0,0 +1,486 @@ +////////////////////////////////////////////////// +// SQL Server Data Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I Sdac.inc} + +unit MSDump; +{$ENDIF} + +interface + +uses + SysUtils, Classes, DB, CRAccess, DBAccess, MSAccess, DADump, DAScript; + +type + TMSDump = class; + + //TMSDumpObject = (doData); + //TMSDumpObjects = set of TMSDumpObject; + + TMSDumpOptions = class(TDADumpOptions) + protected + FIdentityInsert: boolean; + procedure AssignTo(Dest: TPersistent); override; + public + constructor Create(Owner: TMSDump); + published + property IdentityInsert: boolean read FIdentityInsert write FIdentityInsert default False; + end; + + TMSDump = class(TDADump) + protected + //FObjects: TMSDumpObjects; + + procedure AssignTo(Dest: TPersistent); override; + + function GetTableInfoClass: TTableInfoClass; override; + + function GetConnection: TMSConnection; + procedure SetConnection(Value: TMSConnection); + + function GetTableNames: string; override; + procedure SetTableNames(Value: string); override; + + function CreateOptions: TDADumpOptions; override; + function CreateScript: TDAScript; override; + + function GetOptions: TMSDumpOptions; + procedure SetOptions(Value: TMSDumpOptions); + + procedure InternalBackup(Query: string); override; + public + constructor Create(Owner: TComponent); override; + published + property Connection: TMSConnection read GetConnection write SetConnection; + + //property Objects: TMSDumpObjects read FObjects write FObjects default [doData]; + property Options: TMSDumpOptions read GetOptions write SetOptions; + end; + +implementation + +uses +{$IFDEF CLR} + System.Text, System.Runtime.InteropServices, +{$ELSE} + CLRClasses, +{$ENDIF} +{$IFDEF VER6P} + Variants, +{$ENDIF} + MemUtils, MemData, DAConsts, DALoader, OLEDBAccess, MSScript; + +{ TMSDumpOptions } + +constructor TMSDumpOptions.Create(Owner: TMSDump); +begin + inherited Create(Owner); + + FIdentityInsert := False; +end; + +procedure TMSDumpOptions.AssignTo(Dest: TPersistent); +begin + inherited; + + if Dest is TMSDumpOptions then begin + TMSDumpOptions(Dest).IdentityInsert := IdentityInsert; + end; +end; + +{ TMSDump } + +constructor TMSDump.Create(Owner: TComponent); +begin + inherited Create(Owner); + + //FObjects := [doData]; + + FLeftQuote := OLEDBAccess.LeftQuote; + FRightQuote := OLEDBAccess.RightQuote; +end; + +procedure TMSDump.AssignTo(Dest: TPersistent); +begin + inherited; + + if Dest is TMSDump then begin + //TMSDump(Dest).Objects := Objects; + end; +end; + +function TMSDump.GetTableInfoClass: TTableInfoClass; +begin + Result := TOLEDBTableInfo; +end; + +function TMSDump.GetConnection: TMSConnection; +begin + Result := TMSConnection(inherited Connection); +end; + +procedure TMSDump.SetConnection(Value: TMSConnection); +begin + inherited Connection := Value; +end; + +function TMSDump.GetTableNames: string; +begin + Result := TableNamesFromList(FTables); +end; + +procedure TMSDump.SetTableNames(Value: string); +begin + TableNamesToList(Value, FTables); +end; + +function TMSDump.CreateOptions: TDADumpOptions; +begin + Result := TMSDumpOptions.Create(nil); +end; + +function TMSDump.CreateScript: TDAScript; +begin + Result := TMSScript.Create(nil); +end; + +function TMSDump.GetOptions: TMSDumpOptions; +begin + Result := TMSDumpOptions(inherited Options); +end; + +procedure TMSDump.SetOptions(Value: TMSDumpOptions); +begin + inherited Options := Value; +end; + +{$IFNDEF CLR} +type + _StringBuilder = class (StringBuilder); +{$ENDIF} + +procedure TMSDump.InternalBackup(Query: string); +var + MSQuery: TMSQuery; + TableCount: integer; + + procedure VarToMSSQL(Field: TField; FieldDesc: TOLEDBFieldDesc; sb: StringBuilder); + var + dt: TDateTime; + Blob: TBlob; + Piece: PPieceHeader; + Value: Variant; + Data: TBytes; + {$IFNDEF VER6P} + pValueData: PVarData; + {$ENDIF} + {$IFDEF CLR} + Bytes: TBytes; + {$ELSE} + sbOffset: integer; + {$ENDIF} + begin + SetLength(Data, 0); // To avoid Hint from compiler + case FieldDesc.DataType of + dtBoolean: + sb.Append(BoolToStr(Field.AsBoolean)); + dtUnknown, dtString, dtMemo, dtWideMemo, dtExtString, dtWideString, dtExtWideString, dtGuid{$IFDEF VER5P}, dtVariant{$ENDIF}: + sb.Append(QuotedStr(Field.AsString)); + dtInt8, dtInt16, dtInt32, dtInt64, + dtUInt16, dtUInt32: begin + {$IFNDEF VER6P} + Value := Field.AsVariant; + pValueData := @TVarData(Value); + if pValueData.VType = varDecimal then + sb.Append(IntToStr(PInt64(@pValueData.VInteger)^)) + else + {$ENDIF} + sb.Append(Field.AsString); + end; + dtFloat, dtCurrency: + sb.Append(ChangeDecimalSeparator(Field.AsString)); + dtDate, dtTime, dtDateTime: begin + dt := Field.AsDateTime; + if dt = 0 then + sb.Append(QuotedStr('1900-01-01 00:00:00')) + else + sb.Append(QuotedStr(FormatDateTime('YYYY-MM-DD HH:NN:SS', dt))); + end; + dtBlob: begin + sb.Append('0x'); + Blob := MSQuery.GetBlob(Field.FieldName); + Piece := Blob.FirstPiece; + + {$IFDEF CLR} + while IntPtr(Piece) <> nil do begin + SetLength(Data, Piece.Used); + Marshal.Copy(IntPtr(Integer(Piece) + sizeof(TPieceHeader)), Data, 0, Piece.Used); + SetLength(Bytes, Length(Data) * 2); + BinToHex(Data, 0, Bytes, 0, Length(Data)); + sb.Append(Encoding.Default.GetString(Bytes)); + Piece := Piece.Next; + end; + {$ELSE} + sbOffset := sb.Length + 1; + sb.Length := sb.Length + Integer(Blob.Size) * 2; + while Piece <> nil do begin + BinToHex(IntPtr(Integer(Piece) + sizeof(TPieceHeader)), + IntPtr(Integer(@_StringBuilder(sb).FString[sbOffset])), Piece.Used); + sbOffset := sbOffset + Integer(Piece.Used); + Piece := Piece.Next; + end; + {$ENDIF} + end; + dtBytes, dtVarBytes, dtExtVarBytes: begin + sb.Append('0x'); + Value := Field.Value; + Data := Value; + {$IFDEF CLR} + SetLength(Bytes, Length(Data) * 2); + BinToHex(Data, 0, Bytes, 0, Length(Data)); + sb.Append(Encoding.Default.GetString(Bytes)); + {$ELSE} + sbOffset := sb.Length + 1; + sb.Length := sb.Length + Length(Data) * 2; + BinToHex(@Data[0], + IntPtr(Integer(@_StringBuilder(sb).FString[sbOffset])), Length(Data)); + {$ENDIF} + end; + else + Assert(False, 'Unknown datatype (' + IntToStr(FieldDesc.DataType) + ')'); + end; + end; + + procedure BackupTablesAndData; + + function FieldIsIdentity(Field: TField): boolean; + var + FieldDesc: TOLEDBFieldDesc; + begin + FieldDesc := MSQuery.GetFieldDesc(Field) as TOLEDBFieldDesc; + Result := FieldDesc.IsAutoIncrement; + end; + + procedure BackupTable(TableName: string; TableNum: integer); + var + KeyAndDataFields: TKeyAndDataFields; + + procedure GetCurrentRow(sb: StringBuilder); + var + sbOldLen: integer; + + procedure ProcessField(Field: TField); + var + Value: Variant; + FieldDesc: TOLEDBFieldDesc; + begin + if sbOldLen <> sb.Length then + sb.Append(', '); + + Value := Field.AsVariant; + if VarIsEmpty(Value) or VarIsNull(Value) or Field.IsNull then + sb.Append('NULL') + else + begin + FieldDesc := MSQuery.GetFieldDesc(Field) as TOLEDBFieldDesc; + VarToMSSQL(Field, FieldDesc, sb); + end; + end; + + var + i: integer; + begin + sbOldLen := sb.Length; + + if Length(KeyAndDataFields.DataFieldDescs) = 0 then begin + for i := 0 to MSQuery.FieldCount - 1 do + if not (FieldIsIdentity(MSQuery.Fields[i]) and not Options.IdentityInsert) then + ProcessField(MSQuery.Fields[i]); + end + else + begin + if (TDBAccessUtils.GetIdentityField(MSQuery) <> nil) and Options.IdentityInsert then + ProcessField(TDBAccessUtils.GetIdentityField(MSQuery)); + for i := 0 to Length(KeyAndDataFields.DataFieldDescs) - 1 do + ProcessField(MSQuery.GetField(KeyAndDataFields.DataFieldDescs[i])); + end; + end; + + var + RecordCount: integer; + InsHeader: string; + FieldList: string; + i: integer; + SQLSelect1: string; + sb: StringBuilder; + + begin + FieldList := ''; + if Query = '' then + SQLSelect1 := 'SELECT * FROM ' + TableName + else + SQLSelect1 := Query; + + MSQuery.SQL.Text := SQLSelect1; + MSQuery.AddWhere('0=1'); + try + MSQuery.Open; + + if (TableName = '') + and (TDBAccessUtils.GetTablesInfo(MSQuery).Count > 0) then + TableName := TDBAccessUtils.GetTablesInfo(MSQuery)[0].TableName; + + if (TDBAccessUtils.GetIdentityField(MSQuery) <> nil) and Options.IdentityInsert then + FieldList := QuoteName(TDBAccessUtils.GetIdentityField(MSQuery).FieldName); + + TDBAccessUtils.GetKeyAndDataFields(MSQuery, KeyAndDataFields, False); + for i := 0 to Length(KeyAndDataFields.DataFieldDescs) - 1 do + if not (TOLEDBFieldDesc(KeyAndDataFields.DataFieldDescs[i]).IsAutoIncrement and not Options.IdentityInsert) then + if FieldList = '' then + FieldList := QuoteName(KeyAndDataFields.DataFieldDescs[i].Name) + else + FieldList := FieldList + ', ' + QuoteName(KeyAndDataFields.DataFieldDescs[i].Name); + finally + MSQuery.Close; + end; + + if True {(doData in Objects)} then begin + if Options.GenerateHeader then + AddLineToSQL(SBHTableData, [TableName]); + + if Options.AddDrop {and not (doTables in Objects)} then + Add('TRUNCATE TABLE ' + TableName + ';'); + + if Options.IdentityInsert then + Add(Format('SET IDENTITY_INSERT %s ON;', [TableName])); + + MSQuery.SQL.Text := 'SELECT COUNT(*) FROM ' + TableName; + MSQuery.Execute; + RecordCount := MSQuery.Fields[0].AsInteger; + + if Assigned(FOnBackupProgress) then + FOnBackupProgress(Self, TableName, TableNum, TableCount, 0); + + if RecordCount > 0 then begin + if FieldList = '' then + InsHeader := TableName + else + InsHeader := TableName + '(' + FieldList + ')'; + + InsHeader := 'INSERT INTO ' + InsHeader + ' VALUES'; + + MSQuery.SQL.Text := SQLSelect1; + MSQuery.Open; + if FieldList <> '' then + TDBAccessUtils.GetKeyAndDataFields(MSQuery, KeyAndDataFields, False); + + sb := StringBuilder.Create; + try + while not MSQuery.Eof do begin + if Assigned(FOnBackupProgress) then + FOnBackupProgress(Self, TableName, TableNum, TableCount, Trunc(MSQuery.RecNo * 100 / RecordCount)); + + sb.Length := 0; + sb.Append(InsHeader); + sb.Append(' ('); + GetCurrentRow(sb); + sb.Append(');'); + Add(sb.ToString); + MSQuery.Next; + end; + finally + sb.Free; + end; + end; + if Options.IdentityInsert then + Add(Format('SET IDENTITY_INSERT %s OFF;', [TableName])); + end; + end; + + var + i: integer; + TablesList: TStringList; + TableName: string; + + begin + if Query = '' then begin + TablesList := nil; + try + TablesList := TStringList.Create; + + if FTables.Count = 0 then + GetTablesList(Connection, TablesList) + else + TablesList.Assign(FTables); + + for i := 0 to TablesList.Count - 1 do begin + TableName := QuoteName(TablesList[i]); + + if Assigned(FOnBackupProgress) then + FOnBackupProgress(Self, TableName, i, TablesList.Count, 0); + + TableCount := TablesList.Count; + BackupTable(TableName, i); + Add(''); + end; + + finally + TablesList.Free; + end; + end + else + begin + if FTables.Count = 1 then + TableName := QuoteName(FTables[0]) + else + TableName := ''; + + if Assigned(FOnBackupProgress) then + FOnBackupProgress(Self, TableName, 0, 1, 0); + + TableCount := 1; + BackupTable(TableName, 0); + Add(''); + end; + end; + +begin + BeginConnection; + try + Query := Trim(Query); + if (Query <> '') and (FTables.Count > 1) then + raise Exception.Create(SWrongTblCount); + MSQuery := nil; + FSQL.BeginUpdate; + try + FSQL.Text := ''; + if Options.GenerateHeader then + AddLineToSQL(Format(SBHCaption, ['Sdac', SDACVersion, + 'MS SQL', Connection.ServerVersion, 'MS SQL', Connection.ClientVersion, DateTimeToStr(Now), + Connection.Server, Connection.Database])); + + MSQuery := TMSQuery.Create(nil); + MSQuery.Connection := Connection; + MSQuery.ReadOnly := False; + MSQuery.FetchAll := True; + MSQuery.UniDirectional := True; + MSQuery.Options.SetFieldsReadOnly := True; + MSQuery.Options.QueryRecCount := False; + + // if doData in Objects then + BackupTablesAndData; + + finally + FSQL.EndUpdate; + MSQuery.Free; + end; + finally + EndConnection; + end; +end; + +end. diff --git a/internal/4.10.0.10/1/Source/MSLoader.pas b/internal/4.10.0.10/1/Source/MSLoader.pas new file mode 100644 index 0000000..29943c9 --- /dev/null +++ b/internal/4.10.0.10/1/Source/MSLoader.pas @@ -0,0 +1,564 @@ +////////////////////////////////////////////////// +// SQL Server Data Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +// MSAccess +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I Sdac.inc} + +unit MSLoader; +{$ENDIF} +interface + +uses +{$IFDEF CLR} + System.Runtime.InteropServices, Variants, +{$ELSE} + CLRClasses, +{$ENDIF} + Windows, Classes, DB, MemDS, CRAccess, MemData, + DALoader, OLEDBAccess, MSAccess, OLEDBC, OLEDBIntf; + +type + TMSColumn = class(TDAColumn) + private + FSize: integer; + FPrecision: integer; + FScale: integer; + FIsWide: boolean; + + function GetSize: integer; + procedure SetSize(Value: integer); + + protected + procedure SetFieldType(Value: TFieldType); override; + + published + property Size: integer read GetSize write SetSize; + property Precision: integer read FPrecision write FPrecision default 0; + property Scale: integer read FScale write FScale default 0; + end; + + TMSLoader = class; + + TMSPutDataEvent = procedure (Sender: TMSLoader) of object; + TMSGetColumnDataEvent = procedure (Sender: TObject; Column: TMSColumn; + Row: integer; var Value: variant; var IsEOF: boolean) of object; + + TMSLoaderOptions = class(TPersistent) + private + FRowsPerBatch: integer; + FKilobytesPerBatch: integer; + FLockTable: boolean; + FCheckConstraints: boolean; + FOwner: TMSLoader; + protected + procedure AssignTo(Dest: TPersistent); override; + public + constructor Create(Owner: TMSLoader); + published + property RowsPerBatch: integer read FRowsPerBatch write FRowsPerBatch default 0; + property KilobytesPerBatch: integer read FKilobytesPerBatch write FKilobytesPerBatch default 0; + property LockTable: boolean read FLockTable write FLockTable default False; + property CheckConstraints: boolean read FCheckConstraints write FCheckConstraints default False; + end; + + TDBIDAccessor = class + protected + FPDBID: PDBID; + function GeteKind: DBKIND; + procedure SeteKind(Value: DBKIND); + function GetpwszName: IntPtr; + procedure SetpwszName(Value: IntPtr); + procedure SetPDBID(Value: PDBID); + public + constructor Create(APDBID: PDBID); + property eKind: DBKIND read GeteKind write SeteKind; + property pwszName: IntPtr read GetpwszName write SetpwszName; + end; + + TMSLoader = class(TDALoader) + private + FIOpenRowset: IOpenRowset; + FIRowsetFastLoad: IRowsetFastLoad; + FParamsAccessorData: TParamsAccessorData; + FOnPutData: TMSPutDataEvent; + FOnGetColumnData: TMSGetColumnDataEvent; + FKeepIdentity: boolean; + FKeepNulls: boolean; + FOptions: TMSLoaderOptions; + FParamDescs: TParamDescs; + + procedure DAPutDataEvent(Sender: TDALoader); + procedure DAGetColumnDataEvent(Sender: TObject; Column: TDAColumn; + Row: integer; var Value: variant; var IsEOF: boolean); + protected + class function DAColumnClass: TDAColumnClass; override; + function GetConnection: TMSConnection; + procedure SetConnection(Value: TMSConnection); + procedure SetOnPutData(const Value: TMSPutDataEvent); + procedure SetOnGetColumnData(const Value: TMSGetColumnDataEvent); + procedure SetKeepIdentity(Value: boolean); + procedure SetKeepNulls(Value: boolean); + procedure SetOptions(Value: TMSLoaderOptions); + + procedure Prepare; override; + procedure Commit(Done: boolean = True); + procedure Finish; override; + + procedure FillColumn(Column: TDAColumn; FieldDesc: TFieldDesc); override; + public + constructor Create(Owner: TComponent); override; + destructor Destroy; override; + procedure PutColumnData(Col: integer; Row: integer; const Value: variant); override; + published + property Connection: TMSConnection read GetConnection write SetConnection; + property TableName; + property Columns; + property KeepIdentity: boolean read FKeepIdentity write SetKeepIdentity default False; + property KeepNulls: boolean read FKeepNulls write SetKeepNulls default False; + property Options: TMSLoaderOptions read FOptions write SetOptions; + property OnPutData: TMSPutDataEvent read FOnPutData write SetOnPutData; + property OnGetColumnData: TMSGetColumnDataEvent read FOnGetColumnData write SetOnGetColumnData; + end; + +implementation + +uses + SysUtils, +{$IFDEF CLR} + System.Text, +{$ENDIF} +{$IFDEF VER6P} +{$IFNDEF CLR} + Variants, +{$ENDIF} + FmtBcd, +{$ENDIF} + ActiveX, MemUtils, DBAccess; + +{ TMSColumn } + +function TMSColumn.GetSize: integer; +begin + if (FieldType in [ftString, ftFixedChar, ftWideString, ftBytes, ftVarBytes, + ftBlob, ftMemo{$IFDEF VER10P}, ftWideMemo{$ENDIF}, ftVariant, ftUnknown]) then + Result := FSize + else + Result := 0; +end; + +procedure TMSColumn.SetFieldType(Value: TFieldType); +var + NewValue: boolean; +begin + NewValue := Value <> FieldType; + + inherited; + + if NewValue then + case FieldType of + ftGuid: + FSize := SizeOf(TGuid); + ftSmallint: + FSize := SizeOf(SmallInt); + ftInteger: + FSize := SizeOf(Integer); + ftWord: + FSize := SizeOf(Word); + ftLargeint: + FSize := SizeOf(LargeInt); + ftBoolean: + FSize := SizeOf(Boolean); + ftFloat, ftCurrency: + FSize := SizeOf(Double); + ftBCD: + FSize := SizeOf(Currency); + {$IFDEF VER6P} + ftFMTBcd: + FSize := SizeOf(TBcd); + {$ENDIF} + ftDate, ftTime, ftDateTime{$IFDEF VER6P}, ftTimeStamp{$ENDIF}: + FSize := SizeOf(Double); + else + FSize := 0; + end; +end; + +procedure TMSColumn.SetSize(Value: integer); +begin + if (FieldType in [ftString, ftFixedChar, ftWideString, ftBytes, ftVarBytes, + ftBlob, ftMemo{$IFDEF VER10P}, ftWideMemo{$ENDIF}, ftVariant, ftUnknown]) and (Value > 0) then + FSize := Value; +end; + +{ TDBIDAccessor } + +constructor TDBIDAccessor.Create(APDBID: PDBID); +begin + inherited Create; + + FPDBID := APDBID; +end; + +procedure TDBIDAccessor.SetPDBID(Value: PDBID); +begin + FPDBID := Value; +end; + +function TDBIDAccessor.GeteKind: DBKIND; +var + Offset: integer; +begin + Offset := 16; + Result := Marshal.ReadInt32(FPDBID, Offset); +end; + +procedure TDBIDAccessor.SeteKind(Value: DBKIND); +var + Offset: integer; +begin + Offset := 16; + Marshal.WriteInt32(FPDBID, Offset, Value); +end; + +function TDBIDAccessor.GetpwszName: IntPtr; +var + Offset: integer; +begin + Offset := 20; + Result := Marshal.ReadIntPtr(FPDBID, Offset); +end; + +procedure TDBIDAccessor.SetpwszName(Value: IntPtr); +var + Offset: integer; +begin + Offset := 20; + Marshal.WriteIntPtr(FPDBID, Offset, Value); +end; + +{ TMSLoader } + +class function TMSLoader.DAColumnClass: TDAColumnClass; +begin + Result := TMSColumn; +end; + +function TMSLoader.GetConnection: TMSConnection; +begin + Result := TMSConnection(inherited Connection); +end; + +procedure TMSLoader.SetConnection(Value: TMSConnection); +begin + inherited Connection := Value; +end; + +procedure TMSLoader.DAPutDataEvent(Sender: TDALoader); +begin + if Assigned(FOnPutData) then + FOnPutData(TMSLoader(Sender)); +end; + +procedure TMSLoader.DAGetColumnDataEvent(Sender: TObject; Column: TDAColumn; + Row: integer; var Value: variant; var IsEOF: boolean); +begin + if Assigned(FOnGetColumnData) then + FOnGetColumnData(Sender, TMSColumn(Column), Row, Value, IsEOF); +end; + +procedure TMSLoader.SetOnPutData(const Value: TMSPutDataEvent); +begin + FOnPutData := Value; + if Assigned(FOnPutData) then + inherited OnPutData := DAPutDataEvent + else + inherited OnPutData := nil; +end; + +procedure TMSLoader.SetOnGetColumnData(const Value: TMSGetColumnDataEvent); +begin + FOnGetColumnData := Value; + if Assigned(Value) then + inherited OnGetColumnData := DAGetColumnDataEvent + else + inherited OnGetColumnData := nil; +end; + +procedure TMSLoader.SetKeepIdentity(Value: boolean); +begin + FKeepIdentity := Value; +end; + +procedure TMSLoader.SetKeepNulls(Value: boolean); +begin + FKeepNulls := Value; +end; + +procedure TMSLoader.SetOptions(Value: TMSLoaderOptions); +begin + FOptions.Assign(Value); +end; + +constructor TMSLoader.Create(Owner: TComponent); +begin + inherited Create(Owner); + + FOptions := TMSLoaderOptions.Create(Self); + FKeepIdentity := False; + FKeepNulls := False; + FSkipReadOnlyFieldDescs := False; +end; + +destructor TMSLoader.Destroy; +begin + Assert(FIOpenRowset = nil); + Assert(FIRowsetFastLoad = nil); + FOptions.Free; + + inherited; +end; + +procedure TMSLoader.FillColumn(Column: TDAColumn; FieldDesc: TFieldDesc); +begin + with TMSColumn(Column) do begin + Name := FieldDesc.Name; + FIsWide := (FieldDesc.SubDataType and dtWide) <> 0; + FieldType := GetFieldType(FieldDesc.DataType); + case FieldType of + ftString, ftFixedChar, ftWideString, ftBytes, ftVarBytes, ftBlob, ftMemo{$IFDEF VER10P}, ftWideMemo{$ENDIF}, ftVariant, ftUnknown: + Size := FieldDesc.Length; + ftFloat, ftCurrency, ftBCD{$IFDEF VER6P}, ftFMTBcd{$ENDIF}: begin + Precision := FieldDesc.Length; + Scale := FieldDesc.Scale; + end; + end; + end; +end; + +procedure TMSLoader.Prepare; +const + MaxPropCount = 3; +var + OLEDBConnection: TOLEDBConnection; + TableID: PDBID; + TableIDAccessor: TDBIDAccessor; + BindMemorySize: UINT; +{$IFDEF CLR} + rgBindingsGC: GCHandle; +{$ENDIF} + rgBindings: PDBBinding; + rgStatus: PUINT; + i: integer; + OLEDBPropertiesSet: TOLEDBPropertiesSet; + OptionsStr: string; + IUnk: IUnknown; + ParamDesc: TOLEDBParamDesc; + + procedure AddOption(var OptionStr: string; const Value: string); + begin + if OptionStr <> '' then + OptionStr := OptionStr + ', '; + OptionStr := OptionStr + Value; + end; + +begin + inherited; + + OLEDBConnection := TMSAccessUtils.FIConnection(Connection); + OLEDBConnection.Check(TMSAccessUtils.FIDBCreateSession(OLEDBConnection).CreateSession(nil, IID_IOpenRowset, IUnk), Self); + FIOpenRowset := IOpenRowset(IUnk); + + TableID := Marshal.AllocHGlobal(SizeOf(TDBID)); + TableIDAccessor := TDBIDAccessor.Create(TableID); + OLEDBPropertiesSet := TOLEDBPropertiesSet.Create(OLEDBConnection, DBPROPSET_SQLSERVERROWSET); + try + TableIDAccessor.eKind := DBKIND_NAME; + TableIDAccessor.pwszName := Marshal.AllocHGlobal(Length(TableName) * SizeOf(WideChar) + SizeOf(WideChar)); + CopyBuffer(Marshal.StringToHGlobalUni(Encoding.Default.GetString(Encoding.Default.GetBytes(TableName), 0, Length(TableName))), + TableIDAccessor.pwszName, Length(TableName) * SizeOf(WideChar) + SizeOf(WideChar)); + + OLEDBPropertiesSet.AddPropBool(SSPROP_FASTLOADKEEPIDENTITY, FKeepIdentity); + OLEDBPropertiesSet.AddPropBool(SSPROP_FASTLOADKEEPNULLS, FKeepNulls); + if (FOptions.FRowsPerBatch > 0) or (FOptions.FKilobytesPerBatch > 0) or FOptions.FLockTable or FOptions.FCheckConstraints then begin + OptionsStr := ''; + if FOptions.FRowsPerBatch > 0 then + AddOption(OptionsStr, 'ROWS_PER_BATCH = ' + IntToStr(FOptions.FRowsPerBatch)); + if FOptions.FKilobytesPerBatch > 0 then + AddOption(OptionsStr, 'KILOBYTES_PER_BATCH = ' + IntToStr(FOptions.FKilobytesPerBatch)); + if FOptions.FLockTable then + AddOption(OptionsStr, 'TABLOCK'); + if FOptions.FCheckConstraints then + AddOption(OptionsStr, 'CHECK_CONSTRAINTS'); + OLEDBPropertiesSet.AddPropStr(SSPROP_FASTLOADOPTIONS, OptionsStr); + end; + + OLEDBConnection.Check(FIOpenRowset.OpenRowset(nil, TableID, nil, IID_IRowsetFastLoad, 1, + PDBPropIDSetArray(OLEDBPropertiesSet.InitPropSet), IUnk), Self); + FIRowsetFastLoad := IRowsetFastLoad(IUnk); + finally + OLEDBPropertiesSet.Free; + Marshal.FreeHGlobal(TableIDAccessor.pwszName); + Marshal.FreeHGlobal(TableID); + TableIDAccessor.Free; + end; + + rgStatus := Marshal.AllocHGlobal(Columns.Count * SizeOf(UINT)); +{$IFNDEF CLR} + IntPtr(FParamsAccessorData.Accessor) := nil; +{$ENDIF} + try + try + FParamsAccessorData.ExecuteParams.HACCESSOR := 0; + FParamsAccessorData.ExecuteParams.pData := nil; + FParamsAccessorData.ExecuteParams.cParamSets := 1; + + SetLength(FParamsAccessorData.rgBindings, Columns.Count); + + for i := 0 to Columns.Count - 1 do + FParamsAccessorData.rgBindings[i].pObject := nil; + + BindMemorySize := 0; + + FParamDescs := TParamDescs.Create; + for i := 0 to Columns.Count - 1 do begin + ParamDesc := TOLEDBParamDesc.Create; + try + ParamDesc.SetName(Columns[i].Name); // +++ + ParamDesc.SetDataType(GetDataType(TMSColumn(Columns[i]).FieldType)); + ParamDesc.SetParamType(pdInput); + FillBindingForParam(i + 1, ParamDesc, OLEDBConnection, FParamsAccessorData.rgBindings[i], BindMemorySize, False, TMSColumn(Columns[i]).FIsWide); + FParamsAccessorData.rgBindings[i].eParamIO := DBPARAMIO_NOTPARAM; + ParamDesc.SetSize(FParamsAccessorData.rgBindings[i].cbMaxLen); + finally + FParamDescs.Add(ParamDesc); + end; + end; + + FParamsAccessorData.ExecuteParams.pData := Marshal.AllocHGlobal(BindMemorySize); + FillChar(FParamsAccessorData.ExecuteParams.pData, BindMemorySize, 0); + + QueryIntf(FIRowsetFastLoad, {$IFDEF CLR}IAccessor{$ELSE}IID_IAccessor{$ENDIF}, FParamsAccessorData.Accessor); + + {$IFDEF CLR} + rgBindingsGC := GCHandle.Alloc(FParamsAccessorData.rgBindings, GCHandleType.Pinned); + rgBindings := Marshal.UnsafeAddrOfPinnedArrayElement(FParamsAccessorData.rgBindings, 0); + {$ELSE} + rgBindings := @FParamsAccessorData.rgBindings[0]; + {$ENDIF} + + OLEDBConnection.Check(FParamsAccessorData.Accessor.CreateAccessor(DBACCESSOR_ROWDATA, Columns.Count, + rgBindings, BindMemorySize, FParamsAccessorData.ExecuteParams.HACCESSOR, rgStatus), Self); + except + if FParamsAccessorData.ExecuteParams.pData <> nil then + Marshal.FreeHGlobal(FParamsAccessorData.ExecuteParams.pData); + FParamsAccessorData.ExecuteParams.pData := nil; + + if Length(FParamsAccessorData.rgBindings) <> 0 then begin + for i := 0 to Columns.Count - 1 do begin + if FParamsAccessorData.rgBindings[i].pObject <> nil then + Marshal.FreeHGlobal(FParamsAccessorData.rgBindings[i].pObject); + end; + SetLength(FParamsAccessorData.rgBindings, 0); + end; + + raise; + end; + finally + Marshal.FreeHGlobal(rgStatus); + {$IFDEF CLR} + if IntPtr(rgBindingsGC) <> nil then + rgBindingsGC.Free; + {$ENDIF} + end; +end; + +procedure TMSLoader.PutColumnData(Col: integer; Row: integer; const Value: variant); +var + ParamDesc: CRAccess.TParamDesc; + pLength: PUINT; +{$IFDEF CLR} + ParamGCHandle: TIntPtrDynArray; +{$ENDIF} +begin + inherited; + + ParamDesc := FParamDescs.Items[Col]; + ParamDesc.SetValue(Unassigned); + ParamDesc.SetValue(Value); + FParamsAccessorData.rgBindings[Col].eParamIO := DBPARAMIO_INPUT; + + + SaveParamValue(ParamDesc, FParamsAccessorData.rgBindings[Col], FParamsAccessorData{$IFDEF HAVE_COMPRESS}, cbNone{$ENDIF}, + {$IFDEF CLR}ParamGCHandle, {$ENDIF}TMSAccessUtils.FIConnection(Connection).DBMSPrimaryVer, TMSAccessUtils.FIConnection(Connection).ProviderPrimaryVer); + FParamsAccessorData.rgBindings[Col].eParamIO := DBPARAMIO_NOTPARAM; + + if not (ParamDesc.GetDataType in CharsByRef + BytesByRef) and not (ParamDesc.GetDataType in [dtUnknown]) then begin + pLength := PUINT(UINT(Integer(FParamsAccessorData.ExecuteParams.pData)) + FParamsAccessorData.rgBindings[Col].obLength); + Marshal.WriteInt32(pLength, FParamsAccessorData.rgBindings[Col].cbMaxLen); + end; + + if Col = Columns.Count - 1 then + TMSAccessUtils.FIConnection(Connection).Check(FIRowsetFastLoad.InsertRow(FParamsAccessorData.ExecuteParams.HACCESSOR, + FParamsAccessorData.ExecuteParams.pData), Self); +end; + +procedure TMSLoader.Commit(Done: boolean = True); +begin + if FIRowsetFastLoad <> nil then + TMSAccessUtils.FIConnection(Connection).Check(FIRowsetFastLoad.Commit(Done), Self); +end; + +procedure TMSLoader.Finish; +begin + inherited; + + try + Commit; + + FParamDescs.Free; + + if FParamsAccessorData.ExecuteParams.pData <> nil then + TMSAccessUtils.FIConnection(Connection).Check(FParamsAccessorData.Accessor.ReleaseAccessor(FParamsAccessorData.ExecuteParams.HACCESSOR, nil), Self); + finally + FParamsAccessorData.ExecuteParams.HACCESSOR := 0; + FParamsAccessorData.Accessor := nil; + if FParamsAccessorData.ExecuteParams.pData <> nil then + Marshal.FreeHGlobal(FParamsAccessorData.ExecuteParams.pData); + FParamsAccessorData.ExecuteParams.pData := nil; + + FIOpenRowset := nil; + FIRowsetFastLoad := nil; + Reset; + end; +end; + +{ TMSLoaderOptions } + +constructor TMSLoaderOptions.Create(Owner: TMSLoader); +begin + inherited Create; + + FOwner := Owner; + FRowsPerBatch := 0; + FKilobytesPerBatch := 0; + FLockTable := False; + FCheckConstraints := False; +end; + +procedure TMSLoaderOptions.AssignTo(Dest: TPersistent); +begin + if Dest is TMSLoaderOptions then begin + TMSLoaderOptions(Dest).RowsPerBatch := RowsPerBatch; + TMSLoaderOptions(Dest).KilobytesPerBatch := KilobytesPerBatch; + TMSLoaderOptions(Dest).LockTable := LockTable; + TMSLoaderOptions(Dest).CheckConstraints := CheckConstraints; + end + else + inherited; +end; + +end. diff --git a/internal/4.10.0.10/1/Source/MSParser.pas b/internal/4.10.0.10/1/Source/MSParser.pas new file mode 100644 index 0000000..899215e --- /dev/null +++ b/internal/4.10.0.10/1/Source/MSParser.pas @@ -0,0 +1,238 @@ + +////////////////////////////////////////////////// +// SQL Server Data Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +// MS Parser +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I Sdac.inc} + +unit MSParser; +{$ENDIF} + +interface +uses + CRParser; + +const + lxALTER = 7 {MSSymbolCount} + 1; + lxAND = lxALTER; + lxAS = lxAND + 1; + lxBEGIN = lxAS + 1; + lxBY = lxBEGIN + 1; + lxCOMPUTE = lxBY + 1; + lxCREATE = lxCOMPUTE + 1; + lxCROSS = lxCREATE + 1; + lxDECLARE = lxCROSS + 1; + lxDEFAULT = lxDECLARE + 1; + lxDELETE = lxDEFAULT + 1; + lxEND = lxDELETE + 1; + lxFOR = lxEND + 1; + lxFROM = lxFOR + 1; + lxFULL = lxFROM + 1; + lxFUNCTION = lxFULL + 1; + lxGO = lxFUNCTION + 1; + lxGROUP = lxGO + 1; + lxHAVING = lxGROUP + 1; + lxINNER = lxHAVING + 1; + lxINSERT = lxINNER + 1; + lxINTO = lxINSERT + 1; + lxIS = lxINTO + 1; + lxJOIN = lxIS + 1; + lxLEFT = lxJOIN + 1; + lxOPTION = lxLEFT + 1; + lxOR = lxOPTION + 1; + lxORDER = lxOR + 1; + lxOUTER = lxORDER + 1; + lxPROCEDURE = lxOUTER + 1; + lxREPLACE = lxPROCEDURE + 1; + lxRIGHT = lxREPLACE + 1; + lxRULE = lxRIGHT + 1; + lxSELECT = lxRULE + 1; + lxTABLE = lxSELECT + 1; + lxTRIGGER = lxTABLE + 1; + lxUPDATE = lxTRIGGER + 1; + lxUNION = lxUPDATE + 1; + lxVIEW = lxUNION + 1; + lxWHERE = lxVIEW + 1; + lxWITH = lxWHERE + 1; + +type + TMSParser = class (TParser) + protected + function IsAlpha(Ch: char): boolean; override; + function IsStringQuote(Ch: char): boolean; override; + function IsIdentQuote(Ch: char): boolean; override; + function IsInlineComment(Pos: integer): boolean; override; + procedure ToRightQuote(LeftQuote: Char); override; // Search right quote of quoted string value or quoted identifier + + procedure InitParser; override; + public + function IsSemicolon(Code: integer): boolean; override; + end; + +implementation + +uses + Classes, SysUtils; + +var + MSSymbolLexems, MSKeywordLexems: TStringList; + +{ TMSParser } + +procedure TMSParser.InitParser; +begin + inherited; +(* +SELECT statement ::= + < query_expression > + [ ORDER BY { order_by_expression | column_position [ ASC | DESC ] } + [ ,...n ] ] + [ COMPUTE + { { AVG | COUNT | MAX | MIN | SUM } ( expression ) } [ ,...n ] + [ BY expression [ ,...n ] ] + ] + [ FOR { BROWSE | XML { RAW | AUTO | EXPLICIT } + [ , XMLDATA ] + [ , ELEMENTS ] + [ , BINARY base64 ] + } +] + [ OPTION ( < query_hint > [ ,...n ]) ] + +< query expression > ::= + { < query specification > | ( < query expression > ) } + [ UNION [ ALL ] < query specification | ( < query expression > ) [...n ] ] + +< query specification > ::= + SELECT [ ALL | DISTINCT ] + [ { TOP integer | TOP integer PERCENT } [ WITH TIES ] ] + < select_list > + [ INTO new_table ] + [ FROM { < table_source > } [ ,...n ] ] + [ WHERE < search_condition > ] + [ GROUP BY [ ALL ] group_by_expression [ ,...n ] + [ WITH { CUBE | ROLLUP } ] + ] + [ HAVING < search_condition > ] + +*) + + SetLength(FClauses, 7); + FClauses[0] := lxWHERE; + FClauses[1] := lxGROUP; + FClauses[2] := lxHAVING; + FClauses[3] := lxORDER; + FClauses[4] := lxCOMPUTE; + FClauses[5] := lxFOR; + FClauses[6] := lxOPTION; + + FSymbolLexems := MSSymbolLexems; + FKeywordLexems := MSKeywordLexems; + + CommentBegin := '/*'; + CommentEnd := '*/'; +end; + +function TMSParser.IsAlpha(Ch: char): boolean; +begin + Result := inherited IsAlpha(Ch) or (Ch = '$') or (Ch = '#'); +end; + +function TMSParser.IsStringQuote(Ch: char): boolean; +begin + Result := Ch = ''''; +end; + +function TMSParser.IsIdentQuote(Ch: char): boolean; +begin + case Ch of + '"', '[', ']': + Result := True; + else + Result := False; + end; +end; + +function TMSParser.IsInlineComment(Pos: integer): boolean; +begin + // cr 7788 Result := (TextLength >= Pos + 3) and (Text[Pos] = '-') and (Text[Pos + 1] = '-') and (Text[Pos + 2] = ' '); + Result := (TextLength >= Pos + 2) and (Text[Pos] = '-') and (Text[Pos + 1] = '-'); +end; + +procedure TMSParser.ToRightQuote(LeftQuote: Char); +begin + if LeftQuote = '[' then + inherited ToRightQuote(']') + else + inherited; +end; + +function TMSParser.IsSemicolon(Code: integer): boolean; +begin + Result := Code = 7; {';'} +end; + +initialization + MSSymbolLexems := TStringList.Create; + MSKeywordLexems := TStringList.Create; + + MSSymbolLexems.AddObject('*', TObject(Integer(1))); + MSSymbolLexems.AddObject('=', TObject(Integer(2))); + MSSymbolLexems.AddObject(':', TObject(Integer(3))); + MSSymbolLexems.AddObject(',', TObject(Integer(4))); + MSSymbolLexems.AddObject('.', TObject(Integer(5))); + MSSymbolLexems.AddObject('/', TObject(Integer(6))); + MSSymbolLexems.AddObject(';', TObject(Integer(7))); + MSSymbolLexems.CustomSort(CRCmpStrings); + + MSKeywordLexems.AddObject('SELECT', TObject(Integer(lxSELECT))); + MSKeywordLexems.AddObject('FROM', TObject(Integer(lxFROM))); + MSKeywordLexems.AddObject('WHERE', TObject(Integer(lxWHERE))); + MSKeywordLexems.AddObject('ORDER', TObject(Integer(lxORDER))); + MSKeywordLexems.AddObject('BY', TObject(Integer(lxBY))); + MSKeywordLexems.AddObject('GROUP', TObject(Integer(lxGROUP))); + MSKeywordLexems.AddObject('PROCEDURE', TObject(Integer(lxPROCEDURE))); + MSKeywordLexems.AddObject('IS', TObject(Integer(lxIS))); + MSKeywordLexems.AddObject('AS', TObject(Integer(lxAS))); + MSKeywordLexems.AddObject('AND', TObject(Integer(lxAND))); + MSKeywordLexems.AddObject('OR', TObject(Integer(lxOR))); + MSKeywordLexems.AddObject('CREATE', TObject(Integer(lxCREATE))); + MSKeywordLexems.AddObject('REPLACE', TObject(Integer(lxREPLACE))); + MSKeywordLexems.AddObject('INTO', TObject(Integer(lxINTO))); + MSKeywordLexems.AddObject('UPDATE', TObject(Integer(lxUPDATE))); + MSKeywordLexems.AddObject('DELETE', TObject(Integer(lxDELETE))); + MSKeywordLexems.AddObject('INSERT', TObject(Integer(lxINSERT))); + MSKeywordLexems.AddObject('COMPUTE', TObject(Integer(lxCOMPUTE))); + MSKeywordLexems.AddObject('CROSS', TObject(Integer(lxCROSS))); + MSKeywordLexems.AddObject('FOR', TObject(Integer(lxFOR))); + MSKeywordLexems.AddObject('FULL', TObject(Integer(lxFULL))); + MSKeywordLexems.AddObject('HAVING', TObject(Integer(lxHAVING))); + MSKeywordLexems.AddObject('INNER', TObject(Integer(lxINNER))); + MSKeywordLexems.AddObject('JOIN', TObject(Integer(lxJOIN))); + MSKeywordLexems.AddObject('LEFT', TObject(Integer(lxLEFT))); + MSKeywordLexems.AddObject('OPTION', TObject(Integer(lxOPTION))); + MSKeywordLexems.AddObject('OUTER', TObject(Integer(lxOUTER))); + MSKeywordLexems.AddObject('RIGHT', TObject(Integer(lxRIGHT))); + MSKeywordLexems.AddObject('UNION', TObject(Integer(lxUNION))); + MSKeywordLexems.AddObject('WITH', TObject(Integer(lxWITH))); + MSKeywordLexems.AddObject('BEGIN', TObject(Integer(lxBEGIN))); + MSKeywordLexems.AddObject('END', TObject(Integer(lxEND))); + MSKeywordLexems.AddObject('DECLARE', TObject(Integer(lxDECLARE))); + MSKeywordLexems.AddObject('FUNCTION', TObject(Integer(lxFUNCTION))); + MSKeywordLexems.AddObject('GO', TObject(Integer(lxGO))); + MSKeywordLexems.AddObject('TABLE', TObject(Integer(lxTABLE))); + MSKeywordLexems.AddObject('DEFAULT', TObject(Integer(lxDEFAULT))); + MSKeywordLexems.AddObject('RULE', TObject(Integer(lxRULE))); + MSKeywordLexems.AddObject('VIEW', TObject(Integer(lxVIEW))); + + MSKeywordLexems.CustomSort(CRCmpStrings); + +finalization + MSSymbolLexems.Free; + MSKeywordLexems.Free; + +end. diff --git a/internal/4.10.0.10/1/Source/MSSQLMonitor.pas b/internal/4.10.0.10/1/Source/MSSQLMonitor.pas new file mode 100644 index 0000000..28eec37 --- /dev/null +++ b/internal/4.10.0.10/1/Source/MSSQLMonitor.pas @@ -0,0 +1,237 @@ + +////////////////////////////////////////////////// +// SQL Server Data Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +// SQL Monitor +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I Sdac.inc} + +unit MSSQLMonitor; +{$ENDIF} + +interface + +uses + SysUtils, Classes, DB, DBAccess, DASQLMonitor; + +type + TTypeInfo = record + Name: string; + DataType: TFieldType; + end; + +const + // Obsolete, needs to change to DB.FieldTypeNames + ArrTypeInfoCount = 16 {$IFDEF VER5P}+ 2{$ENDIF}{$IFDEF VER10P} + 1{$ENDIF}; + ArrTypeInfo: array [0..ArrTypeInfoCount - 1] of TTypeInfo = ( + (Name: 'Unknown'; DataType: ftUnknown), + (Name: 'String'; DataType: ftString), + (Name: 'WideString';DataType: ftWideString), + (Name: 'Smallint'; DataType: ftSmallint), + (Name: 'Integer'; DataType: ftInteger), + (Name: 'Word'; DataType: ftWord), + (Name: 'LargeInt'; DataType: ftLargeInt), + (Name: 'Boolean'; DataType: ftBoolean), + (Name: 'Float'; DataType: ftFloat), + (Name: 'Currency'; DataType: ftCurrency), + (Name: 'BCD'; DataType: ftBCD), + (Name: 'DateTime'; DataType: ftDateTime), + (Name: 'Memo'; DataType: ftMemo), + {$IFDEF VER10P} + (Name: 'WideMemo'; DataType: ftWideMemo), + {$ENDIF} + (Name: 'Bytes'; DataType: ftBytes), + (Name: 'VarBytes'; DataType: ftVarBytes), + (Name: 'Blob'; DataType: ftBlob){$IFDEF VER5P}, + (Name: 'GUID'; DataType: ftGuid), + (Name: 'Variant'; DataType: ftVariant){$ENDIF} + ); + +function GetArrTypeInfoIdx(DataType: TFieldType): integer; overload; +function GetArrTypeInfoIdx(Name: string): integer; overload; + +type + +{ TMSSQLMonitor } + + TMSSQLMonitorClass = class of TMSSQLMonitor; + + TMSSQLMonitor = class(TCustomDASQLMonitor) + protected + procedure InternalTRSavepoint(Connection: TCustomDAConnection; Savepoint: string); + procedure InternalTRRollbackToSavepoint(Connection: TCustomDAConnection; Savepoint: string); + procedure InternalInfoMessage(Connection: TCustomDAConnection; MessageText: string); + + class function GetMonitor: TCustomDASQLMonitor; override; + + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + class function GetParamDataType(Param: TDAParam): string; override; + + class procedure TRSavepoint(Connection: TCustomDAConnection; Savepoint: string); + class procedure TRRollbackToSavepoint(Connection: TCustomDAConnection; Savepoint: string); + + class procedure InfoMessage(Connection: TCustomDAConnection; MessageText: string); + + class function GetCaption: string; override; + + published + property Active default True; + property Options; + property OnSQL; + property TraceFlags; + end; + +implementation + +uses + MemDS, MSAccess, OLEDBAccess; + +var + MSMonitor: TMSSQLMonitor; + +function GetArrTypeInfoIdx(DataType: TFieldType): integer; +var + i: integer; +begin + if DataType = ftFixedChar then + DataType := ftString; + + Result := - 1; + for i := 0 to ArrTypeInfoCount - 1 do + if ArrTypeInfo[i].DataType = DataType then + begin + Result := i; + Break; + end; +end; + +function GetArrTypeInfoIdx(Name: string): integer; +var + i: integer; +begin + Result := - 1; + for i := 0 to ArrTypeInfoCount - 1 do + if ArrTypeInfo[i].Name = Name then + begin + Result := i; + Break; + end; +end; + +{ TMSSQLMonitor } + +class procedure TMSSQLMonitor.TRSavepoint(Connection: TCustomDAConnection; Savepoint: string); +begin + if GetMonitor <> nil then + TMSSQLMonitor(GetMonitor).InternalTRSavepoint(Connection, Savepoint); +end; + +class procedure TMSSQLMonitor.TRRollbackToSavepoint(Connection: TCustomDAConnection; Savepoint: string); +begin + if GetMonitor <> nil then + TMSSQLMonitor(GetMonitor).InternalTRRollbackToSavepoint(Connection, Savepoint); +end; + +class procedure TMSSQLMonitor.InfoMessage(Connection: TCustomDAConnection; MessageText: string); +begin + if (GetMonitor <> nil) then + TMSSQLMonitor(GetMonitor).InternalInfoMessage(Connection, MessageText); +end; + +class function TMSSQLMonitor.GetMonitor: TCustomDASQLMonitor; +begin + Result := MSMonitor; +end; + +class function TMSSQLMonitor.GetCaption: string; +begin + Result := 'MS SQL'; +end; + +procedure TMSSQLMonitor.InternalTRSavepoint(Connection: TCustomDAConnection; Savepoint: string); +var + St: string; +begin + if Active then begin + St := 'Savepoint ' + Savepoint + ': ' + Connection.Username + '@' + Connection.Server; + + if (moSQLMonitor in Options) and (tfTransact in TraceFlags) then + AddStatement(St); + + if Assigned(FOnSQLEvent) then + FOnSQLEvent(Connection, St, tfTransact); + end; +end; + +procedure TMSSQLMonitor.InternalTRRollbackToSavepoint(Connection: TCustomDAConnection; Savepoint: string); +var + St: string; +begin + if Active then begin + St := 'Rollback to savepoint ' + Savepoint + ': ' + Connection.Username + '@' + Connection.Server; + + if (moSQLMonitor in Options) and (tfTransact in TraceFlags) then + AddStatement(St); + + if Assigned(FOnSQLEvent) then + FOnSQLEvent(Connection, St, tfTransact); + end; +end; + +procedure TMSSQLMonitor.InternalInfoMessage(Connection: TCustomDAConnection; MessageText: string); +var + St: string; +begin + if Active then begin + St := 'Info Message: ' + MessageText + ': ' + Connection.Username + '@' + Connection.Server; + + if (moSQLMonitor in Options) and (tfMisc in TraceFlags) then + AddStatement(St); + + if Assigned(FOnSQLEvent) then + FOnSQLEvent(Connection, St, tfMisc); + end; +end; + +class function TMSSQLMonitor.GetParamDataType(Param: TDAParam): string; +begin + if Param.DataType = TFieldType(ftMSXML) then + Result := 'XML' + else +{$IFDEF D8} // Copied from inherited to avoid D8 Internal linker error: ILLK8903 + begin + Result := FieldTypeNames[Param.DataType]; + if Param.DataType in [ftString,ftFixedChar,ftWideString] then + Result := Result + '[' + IntToStr(Length(Param.AsString)) + ']'; + end; +{$ELSE} + Result := inherited GetParamDataType(Param); +{$ENDIF} +end; + +constructor TMSSQLMonitor.Create(AOwner: TComponent); +begin + inherited; + + if MSMonitor = nil then + MSMonitor := Self; +end; + +destructor TMSSQLMonitor.Destroy; +begin + if MSMonitor = Self then + MSMonitor := nil; + + inherited; +end; + +initialization + +end. + diff --git a/internal/4.10.0.10/1/Source/MSScript.pas b/internal/4.10.0.10/1/Source/MSScript.pas new file mode 100644 index 0000000..428d1a7 --- /dev/null +++ b/internal/4.10.0.10/1/Source/MSScript.pas @@ -0,0 +1,139 @@ +////////////////////////////////////////////////// +// SQL Server Data Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +// MSScript +////////////////////////////////////////////////// +{$IFNDEF CLR} + +{$I Sdac.inc} + +unit MSScript; +{$ENDIF} + +interface + +uses + SysUtils, Classes, DAScript, CRParser, MSParser, MSAccess, DBAccess; + +type + + TMSScript = class(TDAScript) + private + FCodes: array of integer; + protected + function GetConnection: TMSConnection; + procedure SetConnection(Value: TMSConnection); + function GetDataSet: TCustomMSDataSet; + procedure SetDataSet(Value: TCustomMSDataSet); + function GetParserClass: TParserClass; override; + function CreateCommand: TCustomDASQL; override; + procedure CheckLexem(Code: integer; var StatementType: integer; var Omit: boolean); override; + function GetReady(Code: integer): boolean; override; + function CanOptimize(const SQL: string; const StatementType: integer): boolean; override; + public + constructor Create(Owner: TComponent); override; + destructor Destroy; override; + function ExecuteNext: boolean; override; + + published + property Connection: TMSConnection read GetConnection write SetConnection; + property DataSet: TCustomMSDataSet read GetDataSet write SetDataSet; + property UseOptimization; + end; + +implementation + +{ TMSScript } + +function TMSScript.CreateCommand: TCustomDASQL; +begin + Result := TMSSQL.Create(nil); +end; + +function TMSScript.GetParserClass: TParserClass; +begin + Result := TMSParser; +end; + +function TMSScript.ExecuteNext: boolean; +var + OldCommandTimeout: integer; + i: integer; +begin + for i := Low(FCodes) to High(FCodes) do + FCodes[i] := 0; + OldCommandTimeout := 0; + if Assigned(DataSet) then + OldCommandTimeout := DataSet.CommandTimeout; + try + Result := inherited ExecuteNext; + finally + if Assigned(DataSet) then + DataSet.CommandTimeout := OldCommandTimeout; + end; +end; + +function TMSScript.GetConnection: TMSConnection; +begin + Result := TMSConnection(inherited Connection); +end; + +procedure TMSScript.SetConnection(Value: TMSConnection); +begin + inherited Connection := Value; +end; + +function TMSScript.GetDataSet: TCustomMSDataSet; +begin + Result := TCustomMSDataSet(inherited DataSet); +end; + +procedure TMSScript.SetDataSet(Value: TCustomMSDataSet); +begin + inherited DataSet := Value; +end; + +constructor TMSScript.Create(Owner: TComponent); +begin + inherited Create(Owner); + SetLength(FCodes, 3); + FMacros.SetParserClass(TMSParser); + Delimiter := ';'; +end; + +destructor TMSScript.Destroy; +begin + SetLength(FCodes, 0); + inherited; +end; + +procedure TMSScript.CheckLexem(Code: integer; var StatementType: integer; var Omit: boolean); +var + i: integer; +begin + if (Code <> lcBlank) and (Code <> lcComment) then begin + for i := Low(FCodes) to High(FCodes) - 1 do + FCodes[i] := FCodes[i + 1]; + FCodes[2] := Code; + + if (FCurrDelimiter = ';') then + if (FCodes[2] in [lxBEGIN, lxDECLARE]) + or ((FCodes[2] in [lxPROCEDURE, lxFUNCTION, lxTRIGGER]) + and ((FCodes[1] = lxCREATE) and (FCodes[0] = 0) or + (FCodes[1] = lxALTER) and (FCodes[0] = 0))) + then + StatementType := ST_SPECIFIC_SQL; + end; +end; + +function TMSScript.GetReady(Code: integer): boolean; +begin + Result := Code = lxGO; +end; + +function TMSScript.CanOptimize(const SQL: string; const StatementType: integer): boolean; +begin + Result := (StatementType <> ST_SPECIFIC_SQL) and inherited CanOptimize(SQL, StatementType); +end; + +end. diff --git a/internal/4.10.0.10/1/Source/MSServiceBroker.pas b/internal/4.10.0.10/1/Source/MSServiceBroker.pas new file mode 100644 index 0000000..e6be6c6 --- /dev/null +++ b/internal/4.10.0.10/1/Source/MSServiceBroker.pas @@ -0,0 +1,1241 @@ +////////////////////////////////////////////////// +// SQL Server Data Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +// MSServiceBroker +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I Sdac.inc} +unit MSServiceBroker; +{$ENDIF} +interface + +uses + SysUtils, Classes, DB,{$IFDEF VER6P} Variants,{$ENDIF}{$IFNDEF CLR} CLRClasses,{$ENDIF} + CRThread, MSAccess, OLEDBAccess; + +const + SEventNotificationType = 'http://schemas.microsoft.com/SQL/Notifications/EventNotification'; + SQueryNotificationType = 'http://schemas.microsoft.com/SQL/Notifications/QueryNotification'; + SFailedRemoteServiceBindingType = 'http://schemas.microsoft.com/SQL/ServiceBroker/BrokerConfigurationNotice/FailedRemoteServiceBinding'; + SFailedRouteType = 'http://schemas.microsoft.com/SQL/ServiceBroker/BrokerConfigurationNotice/FailedRoute'; + SMissingRemoteServiceBindingType = 'http://schemas.microsoft.com/SQL/ServiceBroker/BrokerConfigurationNotice/MissingRemoteServiceBinding'; + SMissingRouteType = 'http://schemas.microsoft.com/SQL/ServiceBroker/BrokerConfigurationNotice/MissingRoute'; + SDialogTimerType = 'http://schemas.microsoft.com/SQL/ServiceBroker/DialogTimer'; + SEndDialogType = 'http://schemas.microsoft.com/SQL/ServiceBroker/EndDialog'; + SErrorType = 'http://schemas.microsoft.com/SQL/ServiceBroker/Error'; + SDescriptionType = 'http://schemas.microsoft.com/SQL/ServiceBroker/ServiceDiagnostic/Description'; + SQueryType = 'http://schemas.microsoft.com/SQL/ServiceBroker/ServiceDiagnostic/Query'; + SStatusType = 'http://schemas.microsoft.com/SQL/ServiceBroker/ServiceDiagnostic/Status'; + SEchoType = 'http://schemas.microsoft.com/SQL/ServiceBroker/ServiceEcho/Echo'; + +type + // TMSMessageStatus = (msReady, msReceived, msIncomplete, msRetained); // Status of the message. For messages returned by the RECEIVE command, the status is always 0. Messages in the queue may contain one of the following values: 0=Ready, 1=Received message, 2=Not yet complete, 3=Retained sent message + TMSMessageValidation = (mvEmpty, mvNone, mvXML); + + TMSServiceBroker = class; + TMSConversation = class; + + TMSMessage = class + protected + FBody: TBytes; + FConversation: TMSConversation; + FParams: TStringList; + FParamValues: TStringList; + + // FStatus: TMSMessageStatus; // Status of the message. For messages returned by the RECEIVE command, the status is always 0. Messages in the queue may contain one of the following values: 0=Ready, 1=Received message, 2=Not yet complete, 3=Retained sent message + FQueuingOrder: Int64; // Message order number within the queue. + FConversationGroupId: TGuid; // Identifier for the conversation group that this message belongs to. + FConversationHandle: TGuid; // Handle for the conversation that this message is part of. + FMessageSequenceNumber: Int64;// Sequence number of the message within the conversation. + // FServiceName: WideString; // Name of the service that the conversation is to. + // FServiceId: integer; // SQL Server object identifier of the service that the conversation is to. + FServiceContractName: WideString; // Name of the contract that the conversation follows. + // FServiceContractId: integer; // SQL Server object identifier of the contract that the conversation follows. + FMessageType: WideString; // {DEFAULT, http://schemas.microsoft.com/SQL/ServiceBroker/EndDialog} Name of the message type that describes the message. + FMessageTypeId: integer; // SQL Server object identifier of the message type that describes the message. + FValidation: TMSMessageValidation; // Validation used for the message. E=Empty N=None X=XML + FIsEmpty: boolean; + FMessageId: TGuid; // Unique identifier for the message. + + function GetAsString: string; + function GetAsWideString: WideString; + + procedure Fill(Source: TMSQuery); + + function GetParams: TStringList; + function GetParamValues: TStringList; + property Params: TStringList read GetParams; + property ParamValues: TStringList read GetParamValues; + + public + destructor Destroy; override; + + property AsString: string read GetAsString; + property AsWideString: WideString read GetAsWideString; + property AsBytes: TBytes read FBody; + + property Conversation: TMSConversation read FConversation; + + // property Status: TMSMessageStatus read FStatus; // Status of the message. For messages returned by the RECEIVE command, the status is always 0. Messages in the queue may contain one of the following values: 0=Ready, 1=Received message, 2=Not yet complete, 3=Retained sent message + property QueuingOrder: Int64 read FQueuingOrder; // Message order number within the queue. + // property ConversationGroupId: TGuid read FConversationGroupId; // Identifier for the conversation group that this message belongs to. + // property ConversationHandle: TGuid read FConversationHandle; // Handle for the conversation that this message is part of. + property MessageSequenceNumber: Int64 read FMessageSequenceNumber;// Sequence number of the message within the conversation. + // property ServiceName: WideString read FServiceName; // Name of the service that the conversation is to. + // property ServiceId: integer read FServiceId; // SQL Server object identifier of the service that the conversation is to. + // property ServiceContractName: WideString read FServiceContractName; // Name of the contract that the conversation follows. + // property ServiceContractId: integer read FServiceContractId; // SQL Server object identifier of the contract that the conversation follows. + property MessageType: WideString read FMessageType; // {DEFAULT, http://schemas.microsoft.com/SQL/ServiceBroker/EndDialog} Name of the message type that describes the message. + property MessageTypeId: integer read FMessageTypeId; // SQL Server object identifier of the message type that describes the message. + property Validation: TMSMessageValidation read FValidation; // Validation used for the message. E=Empty N=None X=XML + property IsEmpty: boolean read FIsEmpty; + property MessageId: TGuid read FMessageId; // Unique identifier for the message. + end; + + TMSMessageEvent = procedure(Sender: TObject) of object; + TMSConversationBeginEvent = procedure(Sender: TObject; Conversation: TMSConversation) of object; + TMSConversationEndEvent = procedure(Sender: TObject; Conversation: TMSConversation; ErrorMessage: string; ErrorCode: integer) of object; + + TMSConversation = class + protected + FHandle: TGuid; + FGroupId: TGuid; + + FFarService: string; + FIsInitiator: boolean; + FServiceBroker: TMSServiceBroker; + + FContractName: WideString; + // FContractId: integer; + + function GetFarService: string; + function GetGroupId: TGuid; + // function GetContractId: integer; + function GetContractName: WideString; + procedure SetGroupId(const Value: TGuid); + + procedure InternalSend(const MessageBody: TBytes; const MessageType: WideString = ''; const IsEmpty: boolean = False); + public + constructor Create(ServiceBroker: TMSServiceBroker; const Handle: TGuid; const IsInitiator: boolean; const FarService: string = ''); + + procedure EndConversation(const Cleanup: boolean = False); + procedure EndConversationWithError(const ErrorMessage: string; const ErrorCode: integer; const Cleanup: boolean = False); + + procedure Send(const MessageBody: TBytes; const MessageType: WideString = ''); overload; + procedure Send(const MessageBody: string; const MessageType: WideString = ''); overload; + procedure SendEmpty(const MessageType: WideString = ''); + {$IFNDEF CLR} + {$IFDEF VER6P} + procedure Send(const MessageBody: WideString; const MessageType: WideString = ''); overload; + {$ENDIF} + {$ENDIF} + + procedure BeginTimer(const Timeout: integer); + function GetTransmissionStatus: string; + property Handle: TGuid read FHandle; + property GroupId: TGuid read GetGroupId write SetGroupId; + property ServiceBroker: TMSServiceBroker read FServiceBroker; + property FarService: string read GetFarService; + property IsInitiator: boolean read FIsInitiator; + property ContractName: WideString read GetContractName; // Name of the contract that the conversation follows. + // property ContractId: integer read GetContractId; // SQL Server object identifier of the contract that the conversation follows. + end; + + TMSServiceBroker = class(TComponent) + protected + FQuery: TMSQuery; + FReceiveSQL: string; + + FConversations: TList; + FMsgs: TThreadList; + FReceivePrev: boolean; + + FDesignCreate: boolean; + + FService, FQueue: string; + FFetchRows: integer; + FWaitTimeout: integer; + + FOnBeginConversation: TMSConversationBeginEvent; + FOnEndConversation: TMSConversationEndEvent; + + // Async mode + FOnMessage: TMSMessageEvent; + FAsyncNotification: boolean; + FStreamedAsyncNotification: boolean; + FListener: TOLEDBThreadWrapper; + FStopProcessing: boolean; + + function GetConversation(Index: Integer): TMSConversation; + function GetConversationCount: integer; + function GetConversationIndexByHandle(Handle: TGuid): integer; + procedure EndConversations; + + function GetCurrentMessage: TMSMessage; + procedure GetServiceBrockerObjNames(List: TStrings; SQL: string); + function GetQueue: string; + + function GetConnection: TMSConnection; + procedure SetConnection(const Value: TMSConnection); + procedure SetService(Value: string); + procedure SetFetchRows(Value: integer); + procedure SetWaitTimeout(Value: integer); + procedure SetOnMessage(Value: TMSMessageEvent); + procedure ConnectChange(Sender: TObject; Connecting: Boolean); + + procedure Loaded; override; + procedure AssignTo(Dest: TPersistent); override; + procedure CheckInactive; + + procedure BeginConnection; + procedure EndConnection; + + class function GenerateReceiveSQL(const Queue: string; Conversation: TMSConversation; const FetchRows: integer; const TimeoutMSec: integer): string; + class function ReceiveFromServer(Query: TMSQuery; Msgs: TThreadList): integer; // Received messages count + + function BeginDialogInternal( + const TargetService: string; + const TargetDatabase: string; + const Contract: string; + const LifeTime: integer; + const UseEncryption: boolean; + RelatedConversation: TMSConversation; + const GroupId: TGuid + ): TMSConversation; + + // Async mode + procedure DoThreadMessage(Sender: TObject; Event: TObject); + procedure DoException(Sender: TObject; E: Exception; var Fail: boolean); + procedure Start; + procedure Stop; + procedure SetAsyncNotification(const Value: boolean); + + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + function BeginDialog( + const TargetService: string; + const TargetDatabase: string = ''; + const UseEncryption: boolean = True; + RelatedConversation: TMSConversation = nil; + const LifeTime: integer = 0; + const Contract: string = '' + ): TMSConversation; overload; + + function BeginDialog( + const TargetService: string; + const TargetDatabase: string; + const UseEncryption: boolean; + const GroupId: TGuid; + const LifeTime: integer = 0; + const Contract: string = '' + ): TMSConversation; overload; + + property Conversations[Index: Integer]: TMSConversation read GetConversation; default; + property ConversationCount: integer read GetConversationCount; + property CurrentMessage: TMSMessage read GetCurrentMessage; + + function Receive(Conversation: TMSConversation = nil): boolean; + + procedure GetQueueNames(List: TStrings); + procedure GetServiceNames(List: TStrings); + procedure GetContractNames(List: TStrings); + procedure GetMessageTypeNames(List: TStrings); + + procedure CreateServerObjects; + procedure DropServerObjects; + + property Queue: string read GetQueue; + published + property Connection: TMSConnection read GetConnection write SetConnection; + property Service: string read FService write SetService; + property AsyncNotification: boolean read FAsyncNotification write SetAsyncNotification default False; + property FetchRows: integer read FFetchRows write SetFetchRows default 0; + property WaitTimeout: integer read FWaitTimeout write SetWaitTimeout default - 1; + property OnMessage: TMSMessageEvent read FOnMessage write SetOnMessage; + property OnBeginConversation: TMSConversationBeginEvent read FOnBeginConversation write FOnBeginConversation; + property OnEndConversation: TMSConversationEndEvent read FOnEndConversation write FOnEndConversation; + end; + +implementation + +uses +{$IFDEF CLR} + System.Runtime.InteropServices, System.Text, System.XML, System.IO, System.Reflection, +{$ELSE} + CRXml, +{$ENDIF} + Windows, ComObj, ActiveX, DAConsts, DBAccess, MSConsts, MemData, OLEDBC, MemUtils; + +function GuidToUniqueidentifier(Guid: TGuid): string; +var + Str: string; +begin + Str := GuidToString(Guid); + Result := Copy(Str, 2, Length(Str) - 2); +end; + +{ TListenThread } + +type + TListenThread = class(TCRThread) + private + FConnection: TMSConnection; + FQuery: TMSQuery; + FMsgs: TThreadList; + + protected + procedure InternalExecute; override; + + public + constructor Create(Owner: TCRThreadWrapper); override; + destructor Destroy; override; + end; + +constructor TListenThread.Create(Owner: TCRThreadWrapper); +begin + inherited Create(Owner); + + FConnection := TMSConnection.Create(nil); + FQuery := TMSQuery.Create(nil); + FQuery.Connection := FConnection; +end; + +destructor TListenThread.Destroy; +begin + Terminate; + WaitFor; + + FQuery.Free; + FConnection.Free; + + inherited; +end; + +procedure TListenThread.InternalExecute; +var + MsgCount: integer; +begin + OleCheck(CoInitializeEx(nil, COINIT_APARTMENTTHREADED)); + try + FQuery.Connection.Connect; + while not Terminated do begin + MsgCount := TMSServiceBroker.ReceiveFromServer(FQuery, FMsgs); + PostEvent(TObject(MsgCount)); + end; + finally + CoUninitialize; + end; +end; + +{ TMSMessage } + +destructor TMSMessage.Destroy; +begin + FParams.Free; + FParamValues.Free; + + inherited; +end; + +function TMSMessage.GetAsString: string; +begin + Result := Encoding.Default.GetString(FBody); +end; + +function TMSMessage.GetAsWideString: WideString; +begin + Result := Encoding.Unicode.{$IFDEF CLR}GetString{$ELSE}GetWideString{$ENDIF}(FBody); +end; + +procedure TMSMessage.Fill(Source: TMSQuery); +var + Blob: MemData.TBlob; + Handle: IntPtr; + s: string; + +begin + (*case Source.FieldByName('status').AsInteger of + 0: + FStatus := msReady; + 1: + FStatus := msReceived; + 2: + FStatus := msIncomplete; + 3: + FStatus := msRetained; + else + Assert(False); + end;*) + FQueuingOrder := (Source.FieldByName('queuing_order') as TLargeIntField).AsLargeInt; + FConversationGroupId := (Source.FieldByName('conversation_group_id') as TGuidField).AsGuid; + FConversationHandle := (Source.FieldByName('conversation_handle') as TGuidField).AsGuid; + FMessageSequenceNumber := (Source.FieldByName('message_sequence_number') as TLargeIntField).AsLargeInt; + // FServiceName := (Source.FieldByName('service_name') as TWideStringField).Value; + // FServiceId := Source.FieldByName('service_id').AsInteger; + FServiceContractName := (Source.FieldByName('service_contract_name') as TWideStringField).Value; + // FServiceContractId := Source.FieldByName('service_contract_id').AsInteger; + FMessageType := (Source.FieldByName('message_type_name') as TWideStringField).Value; + FMessageTypeId := Source.FieldByName('message_type_id').AsInteger; + + s := UpperCase(Source.FieldByName('validation').AsString); + Assert(Length(s) = 1, 'Length(' + s + ') <> 1'); + case s[1] of + 'E': // Empty + FValidation := mvEmpty; + 'N': // None + FValidation := mvNone; + 'X': // XML + FValidation := mvXML; + else + Assert(False); + end; + FIsEmpty := Source.FieldByName('message_body').IsNull; + FMessageId := (Source.FieldByName('message_id') as TGuidField).AsGuid; + + Blob := Source.GetBlob('message_body'); + + SetLength(FBody, Blob.Size); + Handle := AllocGCHandle(FBody, True); + try + Blob.Read(0, 0, GetAddrOfPinnedObject(Handle)); + finally + FreeGCHandle(Handle); + end; +end; + +function TMSMessage.GetParams: TStringList; +var + TextReader: StringReader; + Reader: XMLTextReader; + i: integer; + PrevNodeType: XmlNodeType; +begin + if (FParams = nil) and (Validation = mvXML) then begin + FParams := TStringList.Create; + FParamValues := TStringList.Create; + TextReader := nil; + Reader := nil; + try + TextReader := StringReader.Create(Encoding.Unicode.{$IFDEF CLR}GetString{$ELSE}GetWideString{$ENDIF}(FBody)); + Reader := XMLTextReader.Create(TextReader); + PrevNodeType := Reader.NodeType; + while Reader.Read do begin + if Reader.NodeType = ntElement then begin + FParams.Add(Reader.Name); + FParamValues.Add(''); + end; + if (Reader.NodeType = ntText) and (PrevNodeType = ntElement) then begin + Assert(FParams.Count = FParamValues.Count); + FParamValues[FParamValues.Count - 1] := Reader.Value; + end; + + for i := 0 to Reader.AttributeCount - 1 do begin + Reader.MoveToAttribute(i); + FParams.Add(Reader.Name); + FParamValues.Add(Reader.Value); + end; + PrevNodeType := Reader.NodeType; + end; + finally + Reader.Free; + TextReader.Free; + end; + end; + Result := FParams; + Assert(Result <> nil); +end; + +function TMSMessage.GetParamValues: TStringList; +begin + GetParams; // fill FParams and FParamValues + Result := FParamValues; + Assert(Result <> nil); +end; + +{ TMSConversation } + +constructor TMSConversation.Create(ServiceBroker: TMSServiceBroker; const Handle: TGuid; const IsInitiator: boolean; const FarService: string = ''); +begin + inherited Create; + Assert(ServiceBroker <> nil); + FServiceBroker := ServiceBroker; + FHandle := Handle; + FFarService := FarService; + FIsInitiator := IsInitiator; + + FServiceBroker.FConversations.Add(Self); + if Assigned(FServiceBroker.FOnBeginConversation) then + FServiceBroker.FOnBeginConversation(FServiceBroker, Self); +end; + +procedure TMSConversation.EndConversation(const Cleanup: boolean = False); +begin + EndConversationWithError('', 0, Cleanup); +end; + +procedure TMSConversation.EndConversationWithError(const ErrorMessage: string; const ErrorCode: integer; const Cleanup: boolean = False); +var + WithError: string; + WithCleanUp: string; +begin + Assert(FServiceBroker <> nil); + Assert(FServiceBroker.Connection <> nil); + try + if Assigned(FServiceBroker.FOnEndConversation) then + FServiceBroker.FOnEndConversation(FServiceBroker, Self, ErrorMessage, ErrorCode); + FServiceBroker.FConversations.Remove(Self); + + if (ErrorMessage <> '') and (ErrorCode <> 0) then + WithError := ' WITH ERROR = :ErrorCode DESCRIPTION = :ErrorMessage'; + + if Cleanup then + WithCleanUp := ' WITH CLEANUP'; + FServiceBroker.FQuery.SQL.Text := 'END CONVERSATION :Handle ' + WithError + WithCleanUp; + FServiceBroker.FQuery.ParamByName('Handle').DataType := ftGuid; + FServiceBroker.FQuery.ParamByName('Handle').AsString := GuidToString(Handle); + + if FServiceBroker.FQuery.Params.Count > 1 then begin + FServiceBroker.FQuery.ParamByName('ErrorCode').AsInteger := ErrorCode; + FServiceBroker.FQuery.ParamByName('ErrorMessage').AsString := ErrorMessage; + end; + FServiceBroker.FQuery.Execute; + finally + FServiceBroker.EndConnection; + Free; + end; +end; + +{$IFNDEF CLR} +{$IFDEF VER6P} +procedure TMSConversation.Send(const MessageBody: WideString; const MessageType: WideString = ''); +var + Buf: TBytes; +begin + Buf := Encoding.Default.{$IFNDEF VER5}GetBytes{$ELSE}GetBytesWide{$ENDIF}(MessageBody); + Send(Buf, MessageType); +end; +{$ENDIF} +{$ENDIF} + +function TMSConversation.GetTransmissionStatus: string; +begin + FServiceBroker.FQuery.SQL.Text := 'SELECT GET_TRANSMISSION_STATUS(CONVERT(uniqueidentifier, ''' + + GuidToUniqueidentifier(Handle) + '''))'; + FServiceBroker.FQuery.Execute; + Result := FServiceBroker.FQuery.Fields[0].AsString; +end; + +procedure TMSConversation.BeginTimer(const Timeout: integer); +begin + FServiceBroker.FQuery.SQL.Text := 'BEGIN CONVERSATION TIMER (CONVERT(uniqueidentifier, ''' + + GuidToUniqueidentifier(Handle) + ''')) TIMEOUT = ' + IntToStr(Timeout); + FServiceBroker.FQuery.Execute; +end; + +function TMSConversation.GetFarService: string; +begin + if FFarService = '' then begin + FServiceBroker.FQuery.SQL.Text := 'SELECT far_service FROM sys.conversation_endpoints WHERE conversation_handle = CONVERT(uniqueidentifier, ''' + GuidToUniqueidentifier(Handle) + ''')'; + FServiceBroker.FQuery.Execute; + FFarService := FServiceBroker.FQuery.Fields[0].AsString; + end; + + Result := FFarService; +end; + +function TMSConversation.GetGroupId: TGuid; +begin + if CompareGuid(FGroupId, DB_NULLGUID) then begin + Assert(FServiceBroker <> nil); + Assert(FServiceBroker.FQuery <> nil); + + // sys.conversation_endpoints + FServiceBroker.FQuery.SQL.Text := + 'SELECT e.conversation_group_id, e.service_contract_id, c.name ' + + 'FROM sys.conversation_endpoints e, sys.service_contracts c ' + + 'WHERE (e.conversation_handle = CONVERT(uniqueidentifier, ''' + GuidToUniqueidentifier(Handle) + ''')) AND (e.service_contract_id = c.service_contract_id)'; + FServiceBroker.FQuery.Execute; + FGroupId := StringToGUID(FServiceBroker.FQuery.Fields[0].AsString); + // FContractId := FServiceBroker.FQuery.Fields[1].AsInteger; + FContractName := FServiceBroker.FQuery.Fields[2].AsString; + end; + + Result := FGroupId; +end; + +(*function TMSConversation.GetContractId: integer; +begin + if CompareGuid(FGroupId, DB_NULLGUID) then + GetGroupId; // Fill FGroupId, FContractId, FContractName + + Result := FContractId; +end;*) + +function TMSConversation.GetContractName: WideString; +begin + if CompareGuid(FGroupId, DB_NULLGUID) then + GetGroupId; // Fill FGroupId, FContractId, FContractName + + Result := FContractName; +end; + +procedure TMSConversation.SetGroupId(const Value: TGuid); +begin + Assert(FServiceBroker <> nil); + Assert(FServiceBroker.Connection <> nil); + + FServiceBroker.FQuery.SQL.Text := 'MOVE CONVERSATION CONVERT(uniqueidentifier, ''' + + GuidToUniqueidentifier(Handle) + ''')'; + FServiceBroker.FQuery.SQL.Add('TO CONVERT(uniqueidentifier, ''' + + GuidToUniqueidentifier(Value) + ''')'); + FServiceBroker.FQuery.Execute; + FGroupId := Value; +end; + +procedure TMSConversation.SendEmpty(const MessageType: WideString = ''); +begin + InternalSend(nil, MessageType, True); +end; + +procedure TMSConversation.Send(const MessageBody: string; const MessageType: WideString = ''); +var + Buf: TBytes; +begin + Buf := Encoding.Default.GetBytes(MessageBody); + InternalSend(Buf, MessageType); +end; + +procedure TMSConversation.Send(const MessageBody: TBytes; const MessageType: WideString = ''); +begin + InternalSend(MessageBody, MessageType); +end; + +procedure TMSConversation.InternalSend(const MessageBody: TBytes; const MessageType: WideString = ''; const IsEmpty: boolean = False); +var + ParamIndex: integer; +begin + Assert(FServiceBroker <> nil); + Assert(FServiceBroker.Connection <> nil); + + ParamIndex := 0; + FServiceBroker.FQuery.SQL.BeginUpdate; + try + FServiceBroker.FQuery.SQL.Text := 'SEND ON CONVERSATION CONVERT(uniqueidentifier, ''' + GuidToUniqueidentifier(Handle) + ''')'; + if MessageType <> '' then + FServiceBroker.FQuery.SQL.Add('MESSAGE TYPE :MessageType' + LineSeparator); + if not IsEmpty then + FServiceBroker.FQuery.SQL.Add('(:MessageBody);'); + finally + FServiceBroker.FQuery.SQL.EndUpdate; + end; + if MessageType <> '' then begin + FServiceBroker.FQuery.Params[ParamIndex].DataType := ftWideString; + FServiceBroker.FQuery.Params[ParamIndex].Value := MessageType; + FServiceBroker.FQuery.Params[ParamIndex].ParamType := ptInput; + Inc(ParamIndex); + end; + + if not IsEmpty then begin + FServiceBroker.FQuery.Params[ParamIndex].DataType := ftBytes; + FServiceBroker.FQuery.Params[ParamIndex].Value := MessageBody; + FServiceBroker.FQuery.Params[ParamIndex].ParamType := ptInput; + end; + FServiceBroker.FQuery.Execute; +end; + +{ TMSServiceBroker } + +constructor TMSServiceBroker.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + + FWaitTimeout := -1; + + FConversations := TList.Create; + + FQuery := TMSQuery.Create(nil); + FQuery.ReadOnly := True; + FMsgs := TThreadList.Create; + + FDesignCreate := csDesigning in ComponentState; +end; + +destructor TMSServiceBroker.Destroy; +var + i: integer; + MsgList: TList; +begin + Stop; + EndConversations; + + Connection := nil; // UnregisterClient + + if FMsgs <> nil then begin + MsgList := FMsgs.LockList; + try + for i := 0 to MsgList.Count - 1 do + TObject(MsgList[i]).Free; + finally + FMsgs.UnlockList; + FMsgs.Free; + end; + end; + + FQuery.Free; + FConversations.Free; + + inherited; +end; + +procedure TMSServiceBroker.Loaded; +begin + inherited; + + FDesignCreate := False; + try + if FStreamedAsyncNotification then + AsyncNotification := True; + except + if csDesigning in ComponentState then + ApplicationHandleException(Self) + else + raise; + end; +end; + +procedure TMSServiceBroker.AssignTo(Dest: TPersistent); +begin + if Dest is TMSServiceBroker then begin + TMSServiceBroker(Dest).Connection := Connection; + TMSServiceBroker(Dest).Service := Service; + TMSServiceBroker(Dest).OnMessage := OnMessage; + end + else + inherited; +end; + +procedure TMSServiceBroker.BeginConnection; +begin + if Connection = nil then + raise Exception.Create(SConnectionNotDefined); + TDBAccessUtils.InternalConnect(Connection); +end; + +procedure TMSServiceBroker.EndConnection; +begin + TDBAccessUtils.InternalDisconnect(Connection); +end; + +procedure TMSServiceBroker.EndConversations; +var + i: integer; +begin + for i := ConversationCount - 1 downto 0 do + Conversations[i].Free; + FConversations.Clear; +end; + +procedure TMSServiceBroker.CheckInactive; +begin + if AsyncNotification then + if ([csUpdating, csDesigning] * ComponentState) <> [] then + Stop + else + DatabaseError(SServiceBrokerAsync, Self); +end; + +procedure TMSServiceBroker.ConnectChange(Sender: TObject; Connecting: Boolean); +begin + if not Connecting then begin + Stop; + EndConversations; + end; +end; + +function TMSServiceBroker.GetConversation(Index: Integer): TMSConversation; +begin + Result := TMSConversation(FConversations[Index]); +end; + +function TMSServiceBroker.GetConversationCount: integer; +begin + Result := FConversations.Count; +end; + +function TMSServiceBroker.GetConversationIndexByHandle(Handle: TGuid): integer; +var + i: integer; +begin + Result := -1; + for i := 0 to FConversations.Count - 1 do + if CompareGuid(Conversations[i].Handle, Handle) then begin + Result := i; + Exit; + end; +end; + +class function TMSServiceBroker.GenerateReceiveSQL(const Queue: string; Conversation: TMSConversation; const FetchRows: integer; const TimeoutMSec: integer): string; +begin + if FetchRows = 0 then + Result := 'RECEIVE ' + else + Result := 'RECEIVE TOP(' + IntToStr(FetchRows) + ') '; + + Result := Result + 'message_id, message_body, status, queuing_order, conversation_group_id, conversation_handle, message_sequence_number, service_contract_name, service_contract_id, message_type_name, message_type_id, validation FROM ' + BracketIfNeed(Queue); + if Conversation <> nil then + Result := Result + ' WHERE conversation_handle = ' + + 'CONVERT(uniqueidentifier, ''''' + GuidToUniqueidentifier(Conversation.Handle) + ''''')'; + + if TimeoutMSec <> - 1 then + Result := 'WAITFOR (' + Result + '), TIMEOUT ' + IntToStr(TimeoutMSec); +end; + +function TMSServiceBroker.BeginDialogInternal( + const TargetService: string; + const TargetDatabase: string; + const Contract: string; + const LifeTime: integer; + const UseEncryption: boolean; + RelatedConversation: TMSConversation; + const GroupId: TGuid +): TMSConversation; +var + Param: TMSParam; +begin + if FService = '' then + raise Exception.Create(SServiceNotDefined); + + BeginConnection; + try + FQuery.SQL.Clear; + FQuery.SQL.Append('BEGIN DIALOG :ch FROM SERVICE :fs TO SERVICE :ts'); + Param := FQuery.ParamByName('ch'); + Param.DataType := ftGuid; + Param.ParamType := ptOutput; + Param := FQuery.ParamByName('fs'); + Param.AsString := FService; + Param := FQuery.ParamByName('ts'); + Param.AsString := TargetService; + + if TargetDatabase <> '' then begin + FQuery.SQL.Append(', :bi'); + Param := FQuery.ParamByName('bi'); + Param.AsWideString := TargetDatabase; + end; + + if Contract <> '' then begin + FQuery.SQL.Append(' ON CONTRACT :cn'); + Param := FQuery.ParamByName('cn'); + Param.AsString := Contract; + end; + + if UseEncryption then + FQuery.SQL.Append(' WITH ENCRYPTION = ON ') + else + FQuery.SQL.Append(' WITH ENCRYPTION = OFF '); + + if RelatedConversation <> nil then begin + FQuery.SQL.Append(', RELATED_CONVERSATION = :rch '); + Param := FQuery.ParamByName('rch'); + Param.AsString := GUIDToString(RelatedConversation.Handle); + end + else + if not CompareGuid(GroupId, DB_NULLGUID) then begin + FQuery.SQL.Append(', RELATED_CONVERSATION_GROUP = :rcg '); + Param := FQuery.ParamByName('rcg'); + Param.AsString := GUIDToString(GroupId); + end; + if LifeTime <> 0 then + FQuery.SQL.Append(', LIFETIME = ' + IntToStr(LifeTime) + ' '); + + FQuery.Execute; + + Param := FQuery.ParamByName('ch'); + Result := TMSConversation.Create(Self, StringToGUID(Param.AsString), True, TargetService); + except + EndConnection; + raise; + end; +end; + +function TMSServiceBroker.BeginDialog( + const TargetService: string; + const TargetDatabase: string = ''; + const UseEncryption: boolean = True; + RelatedConversation: TMSConversation = nil; + const LifeTime: integer = 0; + const Contract: string = ''): TMSConversation; +begin + Result := BeginDialogInternal(TargetService, TargetDatabase, Contract, LifeTime, UseEncryption, RelatedConversation, DB_NULLGUID); +end; + +function TMSServiceBroker.BeginDialog( + const TargetService: string; + const TargetDatabase: string; + const UseEncryption: boolean; + const GroupId: TGuid; + const LifeTime: integer = 0; + const Contract: string = ''): TMSConversation; +begin + Result := BeginDialogInternal(TargetService, TargetDatabase, Contract, LifeTime, UseEncryption, nil, GroupId); +end; + +function TMSServiceBroker.GetCurrentMessage: TMSMessage; +var + MsgList: TList; +begin + MsgList := FMsgs.LockList; + try + if MsgList.Count > 0 then + Result := TMSMessage(MsgList[0]) + else + Result := nil; + finally + FMsgs.UnlockList; + end; +end; + +procedure TMSServiceBroker.GetServiceBrockerObjNames(List: TStrings; SQL: string); +var + QueueDS: TMSQuery; + NameFld: TField; +begin + BeginConnection; + List.Clear; + QueueDS := nil; + try + QueueDS := TMSQuery.Create(nil); + QueueDS.Connection := Connection; + QueueDS.SQL.Text := SQL; + + if TOLEDBConnection(TMSAccessUtils.FIConnection(Connection)).DBMSPrimaryVer <= 8 then + Exit; + + QueueDS.Open; + + NameFld := QueueDS.Fields[0]; + while not QueueDS.Eof do begin + List.Add(NameFld.AsString); + QueueDS.Next + end; + + if List is TStringList then + TStringList(List).Sort; + finally + QueueDS.Free; + EndConnection; + end; +end; + +function TMSServiceBroker.GetQueue: string; +begin + if FQueue = '' then begin + BeginConnection; + try + FQuery.SQL.Text := 'SELECT q.name FROM sys.service_queues q, sys.services s WHERE (s.service_queue_id = q.object_id) AND (s.name = ''' + Service + ''')'; + FQuery.Execute; + FQueue := FQuery.Fields[0].AsString; + finally + EndConnection; + end; + end; + Result := FQueue; +end; + +function TMSServiceBroker.GetConnection: TMSConnection; +begin + Assert(FQuery <> nil); + Result := FQuery.Connection; +end; + +procedure TMSServiceBroker.SetConnection(const Value: TMSConnection); +begin + if Value <> Connection then begin + Stop; + EndConversations; + + if Connection <> nil then + TDBAccessUtils.UnRegisterClient(Connection, Self); + + FQuery.Connection := Value; + if Value <> nil then + TDBAccessUtils.RegisterClient(Value, Self, ConnectChange); + end; +end; + +procedure TMSServiceBroker.SetService(Value: string); +begin + if FService <> Value then begin + Stop; + if FConversations.Count > 0 then + if ([csUpdating, csDesigning] * ComponentState) <> [] then + EndConversations + else + DatabaseError(SDialogActive, Self); + FService := Value; + FQueue := ''; + end; +end; + +procedure TMSServiceBroker.SetFetchRows(Value: integer); +begin + FFetchRows := Value; + FReceiveSQL := ''; +end; + +procedure TMSServiceBroker.SetWaitTimeout(Value: integer); +begin + FWaitTimeout := Value; + FReceiveSQL := ''; +end; + +procedure TMSServiceBroker.SetOnMessage(Value: TMSMessageEvent); +begin + CheckInactive; + FOnMessage := Value; +end; + +class function TMSServiceBroker.ReceiveFromServer(Query: TMSQuery; Msgs: TThreadList): integer; // Received messages count +var + Msg: TMSMessage; + MsgList: TList; +begin + Assert(Query <> nil); + Assert(Query.Connection <> nil); + + Result := 0; + TDBAccessUtils.InternalConnect(Query.Connection); + try + Query.Execute; + + MsgList := Msgs.LockList; + try + while not Query.Eof do begin + Msg := TMSMessage.Create; + try + Msg.Fill(Query); + except + Msg.Free; + raise; + end; + MsgList.Add(Msg); + Inc(Result); + + Query.Next; + end; + finally + Msgs.UnlockList; + end; + Query.Close; + finally + // Query will automatically disconnect + // TDBAccessUtils.InternalDisconnect(Query.Connection); + end; +end; + +function TMSServiceBroker.Receive(Conversation: TMSConversation = nil): boolean; +var + MsgList: TList; + + procedure RemoveCurrentMessage; + var + Msg: TMSMessage; + begin + Msg := TMSMessage(MsgList[0]); + try + if (Msg.MessageType = SEndDialogType) or (Msg.MessageType = SErrorType) then begin + FConversations.Remove(Msg.Conversation); + Msg.Conversation.Free; + end; + finally + Msg.Free; + MsgList.Delete(0); + end; + end; + + procedure ActualizeCurrentMessage; + var + Msg: TMSMessage; + ConversationIndex: integer; + i: integer; + s: string; + begin + Msg := CurrentMessage; + + ConversationIndex := GetConversationIndexByHandle(Msg.FConversationHandle); + if ConversationIndex < 0 then + Msg.FConversation := TMSConversation.Create(Self, Msg.FConversationHandle, False) + else + Msg.FConversation := Conversations[ConversationIndex]; + + Msg.FConversation.FGroupId := Msg.FConversationGroupId; + Msg.FConversation.FContractName := Msg.FServiceContractName; + // Msg.FConversation.FContractId := Msg.FServiceContractId; + + if Assigned(FOnEndConversation) then begin + if Msg.MessageType = SEndDialogType then + FOnEndConversation(Self, Msg.Conversation, '', 0) + else + if Msg.MessageType = SErrorType then begin + i := Msg.Params.IndexOf('Description'); + s := Msg.ParamValues[i]; + i := Msg.Params.IndexOf('Code'); + i := StrToInt(Msg.ParamValues[i]); + FOnEndConversation(Self, Msg.Conversation, s, i); + end; + end; + end; + +begin + if (Conversation <> nil) and AsyncNotification then + raise Exception.Create(SServiceBrokerAsync); + + MsgList := FMsgs.LockList; + try + if (MsgList.Count > 0) and FReceivePrev then + RemoveCurrentMessage; + + if (MsgList.Count = 0) and not AsyncNotification then begin + if (FReceiveSQL = '') or (Conversation <> nil) then + FReceiveSQL := GenerateReceiveSQL(Queue, Conversation, FetchRows, WaitTimeout); + FQuery.SQL.Text := FReceiveSQL; + ReceiveFromServer(FQuery, FMsgs); + end; + + Result := MsgList.Count > 0; + FReceivePrev := Result; + if Result then + ActualizeCurrentMessage; + finally + FMsgs.UnlockList; + end; +end; + +procedure TMSServiceBroker.GetQueueNames(List: TStrings); +begin + GetServiceBrockerObjNames(List, 'SELECT name FROM sys.service_queues'); +end; + +procedure TMSServiceBroker.GetServiceNames(List: TStrings); +begin + GetServiceBrockerObjNames(List, 'SELECT name FROM sys.services'); +end; + +procedure TMSServiceBroker.GetContractNames(List: TStrings); +begin + GetServiceBrockerObjNames(List, 'SELECT name FROM sys.service_contracts'); +end; + +procedure TMSServiceBroker.GetMessageTypeNames(List: TStrings); +begin + GetServiceBrockerObjNames(List, 'SELECT name FROM sys.service_message_types'); +end; + +procedure TMSServiceBroker.CreateServerObjects; +begin + Connection.ExecSQL( + 'IF NOT EXISTS (SELECT * FROM sys.service_queues WHERE name = ''' + Service + '_QUEUE'') CREATE QUEUE ' + BracketIfNeed(Service + '_QUEUE') + #$D#$A + + 'IF NOT EXISTS (SELECT * FROM sys.services WHERE name = ''' + Service + ''') CREATE SERVICE ' + BracketIfNeed(Service) + ' ON QUEUE ' + BracketIfNeed(Service + '_QUEUE') + '([DEFAULT])', []); +end; + +procedure TMSServiceBroker.DropServerObjects; +begin + BeginConnection; + try + Stop; + + Connection.ExecSQL( + 'IF EXISTS (SELECT * FROM sys.services WHERE name = ''' + Service + ''') DROP SERVICE ' + BracketIfNeed(Service) + #$D#$A + + 'IF EXISTS (SELECT * FROM sys.service_queues WHERE name = ''' + Service + '_Queue'') DROP QUEUE ' + BracketIfNeed(Service + '_Queue'), []); + finally + EndConnection; + end; +end; + +procedure TMSServiceBroker.DoThreadMessage(Sender: TObject; Event: TObject); +var + i: integer; +begin + if Assigned(FOnMessage) then + for i := 0 to Integer(Event) - 1do + FOnMessage(Sender); +end; + +procedure TMSServiceBroker.DoException(Sender: TObject; E: Exception; var Fail: boolean); +begin + if (E is EOLEDBError) then begin + if EOLEDBError(E).ErrorCode = DB_E_CANCELED then + Fail := False + else + if Connection.Connected then + TMSAccessUtils.DoError(Connection, E, Fail); + if Fail then + Stop; + end; +end; + +procedure TMSServiceBroker.Start; +var + lt: TListenThread; +begin + if not FAsyncNotification then begin + BeginConnection; + if FService = '' then + DatabaseError(SServiceNotDefined, Self); + {if not Assigned(FOnMessage) then + DatabaseError(SOnMessageNotAssigned, Self);} + + Assert(FListener = nil); + FListener := TOLEDBThreadWrapper.Create(TListenThread, True); + lt := TListenThread(FListener.Thread); + Assert(lt.FConnection <> nil); + lt.FConnection.Assign(Connection); + lt.FConnection.LoginPrompt := False; + lt.FQuery.SQL.Text := GenerateReceiveSQL(Queue, nil, FetchRows, MaxInt); + lt.FMsgs := FMsgs; + + FListener.OnPostEvent := DoThreadMessage; + FListener.OnException := DoException; + FListener.Resume; + FAsyncNotification := True; + end; +end; + +procedure TMSServiceBroker.Stop; +begin + if FStopProcessing then + Exit; + + if FAsyncNotification then begin + FStopProcessing := True; + try + TListenThread(FListener.Thread).FQuery.BreakExec; + FListener.Free; + FListener := nil; + FAsyncNotification := False; + finally + FStopProcessing := False; + EndConnection; + end; + end; +end; + +procedure TMSServiceBroker.SetAsyncNotification(const Value: boolean); +begin + if csReading in ComponentState then begin + if Value then + FStreamedAsyncNotification := True; + end + else + if Value <> FAsyncNotification then + if Value then + Start + else + Stop; +end; + +end. diff --git a/internal/4.10.0.10/1/Source/Make.bat b/internal/4.10.0.10/1/Source/Make.bat new file mode 100644 index 0000000..edcfc1d --- /dev/null +++ b/internal/4.10.0.10/1/Source/Make.bat @@ -0,0 +1,277 @@ +@echo off +rem ********************************************************************** +rem * +rem * SDAC +rem * +rem * Tasks: +rem * 1) Compile DAC packages; +rem * 2) Compile CRControls package; +rem * 2) Compile SDAC packages; +rem * +rem * Command line: +rem * call ..\_Make.bat IDEName IDEVer CLR +rem * +rem * Parameters: +rem * IDEName = (Delphi, CBuilder) +rem * IDEVer = (5, 6, 7, 8, 9, 10, 11) +rem * CLR = (CLR, WIN32) WIN32 - default +rem ********************************************************************** + +rem Prepare ============================================================== +rem ====================================================================== +set IDEName=%1 +set IDEVer=%2 +set CLR=%3 +set PrjName=Sdac +set PrjNameL=sdac + +pushd + +rem Test IDEName +if %IDEName%A==DelphiA goto IDENameOK +if %IDEName%A==CBuilderA goto IDENameOK +echo Command line must be: +echo call ..\_Make.bat IDEName IDEVer +echo IDEName = (Delphi, CBuilder) +goto Err +:IDENameOK + +rem Test IDEVer +if %IDEVer%A==5A goto IDEVerOK +if %IDEVer%A==6A goto IDEVerOK +if %IDEVer%A==7A goto IDEVerOK +if %IDEVer%A==8A goto IDEVerOK +if %IDEVer%A==9A goto IDEVerOK +if %IDEVer%A==10A goto IDEVerOK +if %IDEVer%A==11A goto IDEVer11 +echo Command line must be: +echo call ..\Make.bat IDEName IDEVer CLR +echo IDEVer = (5, 6, 7, 8, 9, 10, 11) +goto Err + +:IDEVer11: +set PkgVer=105 +goto PkgVerOK + +:IDEVerOK +set PkgVer=%IDEVer%0 + +:PkgVerOK + +rem Test CLR +if %CLR%A==CLRA goto CLROK +set CLR=WIN32 +:CLROK + +rem Make paths =========================================================== +rem Create common paths +mkdir %PrjName% +mkdir %PrjName%\Lib +mkdir %PrjName%\CRGrid +if %IDEVer%A==10A mkdir %PrjName%\Include + +rem Create CBuilder specific paths +if %IDEName%A==DelphiA goto SkipCBPaths +mkdir %PrjName%\Include +mkdir %PrjName%\Dcu +:SkipCBPaths + +rem del /Q/S %PrjName%\*.* + +if %IDEName%A==CBuilderA goto CBuilder +if %CLR%A==CLRA goto Delphi8 + +rem Compile ============================================================== +rem Compile DAC packages ================================================= +%IdeDir%\Bin\dcc32.exe" -LE. dac%PkgVer%.dpk +@if errorlevel 1 goto Err + +if %IDEVer%A==4A goto SkipDVcl +if %IDEVer%A==5A goto SkipDVcl +%IdeDir%\Bin\dcc32.exe" -LE. dacvcl%PkgVer%.dpk +@if errorlevel 1 goto Err + +:SkipDVcl +%IdeDir%\Bin\dcc32.exe" -LE. dcldac%PkgVer%.dpk +@if errorlevel 1 goto Err + +rem Compile CRControls package =========================================== +cd ..\..\CRGrid\Source\%IDEName%%IDEVer% +%IdeDir%\Bin\dcc32.exe" -LE. CRControls%PkgVer%.dpk -I..\..\..\Source -U..\..\..\Source\%IDEName%%IDEVer% +@if errorlevel 1 goto Err +cd ..\..\..\Source\%IDEName%%IDEVer% + +rem Compile SDAC packages =========================================== +%IdeDir%\Bin\dcc32.exe" -LE. %PrjNameL%%PkgVer%.dpk +@if errorlevel 1 goto Err + +if %IDEVer%A==4A goto SkipD__Vcl +if %IDEVer%A==5A goto SkipD__Vcl + +%IdeDir%\Bin\dcc32.exe" -LE. %PrjNameL%vcl%PkgVer%.dpk +@if errorlevel 1 goto Err + +:SkipD__Vcl + +%IdeDir%\Bin\dcc32.exe" -LE. dcl%PrjNameL%%PkgVer%.dpk +@if errorlevel 1 goto Err + +rem Copy files =========================================================== +rem ====================================================================== + +copy ..\..\CRGrid\Source\%IDEName%%IDEVer%\CRControls%PkgVer%.bpl %PrjName% + +copy ..\..\CRGrid\Source\%IDEName%%IDEVer%\CRControls%PkgVer%.dcp %PrjName%\CRGrid +copy ..\..\CRGrid\Source\%IDEName%%IDEVer%\CRGrid.dcu %PrjName%\CRGrid +copy ..\..\CRGrid\Source\CRGrid.res %PrjName%\CRGrid + +copy *.bpl %PrjName% + +copy *.bpi %PrjName%\Lib +copy *.dcu %PrjName%\Lib +copy *.dcp %PrjName%\Lib +copy ..\*.res %PrjName%\Lib +copy *.hpp %PrjName%\Include +copy ..\*.hpp %PrjName%\Include + +copy ..\..\CRGrid\Source\CRControlsReg.hpp %PrjName%\Include +copy ..\..\CRGrid\Source\CRGrid.hpp %PrjName%\Include + +set IdeDir="D:\Progra~1\Borland\BDS\4.0 + +if not %IDEVer%A==10A goto SkipD10BCCLib +if not %CLR%A==WIN32A goto SkipD10BCCLib + +del %PrjName%\Include\*100.hpp +:SkipD10BCCLib + +goto end + +:Delphi8 +rem Compile Delphi8 ====================================================== +rem Compile DAC packages ================================================= + +%IdeDir%\Bin\dccil.exe" -LE. CoreLab.Dac.dpk +@if errorlevel 1 goto Err + +%IdeDir%\Bin\dccil.exe" -LE. CoreLab.Dac.AdoNet.dpk +@if errorlevel 1 goto Err + +%IdeDir%\Bin\dccil.exe" -LE. CoreLab.Dac.Design.dpk +@if errorlevel 1 goto Err + +rem Compile CRControls package =========================================== +cd ..\..\CRGrid\Source\%IDEName%%IDEVer% +%IdeDir%\Bin\dccil.exe" -LE. CoreLab.Vcl.dpk -I..\..\..\Source -U..\..\..\Source\%IDEName%%IDEVer%;..\ -R..\..\..\Source\;..\ +@if errorlevel 1 goto Err +cd ..\..\..\Source\%IDEName%%IDEVer% + +rem Compile SDAC packages =========================================== +%IdeDir%\Bin\dccil.exe" -LE. CoreLab.Sdac.dpk +@if errorlevel 1 goto Err + +%IdeDir%\Bin\dccil.exe" -LE. CoreLab.Sdac.AdoNet.dpk +@if errorlevel 1 goto Err + +%IdeDir%\Bin\dccil.exe" -LE. CoreLab.Sdac.Design.dpk +@if errorlevel 1 goto Err + +rem Copy files =========================================================== +rem ====================================================================== + +copy ..\..\CRGrid\Source\%IDEName%%IDEVer%\CoreLab.Vcl.dll %PrjName% + +copy ..\..\CRGrid\Source\%IDEName%%IDEVer%\CoreLab.Vcl.dcpil %PrjName%\CRGrid +copy ..\..\CRGrid\Source\%IDEName%%IDEVer%\CoreLab.Vcl.CRGrid.dcuil %PrjName%\CRGrid +copy ..\..\CRGrid\Source\CRGrid.res %PrjName%\CRGrid + +copy *.dll %PrjName% + +copy *.dcuil %PrjName%\Lib +copy *.dcpil %PrjName%\Lib +copy ..\*.res %PrjName%\Lib + +goto end + +:CBuilder +rem Compile ============================================================== +rem Compile DAC packages ================================================= +cd %DacDir% + +%IdeDir%\Bin\bpr2mak.exe" -t..\dac.bmk dac%PkgVer%.bpk +@if errorlevel 1 goto Err +%IdeDir%\Bin\make.exe" -f dac%PkgVer%.mak +@if errorlevel 1 goto Err + +if %IDEVer%A==4A goto SkipCBVcl +if %IDEVer%A==5A goto SkipCBVcl +%IdeDir%\Bin\bpr2mak.exe" -t..\dac.bmk dacvcl%PkgVer%.bpk +@if errorlevel 1 goto Err +%IdeDir%\Bin\make.exe" -f dacvcl%PkgVer%.mak +@if errorlevel 1 goto Err + +:SkipCBVcl + +%IdeDir%\Bin\bpr2mak.exe" -t..\dac.bmk dcldac%PkgVer%.bpk +@if errorlevel 1 goto Err +%IdeDir%\Bin\make.exe" -f dcldac%PkgVer%.mak +@if errorlevel 1 goto Err + +rem Compile CRControls package =========================================== +cd ..\..\CRGrid\Source\%IDEName%%IDEVer% + +%IdeDir%\Bin\bpr2mak.exe" -t..\..\..\Source\dac.bmk CRControls%PkgVer%.bpk +@if errorlevel 1 goto Err +%IdeDir%\Bin\make.exe" -f CRControls%PkgVer%.mak +@if errorlevel 1 goto Err +cd ..\..\..\Source\%IDEName%%IDEVer% + +rem Compile SDAC packages =========================================== +%IdeDir%\Bin\bpr2mak.exe" -t..\dac.bmk %PrjNameL%%PkgVer%.bpk +@if errorlevel 1 goto Err +%IdeDir%\Bin\make.exe" -f %PrjNameL%%PkgVer%.mak +@if errorlevel 1 goto Err + +if %IDEVer%A==4A goto SkipCB__Vcl +if %IDEVer%A==5A goto SkipCB__Vcl + +%IdeDir%\Bin\bpr2mak.exe" -t..\dac.bmk %PrjNameL%vcl%PkgVer%.bpk +@if errorlevel 1 goto Err +%IdeDir%\Bin\make.exe" -f %PrjNameL%vcl%PkgVer%.mak +@if errorlevel 1 goto Err + +:SkipCB__Vcl + +%IdeDir%\Bin\bpr2mak.exe" -t..\dac.bmk dcl%PrjNameL%%PkgVer%.bpk +@if errorlevel 1 goto Err +%IdeDir%\Bin\make.exe" -f dcl%PrjNameL%%PkgVer%.mak +@if errorlevel 1 goto Err + +rem Copy files =========================================================== +rem ====================================================================== + +copy ..\..\CRGrid\Source\%IDEName%%IDEVer%\CRControls%PkgVer%.bpl %PrjName% + +copy ..\..\CRGrid\Source\%IDEName%%IDEVer%\CRControls%PkgVer%.bpi %PrjName%\CRGrid +copy ..\..\CRGrid\Source\%IDEName%%IDEVer%\CRControls%PkgVer%.lib %PrjName%\CRGrid + +copy ..\..\CRGrid\Source\%IDEName%%IDEVer%\CRGrid.obj %PrjName%\CRGrid +copy ..\..\CRGrid\Source\%IDEName%%IDEVer%\CRGrid.dcu %PrjName%\CRGrid +copy ..\..\CRGrid\Source\CRGrid.hpp %PrjName%\CRGrid +copy ..\..\CRGrid\Source\CRGrid.res %PrjName%\CRGrid + +copy *.bpl %PrjName% + +copy *.dcu %PrjName%\Dcu +copy ..\*.hpp %PrjName%\Include +copy *.bpi %PrjName%\Lib +copy *.lib %PrjName%\Lib +copy *.obj %PrjName%\Lib +copy ..\*.res %PrjName%\Lib + +goto end +:Err +pause + +:end +popd diff --git a/internal/4.10.0.10/1/Source/MemDS.pas b/internal/4.10.0.10/1/Source/MemDS.pas new file mode 100644 index 0000000..cff1d5d --- /dev/null +++ b/internal/4.10.0.10/1/Source/MemDS.pas @@ -0,0 +1,3921 @@ + +////////////////////////////////////////////////// +// DB Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +// Memory Data Set +// Created: 01.02.98 +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I Dac.inc} + +unit MemDS; +{$ENDIF} +interface +uses +{$IFDEF CLR} + DB, SysUtils, Classes, MemData, MemUtils{$IFDEF BDE_SHARED}, DBTables{$ENDIF}, Variants, + System.Runtime.InteropServices, System.Text, System.IO, System.XML; +{$ELSE} + DB, SysUtils, Classes, MemData, MemUtils{$IFDEF BDE_SHARED}, DBTables{$ENDIF} + {$IFDEF VER6P}, Variants{$ENDIF}, CRXml, CLRClasses; +{$ENDIF} + +const + uaDefault = 10; // TUpdateAction + +type + +{ TMemDataSet } + +{$IFDEF VER4} + +{$IFNDEF BDE_SHARED} + TUpdateAction = (uaFail, uaAbort, uaSkip, uaRetry, uaApplied); // uaDefault +{$ENDIF} + +{$ENDIF} + + TUpdateRecordTypes = set of (rtModified, rtInserted, rtDeleted, rtUnmodified); + TUpdateErrorEvent = procedure(DataSet: TDataSet; E: EDatabaseError; + UpdateKind: TUpdateKind; var UpdateAction: TUpdateAction) of object; + TUpdateRecordEvent = procedure(DataSet: TDataSet; UpdateKind: TUpdateKind; + var UpdateAction: TUpdateAction) of object; + +{$IFDEF CLR} + PRecInfo = packed record + private + Ptr: IntPtr; + + function GetRecordNumber: longint; + procedure SetRecordNumber(const Value: longint); + function GetUpdateStatus: TUpdateStatus; + procedure SetUpdateStatus(const Value: TUpdateStatus); + function GetBookmarkFlag: TBookmarkFlag; + procedure SetBookmarkFlag(const Value: TBookmarkFlag); + function GetRefComplexFields: boolean; + procedure SetRefComplexFields(const Value: boolean); + + public + property RecordNumber: longint read GetRecordNumber write SetRecordNumber; + property UpdateStatus: TUpdateStatus read GetUpdateStatus write SetUpdateStatus; + property BookmarkFlag: TBookmarkFlag read GetBookmarkFlag write SetBookmarkFlag; + property RefComplexFields: boolean read GetRefComplexFields write SetRefComplexFields; + + class operator Implicit(AValue: IntPtr): PRecInfo; + class operator Implicit(AValue: integer): PRecInfo; + end; +{$ELSE} + TRecordBuffer = PChar; + TValueBuffer = pointer; + PRecInfo = ^TRecInfo; +{$ENDIF} + TRecInfo = packed record + RecordNumber: longint; + UpdateStatus: TUpdateStatus; + BookmarkFlag: TBookmarkFlag; + RefComplexFields: boolean; + end; + +// TBlobData = string; + + TCalcFieldDescMapping = record + FieldDesc: TFieldDesc; + Field: TField; + end; + + TMemDataSet = class(TDataSet) + private + FOldRecBuf: TRecordBuffer; + FFilterBuffer: TRecordBuffer; + FCachedUpdates: boolean; + FLocalUpdate: boolean; + //FInDeferredPost: boolean; to protected + FInInserting: boolean; + FInEditing: boolean; + FIndexFieldNames: string; + FCalcFieldsMapping: array of TCalcFieldDescMapping; + + FOnUpdateError: TUpdateErrorEvent; + FOnUpdateRecord: TUpdateRecordEvent; + + //Renamed LocateRecord (CBuilder5 bug - overloaded methods in different sections): + function InternalLocateRecord(KeyFields: TDAList; const KeyValues: variant; + Options: TLocateExOptions; SavePos: boolean): boolean; overload; + + {function GetBlobData(Field:TField; Buffer: PChar):TBlobData; + procedure SetBlobData(Field:TField; Buffer: PChar; Value:TBlobData); + procedure ClearBlobCache(Buffer: PChar);} + + procedure SetCachedUpdates(Value: boolean); + function GetUpdatesPending: boolean; + function GetPrepared: boolean; + procedure SetPrepared(Value: boolean); + function GetUpdateRecordSet: TUpdateRecordTypes; + procedure SetUpdateRecordSet(Value: TUpdateRecordTypes); + procedure SetIndexFieldNames(Value: string); + + protected + Data: TData; // FIRecordSet + + FBookmarkOfs: longint; + FRecInfoOfs: longint; +{$IFNDEF CLR} +{$IFNDEF VER10P} + FWideStringOfs: longint; +{$ENDIF} +{$ENDIF} + FRecBufSize: longint; + FInCacheProcessing: boolean; + FInDeferredPost: boolean; // private + NewCacheRecBuf: TRecordBuffer; + OldCacheRecBuf: TRecordBuffer; + OldDeferredPostBuf: TRecordBuffer; + FParentDataSet: TMemDataSet; + FLastParentPos: integer; + FLocalConstraints: boolean; + FNumberRange: boolean; + FNeedAddRef: boolean; + FCacheCalcFields: boolean; + FCreateCalcFieldDescs: boolean; + + procedure CreateIRecordSet; virtual; + procedure FreeIRecordSet; + procedure SetIRecordSet(Value: TData{TRecordSet}); virtual; + + { Open/Close DataSet } + procedure OpenCursor(InfoQuery: boolean); override; + procedure CloseCursor; override; + + procedure InternalOpen; override; + procedure InternalClose; override; + function IsCursorOpen: boolean; override; + procedure DataReopen; virtual; + procedure InternalRefresh; override; + procedure CheckFieldCompatibility(Field: TField; FieldDef: TFieldDef); override; + procedure DoAfterOpen; override; + + { Field Management } + procedure InternalInitFieldDefs; override; + procedure CreateFieldDefs; virtual; + procedure ClearCalcFields(Buffer: TRecordBuffer); override; + + function GetObjectFieldDefName(Parent: TFieldDef; Index: integer; ObjType: TObjectType):string; virtual; + function GetFielDefSize(FieldType: TFieldType; FieldDesc: TFieldDesc): integer; virtual; + procedure GetObjectTypeNames(Fields: TFields); + function GetFieldType(DataType: word): TFieldType; overload; virtual; + function GetFieldType(FieldDesc: TFieldDesc): TFieldType; overload; virtual; + procedure SetFieldData(Field: TField; Buffer: TValueBuffer); override; + procedure SetFieldData(Field: TField; Buffer: TValueBuffer; NativeFormat: Boolean); override; + procedure DataConvert(Field: TField; Source, Dest: TValueBuffer; ToNative: Boolean); override; //TODO + function GetSparseArrays: boolean; + procedure SetSparseArrays(Value: boolean); + + procedure SetNumberRange(FieldDef: TFieldDef); virtual; + + { Buffer/Record Management } + function AllocRecordBuffer: TRecordBuffer; override; + procedure FreeRecordBuffer(var Buffer: TRecordBuffer); override; + procedure CopyRecordBuffer(SrcBuffer: IntPtr; DstBuffer: IntPtr); + + procedure InitRecord(Buffer: TRecordBuffer); override; + procedure InternalInitRecord(Buffer: TRecordBuffer); override; + + function GetOldRecord: TRecordBuffer; + function GetActiveRecBuf(var RecBuf: TRecordBuffer): boolean; + function GetRecord(Buffer: TRecordBuffer; GetMode: TGetMode; DoCheck: boolean): TGetResult; override; + + procedure BlockReadNext; override; + procedure SetBlockReadSize(Value: integer); override; + procedure FreeRefBuffers; + procedure FreeRefComplexFields(Buffer: TRecordBuffer; WithBlob: boolean = True); + + { Bookmarks } + procedure GetBookmarkData(Buffer: TRecordBuffer; {$IFDEF CLR}var{$ENDIF} Bookmark: TBookmark); override; + procedure SetBookmarkData(Buffer: TRecordBuffer; {$IFDEF CLR}const{$ENDIF} Bookmark: TBookmark); override; + function GetBookmarkFlag(Buffer: TRecordBuffer): TBookmarkFlag; override; + procedure SetBookmarkFlag(Buffer: TRecordBuffer; Value: TBookmarkFlag); override; + //function GetBookmarkStr: TBookmarkStr; override; + + { Navigation } + procedure InternalFirst; override; + procedure InternalLast; override; + procedure InternalGotoBookmark({$IFDEF CLR}const{$ENDIF} Bookmark: TBookmark); override; + procedure InternalSetToRecord(Buffer: TRecordBuffer); override; + + { Editing } + procedure InternalAddRecord(Buffer: IntPtr; Append: boolean); override; + procedure InternalInsert; override; + procedure InternalDelete; override; + procedure InternalEdit; override; + + procedure InternalPost; override; + procedure InternalCancel; override; + + procedure InternalDeferredPost; virtual; + + function PerformAppend: boolean; virtual; + function PerformDelete: boolean; virtual; + function PerformUpdate: boolean; virtual; + + procedure DoPerformAppend; + procedure DoPerformDelete; + procedure DoPerformUpdate; + procedure DoGetCachedFields; + procedure DoGetCachedBuffer(Buffer: IntPtr; Source: IntPtr = nil); + + procedure SetDefaultExpressionValue(Field: TField); virtual; + procedure DoOnNewRecord; override; + + { Filter/Find/Locate } + procedure ActivateFilters; + procedure DeactivateFilters; + function RecordFilter(RecBuf: IntPtr): boolean; + procedure SetFilterData(const Text: string; Options:TFilterOptions); + + procedure SetFiltered(Value: boolean); override; + procedure SetFilterOptions(Value: TFilterOptions); override; + procedure SetFilterText(const Value: string); override; + procedure SetOnFilterRecord(const Value: TFilterRecordEvent); override; + + procedure CopyFieldValue(const Value: variant; out ValuePtr: IntPtr; out ValueType: integer; FieldDesc: TFieldDesc); virtual; + function LocateRecord(const KeyFields: string; const KeyValues: variant; + Options: TLocateExOptions; SavePos: boolean): boolean; overload; + function LocateRecord(const KeyFields: array of TField; const KeyValues: variant; + Options: TLocateExOptions; SavePos: boolean): boolean; overload; + function FindRecord(Restart, GoForward: boolean): boolean; override; + + { CachedUpdates } + function BatchUpdate: boolean; virtual; + function CanFlushBatch: boolean; virtual; + procedure FlushBatch; virtual; + + procedure CheckCachedUpdateMode; + + procedure DoApplyRecord(UpdateKind: TUpdateRecKind; var Action: TUpdateRecAction; LastItem: boolean); + + { Blobs } + //Renamed GetBlob (CBuilder5 bug - overloaded methods in different sections): + function InternalGetBlob(FieldDesc: TFieldDesc): TBlob; + function InternalSetBlob(FieldDesc: TFieldDesc; Blob: TBlob): boolean; + function SetBlob(Field: TField; Blob: TBlob): boolean; + procedure CloseBlob(Field: TField); override; + + { Misc } + function GetRecordCount: integer; override; + function GetRecordSize: word; override; + + function GetRecNo: integer; override; + procedure SetRecNo(Value: integer); override; + + procedure InternalHandleException; override; + + procedure AssignTo(Dest: TPersistent); override; + + {$IFDEF CLR} + procedure DataEvent(Event: TDataEvent; Info: TObject); override; + {$ELSE} + procedure DataEvent(Event: TDataEvent; Info: longint); override; + {$ENDIF} + + function GetStateFieldValue(State: TDataSetState; Field: TField): Variant; override; + + { XML } + procedure WriteFieldXMLDataType(Field: TField; FieldDesc: TFieldDesc; const FieldAlias: string; + XMLWriter: XMLTextWriter); virtual; + procedure WriteFieldXMLAttributeType(Field: TField; FieldDesc: TFieldDesc; const FieldAlias: string; + XMLWriter: XMLTextWriter); virtual; + function GetFieldXMLValue(Field: TField; FieldDesc: TFieldDesc): string; virtual; + + public + constructor Create(aOwner: TComponent); override; + destructor Destroy; override; + + procedure Prepare; virtual; + procedure UnPrepare; virtual; + procedure CheckPrepared; + + { Fields } + function GetFieldDescNo(Field: TField): integer; + function GetFieldDesc(const Field: TField): TFieldDesc; overload; virtual; + function GetFieldData(Field: TField; Buffer: TValueBuffer): boolean; overload; override; + //function Translate(const Src: string; var Dest: string; ToOem: boolean): integer; override; + + function GetFieldData(FieldNo: integer; Buffer: TValueBuffer): boolean; overload; override; + function GetFieldData(Field: TField; Buffer: TValueBuffer; NativeFormat: Boolean): Boolean; override; + + function GetBlob(const FieldName: string): TBlob; overload; + function GetBlob(Field: TField): TBlob; overload; + + { Edit } + procedure Cancel; override; + procedure DeferredPost; + + { Bookmarks } + {$IFDEF CLR} // TDataSet bug + function GetBookmark: TBookmark; override; + procedure FreeBookmark(var Bookmark: TBookmark); override; + {$ENDIF} + function BookmarkValid({$IFDEF CLR}const{$ENDIF} Bookmark: TBookmark): boolean; override; + function CompareBookmarks({$IFDEF CLR}const{$ENDIF} Bookmark1, Bookmark2: TBookmark): integer; override; + + function CreateBlobStream(Field: TField; Mode: TBlobStreamMode): TStream; override; + + function Locate(const KeyFields: string; const KeyValues: variant; + Options: TLocateOptions): boolean; overload; override; + function Locate(const KeyFields: array of TField; const KeyValues: variant; + Options: TLocateOptions): boolean; reintroduce; overload; + function LocateEx(const KeyFields: string; const KeyValues: variant; + Options: TLocateExOptions): boolean; overload; + function LocateEx(const KeyFields: array of TField; const KeyValues: variant; + Options: TLocateExOptions): boolean; overload; + function Lookup(const KeyFields: string; const KeyValues: variant; + const ResultFields: string): variant; override; + + { CachedUpdates } + function UpdateStatus: TUpdateStatus; override; + function UpdateResult: TUpdateAction; + procedure ApplyUpdates; virtual; + procedure CommitUpdates; + procedure CancelUpdates; + procedure RestoreUpdates; + procedure RevertRecord; + + { XML } + procedure SaveToXML(Destination: TStream); overload; + procedure SaveToXML(const FileName: string); overload; + + function IsSequenced: boolean; override; + + property Prepared: boolean read GetPrepared write SetPrepared; + property CachedUpdates: boolean read FCachedUpdates write SetCachedUpdates default False; + property UpdatesPending: boolean read GetUpdatesPending; + property LocalUpdate: boolean read FLocalUpdate write FLocalUpdate default False; + property UpdateRecordTypes: TUpdateRecordTypes read GetUpdateRecordSet write SetUpdateRecordSet; + property SparseArrays: boolean read GetSparseArrays write SetSparseArrays; + + // obsolete + property LocalConstraints: boolean read FLocalConstraints write FLocalConstraints default True; + + property OnUpdateError: TUpdateErrorEvent read FOnUpdateError write FOnUpdateError; + property OnUpdateRecord: TUpdateRecordEvent read FOnUpdateRecord write FOnUpdateRecord; + property IndexFieldNames: string read FIndexFieldNames write SetIndexFieldNames; + end; + +{ TBlobStream } + + TBlobStream = class(TStream) + protected + FField: TBlobField; + FDataSet: TMemDataSet; + FBuffer: TRecordBuffer; + FMode: TBlobStreamMode; + FFieldNo: integer; + FOpened: boolean; + FModified: boolean; + FPosition: longint; + function GetBlobSize: Longint; + + protected + {$IFDEF CLR} + procedure SetSize(NewSize: Int64); override; + {$ELSE} + procedure SetSize(NewSize: Longint); override; + {$ENDIF} + public + constructor Create(Field: TBlobField; Mode: TBlobStreamMode); + destructor Destroy; override; + {$IFDEF CLR} + function Read(var Buffer: TBytes; Offset, Count: Longint): Longint; override; + function Write(const Buffer: TBytes; Offset, Count: Longint): Longint; override; + function Seek(const Offset: Int64; Origin: TSeekOrigin): Int64; override; + {$ELSE} + function Read(var Buffer; Count: longint): longint; override; + function Write(const Buffer; Count: Longint): Longint; override; + function Seek(Offset: Longint; Origin: Word): Longint; override; + {$ENDIF} + procedure Truncate; + end; + + TMemDSUtils = class + public + class function SetBlob(Obj: TMemDataSet; Field: TField; Blob: TBlob): boolean; + class function GetBlob(Obj: TMemDataSet; FieldDesc: TFieldDesc): TBlob; + end; + + function GetFieldType(DataType: word): TFieldType; + function GetDataType(FieldType: TFieldType): word; + + function ChangeDecimalSeparator(const Value: string; OldSeparator, NewSeparator: string): string; + + function XMLEncode(const AStr: String): String; + +implementation + +uses +{$IFDEF VER6P} + DateUtils,FmtBcd, +{$ENDIF} + DBConsts, DAConsts, Math{$IFDEF MSWINDOWS}, Windows{$ENDIF}; + +const +{$IFDEF VER4} + DataTypeMap: array [TFieldType] of word = ( + // ftUnknown, ftString, ftSmallint, ftInteger, ftWord + dtUnknown, dtString, dtInt16, dtInteger, dtUInt16, + // ftBoolean, ftFloat, ftCurrency, ftBCD, ftDate, ftTime, ftDateTime, + dtBoolean, dtFloat, dtCurrency, dtBCD, dtDate, dtTime, dtDateTime, + // ftBytes, ftVarBytes, ftAutoInc, ftBlob, ftMemo, ftGraphic, ftFmtMemo, + dtBytes, dtVarBytes, dtInteger, dtBlob, dtMemo, 0, 0, + // ftParadoxOle, ftDBaseOle, ftTypedBinary, ftCursor, ftFixedChar, ftWideString, + 0, 0, 0, 0, dtString, dtWideString, + // ftLargeint, ftADT, ftArray, ftReference, ftDataSet + dtInt64, dtObject, dtArray, dtReference, dtTable); +{$ENDIF} +{$IFDEF VER5} + DataTypeMap: array [TFieldType] of word = ( + // ftUnknown, ftString, ftSmallint, ftInteger, ftWord + dtUnknown, dtString, dtInt16, dtInteger, dtUInt16, + // ftBoolean, ftFloat, ftCurrency, ftBCD, ftDate, ftTime, ftDateTime, + dtBoolean, dtFloat, dtCurrency, dtBCD, dtDate, dtTime, dtDateTime, + // ftBytes, ftVarBytes, ftAutoInc, ftBlob, ftMemo, ftGraphic, ftFmtMemo, + dtBytes, dtVarBytes, dtInteger, dtBlob, dtMemo, 0, 0, + // ftParadoxOle, ftDBaseOle, ftTypedBinary, ftCursor, ftFixedChar, ftWideString, + 0, 0, 0, 0, dtString, dtWideString, + // ftLargeint, ftADT, ftArray, ftReference, ftDataSet, ftOraBlob, ftOraClob, + dtInt64, dtObject, dtArray, dtReference, dtTable, 0, 0, + // ftVariant, ftInterface, ftIDispatch, ftGuid + dtVariant, 0, 0, dtGuid); +{$ENDIF} +{$IFDEF VER6P} +{$IFNDEF VER10P} + DataTypeMap: array [TFieldType] of word = ( + // ftUnknown, ftString, ftSmallint, ftInteger, ftWord + dtUnknown, dtString, dtInt16, dtInteger, dtUInt16, + // ftBoolean, ftFloat, ftCurrency, ftBCD, ftDate, ftTime, ftDateTime, + dtBoolean, dtFloat, dtCurrency, dtBCD, dtDate, dtTime, dtDateTime, + // ftBytes, ftVarBytes, ftAutoInc, ftBlob, ftMemo, ftGraphic, ftFmtMemo, + dtBytes, dtVarBytes, dtInteger, dtBlob, dtMemo, 0, 0, + // ftParadoxOle, ftDBaseOle, ftTypedBinary, ftCursor, ftFixedChar, ftWideString, + 0, 0, 0, 0, dtString, dtWideString, + // ftLargeint, ftADT, ftArray, ftReference, ftDataSet, ftOraBlob, ftOraClob, + dtInt64, dtObject, dtArray, dtReference, dtTable, 0, 0, + // ftVariant, ftInterface, ftIDispatch, ftGuid, ftTimeStamp, ftFMTBcd + dtVariant, 0, 0, dtGuid, 0, dtFmtBCD); +{$ENDIF} +{$ENDIF} + +{$IFDEF VER10P} + DataTypeMap: array [TFieldType] of word = ( + // ftUnknown, ftString, ftSmallint, ftInteger, ftWord + dtUnknown, dtString, dtInt16, dtInteger, dtUInt16, + // ftBoolean, ftFloat, ftCurrency, ftBCD, ftDate, ftTime, ftDateTime, + dtBoolean, dtFloat, dtCurrency, dtBCD, dtDate, dtTime, dtDateTime, + // ftBytes, ftVarBytes, ftAutoInc, ftBlob, ftMemo, ftGraphic, ftFmtMemo, + dtBytes, dtVarBytes, dtInteger, dtBlob, dtMemo, 0, 0, + // ftParadoxOle, ftDBaseOle, ftTypedBinary, ftCursor, ftFixedChar, ftWideString, + 0, 0, 0, 0, dtString, dtWideString, + // ftLargeint, ftADT, ftArray, ftReference, ftDataSet, ftOraBlob, ftOraClob, + dtInt64, dtObject, dtArray, dtReference, dtTable, 0, 0, + // ftVariant, ftInterface, ftIDispatch, ftGuid, ftTimeStamp, ftFMTBcd, ftFixedWideChar + dtVariant, 0, 0, dtGuid, 0, dtFmtBCD, dtWideString, + // ftWideMemo, ftOraTimeStamp, ftOraInterval + dtWideMemo, 0, 0); +{$ENDIF} + +function GetFieldType(DataType: word): TFieldType; +begin + case DataType of + dtUnknown: + Result := ftUnknown; + dtString: + Result := ftString; + dtWideString: + Result := ftWideString; + dtInt8: + Result := ftSmallint; + dtInt16: + Result := ftSmallint; + dtWord: + Result := ftWord; + dtInteger: + Result := ftInteger; + dtUInt32: + Result := ftLargeInt; + dtLargeint: + Result := ftLargeInt; + dtFloat: + Result := ftFloat; + dtDate: + Result := ftDate; + dtTime: + Result := ftTime; + dtDateTime: + Result := ftDateTime; + dtMemo: + Result := ftMemo; + dtWideMemo: + Result := {$IFDEF VER10P}ftWideMemo;{$ELSE}ftMemo;{$ENDIF} + dtBlob: + Result := ftBlob; + dtObject: + Result := ftADT; + dtReference: + Result := ftReference; + dtArray: + Result := ftArray; + dtTable: + Result := ftDataSet; + dtBoolean: + Result := ftBoolean; + {$IFDEF VER5P} + dtVariant: + Result := ftVariant; + {$ENDIF} + dtExtString: + Result := ftString; + dtExtWideString: + Result := ftWideString; + dtBytes: + Result := ftBytes; + dtVarBytes: + Result := ftVarBytes; + dtExtVarBytes: + Result := ftVarBytes; + dtBCD: + Result := ftBCD; + {$IFDEF VER6P} + dtFmtBCD: + Result := ftFMTBcd; + {$ENDIF} + dtGuid: + Result := ftGuid; + dtCurrency: + Result := ftCurrency; + else + Assert(False, SUnknownDataType); + Result := ftUnknown; + end; +end; + +function GetDataType(FieldType: TFieldType): word; +begin + Result := DataTypeMap[FieldType]; +end; + +{$IFDEF CLR} +{ PRecInfo } + +function PRecInfo.GetRecordNumber: longint; +begin + Result := Marshal.ReadInt32(Ptr); +end; + +procedure PRecInfo.SetRecordNumber(const Value: longint); +begin + Marshal.WriteInt32(Ptr, Value); +end; + +function PRecInfo.GetUpdateStatus: TUpdateStatus; +begin + Result := TUpdateStatus(Marshal.ReadByte(Ptr, sizeof(longint))); +end; + +procedure PRecInfo.SetUpdateStatus(const Value: TUpdateStatus); +begin + Marshal.WriteByte(Ptr, sizeof(longint), byte(Value)); +end; + +function PRecInfo.GetBookmarkFlag: TBookmarkFlag; +begin + Result := TBookmarkFlag(Marshal.ReadByte(Ptr, sizeof(integer) + sizeof(TUpdateStatus))); +end; + +procedure PRecInfo.SetBookmarkFlag(const Value: TBookmarkFlag); +begin + Marshal.WriteByte(Ptr, sizeof(integer) + sizeof(TUpdateStatus), byte(Value)); +end; + +function PRecInfo.GetRefComplexFields: boolean; +begin + Result := boolean(Marshal.ReadByte(Ptr, sizeof(integer) + sizeof(TUpdateStatus) + + sizeof(TBookmarkFlag))); +end; + +procedure PRecInfo.SetRefComplexFields(const Value: boolean); +begin + Marshal.WriteByte(Ptr, sizeof(integer) + sizeof(TUpdateStatus) + + sizeof(TBookmarkFlag), byte(Value)); +end; + +class operator PRecInfo.Implicit(AValue: IntPtr): PRecInfo; +begin + Result.Ptr := AValue; +end; + +class operator PRecInfo.Implicit(AValue: integer): PRecInfo; +begin + Result.Ptr := IntPtr(AValue); +end; +{$ENDIF} + +{ TMemDataSet } + +constructor TMemDataSet.Create(aOwner:TComponent); +begin + inherited Create(aOwner); + + FLocalConstraints := True; + FCreateCalcFieldDescs := True; + + CreateIRecordSet; +end; + +destructor TMemDataSet.Destroy; +begin + inherited; + + UnPrepare; + + FreeIRecordSet; +end; + +procedure TMemDataSet.CreateIRecordSet; +begin + SetIRecordSet(TMemData.Create); +end; + +procedure TMemDataSet.FreeIRecordSet; +begin + Data.Free; +end; + +procedure TMemDataSet.SetIRecordSet(Value: TData); +begin + Data := Value; + + if Data <> nil then begin + Data.CachedUpdates := FCachedUpdates; + Data.OnAppend := DoPerformAppend; + Data.OnDelete := DoPerformDelete; + Data.OnUpdate := DoPerformUpdate; + Data.OnApplyRecord := DoApplyRecord; + if FCreateCalcFieldDescs then begin + TMemData(Data).OnGetCachedFields := DoGetCachedFields; + TMemData(Data).OnGetCachedBuffer := DoGetCachedBuffer; + end; + end; +end; + +{ Open/Close DataSet } + +procedure TMemDataSet.Prepare; +begin + if not Prepared then begin + Data.Prepare; + CreateFieldDefs; + end; +end; + +procedure TMemDataSet.UnPrepare; +begin + if Active then + Close; + + Data.UnPrepare; + + if not (csDestroying in ComponentState) then // This line may be called after destroing FieldDefs. For details see TMemDataSet.Destroy + FieldDefs.Updated := False; +end; + +procedure TMemDataSet.CheckPrepared; +begin + if not Prepared then + DatabaseError(SDataSetIsNotPrepared); +end; + +procedure TMemDataSet.InternalOpen; +var + Field: TField; + i: integer; +begin + Data.Open; + + CreateFieldDefs; + + // Update FieldDefs once to avoid multiple Update calls when working with FieldDefsList + // (Perfomance optimization) +// FieldDefs.Updated := False; +// FieldDefs.Update; + + if DefaultFields then + CreateFields + else // Setting actual size + for i := 0 to FieldDefs.Count - 1 do + if FieldDefs[i].DataType = ftString then begin + Field := FindField(FieldDefs[i].Name); + if (Field <> nil) and (Field.FieldKind = fkData) then begin + CheckFieldCompatibility(Field, FieldDefs[i]); + Field.Size := FieldDefs[i].Size; + end; + end; + + // Set number specific + if FNumberRange then + for i := 0 to FieldDefs.Count - 1 do + SetNumberRange(FieldDefs[i]); + + BindFields(True); + + if (Data.Fields.Count > 0) and (Data.Fields[Data.Fields.Count - 1].FieldDescKind = fdkCached) then + TMemData(Data).UpdateCachedBuffer(nil, nil); + + if ObjectView then + GetObjectTypeNames(Fields); + + if (Data is TMemData) and (TMemData(Data).IndexFields.Count > 0) then + TMemData(Data).SortItems; + + BookmarkSize := SizeOf(TRecBookmark); + + //FBlobCacheOfs := Data.RecordSize + CalcFieldsSize; + if not FCreateCalcFieldDescs then + FRecInfoOfs := Data.RecordSize + CalcFieldsSize + else + if FCacheCalcFields then + FRecInfoOfs := Data.RecordSize + else + FRecInfoOfs := Data.RecordSize + Data.CalcRecordSize; //FBlobCacheOfs + BlobFieldCount * SizeOf(Pointer); + + FBookmarkOfs := FRecInfoOfs + SizeOf(TRecInfo); + FRecBufSize := FBookmarkOfs + BookmarkSize; + +{$IFNDEF CLR} +{$IFNDEF VER10P} + if not FCreateCalcFieldDescs then begin + FWideStringOfs := FRecBufSize; + + if CalcFieldsSize > 0 then + for i := 0 to Fields.Count - 1 do + if (Fields[i].DataType = ftWideString) and (Fields[i].FieldKind in [fkCalculated, fkLookUp]) then + FRecBufSize := FRecBufSize + (Fields[i].Size + 1) * sizeof(WideChar); + end; +{$ENDIF} +{$ENDIF} + + FInCacheProcessing := False; + + if Filtered then begin + ActivateFilters; + Data.FilterUpdated; + end; +end; + +function TMemDataSet.IsCursorOpen: boolean; +begin + Result := Data.Active; +end; + +procedure TMemDataSet.InternalClose; +begin + BindFields(False); + if DefaultFields then + DestroyFields; + + Data.Close; +end; + +procedure TMemDataSet.OpenCursor(InfoQuery: boolean); +begin + inherited; + + if not InfoQuery then begin + if FOldRecBuf <> nil then begin + FreeRecordBuffer(FOldRecBuf); + FOldRecBuf := nil; + end; + + FOldRecBuf := AllocRecordBuffer; + end; + //DataEvent(deDataSetChange, 0); // Notify nested datasets // DEBUG +end; + +procedure TMemDataSet.CloseCursor; +var + Buffer: IntPtr; + RecInfo: PRecInfo; +begin +// free complex fields if call Close in dsInsert or dsEdit mode +// TDataSet.Close doesn't call Cancel + if Data.HasComplexFields then begin + if FInInserting then begin + Buffer := ActiveBuffer; + RecInfo := PRecInfo(integer(Buffer) + FRecInfoOfs); + if RecInfo.RefComplexFields then begin + Data.FreeComplexFields(Buffer, True); + RecInfo.RefComplexFields := False; + end; + end; + if FInEditing then begin + Buffer := ActiveBuffer; + RecInfo := PRecInfo(integer(Buffer) + FRecInfoOfs); + if RecInfo.RefComplexFields then begin + Data.FreeComplexFields(Buffer, False); // Blobs isn't created + RecInfo.RefComplexFields := False; + end; + end; + + if FInInserting then + Data.FreeComplexFields(ActiveBuffer, True); + if FInEditing then + Data.FreeComplexFields(ActiveBuffer, False); // Blobs isn't created + + FInInserting := False; + FInEditing := False; + end; + + if FOldRecBuf <> nil then begin + FreeRecordBuffer(FOldRecBuf); + FOldRecBuf := nil; + end; + + try + inherited; + finally + FParentDataSet := nil; + end; +end; + +procedure TMemDataSet.DataReopen; +begin + Data.Reopen; +end; + +procedure TMemDataSet.InternalRefresh; +begin + FreeRefBuffers; + //ClearBuffers; /// CR11512 + DataReopen; + if (Data is TMemData) and (TMemData(Data).IndexFields.Count > 0) then + TMemData(Data).SortItems; +end; + +procedure TMemDataSet.CheckFieldCompatibility(Field: TField; FieldDef: TFieldDef); +begin + with Field do + begin + {$IFDEF VER6P} + if (DataType <= ftFMTBcd) and (FieldDef.DataType <= ftFMTBcd) then + {$ELSE} + if (DataType <= ftGuid) and (FieldDef.DataType <= ftGuid) then + {$ENDIF} + inherited CheckFieldCompatibility(Field, FieldDef) + else + if DataType <> FieldDef.DataType then + DatabaseErrorFmt(SFieldTypeMismatch, [DisplayName, + FieldTypeNames[DataType], FieldTypeNames[FieldDef.DataType]], Self); + end; +end; + +procedure TMemDataSet.DoAfterOpen; +var + i: integer; +begin + inherited; + + for i := 0 to NestedDataSets.Count - 1 do + with TDataSet(NestedDataSets[i]) do + if Active then + DataEvent(deParentScroll, {$IFDEF CLR}nil{$ELSE}0{$ENDIF}); +end; + +procedure TMemDataSet.FreeRefBuffers; +var + i: integer; +begin + if FNeedAddRef then + for i := 0 to BufferCount do + FreeRefComplexFields(Buffers[i]); + FreeRefComplexFields(TempBuffer); +end; + +procedure TMemDataSet.FreeRefComplexFields(Buffer: TRecordBuffer; WithBlob: boolean); +var + RecInfo: PRecInfo; +begin + RecInfo := PRecInfo(integer(Buffer) + FRecInfoOfs); + if RecInfo.RefComplexFields then begin + Data.FreeComplexFields(Buffer, WithBlob); + RecInfo.RefComplexFields := False; + end; +end; + +{ Field Management } + +procedure TMemDataSet.InternalInitFieldDefs; +var + CheckDefs: boolean; + i: integer; + OldFieldNames: array of string; + OldFieldCount: integer; + +begin + // can't CreateFieldDefs if FieldDefs.Update(InitFieldDefs) + if not Data.Active then begin + OldFieldCount := Data.Fields.Count; + CheckDefs := (FieldDefs <> nil) and not FieldDefs.Updated; + if CheckDefs then begin + SetLength(OldFieldNames, OldFieldCount); + for i := 0 to OldFieldCount - 1 do + OldFieldNames[i] := Data.Fields[i].Name; + end; + + Data.InitFields; + + if OldFieldCount <> Data.Fields.Count then + FieldDefs.Updated := False + else + if CheckDefs then + for i := 0 to OldFieldCount - 1 do + if OldFieldNames[i] <> Data.Fields[i].Name then begin + FieldDefs.Updated := False; + Break; + end; + + CreateFieldDefs; + end; +end; + +function TMemDataSet.GetFieldType(DataType: word): TFieldType; +begin + Result := {$IFDEF CLR}CoreLab.Dac.{$ENDIF}MemDS.GetFieldType(DataType); +end; + +function TMemDataSet.GetFieldType(FieldDesc: TFieldDesc): TFieldType; +begin + Result := GetFieldType(FieldDesc.DataType); +end; + +function TMemDataSet.GetObjectFieldDefName(Parent: TFieldDef; Index: integer; ObjType: TObjectType):string; +begin + Result := IntToStr(Index); +end; + +function TMemDataSet.GetFielDefSize(FieldType: TFieldType; FieldDesc: TFieldDesc): integer; +begin + Result := 0; + case FieldType of + ftString, ftWideString{$IFDEF VER5P},ftGuid{$ENDIF}: begin + Result := FieldDesc.Length; + if Result = 0 then + Result := 1; // For SELECT NULL FROM ... + end; + ftBytes, ftVarBytes: + Result := FieldDesc.Length; + end; +end; + +procedure TMemDataSet.CreateFieldDefs; + + function GetFieldName(ParentFieldName, FieldName: string; Index: integer): string; + var + NewFieldName: string; + begin + if Index = 0 then + NewFieldName := FieldName + else + NewFieldName := FieldName + '_' + IntToStr(Index); + + if (FieldDefs.IndexOf(ParentFieldName + '.' + NewFieldName) <> -1) then + Result := GetFieldName(ParentFieldName, FieldName, Index + 1) + else + Result := NewFieldName; + end; + + procedure CreateObjectFields(ObjType: TObjectType; Parent: TFieldDef); + var + i: integer; + FieldDef: TFieldDef; + FieldType: TFieldType; + aSize: word; + Item,CountItem: integer; + FieldName: string; + begin + if (ObjType.DataType = dtObject) or SparseArrays then + CountItem := 1 + else begin + CountItem := ObjType.Size; + if CountItem > MaxArrayItem then // Restriction of array length + CountItem := MaxArrayItem; + end; + + for i := 0 to ObjType.AttributeCount - 1 do begin + for Item := 0 to CountItem - 1 do begin + with ObjType.Attributes[i] do begin + FieldType := GetFieldType(DataType); + + aSize := 0; + case FieldType of + ftString: + aSize := Length; + end; + + FieldDef := TFieldDef.Create(Parent.ChildDefs); + if ObjType.DataType = dtObject then + FieldName := Name + else + FieldName := GetObjectFieldDefName(Parent, Item, ObjType); + FieldDef.Name := GetFieldName(Parent.Name, FieldName, 0); + + FieldDef.DataType := FieldType; + FieldDef.Size := aSize; + FieldDef.Required := False; + if DB.faReadonly in Parent.Attributes then + FieldDef.Attributes := FieldDef.Attributes + [DB.faReadonly]; + + if FieldType in [ftADT,ftArray] then + CreateObjectFields(ObjectType, FieldDef); + end; + end; + end; + end; + +var + FieldType: TFieldType; + aSize: word; + i: integer; + FieldDef: TFieldDef; +begin + if FieldDefs.Updated then Exit; + FieldDefs.BeginUpdate; + try + FieldDefs.Clear; + for i := 0 to Data.FieldCount - 1 do + with Data.Fields[i] do + if not HiddenObject and (FieldDescKind = fdkData) and (not HasParent or ParentField.HiddenObject) then begin + // FieldNo 1.. + FieldType := GetFieldType(Data.Fields[i]); + aSize := GetFielDefSize(FieldType, Data.Fields[i]); + if FieldType <> ftUnknown then begin + FieldDef := TFieldDef.Create(FieldDefs, Name, FieldType, aSize, + Required and FLocalConstraints, i + 1); + + if ReadOnly then + FieldDef.Attributes := FieldDef.Attributes + [DB.faReadonly]; + + if FieldType in [ftFloat, ftInteger] then + FieldDef.Precision := Length + else + if FieldType in [ftBCD{$IFDEF VER6P}, ftFMTBCD{$ENDIF}] then begin + FieldDef.Precision := Length; + FieldDef.Size := Scale; + end + else + if FieldType in [ftADT, ftArray] then + CreateObjectFields(ObjectType, FieldDef); + + if Hidden then + FieldDef.Attributes := FieldDef.Attributes + [DB.faHiddenCol]; + {$IFDEF VER5P} + if Fixed then + FieldDef.Attributes := FieldDef.Attributes + [DB.faFixed]; + {$ENDIF} + end; + end; + finally + FieldDefs.EndUpdate; + end; + FieldDefList.Update; + FieldDefs.Updated := True; +end; + +procedure TMemDataSet.GetObjectTypeNames(Fields: TFields); +var + i: integer; + ObjectField: TObjectField; +begin + for i := 0 to Fields.Count - 1 do + if Fields[i] is TObjectField then begin + ObjectField := TObjectField(Fields[i]); + + ObjectField.ObjectType := Data.Fields[Fields[i].FieldNo - 1].ObjectType.Name; + + with ObjectField do + if DataType in [ftADT, ftArray] then begin + if (DataType = ftArray) and SparseArrays and + (Fields[0].DataType = ftADT) + then + GetObjectTypeNames(TObjectField(Fields[0]).Fields) + else + GetObjectTypeNames(Fields); + end; + end +end; + +function TMemDataSet.GetFieldDescNo(Field: TField): integer; +var + FieldDesc: TFieldDesc; +begin + FieldDesc := GetFieldDesc(Field); + if FieldDesc <> nil then + Result := FieldDesc.FieldNo + else + raise Exception.Create(Format(SFieldNotFound, [Field.FieldName])); +end; + +function TMemDataSet.GetFieldDesc(const Field: TField): TFieldDesc; +var + FieldDesc: TFieldDesc; + i: integer; + Found: boolean; +begin + Assert(Data <> nil, 'FIRecordSet must be setted to this time'); + Assert(Field <> nil, 'Field cannot be nil'); + Assert((Field.DataSet = Self) or (Field.DataSet = nil {CR 22356}), 'Wrong DataSet'); + {if Field.DataSet <> Self then + for i := 0 to Data.FieldCount - 1 do + if AnsiLowerCase(Field.FieldName) = AnsiLowerCase(Data.Fields[i].Name) then begin /// Field.FieldName must be equal with FieldDesc.Name + Result := Data.Fields[i]; + Exit; + end;} + + Result := nil; + if Field.FieldNo > 0 then + Result := TFieldDesc(Data.Fields[Field.FieldNo - 1]) + else + begin + if DefaultFields and (Fields.Count = Data.Fields.Count {just in case; should be moved to Assert}) then begin + i := Fields.IndexOf(Field); + Result := Data.Fields[i]; + end + else + for i := 0 to Data.FieldCount - 1 do begin + FieldDesc := Data.Fields[i]; + Found := AnsiLowerCase(Field.FieldName) = AnsiLowerCase(FieldDesc.Name); /// Field.FieldName must be equal with FieldDesc.Name + if (Field.FieldKind <> fkData) then begin + if FieldDesc.FieldDescKind = fdkData then + Found := False + else + if not Found then + Found := AnsiLowerCase(Field.FieldName) = AnsiLowerCase(FieldDesc.ActualName); + end; + if Found then begin + Result := FieldDesc; + Break; + end; + end; + end; + // Assert(AnsiLowerCase(Field.FieldName) = AnsiLowerCase(Result.Name), Format('Field.FieldName <> FieldDesc.Name' + LineSeparator + '"%s" <> "%s"' + LineSeparator, [Field.FieldName, Result.Name])); +end; + +function TMemDataSet.GetFieldData(Field: TField; Buffer: TValueBuffer): boolean; +var + IsBlank: boolean; + RecBuf: TRecordBuffer; + FieldBuf: IntPtr; +{$IFNDEF CLR} +{$IFNDEF VER10P} + DataOffset: LongInt; +{$ENDIF} +{$ENDIF} + i: integer; + FieldDesc: TFieldDesc; +begin + Result := False; + if not GetActiveRecBuf(RecBuf) then + Exit; + + with Field do + if FieldNo > 0 then begin + Data.GetField(FieldNo, RecBuf, Buffer, IsBlank); + Result := not IsBlank; + end + else + if State in [dsBrowse, dsEdit, dsInsert, dsCalcFields, dsFilter, dsBlockRead] then + if FCreateCalcFieldDescs then begin + FieldDesc := nil; + for i := 0 to Length(FCalcFieldsMapping) - 1 do + if FCalcFieldsMapping[i].Field = Field then begin + FieldDesc := FCalcFieldsMapping[i].FieldDesc; + break; + end; + if FieldDesc <> nil then + Data.GetField(FieldDesc.FieldNo, RecBuf, Buffer, IsBlank) + else + Data.GetField(GetFieldDescNo(Field), RecBuf, Buffer, IsBlank); + Result := not IsBlank; + end + else begin + FieldBuf := IntPtr(integer(RecBuf) + RecordSize + Offset); + Result := Boolean(Marshal.ReadByte(FieldBuf)); + if Result and (Buffer <> nil) then + {$IFNDEF CLR} + {$IFNDEF VER10P} + if Field.DataType = ftWideString then begin + DataOffset := Integer(IntPtr(Integer(FieldBuf) + 1)^); + CopyBuffer(IntPtr(Integer(RecBuf) + FWideStringOfs + DataOffset), Buffer, (Size + 1) * SizeOf(WideChar)); + end + else + {$ENDIF} + {$ENDIF} + CopyBuffer(IntPtr(integer(FieldBuf) + 1), Buffer, DataSize); + end; +end; + +function TMemDataSet.GetFieldData(FieldNo: integer; Buffer: TValueBuffer): boolean; +var + IsBlank: boolean; + RecBuf: TRecordBuffer; +begin +//if BlockReadSize > 0 then + + Result := GetActiveRecBuf(RecBuf); + if Result then begin + Data.GetField(FieldNo, RecBuf, Buffer, IsBlank); + Result := not IsBlank; + end +end; + +procedure TMemDataSet.SetFieldData(Field: TField; Buffer: TValueBuffer); +var + RecBuf: TRecordBuffer; + FieldBuf: IntPtr; +{$IFNDEF CLR} +{$IFNDEF VER10P} + DataOffset, WideStringSize: integer; +{$ENDIF} +{$ENDIF} + FieldDesc: TFieldDesc; + i: integer; +begin + with Field do begin + if not (State in dsWriteModes) then + DatabaseError(SNotEditing); + GetActiveRecBuf(RecBuf); + if FieldNo > 0 then begin + if State = dsCalcFields then + DatabaseError(SNotEditing); + if ReadOnly and not (State in [dsSetKey, dsFilter]) then + DatabaseErrorFmt(SFieldReadOnly, [DisplayName]); + Validate(Buffer); + if FieldKind <> fkInternalCalc then begin + Data.PutField(FieldNo, RecBuf, Buffer); + end; + end + else + if FCreateCalcFieldDescs then begin + FieldDesc := nil; + for i := 0 to Length(FCalcFieldsMapping) - 1 do + if FCalcFieldsMapping[i].Field = Field then begin + FieldDesc := FCalcFieldsMapping[i].FieldDesc; + break; + end; + if FieldDesc <> nil then + Data.PutField(FieldDesc.FieldNo, RecBuf, Buffer) + else + Data.PutField(GetFieldDescNo(Field), RecBuf, Buffer); + end + else begin + FieldBuf := IntPtr(integer(RecBuf) + RecordSize + Offset); + Marshal.WriteByte(FieldBuf, Integer(Integer(Buffer) <> 0) ); + if Integer(Buffer) <> 0 then + {$IFNDEF CLR} + {$IFNDEF VER10P} + if Field.DataType = ftWideString then begin + WideStringSize := Length(WideString(Buffer^)) * Sizeof(WideChar); + DataOffset := Integer(IntPtr(integer(FieldBuf) + 1)^); + + CopyBuffer(Pointer(Buffer^), IntPtr(Integer(RecBuf) + FWideStringOfs + DataOffset), WideStringSize); + Marshal.WriteInt16(IntPtr(Integer(RecBuf) + FWideStringOfs + DataOffset + WideStringSize), 0); + end + else + {$ENDIF} + {$ENDIF} + CopyBuffer(Buffer, IntPtr(integer(FieldBuf) + 1), DataSize); + end; + + if not (State in [dsCalcFields, dsFilter, dsNewValue]) then + {$IFDEF CLR} + DataEvent(deFieldChange, Field); + {$ELSE} + DataEvent(deFieldChange, longint(Field)); + {$ENDIF} + end; +end; + +function TMemDataSet.GetFieldData(Field: TField; Buffer: TValueBuffer; + NativeFormat: Boolean): Boolean; +{$IFNDEF CLR} +{$IFNDEF VER10P} +var + Temp: PWideChar; +{$ENDIF} +{$ENDIF} +begin + if (Field.DataType = ftWideString) and (Buffer <> nil) then begin + {$IFDEF CLR} + Result := inherited GetFieldData(Field, Buffer, True); + {$ELSE} + {$IFDEF VER10P} + Result := inherited GetFieldData(Field, Buffer, True); + {$ELSE} + { Cannot copy direct - may be conflict with Delphi string manager + SetLength(WideString(Buffer^), Field.Size * sizeof(WideChar)); + Result := inherited GetFieldData(Field, PWideChar(WideString(Buffer^)), True);} + GetMem(Temp, (Field.Size + 1 {#0} + 8) * sizeof(WideChar));//+ 8 for numbers + try + Result := inherited GetFieldData(Field, Temp, True); + if Result then + WideString(Buffer^) := Temp + else + WideString(Buffer^) := ''; + finally + FreeMem(Temp); + end; + {$ENDIF} + {$ENDIF} + end + else + Result := inherited GetFieldData(Field, Buffer, NativeFormat); +end; + +procedure TMemDataSet.SetFieldData(Field: TField; Buffer: TValueBuffer; NativeFormat: Boolean); +begin + if Field is TWideStringField then begin + //Assert(Buffer <> nil); + inherited SetFieldData(Field, Buffer, True); + end + else + inherited SetFieldData(Field, Buffer, NativeFormat); +end; + +function TMemDataSet.GetStateFieldValue(State: TDataSetState; Field: TField): Variant; +begin + if ((Self.State = dsInsert) and (State = dsOldValue)) or (State = dsInsert) then + Result := NULL + else + Result := inherited GetStateFieldValue(State, Field); +end; + +procedure TMemDataSet.DataConvert(Field: TField; Source, Dest: TValueBuffer; ToNative: Boolean); +{$IFDEF CLR} +var + TimeStamp: TTimeStamp; + TempDouble: Double; +{$ENDIF} +begin + case Field.DataType of + {$IFDEF CLR} + ftDate: + if ToNative then + begin + TimeStamp := DateTimeToTimeStamp( + BitConverter.Int64BitsToDouble(Marshal.ReadInt64(Source))); + Marshal.WriteInt32(Dest, TimeStamp.Date); + end + else + begin + TimeStamp.Time := 0; + TimeStamp.Date := Marshal.ReadInt32(Source); + Marshal.WriteInt64(Dest, + BitConverter.DoubleToInt64Bits(MemUtils.TimeStampToDateTime(TimeStamp))); + end; + ftTime: + if ToNative then + begin + TimeStamp := DateTimeToTimeStamp( + BitConverter.Int64BitsToDouble(Marshal.ReadInt64(Source))); + Marshal.WriteInt32(Dest, TimeStamp.Time); + end + else + begin + TimeStamp.Time := Marshal.ReadInt32(Source); + TimeStamp.Date := DateDelta; + Marshal.WriteInt64(Dest, + BitConverter.DoubleToInt64Bits(MemUtils.TimeStampToDateTime(TimeStamp))); + end; + ftDateTime: + if ToNative then + begin + TempDouble := TimeStampToMSecs(DateTimeToTimeStamp( + BitConverter.Int64BitsToDouble(Marshal.ReadInt64(Source)))); + Marshal.WriteInt64(Dest, BitConverter.DoubleToInt64Bits(TempDouble)); + end + else + begin + TimeStamp := MSecsToTimeStamp( + Trunc(BitConverter.Int64BitsToDouble(Marshal.ReadInt64(Source)))); + Marshal.WriteInt64(Dest, + BitConverter.DoubleToInt64Bits(MemUtils.TimeStampToDateTime(TimeStamp))); + end; +{$ENDIF} + ftBCD: + Marshal.WriteInt64(Dest, Marshal.ReadInt64(Source)); + else + inherited DataConvert(Field, Source, Dest, ToNative); + end; +end; + +function TMemDataSet.GetSparseArrays: boolean; +begin + Result := inherited SparseArrays; +end; + +procedure TMemDataSet.SetSparseArrays(Value: boolean); +begin + if SparseArrays <> Value then begin + UnPrepare; + + inherited SparseArrays := Value; + + if Data <> nil then + Data.SparseArrays := Value; + end; +end; + +function TMemDataSet.InternalGetBlob(FieldDesc: TFieldDesc): TBlob; +var + RecBuf: TRecordBuffer; + Ptr: IntPtr; + IsBlank: boolean; +begin + Ptr := Marshal.AllocHGlobal(sizeof(IntPtr)); + try + if GetActiveRecBuf(RecBuf) then begin + if not Data.IsBlobFieldType(FieldDesc.DataType) then + DatabaseError(SNeedBlobType); + + Data.GetField(FieldDesc.FieldNo, RecBuf, Ptr, IsBlank); + Result := TBlob(GetGCHandleTarget(Marshal.ReadIntPtr(Ptr))); + end + else + Result := nil; + finally + Marshal.FreeHGlobal(Ptr); + end; +end; + +function TMemDataSet.GetBlob(const FieldName: string): TBlob; +var + FieldDesc: TFieldDesc; +begin + FieldDesc := Data.FieldByName(FieldName); + Result := InternalGetBlob(FieldDesc); +end; + +function TMemDataSet.GetBlob(Field: TField): TBlob; +var + FieldDesc: TFieldDesc; +begin + if Field <> nil then begin + FieldDesc := GetFieldDesc(Field); + if FieldDesc = nil then + raise Exception.Create(Format(SFieldNotFound, [Field.FieldName])); + Result := InternalGetBlob(FieldDesc); + end + else + Result := nil; +end; + +function TMemDataSet.InternalSetBlob(FieldDesc: TFieldDesc; Blob: TBlob): boolean; +var + OldBlob: TBlob; + RecBuf: TRecordBuffer; +begin + Assert(FieldDesc <> nil); + Assert(Blob <> nil); + OldBlob := InternalGetBlob(FieldDesc); + Assert(OldBlob <> nil); + Result := Blob.ClassType = OldBlob.ClassType; + if GetActiveRecBuf(RecBuf) then begin + if not Data.IsBlobFieldType(FieldDesc.DataType) then + DatabaseError(SNeedBlobType); + + Assert((Blob.RefCount = 1) and (OldBlob.RefCount = 1)); + OldBlob.Free; + Blob.AddRef; + Marshal.WriteIntPtr(RecBuf, FieldDesc.Offset, Blob.GCHandle); + end + else + Result := False; +end; + +function TMemDataSet.SetBlob(Field: TField; Blob: TBlob): boolean; +var + FieldDesc: TFieldDesc; +begin + if Field <> nil then begin + FieldDesc := GetFieldDesc(Field); + if FieldDesc = nil then + raise Exception.Create(Format(SFieldNotFound, [Field.FieldName])); + Result := InternalSetBlob(FieldDesc, Blob); + end + else + Result := False; +end; + +procedure TMemDataSet.SetNumberRange(FieldDef: TFieldDef); +var + Field: TField; + FieldDesc: TFieldDesc; +begin + if FieldDef.DataType in [ftInteger, ftFloat] then begin + Field := FindField(FieldDef.Name); + if Field <> nil then begin + CheckFieldCompatibility(Field, FieldDef); + FieldDesc := Data.FindField(FieldDef.Name); + if FieldDef.DataType = ftInteger then begin + Assert(Field is TIntegerField); + TIntegerField(Field).MaxValue := Round(IntPower(10, FieldDesc.Length)) - 1; + TIntegerField(Field).MinValue := -TIntegerField(Field).MaxValue; + end + else + if (FieldDesc.Length > 0) and (FieldDesc.Length <= 15) then begin + Assert(Field is TFloatField); + TFloatField(Field).Precision := FieldDesc.Length; + TFloatField(Field).MaxValue := + IntPower(10, FieldDesc.Length - FieldDesc.Scale) - + IntPower(10, - FieldDesc.Scale); + TFloatField(Field).MinValue := - TFloatField(Field).MaxValue; + end; + end; + end; +end; + +{function TMemDataSet.Translate(const Src: string; var Dest: string; boolean): integer; +begin + inherited Translate(Src, Dest, ToOem); + Result := StrLen(Src); +{ if ToOem then + AnsiToNativeBuf(Locale, Src, Dest, Result) + else + NativeToAnsiBuf(Locale, Src, Dest, Result); + if Src <> Dest then + Dest[Result] := #0; +end;} + +{ Buffer/Record Management } + +function TMemDataSet.AllocRecordBuffer: TRecordBuffer; +begin + Result := Marshal.AllocHGlobal(FRecBufSize); + PRecInfo(integer(Result) + FRecInfoOfs).RefComplexFields := False; +end; + +procedure TMemDataSet.FreeRecordBuffer(var Buffer: TRecordBuffer); +begin + FreeRefComplexFields(Buffer); + Marshal.FreeHGlobal(Buffer); + Buffer := nil; +end; + +procedure TMemDataSet.CopyRecordBuffer(SrcBuffer: IntPtr; DstBuffer: IntPtr); +begin + Data.FreeComplexFields(DstBuffer, False); + CopyBuffer(SrcBuffer, DstBuffer, FRecBufSize); + PRecInfo(integer(DstBuffer) + FRecInfoOfs).RefComplexFields := True; + Data.CreateComplexFields(DstBuffer, False); //copy complex fields + Data.CopyComplexFields(SrcBuffer, DstBuffer, False); +end; + +function TMemDataSet.GetRecord(Buffer: TRecordBuffer; GetMode: TGetMode; + DoCheck: Boolean): TGetResult; +var +{$IFDEF CLR} + RecInfo: IntPtr; +{$ELSE} + RecInfo: PRecInfo; +{$ENDIF} +begin + FreeRefComplexFields(Buffer); + case GetMode of + gmCurrent: + Data.GetRecord(Buffer); + gmNext: + Data.GetNextRecord(Buffer); + gmPrior: + Data.GetPriorRecord(Buffer); + end; + if Data.BOF then + Result := grBOF + else + if Data.EOF then + Result := grEOF + else begin + {$IFDEF CLR} + RecInfo := IntPtr(Integer(Buffer) + FRecInfoOfs); + Marshal.WriteInt32(RecInfo, Data.RecordNo); //RecordNumber + Marshal.WriteInt16(RecInfo, sizeof(longint), (byte(bfCurrent) shl 8) or byte(Data.GetUpdateStatus)); //UpdateStatus + if FNeedAddRef then begin + Marshal.WriteByte(RecInfo, sizeof(integer) + sizeof(TUpdateStatus) + + sizeof(TBookmarkFlag), byte(True)); //RefComplexFields + Data.AddRefComplexFields(Buffer); + end; + {$ELSE} + RecInfo := PRecInfo(Integer(Buffer) + FRecInfoOfs); + RecInfo.RecordNumber := Data.RecordNo; + RecInfo.UpdateStatus := TUpdateStatus(Data.GetUpdateStatus); + RecInfo.BookmarkFlag := bfCurrent; + if FNeedAddRef then begin + RecInfo.RefComplexFields := True; + Data.AddRefComplexFields(Buffer); + end; + {$ENDIF} + + //ClearBlobCache(Buffer); + if not FCacheCalcFields then + GetCalcFields(Buffer); + //SetBookmarkFlag(Buffer, bfCurrent); + Data.GetBookmark(PRecBookmark(Integer(Buffer) + FBookmarkOfs)); + + Result := grOK; + end; +end; + +procedure TMemDataSet.InternalInitRecord(Buffer: TRecordBuffer); +begin + //FInDeferredPost := False; moved to InternalInsert + //FInInserting := True; + FreeRefComplexFields(Buffer); + Data.InitRecord(Buffer); + if Data.HasComplexFields then + Data.CreateComplexFields(Buffer, True); +end; + +procedure TMemDataSet.InitRecord(Buffer: TRecordBuffer); +var + RecInfo: PRecInfo; +begin + inherited InitRecord(Buffer); + //ClearBlobCache(Buffer); + RecInfo := PRecInfo(integer(Buffer) + FRecInfoOfs); + RecInfo.RecordNumber := 0; + RecInfo.UpdateStatus := TUpdateStatus(usInserted); + RecInfo.BookMarkFlag := bfInserted; + Data.InitRecord(FOldRecBuf); // clear OldRecBuf +end; + +function TMemDataSet.GetActiveRecBuf(var RecBuf: TRecordBuffer): boolean; +begin + case State of + dsBlockRead: + if IsEmpty then + RecBuf := nil + else + RecBuf := ActiveBuffer; + dsBrowse: + if FInCacheProcessing then + RecBuf := NewCacheRecBuf + else + if IsEmpty then + RecBuf := nil + else + RecBuf := ActiveBuffer; + dsEdit,dsInsert: + RecBuf := ActiveBuffer; + dsCalcFields: + RecBuf := CalcBuffer; + dsFilter: + RecBuf := FFilterBuffer; + dsNewValue: + if FInCacheProcessing then + RecBuf := NewCacheRecBuf + else + RecBuf := ActiveBuffer; + dsOldValue: + if FInDeferredPost then + RecBuf := OldDeferredPostBuf + else + if FInCacheProcessing then + RecBuf := OldCacheRecBuf + else + RecBuf := GetOldRecord; +// dsSetKey: RecBuf := PChar(FKeyBuffer) + SizeOf(TKeyBuffer); + else + RecBuf := nil; + end; + Result := RecBuf <> nil; +end; + +function TMemDataSet.GetOldRecord: TRecordBuffer; +begin + UpdateCursorPos; + Data.GetOldRecord(FOldRecBuf); + Result := FOldRecBuf; +end; + +procedure TMemDataSet.ClearCalcFields(Buffer: TRecordBuffer); +var + i: integer; +{$IFNDEF CLR} +{$IFNDEF VER10P} + DataOffset: integer; +{$ENDIF} +{$ENDIF} +begin + if FCreateCalcFieldDescs then begin + for i := 0 to Data.Fields.Count - 1 do + if Data.Fields[i].FieldDescKind <> fdkData then + Data.SetNull(i + 1, Buffer, True); + end + else begin + FillChar(IntPtr(integer(Buffer) + RecordSize), CalcFieldsSize, 0); + + {$IFNDEF CLR} + {$IFNDEF VER10P} + DataOffset := 0; + for i := 0 to Fields.Count - 1 do + if (Fields[i].DataType = ftWideString) and (Fields[i].FieldKind in [fkCalculated, fkLookUp]) then begin + Marshal.WriteInt32(Pointer(Integer(Buffer) + RecordSize + Fields[i].Offset + 1), DataOffset); + DataOffset := DataOffset + (Fields[i].Size + 1) * sizeof(WideChar); + end; + FillChar(IntPtr(integer(Buffer) + FWideStringOfs), DataOffset, 0); + {$ENDIF} + {$ENDIF} + end; +end; + +// WAR don't support BlockRead + +procedure TMemDataSet.SetBlockReadSize(Value: Integer); +begin + if Value <> BlockReadSize then + if (Value > 0) or (Value < -1) then begin + UpdateCursorPos; + inherited; + end + else + inherited; +end; + +procedure TMemDataSet.BlockReadNext; +begin + inherited; +end; + +{ Bookmarks } + +function TMemDataSet.GetBookmarkFlag(Buffer: TRecordBuffer): TBookmarkFlag; +begin + Result := PRecInfo(integer(Buffer) + FRecInfoOfs).BookmarkFlag; +end; + +procedure TMemDataSet.SetBookmarkFlag(Buffer: TRecordBuffer; Value: TBookmarkFlag); +begin + PRecInfo(integer(Buffer) + FRecInfoOfs).BookmarkFlag := Value +end; + +// Data - pointer to bookmark +procedure TMemDataSet.GetBookmarkData(Buffer: TRecordBuffer; + {$IFDEF CLR}var{$ENDIF} Bookmark: TBookmark); +begin + CopyBuffer(IntPtr(integer(Buffer) + FBookmarkOfs), Bookmark, BookmarkSize); +end; + +procedure TMemDataSet.SetBookmarkData(Buffer: TRecordBuffer; + {$IFDEF CLR}const{$ENDIF} Bookmark: TBookmark); +begin + CopyBuffer(Bookmark, IntPtr(integer(Buffer) + FBookmarkOfs), BookmarkSize); +end; + +procedure TMemDataSet.InternalGotoBookmark({$IFDEF CLR}const{$ENDIF} Bookmark: TBookmark); +begin + Data.SetToBookMark(PRecBookmark(Bookmark)); +end; + +{function TMemDataSet.GetBookmarkStr: TBookmarkStr; +begin + if State in [dsFilter] then begin + SetLength(Result, BookmarkSize); + Data.GetBookmark(Pointer(Result)); + end + else + Result := inherited GetBookmarkStr; +end;} + +function ChangeDecimalSeparator(const Value: string; OldSeparator, NewSeparator: string): string; +begin + if OldSeparator <> NewSeparator then + Result := StringReplace(Value, OldSeparator, NewSeparator, [rfReplaceAll]) + else + Result := Value; +end; + +function XMLEncode(const AStr: String): String; +var + sb: StringBuilder; +begin + sb := StringBuilder.Create(AStr, Length(AStr)); + try + sb.Replace('&', '&'); + sb.Replace('''', '''); + sb.Replace('"', '"'); + sb.Replace('<', '<'); + sb.Replace('>', '>'); + Result := sb.ToString; + finally + sb.Free; + end; +end; + +procedure TMemDataSet.SaveToXML(const FileName: string); +var + FileStream: TFileStream; +begin + FileStream := TFileStream.Create(FileName, fmCreate); + try + SaveToXML(FileStream); + finally + FileStream.Free; + end; +end; + +procedure TMemDataSet.SaveToXML(Destination: TStream); +var + FieldAliases: TStringList; + + function IsValidFieldName(const FldName: string): boolean; + var + i: integer; + ch: char; + begin + for i := 1 to Length(FldName) do begin + ch := FldName[i]; + if not ((ch = '_') or (ch >= 'A') and (ch <= 'Z') or (ch >= 'a') and (ch <= 'z') or + (i > 1) and (ch >= '0') and (ch <= '9')) + then begin + Result := False; + Exit; + end; + end; + Result := True; + end; + + function FindFieldAlias(FldName: string): string; + var + i, p: integer; + Attr: string; + ActualName: string; + begin + Result := ''; + if FieldAliases <> nil then + for i := 0 to FieldAliases.Count - 1 do begin + Attr := FieldAliases[i]; + p := Pos('''=c', Attr); + Assert(p <> 0); + ActualName := Copy(Attr, 2, p - 2); + if ActualName = FldName then begin + Result := Copy(Attr, p + 2, Length(Attr) - p - 1); + Break; + end; + end; + end; + +var + OldActive: boolean; + Bookmark: DB.TBookmark; + DestWriter: StreamWriter; + XMLWriter: XmlTextWriter; + XML: string; + FldName, FldAlias: string; + i: integer; + FieldDesc: TFieldDesc; +{$IFDEF VER8} + DestStream: Stream; +{$ENDIF} +begin + OldActive := Active; + Bookmark := nil; + FieldAliases := nil; + DestWriter := nil; + XmlWriter := nil; +{$IFDEF VER8} + DestStream := nil; +{$ENDIF} + try + DisableControls; + Active := True; + {$IFDEF CLR} + {$IFDEF VER9P} + {$DEFINE OWNGETBOOKMARK} + {$ENDIF} + {$ENDIF} + {$IFDEF OWNGETBOOKMARK} + if BookmarkAvailable then + begin + Bookmark := Marshal.AllocHGlobal(BookmarkSize); + GetBookmarkData(ActiveBuffer, Bookmark); + end else + Bookmark := nil; + {$ELSE} + Bookmark := GetBookmark; + {$ENDIF} + + FieldAliases := TStringList.Create; + + {$IFDEF VER8} + DestStream := TStreamToCLRStream.GetStream(Destination); + {$ENDIF} + DestWriter := StreamWriter.Create({$IFDEF VER8}DestStream{$ELSE}Destination{$ENDIF}, Encoding.Default); + XmlWriter := XmlTextWriter.Create(DestWriter); + + XmlWriter.QuoteChar := ''''; + XmlWriter.Formatting := fmtIndented; + XmlWriter.Indentation := 2; + XmlWriter.IndentChar := ' '; + + // Header + XmlWriter.WriteStartElement('xml'); + + XmlWriter.WriteAttributeString('xmlns:s', 'uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882'); + XmlWriter.WriteAttributeString('xmlns:dt', 'uuid:C2F41010-65B3-11d1-A29F-00AA00C14882'); + XmlWriter.WriteAttributeString('xmlns:rs', 'urn:schemas-microsoft-com:rowset'); + XmlWriter.WriteAttributeString('xmlns:z', '#RowsetSchema'); + + // Fields + XmlWriter.WriteStartElement('s:Schema'); + XmlWriter.WriteAttributeString('id', 'RowsetSchema'); + + XmlWriter.WriteStartElement('s:ElementType'); + XmlWriter.WriteAttributeString('name', 'row'); + XmlWriter.WriteAttributeString('content', 'eltOnly'); + XmlWriter.WriteAttributeString('rs:updatable', 'true'); + + for i := 0 to Fields.Count - 1 do + if not (Fields[i].FieldKind in [fkCalculated, fkLookup]) then begin + FieldDesc := GetFieldDesc(Fields[i]); + if FieldDesc <> nil then begin + FldName := FieldDesc.Name; + if not IsValidFieldName(FldName) then begin + FldAlias := 'c' + IntToStr(FieldAliases.Count + 1); + FieldAliases.Add(QuotedStr({$IFNDEF CLR}XMLEncode{$ENDIF}(UTF8Encode(FldName))) + '=' + FldAlias); + end + else + FldAlias := ''; + XmlWriter.WriteStartElement('s:AttributeType'); + WriteFieldXMLAttributeType(Fields[i], FieldDesc, FldAlias, XmlWriter); + XmlWriter.WriteStartElement('s:datatype'); + WriteFieldXMLDataType(Fields[i], FieldDesc, FldAlias, XmlWriter); + XmlWriter.WriteEndElement; // s:datatype + XmlWriter.WriteFullEndElement; // s:AttributeType + end; + end; + + XmlWriter.WriteStartElement('s:extends'); + XmlWriter.WriteAttributeString('type', 'rs:rowbase'); + XmlWriter.WriteEndElement; // s:extends + XmlWriter.WriteFullEndElement; // s:ElementType + XmlWriter.WriteFullEndElement; // s:Schema + + // Data + XmlWriter.WriteStartElement('rs:data'); + + First; + while not EOF do begin + XmlWriter.WriteStartElement('z:row'); + for i := 0 to Fields.Count - 1 do + if not (Fields[i].FieldKind in [fkCalculated, fkLookup]) then begin + if not Fields[i].IsNull then begin + XML := GetFieldXMLValue(Fields[i], GetFieldDesc(Fields[i])); + FldName := {$IFNDEF CLR}XMLEncode{$ENDIF}(UTF8Encode(Fields[i].FieldName)); + if not IsValidFieldName(FldName) then + FldName := FindFieldAlias(FldName); + XmlWriter.WriteAttributeString(FldName, XML); + end; + end; + XmlWriter.WriteEndElement; + Next; + end; + + XmlWriter.WriteFullEndElement; // rs:data + XmlWriter.WriteFullEndElement; // xml + + XmlWriter.Close; + finally + Active := OldActive; + if OldActive and (Bookmark <> nil) then + GotoBookmark(Bookmark); + if Bookmark <> nil then + {$IFDEF OWNGETBOOKMARK} + Marshal.FreeHGlobal(Bookmark); + {$ELSE} + FreeBookmark(Bookmark); + {$ENDIF} + FieldAliases.Free; + XmlWriter.Free; + DestWriter.Free; + {$IFDEF VER8} + DestStream.Free; + {$ENDIF} + + EnableControls; + end; +end; + +procedure TMemDataSet.WriteFieldXMLDataType(Field: TField; FieldDesc: TFieldDesc; + const FieldAlias: string; XmlWriter: XMLTextWriter); +begin + case FieldDesc.DataType of + dtInt64: begin + XmlWriter.WriteAttributeString('dt:type', 'i8'); + XmlWriter.WriteAttributeString('dt:maxLength', IntToStr(FieldDesc.Size)); + XmlWriter.WriteAttributeString('rs:precision', '19'); + end; + dtBlob, dtBytes, dtVarBytes, dtExtVarBytes: begin + XmlWriter.WriteAttributeString('dt:type', 'bin.hex'); + if (FieldDesc.DataType = dtBlob) then + XmlWriter.WriteAttributeString('dt:maxLength', '2147483647') + else + XmlWriter.WriteAttributeString('dt:maxLength', IntToStr(FieldDesc.Length)); + if Field.IsBlob and not FieldDesc.Fixed then + XmlWriter.WriteAttributeString('rs:long', 'true'); + end; + dtBoolean: begin + XmlWriter.WriteAttributeString('dt:type', 'boolean'); + XmlWriter.WriteAttributeString('dt:maxLength', IntToStr(FieldDesc.Size)); + end; + dtString, dtExtString, dtMemo, dtWideString, dtExtWideString, dtWideMemo: begin + XmlWriter.WriteAttributeString('dt:type', 'string'); + if FieldDesc.DataType in [dtMemo, dtWideMemo] then + XmlWriter.WriteAttributeString('dt:maxLength', '2147483647') + else + XmlWriter.WriteAttributeString('dt:maxLength', IntToStr(FieldDesc.Length)); + if not (FieldDesc.DataType in [dtWideString, dtExtWideString, dtWideMemo]) then + XmlWriter.WriteAttributeString('rs:dbtype', 'str'); + if Field.IsBlob and not FieldDesc.Fixed then + XmlWriter.WriteAttributeString('rs:long', 'true'); + end; + dtCurrency, dtBCD: begin + XmlWriter.WriteAttributeString('dt:type', 'number'); + XmlWriter.WriteAttributeString('rs:dbtype', 'currency'); + XmlWriter.WriteAttributeString('dt:maxLength', IntToStr(FieldDesc.Size)); + XmlWriter.WriteAttributeString('rs:precision', IntToStr(FieldDesc.Length)); + end; + dtDateTime: begin + XmlWriter.WriteAttributeString('dt:type', 'datetime'); + XmlWriter.WriteAttributeString('rs:dbtype', 'variantdate'); + XmlWriter.WriteAttributeString('dt:maxLength', IntToStr(FieldDesc.Size)); + XmlWriter.WriteAttributeString('rs:scale', IntToStr(FieldDesc.Scale)); + XmlWriter.WriteAttributeString('rs:precision', IntToStr(FieldDesc.Length)); + end; + dtDate: begin + XmlWriter.WriteAttributeString('dt:type', 'date'); + XmlWriter.WriteAttributeString('dt:maxLength', IntToStr(FieldDesc.Size)); + XmlWriter.WriteAttributeString('rs:scale', IntToStr(FieldDesc.Scale)); + XmlWriter.WriteAttributeString('rs:precision', IntToStr(FieldDesc.Length)); + end; + dtTime: begin + XmlWriter.WriteAttributeString('dt:type', 'time'); + XmlWriter.WriteAttributeString('dt:maxLength', IntToStr(FieldDesc.Size)); + XmlWriter.WriteAttributeString('rs:scale', IntToStr(FieldDesc.Scale)); + XmlWriter.WriteAttributeString('rs:precision', IntToStr(FieldDesc.Length)); + end; + dtFloat: begin + if FieldDesc.Length <= 7 then begin + XmlWriter.WriteAttributeString('dt:type', 'r4'); + XmlWriter.WriteAttributeString('dt:maxLength', '4'); + end + else begin + XmlWriter.WriteAttributeString('dt:type', 'float'); + XmlWriter.WriteAttributeString('dt:maxLength', IntToStr(FieldDesc.Size)); + end; + XmlWriter.WriteAttributeString('rs:precision', IntToStr(FieldDesc.Length)); + end; + {$IFDEF VER5P} + dtGuid: begin + XmlWriter.WriteAttributeString('dt:type', 'uuid'); + XmlWriter.WriteAttributeString('dt:maxLength', '16'); + end; + {$ENDIF} + dtInt32: begin + XmlWriter.WriteAttributeString('dt:type', 'int'); + XmlWriter.WriteAttributeString('dt:maxLength', IntToStr(FieldDesc.Size)); + XmlWriter.WriteAttributeString('rs:precision', '10'); + end; + {$IFDEF VER6P} + dtFmtBCD: begin + XmlWriter.WriteAttributeString('dt:type', 'number'); + XmlWriter.WriteAttributeString('rs:dbtype', 'numeric'); + XmlWriter.WriteAttributeString('dt:maxLength', IntToStr(FieldDesc.Size)); + XmlWriter.WriteAttributeString('rs:scale', IntToStr(FieldDesc.Scale)); + XmlWriter.WriteAttributeString('rs:precision', IntToStr(FieldDesc.Length)); + end; + {$ENDIF} + dtInt16: begin + XmlWriter.WriteAttributeString('dt:type', 'i2'); + XmlWriter.WriteAttributeString('dt:maxLength', IntToStr(FieldDesc.Size)); + XmlWriter.WriteAttributeString('rs:precision', '5'); + end; + dtInt8: begin + XmlWriter.WriteAttributeString('dt:type', 'i1'); + XmlWriter.WriteAttributeString('dt:maxLength', IntToStr(FieldDesc.Size)); + XmlWriter.WriteAttributeString('rs:precision', IntToStr(FieldDesc.Length)); + end; + dtLongword: begin + XmlWriter.WriteAttributeString('dt:type', 'ui4'); + XmlWriter.WriteAttributeString('dt:maxLength', IntToStr(FieldDesc.Size)); + XmlWriter.WriteAttributeString('rs:precision', IntToStr(FieldDesc.Length)); + end; + dtWord: begin + XmlWriter.WriteAttributeString('dt:type', 'ui2'); + XmlWriter.WriteAttributeString('dt:maxLength', IntToStr(FieldDesc.Size)); + XmlWriter.WriteAttributeString('rs:precision', IntToStr(FieldDesc.Length)); + end; + dtUnknown{$IFDEF VER5P}, dtVariant{$ENDIF}: + XmlWriter.WriteAttributeString('dt:type', 'string') + else + DatabaseError(SDataTypeNotSupported, Self); + end; + + if FieldDesc.Fixed and not (FieldDesc.DataType in [dtUnknown{$IFDEF VER5P}, dtVariant{$ENDIF}]) then + XmlWriter.WriteAttributeString('rs:fixedlength', 'true'); + + if Field.Required and not Field.ReadOnly then + XmlWriter.WriteAttributeString('rs:maybenull', 'false'); +end; + +procedure TMemDataSet.WriteFieldXMLAttributeType(Field: TField; FieldDesc: TFieldDesc; + const FieldAlias: string; XmlWriter: XMLTextWriter); +begin + if FieldAlias = '' then + XmlWriter.WriteAttributeString('name', {$IFNDEF CLR}XMLEncode{$ENDIF}(UTF8Encode(FieldDesc.Name))) + else begin + XmlWriter.WriteAttributeString('name', FieldAlias); + XmlWriter.WriteAttributeString('rs:name', {$IFNDEF CLR}XMLEncode{$ENDIF}(UTF8Encode(FieldDesc.Name))); + end; + + XmlWriter.WriteAttributeString('rs:number', IntToStr(FieldDesc.FieldNo)); + if not Field.Required and not Field.ReadOnly then /// Can't use FieldDesc.Required, see "Required and FLocalConstraints" line in TMemDataSet.CreateFieldDefs for details + XmlWriter.WriteAttributeString('rs:nullable', 'true'); + if not Field.ReadOnly then + XmlWriter.WriteAttributeString('rs:writeunknown', 'true'); + // XmlWriter.WriteAttributeString('rs:basecatalog', ''); + + if FieldDesc.ActualName <> '' then + XmlWriter.WriteAttributeString('rs:basecolumn', {$IFNDEF CLR}XMLEncode{$ENDIF}(UTF8Encode(FieldDesc.ActualName))); + if FieldDesc.IsKey then + XmlWriter.WriteAttributeString('rs:keycolumn', 'true'); + if Field.AutoGenerateValue = arAutoInc then + XmlWriter.WriteAttributeString('rs:autoincrement', 'true'); +end; + +function TMemDataSet.GetFieldXMLValue(Field: TField; FieldDesc: TFieldDesc): string; +var + Buffer: TBytes; + Blob: TBlob; + Piece: PPieceHeader; +{$IFDEF CLR} + sb: StringBuilder; + Bytes: TBytes; +{$ELSE} + sbOffset: integer; +{$ENDIF} + + function EncodeXMLDateTime(Value: TDateTime): string; + var + Year, Month, Day, Hour, Minute, Second, MilliSecond: Word; + begin + DecodeDateTime(Value, Year, Month, Day, Hour, Minute, Second, MilliSecond); + Result := StringReplace(Format('%4d%s%2d%s%2d', [Year, '-', Month, '-', Day]), + ' ', '0', [rfReplaceAll]); + Result := Result + 'T'; + Result := StringReplace(Result + Format('%2d%s%2d%s%2d', [Hour, ':', Minute, ':', Second]), + ' ', '0', [rfReplaceAll]); + end; + + function EncodeXMLTime(Value: TDateTime): string; + var + Hour, Minute, Second, MilliSecond: Word; + begin + DecodeTime(Value, Hour, Minute, Second, MilliSecond); + Result := StringReplace(Format('%2d%s%2d%s%2d', [Hour, ':', Minute, ':', Second]), + ' ', '0', [rfReplaceAll]); + end; + +begin + Result := ''; + SetLength(Buffer, 0); + case FieldDesc.DataType of + dtBoolean: + Result := BoolToStr(Field.AsBoolean, True); + dtInt8, dtInt16, dtInt32, dtUInt16, dtUInt32, dtInt64: + Result := Field.AsString; + dtFloat: + Result := ChangeDecimalSeparator(FloatToStr(Field.AsFloat), DecimalSeparator, '.'); + dtCurrency, dtBcd: + Result := ChangeDecimalSeparator(CurrToStr(Field.Value), DecimalSeparator, '.'); + dtDate, dtDateTime: + Result := EncodeXMLDateTime(Field.AsDateTime); + dtTime: + Result := EncodeXMLTime(Field.AsDateTime); + {$IFDEF VER6P} + dtFmtBCD: + Result := BcdToStr(Field.AsBCD); + {$ENDIF} + dtBytes, dtVarBytes, dtExtVarBytes: begin + Buffer := Field.Value; + SetLength(Result, Length(Buffer) * 2); + {$IFDEF CLR} + Bytes := Encoding.Default.GetBytes(Result); + BinToHex(Buffer, 0, Bytes, 0, Length(Buffer)); + Result := Encoding.Default.GetString(Bytes); + {$ELSE} + BinToHex(@Buffer[0], PChar(Result), Length(Buffer)); + {$ENDIF} + end; + dtBlob: begin + Blob := InternalGetBlob(FieldDesc); + SetLength(Result, Integer(Blob.Size) * 2); + Piece := Blob.FirstPiece; + {$IFDEF CLR} + sb := StringBuilder.Create; + try + while IntPtr(Piece) <> nil do begin + SetLength(Buffer, Piece.Used); + Marshal.Copy(IntPtr(Integer(Piece) + sizeof(TPieceHeader)), Buffer, 0, Piece.Used); + SetLength(Bytes, Length(Buffer) * 2); + BinToHex(Buffer, 0, Bytes, 0, Length(Buffer)); + sb.Append(Encoding.Default.GetString(Bytes)); + Piece := Piece.Next; + end; + Result := sb.ToString; + finally + sb.Free; + end; + {$ELSE} + sbOffset := 0; + while Piece <> nil do begin + BinToHex(IntPtr(Integer(Piece) + sizeof(TPieceHeader)), + IntPtr(Integer(Result) + sbOffset), Piece.Used); + sbOffset := sbOffset + Integer(Piece.Used); + Piece := Piece.Next; + end; + {$ENDIF} + end; + else + Result := Field.AsString; + end; + Result := {$IFNDEF CLR}XMLEncode{$ENDIF}(UTF8Encode(Result)); +end; + +{$IFDEF CLR} // TDataSet bug +var + NativeDBBuffers: TDBBufferList; + +function NativeBuffers: TDBBufferList; +begin + if NativeDBBuffers <> nil then + Result := NativeDBBuffers + else + begin + Result := TDBBufferList.Create; + NativeDBBuffers := Result; // fix d9 bug + end; +end; + +function TMemDataSet.GetBookmark: TBookmark; +begin + if BookmarkAvailable then + begin + Result := NativeBuffers.AllocHGlobal(BookmarkSize); + GetBookmarkData(ActiveBuffer, Result); + end else + Result := nil; +end; + +procedure TMemDataSet.FreeBookmark(var Bookmark: TBookmark); +begin + NativeBuffers.FreeHGlobal(Bookmark); +end; +{$ENDIF} + +function TMemDataSet.BookmarkValid({$IFDEF CLR}const{$ENDIF} Bookmark: TBookmark): boolean; +begin + Result := Data.BookmarkValid(PRecBookmark(Bookmark)); +end; + +function TMemDataSet.CompareBookmarks({$IFDEF CLR}const{$ENDIF} Bookmark1, Bookmark2: TBookmark): integer; +begin + Result := Data.CompareBookmarks(PRecBookmark(Bookmark1), PRecBookmark(Bookmark2)); +end; + +{ Navigation } + +procedure TMemDataSet.InternalSetToRecord(Buffer: TRecordBuffer); +begin + InternalGotoBookmark(IntPtr(integer(Buffer) + FBookmarkOfs)); +end; + +procedure TMemDataSet.SetIndexFieldNames(Value: string); +begin + if Active then + CheckBrowseMode; + TMemData(Data).SetIndexFieldNames(Value); + if Active and (TMemData(Data).IndexFields.Count > 0) then + Resync([]); + FIndexFieldNames := Value; +end; + +procedure TMemDataSet.InternalFirst; +begin + Data.SetToBegin; +end; + +procedure TMemDataSet.InternalLast; +begin + Data.SetToEnd; +end; + +{ Editing } + +procedure TMemDataSet.InternalAddRecord(Buffer: IntPtr; Append: Boolean); +begin + if Append then + Data.AppendRecord(Buffer) + else + Data.InsertRecord(Buffer); +end; + +procedure TMemDataSet.InternalInsert; +begin + FInDeferredPost := False; + if OldDeferredPostBuf <> nil then begin + FreeRefComplexFields(OldDeferredPostBuf, False); + Marshal.FreeHGlobal(OldDeferredPostBuf); + OldDeferredPostBuf := nil; + end; + FInInserting := True; +end; + +procedure TMemDataSet.InternalEdit; +begin + FInDeferredPost := False; + if OldDeferredPostBuf <> nil then begin + FreeRefComplexFields(OldDeferredPostBuf, False); + Marshal.FreeHGlobal(OldDeferredPostBuf); + OldDeferredPostBuf := nil; + end; + FInEditing := True; + + FreeRefComplexFields(ActiveBuffer); + Data.EditRecord(ActiveBuffer); +end; + +procedure TMemDataSet.InternalDelete; +begin + if not CanModify then DatabaseError(SDataSetReadOnly, Self); + Data.DeleteRecord; + + // CR M8107 + FInInserting := False; + FInEditing := False; +end; + +procedure TMemDataSet.InternalPost; +var + i: integer; + Blob: TBlob; + Field: TField; + FieldDesc: TFieldDesc; +begin +{$IFDEF VER6P} + inherited; +{$ENDIF} + + for i := 0 to FieldCount - 1 do begin + Field := Fields[i]; + FieldDesc := GetFieldDesc(Field); + if (FieldDesc <> nil) and Data.IsBlobFieldType(FieldDesc.DataType) then begin + Blob := Data.GetObject(FieldDesc.FieldNo, ActiveBuffer) as TBlob; + if Blob.Modified then + TBlobField(Field).Modified := True; + end; + end; + if State = dsEdit then begin + Data.PostRecord(ActiveBuffer); + end + else + Data.InsertRecord(ActiveBuffer); + + FInDeferredPost := False; + if OldDeferredPostBuf <> nil then begin + FreeRefComplexFields(OldDeferredPostBuf, False); + Marshal.FreeHGlobal(OldDeferredPostBuf); + OldDeferredPostBuf := nil; + end; + FInInserting := False; + FInEditing := False; +end; + +procedure TMemDataSet.Cancel; +var + CancelBuf : IntPtr; +begin + if ((State = dsEdit) or (State = dsInsert)) and (Data.HasComplexFields) then begin + CancelBuf := AllocRecordBuffer; + CopyBuffer(ActiveBuffer, CancelBuf, FRecBufSize); + Data.AddRefComplexFields(CancelBuf); + end + else + CancelBuf := nil; + try +{$IFDEF D3} + if State = dsInsert then + if Data.HasComplexFields then + Data.FreeComplexFields(ActiveBuffer, True); +{$ENDIF} + + + inherited; + finally + if CancelBuf <> nil then begin + Data.FreeComplexFields(CancelBuf, True); + Marshal.FreeHGlobal(CancelBuf); + end; + end; +end; + + +procedure TMemDataSet.InternalCancel; +begin + FInDeferredPost := False; + if OldDeferredPostBuf <> nil then begin + FreeRefComplexFields(OldDeferredPostBuf, False); + Marshal.FreeHGlobal(OldDeferredPostBuf); + OldDeferredPostBuf := nil; + end; + FInInserting := False; + FInEditing := False; + + if State = dsEdit then + Data.CancelRecord(ActiveBuffer); +{$IFNDEF D3} + if State = dsInsert then + if Data.HasComplexFields then + Data.FreeComplexFields(ActiveBuffer, True); +{$ENDIF} +end; + +procedure TMemDataSet.InternalDeferredPost; +begin + if State = dsEdit then + DoPerformUpdate + else + DoPerformAppend; +end; + +procedure TMemDataSet.DeferredPost; + procedure CheckRequiredFields; + var + I: Integer; + begin + for I := 0 to Fields.Count - 1 do + with Fields[I] do + if Required and not ReadOnly and (FieldKind = fkData) and IsNull then + begin + FocusControl; + DatabaseErrorFmt(SFieldRequired, [DisplayName]); + end; + end; +begin + if not CachedUpdates then begin + UpdateRecord; + case State of + dsEdit, dsInsert: + begin + {$IFDEF CLR} + DataEvent(deCheckBrowseMode, nil); + {$ELSE} + DataEvent(deCheckBrowseMode, 0); + {$ENDIF} + CheckRequiredFields; + UpdateCursorPos; + + InternalDeferredPost; + + if OldDeferredPostBuf = nil then begin + OldDeferredPostBuf := AllocRecordBuffer; + Data.CreateComplexFields(OldDeferredPostBuf, False); + PRecInfo(Integer(OldDeferredPostBuf) + FRecInfoOfs).RefComplexFields := True;//own complex fields + end; + CopyRecordBuffer(ActiveBuffer, OldDeferredPostBuf); + FInDeferredPost := True; + end; + end; + end; +end; + +procedure TMemDataSet.SetDefaultExpressionValue(Field: TField); +begin + Field.AsString := Field.DefaultExpression; +end; + +procedure TMemDataSet.DoOnNewRecord; +var + i: integer; +begin + for i := 0 to FieldCount - 1 do + if Fields[i].DefaultExpression <> '' then + SetDefaultExpressionValue(Fields[i]); + try + inherited; + except + InternalCancel; + raise; + end; +end; + +function TMemDataSet.PerformAppend: boolean; +begin + Result := False; +end; + +function TMemDataSet.PerformDelete: boolean; +begin + Result := False; +end; + +function TMemDataSet.PerformUpdate: boolean; +begin + Result := False; +end; + +procedure TMemDataSet.DoPerformAppend; +var + OldModified: boolean; +begin + OldModified := Modified; + try + if not FLocalUpdate then + if not FInDeferredPost then // WAR supports defer posting + PerformAppend + else + DoPerformUpdate; + finally + SetModified(OldModified); + end; +end; + +procedure TMemDataSet.DoPerformDelete; +var + OldModified: boolean; +begin + OldModified := Modified; + try + if not FLocalUpdate then + PerformDelete + finally + SetModified(OldModified); + end; +end; + +procedure TMemDataSet.DoPerformUpdate; +var + OldModified: boolean; +begin + OldModified := Modified; + try + if not FLocalUpdate then + PerformUpdate + finally + SetModified(OldModified); + end; +end; + +{ Filter / Locate / Find } +procedure TMemDataSet.DoGetCachedFields; +var + i: Integer; + FieldDesc: TFieldDesc; + CalcFieldCount: integer; +begin + CalcFieldCount := 0; + if not DefaultFields then begin + for i := 0 to Fields.Count - 1 do + case Fields[i].FieldKind of + fkCalculated, fkLookup: begin + FieldDesc := Data.GetFieldDescType.Create; + try + FieldDesc.ActualName := Fields[i].FullName; + FieldDesc.Name := Fields[i].FullName; + FieldDesc.FieldNo := Data.FieldCount + 1; + FieldDesc.DataType := GetDataType(Fields[i].DataType); + case Fields[i].DataType of + ftWideString: + FieldDesc.Size := (Fields[i].Size + 1) * SizeOf(WideChar); + ftDate, ftTime: + FieldDesc.Size := Fields[i].DataSize * 2; + else + FieldDesc.Size := Fields[i].DataSize; + end; + FieldDesc.Length := Fields[i].Size; + if FCacheCalcFields then + FieldDesc.FieldDescKind := fdkCached + else + FieldDesc.FieldDescKind := fdkCalculated; + + // FieldDescs with CachedField=True must be positioned after data FieldDescs + Data.Fields.Add(FieldDesc); + Inc(CalcFieldCount); + SetLength(FCalcFieldsMapping, CalcFieldCount); + FCalcFieldsMapping[CalcFieldCount - 1].Field := Fields[i]; + FCalcFieldsMapping[CalcFieldCount - 1].FieldDesc := FieldDesc; + except + FieldDesc.Free; + raise; + end; + end; + end; + end; +end; + +procedure TMemDataSet.DoGetCachedBuffer(Buffer: IntPtr; Source: IntPtr = nil); +var + RecBuf: IntPtr; +begin + if (CalcFieldsSize > 0) then begin + RecBuf := Marshal.AllocHGlobal(Data.RecordSize + Data.CalcRecordSize + SizeOf(TRecInfo) + BookmarkSize); + try + if Source = nil then + CopyBuffer(Buffer, RecBuf, Data.RecordSize) + else + CopyBuffer(Source, RecBuf, Data.RecordSize); + + GetCalcFields(RecBuf); + CopyBuffer(RecBuf, Buffer, Data.RecordSize + Data.CalcRecordSize); + finally + Marshal.FreeHGlobal(RecBuf); + end; + end; +end; + +procedure TMemDataSet.ActivateFilters; +begin + DeactivateFilters; + + if Assigned(OnFilterRecord) then + Data.FilterFunc := RecordFilter; + if Trim(Filter) <> '' then + Data.FilterText := Filter; +end; + +procedure TMemDataSet.DeactivateFilters; +begin + Data.FilterFunc := nil; + Data.FilterText := ''; +end; + +function TMemDataSet.RecordFilter(RecBuf: IntPtr): boolean; +var + Accept: boolean; + SaveState: TDataSetState; +begin + SaveState := SetTempState(dsFilter); + FFilterBuffer := RecBuf; + try + Accept := True; + OnFilterRecord(Self, Accept); + except + InternalHandleException; + end; + RestoreState(SaveState); + Result := Accept; +end; + +procedure TMemDataSet.SetFiltered(Value: boolean); +begin + if Active then begin + CheckBrowseMode; + UpdateCursorPos; + end; + + if Value <> Filtered then begin + if Value then + ActivateFilters + else + DeactivateFilters; + + inherited SetFiltered(Value); + + if Active then begin + Data.FilterUpdated; + Resync([]); + First; + //DoAfterScroll; + end; + end; +end; + +procedure TMemDataSet.SetFilterData(const Text: string; Options: TFilterOptions); +begin + if Active then begin + CheckBrowseMode; + UpdateCursorPos; + end; + + if (Text <> Filter) or (Options <> FilterOptions) then begin + Data.FilterCaseInsensitive := foCaseInsensitive in Options; + Data.FilterNoPartialCompare := foNoPartialCompare in Options; + + if Filtered and (Trim(Text) <> '') then + Data.FilterText := Text + else + Data.FilterText := ''; + + inherited SetFilterText(Text); + inherited SetFilterOptions(Options); + + if Active and Filtered then begin + Data.FilterUpdated; + Resync([]); + First; + //DoAfterScroll; + end; + end; +end; + +procedure TMemDataSet.SetFilterOptions(Value: TFilterOptions); +begin + SetFilterData(Filter, Value); +end; + +procedure TMemDataSet.SetFilterText(const Value: string); +begin + SetFilterData(Value, FilterOptions); +end; + +procedure TMemDataSet.SetOnFilterRecord(const Value: TFilterRecordEvent); +begin + if Active then begin + CheckBrowseMode; + UpdateCursorPos; + end; + + inherited SetOnFilterRecord(Value); + + if Filtered and Assigned(OnFilterRecord) then + Data.FilterFunc := RecordFilter + else + Data.FilterFunc := nil; + + if Active then begin + Data.FilterUpdated; + Resync([]); + First; + end; +end; + +function TMemDataSet.FindRecord(Restart, GoForward: boolean): boolean; +begin + CheckBrowseMode; + DoBeforeScroll; + SetFound(False); + UpdateCursorPos; + CursorPosChanged; + if not Filtered then + ActivateFilters; + try + if GoForward then begin + if Restart then + Data.SetToBegin; + Data.GetNextRecord(nil); + end + else begin + if Restart then + Data.SetToEnd; + Data.GetPriorRecord(nil); + end; + finally + if not Filtered then + DeactivateFilters; + end; + + if not Data.BOF and not Data.EOF then begin + Resync([rmExact, rmCenter]); + SetFound(True); + end; + Result := Found; + if Result then + DoAfterScroll; +end; + +// Allocate memory for Value (ValuePtr - must call FreeMem!) and copy Value to ValuePtr +procedure TMemDataSet.CopyFieldValue(const Value: variant; out ValuePtr: IntPtr; + out ValueType: integer; FieldDesc: TFieldDesc); // Allocate memory for Value (ValuePtr - must call FreeMem!) and copy Value to ValuePtr +var + BoolValue: boolean; + s: string; + l: integer; + Temp: IntPtr; + ws: WideString; +{$IFDEF CLR} + Data: TBytes; +{$ENDIF} +{$IFDEF VER6P} + i64: Int64; + bcd: TBcd; +{$ENDIF} +begin + case VarType(Value) of + varEmpty,varNull: + ValuePtr := nil; + varString{$IFDEF CLR}, varChar{$ELSE}, varOleStr{$ENDIF}: + case FieldDesc.DataType of + dtBoolean: begin + BoolValue := Value; + ValuePtr := Marshal.AllocHGlobal(SizeOf(Boolean)); + Marshal.WriteByte(ValuePtr, integer(BoolValue)); + ValueType := dtBoolean; + end; + dtBytes, dtVarBytes, dtExtVarBytes: begin + s := Value; + l := Length(s); + ValuePtr := Marshal.AllocHGlobal(l + SizeOf(Word)); + + Temp := Marshal.StringToHGlobalAnsi(s); + try + CopyBuffer(Temp, IntPtr(integer(ValuePtr) + SizeOf(Word)), l); + finally + Marshal.FreeCoTaskMem(Temp); + end; + Marshal.WriteInt16(ValuePtr, l); + ValueType := FieldDesc.DataType; + end; + dtWideString: + begin + ws := Value; + l := (Length(ws) + 1) * SizeOf(WideChar); + ValuePtr := Marshal.AllocHGlobal(l); + CopyBufferUni(ws, ValuePtr, l); + ValueType := dtWideString; + end; + else + begin + s := Value; + l := Length(s) + 1; + ValuePtr := Marshal.AllocHGlobal(l); + CopyBufferAnsi(s, ValuePtr, l); + ValueType := dtString; + end; + end; + else + ValueType := FieldDesc.DataType; + case ValueType of + dtInt32, dtInt8, dtInt16, dtUInt16: begin + ValuePtr := Marshal.AllocHGlobal(SizeOf(integer)); + Marshal.WriteInt32(ValuePtr, Value); + end; + dtUInt32: begin + ValuePtr := Marshal.AllocHGlobal(SizeOf(longword)); + Marshal.WriteInt32(ValuePtr, Value); + end; + dtBoolean: begin + ValuePtr := Marshal.AllocHGlobal(SizeOf(Boolean)); + Marshal.WriteByte(ValuePtr, Integer(Boolean(Value))); + end; + dtInt64: begin + {$IFDEF VER6P} + ValuePtr := Marshal.AllocHGlobal(SizeOf(Int64)); + i64 := Value; + Marshal.WriteInt64(ValuePtr, i64); + {$ELSE} + GetMem(ValuePtr, SizeOf(Int64)); + if TVarData(Value).VType = varDecimal then + Int64(ValuePtr^) := TVarDataD6(Value).VInt64 + else + Int64(ValuePtr^) := StrToInt64(Value); + {$ENDIF} + end; + dtFloat, dtCurrency: begin + ValuePtr := Marshal.AllocHGlobal(SizeOf(Int64)); + Marshal.WriteInt64(ValuePtr, BitConverter.DoubleToInt64Bits(Value)); + end; + dtBCD: begin + ValuePtr := Marshal.AllocHGlobal(SizeOf(Currency)); + Marshal.WriteInt64(ValuePtr, BitConverter.DoubleToInt64Bits(Value)); + end; + {$IFDEF VER6P} + dtFmtBCD: begin + ValuePtr := Marshal.AllocHGlobal(SizeOfTBcd); + bcd := VarToBcd(Value); + {$IFDEF CLR} + Data := TBcd.ToBytes(bcd); + Marshal.Copy(Data, 0, ValuePtr, SizeOfTBcd); + {$ELSE} + PBcd(ValuePtr)^ := bcd; + {$ENDIF} + end; + {$ENDIF} + dtString, dtExtString: begin + s := Value; + l := Length(s) + 1; + ValuePtr := Marshal.AllocHGlobal(l); + CopyBufferAnsi(s, ValuePtr, l); + ValueType := dtString; + end; + dtWideString, dtExtWideString: begin + ws := Value; + l := (Length(ws) + 1) * SizeOf(WideChar); + ValuePtr := Marshal.AllocHGlobal(l); + CopyBufferUni(ws, ValuePtr, l); + ValueType := dtWideString; + end; + dtDateTime, dtDate, dtTime: begin + ValuePtr := Marshal.AllocHGlobal(SizeOf(Int64)); + Marshal.WriteInt64(ValuePtr, BitConverter.DoubleToInt64Bits(TDateTime(Value))); + end; + dtBytes, dtVarBytes, dtExtVarBytes: begin + Assert(VarType(Value) = varArray + varByte); + {$IFDEF CLR} + SetLength(Data, VarArrayHighBound(Value, 1) + 1); + for l := 0 to High(Data) do + Data[l] := VarArrayGet(Value, l); + ValuePtr := Marshal.AllocHGlobal(Length(Data) + sizeof(word)); + Marshal.WriteInt16(ValuePtr, Length(Data)); + Marshal.Copy(Data, 0, IntPtr(integer(ValuePtr) + sizeof(word)), Length(Data)); + {$ELSE} + GetMem(ValuePtr, TVarData(Value).VArray.Bounds[0].ElementCount + SizeOf(Word)); + Move(TVarData(Value).VArray.Data^, (PChar(ValuePtr) + SizeOf(Word))^, TVarData(Value).VArray.Bounds[0].ElementCount); + Word(ValuePtr^) := TVarData(Value).VArray.Bounds[0].ElementCount; + {$ENDIF} + end; + else + raise EConvertError.Create(SCannotConvertType); + end; + end; +end; + +function TMemDataSet.InternalLocateRecord(KeyFields: TDAList; const KeyValues: variant; + Options: TLocateExOptions; SavePos: boolean): boolean; +var + FieldDesc: TFieldDesc; + RecBuf: TRecordBuffer; + Values: array of IntPtr; + Types: array of integer; + i, FieldCount: integer; + IndexedFieldCount: integer; + Bookmark: PRecBookmark; + Res: integer; + CalcKeyFields: boolean; + FirstRecNo, LastRecNo: Integer; + + procedure SetKeyFields; + var + i: integer; + Index: integer; + TmpValue: IntPtr; + TmpType: integer; + Value: variant; + begin + CalcKeyFields := False; + FieldCount := KeyFields.Count; + SetLength(Values, FieldCount); + for i := 0 to FieldCount - 1 do begin + Values[i] := nil; // Clear Values array to prevent AV in 'finally' section after Exception + + if TFieldDesc(KeyFields[i]).FieldDescKind = fdkCalculated then + CalcKeyFields := True; + end; + + SetLength(Types, FieldCount); + for i := 0 to FieldCount - 1 do begin + Value := Unassigned; + if VarIsArray(KeyValues) + and ((FieldCount > 1) or (VarArrayHighBound(KeyValues, 1) = 0)) then + if i <= VarArrayHighBound(KeyValues, 1) then + Value := KeyValues[i] + else + Value := Null + else + if i = 0 then + Value := KeyValues + else + Value := Null; + + CopyFieldValue(Value, Values[i], Types[i], TFieldDesc(KeyFields[i])); + end; + + + IndexedFieldCount := 0; + if not ((lxPartialKey in Options) or (lxPartialCompare in Options) or (lxNearest in Options))then //lxPartialKey and lxPartialCompare incompatible with ordered locate + //lxNearest can be partially supported in the next versions + for i := 0 to TMemData(Data).IndexFields.Count - 1 do begin + //Check ordered locate posibility for current Index field + if (not TMemData(Data).IndexFields[i].CaseSensitive) xor + (lxCaseInsensitive in Options) then + break; + + //First IndexFields should be in KeyFields if not then we can't use ordered Locate + Index := KeyFields.IndexOf(TMemData(Data).IndexFields[i].FieldDesc); + if (Index > -1) then begin + if IndexedFieldCount <> Index then begin + FieldDesc := TFieldDesc(KeyFields[IndexedFieldCount]); + KeyFields[IndexedFieldCount] := KeyFields[Index]; + KeyFields[Index] := FieldDesc; + + TmpValue := Values[IndexedFieldCount]; + Values[IndexedFieldCount] := Values[Index]; + Values[Index] := TmpValue; + + TmpType := Types[IndexedFieldCount]; + Types[IndexedFieldCount] := Types[Index]; + Types[Index] := TmpType; + end; + inc(IndexedFieldCount); + end + else + break; + + end; + + end; + + function GetGoldenSectionDir(ReadRecBuf: boolean): integer; + var + i: integer; + FieldBlank: boolean; + Dir: Integer; + begin + Result := 0; + i := 0; + if ReadRecBuf then + Data.GetRecord(RecBuf); + + if CalcKeyFields then + GetCalcFields(RecBuf); + + while (Result = 0) and (i < IndexedFieldCount) do begin + FieldDesc := TFieldDesc(KeyFields[i]); + + FieldBlank := TMemData(Data).GetNull(FieldDesc.FieldNo, RecBuf); + + if TMemData(Data).IndexFields[i].DescendingOrder then + Dir := -1 + else + Dir := 1; + + if FieldBlank and (Values[i] = nil) then + Result := 0 + else + if FieldBlank and not (Values[i] = nil) then + Result := 1 + else + if not FieldBlank and (Values[i] = nil) then + Result := -1 + else + Result := TMemData(Data).CompareFieldValue(Values[i], Types[i], FieldDesc, RecBuf, Options); + + if Result <> 0 then + Result := Result * Dir; + Inc(i); + end; + end; + + function ExecGoldenSection: boolean; + var + First, Last, Current: Integer; + Dir: Integer; + + begin + Result := False; + + First := FirstRecNo; + Last := LastRecNo; + + Data.RecordNo := First; + Dir := GetGoldenSectionDir(True); + if Dir <= 0 then begin + Result := Dir = 0; + Exit; + end; + + Data.RecordNo := Last; + Dir := GetGoldenSectionDir(True); + if Dir >= 0 then begin + Result := Dir = 0; + Exit; + end; + + repeat + Current := (Last + First) div 2; + TMemData(Data).RecordNo := Current; + Dir := GetGoldenSectionDir(True); + if Dir < 0 then + Last := Current + else + if Dir > 0 then + First := Current + else begin + Result := True; + Break; + end; + until Last - First <= 1; + end; + +begin + Result := False; + if KeyFields.Count = 0 then + Exit; + + CheckBrowseMode; + CursorPosChanged; + UpdateCursorPos; + + FieldCount := 0; + + RecBuf := TempBuffer; + FreeRefComplexFields(RecBuf); + + Values := nil; + Bookmark := Marshal.AllocHGlobal(sizeof(TRecBookmark)); + try + SetKeyFields; + Data.GetBookmark(Bookmark); + + //Set locate dimensions. This dimensions should be used for lxNearest ordered implementation + FirstRecNo := 1; + LastRecNo := Data.RecordCount; + + if (lxNext in Options) then begin//Search from current position + if IndexedFieldCount > 0 then + Data.GetNextRecord(RecBuf); //Next RecNo in case of Ordered Search + FirstRecNo := Data.RecordNo; + end; + + if (lxUp in Options) then begin //Search from current position downto first + if IndexedFieldCount > 0 then + Data.GetPriorRecord(RecBuf); //Prior RecNo in case of Ordered Search + LastRecNo := Data.RecordNo; + end; + + if IndexedFieldCount > 0 then begin + TMemData(Data).PrepareRecNoCache; + Result := ExecGoldenSection; + + //Find the first occurence of located data + if Result then + repeat + + if (lxUp in Options) then begin + if Data.RecordNo >= LastRecNo then //top limit of first occurrence search + break + else begin + Data.GetNextRecord(RecBuf); + if Data.Eof or (GetGoldenSectionDir(False) <> 0) then begin + if IndexedFieldCount >= FieldCount then //we shouldn't restore correct position in case of mixed locate + Data.GetPriorRecord(RecBuf); //Restore correct position + break; + end; + end; + end + else + if Data.RecordNo <= FirstRecNo then //bottom limit of first occurrence search + break + else begin + Data.GetPriorRecord(RecBuf); + if (GetGoldenSectionDir(False) <> 0) then begin + if IndexedFieldCount >= FieldCount then //we shouldn't restore correct position in case of mixed locate + Data.GetNextRecord(RecBuf); //Restore correct position + break; + end; + end; + + until Data.Bof or Data.Eof; + end; + + + if (IndexedFieldCount = 0) or ((IndexedFieldCount < FieldCount) and Result) then begin + + if not((lxNext in Options) or (lxUp in Options)) and not (IndexedFieldCount > 0) then + Data.SetToBegin; + + while True do begin + if lxUp in Options then + Data.GetPriorRecord(RecBuf) + else + Data.GetNextRecord(RecBuf); + + if CalcKeyFields then + GetCalcFields(RecBuf); + + if not (Data.EOF or Data.BOF) then begin + Result := True; + i := 0; + while Result and (i < FieldCount) do begin + FieldDesc := TFieldDesc(KeyFields[i]); + if (Values[i] = nil) or Data.GetNull(FieldDesc.FieldNo, RecBuf) then + Result := (Values[i] = nil) and Data.GetNull(FieldDesc.FieldNo, RecBuf) + else begin + Res := TMemData(Data).CompareFieldValue(Values[i], Types[i], FieldDesc, RecBuf, Options); + Result := (Res = 0) or (Res < 0) and (lxNearest in Options); + end; + Inc(i); + end; + + if Result then + break; + end + else begin + Result := False; + break; + end; + end; + end; + + if (SavePos or not Result) + and not (Data.Eof and Data.Bof {Empty Data}) then + Data.SetToBookmark(Bookmark); + finally + Marshal.FreeHGlobal(Bookmark); + for i := 0 to FieldCount - 1 do + Marshal.FreeHGlobal(Values[i]); + end; +end; + +function TMemDataSet.LocateRecord(const KeyFields: string; const KeyValues: variant; + Options: TLocateExOptions; SavePos: boolean): boolean; +var + Fields: TDAList; + FieldDesc: TFieldDesc; + + procedure ParseKeyFields; + var + St: string; + i: integer; + begin + i := 1; + while True do begin + St := ExtractFieldName(KeyFields, i); + if St <> '' then begin + FieldDesc := Data.FieldByName(St); + if FieldDesc <> nil then + Fields.Add(FieldDesc); + end + else + break; + end; + end; + +begin + Fields := TDAList.Create; + try + ParseKeyFields; + Result := InternalLocateRecord(Fields, KeyValues, Options, SavePos); + finally + Fields.Free; + end; +end; + +function TMemDataSet.LocateRecord(const KeyFields: array of TField; const KeyValues: variant; + Options: TLocateExOptions; SavePos: boolean): boolean; +var + Fields: TDAList; + i: integer; +begin + Fields := TDAList.Create; + try + for i := 0 to Length(KeyFields) - 1 do begin + if KeyFields[i] <> nil then + Fields.Add(GetFieldDesc(KeyFields[i])); + end; + + Result := InternalLocateRecord(Fields, KeyValues, Options, SavePos); + finally + Fields.Free; + end; +end; + +function LocateExOptions(Options: TLocateOptions): TLocateExOptions; +begin + Result := []; + if loCaseInsensitive in Options then + Result := Result + [lxCaseInsensitive]; + + if loPartialKey in Options then + Result := Result + [lxPartialKey]; +end; + +function TMemDataSet.Locate(const KeyFields: array of TField; const KeyValues: variant; + Options: TLocateOptions): boolean; +begin + DoBeforeScroll; + + Result := LocateRecord(KeyFields, KeyValues, LocateExOptions(Options), False); + + if Result then begin + Resync([{rmExact, rmCenter}]); + DoAfterScroll; + end; +end; + +function TMemDataSet.Locate(const KeyFields: string; + const KeyValues: variant; Options: TLocateOptions): boolean; +begin + DoBeforeScroll; + + Result := LocateRecord(KeyFields, KeyValues, LocateExOptions(Options), False); + + if Result then begin + Resync([{rmExact, rmCenter}]); + DoAfterScroll; + end; +end; + +function TMemDataSet.LocateEx(const KeyFields: string; + const KeyValues: variant; Options: TLocateExOptions): boolean; +begin + DoBeforeScroll; + + Result := LocateRecord(KeyFields, KeyValues, Options, False); + + if Result then begin + Resync([{rmExact, rmCenter}]); + DoAfterScroll; + end; +end; + +function TMemDataSet.LocateEx(const KeyFields: array of TField; + const KeyValues: variant; Options: TLocateExOptions): boolean; +begin + DoBeforeScroll; + + Result := LocateRecord(KeyFields, KeyValues, Options, False); + + if Result then begin + Resync([{rmExact, rmCenter}]); + DoAfterScroll; + end; +end; + +function TMemDataSet.Lookup(const KeyFields: string; const KeyValues: variant; + const ResultFields: string): variant; +begin + Result := Null; + if LocateRecord(KeyFields, KeyValues, [], True) then begin + SetTempState(dsCalcFields); + try + CalculateFields(TempBuffer); + Result := FieldValues[ResultFields]; + finally + RestoreState(dsBrowse); + end; + end; +end; + +{ CachedUpdates } + +procedure TMemDataSet.CheckCachedUpdateMode; +begin + if not CachedUpdates then + DatabaseError(SNotCachedUpdate); +end; + +function TMemDataSet.UpdateStatus: TUpdateStatus; +var + RecBuf: TRecordBuffer; +begin + if CachedUpdates and not IsEmpty then begin + if State = dsCalcFields then + RecBuf := CalcBuffer + else + RecBuf := ActiveBuffer; + + Result := PRecInfo(integer(RecBuf) + FRecInfoOfs).UpdateStatus; + end + else + Result := usUnModified; +end; + +function TMemDataSet.UpdateResult: TUpdateAction; +begin + UpdateCursorPos; + + if Data.GetUpdateResult = urNone then + Result := uaApplied + else + Result := TUpdateAction(Data.GetUpdateResult); +end; + +procedure TMemDataSet.ApplyUpdates; +begin + CheckActive; + FreeRefBuffers; + if State <> dsBrowse then + Post; + CheckCachedUpdateMode; + UpdateCursorPos; + + NewCacheRecBuf := AllocRecordBuffer; + OldCacheRecBuf := AllocRecordBuffer; + FInCacheProcessing := True; + try + Data.SetCacheRecBuf(NewCacheRecBuf, OldCacheRecBuf); + Data.ApplyUpdates; + finally + FInCacheProcessing := False; + FreeRecordBuffer(NewCacheRecBuf); + FreeRecordBuffer(OldCacheRecBuf); + Resync([]); + end; +end; + +procedure TMemDataSet.CommitUpdates; +begin + CheckActive; + CheckCachedUpdateMode; + FreeRefBuffers; + UpdateCursorPos; + + NewCacheRecBuf := AllocRecordBuffer; + OldCacheRecBuf := AllocRecordBuffer; + FInCacheProcessing := True; + try + Data.SetCacheRecBuf(NewCacheRecBuf, OldCacheRecBuf); + Data.CommitUpdates; + finally + FInCacheProcessing := False; + FreeRecordBuffer(NewCacheRecBuf); + FreeRecordBuffer(OldCacheRecBuf); + end; + Resync([]); +end; + +procedure TMemDataSet.CancelUpdates; +begin + CheckActive; + FreeRefBuffers; + Cancel; + CheckCachedUpdateMode; + UpdateCursorPos; + Data.CancelUpdates; + Resync([]); +end; + +procedure TMemDataSet.RestoreUpdates; +begin + CheckActive; + FreeRefBuffers; + Cancel; + CheckCachedUpdateMode; + UpdateCursorPos; + Data.RestoreUpdates; + Resync([]); +end; + +procedure TMemDataSet.RevertRecord; +begin + CheckActive; + FreeRefComplexFields(ActiveBuffer); + if State in dsEditModes then + Cancel; + CheckCachedUpdateMode; + UpdateCursorPos; + Data.RevertRecord; + Resync([]); +end; + +procedure TMemDataSet.DoApplyRecord(UpdateKind: TUpdateRecKind; var Action: TUpdateRecAction; LastItem: boolean); +var + OldModified: boolean; + UpdateAction: TUpdateAction; +begin + OldModified := Modified; // NewValue change Modified ??? or MemDS + try + UpdateAction := uaFail; + try + if Assigned(OnUpdateRecord) then begin + OnUpdateRecord(Self, TUpdateKind(UpdateKind), UpdateAction); + if UpdateAction in [uaAbort] then + Abort; + end; + //else begin + if not Assigned(OnUpdateRecord) or (UpdateAction = TUpdateAction(uaDefault)) then begin + case UpdateKind of + ukUpdate: + PerformUpdate; + ukInsert: + PerformAppend; + ukDelete: + PerformDelete; + end; + + if BatchUpdate then + if CanFlushBatch or LastItem then + // Should be flushed here because of Action parameter that should be returned + // to TMemData.ApplyUpdates function + FlushBatch + else begin + Action := urSuspended; + Exit; + end; + + UpdateAction := uaApplied; + end; + except + on E: Exception do + if IsClass(E, EDatabaseError) and Assigned(OnUpdateError) then begin + OnUpdateError(Self, EDatabaseError(E), TUpdateKind(UpdateKind), UpdateAction); + case UpdateAction of + uaFail: + raise; + uaAbort: + Abort; + end; + end + else + raise; + end; + finally + SetModified(OldModified); + end; + Action := TUpdateRecAction(UpdateAction); +end; + +function TMemDataSet.BatchUpdate: boolean; +begin + Result := False; +end; + +function TMemDataSet.CanFlushBatch: boolean; +begin + Result := False; +end; + +procedure TMemDataSet.FlushBatch; +begin + Assert(False, 'Should be overridden'); +end; + +{ BLOB Support } + +{function TMemDataSet.GetBlobData(Field:TField; Buffer: PChar):TBlobData; +begin + Result := PBlobDataArray(Buffer + FBlobCacheOfs)[Field.Offset]; +end; + +procedure TMemDataSet.SetBlobData(Field:TField; Buffer: PChar; Value:TBlobData); +begin + if Buffer = ActiveBuffer then + PBlobDataArray(Buffer + FBlobCacheOfs)[Field.Offset] := Value; +end; + +procedure TMemDataSet.ClearBlobCache(Buffer: PChar); +var + i: integer; +begin + for i := 0 to BlobFieldCount - 1 do + PBlobDataArray(Buffer + FBlobCacheOfs)[i] := ''; +end;} + +procedure TMemDataSet.CloseBlob(Field: TField); +begin +end; + +function TMemDataSet.CreateBlobStream(Field: TField; Mode: TBlobStreamMode): TStream; +begin + Result := TBlobStream.Create(Field as TBlobField, Mode); +end; + +{ Informational } + +function TMemDataSet.IsSequenced: boolean; +begin + Result := True; +end; + +function TMemDataSet.GetRecordSize: word; +begin + Result := word(Data.RecordSize); +end; + +function TMemDataSet.GetRecordCount: integer; +begin + if Active then + Result := Data.RecordCount + else + Result := 0; +end; + +function TMemDataSet.GetRecNo: integer; +var + RecBuf: TRecordBuffer; +begin + if GetActiveRecBuf(RecBuf) then + Result := PRecInfo(integer(RecBuf) + FRecInfoOfs).RecordNumber + else + Result := 0; +end; + +procedure TMemDataSet.SetRecNo(Value: integer); +begin + CheckBrowseMode; + DoBeforeScroll; + Data.RecordNo := Value; + Resync([{rmCenter}]); + DoAfterScroll; +end; + +{ More } + +procedure TMemDataSet.InternalHandleException; +begin +{$IFDEF VER6P} + if Assigned(Classes.ApplicationHandleException) then + Classes.ApplicationHandleException(ExceptObject) + else + ShowException(ExceptObject, ExceptAddr) +{$ELSE} + ApplicationHandleException(Self); +{$ENDIF} +end; + +{$IFDEF CLR} +procedure TMemDataSet.DataEvent(Event: TDataEvent; Info: TObject); +{$ELSE} +procedure TMemDataSet.DataEvent(Event: TDataEvent; Info: longint); +{$ENDIF} + procedure CheckIfParentScrolled; + var + ParentPosition, I: Integer; + begin + if FParentDataSet = nil then + Exit; + ParentPosition := 0; + with FParentDataSet do + if not IsEmpty then + for I := 0 to BookmarkSize - 1 do + ParentPosition := ParentPosition + + Marshal.ReadByte(ActiveBuffer, FBookmarkOfs + I); + if (FLastParentPos = 0) or (ParentPosition <> FLastParentPos) then + begin + First; + FLastParentPos := ParentPosition; + end else + begin + UpdateCursorPos; + Resync([]); + end; + end; + +begin + if Event = deParentScroll then + CheckIfParentScrolled; + inherited DataEvent(Event, Info); +end; + +procedure TMemDataSet.AssignTo(Dest: TPersistent); +begin + if Dest is TMemDataSet then begin + TMemDataSet(Dest).CachedUpdates := CachedUpdates; + TMemDataSet(Dest).LocalConstraints := LocalConstraints; + TMemDataSet(Dest).LocalUpdate := LocalUpdate; + end + else + inherited; +end; + +procedure TMemDataSet.SetCachedUpdates(Value: boolean); +begin + if FCachedUpdates <> Value then begin + CheckInactive; + FCachedUpdates := Value; + Data.CachedUpdates := FCachedUpdates; + end; +end; + +function TMemDataSet.GetUpdatesPending: boolean; +begin + Result := Data.UpdatesPending; +end; + +function TMemDataSet.GetPrepared: boolean; +begin + Result := Data.Prepared; +end; + +procedure TMemDataSet.SetPrepared(Value: boolean); +begin + if Value then + Prepare + else + UnPrepare; +end; + +function TMemDataSet.GetUpdateRecordSet: TUpdateRecordTypes; +var + ItemTypes: TItemTypes; +begin +// if Active then begin + CheckCachedUpdateMode; + ItemTypes := Data.FilterItemTypes; + + Result := []; + if isUnmodified in ItemTypes then + Result := Result + [rtUnmodified]; + if isUpdated in ItemTypes then + Result := Result + [rtModified]; + if isAppended in ItemTypes then + Result := Result + [rtInserted]; + if isDeleted in ItemTypes then + Result := Result + [rtDeleted]; +{ end + else + Result := [];} +end; + +procedure TMemDataSet.SetUpdateRecordSet(Value: TUpdateRecordTypes); +var + ItemTypes: TItemTypes; +begin + CheckCachedUpdateMode; + + //CheckBrowseMode; + if Active then + UpdateCursorPos; + + ItemTypes := []; + if rtUnmodified in Value then + ItemTypes := ItemTypes + [isUnmodified]; + if rtModified in Value then + ItemTypes := ItemTypes + [isUpdated]; + if rtInserted in Value then + ItemTypes := ItemTypes + [isAppended]; + if rtDeleted in Value then + ItemTypes := ItemTypes + [isDeleted]; + + Data.FilterItemTypes := ItemTypes; + + if Active then + Resync([]); +end; + +{ TBlobStream } + +constructor TBlobStream.Create(Field: TBlobField; Mode: TBlobStreamMode); +begin + inherited Create; + + FMode := Mode; + FField := Field; + FDataSet := FField.DataSet as TMemDataSet; + FFieldNo := FField.FieldNo; + if not FDataSet.GetActiveRecBuf(FBuffer) then + Exit; +{ if FDataSet.State = dsFilter then + DatabaseErrorFmt('SNoFieldAccess', [FField.DisplayName]);} + if not FField.Modified then begin + if Mode = bmRead then begin +{ FCached := FDataSet.FCacheBlobs and (FBuffer = FDataSet.ActiveBuffer) and + (FField.IsNull or (FDataSet.GetBlobData(FField, FBuffer) <> ''));} + end + else begin +// FDataSet.SetBlobData(FField, FBuffer, ''); + if FField.ReadOnly then + DatabaseErrorFmt(SFieldReadOnly, [FField.DisplayName]); + if not (FDataSet.State in [dsNewValue, dsEdit, dsInsert]) then + DatabaseError(SNotEditing); + end; + end; + FOpened := True; + if Mode = bmWrite then + Truncate; +end; + +destructor TBlobStream.Destroy; +begin + if FOpened then begin + if FModified then + FField.Modified := True; + end; + if FModified then + //try + {$IFDEF CLR} + FDataSet.DataEvent(deFieldChange, FField); + {$ELSE} + FDataSet.DataEvent(deFieldChange, longint(FField)); + {$ENDIF} + {except + Application.HandleException(Self); + end;} +end; + +{$IFDEF CLR} +function TBlobStream.Read(var Buffer: TBytes; Offset, Count: Longint): Longint; +var + Handle: IntPtr; +{$ELSE} +function TBlobStream.Read(var Buffer; Count: longint): longint; +{$ENDIF} +begin + Result := 0; + if FOpened then begin + if Count > Size - FPosition then + Result := Size - FPosition + else + Result := Count; + if Result > 0 then begin + {$IFDEF CLR} + Handle := AllocGCHandle(Buffer, True); + try + Result := FDataSet.Data.ReadBlob(FFieldNo, FBuffer, FPosition, Count, + GetAddrOfPinnedObject(Handle), FDataSet.State = dsOldValue{$IFDEF VER10P}, (FField is TWideMemoField){$ENDIF}); + finally + FreeGCHandle(Handle); + end; + {$ELSE} + Result := FDataSet.Data.ReadBlob(FFieldNo, FBuffer, FPosition, Count, @Buffer, + (FDataSet.State = dsOldValue){$IFDEF VER10P}, (FField is TWideMemoField){$ENDIF}); + {$ENDIF} + Inc(FPosition, Result); + end; + end; +end; + +{$IFDEF CLR} +function TBlobStream.Write(const Buffer: TBytes; Offset, Count: Longint): Longint; +var + Handle: IntPtr; +{$ELSE} +function TBlobStream.Write(const Buffer; Count: Longint): Longint; +{$ENDIF} +begin + Result := 0; + if FOpened then begin + {$IFDEF CLR} + Handle := AllocGCHandle(Buffer, True); + try + FDataSet.Data.WriteBlob(FFieldNo, FBuffer, FPosition, Count, + GetAddrOfPinnedObject(Handle){$IFDEF VER10P}, FField is TWideMemoField{$ENDIF}); + finally + FreeGCHandle(Handle); + end; + + {$ELSE} + FDataSet.Data.WriteBlob(FFieldNo, FBuffer, FPosition, Count, @Buffer + {$IFDEF VER10P}, FField is TWideMemoField{$ENDIF}); + {$ENDIF} + Inc(FPosition, Count); + Result := Count; + FModified := True; +{ FDataSet.SetBlobData(FField, FBuffer, '');} + end; +end; + +{$IFDEF CLR} +function TBlobStream.Seek(const Offset: Int64; Origin: TSeekOrigin): Int64; +{$ELSE} +function TBlobStream.Seek(Offset: Longint; Origin: Word): Longint; +{$ENDIF} +begin + case Origin of + soFromBeginning: + FPosition := Offset; + soFromCurrent: + Inc(FPosition, Offset); + soFromEnd: + FPosition := GetBlobSize + Offset; + end; + Result := FPosition; +end; + +procedure TBlobStream.Truncate; +begin + if FOpened then begin + FDataSet.Data.TruncateBlob(FFieldNo, FBuffer, FPosition + {$IFDEF VER10P}, FField is TWideMemoField{$ENDIF}); + FModified := True; +// FDataSet.SetBlobData(FField, FBuffer, ''); + end; +end; + +function TBlobStream.GetBlobSize: longint; +begin + Result := 0; + if FOpened then + Result := FDataSet.Data.GetBlobSize(FFieldNo, FBuffer, (FDataSet.State = dsOldValue) + {$IFDEF VER10P}, FField is TWideMemoField{$ENDIF}); +end; + +{$IFDEF CLR} +procedure TBlobStream.SetSize(NewSize: Int64); +{$ELSE} +procedure TBlobStream.SetSize(NewSize: Longint); +{$ENDIF} +begin + if FOpened then + FDataSet.Data.SetBlobSize(FFieldNo, FBuffer, NewSize, (FDataSet.State = dsOldValue) + {$IFDEF VER10P}, (FField is TWideMemoField){$ENDIF}); +end; + +class function TMemDSUtils.SetBlob(Obj: TMemDataSet; Field: TField; Blob: TBlob): boolean; +begin + Result := Obj.SetBlob(Field, Blob); +end; + +class function TMemDSUtils.GetBlob(Obj: TMemDataSet; FieldDesc: TFieldDesc): TBlob; +begin + Result := Obj.InternalGetBlob(FieldDesc); +end; + +end. diff --git a/internal/4.10.0.10/1/Source/MemData.pas b/internal/4.10.0.10/1/Source/MemData.pas new file mode 100644 index 0000000..305efe4 --- /dev/null +++ b/internal/4.10.0.10/1/Source/MemData.pas @@ -0,0 +1,9028 @@ + +////////////////////////////////////////////////// +// DB Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +// Mem Data +// Created: 20.02.98 +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I Dac.inc} + +unit MemData; +{$ENDIF} +interface +uses + Classes, CRParser, MemUtils, SyncObjs, +{$IFDEF MSWINDOWS} + Windows, +{$ENDIF} +{$IFDEF VER6P} + FMTBcd, Variants, +{$ENDIF} +{$IFDEF CLR} + System.Runtime.InteropServices, System.Text; +{$ELSE} + CLRClasses; +{$ENDIF} + +const + btSign = $DD; // DEBUG + flUsed = $EE; + flFree = $DD; + + FlatBufferLimit = 32; + +{ internal data types } + +{ ! can't modify this consts } + + dtUnknown = 0; + dtString = 1; + + dtInt8 = 2; + dtInt16 = 3; + dtSmallint = dtInt16; + dtInt32 = 4; + + dtInteger = dtInt32; + dtFloat = 5; + dtDate = 6; // Date only + dtTime = 7; // Time only + dtDateTime = 8; // Date and time + dtUInt16 = 9; + dtWord = dtUInt16; + dtBoolean = 10; + dtInt64 = 11; + dtLargeint = dtInt64; + dtCurrency = 12; + dtBlob = 13; + dtMemo = 14; + dtObject = 15; + dtReference = 16; + dtArray = 17; + dtTable = 18; + +{$IFDEF VER5P} + dtVariant = 19; +{$ENDIF} + dtExtString = 20; + dtBytes = 21; + dtVarBytes = 22; /// Cannot be deleted because "Fixed" flag not avaible on component level (MSAccess) GetFieldType(DataType: word): TFieldType + dtExtVarBytes = 23; + + dtUInt32 = 24; + dtLongword = dtUInt32; + + dtWideString = 25; + dtExtWideString = 26; + + dtBCD = 27; +{$IFDEF VER6P} + dtFMTBCD = 28; +{$ENDIF} + dtGuid = 29; + dtWideMemo = 30; //This type corectly supported only in BDS 2006 and higher + +{ StringHeap const } + +const + BlockSize = 16384; + SmallSize = 2000; + Align = 8; + RefNull = 101; + +{$IFNDEF CLR} +{$IFDEF VER6P} + SizeOfTBcd = SizeOf(TBcd); +{$ENDIF} +{$ENDIF} + +type + TDataType = word; + + TDANumericType = (ntFloat, ntBCD{$IFDEF VER6P}, ntFmtBCD{$ENDIF}); + + //Note that TConnLostCause should be ordered by FailOver priority + //e.g. there are multyple DataSet.ApplyUpdates during Connection.ApplyUpdates so Connection.ApplyUpdates is more + //prioritized operation than DataSet.ApplyUpdates and should be reexecuted instead of DataSet.ApplyUpdates in case of + //failover + TConnLostCause = (clUnknown, //Connection lost reason - unknown + clExecute, //Connection Lost detected during SQL execution (Reconnect with exception possible) + clOpen, //Connection Lost detected during query opening (Reconnect/Reexecute possible) + clRefresh, //Connection Lost detected during query opening (Reconnect/Reexecute possible) + clApply, //Connection Lost detected during DataSet.ApplyUpdates (Reconnect/Reexecute possible) + clServiceQuery, //Connection Lost detected during service information request (Reconnect/Reexecute possible) + clTransStart, //Connection Lost detected during transaction start (Reconnect/Reexecute possible) + //In IBDAC one connection could start several transactions during ApplyUpdates that's why + //clTransStart has less priority then clConnectionApply + clConnectionApply, //Connection Lost detected during Connection.ApplyUpdates (Reconnect/Reexecute possible) + clConnect //Connection Lost detected during connection establishing (Reconnect possible) + ); + +{ TBlockManager } + +{$IFDEF CLR} + PBlockHeader = packed record + private + Ptr: IntPtr; + + function GetItemCount: word; + procedure SetItemCount(Value: word); + function GetUsedItems: word; + procedure SetUsedItems(Value: word); + function GetPrev: PBlockHeader; + procedure SetPrev(Value: PBlockHeader); + function GetNext: PBlockHeader; + procedure SetNext(Value: PBlockHeader); + + public + property ItemCount: word read GetItemCount write SetItemCount; + property UsedItems: word read GetUsedItems write SetUsedItems; + property Prev: PBlockHeader read GetPrev write SetPrev; + property Next: PBlockHeader read GetNext write SetNext; + + class operator Implicit(AValue: IntPtr): PBlockHeader; + class operator Implicit(AValue: PBlockHeader): IntPtr; + class operator Implicit(AValue: PBlockHeader): integer; + class operator Equal(ALeft, ARight: PBlockHeader): boolean; + end; +{$ELSE} + PBlockHeader = ^TBlockHeader; +{$ENDIF} + TBlockHeader = packed record + ItemCount: word; + UsedItems: word; + Prev: PBlockHeader; + Next: PBlockHeader; + Test: byte; // DEBUG + end; + + TItemStatus = (isUnmodified, isUpdated, isAppended, isDeleted); + TItemTypes = set of TItemStatus; + TUpdateRecAction = (urFail, urAbort, urSkip, urRetry, urApplied, urNone, urSuspended); + TItemFilterState = (fsNotChecked, fsNotOmitted, fsOmitted); + +{$IFDEF CLR} + PItemHeader = packed record + private + Ptr: IntPtr; + + function GetBlock: PBlockHeader; + procedure SetBlock(Value: PBlockHeader); + function GetPrev: PItemHeader; + procedure SetPrev(Value: PItemHeader); + function GetNext: PItemHeader; + procedure SetNext(Value: PItemHeader); + function GetRollback: PItemHeader; + procedure SetRollback(Value: PItemHeader); + function GetStatus: TItemStatus; + procedure SetStatus(Value: TItemStatus); + function GetUpdateResult: TUpdateRecAction; + procedure SetUpdateResult(Value: TUpdateRecAction); + function GetOrder: longint; + procedure SetOrder(Value: longint); + function GetFlag: byte; + procedure SetFlag(Value: byte); + function GetFilterResult: TItemFilterState; + procedure SetFilterResult(Value: TItemFilterState); + public + property Block: PBlockHeader read GetBlock write SetBlock; + property Prev: PItemHeader read GetPrev write SetPrev; + property Next: PItemHeader read GetNext write SetNext; + property Rollback: PItemHeader read GetRollback write SetRollback; + property Status: TItemStatus read GetStatus write SetStatus; + property UpdateResult: TUpdateRecAction read GetUpdateResult write SetUpdateResult; + property Order: longint read GetOrder write SetOrder; + property Flag: byte read GetFlag write SetFlag; + property FilterResult: TItemFilterState read GetFilterResult write SetFilterResult; + + class operator Implicit(AValue: IntPtr): PItemHeader; + class operator Implicit(AValue: PItemHeader): IntPtr; + class operator Implicit(AValue: PItemHeader): integer; + class operator Equal(ALeft, ARight: PItemHeader): boolean; + end; +{$ELSE} + PItemHeader = ^TItemHeader; +{$ENDIF} + TItemHeader = packed record + Block: PBlockHeader; + Prev: PItemHeader; + Next: PItemHeader; + Rollback: PItemHeader; + Status: TItemStatus; + UpdateResult: TUpdateRecAction; + Order: longint; + Flag: byte; + FilterResult: TItemFilterState; + AlignByte: byte; // (SizeOf(TBlockHeader) + SizeOf(TItemHeader)) mod 2 = 0 + end; // (RecordSize + SizeOf(TItemHeader)) mod 2 = 0 + + TBlockManager = class + private + {$IFDEF CLR} + FHeap: THandle; + {$ENDIF} + + public + FirstFree: PItemHeader; + FirstBlock: PBlockHeader; + RecordSize: longint; + DefaultItemCount: word; + + constructor Create; + destructor Destroy; override; + + procedure AllocBlock(var Block: PBlockHeader; ItemCount: word); + procedure FreeBlock(Block: PBlockHeader); + + procedure AddFreeBlock; + procedure FreeAllBlock; + + procedure AllocItem(var Item: PItemHeader); + procedure FreeItem(Item: PItemHeader); + procedure InitItem(Item: PItemHeader); + + procedure PutRecord(Item: PItemHeader; Rec: IntPtr); + procedure GetRecord(Item: PItemHeader; Rec: IntPtr); + function GetRecordPtr(Item: PItemHeader): IntPtr; + + procedure CopyRecord(ItemSrc: PItemHeader; ItemDest: PItemHeader); + end; + +{ TStringHeap } + +{$IFDEF CLR} + PBlock = packed record + private + Ptr: IntPtr; + + function GetNext: PBlock; + procedure SetNext(Value: PBlock); + public + property Next: PBlock read GetNext write SetNext; + + class operator Implicit(AValue: IntPtr): PBlock; + class operator Implicit(AValue: PBlock): IntPtr; + end; +{$ELSE} + PBlock = ^TBlock; +{$ENDIF} + TStrData = array [0..BlockSize - 5 {SizeOf(PBlock) - 1}] of char; + TBlock = packed record + Next: PBlock; + Data: TStrData; + end; + + TSmallTab = array [1..SmallSize div Align] of IntPtr; + +const + SizeOf_TStrData = BlockSize - 4; + SizeOf_TBlock = SizeOf_TStrData + 4; + SizeOf_TSmallTab = SmallSize div Align * 4; + +type + TStringHeap = class + private + FSmallTab: TSmallTab; + FFree: integer; + FRoot: PBlock; + FEmpty: boolean; + FSysGetMem: boolean; + {$IFDEF WIN32} + FUseSysMemSize: boolean; + {$ENDIF} + FThreadSafety: boolean; + FThreadSafetyCS: TCriticalSection; + procedure SetThreadSafety(const Value: boolean); + function UseSmallTabs(divSize: integer): boolean; + public + constructor Create; + destructor Destroy; override; + function NewBuf(Size: integer): IntPtr; + function AllocStr(Str: IntPtr; Trim: boolean = false; Len: integer = -1): IntPtr; + function AllocWideStr(Str: IntPtr; Trim: boolean = false; Len: integer = -1): IntPtr; + function ReAllocStr(Str: IntPtr; Trim: boolean = false): IntPtr; + function ReAllocWideStr(Str: IntPtr; Trim: boolean = false): IntPtr; + procedure DisposeBuf(Buf: IntPtr); + procedure AddRef(Buf: IntPtr); + procedure Clear; + property Empty: boolean read FEmpty; + property SysGetMem: boolean read FSysGetMem; + property ThreadSafety: boolean read FThreadSafety write SetThreadSafety; + end; + +{ TFieldDesc } + + TFieldTypeSet = set of byte; + + TDateFormat = (dfMSecs, dfDateTime, dfTime, dfDate); + + TFieldDescKind = (fdkData, fdkCached, fdkCalculated); + + TObjectType = class; + + TFieldDesc = class + protected + FName: string; // unique name in TData + FActualName: string; // original name from source + FDataType: word; + FSubDataType: word; + FLength: word; // precision for number + FScale: word; + FFieldNo: word; + FActualFieldNo: word; + FSize: word; // size in rec buffer + FOffset: longint; // offset in rec buffer + FDataOffset: longint;// offset in storage structure + FRequired: boolean; + FReadOnly: boolean; + FIsKey: boolean; + FFixed: boolean; // indicates that the string field has a fixed size + FHidden: boolean; + FObjectType: TObjectType; + FParentField: TFieldDesc; + FHiddenObject: boolean; // for hide Object field (child field is visible) + FHandle: IntPtr; // pointer to field specific data + FReserved: boolean; // reserved flag for perfomance optimization + FFieldDescKind: TFieldDescKind; + + procedure SetObjectType(Value: TObjectType); + + public + constructor Create; virtual; + destructor Destroy; override; + + function HasParent: boolean; + + procedure Assign(FieldDesc: TFieldDesc); + + property Name: string read FName write FName; + property ActualName: string read FActualName write FActualName ; + property DataType: word read FDataType write FDataType; + property SubDataType: word read FSubDataType write FSubDataType; + property Length: word read FLength write FLength; + property Scale: word read FScale write FScale; + property FieldNo: word read FFieldNo write FFieldNo; + property ActualFieldNo: word read FActualFieldNo write FActualFieldNo; // for define + property Size: word read FSize write FSize; + property Offset: longint read FOffset write FOffset; + property DataOffset: longint read FDataOffset write FDataOffset; + property Required: boolean read FRequired write FRequired; + property ReadOnly: boolean read FReadOnly write FReadOnly; + property IsKey: boolean read FIsKey write FIsKey; + property Fixed: boolean read FFixed write FFixed; + property Hidden: boolean read FHidden write FHidden; + property ObjectType: TObjectType read FObjectType write SetObjectType; + property ParentField: TFieldDesc read FParentField write FParentField; + property HiddenObject: boolean read FHiddenObject write FHiddenObject; // IncludeObject + property Handle: IntPtr read FHandle write FHandle; + property FieldDescKind: TFieldDescKind read FFieldDescKind write FFieldDescKind; + end; + + TFieldDescClass = class of TFieldDesc; + + TFieldDescs = class (TDAList) + private + function GetItems(Index: integer): TFieldDesc; + + public + destructor Destroy; override; + + procedure Clear; override; + + function FindField(Name: string): TFieldDesc; + function FieldByName(Name: string): TFieldDesc; + + property Items[Index: integer]: TFieldDesc read GetItems; default; + end; + +{ TSharedObject } + + TSharedObject = class + protected + FRefCount: integer; + FGCHandle: IntPtr; + + function GetGCHandle: IntPtr; + + public + constructor Create; + destructor Destroy; override; + procedure Free; + + procedure CheckValid; + + procedure AddRef; + procedure Release; + {$IFNDEF CLR} + function GetHashCode: integer; + {$ENDIF} + + property RefCount: integer read FRefCount; + property GCHandle: IntPtr read GetGCHandle; + end; + +{ TObjectType } + + TAttribute = class + private + FName: string; + FDataType: word; + FLength: word; + FScale: word; + FSize: word; // size of got data + FDataSize: word; // size of stored data + FOffset: word; // stored offset + FIndicatorOffset: word; // indicator offset + FAttributeNo: word; + FObjectType: TObjectType; + FOwner: TObjectType; + FFixed: boolean; + + procedure SetObjectType(Value: TObjectType); + + public + constructor Create; + destructor Destroy; override; + + property Name: string read FName write FName; + property DataType: word read FDataType write FDataType; + property Fixed: boolean read FFixed write FFixed; + property Length: word read FLength write FLength; + property Scale: word read FScale write FScale; + property Size: word read FSize write FSize; + property DataSize: word read FDataSize write FDataSize; + property Offset: word read FOffset write FOffset; + property IndicatorOffset: word read FIndicatorOffset write FIndicatorOffset; + property AttributeNo: word read FAttributeNo write FAttributeNo; + property ObjectType: TObjectType read FObjectType write SetObjectType; + property Owner: TObjectType read FOwner write FOwner; + end; + + TObjectType = class (TSharedObject) + private + function GetAttributes(Index: integer): TAttribute; + function GetAttributeCount: integer; + + protected + FName: string; + FDataType: word; + FSize: integer; + FAttributes: TDAList; + + protected + procedure ClearAttributes; + + public + constructor Create; + destructor Destroy; override; + + function FindAttribute(Name: string): TAttribute; + function AttributeByName(Name: string): TAttribute; + + property Name: string read FName; + property DataType: word read FDataType; + property Size: integer read FSize; + property AttributeCount: integer read GetAttributeCount; + + property Attributes[Index: integer]: TAttribute read GetAttributes; + end; + + TDBObject = class (TSharedObject) + private + FObjectType: TObjectType; + + protected + procedure SetObjectType(Value: TObjectType); + + procedure GetAttributeValue(Name: string; Dest: IntPtr; var IsBlank: boolean); virtual; + procedure SetAttributeValue(Name: string; Source: IntPtr); virtual; + + public + constructor Create; + + property ObjectType: TObjectType read FObjectType; + end; + + TCacheItem = class + Item: PItemHeader; + Next: TCacheItem; + end; + +{$IFDEF CLR} + PRecBookmark = packed record + private + Ptr: IntPtr; + + function GetRefreshIteration: longint; + procedure SetRefreshIteration(Value: longint); + function GetItem: PItemHeader; + procedure SetItem(Value: PItemHeader); + function GetOrder: longint; + procedure SetOrder(Value: longint); + + public + property RefreshIteration: longint read GetRefreshIteration write SetRefreshIteration; + property Item: PItemHeader read GetItem write SetItem; + property Order: longint read GetOrder write SetOrder; + + class operator Implicit(AValue: IntPtr): PRecBookmark; + class operator Implicit(AValue: PRecBookmark): IntPtr; + class operator Implicit(AValue: integer): PRecBookmark; + end; +{$ELSE} + PRecBookmark = ^TRecBookmark; +{$ENDIF} + TRecBookmark = record + RefreshIteration: longint; + Item: PItemHeader; + Order: longint + end; + + TFilterFunc = function(RecBuf: IntPtr): boolean of object; + + TBoolParser = class (TParser) + protected + procedure ToRightQuote(LeftQuote: Char); override; + public + constructor Create(const Text: string); override; + end; + + TExpressionType = (ntEqual,ntMore,ntLess,ntMoreEqual,ntLessEqual,ntNoEqual, + ntAnd,ntOr,ntNot,ntField,ntValue,ntTrue,ntFalse,ntLike); + + TExpressionNode = class + NextAlloc: TExpressionNode; + NodeType: TExpressionType; + LeftOperand: TExpressionNode; + RightOperand: TExpressionNode; + NextOperand: TExpressionNode; + FieldDesc: TFieldDesc; // used only when TExpressionType = ntField + Value: variant; + end; + + TBlob = class; + +{ TData } + + TUpdateRecKind = (ukUpdate, ukInsert, ukDelete); + TOnModifyRecord = procedure of object; + TOnApplyRecord = procedure (UpdateKind: TUpdateRecKind; var Action: TUpdateRecAction; LastItem: boolean) of object; + + TOnGetCachedFields = procedure of object; + TOnGetCachedBuffer = procedure(Buffer: IntPtr; Source: IntPtr = nil) of object; + + TData = class + private + FRecordSize: longint; // FDataSize + TIndicatorSize + FCalcRecordSize: longint; + FCachedUpdates: boolean; + FOnAppend: TOnModifyRecord; + FOnDelete: TOnModifyRecord; + FOnUpdate: TOnModifyRecord; + FOnApplyRecord: TOnApplyRecord; + FAutoInitFields: boolean; // initialization fields by InternalInitField + FTrimFixedChar: boolean; + FTrimVarChar: boolean; + + { Filter } + FFilterFunc: TFilterFunc; + FFilterMDFunc: TFilterFunc; + FFilterText: string; + FFilterCaseInsensitive: boolean; + FFilterNoPartialCompare: boolean; + FFilterItemTypes: TItemTypes; + + Parser: TBoolParser; + Code: integer; + StrLexem: string; + FilterExpression: TExpressionNode; + FirstAlloc: TExpressionNode; + FilterRecBuf: IntPtr; + + /// if False then PutField set Null for string fields with empty value ('') + FEnableEmptyStrings: boolean; + FHasComplexFields: boolean; + FSparseArrays: boolean; + + FOnGetCachedFields: TOnGetCachedFields; + FOnGetCachedBuffer: TOnGetCachedBuffer; + + procedure FilterError; + function AllocNode: TExpressionNode; + function OrExpr: TExpressionNode; + function AndExpr: TExpressionNode; + function Condition: TExpressionNode; + function Argument: TExpressionNode; + + procedure CreateFilterExpression(Text: string); + procedure FreeFilterExpression; + + function Eval(Node: TExpressionNode): boolean; + + function GetFieldCount: word; + procedure SetCachedUpdates(Value: boolean); + protected + FRecordNoOffset: integer; + + FRecordCount: longint; + FBOF: boolean; + FEOF: boolean; + DataSize: longint; // size of data + CalcDataSize: longint; + + FFields: TFieldDescs; + + StringHeap: TStringHeap; + + { Open/Close } + procedure InternalPrepare; virtual; + procedure InternalUnPrepare; virtual; + procedure InternalOpen; virtual; + procedure InternalClose; virtual; + + { Data } + procedure InitData; virtual; + procedure FreeData; virtual; + + { Fields } + procedure InternalInitFields; virtual; + procedure InitObjectFields(ObjectType: TObjectType; Parent: TFieldDesc); + function InternalGetObject(FieldNo: word; RecBuf: IntPtr): TSharedObject; + function GetArrayFieldName(ObjectType: TObjectType; ItemIndex: integer): string; virtual; + + function GetIndicatorSize: word; virtual; + + procedure GetChildFieldInfo(Field: TFieldDesc; var RootField: TFieldDesc; var AttrName: string); + procedure GetChildField(Field: TFieldDesc; RecBuf: IntPtr; Dest: IntPtr; var IsBlank: boolean); + procedure PutChildField(Field: TFieldDesc; RecBuf: IntPtr; Source: IntPtr); + + function NeedConvertEOL: boolean; virtual; + + { Records } + + { Navigation } + function GetEOF: boolean; virtual; + function GetBOF: boolean; virtual; + + function GetRecordCount: longint; virtual; + function GetRecordNo: longint; virtual; + procedure SetRecordNo(Value: longint); virtual; + + { Edit } + procedure InternalAppend(RecBuf: IntPtr); virtual; + procedure InternalDelete; virtual; + procedure InternalUpdate(RecBuf: IntPtr); virtual; + + property IndicatorSize: word read GetIndicatorSize; + + { Filter } + function Filtered: boolean; + procedure SetFilterText(Value: string); virtual; + + { CachedUpdates } + function GetUpdatesPending: boolean; virtual; + procedure SetFilterItemTypes(Value: TItemTypes); virtual; + + public + Active: boolean; + Prepared: boolean; + NewCacheRecBuf: IntPtr; + OldCacheRecBuf: IntPtr; + + property FieldCount: word read GetFieldCount; + property Fields: TFieldDescs read FFields; + property Bof: boolean read GetBOF; // EOF: for CB case sensivity + property Eof: boolean read GetEOF; + + constructor Create; + destructor Destroy; override; + + { Open/Close } + procedure Open; virtual; + procedure Close; virtual; + + procedure Prepare; virtual; + procedure UnPrepare; virtual; + + function IsFullReopen: boolean; virtual; + procedure Reopen; virtual; + + { Fields } + function GetFieldDescType: TFieldDescClass; virtual; + procedure InitFields; virtual; + procedure ClearFields; virtual; + procedure GetField(FieldNo: word; RecBuf: IntPtr; Dest: IntPtr; var IsBlank: boolean); + procedure GetFieldData(Field: TFieldDesc; RecBuf: IntPtr; Dest: IntPtr); virtual; + function GetFieldBuf(RecBuf: IntPtr; FieldDesc: TFieldDesc; var DataType: integer; var IsBlank, NativeBuffer: boolean): IntPtr; + procedure PutField(FieldNo: word; RecBuf: IntPtr; Source: IntPtr); + procedure PutFieldData(Field: TFieldDesc; RecBuf: IntPtr; Source: IntPtr); virtual; + function GetNull(FieldNo: word; RecBuf: IntPtr): boolean; virtual; + procedure SetNull(FieldNo: word; RecBuf: IntPtr; Value: boolean); virtual; + function GetNullByBlob(FieldNo: word; RecBuf: IntPtr): boolean; + + procedure GetFieldAsVariant(FieldNo: word; RecBuf: IntPtr; var Value: variant); virtual; + procedure PutFieldAsVariant(FieldNo: word; RecBuf: IntPtr; const Value: variant); virtual; + + procedure GetDateFromBuf(Buf: IntPtr; Offset: integer; Date: IntPtr; Format: TDateFormat); virtual; + procedure PutDateToBuf(Buf: IntPtr; Offset: integer; Date: IntPtr; Format: TDateFormat); virtual; + + function FindField(Name: string): TFieldDesc; + function FieldByName(Name: string): TFieldDesc; + + function IsBlobFieldType(DataType: word): boolean; virtual; // TBlob descendants - dtBlob, dtMemo etc + function IsComplexFieldType(DataType: word): boolean; virtual; // All supported complex field types (BlobFieldTypes, ExtFieldTypes and TSharedObject descendants (not BLOB)) + + function HasFields(FieldTypes: TFieldTypeSet): boolean; + function HasBlobFields: boolean; + function CheckHasComplexFields: boolean; + + { Records } + function AllocRecBuf(var RecBuf: IntPtr): IntPtr; + procedure FreeRecBuf(RecBuf: IntPtr); + + procedure InitRecord(RecBuf: IntPtr); + //procedure FreeRecord(RecBuf: pointer); + procedure GetRecord(RecBuf: IntPtr); virtual; abstract; + procedure GetNextRecord(RecBuf: IntPtr); virtual; abstract; + procedure GetPriorRecord(RecBuf: IntPtr); virtual; abstract; + procedure PutRecord(RecBuf: IntPtr); virtual; abstract; + procedure AppendRecord(RecBuf: IntPtr); virtual; abstract; + procedure AppendBlankRecord; + procedure InsertRecord(RecBuf: IntPtr); virtual; abstract; + procedure UpdateRecord(RecBuf: IntPtr); virtual; abstract; // Modify + procedure DeleteRecord; virtual; abstract; + + procedure EditRecord(RecBuf: IntPtr); + procedure PostRecord(RecBuf: IntPtr); + procedure CancelRecord(RecBuf: IntPtr); virtual; + + procedure CreateComplexFields(RecBuf: IntPtr; WithBlob: boolean); virtual; + procedure CreateComplexField(RecBuf: IntPtr; FieldIndex: integer; WithBlob: boolean); virtual; + procedure FreeComplexFields(RecBuf: IntPtr; WithBlob: boolean); virtual; + procedure CopyComplexFields(Source: IntPtr; Dest: IntPtr; WithBlob: boolean); virtual; // copy content ComplexFields + procedure AddRefComplexFields(RecBuf: IntPtr); virtual; + + { Navigation } + procedure SetToBegin; virtual; + procedure SetToEnd; virtual; + + { BookMarks } + procedure GetBookmark(Bookmark: PRecBookmark); virtual; + procedure SetToBookmark(Bookmark: PRecBookmark); virtual; + function BookmarkValid(Bookmark: PRecBookmark): boolean; virtual; + function CompareBookmarks(Bookmark1, Bookmark2: PRecBookmark): integer; virtual; + + { CachedUpdates } + function GetUpdateStatus: TItemStatus; virtual; + function GetUpdateResult: TUpdateRecAction; virtual; + + procedure SetCacheRecBuf(NewBuf: IntPtr; OldBuf: IntPtr); virtual; + procedure ApplyUpdates; virtual; + procedure CommitUpdates; virtual; + procedure CancelUpdates; virtual; + procedure RestoreUpdates; virtual; + procedure RevertRecord; virtual; + + procedure ApplyRecord(UpdateKind: TUpdateRecKind; var Action: TUpdateRecAction; LastItem: boolean); virtual; + + procedure GetOldRecord(RecBuf: IntPtr); virtual; // get rollback data + + { Filter } + procedure FilterUpdated; virtual; + + { Blobs } + function GetObject(FieldNo: word; RecBuf: IntPtr): TSharedObject; + procedure SetObject(FieldNo: word; RecBuf: IntPtr; Obj: TSharedObject); + function ReadBlob(FieldNo: word; RecBuf: IntPtr; Position: longint; + Count: longint; Dest: IntPtr; FromRollback: boolean = false; TrueUnicode: boolean = False): longint; + procedure WriteBlob(FieldNo: word; RecBuf: IntPtr; Position: longint; + Count: longint; Source: IntPtr; TrueUnicode: boolean = False); + procedure TruncateBlob(FieldNo: word; RecBuf: IntPtr; Size: longint; + TrueUnicode: boolean = False); + function GetBlobSize(FieldNo: word; RecBuf: IntPtr; FromRollback: boolean = false; + TrueUnicode: boolean = False): longint; + procedure SetBlobSize(FieldNo: word; RecBuf: IntPtr; NewSize: longint; FromRollback: boolean = false; + TrueUnicode: boolean = False); + + property RecordSize: longint read FRecordSize; + property CalcRecordSize: longint read FCalcRecordSize; + property RecordCount: longint read GetRecordCount;//FRecordCount; + property RecordNo: longint read GetRecordNo write SetRecordNo; + property CachedUpdates: boolean read FCachedUpdates write SetCachedUpdates default False; + property UpdatesPending: boolean read GetUpdatesPending; + property FilterFunc: TFilterFunc read FFilterFunc write FFilterFunc; + property FilterMDFunc: TFilterFunc read FFilterMDFunc write FFilterMDFunc; + property FilterText: string read FFilterText write SetFilterText; + property FilterCaseInsensitive: boolean read FFilterCaseInsensitive write FFilterCaseInsensitive; + property FilterNoPartialCompare: boolean read FFilterNoPartialCompare write FFilterNoPartialCompare; + property FilterItemTypes: TItemTypes read FFilterItemTypes write SetFilterItemTypes; + property AutoInitFields: boolean read FAutoInitFields write FAutoInitFields; + property TrimFixedChar: boolean read FTrimFixedChar write FTrimFixedChar; + property TrimVarChar: boolean read FTrimVarChar write FTrimVarChar; + + /// if False then PutField set Null for string fields with empty value ('') + property EnableEmptyStrings: boolean read FEnableEmptyStrings write FEnableEmptyStrings; + property SparseArrays: boolean read FSparseArrays write FSparseArrays; + + property OnAppend: TOnModifyRecord read FOnAppend write FOnAppend; + property OnDelete: TOnModifyRecord write FOnDelete; + property OnUpdate: TOnModifyRecord write FOnUpdate; + property OnApplyRecord: TOnApplyRecord write FOnApplyRecord; + property OnGetCachedFields: TOnGetCachedFields write FOnGetCachedFields; + property OnGetCachedBuffer: TOnGetCachedBuffer write FOnGetCachedBuffer; + property HasComplexFields: boolean read FHasComplexFields write FHasComplexFields; + end; + + TReorderOption = (roInsert,roDelete,roFull); + + TSortColumn = class + public + FieldDesc: TFieldDesc; + DescendingOrder: boolean; + CaseSensitive: boolean; + end; + + TSortColumns = class (TDAList) + private + function GetItems(Index: integer): TSortColumn; + + public + destructor Destroy; override; + + procedure Clear; override; + + property Items[Index: integer]: TSortColumn read GetItems; default; + end; + + TRecordNoCache = array of PItemHeader; + + TLocateExOption = (lxCaseInsensitive, lxPartialKey, lxNearest, lxNext, lxUp, lxPartialCompare{,lxCharCompare}); + TLocateExOptions = set of TLocateExOption; + + TMemData = class (TData) + private + Cache: TCacheItem; + LastCacheItem: TCacheItem; + FRefreshIteration: longint; + FIndexFieldNames: string; + FIndexFields: TSortColumns; + + FRecordNoCache: TRecordNoCache; + + { Sorting } + procedure UpdateIndexFields; + function CompareRecords(RecBuf1, RecBuf2: IntPtr): integer; + procedure Exchange(I, J: PItemHeader); + procedure MoveSortedRecord(Dir: integer); + procedure QuickSort(L, R, P: PItemHeader); + procedure ClearItemsOmittedStatus; + protected + FirstItem: PItemHeader; + LastItem: PItemHeader; + CurrentItem: PItemHeader; + + BlockMan: TBlockManager; + + { Items/Data } + function InsertItem: PItemHeader; + function AppendItem: PItemHeader; + procedure DeleteItem(Item: PItemHeader); + procedure RevertItem(Item: PItemHeader); + + procedure InitData; override; + procedure FreeData; override; + + procedure ReorderItems(Item: PItemHeader; ReorderOption: TReorderOption); + + { Navigation } + function GetEOF: boolean; override; + function GetBOF: boolean; override; + + function GetRecordCount: longint; override; + function GetRecordNo: longint; override; + procedure SetRecordNo(Value: longint); override; + + { Fetch } + function Fetch(FetchBack: boolean = False): boolean; virtual; + procedure InitFetchedItems(FetchedItem: IntPtr; NoData, FetchBack: boolean); + + { Filter/Sorting } + {$IFNDEF CLR} + function InternalAnsiStrComp(const Value1, Value2: IntPtr; + const Options: TLocateExOptions): integer; virtual; + {$ENDIF} + function InternalAnsiCompareText(const Value1, Value2: string; + const Options: TLocateExOptions): integer; virtual; + function InternalWStrLComp(const Value1, Value2: WideString; + const Options: TLocateExOptions): integer; virtual; + function InternalWStrComp(const Value1, Value2: WideString; + const Options: TLocateExOptions): integer; virtual; + + function CompareStrValues(const Value: string; const FieldValue: string; const Options: TLocateExOptions): integer; virtual; + function CompareWideStrValues(const Value: WideString; const FieldValue: WideString; const Options: TLocateExOptions): integer; virtual; + function CompareBinValues(const Value: IntPtr; const ValueLen: integer; const FieldValue: IntPtr; const FieldValueLen: integer; const Options: TLocateExOptions): integer; + + { Edit } + procedure AddCacheItem(CacheItem: TCacheItem); + + { CachedUpdates } + function GetUpdatesPending: boolean; override; + procedure SetFilterItemTypes(Value: TItemTypes); override; + + public + constructor Create; + destructor Destroy; override; + + { Open/Close } + procedure Open; override; + procedure Reopen; override; + + { Fields } + procedure InitFields; override; + procedure ClearFields; override; + + { Records } + procedure GetRecord(RecBuf: IntPtr); override; + procedure GetNextRecord(RecBuf: IntPtr); override; + procedure GetPriorRecord(RecBuf: IntPtr); override; + procedure PutRecord(RecBuf: IntPtr); override; + procedure AppendRecord(RecBuf: IntPtr); override; + procedure InsertRecord(RecBuf: IntPtr); override; + procedure UpdateRecord(RecBuf: IntPtr); override; + procedure DeleteRecord; override; + procedure AddRecord(RecBuf: IntPtr); + procedure RemoveRecord; // remove record from memory + + + function OmitRecord(Item: PItemHeader): boolean; + procedure UpdateCachedBuffer(FItem, LItem: PItemHeader); // FItem and LItem can be nil. In this case FirstItem and LastItem used + + { Navigation } + procedure SetToBegin; override; + procedure SetToEnd; override; + procedure PrepareRecNoCache; + + { BookMarks } + procedure GetBookmark(Bookmark: PRecBookmark); override; + procedure SetToBookmark(Bookmark: PRecBookmark); override; + function BookmarkValid(Bookmark: PRecBookmark): boolean; override; + function CompareBookmarks(Bookmark1, Bookmark2: PRecBookmark): integer; override; + + { CachedUpdates } + function GetUpdateStatus: TItemStatus; override; + function GetUpdateResult: TUpdateRecAction; override; + + procedure SetCacheRecBuf(NewBuf: IntPtr; OldBuf: IntPtr); override; + procedure ApplyUpdates; override; + procedure CommitUpdates; override; + procedure CancelUpdates; override; + procedure RestoreUpdates; override; + procedure RevertRecord; override; + + procedure GetOldRecord(RecBuf: IntPtr); override; + + { Filter } + function CompareFieldValue(ValuePtr: IntPtr; const ValueType: integer; FieldDesc: TFieldDesc; RecBuf: IntPtr; const Options: TLocateExOptions): integer; virtual; + function CompareFields(RecBuf1: IntPtr; RecBuf2: IntPtr; SortColumn: TSortColumn): integer; overload; virtual; + function CompareFields(RecBuf1: IntPtr; RecBuf2: IntPtr; FieldDesc: TFieldDesc; Options: TLocateExOptions = []): integer; overload; virtual; + procedure FilterUpdated; override; + + { Sorting } + procedure SetIndexFieldNames(Value: string); virtual; + procedure SortItems; virtual; + + property IndexFields: TSortColumns read FIndexFields; + end; + +{ TBlob } + +{$IFDEF CLR} + PPieceHeader = packed record + private + Ptr: IntPtr; + + function GetBlob: integer; + procedure SetBlob(Value: integer); + function GetSize: cardinal; + procedure SetSize(Value: cardinal); + function GetUsed: cardinal; + procedure SetUsed(Value: cardinal); + function GetPrev: PPieceHeader; + procedure SetPrev(Value: PPieceHeader); + function GetNext: PPieceHeader; + procedure SetNext(Value: PPieceHeader); + + public + property Blob: integer read GetBlob write SetBlob; + property Size: cardinal read GetSize write SetSize; + property Used: cardinal read GetUsed write SetUsed; + property Prev: PPieceHeader read GetPrev write SetPrev; + property Next: PPieceHeader read GetNext write SetNext; + + class operator Implicit(AValue: IntPtr): PPieceHeader; + class operator Implicit(AValue: PPieceHeader): IntPtr; + class operator Implicit(AValue: PPieceHeader): integer; + class operator Equal(ALeft, ARight: PPieceHeader): boolean; + end; +{$ELSE} + PPieceHeader = ^TPieceHeader; +{$ENDIF} + TPieceHeader = packed record + Blob: integer; + Size: cardinal; + Used: cardinal; // offest 8 uses GetUsedPtr + Prev: PPieceHeader; + Next: PPieceHeader; + Test: word; // DEBUG + end; + + TBlob = class (TSharedObject) + protected + FIsUnicode: boolean; + + FFirstPiece: PPieceHeader; + FNeedRollback: boolean; + Rollback: TBlob; + + // Used to detect a need to write LOB parameters before executing statement + FModified: boolean; + + function GetAsString: string; virtual; + procedure SetAsString(Value: string); virtual; + + function GetAsWideString: WideString; virtual; + procedure SetAsWideString(Value: WideString); virtual; + + procedure AddCRUnicode; + procedure RemoveCRUnicode; + procedure AddCRString; + procedure RemoveCRString; + + procedure CheckValid; // DEBUG + procedure CheckCached; + + procedure CheckValue; virtual; + + procedure SaveToRollback; virtual; + + function GetDataSize: cardinal; // sum of pieces.used + function GetSize: cardinal; virtual; // if uncompressed then equal to GetDataSize else uncompressed size + procedure SetSize(Value: cardinal); virtual; + procedure SetIsUnicode(Value: boolean); virtual; + procedure InternalClear; + + { Unicode to Ansi conversion methods } + function TranslatePosition(Position: integer): integer; // Ansi to Unicode + function GetSizeAnsi: integer; + + public + PieceSize: cardinal; + Test: byte; // DEBUG + + constructor Create(IsUnicode: boolean = False); + destructor Destroy; override; + + { Pieces } + procedure AllocPiece(var Piece: PPieceHeader; Size: cardinal); + procedure ReallocPiece(var Piece: PPieceHeader; Size: cardinal); + procedure FreePiece(Piece: PPieceHeader); + procedure AppendPiece(Piece: PPieceHeader); + procedure DeletePiece(Piece: PPieceHeader); + procedure CompressPiece(var Piece: PPieceHeader); + + function FirstPiece: PPieceHeader; + + function Read(Position: cardinal; Count: cardinal; Dest: IntPtr): cardinal; virtual; + procedure Write(Position: cardinal; Count: cardinal; Source: IntPtr); virtual; + procedure Clear; virtual; + procedure Truncate(NewSize: cardinal); virtual; + procedure Compress; + procedure Defrag; virtual; // Move all data to first piece + procedure AddCR; + procedure RemoveCR; + + { Stream/File } + + procedure LoadFromStream(Stream: TStream); virtual; + procedure SaveToStream(Stream: TStream); virtual; + + procedure LoadFromFile(const FileName: string); + procedure SaveToFile(const FileName: string); + + procedure Assign(Source: TBlob); + + { Rollback } + procedure EnableRollback; + procedure Commit; virtual; + procedure Cancel; virtual; + function CanRollback: boolean; + + property Size: cardinal read GetSize write SetSize; + property AsString: string read GetAsString write SetAsString; + property AsWideString: WideString read GetAsWideString write SetAsWideString; + property IsUnicode: boolean read FIsUnicode write SetIsUnicode; + property Modified: boolean read FModified; + end; + +const +{$IFDEF CLR} + DefaultPieceSize: longint = 64*1024 - 22; +{$ELSE} + DefaultPieceSize: longint = 64*1024 - sizeof(TPieceHeader); +{$ENDIF} + +type + TBlobUtils = class + public + class procedure SetModified(Blob: TBlob; Value: boolean); + end; + +{$IFDEF HAVE_COMPRESS} + +{ TCompressedBlob } + +const + CCompressBlobHeaderGuidSize = 16; + CCompressBlobHeaderSize = CCompressBlobHeaderGuidSize{guid} + SizeOf(Integer){uncompressed size}; + CCompressBlobHeaderGuid: array [0..CCompressBlobHeaderGuidSize - 1] of byte = ($39, $8C, $9D, $F1, $58, $55, $49, $38, $A6, $52, $87, $CE, $E0, $C6, $DA, $7E); + +type + TCompressBlobMode = ( + cbNone, // uncompressed (default) + cbClient, // store compressed data on client. Save client memory. Other apps can read and write BLOBs on server + cbServer, // store compressed data on server. Save server memory. Other apps can NOT read and write BLOBs on server + cbClientServer // store compressed data on client and server. + ); + + TCompressedBlob = class(TBlob) + protected + function GetCompressed: boolean; + procedure SetCompressed(Value: boolean); + function UnCompressedSize: cardinal; + + function GetSize: cardinal; override; + procedure SetSize(Value: cardinal); override; + function GetCompressedSize: cardinal; + procedure SaveToRollback; override; + + function CompressFrom(source: IntPtr; const sourceLen: longint): boolean; + procedure UncompressTo(dest: IntPtr; var destlen: integer); + + public + function Read(Position: cardinal; Count: cardinal; Dest: IntPtr): cardinal; override; + procedure Write(Position: cardinal; Count: cardinal; Source: IntPtr); override; + procedure Truncate(NewSize: cardinal); override; + property Compressed: boolean read GetCompressed write SetCompressed; + property CompressedSize: cardinal read GetCompressedSize; + end; +{$ELSE} +type + TCompressedBlob = class(TBlob); +{$ENDIF} + +{ TVariantObject } + + TVariantObject = class (TSharedObject) + private + FValue: Variant; + + public + property Value: Variant read FValue write FValue; + end; + + function NextPiece(Piece: PPieceHeader): PPieceHeader; + function PieceData(Piece: PPieceHeader): IntPtr; + function PieceUsedPtr(Piece: PPieceHeader): IntPtr; + + procedure DataError(Msg: string); + +const + MaxArrayItem: integer = 100; // Max count of fields from array type + +{$IFDEF CRDEBUG} + ShareObjectCnt: integer = 0; +{$ENDIF} + + varDecimal = $000E; + varLongWord = $0013; +{$IFNDEF VER6P} + varInt64 = $0014; + +type + TVarDataD6 = packed record // TVarData from Delphi 6 + VType: word; + case Integer of + 0: (Reserved1: Word; + case Integer of + 0: (Reserved2, Reserved3: Word; + case Integer of + varLongWord: (VLongWord: LongWord); + varDecimal: (VInt64: Int64); + ); + ); + end; + +{$ENDIF} + +var + StartWaitProc: procedure; + StopWaitProc: procedure; + ApplicationTitleProc: function: string; +{$IFNDEF VER6P} + ApplicationHandleException: procedure (Sender: TObject) of object; +{$ENDIF} + +procedure StartWait; +procedure StopWait; +function ApplicationTitle: string; + +function AddCRString(Source, Dest: IntPtr; Count: integer): integer; overload; +function RemoveCRString(Source, Dest: IntPtr; DestLen, Count: integer): integer; overload; + +function AddCRUnicode(Source, Dest: IntPtr; Count: integer): integer; overload; +function RemoveCRUnicode(Source, Dest: IntPtr; DestLen, Count: integer): integer; overload; + +implementation +uses + DAConsts, SysUtils, Math; + +const + lxEqual = 1; + lxMore = lxEqual + 1; + lxLess = lxMore + 1; + lxMoreEqual = lxLess + 1; + lxLessEqual = lxMoreEqual + 1; + lxNoEqual = lxLessEqual + 1; + lxLeftBracket = lxNoEqual + 1; + lxRightBracket = lxLeftBracket + 1; + lxMinus = lxRightBracket + 1; + lxPlus = lxMinus + 1; + lxLeftSqBracket = lxPlus + 1; + lxRightSqBracket = lxLeftSqBracket + 1; + + lxAND = lxRightSqBracket + 1; + lxFALSE = lxAND + 1; + lxIS = lxFALSE + 1; + lxLIKE = lxIS + 1; + lxNOT = lxLIKE + 1; + lxNULL = lxNOT + 1; + lxOR = lxNULL + 1; + lxTRUE = lxOR + 1; + +var + BoolSymbolLexems, BoolKeywordLexems: TStringList; + RefreshIteration: longint; + +procedure DataError(Msg: string); +begin + raise Exception.Create(Msg); +end; + +procedure StartWait; +begin + if Assigned(StartWaitProc) then + StartWaitProc; +end; + +procedure StopWait; +begin + if Assigned(StopWaitProc) then + StopWaitProc; +end; + +function ApplicationTitle: string; +begin + if Assigned(ApplicationTitleProc) then + Result := ApplicationTitleProc + else + Result := ''; +end; + +{$IFDEF CLR} + +{ PBlockHeader } + +function PBlockHeader.GetItemCount: word; +begin + Result := Marshal.ReadInt16(Ptr); +end; + +procedure PBlockHeader.SetItemCount(Value: word); +begin + Marshal.WriteInt16(Ptr, Value); +end; + +function PBlockHeader.GetUsedItems: word; +begin + Result := Marshal.ReadInt16(Ptr, sizeof(word)); +end; + +procedure PBlockHeader.SetUsedItems(Value: word); +begin + Marshal.WriteInt16(Ptr, sizeof(word), Value); +end; + +function PBlockHeader.GetPrev: PBlockHeader; +begin + Result := Marshal.ReadIntPtr(Ptr, sizeof(word) * 2); +end; + +procedure PBlockHeader.SetPrev(Value: PBlockHeader); +begin + Marshal.WriteIntPtr(Ptr, sizeof(word) * 2, Value.Ptr); +end; + +function PBlockHeader.GetNext: PBlockHeader; +begin + Result := Marshal.ReadIntPtr(Ptr, sizeof(word) * 2 + sizeof(PBlockHeader)); +end; + +procedure PBlockHeader.SetNext(Value: PBlockHeader); +begin + Marshal.WriteIntPtr(Ptr, sizeof(word) * 2 + sizeof(PBlockHeader), Value.Ptr); +end; + +class operator PBlockHeader.Implicit(AValue: IntPtr): PBlockHeader; +begin + Result.Ptr := AValue; +end; + +class operator PBlockHeader.Implicit(AValue: PBlockHeader): IntPtr; +begin + Result := AValue.Ptr; +end; + +class operator PBlockHeader.Implicit(AValue: PBlockHeader): integer; +begin + Result := AValue.Ptr.ToInt32; +end; + +class operator PBlockHeader.Equal(ALeft, ARight: PBlockHeader): boolean; +begin + Result := ALeft.Ptr = ARight.Ptr; +end; + +{ PItemHeader } + +function PItemHeader.GetBlock: PBlockHeader; +begin + Result := Marshal.ReadIntPtr(Ptr); +end; + +procedure PItemHeader.SetBlock(Value: PBlockHeader); +begin + Marshal.WriteIntPtr(Ptr, Value.Ptr); +end; + +function PItemHeader.GetPrev: PItemHeader; +begin + Result := Marshal.ReadIntPtr(Ptr, sizeof(PBlockHeader)); +end; + +procedure PItemHeader.SetPrev(Value: PItemHeader); +begin + Marshal.WriteIntPtr(Ptr, sizeof(PBlockHeader), Value.Ptr); +end; + +function PItemHeader.GetNext: PItemHeader; +begin + Result := Marshal.ReadIntPtr(Ptr, sizeof(PBlockHeader) + sizeof(PItemHeader)); +end; + +procedure PItemHeader.SetNext(Value: PItemHeader); +begin + Marshal.WriteIntPtr(Ptr, sizeof(PBlockHeader) + sizeof(PItemHeader), Value.Ptr); +end; + +function PItemHeader.GetRollback: PItemHeader; +begin + Result := Marshal.ReadIntPtr(Ptr, sizeof(PBlockHeader) + sizeof(PItemHeader) * 2); +end; + +procedure PItemHeader.SetRollback(Value: PItemHeader); +begin + Marshal.WriteIntPtr(Ptr, sizeof(PBlockHeader) + sizeof(PItemHeader) * 2, Value.Ptr); +end; + +function PItemHeader.GetStatus: TItemStatus; +begin + Result := TItemStatus(Marshal.ReadByte(Ptr, sizeof(PBlockHeader) + sizeof(PItemHeader) * 3)); +end; + +procedure PItemHeader.SetStatus(Value: TItemStatus); +begin + Marshal.WriteByte(Ptr, sizeof(PBlockHeader) + sizeof(PItemHeader) * 3, byte(Value)); +end; + +function PItemHeader.GetUpdateResult: TUpdateRecAction; +begin + Result := TUpdateRecAction(Marshal.ReadByte(Ptr, sizeof(PBlockHeader) + + sizeof(PItemHeader) * 3 + sizeof(TItemStatus))); +end; + +procedure PItemHeader.SetUpdateResult(Value: TUpdateRecAction); +begin + Marshal.WriteByte(Ptr, sizeof(PBlockHeader) + sizeof(PItemHeader) * 3 + + sizeof(TItemStatus), byte(Value)); +end; + +function PItemHeader.GetOrder: longint; +begin + Result := Marshal.ReadInt32(Ptr, sizeof(PBlockHeader) + sizeof(PItemHeader) * 3 + + sizeof(TItemStatus) + sizeof(TUpdateRecAction)); +end; + +procedure PItemHeader.SetOrder(Value: longint); +begin + Marshal.WriteInt32(Ptr, sizeof(PBlockHeader) + sizeof(PItemHeader) * 3 + + sizeof(TItemStatus) + sizeof(TUpdateRecAction), Value); +end; + +function PItemHeader.GetFlag: byte; +begin + Result := Marshal.ReadByte(Ptr, sizeof(PBlockHeader) + sizeof(PItemHeader) * 3 + + sizeof(TItemStatus) + sizeof(TUpdateRecAction) + sizeof(longint)); +end; + +procedure PItemHeader.SetFlag(Value: byte); +begin + Marshal.WriteByte(Ptr, sizeof(PBlockHeader) + sizeof(PItemHeader) * 3 + + sizeof(TItemStatus) + sizeof(TUpdateRecAction) + sizeof(longint), Value); +end; + +function PItemHeader.GetFilterResult: TItemFilterState; +begin + Result := TItemFilterState(Marshal.ReadByte(Ptr, sizeof(PBlockHeader) + sizeof(PItemHeader) * 3 + + sizeof(TItemStatus) + sizeof(TUpdateRecAction) + sizeof(longint) + + SizeOf(byte))); +end; + +procedure PItemHeader.SetFilterResult(Value: TItemFilterState); +begin + Marshal.WriteByte(Ptr, sizeof(PBlockHeader) + sizeof(PItemHeader) * 3 + + sizeof(TItemStatus) + sizeof(TUpdateRecAction) + sizeof(longint) + + SizeOf(byte), Byte(Value)); +end; + +class operator PItemHeader.Implicit(AValue: IntPtr): PItemHeader; +begin + Result.Ptr := AValue; +end; + +class operator PItemHeader.Implicit(AValue: PItemHeader): IntPtr; +begin + Result := AValue.Ptr; +end; + +class operator PItemHeader.Implicit(AValue: PItemHeader): integer; +begin + Result := AValue.Ptr.ToInt32; +end; + +class operator PItemHeader.Equal(ALeft, ARight: PItemHeader): boolean; +begin + Result := ALeft.Ptr = ARight.Ptr; +end; + +{ PRecBookmark } + +function PRecBookmark.GetRefreshIteration: longint; +begin + Result := Marshal.ReadInt32(Ptr); +end; + +procedure PRecBookmark.SetRefreshIteration(Value: longint); +begin + Marshal.WriteInt32(Ptr, Value); +end; + +function PRecBookmark.GetItem: PItemHeader; +begin + Result := Marshal.ReadIntPtr(Ptr, sizeof(longint)); +end; + +procedure PRecBookmark.SetItem(Value: PItemHeader); +begin + Marshal.WriteIntPtr(Ptr, sizeof(longint), Value); +end; + +function PRecBookmark.GetOrder: longint; +begin + Result := Marshal.ReadInt32(Ptr, sizeof(longint) + sizeof(PItemHeader)); +end; + +procedure PRecBookmark.SetOrder(Value: longint); +begin + Marshal.WriteInt32(Ptr, sizeof(longint) + sizeof(PItemHeader), Value); +end; + +class operator PRecBookmark.Implicit(AValue: IntPtr): PRecBookmark; +begin + Result.Ptr := AValue; +end; + +class operator PRecBookmark.Implicit(AValue: PRecBookmark): IntPtr; +begin + Result := AValue.Ptr; +end; + +class operator PRecBookmark.Implicit(AValue: integer): PRecBookmark; +begin + Result.Ptr := IntPtr(AValue); +end; + +{ PPieceHeader } + +function PPieceHeader.GetBlob: integer; +begin + Result := Marshal.ReadInt32(Ptr); +end; + +procedure PPieceHeader.SetBlob(Value: integer); +begin + Marshal.WriteInt32(Ptr, Value); +end; + +function PPieceHeader.GetSize: cardinal; +begin + Result := Marshal.ReadInt32(Ptr, sizeof(integer)); +end; + +procedure PPieceHeader.SetSize(Value: cardinal); +begin + Marshal.WriteInt32(Ptr, sizeof(integer), Value); +end; + +function PPieceHeader.GetUsed: cardinal; +begin + Result := Marshal.ReadInt32(Ptr, sizeof(integer) * 2); +end; + +procedure PPieceHeader.SetUsed(Value: cardinal); +begin + Marshal.WriteInt32(Ptr, sizeof(integer) * 2, Value); +end; + +function PPieceHeader.GetPrev: PPieceHeader; +begin + Result := Marshal.ReadIntPtr(Ptr, sizeof(integer) * 3); +end; + +procedure PPieceHeader.SetPrev(Value: PPieceHeader); +begin + Marshal.WriteIntPtr(Ptr, sizeof(integer) * 3, Value.Ptr); +end; + +function PPieceHeader.GetNext: PPieceHeader; +begin + Result := Marshal.ReadIntPtr(Ptr, sizeof(integer) * 3 + sizeof(PPieceHeader)); +end; + +procedure PPieceHeader.SetNext(Value: PPieceHeader); +begin + Marshal.WriteIntPtr(Ptr, sizeof(integer) * 3 + sizeof(PPieceHeader), Value.Ptr); +end; + +class operator PPieceHeader.Implicit(AValue: IntPtr): PPieceHeader; +begin + Result.Ptr := AValue; +end; + +class operator PPieceHeader.Implicit(AValue: PPieceHeader): IntPtr; +begin + Result := AValue.Ptr; +end; + +class operator PPieceHeader.Implicit(AValue: PPieceHeader): integer; +begin + Result := AValue.Ptr.ToInt32; +end; + +class operator PPieceHeader.Equal(ALeft, ARight: PPieceHeader): boolean; +begin + Result := ALeft.Ptr = ARight.Ptr; +end; +{$ENDIF} + +{ TFieldDesc } + +constructor TFieldDesc.Create; +begin + inherited; +end; + +destructor TFieldDesc.Destroy; +begin + if FObjectType <> nil then + FObjectType.Release; + + inherited; +end; + +function TFieldDesc.HasParent: boolean; +begin + Result := FParentField <> nil; +end; + +procedure TFieldDesc.Assign(FieldDesc:TFieldDesc); +begin + Name := FieldDesc.Name; + ActualName := FieldDesc.ActualName; + DataType := FieldDesc.DataType; + Length := FieldDesc.Length; + Scale := FieldDesc.Scale; + Size := FieldDesc.Size; + Offset := FieldDesc.Offset; + Required := FieldDesc.Required; + FieldNo := FieldDesc.FieldNo; +end; + +procedure TFieldDesc.SetObjectType(Value:TObjectType); +begin + if Value <> FObjectType then begin + if FObjectType <> nil then + FObjectType.Release; + + FObjectType := Value; + + if FObjectType <> nil then + FObjectType.AddRef; + end; +end; + +{ TFieldDescs } + +destructor TFieldDescs.Destroy; +begin + Clear; + + inherited; +end; + +procedure TFieldDescs.Clear; +var + i: integer; +begin + for i := 0 to Count - 1 do + if Items[i] <> nil then + TFieldDesc(Items[i]).Free; + + inherited Clear; +end; + +function TFieldDescs.FindField(Name: string):TFieldDesc; +var + i: integer; + ComplexField: boolean; + Found: boolean; +begin + Result := nil; + ComplexField := (Pos('.', Name) > 0) or (Pos('[', Name) > 0); + if not ComplexField then + for i := 0 to Count - 1 do + if (Items[i] <> nil) and (not TFieldDesc(Items[i]).HasParent) then begin + Found := AnsiCompareText(TFieldDesc(Items[i]).Name, Name) = 0; + + if Found then begin + Result := Items[i]; + Exit; + end; + end; + for i := 0 to Count - 1 do + if (Items[i] <> nil) then begin + Found := False; + if ComplexField then + Found := AnsiCompareText(TFieldDesc(Items[i]).ActualName, Name) = 0 + else + if (TFieldDesc(Items[i]).HasParent) then + Found := AnsiCompareText(TFieldDesc(Items[i]).Name, Name) = 0; + + if Found then begin + Result := Items[i]; + Exit; + end; + end; +end; + +function TFieldDescs.FieldByName(Name: string): TFieldDesc; +begin + Result := FindField(Name); + + if Result = nil then + raise Exception.Create(Format(SFieldNotFound, [Name])); +end; + +function TFieldDescs.GetItems(Index: integer): TFieldDesc; +begin + Result := TFieldDesc(inherited Items[Index]); +end; + +{ TAttribute } + +constructor TAttribute.Create; +begin + inherited; +end; + +destructor TAttribute.Destroy; +begin + if (FObjectType <> nil) and (FOwner.Name <> FObjectType.Name) then + FObjectType.Release; + + inherited; +end; + +procedure TAttribute.SetObjectType(Value:TObjectType); +begin + if Value <> FObjectType then begin + if FObjectType <> nil then + FObjectType.Release; + + FObjectType := Value; + + if (FObjectType <> nil) and (FOwner.Name <> FObjectType.Name) then + FObjectType.AddRef; + end; +end; + +{ TObjectType } + +constructor TObjectType.Create; +begin + inherited; + + FAttributes := TDAList.Create; +end; + +destructor TObjectType.Destroy; +begin + ClearAttributes; + FAttributes.Free; + + inherited; +end; + +{function TObjectType.AddAttribute:TAttribute; +begin + Result := TAttribute.Create; + FAttributes.Add(Result); +end;} + +procedure TObjectType.ClearAttributes; +var + i: integer; +begin + for i := 0 to FAttributes.Count - 1 do + TAttribute(FAttributes[i]).Free; + FAttributes.Clear; +end; + +function TObjectType.FindAttribute(Name: string):TAttribute; +var + St: string; + iPos,IndexPos: integer; + i: integer; + OType:TObjectType; +begin + Name := AnsiUpperCase(Name); + OType := Self; + + repeat + Name := TrimLeft(Name); + + iPos := Pos('.', Name); + IndexPos := Pos('[', Name); + if IndexPos = 1 then begin + i := Pos(']', Name); + if i = 0 then begin + Result := nil; + Exit; + end; + if (i + 1 <= Length(Name)) and (Name[i + 1] = '.') then + Inc(i); + + St := 'ELEMENT'; + Name := Copy(Name, i + 1, Length(Name)); + end + else + if (iPos > 0) and ((iPos < IndexPos) or (IndexPos = 0)) then begin + St := Copy(Name, 1, iPos - 1); + Name := Copy(Name, iPos + 1, Length(Name)); + end + else + if IndexPos > 0 then begin + St := Copy(Name, 1, IndexPos - 1); + Name := Copy(Name, IndexPos, Length(Name)); + end + else + St := Name; + + Result := nil; + for i := 0 to OType.AttributeCount - 1 do + if AnsiUpperCase(TAttribute(OType.Attributes[i]).Name) = St then begin + Result := OType.Attributes[i]; + break; + end; + + if (Result = nil) or not(Result.DataType in [dtObject,dtArray,dtTable,dtReference]) and + (iPos <> 0) + then begin + Result := nil; + Exit; + end; + + OType := Result.ObjectType; + until (iPos = 0) and ((IndexPos = 0) or (Name = '')); +end; + +function TObjectType.AttributeByName(Name: string):TAttribute; +begin + Result := FindAttribute(Name); + if Result = nil then + raise Exception.Create(Format(SAttributeNotFount, [Name])); +end; + +function TObjectType.GetAttributes(Index: integer):TAttribute; +begin + Result := TAttribute(FAttributes[Index]); +end; + +function TObjectType.GetAttributeCount: integer; +begin + Result := FAttributes.Count; +end; + +{ TDBObject } + +constructor TDBObject.Create; +begin + inherited; +end; + +procedure TDBObject.SetObjectType(Value:TObjectType); +begin + if FObjectType <> nil then + FObjectType.Release; + + FObjectType := Value; + + if FObjectType <> nil then + FObjectType.AddRef; +end; + +procedure TDBObject.GetAttributeValue(Name: string; Dest: IntPtr; var IsBlank: boolean); +begin + IsBlank := True; +end; + +procedure TDBObject.SetAttributeValue(Name: string; Source: IntPtr); +begin +end; + +{ TBoolParser } + +constructor TBoolParser.Create(const Text: string); +begin + inherited Create(Text); + + FSymbolLexems := BoolSymbolLexems; + FKeywordLexems := BoolKeywordLexems; +end; + +procedure TBoolParser.ToRightQuote(LeftQuote: Char); +begin + while (Pos <= TextLength) and (Text[Pos] <> LeftQuote) do begin + Inc(Pos); + if (Pos + 1 <= TextLength) and (Text[Pos] = '''') and (Text[Pos + 1] = '''') then + Inc(Pos, 2); + end; +end; + +{ TData } + +{$IFDEF CRDEBUG} +const + DataCnt: integer = 0; +{$ENDIF} + +constructor TData.Create; +begin + inherited; + + FEOF := True; + FBOF := True; + FFields := TFieldDescs.Create; + FAutoInitFields := True; + FEnableEmptyStrings := False; + +{$IFDEF CRDEBUG} Inc(DataCnt); {$ENDIF} + StringHeap := TStringHeap.Create; +end; + +destructor TData.Destroy; +begin + Close; + + ClearFields; + FFields.Free; + StringHeap.Free; + + inherited; + +{$IFDEF CRDEBUG} Dec(DataCnt); {$ENDIF} +end; + +{ Data } + +procedure TData.InitData; +begin + FBOF := True; + FEOF := True; + FRecordCount := 0; + FRecordNoOffset := 0; +end; + +procedure TData.FreeData; +begin + InitData; +end; + +{ Open / Close } + +procedure TData.InternalPrepare; +begin +end; + +procedure TData.Prepare; +begin + InternalPrepare; + Prepared := True; // lost connection +end; + +procedure TData.InternalUnPrepare; +begin +end; + +procedure TData.UnPrepare; +begin + if Prepared then begin + Prepared := False; + if FAutoInitFields then + ClearFields; + InternalUnPrepare; + end; +end; + +procedure TData.InternalOpen; +begin +end; + +procedure TData.Open; +begin + if not Active then begin + InitData; + try + InternalOpen; + CreateFilterExpression(FFilterText); // ??? + except + FreeData; + FreeFilterExpression; + raise; + end; + + Active := True; + end; +end; + +procedure TData.InternalClose; +begin +end; + +procedure TData.Close; +begin + try + if Active then + InternalClose; + finally + Active := False; + FreeData; // FreeData after for multithreads + + if FAutoInitFields and not Prepared then // After FreeData! + ClearFields; + + FreeFilterExpression; + end; +end; + +function TData.IsFullReopen: boolean; +begin + Result := True; +end; + +procedure TData.Reopen; +begin + Close; + Open; +end; + +{ Field } + +function TData.GetFieldCount: word; +begin + Result := FFields.Count; +end; + +function TData.GetIndicatorSize: word; +begin + Result := FieldCount; +end; + +function TData.GetFieldDescType: TFieldDescClass; +begin + Result := TFieldDesc; +end; + +procedure TData.InternalInitFields; +begin +end; + +function TData.GetArrayFieldName(ObjectType: TObjectType; ItemIndex: integer): string; +begin + Result := '[' + IntToStr(ItemIndex) + ']'; +end; + +procedure TData.InitObjectFields(ObjectType:TObjectType; Parent: TFieldDesc); +var + i: integer; + Field:TFieldDesc; + Item,CountItem: integer; +begin + if (ObjectType.DataType in [dtObject,dtTable]) or FSparseArrays then + CountItem := 1 + else begin + CountItem := ObjectType.Size; + if CountItem > MaxArrayItem then // Restriction of array length + CountItem := MaxArrayItem; + end; + + for i := 0 to ObjectType.AttributeCount - 1 do begin + for Item := 0 to CountItem - 1 do begin + Field := GetFieldDescType.Create; + Field.ParentField := Parent; + if ObjectType.DataType in [dtObject,dtTable] then begin + Field.Name := ObjectType.Attributes[i].Name; + if Parent = nil then + Field.ActualName := Field.Name + else + Field.ActualName := Parent.ActualName + '.' + Field.Name; + end + else begin + Field.Name := GetArrayFieldName(ObjectType, Item); + if Parent = nil then + Field.ActualName := Field.Name + else + Field.ActualName := Parent.ActualName + Field.Name; + end; + + Field.DataType := ObjectType.Attributes[i].DataType; + Field.Size := 0;// ObjectType.Attributes[i].Size; + Field.Fixed := ObjectType.Attributes[i].Fixed; + Field.Length := ObjectType.Attributes[i].Length; + Field.FieldNo := FFields.Count + 1; + Field.ObjectType := ObjectType.Attributes[i].ObjectType; + if Parent <> nil then + Field.ReadOnly := Parent.ReadOnly; + FFields.Add(Field); + + if Field.DataType in [dtObject,dtArray] then + InitObjectFields(Field.ObjectType, Field); + end; + end; +end; + +function CompareAlias(Field1, Field2: {$IFDEF CLR}TObject{$ELSE}pointer{$ENDIF}): integer; +begin + if Field1 = Field2 then + Result := 0 + else begin + Result := AnsiCompareText(TFieldDesc(Field1).Name, TFieldDesc(Field2).Name); + if Result = 0 then begin + Result := TFieldDesc(Field1).FieldNo - TFieldDesc(Field2).FieldNo; + TFieldDesc(Field1).FReserved := True; + TFieldDesc(Field2).FReserved := True; + end; + end +end; + +procedure TData.InitFields; +var + i: integer; + + // perfomance optimization for many fields set aliases + procedure InitAliases; + var + AliasNum, AliasLen: integer; + AFields: TDAList; + i: integer; + s: string; + + procedure ReplaceNextOriginalNames(StartName: string; StartInd: integer); + var + i, Res: integer; + AliasNum: integer; + S: string; + begin + AliasNum := 1; + for i := StartInd to AFields.Count - 1 do begin + S := TFieldDesc(AFields[i]).Name; + Res := AnsiCompareTextS(StartName, S); + if (Res < 0) then + break; + if (Res = 0) then begin + TFieldDesc(AFields[i]).Name := S + '_' + IntToStr(AliasNum); + Inc(AliasNum); + ReplaceNextOriginalNames(TFieldDesc(AFields[i]).Name, i + 1); + end; + end; + end; + begin + AFields := TDAList.Create; + try + AFields.Capacity := FFields.Capacity; + for i := 0 to FFields.Count - 1 do + if (FFields[i] <> nil) and (TFieldDesc(FFields[i]).ParentField = nil) then + AFields.Add(FFields[i]); + + AFields.Sort(CompareAlias); + AliasNum := 0; + for i := 0 to AFields.Count - 1 do + if (TFieldDesc(AFields[i]).FReserved) or (TFieldDesc(AFields[i]).Name = '') then begin + if (AliasNum > 1) then begin + s := TFieldDesc(AFields[i-1]).Name; + AliasLen := 1 {'_'} + Length(IntToStr((AliasNum - 1))); + SetLength(s, Length(s) - AliasLen); + if (AnsiCompareText(s, TFieldDesc(AFields[i]).Name) <> 0) then + AliasNum := 0; + end; + if (AliasNum <> 0) or (TFieldDesc(AFields[i]).Name = '') then begin + TFieldDesc(AFields[i]).Name := TFieldDesc(AFields[i]).Name + '_' + IntToStr(AliasNum); + ReplaceNextOriginalNames(TFieldDesc(AFields[i]).Name, i + 1); + end; + Inc(AliasNum); + end else + AliasNum := 0; + finally + AFields.Free; + end; + end; + +var + Off, AlignOff: integer; + FieldDesc: TFieldDesc; +begin + if FAutoInitFields then begin + ClearFields; + InternalInitFields; + if Assigned(FOnGetCachedFields) then + FOnGetCachedFields(); + InitAliases; + end; + + DataSize := 0; + CalcDataSize := 0; + for i := 0 to FieldCount - 1 do + if Fields[i].FieldDescKind <> fdkCalculated then begin + FieldDesc := Fields[i]; + FieldDesc.Offset := DataSize; + + if FieldDesc.DataType = dtWideString then begin + Off := FieldDesc.Offset; + AlignOff := Off and 1; // Fields[i].Offset mod 2; + FieldDesc.Offset := Off + AlignOff; // align WideString field offset + end + else + AlignOff := 0; + + DataSize := DataSize + FieldDesc.Size + AlignOff; + end; + + FRecordSize := DataSize + IndicatorSize; + FRecordSize := FRecordSize + (FRecordSize + 1) mod 2; //align + + for i := 0 to FieldCount - 1 do + if Fields[i].FieldDescKind = fdkCalculated then begin + FieldDesc := Fields[i]; + FieldDesc.Offset := FRecordSize + CalcDataSize; + + if FieldDesc.DataType = dtWideString then begin + Off := FieldDesc.Offset; + AlignOff := Off and 1; // Fields[i].Offset mod 2; + FieldDesc.Offset := Off + AlignOff; // align WideString field offset + end + else + AlignOff := 0; + + CalcDataSize := CalcDataSize + FieldDesc.Size + AlignOff; + end; + + FCalcRecordSize := CalcDataSize; + if FCalcRecordSize > 0 then + FCalcRecordSize := FCalcRecordSize + (FCalcRecordSize + 1) mod 2; //align + CheckHasComplexFields; +end; + +procedure TData.ClearFields; +begin + FFields.Clear; +end; + +procedure TData.GetDateFromBuf(Buf: IntPtr; Offset: integer; Date: IntPtr; Format: TDateFormat); +var + DateTime: double; +begin + DateTime := BitConverter.Int64BitsToDouble(Marshal.ReadInt64(Buf, Offset)); + case Format of + dfMSecs: begin + DateTime := TimeStampToMSecs(DateTimeToTimeStamp(DateTime)); + Marshal.WriteInt64(Date, BitConverter.DoubleToInt64Bits(DateTime)); + end; + dfDateTime: + Marshal.WriteInt64(Date, BitConverter.DoubleToInt64Bits(DateTime)); + dfDate: + Marshal.WriteInt32(Date, DateTimeToTimeStamp(DateTime).Date); + dfTime: + Marshal.WriteInt32(Date, DateTimeToTimeStamp(DateTime).Time); + end; +end; + +procedure TData.PutDateToBuf(Buf: IntPtr; Offset: integer; Date: IntPtr; Format: TDateFormat); +var + Ts: TTimeStamp; + DateTime: TDateTime; +begin + case Format of + dfMSecs: begin + {$IFDEF CLR} + DateTime := MemUtils.TimeStampToDateTime(MSecsToTimeStamp(Trunc(BitConverter.Int64BitsToDouble(Marshal.ReadInt64(Date))))); + {$ELSE} + DateTime := MemUtils.TimeStampToDateTime(MSecsToTimeStamp(TDateTime(Date^))); + {$ENDIF} + Marshal.WriteInt64(Buf, Offset, BitConverter.DoubleToInt64Bits(DateTime)); + end; + dfDateTime: + Marshal.WriteInt64(Buf, Offset, Marshal.ReadInt64(Date)); + dfDate: begin + Ts.Date := Marshal.ReadInt32(Date); + Ts.Time := 0; + Marshal.WriteInt64(Buf, Offset, BitConverter.DoubleToInt64Bits(MemUtils.TimeStampToDateTime(Ts))); + end; + dfTime: begin + Ts.Date := DateDelta; + Ts.Time := Marshal.ReadInt32(Date); + Marshal.WriteInt64(Buf, Offset, BitConverter.DoubleToInt64Bits(MemUtils.TimeStampToDateTime(Ts))); + end; + end; +end; + +procedure TData.GetChildFieldInfo(Field: TFieldDesc; var RootField: TFieldDesc; var AttrName: string); +begin + AttrName := ''; + repeat + if AttrName = '' then + AttrName := Field.Name + else + if Field.DataType = dtArray then + AttrName := Field.Name + AttrName + else + AttrName := Field.Name + '.' + AttrName; + Field := Field.ParentField; + until not Field.HasParent; + RootField := Field; +end; + +procedure TData.GetChildField(Field: TFieldDesc; RecBuf: IntPtr; Dest: IntPtr; var IsBlank: boolean); +var + DBObject: IntPtr; + AttrName: string; +begin + GetChildFieldInfo(Field, Field, AttrName); + DBObject := Marshal.ReadIntPtr(RecBuf, Field.Offset); + if DBObject <> nil then + TDBObject(GetGCHandleTarget(DBObject)).GetAttributeValue(AttrName, Dest, IsBlank) + else + IsBlank := True; +end; + +procedure TData.PutChildField(Field: TFieldDesc; RecBuf: IntPtr; Source: IntPtr); +var + DBObject: IntPtr; + AttrName: string; +begin + GetChildFieldInfo(Field, Field, AttrName); + DBObject := Marshal.ReadIntPtr(RecBuf, Field.Offset); + if DBObject <> nil then + TDBObject(GetGCHandleTarget(DBObject)).SetAttributeValue(AttrName, Source); +end; + +const + CRLF = $0A0D; + LF = $0A; + CRLF_UTF16 = $000A000D; + LF_UTF16 = $000A; + +function AddCRString(Source, Dest: IntPtr; Count: integer): integer; +var + SourceEnd: IntPtr; + w: word; + b: byte; +begin + Result := Count; + SourceEnd := IntPtr(Integer(Source) + Count); + while Integer(Source) < Integer(SourceEnd) do begin + w := Marshal.ReadInt16(Source); + if w = CRLF then begin + Marshal.WriteInt16(Dest, w); + Source := IntPtr(Integer(Source) + 2); + Dest := IntPtr(Integer(Dest) + 2); + end + else begin + b := Byte(w); + if b = 0 then begin + Dec(Result, Integer(SourceEnd) - Integer(Source)); + break; + end + else + if b = LF then begin + Marshal.WriteInt16(Dest, CRLF); + Source := IntPtr(Integer(Source) + 1); + Dest := IntPtr(Integer(Dest) + 2); + Inc(Result); + end + else begin + Marshal.WriteByte(Dest, b); + Source := IntPtr(Integer(Source) + 1); + Dest := IntPtr(Integer(Dest) + 1); + end; + end; + end; + Marshal.WriteByte(Dest, 0); +end; + +function RemoveCRString(Source, Dest: IntPtr; DestLen, Count: integer): integer; +var + SourceEnd: IntPtr; + DestStart: IntPtr; + w: word; +begin + Result := Count; + SourceEnd := IntPtr(Integer(Source) + Count); + DestStart := Dest; + while (Integer(Source) < Integer(SourceEnd)) and (Integer(Dest) - Integer(DestStart) < DestLen) do begin + w := Marshal.ReadInt16(Source); + if w = CRLF then begin + Marshal.WriteByte(Dest, LF); + Source := IntPtr(Integer(Source) + 2); + Dec(Result); + Dest := IntPtr(Integer(Dest) + 1); + end + else + begin + Marshal.WriteByte(Dest, Byte(w)); + Source := IntPtr(Integer(Source) + 1); + Dest := IntPtr(Integer(Dest) + 1); + end; + end; + Marshal.WriteByte(Dest, 0); +end; + +function AddCRUnicode(Source, Dest: IntPtr; Count: integer): integer; +var + SourceEnd: IntPtr; + w: LongWord; + b: word; +begin + Result := Count; + SourceEnd := IntPtr(Integer(Source) + Count * 2); + while Integer(Source) < Integer(SourceEnd) do begin + w := Marshal.ReadInt32(Source); + if w = CRLF_UTF16 then begin + Marshal.WriteInt32(Dest, w); + Source := IntPtr(Integer(Source) + 4); + Dest := IntPtr(Integer(Dest) + 4); + end + else begin + b := Word(w); + if b = 0 then begin + Dec(Result, (Integer(SourceEnd) - Integer(Source)) div 2); + break; + end + else + if b = LF_UTF16 then begin + Marshal.WriteInt32(Dest, CRLF_UTF16); + Source := IntPtr(Integer(Source) + 2); + Dest := IntPtr(Integer(Dest) + 4); + Inc(Result); + end + else begin + Marshal.WriteInt16(Dest, b); + Source := IntPtr(Integer(Source) + 2); + Dest := IntPtr(Integer(Dest) + 2); + end; + end; + end; + Marshal.WriteInt16(Dest, 0); +end; + +function RemoveCRUnicode(Source, Dest: IntPtr; DestLen, Count: integer): integer; +var + SourceEnd: IntPtr; + DestStart: IntPtr; + w: LongWord; +begin + Result := Count; + SourceEnd := IntPtr(Integer(Source) + Count * 2); + DestStart := Dest; + while (Integer(Source) < Integer(SourceEnd)) and (Integer(Dest) - Integer(DestStart) < DestLen * 2) do begin + w := Marshal.ReadInt32(Source); + if w = CRLF_UTF16 then begin + Marshal.WriteInt16(Dest, LF_UTF16); + Source := IntPtr(Integer(Source) + 4); + Dec(Result); + Dest := IntPtr(Integer(Dest) + 2); + end + else + begin + Marshal.WriteInt16(Dest, Word(w)); + Source := IntPtr(Integer(Source) + 2); + Dest := IntPtr(Integer(Dest) + 2); + end; + end; + Marshal.WriteInt16(Dest, 0); +end; + +function TData.NeedConvertEOL: boolean; +begin + Result := False; +end; + +procedure TData.GetFieldData(Field: TFieldDesc; RecBuf: IntPtr; Dest: IntPtr); +var + Data: IntPtr; +begin + case Field.DataType of + dtUInt32: + Marshal.WriteInt64(Dest, Longword(Marshal.ReadInt32(RecBuf, Field.Offset))); + dtDateTime: + GetDateFromBuf(RecBuf, Field.Offset, Dest, dfMSecs); + dtDate: + GetDateFromBuf(RecBuf, Field.Offset, Dest, dfDate); + dtTime: + GetDateFromBuf(RecBuf, Field.Offset, Dest, dfTime); + {$IFDEF VER5P} + dtVariant: + {$IFDEF CLR} + Assert(False); + {$ELSE} + Variant(Dest^) := TVariantObject(Marshal.ReadIntPtr(RecBuf, Field.Offset)).Value; + {$ENDIF} + {$ENDIF} + {$IFDEF VER6P} + dtFmtBCD: + CopyBuffer(IntPtr(Integer(RecBuf) + Field.Offset), Dest, SizeOfTBcd); // To avoid errors if Field.Size > SizeOfTBcd + {$ENDIF} + dtExtString: begin + Assert(Marshal.ReadIntPtr(RecBuf, Field.Offset) <> nil); + if NeedConvertEOL then + AddCRString(Marshal.ReadIntPtr(RecBuf, Field.Offset), Dest, MaxInt div 2) + else + StrCopy(Dest, Marshal.ReadIntPtr(RecBuf, Field.Offset)); + end; + dtExtWideString: begin + Assert(Marshal.ReadIntPtr(RecBuf, Field.Offset) <> nil); + if NeedConvertEOL then + AddCRUnicode(Marshal.ReadIntPtr(RecBuf, Field.Offset), Dest, MaxInt div 4) + else + StrCopyW(Dest, Marshal.ReadIntPtr(RecBuf, Field.Offset)); + end; + dtExtVarBytes: begin + Data := Marshal.ReadIntPtr(RecBuf, Field.Offset); + CopyBuffer(Data, Dest, Marshal.ReadInt16(Data) + SizeOf(Word)); + end; + dtString: + if NeedConvertEOL then + AddCRString(IntPtr(Integer(RecBuf) + Field.Offset), Dest, Field.Size) + else + StrLCopy(Dest, IntPtr(Integer(RecBuf) + Field.Offset), Field.Size); + dtWideString: begin + if NeedConvertEOL then + AddCRUnicode(IntPtr(Integer(RecBuf) + Field.Offset), Dest, Field.Size) + else + StrLCopyW(Dest, IntPtr(Integer(RecBuf) + Field.Offset), Field.Size); + end; + {$IFDEF CLR} + dtBytes: + CopyBuffer(IntPtr(Integer(RecBuf) + Field.Offset), Dest, Field.Length); + {$ENDIF} + else + CopyBuffer(IntPtr(Integer(RecBuf) + Field.Offset), Dest, Field.Size); + end; +end; + +procedure TData.GetField(FieldNo: word; RecBuf: IntPtr; Dest: IntPtr; var IsBlank: boolean); +var + Field: TFieldDesc; + DataType: word; + t: boolean; + l: integer; + +begin + Assert((FieldNo <= FieldCount) and (FieldNo > 0)); + + IsBlank := GetNull(FieldNo, RecBuf); + + Field := Fields[FieldNo - 1]; + + DataType := Field.DataType; + if (Dest = nil) or IsBlank and (not IsComplexFieldType(DataType) + or (DataType = dtExtString) or (DataType = dtExtWideString) + or (DataType = dtExtVarBytes)) + then + Exit; + + if not Field.HasParent then + GetFieldData(Field, RecBuf, Dest) + else + GetChildField(Field, RecBuf, Dest, IsBlank); + + if not IsBlank and (Field.DataType in [dtString, dtWideString]) then begin// trim fixed char values + if Field.Fixed then begin + t := FTrimFixedChar; + l := Field.Length; + end + else begin + t := FTrimVarChar; + l := -1; + end; + if t then + if Field.DataType = dtString then + StrTrim(Dest, l) + else + StrTrimW(Dest, l); + end; +end; + +function TData.GetFieldBuf(RecBuf: IntPtr; FieldDesc: TFieldDesc; var DataType: integer; var IsBlank, NativeBuffer: boolean): IntPtr; +var + FieldBufStatic: IntPtr; + ValueBuf: IntPtr; + Len: integer; +begin + NativeBuffer := True; + FieldBufStatic := nil; + ValueBuf := nil; + try + if FieldDesc.ParentField = nil then begin + Result := IntPtr(integer(RecBuf) + FieldDesc.Offset); + IsBlank := GetNull(FieldDesc.FieldNo, RecBuf); + end + else begin + // support objects + FieldBufStatic := Marshal.AllocHGlobal(4001); + Result := FieldBufStatic; + GetField(FieldDesc.FieldNo, RecBuf, Result, IsBlank); // GetChildField + end; + + if not IsBlank then begin + DataType := FieldDesc.DataType; + case DataType of + dtExtString: begin + Result := Marshal.ReadIntPtr(Result); + DataType := dtString; + end; + dtExtWideString: begin + Result := Marshal.ReadIntPtr(Result); + DataType := dtWideString; + end; + dtExtVarBytes: + Result := Marshal.ReadIntPtr(Result); + dtBCD: begin + ValueBuf := Marshal.AllocHGlobal(SizeOf(double)); + Marshal.WriteInt64(ValueBuf, BitConverter.DoubleToInt64Bits(Marshal.ReadInt64(Result) / 10000)); + Result := ValueBuf; + end; + dtDateTime, dtDate, dtTime: begin + ValueBuf := Marshal.AllocHGlobal(SizeOf(double)); + GetDateFromBuf(RecBuf, FieldDesc.Offset, ValueBuf, dfDateTime); + Result := ValueBuf; + end; + dtBytes: begin + ValueBuf := Marshal.AllocHGlobal(FieldDesc.Length + SizeOf(Word)); + Marshal.WriteInt16(ValueBuf, FieldDesc.Length); + CopyBuffer(Result, IntPtr(Integer(ValueBuf) + SizeOf(Word)), FieldDesc.Length); + Result := ValueBuf; + end; + else + if IsBlobFieldType(DataType) then begin + Len := GetBlobSize(FieldDesc.FieldNo, RecBuf); + ValueBuf := Marshal.AllocHGlobal(Len + 1); + ReadBlob(FieldDesc.FieldNo, RecBuf, 0, Len, ValueBuf); + Marshal.WriteByte(ValueBuf, Len, 0); + DataType := dtString; + Result := ValueBuf; + end + end; + end; + finally + if (FieldBufStatic <> nil) and (ValueBuf <> nil) then + Marshal.FreeHGlobal(FieldBufStatic); + NativeBuffer := (FieldBufStatic = nil) and (ValueBuf = nil); + end; +end; + +function SetScale(F: double; Scale: integer): double; +begin + if Scale > 0 then begin + Result := StrToFloat(FloatToStrF(F, ffFixed, 18, Scale)); // 0.009 + end + else + Result := F; +end; + +procedure TData.PutFieldData(Field: TFieldDesc; RecBuf: IntPtr; Source: IntPtr); +var + Dest, Src: IntPtr; + D: double; + Len: integer; + +begin + case Field.DataType of + dtFloat: begin + D := BitConverter.Int64BitsToDouble(Marshal.ReadInt64(Source)); + D := SetScale(D, Field.Scale); + Marshal.WriteInt64(RecBuf, Field.Offset, BitConverter.DoubleToInt64Bits(D)); + end; + dtDateTime: + PutDateToBuf(RecBuf, Field.Offset, Source, dfMSecs); + dtDate: + PutDateToBuf(RecBuf, Field.Offset, Source, dfDate); + dtTime: + PutDateToBuf(RecBuf, Field.Offset, Source, dfTime); + {$IFDEF VER5P} + dtVariant: + {$IFDEF CLR} + Assert(False); + {$ELSE} + TVariantObject(Marshal.ReadIntPtr(RecBuf, Field.Offset)).Value := Variant(Source^); + {$ENDIF} + {$ENDIF} + dtString: + StrLCopy(IntPtr(Integer(RecBuf) + Field.Offset), Source, Field.Size); + dtWideString: begin + Src := + {$IFDEF CLR} + Source; + {$ELSE} + {$IFDEF VER10P} + Source; + {$ELSE} + PWideChar(WideString(Source^)); + {$ENDIF} + {$ENDIF} + StrLCopyW(IntPtr(Integer(RecBuf) + Field.Offset), Src, Field.Length); + end; + dtExtString: begin + StringHeap.DisposeBuf(Marshal.ReadIntPtr(RecBuf, Field.Offset)); + Marshal.WriteIntPtr(RecBuf, Field.Offset, StringHeap.AllocStr(Source)); + end; + dtExtWideString: begin + StringHeap.DisposeBuf(Marshal.ReadIntPtr(RecBuf, Field.Offset)); + if Source = nil then + Src := nil + else + Src := + {$IFDEF CLR} + Source; + {$ELSE} + {$IFDEF VER10P} + Source; + {$ELSE} + PWideChar(WideString(Source^)); + {$ENDIF} + {$ENDIF} + Marshal.WriteIntPtr(RecBuf, Field.Offset, StringHeap.AllocWideStr(Src)); + end; + dtExtVarBytes: begin + StringHeap.DisposeBuf(Marshal.ReadIntPtr(RecBuf, Field.Offset)); + if Source <> nil then begin + Len := Marshal.ReadInt16(Source) + SizeOf(Word); + Dest := StringHeap.NewBuf(Len); + CopyBuffer(Source, Dest, Len); + Marshal.WriteIntPtr(RecBuf, Field.Offset, Dest); + end + else + Marshal.WriteIntPtr(RecBuf, Field.Offset, nil); + end; + {$IFDEF CLR} + dtBytes: + CopyBuffer(Source, IntPtr(Integer(RecBuf) + Field.Offset), Field.Length); + {$ENDIF} + else + CopyBuffer(Source, IntPtr(Integer(RecBuf) + Field.Offset), Field.Size); + end; +end; + +procedure TData.PutField(FieldNo: word; RecBuf: IntPtr; Source: IntPtr); +var + Field: TFieldDesc; +begin + if Source = nil then begin + SetNull(FieldNo, RecBuf, True); + Exit; + end; + + Field := Fields[FieldNo - 1]; + + if not Field.HasParent then begin + if (not FEnableEmptyStrings) and + ((Field.DataType in [dtString, dtExtString]) and (Marshal.ReadByte(Source) = 0) or + (Field.DataType in [dtWideString, dtExtWideString]) and (Marshal.ReadInt16(Source) = 0)) + then + SetNull(FieldNo, RecBuf, True) + else + begin + PutFieldData(Field, RecBuf, Source); + SetNull(FieldNo, RecBuf, False); + end; + end + else + PutChildField(Field, RecBuf, Source); +end; + +function TData.GetNull(FieldNo: word; RecBuf: IntPtr): boolean; +var + Field:TFieldDesc; +begin + Field := Fields[FieldNo - 1]; + if not Field.HasParent then + Result := Marshal.ReadByte(RecBuf, DataSize + FieldNo - 1) = 1 + else + GetChildField(Field, RecBuf, nil, Result); +end; + +procedure TData.SetNull(FieldNo: word; RecBuf: IntPtr; Value: boolean); +var + Flag: byte; + Field: TFieldDesc; + Blob: TBlob; +begin + Field := Fields[FieldNo - 1]; + if not Field.HasParent then begin + if Value then + Flag := 1 + else + Flag := 0; + + Marshal.WriteByte(RecBuf, DataSize + FieldNo - 1, Flag); + + if Value and IsBlobFieldType(Field.DataType) then begin // clear Blob value + Blob := TBlob(GetGCHandleTarget(Marshal.ReadIntPtr(RecBuf, Field.Offset))); + if Blob <> nil then + Blob.Clear; + end; + end + else + PutChildField(Field, RecBuf, nil); +end; + +function TData.GetNullByBlob(FieldNo: word; RecBuf: IntPtr): boolean; +var + Blob: TBlob; + Ptr: IntPtr; +begin + Result := True; + if IsBlobFieldType(Fields[FieldNo - 1].DataType) then begin + Ptr := Marshal.AllocHGlobal(sizeof(IntPtr)); + try + if Fields[FieldNo - 1].HasParent then + GetChildField(Fields[FieldNo - 1], RecBuf, Ptr, Result) + else + GetFieldData(Fields[FieldNo - 1], RecBuf, Ptr); + Blob := TBlob(GetGCHandleTarget(Marshal.ReadIntPtr(Ptr))); + finally + Marshal.FreeHGlobal(Ptr); + end; + + if (Blob <> nil) and (Blob.Size <> 0) then begin + Result := False; + SetNull(FieldNo, RecBuf, False); + end; + end; +end; + +procedure TData.GetFieldAsVariant(FieldNo: word; RecBuf: IntPtr; var Value: variant); +var + Field: TFieldDesc; + FieldData: IntPtr; + Date: TDateTime; + Date64: int64; + PDate: IntPtr; + Buf: IntPtr; + Data: TBytes; + IsBlank, t: boolean; +{ Blob: TBlob; + l: integer;} +{$IFDEF VER6P} + bcd: TBcd; +{$ENDIF} +begin + if GetNull(FieldNo, RecBuf) then begin + Value := Null; + Exit; + end; + + Value := Unassigned; // Delphi bug + Field := Fields[FieldNo - 1]; + + if not Field.HasParent then + Buf := nil + else + Buf := Marshal.AllocHGlobal(4000); + + try + if not Field.HasParent then + FieldData := IntPtr(Integer(RecBuf) + Field.Offset) + else begin + FieldData := Buf; + GetChildField(Field, RecBuf, FieldData, IsBlank); + end; + + case Field.DataType of + dtString: begin + if Field.Fixed then + t := FTrimFixedChar + else + t := FTrimVarChar; + if t then + // trim fixed char values + Value := TrimRight(Marshal.PtrToStringAnsi(FieldData)) + else + Value := Marshal.PtrToStringAnsi(FieldData); + end; + dtWideString: begin + if Field.Fixed then + t := FTrimFixedChar + else + t := FTrimVarChar; + if t then + // trim fixed char values + Value := TrimRight(Marshal.PtrToStringUni(FieldData)) + else + Value := Marshal.PtrToStringUni(FieldData); + end; + dtInt8: + Value := shortint(Marshal.ReadByte(FieldData)); + dtSmallint: + Value := Marshal.ReadInt16(FieldData); + dtInt64: begin + {$IFDEF VER6P} + Value := Marshal.ReadInt64(FieldData); + {$ELSE} + TVarData(Value).VType := varDecimal; + TVarDataD6(Value).VInt64 := Int64(FieldData^); + {$ENDIF} + end; + dtUInt32: begin + {$IFDEF VER6P} + Value := LongWord(Marshal.ReadInt32(FieldData)); + {$ELSE} + TVarData(Value).VType := varLongWord; + TVarDataD6(Value).VLongword := LongWord(FieldData^); + {$ENDIF} + end; + dtInteger: + Value := Marshal.ReadInt32(FieldData); + dtWord: + Value := Word(Marshal.ReadInt16(FieldData)); + dtBoolean: + Value := WordBool(Marshal.ReadInt16(FieldData)); + dtFloat,dtCurrency: + Value := BitConverter.Int64BitsToDouble(Marshal.ReadInt64(FieldData)); + dtDateTime, dtDate, dtTime: begin + if Field.HasParent then + Date := MemUtils.TimeStampToDateTime(MSecsToTimeStamp(Trunc(BitConverter.Int64BitsToDouble(Marshal.ReadInt64(FieldData))))) + else begin + PDate := OrdinalToPtr(Date64); + try + GetDateFromBuf(FieldData, 0, PDate, dfDateTime); + finally + PtrToOrdinal(PDate, Date64); + end; + Date := BitConverter.Int64BitsToDouble(Date64); + end; + Value := Date; + end; + dtMemo: + Value := TBlob(GetGCHandleTarget(Marshal.ReadIntPtr(FieldData))).AsString; + dtWideMemo: + Value := TBlob(GetGCHandleTarget(Marshal.ReadIntPtr(FieldData))).AsWideString; + {$IFDEF VER5P} + dtVariant: + Value := TVariantObject(GetGCHandleTarget(Marshal.ReadIntPtr(FieldData))).Value; + {$ENDIF} + dtExtString: + Value := Marshal.PtrToStringAnsi(Marshal.ReadIntPtr(FieldData)); + dtExtWideString: + Value := Marshal.PtrToStringUni(Marshal.ReadIntPtr(FieldData)); + dtBytes: begin + SetLength(Data, Field.Length); + Marshal.Copy(FieldData, Data, 0, Field.Length); + Value := Data; + end; + dtVarBytes: begin + SetLength(Data, Marshal.ReadInt16(FieldData)); + Marshal.Copy(IntPtr(Integer(FieldData) + SizeOf(word)), Data, 0, Length(Data)); + Value := Data; + end; + dtExtVarBytes: begin + SetLength(Data, Marshal.ReadInt16(Marshal.ReadIntPtr(FieldData))); + Marshal.Copy(IntPtr(Integer(Marshal.ReadIntPtr(FieldData)) + SizeOf(word)), Data, 0, Length(Data)); + Value := Data; + end; +(* dtBlob: begin + Blob := GetObject(FieldNo, RecBuf) as TBlob; + try + l := Blob.Size; + {$IFDEF CLR} + SetLength(Value, l); + Blob.Defrag; + asdd + {$ELSE} + Value := VarArrayCreate([0, l - 1], varByte); + Blob.Read(0, l, TVarData(Value).VArray.Data); + {$ENDIF} + finally + Blob.Free; + end; + end; *) + dtBCD: + begin + {$IFDEF CLR} + Date64 := Marshal.ReadInt64(FieldData); + Value := Date64 / 10000; + {$ELSE} + Value := PCurrency(FieldData)^; + {$ENDIF} + end; + {$IFDEF VER6P} + dtFmtBCD: + begin + {$IFDEF CLR} + SetLength(Data, SizeOfTBcd); + Marshal.Copy(FieldData, Data, 0, SizeOfTBcd); + bcd := TBcd.FromBytes(Data); + {$ELSE} + bcd := PBcd(FieldData)^; + {$ENDIF} + Value := VarFMTBcdCreate(bcd); + end; + {$ENDIF} + dtGuid: + Value := Marshal.PtrToStringAnsi(FieldData); + else + raise EConvertError.Create(SCannotConvertType + ' ' + IntToStr(Integer(Field.DataType))); + end; + finally + if Buf <> nil then + Marshal.FreeHGlobal(Buf); + end; +end; + +procedure TData.PutFieldAsVariant(FieldNo: word; RecBuf: IntPtr; const Value: variant); +var + FieldData: IntPtr; + i: integer; +{$IFDEF VER6P} + lw: Longword; + i32: Int32; + i64: Int64; +{$ENDIF} +{$IFDEF CLR} + Data: TBytes; + bcd: TBcd; + d: Double; +{$ENDIF} + Date: int64; + PDate: IntPtr; + Temp: IntPtr; + Ws: WideString; + l: word; + + s: string; + p: IntPtr; +begin + if VarIsNull(Value) or VarIsEmpty(Value) then begin + SetNull(FieldNo, RecBuf, True); + Exit; + end; + FieldData := IntPtr(Integer(RecBuf) + Fields[FieldNo - 1].Offset); + case Fields[FieldNo - 1].DataType of + dtString: begin + {$IFDEF CLR} + Data := Encoding.Default.GetBytes(String(Copy(String(Value), 1, Fields[FieldNo - 1].Size))); + Marshal.Copy(Data, 0, FieldData, Length(Data)); + Marshal.WriteByte(FieldData, Length(Data), 0); + {$ELSE} + StrLCopy(FieldData, PChar(VarToStr(Value)), Fields[FieldNo - 1].Size); + {$ENDIF} + end; + dtWideString: begin + Ws := WideString(Value); + {$IFDEF CLR} + i := Fields[FieldNo - 1].Size div 2 - 1; + if Length(Ws) > i then + SetLength(Ws, i); + Data := Encoding.Unicode.GetBytes(Ws); + Marshal.Copy(Data, 0, FieldData, Length(Data)); + Marshal.WriteInt16(FieldData, Length(Data), 0); + {$ELSE} + StrLCopyW(FieldData, PWideChar(ws), Fields[FieldNo - 1].Size div 2 - 1); + {$ENDIF} + end; + dtInt8: begin + i := Value; + case Fields[FieldNo - 1].Size of + 2: + Marshal.WriteInt16(FieldData, i); + 1: + Marshal.WriteByte(FieldData, byte(i)); + else + Assert(False); + end; + end; + dtSmallint: + case VarType(Value) of + varSmallint,varInteger,varByte{$IFDEF VER6P}, varWord{$ENDIF}: + Marshal.WriteInt16(FieldData, smallint(Value)); + else + raise EConvertError.Create(SCannotConvertType); + end; + dtInteger: + case VarType(Value) of + varString{$IFDEF WIN32},varOleStr{$ENDIF}{$IFDEF CLR}, varChar{$ENDIF}: + Marshal.WriteInt32(FieldData, StrToInt(Value)); + varSmallint,varInteger,varByte,{$IFDEF VER6P}varWord,{$ENDIF} + varSingle,varDouble{$IFDEF WIN32},varCurrency{$ENDIF}: + Marshal.WriteInt32(FieldData, Integer(Value)); + else + raise EConvertError.Create(SCannotConvertType); + end; + dtInt64: + case VarType(Value) of + {$IFDEF VER6P} + varInt64: begin + i64 := Value; + Marshal.WriteInt64(FieldData, i64); + end; + {$ELSE} + varDecimal: + Int64(FieldData^) := TVarDataD6(Value).VInt64; + {$ENDIF} + else + raise EConvertError.Create(SCannotConvertType); + end; + dtUInt32: + case VarType(Value) of + varLongWord: + {$IFDEF VER6P} + begin + // To prevent range-checking error on large values (for example, 4294967295) + i64 := Value; + lw := longword(i64); + i32 := Int32(lw); + Marshal.WriteInt32(FieldData, i32); + end; + {$ELSE} + LongWord(FieldData^) := TVarDataD6(Value).VLongWord; + {$ENDIF} + else + raise EConvertError.Create(SCannotConvertType); + end; + dtWord: + case VarType(Value) of + varSmallint,varInteger,varByte{$IFDEF VER6P},varWord{$ENDIF}: begin + i := Value; + Marshal.WriteInt16(FieldData, smallint(i)); + end + else + raise EConvertError.Create(SCannotConvertType); + end; + dtBoolean: + case VarType(Value) of + varBoolean: + Marshal.WriteInt16(FieldData, smallint(boolean(Value))); + else + raise EConvertError.Create(SCannotConvertType); + end; + dtFloat, dtCurrency: + case VarType(Value) of + varString{$IFDEF WIN32},varOleStr{$ENDIF}{$IFDEF CLR}, varChar{$ENDIF}: + Marshal.WriteInt64(FieldData, + BitConverter.DoubleToInt64Bits(SetScale(StrToFloat(Value), Fields[FieldNo - 1].Scale))); + varSmallint,varInteger,varByte: + Marshal.WriteInt64(FieldData, BitConverter.DoubleToInt64Bits(Value)); + varSingle,varDouble{$IFDEF WIN32},varCurrency{$ENDIF}: + Marshal.WriteInt64(FieldData, + BitConverter.DoubleToInt64Bits(SetScale(Value, Fields[FieldNo - 1].Scale))); + else + raise EConvertError.Create(SCannotConvertType); + end; + dtDateTime, dtDate, dtTime: begin + Date := BitConverter.DoubleToInt64Bits(Value); + PDate := OrdinalToPtr(Date); + try + PutDateToBuf(FieldData, 0, PDate, dfDateTime); + finally + FreeOrdinal(PDate); + end; + end; + dtMemo,dtBlob: // used by ODAC to refresh String as Memo + TBlob(GetGCHandleTarget(Marshal.ReadIntPtr(FieldData))).AsString := VarToStr(Value); + dtWideMemo: + TBlob(GetGCHandleTarget(Marshal.ReadIntPtr(FieldData))).AsWideString := VarToWideStr(Value); + {$IFDEF VER5P} + dtVariant: + TVariantObject(GetGCHandleTarget(Marshal.ReadIntPtr(FieldData))).Value := Value; + {$ENDIF} + dtExtString: begin + StringHeap.DisposeBuf(Marshal.ReadIntPtr(FieldData)); + Temp := Marshal.StringToHGlobalAnsi(Value); + try + Marshal.WriteIntPtr(FieldData, StringHeap.AllocStr(Temp)); + finally + Marshal.FreeCoTaskMem(Temp); + end; + end; + dtExtWideString: begin + StringHeap.DisposeBuf(Marshal.ReadIntPtr(FieldData)); + Temp := Marshal.StringToHGlobalUni(Value); + try + Marshal.WriteIntPtr(FieldData, StringHeap.AllocWideStr(Temp)); + finally + Marshal.FreeCoTaskMem(Temp); + end; + end; + dtBytes: begin + Assert(VarType(Value) = varArray + varByte, 'Invalid VType'); + {$IFDEF CLR} + SetLength(Data, VarArrayHighBound(Value, 1) + 1); + for i := 0 to High(Data) do + Data[i] := VarArrayGet(Value, i); + Marshal.Copy(Data, 0, FieldData, Length(Data)); + {$ELSE} + Assert(TVarData(Value).VArray.Bounds[0].ElementCount = Fields[FieldNo - 1].Length, 'Invalid data size'); + Move(TVarData(Value).VArray.Data^, FieldData^, Fields[FieldNo - 1].Length); + {$ENDIF} + end; + dtVarBytes: begin + Assert(VarType(Value) = varArray + varByte, 'Invalid VType'); + {$IFDEF CLR} + SetLength(Data, VarArrayHighBound(Value, 1) + 1); + for i := 0 to High(Data) do + Data[i] := VarArrayGet(Value, i); + Marshal.WriteInt16(FieldData, Length(Data)); + Marshal.Copy(Data, 0, IntPtr(Integer(FieldData) + sizeof(word)), Length(Data)); + {$ELSE} + Assert(TVarData(Value).VArray.Bounds[0].ElementCount <= Fields[FieldNo - 1].Length, 'Invalid data size'); + + Word(FieldData^) := TVarData(Value).VArray.Bounds[0].ElementCount; + Move(TVarData(Value).VArray.Data^, (PChar(FieldData) + sizeof(word))^, Word(FieldData^)); + {$ENDIF} + end; + dtExtVarBytes: begin + Assert(VarType(Value) = varArray + varByte, 'Invalid VType'); +// Assert(VarArrayHighBound(Value, 1) - VarArrayLowBound(Value, 1) + 1 <= Length, 'Invalid data size'); + + StringHeap.DisposeBuf(Marshal.ReadIntPtr(FieldData)); + l := VarArrayHighBound(Value, 1) - VarArrayLowBound(Value, 1) + 1; + Marshal.WriteIntPtr(FieldData, StringHeap.NewBuf(l + sizeof(Word))); + + Marshal.WriteInt16( Marshal.ReadIntPtr(FieldData), l); + for i:= VarArrayLowBound(Value, 1) to VarArrayHighBound(Value, 1) do + Marshal.WriteByte( IntPtr(Integer(Marshal.ReadIntPtr(FieldData)) + sizeof(word) + i - VarArrayLowBound(Value, 1)), Value[i]); + end; + dtBCD: + {$IFDEF CLR} + begin + d := Value; + d := d * 10000; + Marshal.WriteInt64(FieldData, Round(d)); + end; + {$ELSE} + PCurrency(FieldData)^ := Value; + {$ENDIF} + {$IFDEF VER6P} + dtFmtBCD: + {$IFDEF CLR} + begin + bcd := Value; + Data := TBcd.ToBytes(bcd); + Marshal.Copy(Data, 0, FieldData, SizeOfTBcd); + end; + {$ELSE} + PBcd(FieldData)^ := StrToBcd(Value); + {$ENDIF} + {$ENDIF} + dtGuid: + begin + s := VarToStr(Value); + p := Marshal.StringToHGlobalAnsi(s); + try + StrLCopy(FieldData, p, Fields[FieldNo - 1].Size); + finally + Marshal.FreeCoTaskMem(p); + end; + end; + else + raise EConvertError.Create(SCannotConvertType); + end; + + SetNull(FieldNo, RecBuf, False); +end; + +function TData.FindField(Name: string):TFieldDesc; +begin + Result := FFields.FindField(Name); +end; + +function TData.FieldByName(Name: string):TFieldDesc; +begin + Result := FFields.FieldByName(Name); +end; + +function TData.IsBlobFieldType(DataType: word): boolean; // TBlob descendants - dtBlob, dtMemo etc +begin + Result := (DataType = dtBlob) or (DataType = dtMemo) or (DataType = dtWideMemo); +end; + +function TData.IsComplexFieldType(DataType: word): boolean; // All supported complex field types (BlobFieldTypes, ExtFieldTypes and TSharedObject descendants (not BLOB)) +begin + case DataType of + dtExtString, dtExtWideString, dtExtVarBytes{$IFDEF VER5P}, dtVariant{$ENDIF}: + Result := True; + else + Result := IsBlobFieldType(DataType); + end; +end; + +function TData.HasFields(FieldTypes: TFieldTypeSet): boolean; +var + i: integer; +begin + i := 0; + while (i < FieldCount) and not (Fields[i].DataType in FieldTypes) do + Inc(i); + Result := i < FieldCount; +end; + +function TData.HasBlobFields: boolean; +var + i: integer; +begin + i := 0; + while (i < FieldCount) and not IsBlobFieldType(Fields[i].DataType) do + Inc(i); + Result := i < FieldCount; +end; + +function TData.CheckHasComplexFields: boolean; +var + i: integer; +begin + i := 0; + while (i < FieldCount) and not IsComplexFieldType(Fields[i].DataType) do + Inc(i); + Result := i < FieldCount; + FHasComplexFields := Result; +end; + +{ Records } + +function TData.AllocRecBuf(var RecBuf: IntPtr): IntPtr; +begin + RecBuf := Marshal.AllocHGlobal(RecordSize); + Result := RecBuf; +end; + +procedure TData.FreeRecBuf(RecBuf: IntPtr); +begin + Marshal.FreeHGlobal(RecBuf); +end; + +procedure TData.CreateComplexFields(RecBuf: IntPtr; WithBlob: boolean); +var + i: integer; +begin + for i := 0 to FieldCount - 1 do + CreateComplexField(RecBuf, i, WithBlob); +end; + +procedure TData.CreateComplexField(RecBuf: IntPtr; FieldIndex: integer; WithBlob: boolean); +var + Blob: TSharedObject; + FieldDesc: TFieldDesc; +begin + FieldDesc := Fields[FieldIndex]; + if FieldDesc.FieldDescKind <> fdkCalculated then + case FieldDesc.DataType of + dtBlob, dtMemo, dtWideMemo: + if WithBlob then begin + Blob := TBlob.Create; + if FieldDesc.DataType = dtWideMemo then + TBlob(Blob).IsUnicode := True; + // RollBack is always on for LOB fields. Otherwise modification + // that cannot be canceled is possible. + TBlob(Blob).EnableRollback; + SetObject(FieldIndex + 1, RecBuf, Blob); + end; + {$IFDEF VER5P} + dtVariant: + begin + Blob := TVariantObject.Create; + Marshal.WriteIntPtr(RecBuf, FieldDesc.Offset, Blob.GCHandle); + end; + {$ENDIF} + dtExtString, dtExtWideString, dtExtVarBytes: + Marshal.WriteIntPtr(RecBuf, FieldDesc.Offset, nil); + end; +end; + + +procedure TData.AddRefComplexFields(RecBuf: IntPtr); +var + i: integer; + so: TSharedObject; +begin + for i := 0 to FieldCount - 1 do + if Fields[i].DataType in [dtExtString, dtExtWideString, dtExtVarBytes] then + StringHeap.AddRef(Marshal.ReadIntPtr(RecBuf, Fields[i].Offset)) + else + if IsComplexFieldType(Fields[i].DataType) and not Fields[i].HasParent then begin + so := TSharedObject(GetGCHandleTarget(Marshal.ReadIntPtr(RecBuf, Fields[i].Offset))); + Assert(so <> nil, 'Shared object for ' + Fields[i].Name + '=nil'); + so.AddRef; + end; +end; + +procedure TData.FreeComplexFields(RecBuf: IntPtr; WithBlob: boolean); +var + i: integer; + Handle: IntPtr; + so: TSharedObject; + b: boolean; + Field: TFieldDesc; +begin + for i := 0 to FieldCount - 1 do begin + Field := Fields[i]; + if Field.FieldDescKind <> fdkCalculated then + case Field.DataType of + dtBlob, dtMemo, dtWideMemo: + if WithBlob then begin + Handle := Marshal.ReadIntPtr(RecBuf, Field.Offset); + so := TSharedObject(GetGCHandleTarget(Handle)); + // see TSharedObject.Free for details + b := (so <> nil) and (so.RefCount = 1); + so.Free; + if b then + Marshal.WriteIntPtr(RecBuf, Field.Offset, nil); + end; + {$IFDEF VER5P} + dtVariant: begin + Handle := Marshal.ReadIntPtr(RecBuf, Field.Offset); + TVariantObject(GetGCHandleTarget(Handle)).Free; + end; + {$ENDIF} + dtExtString, dtExtWideString, dtExtVarBytes: + if not StringHeap.Empty then begin + Handle := Marshal.ReadIntPtr(RecBuf, Field.Offset); + if (Handle <> nil) and (Marshal.ReadInt16(IntPtr(Integer(Handle) - SizeOf(Word))) = RefNull) then + Handle := nil; + StringHeap.DisposeBuf(Marshal.ReadIntPtr(RecBuf, Field.Offset)); + Marshal.WriteIntPtr(RecBuf, Field.Offset, Handle) + end; + end; + end; +end; + +procedure TData.CopyComplexFields(Source: IntPtr; Dest: IntPtr; WithBlob: boolean); +var + i, l: integer; + SrcPtr: IntPtr; + DestPtr: IntPtr; +begin + if WithBlob then + Assert(False); + + for i := 0 to FieldCount - 1 do + case Fields[i].DataType of + dtExtString: begin + SrcPtr := Marshal.ReadIntPtr(Source, Fields[i].Offset); + Marshal.WriteIntPtr(Dest, Fields[i].Offset, StringHeap.AllocStr(SrcPtr)); + end; + dtExtWideString: begin + SrcPtr := Marshal.ReadIntPtr(Source, Fields[i].Offset); + Marshal.WriteIntPtr(Dest, Fields[i].Offset, StringHeap.AllocWideStr(SrcPtr)); + end; + dtExtVarBytes: begin + SrcPtr := Marshal.ReadIntPtr(Source, Fields[i].Offset); + DestPtr := IntPtr(Integer(Dest) + Fields[i].Offset); + if SrcPtr = nil then + Marshal.WriteIntPtr(DestPtr, nil) + else begin + l := Marshal.ReadInt16(IntPtr(SrcPtr)) + SizeOf(Word); + Marshal.WriteIntPtr(DestPtr, StringHeap.NewBuf(l)); + CopyBuffer(SrcPtr, Marshal.ReadIntPtr(DestPtr), l); + end + end; + {$IFDEF VER5P} + dtVariant: + TVariantObject(GetGCHandleTarget(Marshal.ReadIntPtr(Dest, Fields[i].Offset))).Value := + TVariantObject(GetGCHandleTarget(Marshal.ReadIntPtr(Source, Fields[i].Offset))).Value; + {$ENDIF} + end; +end; + +procedure TData.InitRecord(RecBuf: IntPtr); +var + i: integer; +begin +// Complex fields need create later + if HasComplexFields then // clear pointer to complex field + FillChar(RecBuf, RecordSize, 0); + + for i := 1 to FieldCount do + SetNull(i, RecBuf, True); +end; + +procedure TData.AppendBlankRecord; +var + RecBuf: IntPtr; +begin + AllocRecBuf(RecBuf); + try + InitRecord(RecBuf); + AppendRecord(RecBuf); + finally + FreeRecBuf(RecBuf); + end; +end; + +procedure TData.EditRecord(RecBuf: IntPtr); +var + TempBuf: IntPtr; +begin + AllocRecBuf(TempBuf); + try + GetRecord(TempBuf); + CreateComplexFields(TempBuf, False); // Blobs uses internal cache + CopyComplexFields(RecBuf, TempBuf, False); + PutRecord(TempBuf); + + {if IsBlobFields then + for i:= 0 to FieldCount - 1 do + if Fields[i].DataType in BlobFieldTypes then + TBlob(Pointer(PChar(RecBuf) + Fields[i].Offset)^).EnableRollback;} + finally + FreeRecBuf(TempBuf); + end; +end; + +procedure TData.PostRecord(RecBuf: IntPtr); +var + i: integer; + TempBuf: IntPtr; + Blob: TBlob; +begin + AllocRecBuf(TempBuf); + try + GetRecord(TempBuf); + + UpdateRecord(RecBuf); + + if HasBlobFields then + for i := 0 to FieldCount - 1 do + if IsBlobFieldType(Fields[i].DataType) then begin + Blob := TBlob(InternalGetObject(Fields[i].FieldNo, RecBuf)); + if Blob <> nil then + Blob.Commit; + end; + + FreeComplexFields(TempBuf, False); + finally + FreeRecBuf(TempBuf); + end; +end; + +procedure TData.CancelRecord(RecBuf: IntPtr); +var + i: integer; + Blob: TBlob; +begin + if HasBlobFields then + for i := 0 to FieldCount - 1 do + if IsBlobFieldType(Fields[i].DataType) then begin + Blob := TBlob(InternalGetObject(Fields[i].FieldNo, RecBuf)); + if Blob <> nil then + Blob.Cancel; + end; + + FreeComplexFields(RecBuf, False); +end; + +{ Edit } + +procedure TData.InternalAppend(RecBuf: IntPtr); +begin + if Assigned(FOnAppend) then + FOnAppend; +end; + +procedure TData.InternalDelete; +begin + if Assigned(FOnDelete) then + FOnDelete; +end; + +procedure TData.InternalUpdate(RecBuf: IntPtr); +begin + if Assigned(FOnUpdate) then + FOnUpdate; +end; + +procedure TData.ApplyRecord(UpdateKind:TUpdateRecKind; var Action:TUpdateRecAction; LastItem: boolean); +begin + if Assigned(FOnApplyRecord) then + FOnApplyRecord(UpdateKind, Action, LastItem); +end; + +{ Navigation } + +function TData.GetEOF: boolean; +begin + Result := FEOF; +end; + +function TData.GetBOF: boolean; +begin + Result := FBOF; +end; + +procedure TData.SetToBegin; +begin + FBOF := True; + FEOF := False; +end; + +procedure TData.SetToEnd; +begin + FEOF := True; + FBOF := False; +end; + +function TData.GetRecordCount: longint; +begin + Result := -1; +end; + +function TData.GetRecordNo: longint; +begin + Result := -1; +end; + +procedure TData.SetRecordNo(Value: longint); +begin +end; + +{ BookMarks } + +procedure TData.GetBookmark(Bookmark: PRecBookmark); +begin + Bookmark.Order := RecordNo; +end; + +procedure TData.SetToBookmark(Bookmark: PRecBookmark); +begin + if Bookmark.Order <> -1 then + SetRecordNo(Bookmark.Order); +end; + +function TData.BookmarkValid(Bookmark: PRecBookmark): boolean; +begin + if IntPtr(Bookmark) <> nil then + Result := Bookmark.Order <> -1 + else + Result := False; +end; + +function TData.CompareBookmarks(Bookmark1, Bookmark2: PRecBookmark): integer; +const + RetCodes: array[Boolean, Boolean] of ShortInt = ((2,-1),(1,0)); +begin + Result := RetCodes[IntPtr(Bookmark1) = nil, IntPtr(Bookmark2) = nil]; + if Result = 2 then begin + if Bookmark1.Order >= Bookmark2.Order then + if Bookmark1.Order = Bookmark2.Order then + Result := 0 + else + Result := 1 + else + Result := -1 + end; +end; + +{ CachedUpdates } + +function TData.GetUpdateStatus: TItemStatus; +begin + Result := isUnmodified; +end; + +function TData.GetUpdateResult: TUpdateRecAction; +begin + Result := urNone; +end; + +procedure TData.SetCacheRecBuf(NewBuf: IntPtr; OldBuf: IntPtr); +begin +end; + +procedure TData.ApplyUpdates; +begin +end; + +procedure TData.CommitUpdates; +begin +end; + +procedure TData.CancelUpdates; +begin +end; + +procedure TData.RestoreUpdates; +begin +end; + +procedure TData.RevertRecord; +begin +end; + +function TData.GetUpdatesPending: boolean; +begin + Result := False; +end; + +procedure TData.GetOldRecord(RecBuf: IntPtr); +begin +end; + +{ Filter } + +function TData.AllocNode: TExpressionNode; +begin + Result := TExpressionNode.Create; + Result.NextAlloc := FirstAlloc; + FirstAlloc := Result; + Result.LeftOperand := nil; + Result.RightOperand := nil; + Result.NextOperand := nil; +end; + +procedure TData.FilterError; +begin + raise Exception.Create(SIllegalFilter); +end; + +function TData.OrExpr: TExpressionNode; +var + Node: TExpressionNode; +begin + Result := AndExpr; + while Code = lxOR do begin + Code := Parser.GetNext(StrLexem); + Node := AllocNode; + Node.NodeType := ntOr; + Node.LeftOperand := Result; + Node.RightOperand := AndExpr; + Result := Node; + end; +end; + +function TData.AndExpr: TExpressionNode; +var + Node: TExpressionNode; +begin + Result := Condition; + while Code = lxAND do begin + Code := Parser.GetNext(StrLexem); + Node := AllocNode; + Node.NodeType := ntAnd; + Node.LeftOperand := Result; + Node.RightOperand := Condition; + Result := Node; + end; +end; + +function TData.Condition: TExpressionNode; +var + OpCode: integer; +begin + Result := nil; + if (Code = lcIdent) or (Code = lcNumber) or (Code = lcString) or + (Code in [lxMinus, lxPlus, lxLeftSqBracket, lxRightSqBracket]) + then begin + Result := AllocNode; + Result.LeftOperand := Argument; + OpCode := Code; + case Code of + lxEqual, lxIS: + Result.NodeType := ntEqual; + lxMore: + Result.NodeType := ntMore; + lxLess: + Result.NodeType := ntLess; + lxMoreEqual: + Result.NodeType := ntMoreEqual; + lxLessEqual: + Result.NodeType := ntLessEqual; + lxNoEqual: + Result.NodeType := ntNoEqual; + lxLike: + Result.NodeType := ntLike; + else + FilterError; + end; + Code := Parser.GetNext(StrLexem); + if OpCode = lxIS then begin + if Code = lxNOT then begin + Code := Parser.GetNext(StrLexem); + if Code <> lxNULL then + FilterError; + Result.NodeType := ntNoEqual; + end + else if Code <> lxNULL then + FilterError; + end; + Result.RightOperand := Argument; + end + else + if Code = lxNOT then begin + Code := Parser.GetNext(StrLexem); + Result := AllocNode; + Result.NodeType := ntNot; + Result.LeftOperand := Condition; + end + else + if Code = lxTRUE then begin + Code := Parser.GetNext(StrLexem); + Result := AllocNode; + Result.NodeType := ntTrue; + end + else + if Code = lxFALSE then begin + Code := Parser.GetNext(StrLexem); + Result := AllocNode; + Result.NodeType := ntFalse; + end + else + if Code = lxLeftBracket then begin + Code := Parser.GetNext(StrLexem); + Result := OrExpr; + if Code = lxRightBracket then + Code := Parser.GetNext(StrLexem) + else + FilterError; + end + else + FilterError; +end; + +{$IFNDEF VER6P} +function AnsiExtractQuotedStr(var Src: PChar; Quote: Char): string; +var + P, Dest: PChar; + DropCount: Integer; +begin + Result := ''; + if (Src = nil) or (Src^ <> Quote) then Exit; + Inc(Src); + DropCount := 1; + P := Src; + Src := AnsiStrScan(Src, Quote); + while Src <> nil do // count adjacent pairs of quote chars + begin + Inc(Src); + if Src^ <> Quote then Break; + Inc(Src); + Inc(DropCount); + Src := AnsiStrScan(Src, Quote); + end; + if Src = nil then Src := StrEnd(P); + if ((Src - P) <= 1) then Exit; + if DropCount = 1 then + SetString(Result, P, Src - P - 1) + else + begin + SetLength(Result, Src - P - DropCount); + Dest := PChar(Result); + Src := AnsiStrScan(P, Quote); + while Src <> nil do + begin + Inc(Src); + if Src^ <> Quote then Break; + Move(P^, Dest^, Src - P); + Inc(Dest, Src - P); + Inc(Src); + P := Src; + Src := AnsiStrScan(Src, Quote); + end; + if Src = nil then Src := StrEnd(P); + Move(P^, Dest^, Src - P - 1); + end; +end; + +function AnsiDequotedStr(const S: string; AQuote: Char): string; +var + LText: PChar; +begin + LText := PChar(S); + Result := AnsiExtractQuotedStr(LText, AQuote); + if Result = '' then + Result := S; +end; +{$ENDIF} + +function TData.Argument: TExpressionNode; +var + Field: TFieldDesc; + FieldName: string; + ASign: string; + + function ParseFieldName(FirstPart: string): string; + begin + Result := FirstPart; + Code := Parser.GetNext(StrLexem); + if StrLexem = '.' then + repeat + Code := Parser.GetNext(StrLexem); + if Code = lcIdent then + Result := Result + '.' + StrLexem + else + break; + Code := Parser.GetNext(StrLexem); + until StrLexem <> '.'; + end; +begin + Result := AllocNode; + case Code of + lcIdent: begin + FieldName := ParseFieldName(StrLexem); + Field := FindField(FieldName); + if Field = nil then + raise Exception.Create(Format(SFieldNotFound, [FieldName])); + Result.NodeType := ntField; + Result.FieldDesc := Field; + Result.Value := StrLexem; + Exit; + end; + lxLeftSqBracket: begin + FieldName := ''; + Parser.OmitBlank := False; + Code := Parser.GetNext(StrLexem); + while (Code <> lxRightSqBracket) and (Code <> lcEnd) do begin + FieldName := FieldName + StrLexem; + Code := Parser.GetNext(StrLexem); + end; + Parser.OmitBlank := True; + Field := FindField(FieldName); + if Field = nil then + raise Exception.Create(Format(SFieldNotFound, [FieldName])); + Result.NodeType := ntField; + Result.FieldDesc := Field; + Result.Value := FieldName; + end; + lcString: begin + Result.NodeType := ntValue; + Result.Value := AnsiDequotedStr('''' + StrLexem + '''', ''''); // TODO Optimize with StringBuilder + end; + lcNumber: begin + Result.NodeType := ntValue; + Result.Value := StrToFloat(StrLexem); + end; + lxMinus,lxPlus: begin + Result.NodeType := ntValue; + ASign := StrLexem; + Code := Parser.GetNext(StrLexem); + if Code = lcNumber then + Result.Value := StrToFloat(ASign + StrLexem) + else + FilterError; + end; + lxNULL: begin + Result.NodeType := ntValue; + Result.Value := Null; + end; + lxTRUE: begin + Result.NodeType := ntValue; + Result.Value := True; + end; + lxFALSE: begin + Result.NodeType := ntValue; + Result.Value := False; + end; + else + FilterError; + end; + + Code := Parser.GetNext(StrLexem); +end; + +procedure TData.CreateFilterExpression(Text: string); +begin + FreeFilterExpression; + if Trim(Text) <> '' then begin + Parser := TBoolParser.Create(Text); + try + try + Parser.ToBegin(); + Code := Parser.GetNext(StrLexem); + FilterExpression := OrExpr(); + + if (Code <> lcEnd) then + FilterError; + except + FreeFilterExpression; + raise; + end; + finally + Parser.Free; + end; + end; +end; + +procedure TData.FreeFilterExpression; +var + Node: TExpressionNode; +begin + while FirstAlloc <> nil do begin + Node := FirstAlloc; + FirstAlloc := FirstAlloc.NextAlloc; + Node.Free; + end; + FilterExpression := nil; +end; + +function TData.Eval(Node: TExpressionNode): boolean; + + function VarIsString(const V: Variant): boolean; + begin + Result := (VarType(V) = varString){$IFDEF WIN32} or (VarType(V) = varOleStr){$ENDIF}{$IFDEF CLR} or (VarType(V) = varChar){$ENDIF}; + end; + +var + V1,V2: variant; + DateField1: boolean; + DateField2: boolean; + FieldDesc: TFieldDesc; + + function MatchesMask(St: string; Mask: string): boolean; + const + WildcardAst = '*'; + WildcardPct = '%'; + WildcardOne = '_'; + type + TMatchesResult = (mrFalse,mrTrue,mrEnd); + + function SubMatchesMask(StIndex, MaskIndex: integer): TMatchesResult; + begin + while (MaskIndex <= Length(Mask)) and + ((StIndex <= Length(St)) or + ((Mask[MaskIndex] = WildcardAst) or (Mask[MaskIndex] = WildcardPct))) do begin + if (Mask[MaskIndex] = WildcardAst) or (Mask[MaskIndex] = WildcardPct) then begin + if MaskIndex = Length(Mask) then begin //- + Result := mrTrue; // Speed up + Exit; // with mask '*' + end //- + else + case SubMatchesMask(StIndex, MaskIndex + 1) of + mrTrue: begin + Result := mrTrue; + Exit; + end; + mrFalse: + if StIndex > Length(St) then begin + Result := mrEnd; + Exit; + end + else + Inc(StIndex); + mrEnd: begin + Result := mrEnd; + Exit; + end; + end; + end + else + if (St[StIndex] = Mask[MaskIndex]) or (Mask[MaskIndex] = WildcardOne) + then begin + Inc(StIndex); + Inc(MaskIndex); + end + else begin + Result := mrFalse; + Exit; + end; + end; + + if StIndex > Length(St) then + if MaskIndex > Length(Mask) then + Result := mrTrue + else + Result := mrEnd + else + Result := mrFalse; + end; + begin + Result := SubMatchesMask(1, 1) = mrTrue; + end; + +{$IFNDEF VER6P} + function TryStrToDateTime(const S: string; out Value: TDateTime): Boolean; + begin + try + Value := StrToDateTime(s); + Result := True; + except + Result := False; + end; + end; +{$ENDIF} + + procedure NormalizeDateField(var V: Variant); +{$IFNDEF CLR} + var + d: TDateTime; +{$ENDIF} + begin + if VarIsString(V) then + {$IFDEF CLR} + V := TDateTime(V); + {$ELSE} + if TryStrToDateTime(V, d) then + V := d + else + V := VarToDateTime(V); + {$ENDIF} + end; + +begin + Assert(Node <> nil); + + Result := False; + + if Node.NodeType in [ntEqual, ntMore, ntLess, ntMoreEqual, ntLessEqual, + ntNoEqual, ntLike] + then begin + Assert(Node.LeftOperand <> nil); + Assert(Node.RightOperand <> nil); + + DateField1 := False; + DateField2 := False; + + case Node.LeftOperand.NodeType of + ntField: begin + FieldDesc := Node.LeftOperand.FieldDesc; + GetFieldAsVariant(FieldDesc.FieldNo, FilterRecBuf, V1); + DateField1 := FieldDesc.DataType in [dtDateTime, dtDate, dtTime]; + end; + ntValue: + V1 := Node.LeftOperand.Value; + end; + + case Node.RightOperand.NodeType of + ntField: begin + FieldDesc := Node.RightOperand.FieldDesc; + GetFieldAsVariant(FieldDesc.FieldNo, FilterRecBuf, V2); + DateField2 := FieldDesc.DataType in [dtDateTime, dtDate, dtTime]; + end; + ntValue: + V2 := Node.RightOperand.Value; + end; + + if DateField1 then + NormalizeDateField(V2); /// CR-D12823 + if DateField2 then + NormalizeDateField(V1); + + if FilterCaseInsensitive then begin + if VarIsString(V1) then + V1 := AnsiUpperCase(VarToStr(V1)); + if VarIsString(V2) then + V2 := AnsiUpperCase(VarToStr(V2)); + end; + +// if FilterNoPartialCompare then; + + end; + + if (VarIsNull(V1) or VarIsNull(V2)) and (Node.NodeType in [ntMore, ntLess, ntMoreEqual, ntLessEqual]) then begin + // To prevent exception on compare value with Null + Result := False; + Exit; + end; + + case Node.NodeType of + ntEqual, ntLike: + if FilterNoPartialCompare or not VarIsString(V1) then + Result := V1 = V2 + else + Result := MatchesMask(VarToStr(V1), VarToStr(V2)); + ntNoEqual: + if FilterNoPartialCompare or not VarIsString(V1) then + Result := V1 <> V2 + else + Result := not MatchesMask(VarToStr(V1), VarToStr(V2)); + ntMore: + Result := V1 > V2; + ntLess: + Result := V1 < V2; + ntMoreEqual: + Result := V1 >= V2; + ntLessEqual: + Result := V1 <= V2; + ntAnd: + Result := Eval(Node.LeftOperand) and Eval(Node.RightOperand); + ntOr: + Result := Eval(Node.LeftOperand) or Eval(Node.RightOperand); + ntNot: + Result := not Eval(Node.LeftOperand); + ntTrue: + Result := True; + ntFalse: + Result := False; + else + Assert(False); + end; +end; + +procedure TData.FilterUpdated; +begin +end; + +function TData.Filtered: boolean; +begin + Result := Assigned(FFilterFunc) or Assigned(FilterExpression) or + Assigned(FFilterMDFunc); +end; + +{ Blobs } + +function TData.InternalGetObject(FieldNo: word; RecBuf: IntPtr): TSharedObject; +var + IsBlank: boolean; + Ptr: IntPtr; +begin + Ptr := Marshal.AllocHGlobal(sizeof(IntPtr)); + try + GetField(FieldNo, RecBuf, Ptr, IsBlank); + Result := TSharedObject(GetGCHandleTarget(Marshal.ReadIntPtr(Ptr))); + finally + Marshal.FreeHGlobal(Ptr); + end; +end; + +function TData.GetObject(FieldNo: word; RecBuf: IntPtr): TSharedObject; +begin + if not IsBlobFieldType(Fields[FieldNo - 1].DataType) then + raise Exception.Create(SNeedBlobType); + + Result := InternalGetObject(FieldNo, RecBuf); + + Assert(Result <> nil, 'Object for field ' + Fields[FieldNo - 1].Name + '(' + IntToStr(FieldNo) + ') = nil'); +end; + +procedure TData.SetObject(FieldNo: word; RecBuf: IntPtr; Obj: TSharedObject); +begin + if not IsBlobFieldType(Fields[FieldNo - 1].DataType) then + raise Exception.Create(SNeedBlobType); + + Marshal.WriteIntPtr(RecBuf, Fields[FieldNo - 1].Offset, Obj.GCHandle); +end; + +{$IFDEF VER6} +{$IFDEF MSWINDOWS} +var + DefaultUserCodePage: Integer; +{$ENDIF} + +type + PStrRec = ^StrRec; + StrRec = packed record + refCnt: Longint; + length: Longint; + end; + +{$IFDEF LINUX} +const + libc = 'libc.so.6'; + +const + LC_CTYPE = 0; + _NL_CTYPE_CODESET_NAME = LC_CTYPE shl 16 + 14; + +function iconv_open(ToCode: PChar; FromCode: PChar): Integer; cdecl; + external libc name 'iconv_open'; + +function nl_langinfo(item: integer): pchar; cdecl; + external libc name 'nl_langinfo'; + +function iconv(cd: Integer; var InBuf; var InBytesLeft: Integer; var OutBuf; var OutBytesLeft: Integer): Integer; cdecl; + external libc name 'iconv'; + +function iconv_close(cd: Integer): Integer; cdecl; + external libc name 'iconv_close'; + +function CharacterSizeWideChar(P: Pointer; MaxLen: Integer): Integer; +begin + Result := SizeOf(WideChar); +end; + +procedure LocaleConversionError; +begin + Error(TRuntimeError(234) {reCodesetConversion}); +end; + +type + TCharacterSizeProc = function(P: Pointer; MaxLen: Integer): Integer; + +function __errno_location: PInteger; cdecl; + external libc name '__errno_location'; + +function GetLastError: Integer; +begin + Result := __errno_location^; +end; + +function BufConvert(var Dest; DestBytes: Integer; + const Source; SrcBytes: Integer; + context: Integer; + DestCharSize: Integer; + SourceCharSize: TCharacterSizeProc): Integer; +const + E2BIG = 7; + EINVAL = 22; + EILSEQ = 84; +const + UnknownCharIndicator = '?'; +var + SrcBytesLeft, DestBytesLeft, Zero: Integer; + s, d, pNil: Pointer; + LastError: Integer; + cs: Integer; +begin + Result := -1; + + // Make copies of parameters. iconv modifies param pointers. + DestBytesLeft := DestBytes; + SrcBytesLeft := SrcBytes; + s := Pointer(Source); + d := Pointer(Dest); + + while True do + begin + Result := iconv(context, s, SrcBytesLeft, d, DestBytesLeft); + if Result <> -1 then + Break + else + begin + LastError := GetLastError; + if (LastError = E2BIG) and (SrcBytesLeft > 0) and (DestBytesLeft > 0) then + Continue; + + if (LastError <> EINVAL) and (LastError <> EILSEQ) then + LocaleConversionError; + pNil := nil; + Zero := 0; + iconv(context, pNil, Zero, pNil, Zero); // Reset state of context + + // Invalid input character in conversion stream. + // Skip input character and write '?' to output stream. + // The glibc iconv() implementation also returns EILSEQ + // for a valid input character that cannot be converted + // into the requested codeset. + cs := SourceCharSize(s, SrcBytesLeft); + Inc(Cardinal(s), cs); + Dec(SrcBytesLeft, cs); + + Assert(DestCharSize in [1, 2]); + case DestCharSize of + 1: + begin + PChar(d)^ := UnknownCharIndicator; + Inc(PChar(d)); + Dec(DestBytesLeft, SizeOf(Char)); + end; + + 2: + begin + PWideChar(d)^ := UnknownCharIndicator; + Inc(PWideChar(d)); + Dec(DestBytesLeft, SizeOf(WideChar)); + end; + end; + end; + end; + + if Result <> -1 then + Result := DestBytes - DestBytesLeft; +end; +{$ENDIF} + +function CharFromWCharD7(CharDest: PChar; DestBytes: Integer; const WCharSource: PWideChar; SrcChars: Integer): Integer; +{$IFDEF LINUX} +var + IconvContext: Integer; +{$ENDIF} +begin +{$IFDEF LINUX} + if (DestBytes <> 0) and (SrcChars <> 0) then + begin + IconvContext := iconv_open(nl_langinfo(_NL_CTYPE_CODESET_NAME), 'UNICODELITTLE'); + if IconvContext = -1 then + LocaleConversionError; + try + Result := BufConvert(CharDest, DestBytes, WCharSource, SrcChars * SizeOf(WideChar), + IconvContext, 1, CharacterSizeWideChar); + finally + iconv_close(IconvContext); + end; + end + else + Result := 0; +{$ENDIF} +{$IFDEF MSWINDOWS} + Result := WideCharToMultiByte(DefaultUserCodePage, 0, WCharSource, SrcChars, + CharDest, DestBytes, nil, nil); +{$ENDIF} +end; + +procedure _LStrClr(var S); +var + P: PStrRec; +begin + if Pointer(S) <> nil then + begin + P := Pointer(Integer(S) - Sizeof(StrRec)); + Pointer(S) := nil; + if P.refCnt > 0 then + if InterlockedDecrement(P.refCnt) = 0 then + FreeMem(P); + end; +end; + +function _NewAnsiString(length: Longint): Pointer; +var + P: PStrRec; +begin + Result := nil; + if length <= 0 then Exit; + // Alloc an extra null for strings with even length. This has no actual cost + // since the allocator will round up the request to an even size anyway. + // All widestring allocations have even length, and need a double null terminator. + GetMem(P, length + sizeof(StrRec) + 1 + ((length + 1) and 1)); + Result := Pointer(Integer(P) + sizeof(StrRec)); + P.length := length; + P.refcnt := 1; + PWideChar(Result)[length div 2] := #0; // length guaranteed >= 2 +end; + +procedure _LStrFromPCharLen(var Dest: AnsiString; Source: PAnsiChar; Length: Integer); +asm + { -> EAX pointer to dest } + { EDX source } + { ECX length } + + PUSH EBX + PUSH ESI + PUSH EDI + + MOV EBX,EAX + MOV ESI,EDX + MOV EDI,ECX + + { allocate new string } + + MOV EAX,EDI + + CALL _NewAnsiString + MOV ECX,EDI + MOV EDI,EAX + + TEST ESI,ESI + JE @@noMove + + MOV EDX,EAX + MOV EAX,ESI + CALL Move + + { assign the result to dest } + +@@noMove: + MOV EAX,EBX + CALL _LStrClr + MOV [EBX],EDI + + POP EDI + POP ESI + POP EBX +end; + +procedure _LStrFromPWCharLenD7(var Dest: AnsiString; Source: PWideChar; Length: Integer); +var + DestLen: Integer; + Buffer: array[0..4095] of Char; +begin + if Length <= 0 then + begin + _LStrClr(Dest); + Exit; + end; + if Length+1 < (High(Buffer) div sizeof(WideChar)) then + begin + DestLen := CharFromWCharD7(Buffer, High(Buffer), Source, Length); + if DestLen >= 0 then + begin + _LStrFromPCharLen(Dest, Buffer, DestLen); + Exit; + end; + end; + + DestLen := (Length + 1) * sizeof(WideChar); + SetLength(Dest, DestLen); // overallocate, trim later + DestLen := CharFromWCharD7(Pointer(Dest), DestLen, Source, Length); + if DestLen < 0 then DestLen := 0; + SetLength(Dest, DestLen); +end; + +procedure _LStrFromWStrD7(var Dest: AnsiString; const Source: WideString); +asm + { -> EAX pointer to dest } + { EDX pointer to WideString data } + + XOR ECX,ECX + TEST EDX,EDX + JE @@1 + MOV ECX,[EDX-4] + SHR ECX,1 +@@1: JMP _LStrFromPWCharLenD7 +end; +{$ENDIF} + +function TData.ReadBlob(FieldNo: word; RecBuf: IntPtr; Position: longint; + Count: longint; Dest: IntPtr; FromRollback: boolean = false; + TrueUnicode: boolean = False): longint; +var + Blob: TBlob; + LenBytes, BlobPos: longint; + Ws, Buf: IntPtr; + s: string; + +begin + Blob := TBlob(GetObject(FieldNo, RecBuf)); + if FromRollback and (Blob.Rollback <> nil) then + Blob := Blob.Rollback; + + if not Blob.FIsUnicode or TrueUnicode then + Result := Blob.Read(Position, Count, Dest) + else + begin + BlobPos := Blob.TranslatePosition(Position); + if Count = 0 then + LenBytes := LongInt(Blob.Size) - BlobPos + else + LenBytes := Blob.TranslatePosition(Count); + + Ws := Marshal.AllocHGlobal(LenBytes); + Buf := nil; + try + Result := Blob.Read(BlobPos, LenBytes, Ws); + {$IFNDEF VER6} + s := Marshal.PtrToStringUni(Ws, Result div 2); + {$ELSE} + _LStrFromWStrD7(s, Marshal.PtrToStringUni(Ws, Result div 2)); + {$ENDIF} + Result := Length(s); + Buf := Marshal.StringToHGlobalAnsi(s); + CopyBuffer(Buf, Dest, Result); + finally + Marshal.FreeHGlobal(Ws); + if Buf <> nil then + Marshal.FreeCoTaskMem(Buf); + end; + end; +end; + +procedure TData.WriteBlob(FieldNo: word; RecBuf: IntPtr; Position: longint; + Count: longint; Source: IntPtr; TrueUnicode: boolean = False); +var + Blob: TBlob; + Buf: IntPtr; + S: string; + Ws: WideString; + +begin + Blob := TBlob(GetObject(FieldNo, RecBuf)); + + Blob.EnableRollback; + if not Blob.FIsUnicode or TrueUnicode then + Blob.Write(Position, Count, Source) + else begin + S := Marshal.PtrToStringAnsi(Source, Count); + Ws := S; + Count := Length(Ws) * 2; // for MBCS this differ from Count * 2 + Position := Blob.TranslatePosition(Position); + Buf := Marshal.StringToHGlobalUni(Ws); + try + Blob.Write(Position, Count, Buf); //Count length in bytes + finally + Marshal.FreeCoTaskMem(Buf); + end; + end; + + SetNull(FieldNo, RecBuf, False); +end; + +procedure TData.TruncateBlob(FieldNo: word; RecBuf: IntPtr; Size: longint; + TrueUnicode: boolean = False); +var + Blob:TBlob; +begin + Blob := TBlob(GetObject(FieldNo, RecBuf)); + + Blob.EnableRollback; + if Blob.FIsUnicode and not TrueUnicode then + Size := Blob.TranslatePosition(Size); + + Blob.Truncate(Size); + + if Size = 0 then + SetNull(FieldNo, RecBuf, True); +end; + +function TData.GetBlobSize(FieldNo: word; RecBuf: IntPtr; FromRollback: boolean = false; + TrueUnicode: boolean = False): longint; +var + Blob: TBlob; +begin + if GetNull(FieldNo, RecBuf) then begin + Result := 0; + Exit; + end; + Blob := TBlob(GetObject(FieldNo, RecBuf)); + if FromRollback and (Blob.Rollback <> nil) then + Blob := Blob.Rollback; + if not Blob.FIsUnicode or TrueUnicode then + Result := Blob.Size + else + Result := Blob.GetSizeAnsi; +end; + +procedure TData.SetBlobSize(FieldNo: word; RecBuf: IntPtr; NewSize: longint; FromRollback: boolean = false; + TrueUnicode: boolean = False); +var + Blob: TBlob; + OldSize: integer; +begin + SetNull(FieldNo, RecBuf, False); + + Blob := TBlob(GetObject(FieldNo, RecBuf)); + if FromRollback and (Blob.Rollback <> nil) then + Blob := Blob.Rollback; + + if Blob.FIsUnicode and not TrueUnicode then begin + // Blob.Size is char count * 2 + OldSize := Blob.GetSizeAnsi; + if NewSize > OldSize then + Blob.Size := Integer(Blob.Size) + (NewSize - OldSize) * 2 + else + Blob.Size := Blob.TranslatePosition(NewSize); + end + else + Blob.Size := NewSize; +end; + +procedure TData.SetCachedUpdates(Value: boolean); +begin + if Value <> FCachedUpdates then begin + if FCachedUpdates then + CancelUpdates; + + FCachedUpdates := Value; + + if FCachedUpdates then + FFilterItemTypes := [isUnmodified, isUpdated, isAppended]; + end; +end; + +procedure TData.SetFilterText(Value: string); +begin + if Value <> FFilterText then begin + if Active then + CreateFilterExpression(Value); + FFilterText := Value; + end; +end; + +procedure TData.SetFilterItemTypes(Value:TItemTypes); +begin + FFilterItemTypes := Value; +end; + +{ TSortColumns } + +destructor TSortColumns.Destroy; +begin + Clear; + + inherited; +end; + +procedure TSortColumns.Clear; +var + i: integer; +begin + for i := 0 to Count - 1 do + if Items[i] <> nil then + TSortColumn(Items[i]).Free; + + inherited Clear; +end; + +function TSortColumns.GetItems(Index: integer): TSortColumn; +begin + Result := TSortColumn(inherited Items[Index]); +end; + +{ TMemData } + +constructor TMemData.Create; +begin + inherited; + + BlockMan := TBlockManager.Create; + FIndexFields := TSortColumns.Create; + + InitData; +end; + +destructor TMemData.Destroy; +begin + inherited; + + FIndexFields.Free; + BlockMan.Free; + SetLength(FRecordNoCache, 0); +end; + +{ Items / Data } + +procedure TMemData.SetIndexFieldNames(Value: string); +begin + FIndexFieldNames := Value; + if Active then begin + UpdateIndexFields; + SortItems; + end; +end; + +procedure TMemData.UpdateIndexFields; +var + S, S1: string; + FldName: string; + FieldDesc: TFieldDesc; + SortColumn: TSortColumn; + ProcessedCS, ProcessedDESC: boolean; + + procedure RaiseError; + begin + raise Exception.Create('Invalid IndexFieldNames format!'); + end; + +begin + FIndexFields.Clear; + S := FIndexFieldNames; + if Trim(S) <> '' then begin + Parser := TBoolParser.Create(S); + + try + Parser.ToBegin(); + Code := Parser.GetNext(S1); + while Code <> lcEnd do begin + case Code of + lcIdent, lcString, lxLeftSqBracket: begin + if Code = lxLeftSqBracket then begin + Parser.OmitBlank := False; + Code := Parser.GetNext(S1); + FldName := ''; + while (Code <> lxRightSqBracket) and (Code <> lcEnd) do begin + FldName := FldName + S1; + Code := Parser.GetNext(S1); + end; + Parser.OmitBlank := True; + S1 := FldName; + end; + + FieldDesc := Fields.FindField(S1); + if FieldDesc = nil then + raise Exception.Create(Format(SFieldNotFound, [S1])); + SortColumn := TSortColumn.Create; + SortColumn.FieldDesc := FieldDesc; + SortColumn.CaseSensitive := True; + FIndexFields.Add(SortColumn); + Code := Parser.GetNext(S1); + ProcessedCS := False; + ProcessedDESC := False; + while not (((Code = lcSymbol) and ((S1 = ';') or (S1 = ','))) or (Code = lcEnd)) do begin + if Code = lcIdent then begin + if not ProcessedDESC and ('DESC' = UpperCase(S1)) then begin + SortColumn.DescendingOrder := True; + ProcessedDESC := True; + end + else + if not ProcessedCS and ('CIS' = UpperCase(S1)) then begin + SortColumn.CaseSensitive := False; + ProcessedCS := True; + end + else + if not ProcessedDESC and ('ASC' = UpperCase(S1)) then + ProcessedDESC := True + else + if not ProcessedCS and ('CS' = UpperCase(S1)) then + ProcessedCS := True + else + RaiseError; + Code := Parser.GetNext(S1); + end + else + RaiseError; + end; + end; + lcSymbol: begin + if (S1 <> ';') and (S1 <> ',') then + RaiseError; + Code := Parser.GetNext(S1); + end + else + RaiseError; + end; + end; + finally + Parser.Free; + end; + end; +end; + +{$IFNDEF CLR} +function TMemData.InternalAnsiStrComp(const Value1, Value2: IntPtr; + const Options: TLocateExOptions): integer; +begin + if lxCaseInsensitive in Options then + Result := AnsiStrICompS(Value1, Value2) + else + Result := AnsiStrCompS(Value1, Value2); +end; +{$ENDIF} + +function TMemData.InternalAnsiCompareText(const Value1, Value2: string; + const Options: TLocateExOptions): integer; +begin + if lxCaseInsensitive in Options then + Result := AnsiCompareTextS(Value1, Value2) + else + Result := AnsiCompareStrS(Value1, Value2); +end; + +function TMemData.InternalWStrLComp(const Value1, Value2: WideString; + const Options: TLocateExOptions): integer; +begin + if lxCaseInsensitive in Options then + Result := AnsiStrLICompWS(Value1, Value2, Length(Value1)) + else + Result := AnsiStrLCompWS(Value1, Value2, Length(Value1)) +end; + +function TMemData.InternalWStrComp(const Value1, Value2: WideString; + const Options: TLocateExOptions): integer; +begin + if lxCaseInsensitive in Options then + Result := AnsiStrICompWS(Value1, Value2) + else + Result := AnsiStrCompWS(Value1, Value2); +end; + +// Used to compare field value and string KeyValue with matching options +function TMemData.CompareStrValues(const Value: string; + const FieldValue: string; const Options: TLocateExOptions): integer; +var + Res: integer; + ValueLen: integer; +begin + if lxPartialCompare in Options then begin + if lxCaseInsensitive in Options then + Res := Pos(AnsiUpperCase(Value), AnsiUpperCase(FieldValue)) + else + Res := Pos(Value, FieldValue); + if Res = 0 then + Res := 1 + else + Res := 0; + end + else + if lxPartialKey in Options then begin + ValueLen := Length(Value); + if ValueLen = 0 then + ValueLen := Length(FieldValue); + if Length(FieldValue) >= ValueLen then + Result := 0 + else + Result := 1; + if Result <> 0 then + Exit // To avoid AV in case Len(Value) > Len(St) + else + Res := InternalAnsiCompareText(Value, Copy(FieldValue, 1, ValueLen), Options); + end + else + Res := InternalAnsiCompareText(Value, FieldValue, Options); + Result := Res; +end; + +function TMemData.CompareWideStrValues(const Value: WideString; + const FieldValue: WideString; const Options: TLocateExOptions): integer; +var + Res: integer; + ValueLen: integer; + +{$IFDEF MSWINDOWS} + ValueS, FieldValueS: string; +{$ENDIF} +begin +{$IFDEF MSWINDOWS} + if IsWin9x then begin + ValueS := Value; + FieldValueS := FieldValue; + Result := CompareStrValues(ValueS, FieldValueS, Options); + Exit; + end; +{$ENDIF} + + if lxPartialCompare in Options then begin + if lxCaseInsensitive in Options then + Res := Pos(WideUpperCase(Value), WideUpperCase(FieldValue)) + else + Res := Pos(Value, FieldValue); + if Res = 0 then + Res := 1 + else + Res := 0; + end + else + if lxPartialKey in Options then begin + ValueLen := Length(Value); + if Length(FieldValue) >= ValueLen then + Result := 0 + else + Result := 1; + if Result <> 0 then + Exit // To avoid AV in case Len(Value) > Len(St) + else + Res := InternalWStrLComp(Value, FieldValue, Options); + end + else + Res := InternalWStrComp(Value, FieldValue, Options); + Result := Res; +end; + +// Used to compare binary field value and binary KeyValue with matching options +function TMemData.CompareBinValues(const Value: IntPtr; + const ValueLen: integer; const FieldValue: IntPtr; + const FieldValueLen: integer; const Options: TLocateExOptions): integer; + + function CompareMem(FieldValue, Value: IntPtr; FieldValueLen: integer): integer; + var + i: integer; + begin + for i := 0 to FieldValueLen div 4 - 1 do begin + if Longword(Marshal.ReadInt32(Value, i shl 2)) > Longword(Marshal.ReadInt64(FieldValue, i shl 2)) then begin + Result := 1; + Exit; + end + else + if Longword(Marshal.ReadInt32(Value, i shl 2)) < Longword(Marshal.ReadInt64(FieldValue, i shl 2)) then begin + Result := -1; + Exit; + end + end; + for i := ((FieldValueLen - 1) and $fffffffc) to FieldValueLen - 1 do begin + if Marshal.ReadByte(Value, i) > Marshal.ReadByte(FieldValue, i) then begin + Result := 1; + Exit; + end + else + if Marshal.ReadByte(Value, i) > Marshal.ReadByte(FieldValue, i) then begin + Result := -1; + Exit; + end + end; + Result := 0; + end; + +var + i: integer; + +begin + if lxPartialCompare in Options then begin + if FieldValueLen >= ValueLen then + Result := 0 + else + Result := 1; + if Result <> 0 then + Exit // Field value is shorter when Value + else + begin + for i := integer(FieldValue) to integer(FieldValue) + FieldValueLen - ValueLen - 1 do begin + Result := CompareMem(IntPtr(i), Value, ValueLen); + if Result = 0 then + Break; + end; + Result := 1; + end; + end + else + if lxPartialKey in Options then begin + if FieldValueLen >= ValueLen then + Result := 0 + else + Result := 1; + if Result <> 0 then + Exit // Field value is shorter when Value + else + Result := CompareMem(FieldValue, Value, ValueLen); + end + else + begin + if ValueLen = FieldValueLen then + Result := 0 + else + Result := 1; + if Result <> 0 then + Exit + else + Result := CompareMem(FieldValue, Value, FieldValueLen); + end; +end; + +// Used to compare field value and KeyValue from MemDataSet.LocateRecord +function TMemData.CompareFieldValue( + ValuePtr: IntPtr; const ValueType: integer; FieldDesc: TFieldDesc; + RecBuf: IntPtr; const Options: TLocateExOptions): integer; +var + St: string; + WSt: WideString; + BlobValue: IntPtr; + FieldBuf: IntPtr; + FieldBufStatic: IntPtr; + IsBlank: boolean; + l: integer; + c, cValue: Currency; +{$IFDEF VER6P} + bcd, bcdValue: TBcd; +{$ENDIF} +{$IFDEF CLR} + Data: TBytes; +{$ENDIF} + Value: string; + WValue: WideString; + v1, v2: variant; + v1VType, v2VType: TVarType; +{$IFNDEF CLR} + v1VArray, v2VArray: PVarArray; + v1VArrayData, v2VArrayData: IntPtr; +{$ENDIF} + +begin + FieldBufStatic := nil; + + if FieldDesc.ParentField = nil then + FieldBuf := IntPtr(integer(RecBuf) + FieldDesc.Offset) + else begin + // support objects + FieldBufStatic := Marshal.AllocHGlobal(4001); + FieldBuf := FieldBufStatic; + GetField(FieldDesc.FieldNo, RecBuf, FieldBuf, IsBlank); // GetChildField + end; + + Result := 0; + try + case ValueType of + dtString, dtGuid: begin + case FieldDesc.DataType of + dtString: begin + {$IFNDEF CLR} + if not (lxPartialKey in Options) + and not (lxPartialCompare in Options) + and not (FieldDesc.Fixed and TrimFixedChar) + and not (not FieldDesc.Fixed and TrimVarChar) + then begin + Result := InternalAnsiStrComp(ValuePtr, FieldBuf, Options); + Exit; + end; + {$ENDIF} + St := Marshal.PtrToStringAnsi(FieldBuf); + if FieldDesc.Fixed and TrimFixedChar then + St := Trim(St) + else + if not FieldDesc.Fixed and TrimVarChar then + St := Trim(St) + end; + dtWideString: begin + St := Marshal.PtrToStringUni(FieldBuf); + if FieldDesc.Fixed and TrimFixedChar then + St := Trim(St) + else + if not FieldDesc.Fixed and TrimVarChar then + St := Trim(St) + end; + dtExtString: begin + {$IFNDEF CLR} + if not (lxPartialKey in Options) and not (lxPartialCompare in Options) then begin + Result := InternalAnsiStrComp(ValuePtr, Marshal.ReadIntPtr(FieldBuf), Options); + Exit; + end; + {$ENDIF} + St := Marshal.PtrToStringAnsi(Marshal.ReadIntPtr(FieldBuf)); + end; + dtExtWideString: + St := Marshal.PtrToStringUni(Marshal.ReadIntPtr(FieldBuf)); + {$IFDEF VER5P} + dtVariant: + St := TVariantObject(GetGCHandleTarget(Marshal.ReadIntPtr(FieldBuf))).Value; + {$ENDIF} + dtInt8: + St := IntToStr(ShortInt(Marshal.ReadByte(FieldBuf))); + dtInt16: + St := IntToStr(Marshal.ReadInt16(FieldBuf)); + dtUInt16: + St := IntToStr(Word(Marshal.ReadInt16(FieldBuf))); + dtInt32: + St := IntToStr(Marshal.ReadInt32(FieldBuf)); + dtUInt32: + St := IntToStr(Longword(Marshal.ReadInt32(FieldBuf))); + dtInt64: + St := IntToStr(Marshal.ReadInt64(FieldBuf)); + dtFloat, dtCurrency: + St := FloatToStr(BitConverter.Int64BitsToDouble(Marshal.ReadInt64(FieldBuf))); + dtDate: + St := DateToStr(BitConverter.Int64BitsToDouble(Marshal.ReadInt64(FieldBuf))); + dtTime: + St := TimeToStr(BitConverter.Int64BitsToDouble(Marshal.ReadInt64(FieldBuf))); + dtDateTime: + St := DateTimeToStr(BitConverter.Int64BitsToDouble(Marshal.ReadInt64(FieldBuf))); + dtBCD: + begin + c := Marshal.ReadInt64(RecBuf, FieldDesc.Offset) / 10000; + St := CurrToStr(c); + Result := CompareStrValues(Marshal.PtrToStringAnsi(ValuePtr), St, Options + [lxCaseInsensitive]); + Exit; + end; + {$IFDEF VER6P} + dtFmtBCD: + begin + {$IFDEF CLR} + SetLength(Data, SizeOfTBcd); + Marshal.Copy(IntPtr(Integer(RecBuf) + FieldDesc.Offset), Data, 0, SizeOfTBcd); + bcd := TBcd.FromBytes(Data); + {$ELSE} + bcd := PBcd(PChar(RecBuf) + FieldDesc.Offset)^; + {$ENDIF} + St := BcdToStr(bcd); + Result := CompareStrValues(Marshal.PtrToStringAnsi(ValuePtr), St, Options + [lxCaseInsensitive]); + Exit; + end; + {$ENDIF} + dtGuid: + begin + Result := CompareStrValues(Marshal.PtrToStringAnsi(ValuePtr), Marshal.PtrToStringAnsi(FieldBuf), Options + [lxCaseInsensitive]); + Exit; + end; + else + if IsBlobFieldType(FieldDesc.DataType) then begin + l := GetBlobSize(FieldDesc.FieldNo, RecBuf); + BlobValue := Marshal.AllocHGlobal(l + 1); + try + ReadBlob(FieldDesc.FieldNo, RecBuf, 0, l, BlobValue); + St := Marshal.PtrToStringAnsi(BlobValue, l); + finally + Marshal.FreeHGlobal(BlobValue); + end; + end + else + raise EConvertError.Create(SCannotConvertType); + end; + + if ((FieldDesc.DataType = dtString) or (FieldDesc.DataType = dtWideString)) + and ((FieldDesc.Fixed and TrimFixedChar) or (not FieldDesc.Fixed and TrimVarChar)) then + Value := Trim(Marshal.PtrToStringAnsi(ValuePtr)) + else + Value := Marshal.PtrToStringAnsi(ValuePtr); + Result := CompareStrValues(Value, St, Options); + end; + dtWideString: begin + case FieldDesc.DataType of + dtWideString: begin + WSt := Marshal.PtrToStringUni(FieldBuf); + if FieldDesc.Fixed and TrimFixedChar then + WSt := Trim(WSt) + else + if not FieldDesc.Fixed and TrimVarChar then + WSt := Trim(WSt) + end; + dtString: begin + WSt := Marshal.PtrToStringAnsi(FieldBuf); + if FieldDesc.Fixed and TrimFixedChar then + WSt := Trim(WSt) + else + if not FieldDesc.Fixed and TrimVarChar then + WSt := Trim(WSt) + end; + dtExtString: + WSt := Marshal.PtrToStringAnsi(Marshal.ReadIntPtr(FieldBuf)); + dtExtWideString: + WSt := Marshal.PtrToStringUni(Marshal.ReadIntPtr(FieldBuf)); + {$IFDEF VER5P} + dtVariant: + WSt := TVariantObject(GetGCHandleTarget(Marshal.ReadIntPtr(FieldBuf))).Value; + {$ENDIF} + dtInt8: + WSt := IntToStr(ShortInt(Marshal.ReadByte(FieldBuf))); + dtInt16: + WSt := IntToStr(Marshal.ReadInt16(FieldBuf)); + dtUInt16: + WSt := IntToStr(Word(Marshal.ReadInt16(FieldBuf))); + dtInt32: + WSt := IntToStr(Marshal.ReadInt32(FieldBuf)); + dtUInt32: + WSt := IntToStr(Longword(Marshal.ReadInt16(FieldBuf))); + dtInt64: + WSt := IntToStr(Marshal.ReadInt64(FieldBuf)); + dtFloat, dtCurrency: + WSt := FloatToStr(BitConverter.Int64BitsToDouble(Marshal.ReadInt64(FieldBuf))); + dtDate: + WSt := DateToStr(BitConverter.Int64BitsToDouble(Marshal.ReadInt64(FieldBuf))); + dtTime: + WSt := TimeToStr(BitConverter.Int64BitsToDouble(Marshal.ReadInt64(FieldBuf))); + dtDateTime: + WSt := DateTimeToStr(BitConverter.Int64BitsToDouble(Marshal.ReadInt64(FieldBuf))); + dtBCD: + begin + c := Marshal.ReadInt64(RecBuf, FieldDesc.Offset) / 10000; + WSt := CurrToStr(c); + Result := CompareWideStrValues(Marshal.PtrToStringUni(ValuePtr), WSt, Options + [lxCaseInsensitive]); + Exit; + end; + else + if IsBlobFieldType(FieldDesc.DataType) then begin + BlobValue := Marshal.AllocHGlobal(GetBlobSize(FieldDesc.FieldNo, RecBuf)); + try + ReadBlob(FieldDesc.FieldNo, RecBuf, 0, 0, BlobValue); + St := Marshal.PtrToStringUni(BlobValue); + finally + Marshal.FreeHGlobal(BlobValue); + end; + end + else + raise EConvertError.Create(SCannotConvertType); + end; + + if ((FieldDesc.DataType = dtString) or (FieldDesc.DataType = dtWideString)) + and ((FieldDesc.Fixed and TrimFixedChar) or (not FieldDesc.Fixed and TrimVarChar)) then + WValue := Trim(Marshal.PtrToStringUni(ValuePtr)) + else + WValue := Marshal.PtrToStringUni(ValuePtr); + Result := CompareWideStrValues(WValue, WSt, Options); + end; + dtInt8: + if ShortInt(Marshal.ReadByte(FieldBuf)) < ShortInt(Marshal.ReadByte(ValuePtr)) then + Result := 1 + else + if ShortInt(Marshal.ReadByte(FieldBuf)) > ShortInt(Marshal.ReadByte(ValuePtr)) then + Result := -1 + else + Result := 0; + dtInt16: + if Marshal.ReadInt16(FieldBuf) < Marshal.ReadInt16(ValuePtr) then + Result := 1 + else + if Marshal.ReadInt16(FieldBuf) > Marshal.ReadInt16(ValuePtr) then + Result := -1 + else + Result := 0; + dtUInt16: + if Word(Marshal.ReadInt16(FieldBuf)) < Word(Marshal.ReadInt16(ValuePtr)) then + Result := 1 + else + if Word(Marshal.ReadInt16(FieldBuf)) > Word(Marshal.ReadInt16(ValuePtr)) then + Result := -1 + else + Result := 0; + dtInt32: + if Marshal.ReadInt32(FieldBuf) < Marshal.ReadInt32(ValuePtr) then + Result := 1 + else + if Marshal.ReadInt32(FieldBuf) > Marshal.ReadInt32(ValuePtr) then + Result := -1 + else + Result := 0; + dtUInt32: + if Longword(Marshal.ReadInt32(FieldBuf)) < Longword(Marshal.ReadInt32(ValuePtr)) then + Result := 1 + else + if Longword(Marshal.ReadInt32(FieldBuf)) > Longword(Marshal.ReadInt32(ValuePtr)) then + Result := -1 + else + Result := 0; + dtInt64: + if Marshal.ReadInt64(FieldBuf) < Marshal.ReadInt64(ValuePtr) then + Result := 1 + else + if Marshal.ReadInt64(FieldBuf) > Marshal.ReadInt64(ValuePtr) then + Result := -1 + else + Result := 0; + dtBoolean: + if (Marshal.ReadByte(FieldBuf) = 0) = (Marshal.ReadByte(ValuePtr) = 0) then // Cannot use 'boolean(FieldBuf^) = boolean(ValuePtr^)' because 'True' may have any value without 0 + Result := 0 + else + if (Marshal.ReadByte(FieldBuf) = 0) then + Result := 1 + else + Result := -1; + dtFloat, dtCurrency, + dtDateTime, dtDate, dtTime: begin + if BitConverter.Int64BitsToDouble(Marshal.ReadInt64(FieldBuf)) < BitConverter.Int64BitsToDouble(Marshal.ReadInt64(ValuePtr)) then + Result := 1 + else + if BitConverter.Int64BitsToDouble(Marshal.ReadInt64(FieldBuf)) > BitConverter.Int64BitsToDouble(Marshal.ReadInt64(ValuePtr)) then + Result := -1 + else + Result := 0; + end; + dtBytes: + Result := CompareBinValues(IntPtr(integer(ValuePtr) + SizeOf(Word)), + Marshal.ReadInt16(ValuePtr), FieldBuf, FieldDesc.Length, Options); + dtVarBytes: + Result := CompareBinValues(IntPtr(integer(ValuePtr) + SizeOf(Word)), + Marshal.ReadInt16(ValuePtr), IntPtr(integer(FieldBuf) + SizeOf(Word)), + Marshal.ReadInt16(FieldBuf), Options); + dtExtVarBytes: + Result := CompareBinValues(IntPtr(integer(ValuePtr) + SizeOf(Word)), + Marshal.ReadInt16(ValuePtr), + IntPtr(integer(Marshal.ReadIntPtr(FieldBuf)) + SizeOf(Word)), + Marshal.ReadInt16(Marshal.ReadIntPtr(FieldBuf)), Options); + dtBCD: begin + c := Marshal.ReadInt64(RecBuf, FieldDesc.Offset) / 10000; + cValue := BitConverter.Int64BitsToDouble(Marshal.ReadInt64(ValuePtr)); + if c < cValue then + Result := 1 + else + if c > cValue then + Result := -1 + else + Result := 0; + end; + dtVariant: begin + v1 := TVariantObject(GetGCHandleTarget(Marshal.ReadIntPtr(FieldBuf))).Value; + v2 := TVariantObject(GetGCHandleTarget(Marshal.ReadIntPtr(ValuePtr))).Value; + v1VType := VarType(v1); + v2VType := VarType(v2); + + {$IFNDEF CLR} + if (v1VType = varArray + varByte) or (v2VType = varArray + varByte) then begin + if (v1VType = varNull) and (v2VType = varNull) then + Result := 0 + else + if v1VType = varNull then // (v1VType = varNull) and (v2VType = varArray + varByte) + Result := 1 + else + if v2VType = varNull then // (v2VType = varNull) and (v1VType = varArray + varByte) + Result := -1 + else // (v1VType <> varNull) and (v2VType <> varNull) + if v1VType <> v2VType then begin + if v1VType < v2VType then + Result := 1 + else + Result := -1; + end + else begin + Assert(v1VType = varArray + varByte, 'Invalid v1.VType'); + Assert(v2VType = varArray + varByte, 'Invalid v2.VType'); + + v1VArray := TVarData(v1).VArray; + v2VArray := TVarData(v2).VArray; + if (v1VArray = nil) and (v2VArray = nil) then + Result := 0 + else + if (v1VArray = nil) and (v2VArray = nil) then + Result := 0 + else + if v1VArray = nil then // (v1VArray = nil) and (v2VArray <> nil) + Result := 1 + else + if v2VArray = nil then // (v2VArray = nil) and (v1VArray <> nil) + Result := -1 + else // (v1VArray <> nil) and (v2VArray <> nil) + if v1VArray.Bounds[0].ElementCount < v2VArray.Bounds[0].ElementCount then + Result := 1 + else + if v1VArray.Bounds[0].ElementCount > v2VArray.Bounds[0].ElementCount then + Result := - 1 + else begin + v1VArrayData := v1VArray.Data; + v2VArrayData := v2VArray.Data; + if (v1VArrayData = nil) and (v2VArrayData = nil) then + Result := 0 + else + if (v1VArrayData = nil) and (v2VArrayData = nil) then + Result := 0 + else + if v1VArrayData = nil then // (v1VArrayData = nil) and (v2VArrayData <> nil) + Result := 1 + else + if v2VArrayData = nil then // (v2VArrayData = nil) and (v1VArrayData <> nil) + Result := -1 + else // (v1VArrayData <> nil) and (v2VArrayData <> nil) + Result := CompareBinValues(v1VArrayData, v1VArray.Bounds[0].ElementCount, v2VArrayData, v2VArray.Bounds[0].ElementCount, Options); + end; + end + end + else + {$ENDIF} + {$IFNDEF VER6P} + if (v1VType = v2VType) and (v1VType = varDecimal) then begin + if PInt64(@TVarData(v1).VInteger)^ < PInt64(@TVarData(v2).VInteger)^ then + Result := 1 + else + if PInt64(@TVarData(v1).VInteger)^ > PInt64(@TVarData(v2).VInteger)^ then + Result := -1 + else + Result := 0; + end + else + {$ENDIF} + if (v1VType = v2VType) or + ((((v1VType >= varSmallint) and (v1VType <= varCurrency)) or ((v1VType >= varDecimal) and (v1VType <= varInt64))) and + (((v2VType >= varSmallint) and (v2VType <= varCurrency)) or ((v2VType >= varDecimal) and (v2VType <= varInt64)))) then begin // Equal VarType or Numbers + if v1 < v2 then + Result := 1 + else + if v1 > v2 then + Result := -1 + else + Result := 0; + end + else + if ((v1VType = varString) or (v1VType = varOleStr)) or + ((v2VType = varString) or (v2VType = varOleStr)) then begin// String + Result := CompareStrValues(v2, v1, Options) + end + else // VarType is different + if v1VType < v2VType then + Result := 1 + else + Result := -1; + end; + {$IFDEF VER6P} + dtFmtBCD: begin + {$IFDEF CLR} + SetLength(Data, SizeOfTBcd); + + Marshal.Copy(IntPtr(Integer(RecBuf) + FieldDesc.Offset), Data, 0, SizeOfTBcd); + bcd := TBcd.FromBytes(Data); + + Marshal.Copy(ValuePtr, Data, 0, SizeOfTBcd); + bcdValue := TBcd.FromBytes(Data); + {$ELSE} + bcd := PBcd(PChar(RecBuf) + FieldDesc.Offset)^; + bcdValue := PBcd(ValuePtr)^; + {$ENDIF} + Result := BcdCompare(bcdValue, bcd); + end; + {$ENDIF} + else + Assert(False, 'Unknown ValueType = ' + IntToStr(ValueType)); + end; + finally + if FieldBufStatic <> nil then + Marshal.FreeHGlobal(FieldBufStatic); + end; +end; + +function TMemData.CompareFields(RecBuf1: IntPtr; RecBuf2: IntPtr; SortColumn: TSortColumn): integer; +var + Options: TLocateExOptions; +begin + if not SortColumn.CaseSensitive then + Options := [lxCaseInsensitive] + else + Options := []; + + Result := CompareFields(RecBuf1, RecBuf2, SortColumn.FieldDesc, Options); +end; + +function TMemData.CompareFields(RecBuf1: IntPtr; RecBuf2: IntPtr; FieldDesc: TFieldDesc; Options: TLocateExOptions = []): integer; +var + FieldBuf: IntPtr; + IsBlank1, IsBlank2: boolean; + DataType: integer; + NativeBuffer: boolean; +begin + FieldBuf := nil; + NativeBuffer := True; + try + FieldBuf := GetFieldBuf(RecBuf1, FieldDesc, DataType, IsBlank1, NativeBuffer); + IsBlank2 := GetNull(FieldDesc.FieldNo, RecBuf2); + if IsBlank1 and not IsBlank2 then + Result := -1 + else + if not IsBlank1 and IsBlank2 then + Result := 1 + else + if IsBlank1 and IsBlank2 then + Result := 0 + else + Result := CompareFieldValue(FieldBuf, DataType, FieldDesc, + RecBuf2, Options); + finally + if not NativeBuffer then + Marshal.FreeHGlobal(FieldBuf); + end; +end; + +function TMemData.CompareRecords(RecBuf1, RecBuf2: IntPtr): integer; +var + SortColumn: TSortColumn; + i: integer; + Dir: integer; + + CalcRecBuf1, CalcRecBuf2: IntPtr; +begin + CalcRecBuf1 := nil; + CalcRecBuf2 := nil; + try + Result := 0; + for i := 0 to FIndexFields.Count - 1 do begin + SortColumn := FIndexFields.Items[i]; + if SortColumn.DescendingOrder then + Dir := -1 + else + Dir := 1; + + if SortColumn.FieldDesc.FieldDescKind = fdkCalculated then begin + if CalcRecBuf1 = nil then begin + CalcRecBuf1 := Marshal.AllocHGlobal(FRecordSize + CalcRecordSize); + CalcRecBuf2 := Marshal.AllocHGlobal(FRecordSize + CalcRecordSize); + if Assigned(FOnGetCachedBuffer) then + FOnGetCachedBuffer(CalcRecBuf1, RecBuf1); + if Assigned(FOnGetCachedBuffer) then + FOnGetCachedBuffer(CalcRecBuf2, RecBuf2); + end; + Result := CompareFields(CalcRecBuf1, CalcRecBuf2, SortColumn) * Dir; + end + else + Result := CompareFields(RecBuf1, RecBuf2, SortColumn) * Dir; + + if Result <> 0 then + break; + end; + finally + if CalcRecBuf1 <> nil then + Marshal.FreeHGlobal(CalcRecBuf1); + if CalcRecBuf2 <> nil then + Marshal.FreeHGlobal(CalcRecBuf2); + end; +end; + +procedure TMemData.Exchange(I, J: PItemHeader); +var + NextToI, PrevToJ: PItemHeader; +begin + NextToI := I.Next; + PrevToJ := J.Prev; + if IntPtr(I.Prev) <> nil then + I.Prev.Next := J; + if IntPtr(J.Next) <> nil then + J.Next.Prev := I; + J.Prev := I.Prev; + I.Next := J.Next; + if NextToI = J then begin + I.Prev := J; + J.Next := I; + end + else begin + I.Prev := PrevToJ; + if IntPtr(PrevToJ) <> nil then + PrevToJ.Next := I; + J.Next := NextToI; + if IntPtr(NextToI) <> nil then + NextToI.Prev := J; + end; + + if I = FirstItem then FirstItem := J; + if J = LastItem then LastItem := I; +end; + +procedure TMemData.MoveSortedRecord(Dir: integer); +begin + if Dir = 0 then + Exit; + while True do begin + if Dir > 0 then begin + if (IntPtr(CurrentItem.Next) <> nil) and + (CompareRecords(IntPtr(Integer(CurrentItem) + sizeof(TItemHeader)), IntPtr(Integer(CurrentItem.Next) + sizeof(TItemHeader))) > 0) + then + Exchange(CurrentItem, CurrentItem.Next) + else + break; + end + else begin + if (IntPtr(CurrentItem.Prev) <> nil) and + (CompareRecords(IntPtr(Integer(CurrentItem) + sizeof(TItemHeader)), IntPtr(Integer(CurrentItem.Prev) + sizeof(TItemHeader))) < 0) + then + Exchange(CurrentItem.Prev, CurrentItem) + else + break; + end; + end; +end; + +procedure TMemData.QuickSort(L, R, P: PItemHeader); +var + I, J, IP, JP, I1: PItemHeader; + changeIP, changeJP: boolean; +begin + repeat + I := L; + J := R; + IP := I; + JP := J; + changeIP := False; + changeJP := False; + while True do begin + while (IntPtr(I) <> IntPtr(P)) and (CompareRecords(IntPtr(Integer(I) + sizeof(TItemHeader)), IntPtr(Integer(P) + sizeof(TItemHeader))) < 0) do begin + I := I.Next; + if changeIP then + IP := IP.Next; + changeIP := not changeIP; + end; + while (IntPtr(J) <> IntPtr(P)) and (CompareRecords(IntPtr(Integer(J) + sizeof(TItemHeader)), IntPtr(Integer(P) + sizeof(TItemHeader))) > 0) do begin + J := J.Prev; + if changeJP then + JP := JP.Prev; + changeJP := not changeJP; + end; + if (IntPtr(J.Next) = IntPtr(I)) or + (IntPtr(I) = IntPtr(J)) + then + break; + + if CompareRecords(IntPtr(Integer(I) + sizeof(TItemHeader)), IntPtr(Integer(J) + sizeof(TItemHeader))) <> 0 then begin + Exchange(I, J); + I1 := I; + I := J; + J := I1; + if L = I then + L := J + else + if L = J then + L := I; + + if JP = I then + JP := J + else + if JP = J then + JP := I; + + if IP = I then + IP := J + else + if IP = J then + IP := I; + + if R = I then + R:=J + else + if R=J then + R:=I; + end; + + if IntPtr(I) <> IntPtr(R) then begin + I := I.Next; + if changeIP then + IP := IP.Next; + changeIP := not changeIP; + end; + if IntPtr(J) <> IntPtr(L) then begin + J := J.Prev; + if changeJP then + JP := JP.Prev; + changeJP := not changeJP; + end; + end; + if IntPtr(L) <> IntPtr(J) then QuickSort(L, J, IP); + if (IntPtr(I) = IntPtr(J)) and (IntPtr(I) <> IntPtr(R)) then + I := I.Next; + L := I; + P := JP; + until I = R; +end; + +procedure TMemData.SortItems; +begin + if FIndexFields.Count = 0 then + Exit; + if (IntPtr(FirstItem) <> nil) and (IntPtr(LastItem) <> nil) then begin + QuickSort(FirstItem, LastItem, FirstItem); + ReorderItems(nil, roFull); + end; +end; + +function TMemData.InsertItem: PItemHeader; +var + Item: PItemHeader; +begin + if EOF then begin + Result := AppendItem; + Exit; + end; + + if BOF then + CurrentItem := FirstItem; + + BlockMan.AllocItem(Item); + + Item.Next := CurrentItem; + + if IntPtr(CurrentItem) <> nil then begin + Item.Prev := CurrentItem.Prev; + if IntPtr(CurrentItem.Prev) <> nil then + CurrentItem.Prev.Next := Item; + CurrentItem.Prev := Item + end + else begin + Item.Prev := nil; + end; + + if FirstItem = CurrentItem then + FirstItem := Item; + + if IntPtr(LastItem) = nil then + LastItem := Item; + + Result := Item; +end; + +function TMemData.AppendItem: PItemHeader; +var + Item: PItemHeader; +begin + BlockMan.AllocItem(Item); + + if IntPtr(FirstItem) = nil then begin + FirstItem := Item; + Item.Order := 1; + end + else begin + LastItem.Next := Item; + Item.Order := LastItem.Order + 1; + end; + + Item.Prev := LastItem; + Item.Next := nil; + LastItem := Item; + + Result := Item; +end; + +procedure TMemData.DeleteItem(Item: PItemHeader); +begin + if IntPtr(Item) <> nil then begin + if Item = FirstItem then + if Item = LastItem then begin + CurrentItem := nil; + FirstItem := nil; + LastItem := nil; + FBOF := True; + FEOF := True; + end + else begin + FirstItem := Item.Next; + FirstItem.Prev := nil; + if Item = CurrentItem then + CurrentItem := FirstItem; + end + else + if Item = LastItem then begin + LastItem := Item.Prev; + LastItem.Next := nil; + if Item = CurrentItem then + CurrentItem := LastItem; + end + else begin + if Item = CurrentItem then + CurrentItem := Item.Next; + + if IntPtr(Item.Prev) <> nil then + Item.Prev.Next := Item.Next; + if IntPtr(Item.Next) <> nil then + Item.Next.Prev := Item.Prev; + end; + + {if IsComplexFields then + FreeComplexFields(PChar(Item) + sizeof(TItemHeader), True);} + + BlockMan.FreeItem(Item); + end; +end; + +procedure TMemData.InitData; +begin + FirstItem := nil; + LastItem := nil; + CurrentItem := nil; + Cache := nil; + LastCacheItem := nil; + + FBOF := True; + FEOF := True; + FRecordCount := 0; + FRecordNoOffset := 0; + + BlockMan.FirstFree := nil; + Inc(RefreshIteration); + FRefreshIteration := RefreshIteration; +end; + +procedure TMemData.FreeData; +var + CacheItem: TCacheItem; + Item: PItemHeader; + NeedFreeComplex: boolean; + + function HasComplexFields (IncludeStrings : boolean): boolean; + var + i: integer; + begin + Result := False; + for i := 0 to FieldCount - 1 do + if IsComplexFieldType(Fields[i].DataType) then + case Fields[i].DataType of + dtExtString, dtExtWideString, dtExtVarBytes: + Result := IncludeStrings; + else + begin + Result := True; + Exit; + end; + end; + end; + +begin + if not StringHeap.SysGetMem then begin + NeedFreeComplex := HasComplexFields(False); + StringHeap.Clear; + end + else + NeedFreeComplex := HasComplexFields(True); + + if NeedFreeComplex then begin + // Free complex fields + Item := FirstItem; + while IntPtr(Item) <> nil do begin + FreeComplexFields(IntPtr(Integer(Item) + sizeof(TItemHeader)), True); + Item := Item.Next; + end; + CacheItem := Cache; + while CacheItem <> nil do begin + Item := CacheItem.Item.Rollback; + if IntPtr(Item) <> nil then + FreeComplexFields(IntPtr(Integer(Item) + sizeof(TItemHeader)), True); + CacheItem := CacheItem.Next; + end; + end; + +// Free cache + while Cache <> nil do begin + CacheItem := Cache; + Cache := Cache.Next; + CacheItem.Free; + end; + + StringHeap.Clear; + BlockMan.FreeAllBlock; + + InitData; +end; + +procedure TMemData.ReorderItems(Item: PItemHeader; ReorderOption: TReorderOption); +var + No: longint; + Item1: PItemHeader; +begin + if Length(FRecordNoCache) > 0 then + SetLength(FRecordNoCache, 0); + if (IntPtr(Item) <> nil) or (ReorderOption = roFull) and (IntPtr(FirstItem) <> nil) + then begin + if ReorderOption = roFull then begin + Item := FirstItem; + No := 1; + end + else + if IntPtr(Item.Next) <> nil then + No := Item.Next.Order + else + if IntPtr(Item.Prev) <> nil then + No := Item.Prev.Order + else begin + Item.Order := 1; + FRecordNoOffset := 0; + { $IFDEF LINUX + No := 0; // Kylix 1 anti warning + $ENDIF} + Exit; + end; + + if (ReorderOption = roFull) or (No > (FRecordCount + FRecordNoOffset) div 2) + then begin + Item1 := Item.Prev; + while (IntPtr(Item1) <> nil) and OmitRecord(Item1) do + Item1 := Item1.Prev; + if IntPtr(Item1) <> nil then + No := Item1.Order + 1 + else begin + No := 1; + FRecordNoOffset := 0; + end; + + while IntPtr(Item) <> nil do begin + + if not OmitRecord(Item) then begin + Item.Order := No; + Inc(No); + end + else + Item.Order := 0; + Item := Item.Next; + end; + end + else begin + Item1 := Item.Next; + while (IntPtr(Item1) <> nil) and OmitRecord(Item1) do + Item1 := Item1.Next; + if IntPtr(Item1) <> nil then begin + No := Item1.Order - 1; + if ReorderOption = roInsert then + Inc(FRecordNoOffset) + else + Dec(FRecordNoOffset) + end + else begin + No := FRecordCount; + FRecordNoOffset := 0; + end; + + while IntPtr(Item) <> nil do begin + if not OmitRecord(Item) then begin + Item.Order := No; + Dec(No); + end + else + Item.Order := 0; + Item := Item.Prev; + end; + end; + + if ReorderOption = roFull then + FRecordCount := No - 1; + end; +end; + +{ Fields } + +procedure TMemData.Open; +begin + inherited Open; +end; + +procedure TMemData.Reopen; +begin + inherited; + + if Length(FRecordNoCache) > 0 then + SetLength(FRecordNoCache, 0); + + // M11255 + if FilterText <> '' then + FilterUpdated; + // M11254 + if IndexFields.Count > 0 then + SortItems; +end; + +procedure TMemData.InitFields; +begin + inherited; + + BlockMan.RecordSize := RecordSize; + UpdateIndexFields; +end; + +procedure TMemData.ClearFields; +begin + FIndexFields.Clear; + + inherited; +end; + +{ Records } + +function TMemData.OmitRecord(Item: PItemHeader): boolean; +var + LocalFilterBuf: IntPtr; +begin + if IntPtr(Item) <> nil then begin + if Item.FilterResult = fsNotChecked then begin + FilterRecBuf := BlockMan.GetRecordPtr(Item); + LocalFilterBuf := nil; + try + Result := FCachedUpdates and not (Item.Status in FFilterItemTypes); + if not Result then begin + if (CalcRecordSize > 0) and (Assigned(FFilterMDFunc) or Assigned(FilterExpression) or + Assigned(FFilterFunc)) + then begin + LocalFilterBuf := Marshal.AllocHGlobal(RecordSize + CalcRecordSize); + CopyBuffer(FilterRecBuf, LocalFilterBuf, RecordSize); + if Assigned(FOnGetCachedBuffer) then + FOnGetCachedBuffer(LocalFilterBuf); + FilterRecBuf := LocalFilterBuf; + end; + + Result := Assigned(FFilterFunc) and not FFilterFunc(FilterRecBuf) or + Assigned(FFilterMDFunc) and not FFilterMDFunc(FilterRecBuf) or + Assigned(FilterExpression) and not Eval(FilterExpression); + end; + finally + if LocalFilterBuf <> nil then + Marshal.FreeHGlobal(LocalFilterBuf); + end; + if Result then + Item.FilterResult := fsOmitted + else + Item.FilterResult := fsNotOmitted; + end + else + Result := Item.FilterResult = fsOmitted; + end + else + Result := True; //False; +end; + +procedure TMemData.GetRecord(RecBuf: IntPtr); +begin + if not(EOF or BOF or (IntPtr(CurrentItem) = nil)) then + if OmitRecord(CurrentItem) then + GetNextRecord(RecBuf) + else + BlockMan.GetRecord(CurrentItem, RecBuf); +end; + +procedure TMemData.GetNextRecord(RecBuf: IntPtr); + procedure OmitRecords; + begin + while (IntPtr(CurrentItem) <> nil) and OmitRecord(CurrentItem) do + CurrentItem := CurrentItem.Next; + end; +begin + if not EOF then begin + if BOF then begin + FBOF := False; + CurrentItem := FirstItem; + end + else + if IntPtr(CurrentItem) <> nil then + CurrentItem := CurrentItem.Next + else + CurrentItem := FirstItem; + + OmitRecords; + if IntPtr(CurrentItem) = nil then + FEOF := True + else + if RecBuf <> nil then + GetRecord(RecBuf); + end; +end; + +procedure TMemData.GetPriorRecord(RecBuf: IntPtr); + procedure OmitRecords; + begin + while (IntPtr(CurrentItem) <> nil) and OmitRecord(CurrentItem) do + CurrentItem := CurrentItem.Prev; + end; +begin + if not BOF then begin + if EOF then begin + FEOF := False; + CurrentItem := LastItem; + end + else + if IntPtr(CurrentItem) <> nil then + CurrentItem := CurrentItem.Prev + else + CurrentItem := LastItem; + + OmitRecords; + if IntPtr(CurrentItem) = nil then + FBOF := True + else + if RecBuf <> nil then + GetRecord(RecBuf); + end; +end; + +procedure TMemData.UpdateCachedBuffer(FItem, LItem: PItemHeader); +var + Item: PItemHeader; +begin + if not Assigned(FOnGetCachedBuffer) or (CalcDataSize > 0) then + Exit; + + if IntPtr(FItem) = nil then + FItem := FirstItem; + if IntPtr(LItem) = nil then + LItem := LastItem; + + Item := FItem; + + while IntPtr(Item) <> nil do begin + FOnGetCachedBuffer(IntPtr(Integer(Item) + SizeOf(TItemHeader))); + if Item = LItem then + Break; + Item := Item.Next; + end; +end; + +procedure TMemData.PutRecord(RecBuf: IntPtr); +begin + Assert(IntPtr(CurrentItem) <> nil); + if Length(FRecordNoCache) > 0 then + SetLength(FRecordNoCache, 0); + CurrentItem.FilterResult := fsNotChecked; + BlockMan.PutRecord(CurrentItem, RecBuf); +end; + +procedure TMemData.AddRecord(RecBuf: IntPtr); +var + OldCurrentItem: PItemHeader; + MoveDir, i: integer; + Blob: TBlob; +begin + OldCurrentItem := CurrentItem; + CurrentItem := InsertItem; + + PutRecord(RecBuf); + + if HasBlobFields then + for i := 0 to FieldCount - 1 do + if IsBlobFieldType(Fields[i].DataType) then begin + Blob := TBlob(InternalGetObject(Fields[i].FieldNo, RecBuf)); + if Blob <> nil then + Blob.Commit; + end; + + if FIndexFields.Count > 0 then begin + if IntPtr(OldCurrentItem) = nil then + MoveDir := -1 + else + MoveDir := CompareRecords(RecBuf, IntPtr(Integer(OldCurrentItem) + sizeof(TItemHeader))); + MoveSortedRecord(MoveDir); + end; + Inc(FRecordCount); + ReorderItems(CurrentItem, roInsert); +end; + +procedure TMemData.InsertRecord(RecBuf: IntPtr); +var + CacheItem: TCacheItem; +begin + if not FCachedUpdates then + InternalAppend(RecBuf); + + AddRecord(RecBuf); + + if FCachedUpdates then begin + CacheItem := TCacheItem.Create; + CacheItem.Item := CurrentItem; + AddCacheItem(CacheItem); + + CurrentItem.Status := isAppended; + CurrentItem.UpdateResult := urNone; + end; +end; + +procedure TMemData.AppendRecord(RecBuf: IntPtr); +begin + SetToEnd; + InsertRecord(RecBuf); +end; + +procedure TMemData.UpdateRecord(RecBuf: IntPtr); +var + CacheItem: TCacheItem; + Rollback: PItemHeader; + i: integer; + Blob: TBlob; + RollbackRecBuf: IntPtr; + ItemRecBuf: IntPtr; + MoveDir: integer; +begin + Assert(IntPtr(CurrentItem) <> nil); + + if not FCachedUpdates then + InternalUpdate(RecBuf) + else begin + if CurrentItem.Status = isUnmodified then begin + // add to cache + CacheItem := TCacheItem.Create; + CacheItem.Item := CurrentItem; + AddCacheItem(CacheItem); + end; + + if (CurrentItem.Status <> isAppended) or (CurrentItem.UpdateResult = urApplied) + then begin + CurrentItem.Status := isUpdated; + + if IntPtr(CurrentItem.Rollback) = nil then begin + // create rollback record + BlockMan.AllocItem(Rollback); + CurrentItem.Rollback := Rollback; + BlockMan.CopyRecord(CurrentItem, Rollback); + AddRefComplexFields(IntPtr(Integer(Rollback) + sizeof(TItemHeader))); + end; + if HasBlobFields then begin + RollbackRecBuf := IntPtr(Integer(CurrentItem.Rollback) + sizeof(TItemHeader)); + ItemRecBuf := IntPtr(Integer(CurrentItem) + sizeof(TItemHeader)); + for i := 0 to FieldCount - 1 do + if IsBlobFieldType(Fields[i].DataType) then begin + Blob := TBlob(GetGCHandleTarget(Marshal.ReadIntPtr(RollbackRecBuf, Fields[i].Offset))); + if (Blob.Rollback <> nil) + and (Blob = TBlob(GetGCHandleTarget(Marshal.ReadIntPtr(ItemRecBuf, Fields[i].Offset)))) + then begin + Marshal.WriteIntPtr(RollbackRecBuf, Fields[i].Offset, Blob.Rollback.GCHandle); + Blob.Rollback := nil; + Blob.Release; + end; + end; + end; + end; + CurrentItem.UpdateResult := urNone; + end; + + MoveDir := CompareRecords(RecBuf, IntPtr(Integer(CurrentItem) + sizeof(TItemHeader))); + PutRecord(RecBuf); + if FIndexFields.Count > 0 then begin + MoveSortedRecord(MoveDir); + ReorderItems(nil, roFull); + end; +end; + +procedure TMemData.RemoveRecord; +var + PermitDelete: boolean; +begin + if FCachedUpdates then begin + PermitDelete := CurrentItem.Status <> isAppended; + RevertRecord; + end + else + PermitDelete := True; + + if PermitDelete then begin + if HasComplexFields then + FreeComplexFields(IntPtr(Integer(CurrentItem) + sizeof(TItemHeader)), True); + DeleteItem(CurrentItem); + Dec(FRecordCount); // if PermitDelete = False RecordCount is decreased on RevertRecord + end; + + ReorderItems(CurrentItem, roDelete); +end; + +procedure TMemData.DeleteRecord; +var + CacheItem: TCacheItem; + OldCacheItem: TCacheItem; +begin + if IntPtr(CurrentItem.Next) = nil then + Fetch; + + if not FCachedUpdates then begin + InternalDelete; + + RemoveRecord; + end + else begin + if CurrentItem.Status = isUnmodified then begin + // add to cache + CacheItem := TCacheItem.Create; + CacheItem.Item := CurrentItem; + AddCacheItem(CacheItem); + + CurrentItem.Status := isDeleted; + CurrentItem.UpdateResult := urNone; + end + else + case CurrentItem.Status of + isAppended: begin + // remove record from cache + CacheItem := Cache; + OldCacheItem := CacheItem; + while CacheItem <> nil do begin + if CacheItem.Item = CurrentItem then begin + if CacheItem = LastCacheItem then + if CacheItem = Cache then + LastCacheItem := nil + else + LastCacheItem := OldCacheItem; + + if CacheItem = Cache then + Cache := CacheItem.Next + else + OldCacheItem.Next := CacheItem.Next; + + CacheItem.Free; + break; + end; + + OldCacheItem := CacheItem; + CacheItem := CacheItem.Next; + end; + + if HasComplexFields then + FreeComplexFields(IntPtr(Integer(CurrentItem) + sizeof(TItemHeader)), True); + + DeleteItem(CurrentItem); + end; + isUpdated: begin + // rollback record + FreeComplexFields(IntPtr(Integer(CurrentItem) + sizeof(TItemHeader)), True); + BlockMan.CopyRecord(CurrentItem.Rollback, CurrentItem); + BlockMan.FreeItem(CurrentItem.Rollback); + CurrentItem.Rollback := nil; + + CurrentItem.Status := isDeleted; + CurrentItem.UpdateResult := urNone; + end; + end; + if IntPtr(CurrentItem) <> nil then + CurrentItem.FilterResult := fsNotChecked; + Dec(FRecordCount); + ReorderItems(CurrentItem, roDelete); + end; +end; + +{ Edit } + +{ Navigation } + +function TMemData.GetBOF: boolean; +begin + Result := (IntPtr(CurrentItem) = nil) and FBOF; // WAR +end; + +function TMemData.GetEOF: boolean; +begin + Result := (IntPtr(CurrentItem) = nil) and FEOF; // WAR +end; + +procedure TMemData.SetToBegin; +begin + CurrentItem := nil; //FirstItem; + FBOF := True; + if IntPtr(LastItem) <> nil then + FEOF := False; +end; + +procedure TMemData.SetToEnd; +begin + CurrentItem := nil; //LastItem; + FEOF := True; + if IntPtr(FirstItem) <> nil then + FBOF := False; +end; + +procedure TMemData.PrepareRecNoCache; +var + i: Integer; + Item: PItemHeader; +begin + if Length(FRecordNoCache) > 0 then + Exit; + i := 0; + Item := FirstItem; + SetLength(FRecordNoCache, RecordCount); + while IntPtr(Item) <> nil do begin + if Item.FilterResult = fsNotOmitted then begin + FRecordNoCache[i] := Item; + inc(i); + end; + Item := Item.Next; + end; +end; + +function TMemData.GetRecordCount: longint; +begin + Result := FRecordCount; +end; + +function TMemData.GetRecordNo: longint; +begin + if IntPtr(CurrentItem) <> nil then + Result := CurrentItem.Order + FRecordNoOffset + else + Result := 0; +end; + +procedure TMemData.SetRecordNo(Value: longint); +var + Item, CurrItem, LastOrderedItem: PItemHeader; + ForwardDir: boolean; +begin + if (IntPtr(FirstItem) <> nil) and (Value > 0) then begin + if Length(FRecordNoCache) > 0 then begin + CurrentItem := FRecordNoCache[Value - 1]; + Exit; + end; + + if IntPtr(CurrentItem) <> nil then + CurrItem := CurrentItem + else + CurrItem := FirstItem; + + LastOrderedItem := LastItem; + while LastOrderedItem.Order = 0 do begin // if recordset is filtered + LastOrderedItem := LastOrderedItem.Prev; + if IntPtr(LastOrderedItem) = nil then + Exit; // all records are rejected by filter + end; + + if (Value < Abs(LastOrderedItem.Order + FRecordNoOffset - Value)) and + (Value < Abs(CurrItem.Order + FRecordNoOffset - Value)) + then begin + // from first + Item := FirstItem; + ForwardDir := True; + end + else + if Abs(LastOrderedItem.Order + FRecordNoOffset - Value) < + Abs(CurrItem.Order + FRecordNoOffset - Value) + then begin + // from + Item := LastOrderedItem; + ForwardDir := LastOrderedItem.Order + FRecordNoOffset < Value; + end + else begin + // from current + Item := CurrItem; + ForwardDir := CurrItem.Order + FRecordNoOffset < Value; + end; + + while (IntPtr(Item) <> nil) and (Item.Order + FRecordNoOffset <> Value) do + if ForwardDir then begin + if IntPtr(Item.Next) = nil then + Fetch; + Item := Item.Next + end + else + Item := Item.Prev; + + if IntPtr(Item) <> nil then + CurrentItem := Item; + end; +end; + +{ Fetch } + +function TMemData.Fetch(FetchBack: boolean = False): boolean; +begin + Result := False; +end; + +procedure TMemData.InitFetchedItems(FetchedItem: IntPtr; NoData, FetchBack: boolean); +var + Item: IntPtr; + ItemHeader: PItemHeader {$IFNDEF CLR}absolute Item{$ENDIF}; + NewOrder: Integer; +begin + Item := FetchedItem; +{$IFDEF CLR} + ItemHeader := Item; +{$ENDIF} + if not FetchBack then begin + NewOrder := 1; + while (Item = FetchedItem) or ((Item <> nil) and OmitRecord(ItemHeader)) do begin + ItemHeader := ItemHeader.Prev; + {$IFDEF CLR} + Item := ItemHeader; + {$ENDIF} + end; + if Item <> nil then + NewOrder := ItemHeader.Order + 1; + end + else + NewOrder := ItemHeader.Order; + + Item := FetchedItem; +{$IFDEF CLR} + ItemHeader := Item; +{$ENDIF} + while IntPtr(Item) <> nil do begin + if not OmitRecord(ItemHeader) then begin + if not (NoData or FetchBack) then + Inc(FRecordCount); + ItemHeader.Order := NewOrder; + if FetchBack then + Dec(NewOrder) + else + Inc(NewOrder); + end; + if FetchBack then + ItemHeader := ItemHeader.Prev + else + ItemHeader := ItemHeader.Next; + {$IFDEF CLR} + Item := ItemHeader; + {$ENDIF} + end; +end; + +{ BookMarks } + +procedure TMemData.GetBookmark(Bookmark: PRecBookmark); +begin + Bookmark.RefreshIteration := FRefreshIteration; + Bookmark.Item := CurrentItem; + if IntPtr(CurrentItem) <> nil then + Bookmark.Order := CurrentItem.Order + FRecordNoOffset + else + Bookmark.Order := -1; +end; + +procedure TMemData.SetToBookmark(Bookmark: PRecBookmark); +var + OldCurrentItem: PItemHeader; +begin + if (Bookmark.RefreshIteration = FRefreshIteration) and + (IntPtr(Bookmark.Item) <> nil) + then begin + OldCurrentItem := CurrentItem; + try // for freed item + CurrentItem := Bookmark.Item; + if CurrentItem.Flag = flUsed then begin + FBOF := False; + FEOF := False; + Exit; + end + else + CurrentItem := OldCurrentItem; + except + CurrentItem := OldCurrentItem; + end; + end; + +// Set by order + inherited; +end; + +function TMemData.BookmarkValid(Bookmark: PRecBookmark): boolean; +begin + if IntPtr(Bookmark) <> nil then + Result := (Bookmark.Order <> -1) or (IntPtr(Bookmark.Item) <> nil) + else + Result := False; + + if Result and Filtered then + Result := not OmitRecord(Bookmark.Item); +end; + +function TMemData.CompareBookmarks(Bookmark1, Bookmark2: PRecBookmark): integer; +const + RetCodes: array[Boolean, Boolean] of ShortInt = ((2,-1),(1,0)); +begin + Result := RetCodes[IntPtr(Bookmark1) = nil, IntPtr(Bookmark2) = nil]; + if Result = 2 then + if Bookmark1.RefreshIteration = Bookmark2.RefreshIteration then + if Bookmark1.Item = Bookmark2.Item then begin + Result := 0; + Exit; + end; + +// Compare by order + Result := inherited CompareBookmarks(Bookmark1, Bookmark2); +end; + +{ CachedUpdates } + +function TMemData.GetUpdateStatus: TItemStatus; +begin + if IntPtr(CurrentItem) <> nil then + Result := CurrentItem.Status + else + Result := isUnmodified; +end; + +function TMemData.GetUpdateResult: TUpdateRecAction; +begin + if IntPtr(CurrentItem) <> nil then + Result := CurrentItem.UpdateResult + else + Result := urNone; +end; + +procedure TMemData.AddCacheItem(CacheItem: TCacheItem); +begin +// add to end cache + CacheItem.Next := nil; + if Cache = nil then + Cache := CacheItem + else + LastCacheItem.Next := CacheItem; + + LastCacheItem := CacheItem; +end; + +procedure TMemData.SetCacheRecBuf(NewBuf: IntPtr; OldBuf: IntPtr); +begin + NewCacheRecBuf := NewBuf; + OldCacheRecBuf := OldBuf; +end; + +procedure TMemData.ApplyUpdates; +var + CacheItem, NextCacheItem, PrevCacheItem: TCacheItem; + Action: TUpdateRecAction; + OldCurrentItem: PItemHeader; + + PacketCacheItem: TCacheItem; + PrevPacketCacheItem: TCacheItem; + + function ValidateCacheItem: boolean; + { On case of deleting current item from cache via RevertRecord in + ApplyRecord call. Returns True if CacheItem was deleted. } + begin + Result := True; + if PrevCacheItem <> nil then begin + if PrevCacheItem.Next = NextCacheItem then begin + CacheItem := NextCacheItem; + Result := True; + end; + end + else + if NextCacheItem <> nil then begin + if CacheItem.Next <> NextCacheItem then begin + CacheItem := NextCacheItem; + Result := False; + end; + end + else + if Cache = nil then begin + CacheItem := nil; + Result := False; + end; + end; + + procedure SetAction(Action: TUpdateRecAction); + var + Temp: TCacheItem; + begin + // Set action for batch of items + if Action <> urSuspended then begin + Temp := PacketCacheItem; + while (Temp <> nil) and (Temp <> CacheItem) do begin + Temp.Item.UpdateResult := Action; + Temp := Temp.Next; + end; + end; + CacheItem.Item.UpdateResult := Action; + end; + +begin + if FCachedUpdates then begin + OldCurrentItem := CurrentItem; + try + PrevCacheItem := nil; + PacketCacheItem := nil; + PrevPacketCacheItem := nil; + CacheItem := Cache; + while CacheItem <> nil do + if CacheItem.Item.UpdateResult <> urApplied then begin + NextCacheItem := CacheItem.Next; + try + CurrentItem := CacheItem.Item; // for refresh on applied + Action := urFail; + try + case CacheItem.Item.Status of + isAppended: begin + BlockMan.GetRecord(CacheItem.Item, NewCacheRecBuf); + BlockMan.GetRecord(CacheItem.Item, OldCacheRecBuf); + ApplyRecord(ukInsert, Action, CacheItem.Next = nil); + BlockMan.PutRecord(CacheItem.Item, NewCacheRecBuf); // for ReturnParams + end; + isUpdated: begin + BlockMan.GetRecord(CacheItem.Item, NewCacheRecBuf); + BlockMan.GetRecord(CacheItem.Item.Rollback, OldCacheRecBuf); + ApplyRecord(ukUpdate, Action, CacheItem.Next = nil); + BlockMan.PutRecord(CacheItem.Item, NewCacheRecBuf); // for ReturnParams + end; + isDeleted: begin + BlockMan.GetRecord(CacheItem.Item, NewCacheRecBuf); + BlockMan.GetRecord(CacheItem.Item, OldCacheRecBuf); + ApplyRecord(ukDelete, Action, CacheItem.Next = nil); + end; + else + Assert(False); + end; + finally + if Active and ValidateCacheItem then begin + SetAction(Action); + case Action of + urSuspended: + if PacketCacheItem = nil then begin + PacketCacheItem := CacheItem; + PrevPacketCacheItem := PrevCacheItem; + end; + urRetry: + if PacketCacheItem <> nil then begin + CacheItem := PacketCacheItem; + PrevCacheItem := PrevPacketCacheItem; + end; + else + PacketCacheItem := nil; + PrevPacketCacheItem := nil; + end; + if Action <> urRetry then begin + PrevCacheItem := CacheItem; + CacheItem := NextCacheItem; + end; + end; + end; + except + if CacheItem <> nil then + OldCurrentItem := CacheItem.Item; // failed item is current + raise; + end; + end + else + CacheItem := CacheItem.Next; + finally + CurrentItem := OldCurrentItem; + end; + end; +end; + +procedure TMemData.CommitUpdates; +var + CacheItem,CacheItem1: TCacheItem; +begin + if UpdatesPending then + ApplyUpdates; + + CacheItem := Cache; + LastCacheItem := nil; + while CacheItem <> nil do + if CacheItem.Item.UpdateResult = urApplied then begin + if IntPtr(CacheItem.Item.Rollback) <> nil then begin + FreeComplexFields(IntPtr(Integer(CacheItem.Item.Rollback) + sizeof(TItemHeader)), True); + BlockMan.FreeItem(CacheItem.Item.Rollback); + CacheItem.Item.Rollback := nil; + end; + + if CacheItem.Item.Status = isDeleted then begin + if HasComplexFields then + FreeComplexFields(IntPtr(Integer(CacheItem.Item) + sizeof(TItemHeader)), True); + + DeleteItem(CacheItem.Item) + end + else begin + CacheItem.Item.Status := isUnmodified; + CacheItem.Item.UpdateResult := urNone; + end; + + CacheItem1 := CacheItem; + CacheItem := CacheItem.Next; + if CacheItem1 = Cache then + Cache := CacheItem; + if (CacheItem = nil) and (Cache <> nil) and (Cache.Next = CacheItem1) then + Cache.Next := nil; + CacheItem1.Free; + end + else begin + CacheItem1 := CacheItem; + CacheItem := CacheItem.Next; + if CacheItem <> nil then + LastCacheItem := CacheItem + else + if (LastCacheItem = nil) and (CacheItem1 = Cache) then // only one unapllied reacord + LastCacheItem := Cache; + end; +end; + +procedure TMemData.RevertItem(Item: PItemHeader); +begin + case Item.Status of + isAppended: begin + if HasComplexFields then + FreeComplexFields(IntPtr(Integer(Item) + sizeof(TItemHeader)), True); + + DeleteItem(Item); + Dec(FRecordCount); + end; + isUpdated: begin + FreeComplexFields(IntPtr(Integer(Item) + sizeof(TItemHeader)), True); + BlockMan.CopyRecord(Item.Rollback, Item); + BlockMan.FreeItem(Item.Rollback); + Item.Rollback := nil; + Item.Status := isUnmodified; + Item.UpdateResult := urNone; + Item.FilterResult := fsNotChecked; + end; + isDeleted: begin + Item.Status := isUnmodified; + Item.UpdateResult := urNone; + Item.FilterResult := fsNotChecked; + Inc(FRecordCount); + end; + isUnmodified: begin + Item.UpdateResult := urNone; + Item.FilterResult := fsNotChecked; + end; + end; +end; + +procedure TMemData.RevertRecord; +var + CacheItem: TCacheItem; + OldCacheItem: TCacheItem; +begin + if Cache <> nil then begin + CacheItem := Cache; + OldCacheItem := CacheItem; + while (CacheItem <> nil) and not (CacheItem.Item = CurrentItem) do begin + OldCacheItem := CacheItem; + CacheItem := CacheItem.Next; + end; + if CacheItem <> nil then begin + if OldCacheItem <> CacheItem then + OldCacheItem.Next := CacheItem.Next + else + Cache := CacheItem.Next; + + RevertItem(CacheItem.Item); + if CacheItem = LastCacheItem then + LastCacheItem := OldCacheItem; + CacheItem.Free; + end; + end; +end; + +procedure TMemData.CancelUpdates; +var + CacheItem: TCacheItem; +begin + if Cache <> nil then begin + while Cache <> nil do begin + RevertItem(Cache.Item); + CacheItem := Cache; + Cache := Cache.Next; + CacheItem.Free; + end; + + LastCacheItem := nil; + + ReorderItems(nil, roFull); + end; +end; + +procedure TMemData.RestoreUpdates; +var + CacheItem: TCacheItem; +begin + if FCachedUpdates then begin + CacheItem := Cache; + while CacheItem <> nil do begin + //CacheItem.Item.Status + CacheItem.Item.UpdateResult := urNone; + CacheItem := CacheItem.Next; + end; + end; +end; + +function TMemData.GetUpdatesPending: boolean; +var + CacheItem: TCacheItem; +begin + Result := False; + CacheItem := Cache; + while (CacheItem <> nil) and not Result do begin + Result := CacheItem.Item.UpdateResult <> urApplied; + CacheItem := CacheItem.Next; + end; +end; + +procedure TMemData.GetOldRecord(RecBuf: IntPtr); +begin + if not(EOF or BOF or (IntPtr(CurrentItem) = nil)) then begin + if OmitRecord(CurrentItem) then + GetNextRecord(RecBuf); + if IntPtr(CurrentItem) <> nil then + if IntPtr(CurrentItem.Rollback) <> nil then + BlockMan.GetRecord(CurrentItem.Rollback, RecBuf) + else + BlockMan.GetRecord(CurrentItem, RecBuf); + end; +end; + +{ Filter } + +procedure TMemData.FilterUpdated; +begin + ClearItemsOmittedStatus; + ReorderItems(nil, roFull); + FEOF := RecordCount = 0; // for correct navigation +end; + +procedure TMemData.ClearItemsOmittedStatus; +var + Item: PItemHeader; +begin + Item := FirstItem; + while IntPtr(Item) <> nil do begin + Item.FilterResult := fsNotChecked; + Item := Item.Next; + end; +end; + +procedure TMemData.SetFilterItemTypes(Value: TItemTypes); +begin + if Value <> FilterItemTypes then begin + inherited; + + ClearItemsOmittedStatus; + ReorderItems(nil, roFull); + FEOF := RecordCount = 0; // for correct navigation + end; +end; + +{ TBlockManager } + +{$IFDEF CLR} +[DllImport(kernel32, CharSet = CharSet.Ansi, SetLastError = True, EntryPoint = 'HeapAlloc')] +function HeapAlloc(hHeap: THandle; dwFlags, dwBytes: DWORD): IntPtr; external; + +[DllImport(kernel32, CharSet = CharSet.Ansi, SetLastError = True, EntryPoint = 'HeapFree')] +function HeapFree(hHeap: THandle; dwFlags: DWORD; lpMem: IntPtr): BOOL; external; + +[DllImport(kernel32, CharSet = CharSet.Ansi, SetLastError = True, EntryPoint = 'HeapCreate')] +function HeapCreate(flOptions, dwInitialSize, dwMaximumSize: DWORD): THandle; external; + +[DllImport(kernel32, CharSet = CharSet.Ansi, SetLastError = True, EntryPoint = 'HeapDestroy')] +function HeapDestroy(hHeap: THandle): BOOL; external; + +const + HEAP_NO_SERIALIZE = 1; + HEAP_GENERATE_EXCEPTIONS = 4; +{$ENDIF} + + +constructor TBlockManager.Create; +begin + inherited; + + DefaultItemCount := 10; // WAR +end; + +destructor TBlockManager.Destroy; +begin + FreeAllBlock; + + inherited; +end; + +procedure TBlockManager.AllocBlock(var Block: PBlockHeader; ItemCount: word); +var + BlockSize: integer; +begin + BlockSize := sizeof(TBlockHeader) + ItemCount*(sizeof(TItemHeader) + RecordSize); + +{$IFDEF CLR} + if IntPtr(FHeap) = nil then + FHeap := HeapCreate(HEAP_GENERATE_EXCEPTIONS + HEAP_NO_SERIALIZE, BlockSize + 100 {overhead}, 0); + Block := HeapAlloc(FHeap, HEAP_GENERATE_EXCEPTIONS + HEAP_NO_SERIALIZE, BlockSize); +{$ELSE} + GetMem(Block, BlockSize); +{$ENDIF} + + Block.ItemCount := ItemCount; + Block.UsedItems := ItemCount; + + Block.Next := FirstBlock; + Block.Prev := nil; + + //Block.Test := btSign; // DEBUG + + if IntPtr(FirstBlock) <> nil then + FirstBlock.Prev := Block; + FirstBlock := Block; +end; + +procedure TBlockManager.FreeBlock(Block: PBlockHeader); +begin + if Block = FirstBlock then begin + FirstBlock := Block.Next; + if IntPtr(FirstBlock) <> nil then + FirstBlock.Prev := nil; + end + else begin + Block.Prev.Next := Block.Next; + if IntPtr(Block.Next) <> nil then + Block.Next.Prev := Block.Prev; + end; + +{$IFDEF CLR} + HeapFree(FHeap, HEAP_NO_SERIALIZE, Block); +{$ELSE} + FreeMem(Block, BlockSize); +{$ENDIF} +end; + +procedure TBlockManager.FreeAllBlock; +begin +{$IFDEF CLR} + HeapDestroy(FHeap); + FHeap := 0; + FirstBlock := nil; +{$ELSE} + while IntPtr(FirstBlock) <> nil do + FreeBlock(FirstBlock); +{$ENDIF} + + FirstFree := nil; +end; + +procedure TBlockManager.AddFreeBlock; +var + Block: PBlockHeader; + Item: PItemHeader; + i: word; +begin + AllocBlock(Block, DefaultItemCount); + + Item := IntPtr(Integer(Block) + sizeof(TBlockHeader)); + for i := 1 to DefaultItemCount do begin + Item.Prev := nil; + Item.Next := FirstFree; + Item.Block := Block; + Item.Flag := flFree; + + if IntPtr(FirstFree) <> nil then + FirstFree.Prev := Item; + FirstFree := Item; + + Item := IntPtr(Integer(Item) + sizeof(TItemHeader) + RecordSize); + end; + Block.UsedItems := 0; +end; + +procedure TBlockManager.AllocItem(var Item: PItemHeader); +begin + if IntPtr(FirstFree) = nil then + AddFreeBlock; + + Item := FirstFree; + + Assert(Item.Flag = flFree); + Item.Flag := flUsed; + + FirstFree := FirstFree.Next; + if IntPtr(FirstFree) <> nil then + FirstFree.Prev := nil; + + Item.Rollback := nil; + Item.Status := isUnmodified; + Item.UpdateResult := urNone; + Item.Order := 0; + Item.FilterResult := fsNotChecked; + + Item.Block.UsedItems := Item.Block.UsedItems + 1; +end; + +procedure TBlockManager.FreeItem(Item: PItemHeader); +var + Free: PItemHeader; + i: integer; +begin + Assert(Item.Flag = flUsed); + + Item.Flag := flFree; + + if Item.Block.UsedItems = 1 then begin + // Procesing Free List + Free := IntPtr(Integer(Item.Block) + sizeof(TBlockHeader)); + for i := 1 to Item.Block.ItemCount do begin + if not(Free = Item) then begin + Assert(Free.Flag = flFree); + + if Free = FirstFree then begin + FirstFree := Free.Next; + if IntPtr(FirstFree) <> nil then + FirstFree.Prev := nil; + end + else begin + Free.Prev.Next := Free.Next; + if IntPtr(Free.Next) <> nil then + Free.Next.Prev := Free.Prev; + end; + end; + Free := IntPtr(Integer(Free) + sizeof(TItemHeader) + RecordSize); + end; + FreeBlock(Item.Block); + end + else begin + Item.Prev := nil; + Item.Next := FirstFree; + if IntPtr(FirstFree) <> nil then + FirstFree.Prev := Item; + FirstFree := Item; + Item.Block.UsedItems := Item.Block.UsedItems - 1; + end; +end; + +procedure TBlockManager.InitItem(Item: PItemHeader); +begin + Item.Rollback := nil; + Item.Status := isUnmodified; + Item.UpdateResult := urNone; +end; + +procedure TBlockManager.PutRecord(Item: PItemHeader; Rec: IntPtr); +begin + CopyBuffer(Rec, IntPtr(Integer(Item) + sizeof(TItemHeader)), RecordSize) +end; + +procedure TBlockManager.GetRecord(Item: PItemHeader; Rec: IntPtr); +begin + CopyBuffer(IntPtr(Integer(Item) + sizeof(TItemHeader)), Rec, RecordSize) +end; + +function TBlockManager.GetRecordPtr(Item: PItemHeader): IntPtr; +begin + Result := IntPtr(Integer(Item) + sizeof(TItemHeader)); +end; + +procedure TBlockManager.CopyRecord(ItemSrc: PItemHeader; ItemDest: PItemHeader); +begin + CopyBuffer(IntPtr(Integer(ItemSrc) + sizeof(TItemHeader)), + IntPtr(Integer(ItemDest) + sizeof(TItemHeader)), RecordSize); +end; + +{ TStringHeap } + +{$IFDEF CLR} +function PBlock.GetNext: PBlock; +begin + Result := Marshal.ReadIntPtr(Ptr, 0); +end; + +procedure PBlock.SetNext(Value: PBlock); +begin + Marshal.WriteIntPtr(Ptr, 0, Value); +end; + +class operator PBlock.Implicit(AValue: IntPtr): PBlock; +begin + Result.Ptr := AValue; +end; + +class operator PBlock.Implicit(AValue: PBlock): IntPtr; +begin + Result := AValue.Ptr; +end; + +{$ENDIF} + +constructor TStringHeap.Create; +begin + inherited; + + FRoot := nil; + FEmpty := True; + FSysGetMem := False; + +{$IFDEF WIN32} + FUseSysMemSize := not IsMemoryManagerSet; +{$ENDIF} + FThreadSafety := False; + FThreadSafetyCS := nil; +end; + +destructor TStringHeap.Destroy; +begin + Clear; + FThreadSafetyCS.Free; + + inherited; +end; + +procedure TStringHeap.SetThreadSafety(const Value: boolean); +begin + if Value <> FThreadSafety then begin + FThreadSafety := Value; + if Value then begin + Assert(FThreadSafetyCS = nil); + FThreadSafetyCS := TCriticalSection.Create; + end + else begin + FThreadSafetyCS.Free; + FThreadSafetyCS := nil; + end; + end; +end; + +procedure TStringHeap.Clear; +var + P, Temp: PBlock; + i: integer; +begin + if Empty then + Exit; + if FThreadSafetyCS <> nil then + FThreadSafetyCS.Acquire; + try + P := FRoot; + while IntPtr(P) <> nil do begin + Temp := P; + P := P.Next; + Marshal.FreeHGlobal(Temp); + end; + FRoot := nil; + FFree := SizeOf_TStrData; + for i := Low(FSmallTab) to High(FSmallTab) do + FSmallTab[i] := nil; + FEmpty := True; + FSysGetMem := False; + finally + if FThreadSafetyCS <> nil then + FThreadSafetyCS.Release; + end; +end; + +function TStringHeap.AllocStr(Str: IntPtr; Trim: boolean = false; Len: integer = -1): IntPtr; +var + EndPtr: IntPtr; +begin + if Str = nil then + Result := nil + else begin + if Len = -1 then + Len := StrLen(Str); + if Trim then begin + EndPtr := IntPtr(Integer(Str) + Len - 1); + while (Len > 0) and + {$IFDEF CLR} + (Marshal.ReadByte(EndPtr) = Byte(' ')) + {$ELSE} + (PByte(EndPtr)^ = Byte(' ')) + {$ENDIF} + do begin + EndPtr := IntPtr(Integer(EndPtr) - 1 {sizeof(AsciiChar)}); + Dec(Len); + end; + end; + Result := NewBuf(Len + 1); + CopyBuffer(Str, Result, Len); + Marshal.WriteByte(Result, Len, byte(#0)); + end; +end; + +function TStringHeap.AllocWideStr(Str: IntPtr; Trim: boolean = false; Len: integer = -1): IntPtr; +var + EndPtr: IntPtr; +begin + if Str = nil then + Result := nil + else begin + if Len = -1 then + Len := StrLenW(Str); + if Trim then begin + EndPtr := IntPtr(Integer(Str) + (Len - 1) * sizeof(WideChar)); + while (Len > 0) and + {$IFDEF CLR} + (Marshal.ReadInt16(EndPtr) = SmallInt(' ')) + {$ELSE} + (PSmallInt(EndPtr)^ = SmallInt(' ')) + {$ENDIF} + do begin + EndPtr := IntPtr(Integer(EndPtr) - sizeof(WideChar)); + Dec(Len); + end; + end; + Result := NewBuf((Len + 1) * sizeof(WideChar)); + CopyBuffer(Str, Result, Len * sizeof(WideChar)); + Marshal.WriteInt16(Result, Len * sizeof(WideChar), byte(#0)); + end; +end; + +function TStringHeap.ReAllocStr(Str: IntPtr; Trim: boolean = false): IntPtr; +begin + Result := AllocStr(Str, Trim); + DisposeBuf(Str); +end; + +function TStringHeap.ReAllocWideStr(Str: IntPtr; Trim: boolean = false): IntPtr; +begin + Result := AllocStr(Str, Trim); + DisposeBuf(Str); +end; + +function TStringHeap.UseSmallTabs(divSize: integer): boolean; +begin + Result := divSize <= SmallSize div Align; + // This fix was added 04.04.2006 and rolled back 07.03.2007 because of bug + // with allocation using memory manager and disposing using StringHeap block of memroy with size 2002 bytes + // if (not Result) and ((Size - 1) div Align <= SmallSize div Align) then + // Result := True; +end; + +function TStringHeap.NewBuf(Size: integer): IntPtr; +var + P: IntPtr; + Temp: PBlock; + Idx: integer; + divSize: integer; +begin + if Size <= 0 then begin + Result := nil; + end + else begin + if FThreadSafetyCS <> nil then + FThreadSafetyCS.Acquire; + try + FEmpty := False; + divSize := (Size + Align - 1) div Align; + if UseSmallTabs(divSize) then begin + Result := FSmallTab[divSize]; + if Result <> nil then begin + FSmallTab[divSize] := Marshal.ReadIntPtr(Result); + p := IntPtr(Integer(Result) - SizeOf(Word)); + Marshal.WriteInt16(p, Marshal.ReadInt16(p) + 1); + Exit; + end; + Size := divSize * Align; + if IntPtr(FRoot) = nil then begin + FRoot := Marshal.AllocHGlobal(SizeOf_TBlock); + FRoot.Next := nil; + FFree := SizeOf_TStrData; + end + else + if FFree < Size + SizeOf(Integer) + SizeOf(Word) then begin + P := IntPtr(Integer(IntPtr(FRoot)) + SizeOf(PBlock) + SizeOf_TStrData - FFree); + divSize := (FFree - SizeOf(Integer) - SizeOf(Word)) div Align; + Marshal.WriteInt32(P, divSize * Align); + P := IntPtr(Integer(P) + SizeOf(Integer)); + Marshal.WriteInt16(P, RefNull); + P := IntPtr(Integer(P) + SizeOf(Word)); + Idx := divSize; + Marshal.WriteIntPtr(P, FSmallTab[Idx]); + FSmallTab[Idx] := P; + Temp := FRoot; + FRoot := Marshal.AllocHGlobal(SizeOf_TBlock); + FRoot.Next := Temp; + FFree := SizeOf_TStrData; + end; + Result := IntPtr(Integer(IntPtr(FRoot)) + SizeOf(PBlock) + SizeOf_TStrData - FFree); + Marshal.WriteInt32(Result, Size); + Dec(FFree, Size + SizeOf(Integer) + SizeOf(Word)); + if FFree < SizeOf(Integer) + SizeOf(Word) + Align then begin + Marshal.WriteInt32(Result, Marshal.ReadInt32(Result) + FFree and not (Align - 1)); + Temp := FRoot; + FRoot := Marshal.AllocHGlobal(SizeOf_TBlock); + FRoot.Next := Temp; + FFree := SizeOf_TStrData; + end; + Result := IntPtr(Integer(Result) + SizeOf(Integer)); + end + else begin + {$IFDEF WIN32} + if FUseSysMemSize then + Result := Marshal.AllocHGlobal(Size + SizeOf(Word)) + else begin + {$ENDIF} + Result := Marshal.AllocHGlobal(Size + SizeOf(Word) + SizeOf(Integer)); + Marshal.WriteInt32(Result, Size); + Result := IntPtr(Integer(Result) + SizeOf(Integer)); + {$IFDEF WIN32} + end; + {$ENDIF} + FSysGetMem := True; + end; + Marshal.WriteInt16(Result, RefNull); + Result := IntPtr(Integer(Result) + SizeOf(Word)); + finally + if FThreadSafetyCS <> nil then + FThreadSafetyCS.Release; + end; + end; +end; + +procedure TStringHeap.DisposeBuf(Buf: IntPtr); +var + Size: integer; + PRefCount: IntPtr; + RefCount: Word; + Idx: integer; + divSize: integer; +begin + if (Buf <> nil) then begin + if FThreadSafetyCS <> nil then + FThreadSafetyCS.Acquire; + try + PRefCount := IntPtr(Integer(Buf) - SizeOf(Word)); + RefCount := Marshal.ReadInt16(PRefCount); + Assert(RefCount >= RefNull, 'DisposeBuf failed'); + if RefCount = RefNull then begin + Marshal.WriteInt16(PRefCount, RefCount - 1); + Size := Marshal.ReadInt32(IntPtr(Integer(PRefCount) - SizeOf(Integer))); + divSize := (Size + Align - 1) div Align; + Assert(divSize <> 0, 'SmallTab in DisposeBuf failed'); + if UseSmallTabs(divSize) then begin + Idx := divSize; + Marshal.WriteIntPtr(Buf, FSmallTab[Idx]); + FSmallTab[Idx] := Buf; + end + else + {$IFDEF WIN32} + if FUseSysMemSize then + Marshal.FreeHGlobal(PRefCount) + else + {$ENDIF} + Marshal.FreeHGlobal(IntPtr(Integer(PRefCount) - SizeOf(Integer))); + end + else + Marshal.WriteInt16(PRefCount, RefCount - 1); + finally + if FThreadSafetyCS <> nil then + FThreadSafetyCS.Release; + end; + end; +end; + +procedure TStringHeap.AddRef(Buf: IntPtr); +var + PRefCount: IntPtr; + RefCount: Word; +begin + if (Buf <> nil) then begin + PRefCount := IntPtr(Integer(Buf) - SizeOf(Word)); + RefCount := Marshal.ReadInt16(PRefCount); + Assert(RefCount >= RefNull, 'AddRefStr failed'); + Marshal.WriteInt16(PRefCount, RefCount + 1); + end; +end; + +{ TSharedObject } + +constructor TSharedObject.Create; +begin + inherited; + + AddRef; + +{$IFDEF CRDEBUG} Inc(ShareObjectCnt); {$ENDIF} +end; + +destructor TSharedObject.Destroy; +begin + {$IFDEF CRDEBUG} Dec(ShareObjectCnt); {$ENDIF} + FRefCount := 0; + + inherited; +end; + +procedure TSharedObject.CheckValid; +begin + if FRefCount = 0 then + raise Exception.Create(SInvalidSharedObject); +end; + +procedure TSharedObject.Free; +begin + if Assigned(Self) then begin + Assert(FRefCount > 0, ClassName + '.Free RefCount = ' + IntToStr(FRefCount)); + + if FRefCount = 1 then begin + if FGCHandle <> nil then + FreeGCHandle(FGCHandle); + inherited Free; + end + else + Dec(FRefCount); + end; +end; + +procedure TSharedObject.AddRef; +begin + Inc(FRefCount); +end; + +procedure TSharedObject.Release; +begin + Free; +end; + +{$IFNDEF CLR} +function TSharedObject.GetHashCode: integer; +begin + Result := Integer(Self); +end; +{$ENDIF} + +function TSharedObject.GetGCHandle: IntPtr; +begin + if FGCHandle = nil then + FGCHandle := AllocGCHandle(Self); + Result := FGCHandle; +end; + +{ TPiece } + +function NextPiece(Piece: PPieceHeader): PPieceHeader; +begin + if IntPtr(Piece) <> nil then + Result := Piece.Next + else + Result := nil; +end; + +function PieceData(Piece: PPieceHeader): IntPtr; +begin + if IntPtr(Piece) <> nil then + Result := IntPtr(Integer(Piece) + sizeof(TPieceHeader)) + else + Result := nil; +end; + +function PieceUsedPtr(Piece: PPieceHeader): IntPtr; +begin + if IntPtr(Piece) <> nil then + Result := IntPtr(Integer(Piece) + sizeof(integer) * 2) + else + Result := nil; +end; + +{ TBlob } + +constructor TBlob.Create(IsUnicode: boolean = False); +begin + inherited Create; + + FIsUnicode := IsUnicode; + PieceSize := DefaultPieceSize; + Test := btSign; // DEBUG +end; + +destructor TBlob.Destroy; +begin + CheckValid; // DEBUG + Test := 0; // DEBUG + + FNeedRollback := False; + Clear; + + if Rollback <> nil then + Rollback.Free; + + inherited; +end; + +procedure TBlob.CheckValid; +begin + if Test <> btSign then // DEBUG + raise Exception.Create(SInvalidBlob); +end; + +procedure TBlob.Clear; +begin + if FNeedRollback and (Rollback = nil) then + SaveToRollback; + + InternalClear; + + FModified := True; +end; + +{ Pieces } + +procedure TBlob.AllocPiece(var Piece: PPieceHeader; Size: cardinal); +begin + Assert(Size > 0); + Piece := Marshal.AllocHGlobal(Integer(sizeof(TPieceHeader)) + Integer(Size)); + Piece.Blob := 0; + Piece.Size := Size; + Piece.Used := 0; + Piece.Prev := nil; + Piece.Next := nil; +end; + +procedure TBlob.ReallocPiece(var Piece: PPieceHeader; Size: cardinal); +var + MemSize: integer; +begin + if Size = 0 then begin + FreePiece(Piece); + Piece := nil; + end + else + if Size <> Piece.Size then begin + MemSize := Integer(sizeof(TPieceHeader)) + Integer(Size); + Piece := Marshal.ReAllocHGlobal(Piece, IntPtr(MemSize)); + Piece.Size := Size; + if Piece.Used > Size then + Piece.Used := Size; + if Piece.Blob <> 0 then begin + if IntPtr(Piece.Prev) <> nil then + Piece.Prev.Next := Piece + else + FFirstPiece := Piece; + + if IntPtr(Piece.Next) <> nil then + Piece.Next.Prev := Piece; + end; + end; +end; + +procedure TBlob.FreePiece(Piece: PPieceHeader); +begin + if Piece.Blob <> 0 then + DeletePiece(Piece); + + Marshal.FreeHGlobal(Piece); +end; + +procedure TBlob.AppendPiece(Piece: PPieceHeader); +var + Last: PPieceHeader; +begin + Piece.Blob := Self.GetHashCode; + Piece.Next := nil; + if IntPtr(FFirstPiece) = nil then begin + Piece.Prev := nil; + FFirstPiece := Piece; + end + else begin + Last := FFirstPiece; + while IntPtr(Last.Next) <> nil do + Last := Last.Next; + Last.Next := Piece; + Piece.Prev := Last; + end; +end; + +procedure TBlob.DeletePiece(Piece: PPieceHeader); +begin + Assert(Piece.Blob = Self.GetHashCode); + + if FFirstPiece = Piece then begin + FFirstPiece := Piece.Next; + if IntPtr(FFirstPiece) <> nil then + FFirstPiece.Prev := nil; + end + else + begin + Piece.Prev.Next := Piece.Next; + if IntPtr(Piece.Next) <> nil then + Piece.Next.Prev := Piece.Prev; + end; + + Piece.Blob := 0; +end; + +procedure TBlob.CompressPiece(var Piece: PPieceHeader); +begin + if Piece.Used < Piece.Size then + ReallocPiece(Piece, Piece.Used); +end; + +function TBlob.FirstPiece: PPieceHeader; +begin + Result := FFirstPiece; +end; + +procedure TBlob.CheckValue; +begin +end; + +function TBlob.Read(Position: cardinal; Count: cardinal; Dest: IntPtr): cardinal; +var + Piece: PPieceHeader; + Pos, { shift from Blob begin } + Shift, { for read, in Piece } + ReadCount, { all } + MoveSize: cardinal; { in Piece } +begin + CheckValid; // DEBUG + + CheckValue; + + Result := 0; + + if (IntPtr(FFirstPiece) = nil) or (Position > Size) then + Exit; + + if Count = 0 then + Count := Size; + + if Position + Count > Size then + Count := Size - Position; + + Piece := FFirstPiece; + ReadCount := 0; + Pos := 0; + while (IntPtr(Piece) <> nil) and (Pos < (Position + Count)) do begin + if Pos + Piece.Used > Position then begin + if Position > Pos then + Shift := Position - Pos + else + Shift := 0; + + if (Pos + Piece.Used) > (Position + Count) then + MoveSize := (Position + Count) - (Pos + Shift) + else + MoveSize := Piece.Used - Shift; + + CopyBuffer(IntPtr(Integer(Piece) + sizeof(TPieceHeader) + Integer(Shift)), + IntPtr(Integer(Dest) + Integer(ReadCount)), MoveSize); + Inc(ReadCount, MoveSize); + end; + Inc(Pos, Piece.Used); + Piece := Piece.Next; + end; + Result := ReadCount; +end; + +{ similar to Read } + +procedure TBlob.Write(Position: cardinal; Count: cardinal; Source: IntPtr); +var + Piece: PPieceHeader; + Pos, { shift from Blob begin } + Shift, { for write, in Piece } + WriteCount, { all } + MoveSize: cardinal; { in Piece } +begin + CheckValid; // DEBUG + + if FNeedRollback and (Rollback = nil) then + SaveToRollback; + + if (Position > Size) then + Position := Size; + + Piece := FFirstPiece; + WriteCount := 0; + Pos := 0; + while (Pos < (Position + Count)) do begin + if IntPtr(Piece) = nil then begin + if Count > PieceSize then + AllocPiece(Piece, PieceSize) + else + AllocPiece(Piece, Count); + AppendPiece(Piece); + end; + + if Pos + Piece.Size > Position then begin + if Position > Pos then + Shift := Position - Pos + else + Shift := 0; + + if (Pos + Piece.Size) > (Position + Count) then + MoveSize := (Position + Count) - (Pos + Shift) + else + MoveSize := Piece.Size - Shift; + + CopyBuffer(IntPtr(Integer(Source) + Integer(WriteCount)), + IntPtr(Integer(Piece) + sizeof(TPieceHeader) + Integer(Shift)), MoveSize); + Inc(WriteCount, MoveSize); + + Assert(Shift <= Piece.Used); + if (Shift + MoveSize) > Piece.Used then + Piece.Used := Shift + MoveSize; + end; + Inc(Pos, Piece.Used); + Piece := Piece.Next; + end; + + FModified := True; +end; + +procedure TBlob.Truncate(NewSize: cardinal); +var + Piece: PPieceHeader; + Size: cardinal; +begin + if FNeedRollback and (Rollback = nil) then + SaveToRollback; + + if NewSize = 0 then + Clear + else begin + Size := 0; + Piece := FirstPiece; + while IntPtr(Piece) <> nil do begin + if Size + Piece.Used > NewSize then + Piece.Used := NewSize - Size; + Inc(Size, Piece.Used); + Piece := Piece.Next; + end; + end; + + FModified := True; +end; + +procedure TBlob.Compress; +var + Piece: PPieceHeader; + NextPiece: PPieceHeader; +begin + Piece := FirstPiece; + while IntPtr(Piece) <> nil do begin + NextPiece := Piece.Next; + CompressPiece(Piece); + Piece := NextPiece; + end; +end; + +procedure TBlob.Defrag; // Move all data to first piece +var + pc: IntPtr; + Piece: PPieceHeader; + NextPiece: PPieceHeader; +begin + if IntPtr(FirstPiece) = nil then + Exit; // Is empty + + ReallocPiece(FFirstPiece, GetDataSize); + pc := IntPtr(Integer(FFirstPiece) + sizeof(TPieceHeader) + Integer(FFirstPiece.Used)); + + Piece := FFirstPiece.Next; + while IntPtr(Piece) <> nil do begin + CopyBuffer(IntPtr(Integer(Piece) + sizeof(TPieceHeader)), pc, Piece.Used); + pc := IntPtr(Integer(pc) + Integer(Piece.Used)); + FFirstPiece.Used := FFirstPiece.Used + Piece.Used; + + NextPiece := Piece.Next; + FreePiece(Piece); + Piece := NextPiece; + end; +end; + +{ Stream/File } + +procedure TBlob.LoadFromStream(Stream: TStream); +var + Piece: PPieceHeader; + Remainder: cardinal; + BufLen: cardinal; +{$IFDEF CLR} + Buffer: TBytes; +{$ENDIF} +begin + Clear; + + Stream.Seek(0, soFromBeginning); + + Remainder := Stream.Size; + while Remainder > 0 do begin + if Remainder > PieceSize then + BufLen := PieceSize + else + BufLen := Remainder; + + AllocPiece(Piece, BufLen); + {$IFDEF CLR} + SetLength(Buffer, BufLen); + Stream.Read(Buffer{$IFNDEF CLR}[0]{$ENDIF}, BufLen); + Marshal.Copy(Buffer, 0, IntPtr(Integer(Piece) + Sizeof(TPieceHeader)), BufLen); + {$ELSE} + Stream.Read(IntPtr(Integer(Piece) + Sizeof(TPieceHeader))^, BufLen); + {$ENDIF} + Piece.Used := BufLen; + AppendPiece(Piece); + + Dec(Remainder, BufLen); + end; + + FModified := True; +end; + +procedure TBlob.SaveToStream(Stream: TStream); +var + Piece: PPieceHeader; + BufLen: cardinal; +{$IFDEF CLR} + Buffer: TBytes; +{$ENDIF} +begin + Stream.Size := 0; + + Piece := FirstPiece; + + while IntPtr(Piece) <> nil do begin + BufLen := Piece.Used; + + {$IFDEF CLR} + SetLength(Buffer, BufLen); + Marshal.Copy(IntPtr(Integer(Piece) + Sizeof(TPieceHeader)), Buffer, 0, BufLen); + Stream.Write(Buffer{$IFNDEF CLR}[0]{$ENDIF}, BufLen); + {$ELSE} + Stream.Write(IntPtr(Integer(Piece) + Sizeof(TPieceHeader))^, BufLen); + {$ENDIF} + + Piece := Piece.Next; + end; +end; + +procedure TBlob.LoadFromFile(const FileName: string); +var + Stream:TStream; +begin + Stream := TFileStream.Create(FileName, fmOpenRead); + try + LoadFromStream(Stream); + finally + Stream.Free; + end; +end; + +procedure TBlob.SaveToFile(const FileName: string); +var + Stream:TStream; +begin + Stream := TFileStream.Create(FileName, fmCreate); + try + SaveToStream(Stream); + finally + Stream.Free; + end; +end; + +procedure TBlob.Assign(Source: TBlob); +const + BufSize = 65536; +var + Buf: IntPtr; + Pos: cardinal; + Size: cardinal; +begin + Clear; + + Pos := 0; + Buf := Marshal.AllocHGlobal(BufSize); + try + repeat + Size := Source.Read(Pos, BufSize, Buf); + if Size > 0 then begin + Write(Pos, Size, Buf); + Inc(Pos, Size); + end; + until Size = 0; + finally + Marshal.FreeHGlobal(Buf); + end; +end; + +{ Cached } + +procedure TBlob.CheckCached; +begin + if not FNeedRollback then + raise Exception.Create(SBlobMustBeCached); +end; + +procedure TBlob.SaveToRollback; +var + Piece: PPieceHeader; + CSize: Longint; +begin + CheckCached; + + Rollback := TBlob.Create; + Rollback.FIsUnicode := FIsUnicode; + Rollback.FModified := FModified; + + if IntPtr(FFirstPiece) <> nil then begin + // make copy of data + CSize := Size; + AllocPiece(Piece, CSize); + Piece.used := CSize; + Read(0, CSize, IntPtr(Integer(Piece) + sizeof(TPieceHeader))); + + Rollback.FFirstPiece := FFirstPiece; + FFirstPiece := nil; + AppendPiece(Piece); + end; +end; + +procedure TBlob.EnableRollback; +begin + {if FNeedRollback then + raise Exception.Create(SCachedAlreadyEnabled);} + + FNeedRollback := True; +end; + +procedure TBlob.Commit; +begin + //CheckCached; + + if Rollback <> nil then begin + Rollback.Free; + Rollback := nil; + end; +end; + +procedure TBlob.Cancel; +var + Piece: PPieceHeader; +begin + //CheckCached; + + if Rollback <> nil then begin + Piece := Rollback.FFirstPiece; + Rollback.FFirstPiece := FFirstPiece; + FFirstPiece := Piece; + FModified := Rollback.FModified; + + Rollback.Free; + Rollback := nil; + end; +end; + +function TBlob.CanRollback: boolean; +begin + Result := Rollback <> nil; +end; + +function TBlob.GetDataSize: cardinal; // sum of pieces.used +var + Piece: PPieceHeader; +begin + Result := 0; + Piece := FFirstPiece; + while IntPtr(Piece) <> nil do begin + Inc(Result, Piece.Used); + Piece := Piece.Next; + end; +end; + +function TBlob.GetSize: cardinal; +begin + Result := GetDataSize; +end; + +procedure TBlob.SetSize(Value: cardinal); +var + Piece: PPieceHeader; + OldSize: cardinal; +begin + OldSize := Size; + if OldSize > Value then + Truncate(Value) + else + if OldSize < Value then begin + AllocPiece(Piece, Value - OldSize); + Piece.Used := Value - OldSize; + FillChar(IntPtr(Integer(Piece) + Sizeof(TPieceHeader)), Value - OldSize, 0); + AppendPiece(Piece); + end; +end; + +procedure TBlob.SetIsUnicode(Value: boolean); +begin + if Value = IsUnicode then + Exit; + + if Size > 0 then + DataError(SCannotChangeIsUnicode); + + FIsUnicode := Value; +end; + +procedure TBlob.InternalClear; +var + Piece: PPieceHeader; +begin + while IntPtr(FFirstPiece) <> nil do begin + Piece := FFirstPiece; + FFirstPiece := FFirstPiece.Next; + Marshal.FreeHGlobal(Piece); + end; +end; + +function TBlob.TranslatePosition(Position: integer): integer; // Ansi to Unicode +var + Piece: PPieceHeader; + CurPosAnsi, CurPosUni, i: integer; + p: IntPtr; + w: WideString; + s: string; +begin + Assert(FIsUnicode); + + if {$IFNDEF CLR}not SysLocale.FarEast{$ELSE}(LeadBytes = []){$ENDIF} or (Position = 0) then begin + Result := Position * 2; + Exit; + end; + + CurPosAnsi := 0; + CurPosUni := 0; + Piece := FFirstPiece; + while IntPtr(Piece) <> nil do begin + p := IntPtr(Integer(Piece) + Sizeof(TPieceHeader)); + for i := 0 to Cardinal((Piece.Used div 2) - 1) do begin + w := Marshal.PtrToStringUni(IntPtr(Integer(p) + i * 2), 1); + s := w; + Inc(CurPosUni, 2); + Inc(CurPosAnsi, Length(s)); + if CurPosAnsi = Position then begin + Result := CurPosUni; + Exit; + end; + if CurPosAnsi > Position then + raise Exception.Create(SInvalidBlobPosition); + end; + Piece := Piece.Next; + end; + raise Exception.Create(SInvalidBlobPosition); +end; + +function TBlob.GetSizeAnsi: integer; +var + Piece: PPieceHeader; + i: integer; + p: IntPtr; + w: WideString; + s: string; +begin + Assert(FIsUnicode); + + if {$IFNDEF CLR}not SysLocale.FarEast{$ELSE}(LeadBytes = []){$ENDIF} then begin + Result := Cardinal(Size div 2); + Exit; + end; + + Result := 0; + Piece := FFirstPiece; + while IntPtr(Piece) <> nil do begin + p := IntPtr(Integer(Piece) + Sizeof(TPieceHeader)); + for i := 0 to Cardinal((Piece.Used div 2) - 1) do begin + w := Marshal.PtrToStringUni(IntPtr(Integer(p) + i * 2), 1); + s := w; + Inc(Result, Length(s)); + end; + Piece := Piece.Next; + end; +end; + +function TBlob.GetAsString: string; +var + Buffer: TBytes; + Handle: IntPtr; +begin + SetLength(Buffer, Size); + Handle := AllocGCHandle(Buffer, True); + try + Read(0, 0, GetAddrOfPinnedObject(Handle)); + finally + FreeGCHandle(Handle); + end; + if FIsUnicode then + Result := Encoding.Unicode.GetString(Buffer, 0, Size) + else + Result := Encoding.Default.GetString(Buffer, 0, Size); +end; + +procedure TBlob.SetAsString(Value: string); +var + Ws: WideString; + Buffer: IntPtr; + Size: cardinal; +begin + Clear; + if FIsUnicode then begin + Ws := Value; + Buffer := Marshal.StringToHGlobalUni(Ws); + Size := (Length(Value) shl 1); + end + else begin + Buffer := Marshal.StringToHGlobalAnsi(Value); + Size := Length(Value); + end; + try + Write(0, Size, Buffer); + finally + Marshal.FreeCoTaskMem(Buffer); + end; +end; + +function TBlob.GetAsWideString: WideString; +var + Buffer: TBytes; + Handle: IntPtr; + CachedSize: integer; // performance optimization +begin + CachedSize := Size; + SetLength(Buffer, CachedSize); + Handle := AllocGCHandle(Buffer, True); + try + Read(0, 0, GetAddrOfPinnedObject(Handle)); + finally + FreeGCHandle(Handle); + end; + if FIsUnicode then begin + Assert(CachedSize mod 2 = 0); // WideString must have even Size + Result := Encoding.Unicode.{$IFDEF CLR}GetString{$ELSE}GetWideString{$ENDIF}(Buffer); + end + else + Result := Encoding.Default.GetString(Buffer); +end; + +procedure TBlob.SetAsWideString(Value: WideString); +{$IFDEF WIN32} +var + s: string; +{$ENDIF} +begin +{$IFDEF CLR} + SetAsString(Value); +{$ENDIF} +{$IFDEF WIN32} + Clear; + if not FIsUnicode then begin + s := Value; + Write(0, Length(s), PChar(s)); + end + else + Write(0, Length(Value) shl 1, PWideChar(Value)); +{$ENDIF} +end; + +procedure TBlob.AddCR; +begin + if FIsUnicode then + AddCRUnicode + else + AddCRString; + + FModified := True; +end; + +procedure TBlob.RemoveCR; +begin + if FIsUnicode then + RemoveCRUnicode + else + RemoveCRString; + + FModified := True; +end; + +procedure TBlob.AddCRString; +var + SourcePiece: PPieceHeader; + DestPiece: PPieceHeader; + LastPiece: PPieceHeader; + FirstPiece: PPieceHeader; + TempPiece: PPieceHeader; + + Source: IntPtr; + SourceStart: IntPtr; + Dest: IntPtr; + DestEnd: IntPtr; + SourceEnd: IntPtr; + + Shift: cardinal; + Used: cardinal; + w: word; + b: byte; + c: byte; + + procedure AllocDestPiece; + var + AUsed, AUsed2: cardinal; + begin + AUsed := Used + Cardinal(Integer(SourceStart)) - Cardinal(Integer(Source)); + if Dest <> nil then + DestPiece.Used := Cardinal(DestPiece.Size) - 1 + Cardinal(Integer(Dest))- Cardinal(Integer(DestEnd)); + if AUsed < PieceSize div 2 then begin + AUsed2 := AUsed * 2; //temporary for Update 7.1 + AllocPiece(DestPiece, AUsed2) + end + else + AllocPiece(DestPiece, PieceSize); + Dest := IntPtr(Integer(DestPiece) + SizeOf(TPieceHeader)); + DestEnd := IntPtr(Integer(Dest) + Integer(DestPiece.Size) - 1); + DestPiece.Blob := Self.GetHashCode; + DestPiece.Prev := LastPiece; + if IntPtr(LastPiece) <> nil then + LastPiece.Next := DestPiece; + LastPiece := DestPiece; + if IntPtr(FirstPiece) = nil then + FirstPiece := DestPiece; + end; + +begin + CheckValid; // DEBUG + + CheckValue; + + if (IntPtr(FFirstPiece) = nil) then + Exit; + + SourcePiece := FFirstPiece; + FirstPiece := nil; + LastPiece := nil; + DestPiece := nil; + Dest := nil; + DestEnd := nil; + Shift := 0; + Used := Size; + + while (IntPtr(SourcePiece) <> nil) do begin + if SourcePiece.Used > Shift then begin + SourceStart := IntPtr(Integer(SourcePiece) + SizeOf(TPieceHeader) + Integer(Shift)); + Source := SourceStart; + SourceEnd := IntPtr(Integer(Source) + Integer(SourcePiece.Used) - 1 - Integer(Shift)); + + while Integer(Source) < Integer(SourceEnd) do begin + if Integer(Dest) >= Integer(DestEnd) then + AllocDestPiece; + w := Marshal.ReadInt16(Source); + if w = CRLF then begin + Marshal.WriteInt16(Dest, w); + Source := IntPtr(Integer(Source) + 2); + Dest := IntPtr(Integer(Dest) + 2); + end + else begin + b := Byte(w); + if b = LF then begin + Marshal.WriteInt16(Dest, CRLF); + Source := IntPtr(Integer(Source) + 1); + Dest := IntPtr(Integer(Dest) + 2); + end + else begin + Marshal.WriteByte(Dest, b); + Source := IntPtr(Integer(Source) + 1); + Dest := IntPtr(Integer(Dest) + 1); + end; + end; + end; + + if Source = SourceEnd then begin + c := Marshal.ReadByte(Source); + if Integer(Dest) >= Integer(DestEnd) then + AllocDestPiece; + Shift := Ord( + ((c = 13) + and + (((IntPtr(SourcePiece.Next) <> nil) + and + ( + Marshal.ReadByte( + IntPtr(Integer(IntPtr(SourcePiece.Next)) + SizeOf(TPieceHeader)) + ) = 10 + )) + or + (IntPtr(SourcePiece.Next) = nil))) + or + (c = 10) + ); + if (Shift = 1) then begin + Marshal.WriteInt16(Dest, CRLF); + Dest := IntPtr(Integer(Dest) + 2); + end + else begin + Marshal.WriteByte(Dest, c); + Dest := IntPtr(Integer(Dest) + 1); + end; + end else + Shift := 0; + end; + Dec(Used, SourcePiece.Used); + TempPiece := SourcePiece; + SourcePiece := SourcePiece.Next; + Marshal.FreeHGlobal(TempPiece); + end; + if Dest <> nil then + DestPiece.Used := DestPiece.Size - 1 + Cardinal(Integer(Dest)) - Cardinal(Integer(DestEnd)); + FFirstPiece := FirstPiece; +end; + +procedure TBlob.RemoveCRString; +var + SourcePiece: PPieceHeader; + DestPiece: PPieceHeader; + LastPiece: PPieceHeader; + FirstPiece: PPieceHeader; + TempPiece: PPieceHeader; + + SourceStart: IntPtr; + Source: IntPtr; + Dest: IntPtr; + DestEnd: IntPtr; + SourceEnd: IntPtr; + + Shift: cardinal; + Used: cardinal; + w: word; + c: byte; + + procedure AllocDestPiece; + var + AUsed: cardinal; + begin + AUsed := Used + Cardinal(Integer(SourceStart)) - Cardinal(Integer(Source)); + if Dest <> nil then + DestPiece.Used := DestPiece.Size + Cardinal(Integer(Dest)) - Cardinal(Integer(DestEnd)); + if AUsed < PieceSize then + AllocPiece(DestPiece, AUsed) + else + AllocPiece(DestPiece, PieceSize); + Dest := IntPtr(Integer(IntPtr(DestPiece)) + SizeOf(TPieceHeader)); + DestEnd := IntPtr(Integer(Dest) + Integer(DestPiece.Size)); + DestPiece.Blob := Self.GetHashCode; + DestPiece.Prev := LastPiece; + if IntPtr(LastPiece) <> nil then + LastPiece.Next := DestPiece; + LastPiece := DestPiece; + if IntPtr(FirstPiece) = nil then + FirstPiece := DestPiece; + end; + +begin + CheckValid; // DEBUG + + CheckValue; + + if (IntPtr(FFirstPiece) = nil) then + Exit; + + SourcePiece := FFirstPiece; + FirstPiece := nil; + LastPiece := nil; + DestPiece := nil; + Dest := nil; + DestEnd := nil; + Shift := 0; + Used := Size; + + while (IntPtr(SourcePiece) <> nil) do begin + if SourcePiece.Used > Shift then begin + SourceStart := IntPtr(Integer(SourcePiece) + SizeOf(TPieceHeader) + Integer(Shift)); + Source := SourceStart; + SourceEnd := IntPtr(Integer(Source) + Integer(SourcePiece.Used) - 1 - Integer(Shift)); + + while Integer(Source) < Integer(SourceEnd) do begin + if Integer(Dest) >= Integer(DestEnd) then + AllocDestPiece; + w := Marshal.ReadInt16(Source); + if w = CRLF then begin + Marshal.WriteByte(Dest, LF); + Source := IntPtr(Integer(Source) + 2); + Dest := IntPtr(Integer(Dest) + 1); + end + else + begin + Marshal.WriteByte(Dest, Byte(w)); + Source := IntPtr(Integer(Source) + 1); + Dest := IntPtr(Integer(Dest) + 1); + end; + end; + + if Source = SourceEnd then begin + c := Marshal.ReadByte(Source); + if Integer(Dest) >= Integer(DestEnd) then + AllocDestPiece; + Shift := Ord((c = 13) and (IntPtr(SourcePiece.Next) <> nil) + and + ( + Marshal.ReadByte( + IntPtr(Integer(IntPtr(SourcePiece.Next)) + SizeOf(TPieceHeader)) + ) = 10) + ); + if Shift = 1 then + c := 10; + Marshal.WriteByte(Dest, c); + Dest := IntPtr(Integer(Dest) + 1); + end else + Shift := 0; + end; + Dec(Used, SourcePiece.Used); + TempPiece := SourcePiece; + SourcePiece := SourcePiece.Next; + Marshal.FreeHGlobal(TempPiece); + end; + if Dest <> nil then + DestPiece.Used := DestPiece.Size + Cardinal(Integer(Dest)) - Cardinal(Integer(DestEnd)); + FFirstPiece := FirstPiece; +end; + +procedure TBlob.AddCRUnicode; +var + SourcePiece: PPieceHeader; + DestPiece: PPieceHeader; + LastPiece: PPieceHeader; + FirstPiece: PPieceHeader; + TempPiece: PPieceHeader; + + Source: IntPtr; + SourceStart: IntPtr; + Dest: IntPtr; + DestEnd: IntPtr; + SourceEnd: IntPtr; + + Shift: cardinal; //bytes + Used: cardinal; //bytes + w: LongWord; + b: Word; + c: Word; + procedure AllocDestPiece; + var + AUsed, AUsed2: cardinal; + begin + AUsed := Used + Cardinal(Integer(SourceStart)) - Cardinal(Integer(Source)); + if Dest <> nil then + DestPiece.Used := DestPiece.Size - sizeof(WideChar) + Cardinal(Integer(Dest)) - Cardinal(Integer(DestEnd)); + if AUsed < PieceSize div 2 then begin + AUsed2 := AUsed * 2; //temporary for Update 7.1 + AllocPiece(DestPiece, AUsed2) + end + else + AllocPiece(DestPiece, PieceSize); + Dest := IntPtr(Integer(DestPiece) + SizeOf(TPieceHeader)); + DestEnd := IntPtr(Integer(Dest) + Integer(DestPiece.Size) - sizeof(WideChar)); + DestPiece.Blob := Self.GetHashCode; + DestPiece.Prev := LastPiece; + if IntPtr(LastPiece) <> nil then + LastPiece.Next := DestPiece; + LastPiece := DestPiece; + if IntPtr(FirstPiece) = nil then + FirstPiece := DestPiece; + end; + +begin + CheckValid; // DEBUG + + CheckValue; + + if (IntPtr(FFirstPiece) = nil) then + Exit; + + SourcePiece := FFirstPiece; + FirstPiece := nil; + LastPiece := nil; + DestPiece := nil; + Dest := nil; + DestEnd := nil; + Shift := 0; + Used := Size; + + while (IntPtr(SourcePiece) <> nil) do begin + if SourcePiece.Used > Shift then begin + SourceStart := IntPtr(Integer(SourcePiece) + SizeOf(TPieceHeader) + Integer(Shift)); + Source := SourceStart; + SourceEnd := IntPtr(Integer(Source) + Integer(SourcePiece.Used) - sizeof(WideChar) - Integer(Shift)); + + while Integer(Source) < Integer(SourceEnd) do begin + if Integer(Dest) >= Integer(DestEnd) then + AllocDestPiece; + w := Marshal.ReadInt32(Source); + if w = CRLF_UTF16 then begin + Marshal.WriteInt32(Dest, w); + Source := IntPtr(Integer(Source) + 4); + Dest := IntPtr(Integer(Dest) + 4); + end + else begin + b := Word(w); + if b = LF_UTF16 then begin + Marshal.WriteInt32(Dest, CRLF_UTF16); + Source := IntPtr(Integer(Source) + 2); + Dest := IntPtr(Integer(Dest) + 4); + end + else begin + Marshal.WriteInt16(Dest, b); + Source := IntPtr(Integer(Source) + 2); + Dest := IntPtr(Integer(Dest) + 2); + end; + end; + end; + + if Source = SourceEnd then begin + c := Marshal.ReadInt16(Source); + if Integer(Dest) >= Integer(DestEnd) then + AllocDestPiece; + Shift := Ord( + (c = 13) and (IntPtr(SourcePiece.Next) <> nil) and + ( + Marshal.ReadInt16(IntPtr(Integer(IntPtr(SourcePiece.Next)) + SizeOf(TPieceHeader))) = 10 + ) + ) * sizeof(WideChar); + if Shift = sizeof(WideChar) then begin + Marshal.WriteInt32(Dest, CRLF_UTF16); + Dest := IntPtr(Integer(Dest) + 4); + end + else begin + Marshal.WriteInt16(Dest, c); + Dest := IntPtr(Integer(Dest) + 2); + end; + end else + Shift := 0; + end; + Dec(Used, SourcePiece.Used); + TempPiece := SourcePiece; + SourcePiece := SourcePiece.Next; + Marshal.FreeHGlobal(TempPiece); + end; + if Dest <> nil then + DestPiece.Used := DestPiece.Size - sizeof(WideChar) + Cardinal(Integer(Dest)) - Cardinal(Integer(DestEnd)); + FFirstPiece := FirstPiece; +end; + +procedure TBlob.RemoveCRUnicode; +var + SourcePiece: PPieceHeader; + DestPiece: PPieceHeader; + LastPiece: PPieceHeader; + FirstPiece: PPieceHeader; + TempPiece: PPieceHeader; + + SourceStart: IntPtr; + Source: IntPtr; + Dest: IntPtr; + DestEnd: IntPtr; + SourceEnd: IntPtr; + + Shift: cardinal; //bytes + Used: cardinal; //bytes + w: LongWord; + c: word; + + procedure AllocDestPiece; + var + AUsed: cardinal; + begin + AUsed := Used + Cardinal(Integer(SourceStart)) - Cardinal(Integer(Source)); + if Dest <> nil then + DestPiece.Used := DestPiece.Size + Cardinal(Integer(Dest)) - Cardinal(Integer(DestEnd)); + if AUsed < PieceSize then + AllocPiece(DestPiece, AUsed) + else + AllocPiece(DestPiece, PieceSize); + Dest := IntPtr(Integer(DestPiece) + SizeOf(TPieceHeader)); + DestEnd := IntPtr(Integer(Dest) + Integer(DestPiece.Size)); + DestPiece.Blob := Self.GetHashCode; + DestPiece.Prev := LastPiece; + if IntPtr(LastPiece) <> nil then + LastPiece.Next := DestPiece; + LastPiece := DestPiece; + if IntPtr(FirstPiece) = nil then + FirstPiece := DestPiece; + end; + +begin + CheckValid; // DEBUG + + CheckValue; + + if (IntPtr(FFirstPiece) = nil) then + Exit; + + SourcePiece := FFirstPiece; + FirstPiece := nil; + LastPiece := nil; + DestPiece := nil; + Dest := nil; + DestEnd := nil; + Shift := 0; + Used := Size; + + while (IntPtr(SourcePiece) <> nil) do begin + if SourcePiece.Used > Shift then begin + SourceStart := IntPtr(Integer(SourcePiece) + SizeOf(TPieceHeader) + Integer(Shift)); + Source := SourceStart; + SourceEnd := IntPtr(Integer(Source) + Integer(SourcePiece.Used) - sizeof(WideChar) - Integer(Shift)); + + while Integer(Source) < Integer(SourceEnd) do begin + if Integer(Dest) >= Integer(DestEnd) then + AllocDestPiece; + w := marshal.ReadInt32(Source); + if w = CRLF_UTF16 then begin + Marshal.WriteInt16(Dest, LF_UTF16); + Source := IntPtr(Integer(Source) + 4); + Dest := IntPtr(Integer(Dest) + 2); + end + else + begin + Marshal.WriteInt16(Dest, Word(w)); + Source := IntPtr(Integer(Source) + 2); + Dest := IntPtr(Integer(Dest) + 2); + end; + end; + + if Source = SourceEnd then begin + c := Marshal.ReadInt16(Source); + if Integer(Dest) >= Integer(DestEnd) then + AllocDestPiece; + Shift := Ord( + (c = 13) and (IntPtr(SourcePiece.Next) <> nil) and + ( + Marshal.ReadInt16(IntPtr(Integer(IntPtr(SourcePiece.Next)) + SizeOf(TPieceHeader))) = 10 + ) + ) * sizeof(WideChar); + if Shift = sizeof(WideChar) then + c := 10; + Marshal.WriteInt16(Dest, c); + Dest := IntPtr(Integer(Dest) + 2); + end else + Shift := 0; + end; + Dec(Used, SourcePiece.Used); + TempPiece := SourcePiece; + SourcePiece := SourcePiece.Next; + Marshal.FreeHGlobal(TempPiece); + end; + if Dest <> nil then + DestPiece.Used := DestPiece.Size + Cardinal(Integer(Dest)) - Cardinal(Integer(DestEnd)); + FFirstPiece := FirstPiece; +end; + +{ TBlobUtils } + +class procedure TBlobUtils.SetModified(Blob: TBlob; Value: boolean); +begin + Blob.FModified := Value; +end; + +{$IFDEF HAVE_COMPRESS} + +{ TCompressedBlob } + +function TCompressedBlob.CompressFrom(source: IntPtr; const sourceLen: longint): boolean; +var + CPiece: PPieceHeader; + CSize: integer; +begin + // see my_compress_alloc + // *complen= *len * 120 / 100 + 12; + CheckZLib; + CSize := CCompressBlobHeaderSize{header} + sourceLen + (sourceLen div 5) + 12; + AllocPiece(CPiece, CSize); + try + DoCompress(Pointer(Integer(CPiece) + sizeof(TPieceHeader) + CCompressBlobHeaderSize), @CSize, source, sourceLen); + CPiece.Used := CCompressBlobHeaderSize + CSize; + Result := LongInt(CPiece.Used) < sourceLen; // Compression is successful + except + Result := False; + end; + if not Result then begin + FreePiece(CPiece); + Exit; + end; + + // WriteHeader + CopyBuffer(@CCompressBlobHeaderGuid[0], PByte(Integer(CPiece) + sizeof(TPieceHeader)), CCompressBlobHeaderGuidSize); + Marshal.WriteInt32(CPiece, sizeof(TPieceHeader) + CCompressBlobHeaderSize - SizeOf(Integer), sourceLen); + + CompressPiece(CPiece); + if FFirstPiece <> nil then + FreePiece(FFirstPiece); + AppendPiece(CPiece); + + FModified := True; +end; + +procedure TCompressedBlob.UncompressTo(dest: IntPtr; var destlen: integer); +var + source: IntPtr; +begin + Assert(FFirstPiece <> nil); + + Defrag; + source := PByte(Integer(FFirstPiece) + sizeof(TPieceHeader)); + + Assert(FFirstPiece.Next = nil); + + // Check header + if FFirstPiece.Used <= CCompressBlobHeaderSize then + DataError(SInvalidComprBlobSize); + if not CompareMem(source, @CCompressBlobHeaderGuid[0], CCompressBlobHeaderGuidSize) then + DataError(SInvalidComprBlobHeader); + + CheckZLib; + try + DoUncompress(dest, @destlen, IntPtr(Integer(source) + CCompressBlobHeaderSize), FFirstPiece.Used - CCompressBlobHeaderSize); + except + DataError(SInvalidComprBlobData); + end; +end; + +function TCompressedBlob.GetSize: cardinal; +begin + if Compressed then begin + Result := UnCompressedSize; + Assert(Result > 0); + end + else + Result := inherited GetSize; +end; + +procedure TCompressedBlob.SetSize(Value: cardinal); +begin + if Compressed then + Assert((Value = 0) or (Value = Size)); + + inherited; +end; + +function TCompressedBlob.GetCompressedSize: cardinal; +begin + if not Compressed then + DataError(sBlobNotCompressed); + Result := inherited GetSize; +end; + +function TCompressedBlob.GetCompressed: boolean; +begin + Result := + (FFirstPiece <> nil) and + // (FFirstPiece.Next = nil) and - false, if blob copied from another blob + (FFirstPiece.Used > CCompressBlobHeaderSize) and + CompareMem(IntPtr(Integer(FFirstPiece) + sizeof(TPieceHeader)), @CCompressBlobHeaderGuid[0], CCompressBlobHeaderGuidSize); +end; + +procedure TCompressedBlob.SetCompressed(Value: boolean); +var + CPiece: PPieceHeader; + Count, CSize: integer; +begin + if (IntPtr(FFirstPiece) = nil) or (Compressed = Value) then + Exit; + + if Value then begin + { pack + (b) small blob without compression (Size < MIN_COMPRESS_LENGTH). + (c) big blobs without compression (ZIP, JPG etc). + (d) big blobs with compression (TXT etc). + } + Count := Size; + // (b) + if Count <= MIN_COMPRESS_LENGTH then + Exit; + + Defrag; + CompressFrom(PByte(Integer(FFirstPiece) + sizeof(TPieceHeader)), Count); + end + else + begin + // unpack + CheckValid; // DEBUG + CheckValue; + + Assert(FFirstPiece <> nil, 'FFirstPiece = nil'); + + CSize := UnCompressedSize; + AllocPiece(CPiece, CSize); + try + UncompressTo(IntPtr(Integer(CPiece) + sizeof(TPieceHeader)), CSize); + CPiece.Used := CSize; + if CPiece.Used <> CPiece.Size then + DataError(SInvalidUnComprBlobSize); //DatabaseError(SInvalidUnComprBlobSize); + except + FreePiece(CPiece); + raise; + end; + + FreePiece(FFirstPiece); + AppendPiece(CPiece); + end; + + FModified := True; +end; + +function TCompressedBlob.UnCompressedSize: cardinal; +begin + Assert(Compressed); + Result := Marshal.ReadInt32(FFirstPiece, sizeof(TPieceHeader) + CCompressBlobHeaderSize - SizeOf(Integer)); +end; + +procedure TCompressedBlob.Truncate(NewSize: cardinal); +begin + if Compressed and (NewSize <> 0) then + Compressed := False; + inherited; +end; + +function TCompressedBlob.Read(Position, Count: cardinal; + Dest: IntPtr): cardinal; +var + CSize: Longint; + ReadAll: boolean; +begin + // partial read or read all blob? + ReadAll := (Position = 0) and ((Count = Size) or (Count = 0)); + if Compressed and not ReadAll then + Compressed := False; + + if Compressed then begin + Assert(ReadAll); + + // Copied from inherited + CheckValid; // DEBUG + CheckValue; + Result := 0; + + if (IntPtr(FFirstPiece) = nil) or (Position > Size) then + Exit; + + if Count = 0 then + Count := Size; + //----------- + + CSize := Count; + UncompressTo(Dest, CSize); + Assert(Cardinal(CSize) = Count); + Result := CSize; + end + else + Result := inherited Read(Position, Count, Dest); +end; + +procedure TCompressedBlob.Write(Position, Count: cardinal; Source: IntPtr); +begin + if Compressed then begin + if (Position <> 0) or ((Count <> Size) and (Size <> 0)) {full rewrite} then begin + Compressed := False; + inherited; + Exit; + end; + Clear; + + { pack + (b) small blob without compression (Size < MIN_COMPRESS_LENGTH). + (c) big blobs without compression (ZIP, JPG etc). + (d) big blobs with compression (TXT etc). + } + + // (b) + if (Count <= MIN_COMPRESS_LENGTH) or not CompressFrom(Source, Count) then + inherited; + end + else + inherited; +end; + +procedure TCompressedBlob.SaveToRollback; +var + Piece: PPieceHeader; + CSize: Longint; +begin + CheckCached; + + Rollback := TCompressedBlob.Create; + Rollback.IsUnicode := IsUnicode; + Rollback.FModified := FModified; + + CSize := Size; + if (IntPtr(FFirstPiece) <> nil) and (CSize <> 0) then begin + // make copy of data + AllocPiece(Piece, CSize); + Piece.used := CSize; + Read(0, CSize, IntPtr(Integer(Piece) + sizeof(TPieceHeader))); + + TCompressedBlob(Rollback).FFirstPiece := FFirstPiece; + FFirstPiece := nil; + AppendPiece(Piece); + end; +end; +{$ENDIF} + +{$IFDEF VER6} +{$IFDEF MSWINDOWS} +function LCIDToCodePage(ALcid: LongWord): Integer; +const + CP_ACP = 0; // system default code page + LOCALE_IDEFAULTANSICODEPAGE = $00001004; // default ansi code page +var + ResultCode: Integer; + Buffer: array [0..6] of Char; +begin + GetLocaleInfo(ALcid, LOCALE_IDEFAULTANSICODEPAGE, Buffer, SizeOf(Buffer)); + Val(Buffer, Result, ResultCode); + if ResultCode <> 0 then + Result := CP_ACP; +end; +{$ENDIF} +{$ENDIF} + +initialization + StartWaitProc := nil; + StopWaitProc := nil; + ApplicationTitleProc := nil; +{$IFNDEF VER6P} + ApplicationHandleException := nil; +{$ENDIF} + +{$IFDEF VER6} +{$IFDEF MSWINDOWS} + // Code from Delphi7 system.pas + // High bit is set for Win95/98/ME + if not IsWin9x then + begin + if {Lo(GetVersion) > 4} Win32MajorVersion > 4 then + DefaultUserCodePage := 3 // Use CP_THREAD_ACP with Win2K/XP + else + // Use thread's current locale with NT4 + DefaultUserCodePage := LCIDToCodePage(GetThreadLocale); + end + else + // Convert thread's current locale with Win95/98/ME + DefaultUserCodePage := LCIDToCodePage(GetThreadLocale); +{$ENDIF} +{$ENDIF} + + BoolSymbolLexems := TStringList.Create; + BoolKeywordLexems := TStringList.Create; + + BoolSymbolLexems.AddObject('=', TObject(Integer(lxEqual))); + BoolSymbolLexems.AddObject('>', TObject(Integer(lxMore))); + BoolSymbolLexems.AddObject('<', TObject(Integer(lxLess))); + BoolSymbolLexems.AddObject('>=', TObject(Integer(lxMoreEqual))); + BoolSymbolLexems.AddObject('<=', TObject(Integer(lxLessEqual))); + BoolSymbolLexems.AddObject('<>', TObject(Integer(lxNoEqual))); + BoolSymbolLexems.AddObject('(', TObject(Integer(lxLeftBracket))); + BoolSymbolLexems.AddObject(')', TObject(Integer(lxRightBracket))); + BoolSymbolLexems.AddObject('-', TObject(Integer(lxMinus))); + BoolSymbolLexems.AddObject('+', TObject(Integer(lxPlus))); + BoolSymbolLexems.AddObject('[', TObject(Integer(lxLeftSqBracket))); + BoolSymbolLexems.AddObject(']', TObject(Integer(lxRightSqBracket))); + BoolSymbolLexems.CustomSort(CRCmpStrings); + + BoolKeywordLexems.AddObject('AND', TObject(Integer(lxAND))); + BoolKeywordLexems.AddObject('FALSE', TObject(Integer(lxFALSE))); + BoolKeywordLexems.AddObject('IS', TObject(Integer(lxIS))); + BoolKeywordLexems.AddObject('NOT', TObject(Integer(lxNOT))); + BoolKeywordLexems.AddObject('NULL', TObject(Integer(lxNULL))); + BoolKeywordLexems.AddObject('OR', TObject(Integer(lxOR))); + BoolKeywordLexems.AddObject('TRUE', TObject(Integer(lxTRUE))); + BoolKeywordLexems.AddObject('LIKE', TObject(Integer(lxLIKE))); + BoolKeywordLexems.CustomSort(CRCmpStrings); + + RefreshIteration := 1; + +finalization + BoolSymbolLexems.Free; + BoolKeywordLexems.Free; + +{$IFDEF MSWINDOWS} + {$IFDEF CRDEBUG} if DataCnt <> 0 then MessageBox(0, PChar(IntToStr(DataCnt) + ' Data(s) hasn''t been released'), 'DA warning', MB_OK); {$ENDIF} + {$IFDEF CRDEBUG} if ShareObjectCnt <> 0 then MessageBox(0, PChar(IntToStr(ShareObjectCnt) + ' ShareObject(s) hasn''t been released'), 'DA warning', MB_OK); {$ENDIF} +{$ENDIF} +end. diff --git a/internal/4.10.0.10/1/Source/MemUtils.pas b/internal/4.10.0.10/1/Source/MemUtils.pas new file mode 100644 index 0000000..97be1f6 --- /dev/null +++ b/internal/4.10.0.10/1/Source/MemUtils.pas @@ -0,0 +1,1682 @@ + +////////////////////////////////////////////////// +// DB Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +// Mem Data +// Created: 06.11.03 +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I Dac.inc} + +unit MemUtils; +{$ENDIF} +interface +uses + Classes, SysUtils, {$IFDEF VER6P}Variants, {$ENDIF} +{$IFDEF HAVE_COMPRESS_INTERNAL} + ZLib, ZLibConst, +{$ENDIF} +{$IFDEF LINUX} +{$ELSE} + Windows, +{$ENDIF} +{$IFDEF CLR} + System.Xml, + System.Runtime.InteropServices; +{$ELSE} + CLRClasses; +{$ENDIF} + +{$IFNDEF VER6P} +const + varShortInt = $0010; { vt_i1 } + varWord = $0012; { vt_ui2 } + varLongWord = $0013; { vt_ui4 } + varInt64 = $0014; { vt_i8 } + +type + TVarType = Word; +{$ENDIF} + +{$IFDEF CLR} +const + wsAttribute: System.Xml.WriteState = System.Xml.WriteState.Attribute; + wsClosed: System.Xml.WriteState = System.Xml.WriteState.Closed; + wsContent: System.Xml.WriteState = System.Xml.WriteState.Content; + wsElement: System.Xml.WriteState = System.Xml.WriteState.Element; + wsStart: System.Xml.WriteState = System.Xml.WriteState.Start; + + fmtNone: System.Xml.Formatting = System.Xml.Formatting.None; + fmtIndented: System.Xml.Formatting = System.Xml.Formatting.Indented; + + ntNone: System.Xml.XmlNodeType = System.Xml.XmlNodeType.None; + ntElement: System.Xml.XmlNodeType = System.Xml.XmlNodeType.Element; + ntAttribute: System.Xml.XmlNodeType = System.Xml.XmlNodeType.Attribute; + ntEndElement: System.Xml.XmlNodeType = System.Xml.XmlNodeType.EndElement; + ntComment: System.Xml.XmlNodeType = System.Xml.XmlNodeType.Comment; + ntDeclaration: System.Xml.XmlNodeType = System.Xml.XmlNodeType.XmlDeclaration; + ntDocumentType: System.Xml.XmlNodeType = System.Xml.XmlNodeType.DocumentType; + ntText: System.Xml.XmlNodeType = System.Xml.XmlNodeType.Text; +{$ENDIF} + +type +{$IFNDEF CLR} + TValueArr = PChar; +{$ELSE} + TValueArr = TBytes; + + PChar = string; + PWideChar = string; + + POleVariant = IntPtr; + +const + { TStream seek origins compatibility aliases } + soFromBeginning = soBeginning; + soFromCurrent = soCurrent; + soFromEnd = soEnd; +{$ENDIF} + +{$IFNDEF VER7P} +const + MSecsPerSec = 1000; +{$ENDIF} + +{ CLR compatibility routines } +{$IFDEF CLR} + function CompareMem(P1, P2: IntPtr; Length: integer): boolean; +{$ENDIF} + function CompareGuid(const g1, g2: TGuid): boolean; + function TimeStampToDateTime(const ATimeStamp: TTimeStamp): TDateTime; + + function VarEqual(const Value1, Value2: variant): boolean; + procedure OleVarClear(pValue: POleVariant); + function GetOleVariant(pValue: POleVariant): OleVariant; + procedure SetOleVariant(pValue: POleVariant; const Value: OleVariant); + + procedure CopyBuffer(Source, Dest: IntPtr; Count: cardinal); + procedure CopyBufferAnsi(const Source: string; Dest: IntPtr; Count{Bytes (#0 included)}: cardinal); + procedure CopyBufferUni(const Source: WideString; Dest: IntPtr; Count{Bytes (#0 included)}: cardinal); + + procedure FillChar(X: IntPtr; Count: integer; Value: byte); + procedure FillStr(var S: string; Count: integer; Value: char); + procedure ArrayCopy(sourceArray: TBytes; sourceIndex: integer; destinationArray: TBytes; destinationIndex: integer; length: integer); + function AllocGCHandle(Obj: {$IFDEF CLR}TObject{$ELSE}pointer{$ENDIF}; Pinned: boolean = False): IntPtr; + function GetGCHandleTarget(Handle: IntPtr): TObject; + function GetAddrOfPinnedObject(Handle: IntPtr): IntPtr; + procedure FreeGCHandle(Handle: IntPtr); + + function AllocString(var S: string; Length: integer): IntPtr; + procedure FreeString(P: IntPtr); + function AllocOrdinal(var Obj: IntPtr): IntPtr; overload; + function AllocOrdinal(var Obj: shortint): IntPtr; overload; + function AllocOrdinal(var Obj: byte): IntPtr; overload; + function AllocOrdinal(var Obj: word): IntPtr; overload; + function AllocOrdinal(var Obj: integer): IntPtr; overload; + function AllocOrdinal(var Obj: cardinal): IntPtr; overload; + function OrdinalToPtr(var Obj: double): IntPtr; overload; + function OrdinalToPtr(var Obj: byte): IntPtr; overload; + function OrdinalToPtr(var Obj: smallint): IntPtr; overload; + function OrdinalToPtr(var Obj: integer): IntPtr; overload; + function OrdinalToPtr(var Obj: int64): IntPtr; overload; + function OrdinalToPtr(var Obj: cardinal): IntPtr; overload; + function OrdinalToPtr(var Obj: word): IntPtr; overload; + function OrdinalToPtr(var Obj: IntPtr): IntPtr; overload; + procedure PtrToOrdinal(P: IntPtr; var Obj: shortint); overload; + procedure PtrToOrdinal(P: IntPtr; var Obj: byte); overload; + procedure PtrToOrdinal(P: IntPtr; var Obj: smallint); overload; + procedure PtrToOrdinal(P: IntPtr; var Obj: word); overload; + procedure PtrToOrdinal(P: IntPtr; var Obj: integer); overload; + procedure PtrToOrdinal(P: IntPtr; var Obj: int64); overload; + procedure PtrToOrdinal(P: IntPtr; var Obj: cardinal); overload; + procedure PtrToOrdinal(P: IntPtr; var Obj: IntPtr); overload; + procedure FreeOrdinal(P: IntPtr); +{ PChar and PWideChar routines } +{$IFDEF CLR} + procedure StrCopy(Dest: IntPtr; const Source: IntPtr); + function StrComp(const Str1: IntPtr; const Str2: IntPtr): integer; + procedure StrLCopy(Dest: IntPtr; const Source: IntPtr; MaxLen{Chars}: Cardinal); + function StrLen(const Str: IntPtr): Cardinal; + + function AnsiUpperCase(const S: string): string; + function AnsiCompareText(const S1, S2: string): integer; + function AnsiCompareStr(const S1, S2: string): integer; + function AnsiSameText(const S1, S2: string): Boolean; +{$ELSE} + function AnsiStrCompS(S1, S2: PChar): Integer; // SORT_STRINGSORT + function AnsiStrICompS(S1, S2: PChar): Integer; // SORT_STRINGSORT +{$ENDIF} + function AnsiCompareTextS(const S1, S2: string): integer; // SORT_STRINGSORT + function AnsiCompareStrS(const S1, S2: string): integer; // SORT_STRINGSORT + function Utf8ToWs(const Dest: TValueArr; DestIdx: Cardinal; MaxDestBytes{w/wo #0}: Cardinal; + const Source: TValueArr; SourceIdx, SourceBytes: Cardinal; + const AddNull: boolean): Cardinal{bytes w/wo #0}; + + function StrCopyW(Dest: IntPtr; const Source: IntPtr): IntPtr; + procedure StrLCopyW(Dest: IntPtr; const Source: IntPtr; MaxLen{WideChars}: Cardinal); + function StrLenW(const Str: IntPtr): Cardinal; + procedure StrTrim(const Str: IntPtr; Len: integer = -1); + procedure StrTrimW(const Str: IntPtr; Len: integer = -1); + function AnsiStrLCompWS(const S1, S2: WideString; MaxLen: Cardinal): Integer; // SORT_STRINGSORT + function AnsiStrLICompWS(const S1, S2: WideString; MaxLen: Cardinal): Integer; // SORT_STRINGSORT + function AnsiStrCompWS(const S1, S2: WideString): Integer; // SORT_STRINGSORT + function AnsiStrICompWS(const S1, S2: WideString): Integer; // SORT_STRINGSORT + + function IsClass(Obj: TObject; AClass: TClass): boolean; + +type +{$IFDEF CLR} + TDAList = class(TObject) + FList: array of TObject; + FCount: Integer; + FCapacity: Integer; + protected + function Get(Index: Integer): TObject; + procedure Grow; virtual; + procedure Put(Index: Integer; Item: TObject); + procedure SetCapacity(NewCapacity: Integer); + + public + constructor Create; + destructor Destroy; override; + function Add(Item: TObject): Integer; + procedure Clear; virtual; + procedure Delete(Index: Integer); + function IndexOf(Item: TObject): Integer; + function Last: TObject; + function Remove(Item: TObject): Integer; + procedure Sort(Compare: TListSortCompare); + + property Capacity: Integer read FCapacity write SetCapacity; + property Count: Integer read FCount; + property Items[Index: Integer]: TObject read Get write Put; default; + + end; +{$ELSE} + TDAList = TList; +{$ENDIF} + +{$IFNDEF CLR} +function TryEncodeDate(Year, Month, Day: Word; var Date: TDateTime): Boolean; +function TryEncodeTime(Hour, Min, Sec, MSec: Word; var Time: TDateTime): Boolean; +function TryEncodeDateTime(const AYear, AMonth, ADay, AHour, AMinute, ASecond, + AMilliSecond: Word; out AValue: TDateTime): Boolean; +function EncodeDateTime(const AYear, AMonth, ADay, AHour, AMinute, ASecond, + AMilliSecond: Word): TDateTime; +{$ENDIF} + +{$IFNDEF VER6P} + function BoolToStr(const Value: boolean; UseBoolStrs: Boolean = False): string; + function TryStrToBool(const S: string; out Value: Boolean): Boolean; + function StrToBool(const S: string): Boolean; + procedure DecodeDateTime(const AValue: TDateTime; out AYear, AMonth, ADay, + AHour, AMinute, ASecond, AMilliSecond: Word); + function WideUpperCase(const S: WideString): WideString; + function VarToWideStr(const V: Variant): WideString; +{$ENDIF} + +{$IFDEF VER6} +function StrToBool(const S: string): Boolean; +function TryStrToBool(const S: string; out Value: Boolean): Boolean; +{$ENDIF} + + function Reverse4(Value: cardinal): cardinal; +{$IFNDEF CLR} + procedure Reverse8(pValue: IntPtr); +{$ENDIF} + +{$IFDEF VER8} +type + UTF8String = AnsiString deprecated; + +function UTF8Encode(const WS: WideString): UTF8String; deprecated; +function UTF8Decode(const S: UTF8String): WideString; deprecated; +{$ENDIF} + +{$IFDEF HAVE_COMPRESS} +const + MIN_COMPRESS_LENGTH = 50; // Don't compress small bl. + + procedure CheckZLib; + procedure DoCompress(dest: IntPtr; destLen: IntPtr; const source: IntPtr; sourceLen: longint); + procedure DoUncompress(dest: IntPtr; destlen: IntPtr; source: IntPtr; sourceLne: longint); + +type + TCompressProc = function(dest: IntPtr; destLen: IntPtr; const source: IntPtr; sourceLen: longint): longint; {$IFDEF LINUX}cdecl;{$ENDIF} + TUncompressProc = function(dest: IntPtr; destlen: IntPtr; source: IntPtr; sourceLne: longint): longint; {$IFDEF LINUX}cdecl;{$ENDIF} + +var + CompressProc: TCompressProc; + UncompressProc: TUncompressProc; + +{$ENDIF} + +{$IFDEF MSWINDOWS} +var + IsWin9x: boolean; +{$ENDIF} + +implementation + +{$IFDEF CLR} +uses + ActiveX, System.Text, + RTLConsts; +{$ELSE} +uses +{$IFDEF VER6} + SysConst, +{$ENDIF} + DAConsts; +{$ENDIF} + +{$IFNDEF CLR} + {$IFDEF MSWINDOWS} + {$DEFINE SORT_STRINGSORT} + {$ENDIF} +{$ENDIF} + +{$IFDEF CLR} +[DllImport('kernel32.dll')] +procedure CopyMemory(Dest, Source: IntPtr; Count: cardinal); external; + +[DllImport('kernel32.dll')] +function lstrcpy(lpString1, lpString2: IntPtr): IntPtr; external; + +[DllImport('kernel32.dll')] +function lstrcpyn(lpString1, lpString2: IntPtr; iMaxLength: Integer): IntPtr; external; + +[DllImport('kernel32.dll')] +function lstrcmp(lpString1, lpString2: IntPtr): integer; external; + +[DllImport('kernel32.dll')] +function lstrlen(lpString: IntPtr): Integer; external; + +[DllImport('kernel32.dll')] +procedure FillMemory(Destination: IntPtr; Length: DWORD; Fill: Byte); external; + +function CompareMem(P1, P2: IntPtr; Length: integer): boolean; +var + i: integer; +begin + Result := False; + for i := 0 to Length - 1 do begin + if Marshal.ReadByte(P1) <> Marshal.ReadByte(P2) then + Exit; + P1 := IntPtr(integer(P1) + 1); + P2 := IntPtr(integer(P2) + 1); + end; + Result := True; +end; +function CompareGuid(const g1, g2: TGuid): boolean; +begin + Result := g1 = g2; +end; +{$ELSE} +function CompareGuid(const g1, g2: TGuid): boolean; +begin + Result := CompareMem(@g1, @g2, SizeOf(TGuid)); +end; +{$ENDIF} + +function TimeStampToDateTime(const ATimeStamp: TTimeStamp): TDateTime; + procedure ValidateTimeStamp(const ATimeStamp: TTimeStamp); + begin + if (ATimeStamp.Time < 0) or (ATimeStamp.Date <= 0) then + raise EConvertError.Create(Format('''%d.%d'' is not a valid timestamp', [ATimeStamp.Date, ATimeStamp.Time])); + end; +begin + ValidateTimeStamp(ATimeStamp); + Result := ATimeStamp.Date - DateDelta; +{$IFNDEF CLR} + if Result < 0 then + Result := Result - (ATimeStamp.Time / MSecsPerDay) + else +{$ENDIF} + Result := Result + (ATimeStamp.Time / MSecsPerDay); +end; + +// bug in D8 in compare strings as variant type +function VarEqual(const Value1, Value2: variant): boolean; +var +{$IFDEF CLR} + va_old, va_new: TBytes; + i: integer; +{$ELSE} + va_old, va_new: PVarArray; + va_data_old, va_data_new: IntPtr; +{$ENDIF} +begin +{$IFDEF CLR} + if (Value1 <> nil) and (Value2 <> nil) and + (integer(Convert.GetTypeCode(Value1)) = 18) and (integer(Convert.GetTypeCode(Value2)) = 18) + then + Result := System.String.CompareOrdinal(string(Value1), string(Value2)) = 0 + else +{$ELSE} + // prevent comparing as AnsiString + if (VarType(Value1) = 8) and ((VarType(Value2) = 8) or (VarType(Value2) = 256)) or + (VarType(Value2) = 8) and ((VarType(Value1) = 8) or (VarType(Value1) = 256)) + then + Result := WideString(Value1) = WideString(Value2) + else +{$ENDIF} + if (VarType(Value1) = varNull) and (VarType(Value2) = varNull) then + Result := True + else + if (VarType(Value1) = varNull) or (VarType(Value2) = varNull) or + (VarType(Value2) <> VarType(Value2)) then + Result := False + else + if (VarType(Value1) = varArray + varByte) or + (VarType(Value2) = varArray + varByte) then begin + {$IFDEF CLR} + va_old := Value1; + va_new := Value2; + if (va_old = nil) and (va_new = nil) then + Result := True + else + if (va_old = nil) or (va_new = nil) or + (Length(va_old) <> Length(va_new)) then + Result := False + else begin + Result := True; + for i := Low(va_old) to High(va_old) do + if va_old[i] <> va_new[i] then begin + Result := False; + Break; + end; + end; + {$ELSE} + va_old := TVarData(Value1).VArray; + va_new := TVarData(Value2).VArray; + if (va_old = nil) and (va_new = nil) then + Result := True + else + if (va_old = nil) or (va_new = nil) or + (va_old.Bounds[0].ElementCount <> va_new.Bounds[0].ElementCount) then + Result := False + else begin + va_data_old := va_old.Data; + va_data_new := va_new.Data; + if (va_data_old = nil) and (va_data_new = nil) then + Result := True + else + if (va_data_old = nil) or (va_data_new = nil) then + Result := False + else + Result := CompareMem(va_data_old, va_data_new, va_old.Bounds[0].ElementCount); + end; + {$ENDIF} + end + else + Result := Value1 = Value2; +end; + +procedure CopyBuffer(Source, Dest: IntPtr; Count: cardinal); +begin +{$IFDEF CLR} + CopyMemory(Dest, Source, Count); +{$ELSE} + Move(Source^, Dest^, Count); +{$ENDIF} +end; + +procedure CopyBufferAnsi(const Source: string; Dest: IntPtr; Count{Bytes (#0 included)}: cardinal); +{$IFDEF CLR} +var + buf: TBytes; + CountInt: integer; // To prevent CLR compiler error +begin + SetLength(buf, Count); + CountInt := Convert.ToInt32(Count); // To prevent CLR compiler error + Encoding.Default.GetBytes(Source, 0, CountInt - 1{#0}, buf, 0); + buf[CountInt - 1] := 0; + Marshal.Copy(buf, 0, Dest, CountInt); +end; +{$ELSE} +begin + CopyBuffer(PChar(Source), Dest, Count); +end; +{$ENDIF} + +procedure CopyBufferUni(const Source: WideString; Dest: IntPtr; Count{Bytes (#0#0 included)}: cardinal); +{$IFDEF CLR} +var + buf: TBytes; + CountInt: integer; // To prevent CLR compiler error +begin + SetLength(buf, Count); + CountInt := Convert.ToInt32(Count); // To prevent CLR compiler error + Encoding.Unicode.GetBytes(Source, 0, (CountInt - 1{#0}) shr 1, buf, 0); + buf[CountInt - 1] := 0; + buf[CountInt - 2] := 0; + Marshal.Copy(buf, 0, Dest, CountInt); +end; +{$ELSE} +begin + CopyBuffer(PWideChar(Source), Dest, Count); +end; +{$ENDIF} + +procedure FillChar(X: IntPtr; Count: integer; Value: byte); +begin +{$IFDEF CLR} + FillMemory(X, Count, Value); +{$ELSE} + System.FillChar(X^, Count, Value); +{$ENDIF} +end; + +procedure FillStr(var S: string; Count: integer; Value: char); +begin +{$IFDEF CLR} + S := System.String.Create(Value, Count); +{$ELSE} + SetLength(S, Count); + FillChar(PChar(S), Count, byte(Value)); +{$ENDIF} +end; + +procedure ArrayCopy(sourceArray: TBytes; sourceIndex: integer; destinationArray: TBytes; destinationIndex: integer; length: integer); +begin +{$IFDEF CLR} + System.Array.Copy(sourceArray, sourceIndex, destinationArray, destinationIndex, length); +{$ELSE} + System.Move(sourceArray[sourceIndex], destinationArray[destinationIndex], length); +{$ENDIF} +end; + +function AllocGCHandle(Obj: {$IFDEF CLR}TObject{$ELSE}pointer{$ENDIF}; + Pinned: boolean = False): IntPtr; +begin +{$IFDEF CLR} + if Pinned then + Result := IntPtr(GCHandle.Alloc(Obj, GCHandleType.Pinned)) + else + Result := IntPtr(GCHandle.Alloc(Obj, GCHandleType.Normal)); +{$ELSE} + Result := Obj; +{$ENDIF} +end; + +function GetGCHandleTarget(Handle: IntPtr): TObject; +begin +{$IFDEF CLR} + if Handle = nil then + Result := nil + else + Result := GCHandle(Handle).Target; +{$ELSE} + Result := Handle; +{$ENDIF} +end; + +function GetAddrOfPinnedObject(Handle: IntPtr): IntPtr; +begin +{$IFDEF CLR} + Result := GCHandle(Handle).AddrOfPinnedObject; +{$ELSE} + Result := Handle; +{$ENDIF} +end; + +procedure FreeGCHandle(Handle: IntPtr); +begin +{$IFDEF CLR} + GCHandle(Handle).Free; +{$ELSE} +{$ENDIF} +end; + +function AllocString(var S: string; Length: integer): IntPtr; +begin + {$IFDEF CLR} + Result := Marshal.AllocHGlobal(Length + 1); + {$ELSE} + SetLength(S, Length); + Result := PChar(S); + {$ENDIF} +end; + +procedure FreeString(P: IntPtr); +begin + {$IFDEF CLR} + Marshal.FreeHGlobal(P); + {$ELSE} + {$ENDIF} +end; + +function AllocOrdinal(var Obj: shortint): IntPtr; overload; +begin + {$IFDEF CLR} + Result := Marshal.AllocHGlobal(sizeof(shortint)); + {$ELSE} + Result := @Obj; + {$ENDIF} +end; + +function AllocOrdinal(var Obj: byte): IntPtr; overload; +begin + {$IFDEF CLR} + Result := Marshal.AllocHGlobal(sizeof(byte)); + {$ELSE} + Result := @Obj; + {$ENDIF} +end; + +function AllocOrdinal(var Obj: word): IntPtr; overload; +begin + {$IFDEF CLR} + Result := Marshal.AllocHGlobal(sizeof(word)); + {$ELSE} + Result := @Obj; + {$ENDIF} +end; + +function AllocOrdinal(var Obj: integer): IntPtr; overload; +begin + {$IFDEF CLR} + Result := Marshal.AllocHGlobal(sizeof(integer)); + {$ELSE} + Result := @Obj; + {$ENDIF} +end; + +function AllocOrdinal(var Obj: cardinal): IntPtr; overload; +begin + {$IFDEF CLR} + Result := Marshal.AllocHGlobal(sizeof(integer)); + {$ELSE} + Result := @Obj; + {$ENDIF} +end; + +function AllocOrdinal(var Obj: IntPtr): IntPtr; overload; +begin + {$IFDEF CLR} + Result := Marshal.AllocHGlobal(sizeof(IntPtr)); + {$ELSE} + Result := @Obj; + {$ENDIF} +end; + +function OrdinalToPtr(var Obj: double): IntPtr; overload; +begin + {$IFDEF CLR} + Result := Marshal.AllocHGlobal(sizeof(Int64)); + Marshal.WriteInt64(Result, BitConverter.DoubleToInt64Bits(Obj)); + {$ELSE} + Result := @Obj; + {$ENDIF} +end; + +function OrdinalToPtr(var Obj: byte): IntPtr; overload; +begin + {$IFDEF CLR} + Result := Marshal.AllocHGlobal(sizeof(byte)); + Marshal.WriteByte(Result, Obj); + {$ELSE} + Result := @Obj; + {$ENDIF} +end; + +function OrdinalToPtr(var Obj: smallint): IntPtr; overload; +begin + {$IFDEF CLR} + Result := Marshal.AllocHGlobal(sizeof(smallint)); + Marshal.WriteInt16(Result, Obj); + {$ELSE} + Result := @Obj; + {$ENDIF} +end; + +function OrdinalToPtr(var Obj: integer): IntPtr; overload; +begin + {$IFDEF CLR} + Result := Marshal.AllocHGlobal(sizeof(integer)); + Marshal.WriteInt32(Result, Obj); + {$ELSE} + Result := @Obj; + {$ENDIF} +end; + +function OrdinalToPtr(var Obj: int64): IntPtr; overload; +begin + {$IFDEF CLR} + Result := Marshal.AllocHGlobal(sizeof(int64)); + Marshal.WriteInt64(Result, Obj); + {$ELSE} + Result := @Obj; + {$ENDIF} +end; + +function OrdinalToPtr(var Obj: cardinal): IntPtr; overload; +begin + {$IFDEF CLR} + Result := Marshal.AllocHGlobal(sizeof(cardinal)); + Marshal.WriteInt32(Result, Obj); + {$ELSE} + Result := @Obj; + {$ENDIF} +end; + +function OrdinalToPtr(var Obj: word): IntPtr; overload; +begin + {$IFDEF CLR} + Result := Marshal.AllocHGlobal(sizeof(word)); + Marshal.WriteInt16(Result, Obj); + {$ELSE} + Result := @Obj; + {$ENDIF} +end; + +function OrdinalToPtr(var Obj: IntPtr): IntPtr; overload; +begin + {$IFDEF CLR} + Result := Marshal.AllocHGlobal(sizeof(integer)); + Marshal.WriteIntPtr(Result, Obj); + {$ELSE} + Result := @Obj; + {$ENDIF} +end; + +procedure PtrToOrdinal(P: IntPtr; var Obj: shortint); overload; +begin + {$IFDEF CLR} + Obj := Marshal.ReadByte(P); + Marshal.FreeHGlobal(P); + {$ELSE} + {$ENDIF} +end; + +procedure PtrToOrdinal(P: IntPtr; var Obj: byte); overload; +begin + {$IFDEF CLR} + Obj := Marshal.ReadByte(P); + Marshal.FreeHGlobal(P); + {$ELSE} + {$ENDIF} +end; + +procedure PtrToOrdinal(P: IntPtr; var Obj: smallint); overload; +begin + {$IFDEF CLR} + Obj := Marshal.ReadInt16(P); + Marshal.FreeHGlobal(P); + {$ELSE} + {$ENDIF} +end; + +procedure PtrToOrdinal(P: IntPtr; var Obj: word); overload; +begin + {$IFDEF CLR} + Obj := Word(Marshal.ReadInt32(P)); + Marshal.FreeHGlobal(P); + {$ELSE} + {$ENDIF} +end; + +procedure PtrToOrdinal(P: IntPtr; var Obj: integer); overload; +begin + {$IFDEF CLR} + Obj := Marshal.ReadInt32(P); + Marshal.FreeHGlobal(P); + {$ELSE} + {$ENDIF} +end; + +procedure PtrToOrdinal(P: IntPtr; var Obj: int64); overload; +begin + {$IFDEF CLR} + Obj := Marshal.ReadInt64(P); + Marshal.FreeHGlobal(P); + {$ELSE} + {$ENDIF} +end; + +procedure PtrToOrdinal(P: IntPtr; var Obj: cardinal); overload; +begin + {$IFDEF CLR} + Obj := Marshal.ReadInt32(P); + Marshal.FreeHGlobal(P); + {$ELSE} + {$ENDIF} +end; + +procedure PtrToOrdinal(P: IntPtr; var Obj: IntPtr); overload; +begin + {$IFDEF CLR} + Obj := Marshal.ReadIntPtr(P); + Marshal.FreeHGlobal(P); + {$ELSE} + {$ENDIF} +end; + +procedure FreeOrdinal(P: IntPtr); +begin + {$IFDEF CLR} + Marshal.FreeHGlobal(P); + {$ELSE} + {$ENDIF} +end; + +{$IFDEF CLR} +procedure StrCopy(Dest: IntPtr; const Source: IntPtr); +begin + Win32Check(lstrcpy(Dest, Source) <> nil); +end; + +procedure StrLCopy(Dest: IntPtr; const Source: IntPtr; MaxLen{Chars}: Cardinal); +begin + Win32Check(lstrcpyn(Dest, Source, Integer(MaxLen + 1)) <> nil); +end; + +function StrComp(const Str1: IntPtr; const Str2: IntPtr): integer; +begin + Result := lstrcmp(Str1, Str2); +end; + +function StrLen(const Str: IntPtr): Cardinal; +begin + Result := lstrlen(Str); +end; + +function StrLenW(const Str: IntPtr): Cardinal; +var + s: WideString; +begin + s := Marshal.PtrToStringUni(Str); + Result := s.Length; +end; + +procedure StrTrim(const Str: IntPtr; Len: integer = -1); +var + i: integer; + v: byte; +begin + if Len = - 1 then // Detect length + Len := StrLen(Str); + + i := Integer(Str) + Len - 1; + + while True do begin + v := Marshal.ReadByte(IntPtr(i)); + if ((v <> 32 {Byte(' ')}) and (v <> 0{Byte(#0)})) or (i < Integer(Str)) then + Exit; + Marshal.WriteByte(IntPtr(i), Byte(#0)); + Dec(i); + end; +end; + +procedure StrTrimW(const Str: IntPtr; Len: integer = -1); +var + i: integer; + v: smallint; +begin + if Len = - 1 then // Detect length + Len := StrLenW(Str); + + i := Integer(Str) + (Len - 1) shl 1; + + while True do begin + v := Marshal.ReadInt16(IntPtr(i)); + if ((v <> 32 {SmallInt(' ')}) and (v <> 0{SmallInt(#0)})) or (i < Integer(Str)) then + Exit; + Marshal.WriteInt16(IntPtr(i), SmallInt(#0)); + Dec(i); + Dec(i); + end; +end; + +{$ENDIF} + +function StrCopyW(Dest: IntPtr; const Source: IntPtr): IntPtr; +{$IFDEF CLR} +var + Buf: smallint; + i: integer; +begin + i := 0; + repeat + Buf := Marshal.ReadInt16(Source, i); + Marshal.WriteInt16(Dest, i, Buf); + Inc(i, 2); + until Buf = 0; +{$ELSE} +asm + PUSH EDI + PUSH ESI + MOV ESI,EAX + MOV EDI,EDX + MOV ECX,0FFFFFFFFH + XOR AX,AX + REPNE SCASW + NOT ECX + SHL ECX, 1 // Size := Len * sizeof(WideChar) + MOV EDI,ESI + MOV ESI,EDX + MOV EDX,ECX + MOV EAX,EDI + SHR ECX,2 + REP MOVSD + MOV ECX,EDX + AND ECX,3 + REP MOVSB + POP ESI + POP EDI +{$ENDIF} +end; + +procedure StrLCopyW(Dest: IntPtr; const Source: IntPtr; MaxLen{WideChars}: Cardinal); +{$IFDEF CLR} +var + Buf: smallint; + i: cardinal; +begin + i := 0; + Buf := 0; + while i < MaxLen * 2 do begin + Buf := Marshal.ReadInt16(Source, i); + Marshal.WriteInt16(Dest, i, Buf); + if Buf = 0 then + Break; + Inc(i, 2); + end; + if Buf <> 0 then + Marshal.WriteInt16(Dest, i, 0); +{$ELSE} +var + pwc: PWideChar; +begin + pwc := Source; + while (pwc^ <> #0) and (pwc < PWideChar(Source) + MaxLen) do begin + PWideChar(Dest)^ := pwc^; + Inc(PWideChar(Dest)); + Inc(pwc); + end; + PWideChar(Dest)^ := #0; +{$ENDIF} +end; + +{$IFNDEF CLR} +function StrLenW(const Str: IntPtr): Cardinal; assembler; +asm + MOV EDX,EDI + MOV EDI,EAX + MOV ECX,0FFFFFFFFH + XOR AX,AX + REPNE SCASW + MOV EAX,0FFFFFFFEH + SUB EAX,ECX + MOV EDI,EDX +end; + +procedure StrTrim(const Str: IntPtr; Len: integer = -1); +var + pc: PChar; +begin + if Len = - 1 then // Detect length + Len := StrLen(Str); + + pc := PChar(Str) + Len - 1; + + while ((pc^ = ' ') or (pc^ = #0)) and (pc >= Str) do begin + pc^ := #0; + Dec(pc); + end; +end; + +procedure StrTrimW(const Str: IntPtr; Len: integer = -1); +var + pwc: PWideChar; +begin + if Len = - 1 then // Detect length + Len := StrLenW(Str); + + pwc := PWideChar(Str) + Len - 1; + + while ((pwc^ = ' ') or (pwc^ = #0)) and (pwc >= Str) do begin + PWideChar(pwc)^ := #0; + Dec(pwc); + end; +end; +{$ENDIF} + +function AnsiStrLCompWS(const S1, S2: WideString; MaxLen: Cardinal): Integer; +begin +{$IFDEF MSWINDOWS} + Assert(not IsWin9x, 'Unicode support on Win9x'); +{$IFDEF CLR} + Result := CompareStringW(LOCALE_USER_DEFAULT, SORT_STRINGSORT, S1, MaxLen, S2, MaxLen) - 2; +{$ELSE} + Result := CompareStringW(LOCALE_USER_DEFAULT, SORT_STRINGSORT, PWideChar(S1), MaxLen, + PWideChar(S2), MaxLen) - 2; +{$ENDIF} +{$ELSE} + Result := 0; + Assert(False); +{$ENDIF} +end; + +function AnsiStrLICompWS(const S1, S2: WideString; MaxLen: Cardinal): Integer; +begin +{$IFDEF MSWINDOWS} + Assert(not IsWin9x, 'Unicode support on Win9x'); +{$IFDEF CLR} + Result := CompareStringW(LOCALE_USER_DEFAULT, NORM_IGNORECASE + SORT_STRINGSORT, + S1, MaxLen, S2, MaxLen) - 2; +{$ELSE} + Result := CompareStringW(LOCALE_USER_DEFAULT, NORM_IGNORECASE + SORT_STRINGSORT, + PWideChar(S1), MaxLen, PWideChar(S2), MaxLen) - 2; +{$ENDIF} +{$ELSE} + Result := 0; + Assert(False); +{$ENDIF} +end; + +function AnsiStrCompWS(const S1, S2: WideString): Integer; +begin +{$IFDEF MSWINDOWS} + Assert(not IsWin9x, 'Unicode support on Win9x'); +{$IFDEF CLR} + Result := CompareStringW(LOCALE_USER_DEFAULT, SORT_STRINGSORT, S1, -1, S2, -1) - 2; +{$ELSE} + Result := CompareStringW(LOCALE_USER_DEFAULT, SORT_STRINGSORT, PWideChar(S1), -1, + PWideChar(S2), -1) - 2; +{$ENDIF} +{$ELSE} + Result := 0; + Assert(False); +{$ENDIF} +end; + +function AnsiStrICompWS(const S1, S2: WideString): Integer; +begin +{$IFDEF MSWINDOWS} + Assert(not IsWin9x, 'Unicode support on Win9x'); +{$IFDEF CLR} + Result := CompareStringW(LOCALE_USER_DEFAULT, NORM_IGNORECASE + SORT_STRINGSORT, S1, -1, + S2, -1) - 2; +{$ELSE} + Result := CompareStringW(LOCALE_USER_DEFAULT, NORM_IGNORECASE + SORT_STRINGSORT, PWideChar(S1), + -1, PWideChar(S2), -1) - 2; +{$ENDIF} +{$ELSE} + Result := 0; + Assert(False); +{$ENDIF} +end; + +function IsClass(Obj: TObject; AClass: TClass): boolean; + + function IsClassByName(Obj: TObject; AClass: TClass): boolean; + var + ParentClass: TClass; + begin + Result := False; + ParentClass := Obj.ClassType; + while ParentClass <> nil do begin + Result := ParentClass.ClassName = AClass.ClassName; + if not Result then + ParentClass := ParentClass.ClassParent + else + Break; + end; + end; + +begin + if IsLibrary then + Result := IsClassByName(Obj, AClass) + else + Result := Obj is AClass; +end; + +{$IFDEF CLR} +function AnsiUpperCase(const S: string): string; +begin + if S <> nil then + Result := System.String(S).ToUpper + else + Result := ''; +end; + +function AnsiCompareText(const S1, S2: string): integer; +begin + Result := System.String.Compare(S1, S2, True); +end; + +function AnsiCompareStr(const S1, S2: string): integer; +begin + Result := System.String.Compare(S1, S2, False); +end; + +function AnsiSameText(const S1, S2: string): Boolean; +begin + Result := System.String.Compare(S1, S2, True) = 0; +end; + +{$ELSE} + +function AnsiStrCompS(S1, S2: PChar): Integer; // SORT_STRINGSORT +begin +{$IFDEF SORT_STRINGSORT} + Result := CompareString(LOCALE_USER_DEFAULT, SORT_STRINGSORT, S1, -1, S2, -1) - 2; +{$ELSE} + Result := AnsiStrComp(S1, S2); +{$ENDIF} +end; + +function AnsiStrICompS(S1, S2: PChar): Integer; // SORT_STRINGSORT +begin +{$IFDEF SORT_STRINGSORT} + Result := CompareString(LOCALE_USER_DEFAULT, NORM_IGNORECASE + SORT_STRINGSORT, S1, -1, + S2, -1) - 2; +{$ELSE} + Result := AnsiStrIComp(S1, S2); +{$ENDIF} +end; + +{$ENDIF} + +function AnsiCompareTextS(const S1, S2: string): integer; // SORT_STRINGSORT +begin +{$IFDEF SORT_STRINGSORT} + Result := CompareString(LOCALE_USER_DEFAULT, NORM_IGNORECASE + SORT_STRINGSORT, PChar(S1), + Length(S1), PChar(S2), Length(S2)) - 2; +{$ELSE} + Result := AnsiCompareText(S1, S2); +{$ENDIF} +end; + +function AnsiCompareStrS(const S1, S2: string): integer; // SORT_STRINGSORT +begin +{$IFDEF SORT_STRINGSORT} + Result := CompareString(LOCALE_USER_DEFAULT, SORT_STRINGSORT, PChar(S1), Length(S1), + PChar(S2), Length(S2)) - 2; +{$ELSE} + Result := AnsiCompareStr(S1, S2); +{$ENDIF} +end; + +// Convert Utf8 buffer to WideString buffer with or without null terminator. +// Nearly copied from System.Utf8ToUnicode +function Utf8ToWs(const Dest: TValueArr; DestIdx: Cardinal; MaxDestBytes{w/wo #0}: Cardinal; + const Source: TValueArr; SourceIdx, SourceBytes: Cardinal; + const AddNull: boolean): Cardinal{bytes w/wo #0}; +var + i: Cardinal; + c: Byte; + wc: Cardinal; +begin + Assert(Source <> nil, 'Utf8ToWs: Source is nil'); + Assert(Dest <> nil, 'Utf8ToWs: Destination is nil'); +{$IFDEF CLR} + Assert(Integer(DestIdx + MaxDestBytes) <= Length(Dest), 'Utf8ToWs: DestIdx = ' + IntToStr(DestIdx) + ', MaxDestBytes = ' + IntToStr(MaxDestBytes) + ', Length(Dest) = ' + IntToStr(Length(Dest))); + Assert(Integer(SourceIdx + SourceBytes) <= Length(Source), 'Utf8ToWs: SourceIdx = ' + IntToStr(SourceIdx) + ', SourceBytes = ' + IntToStr(SourceBytes) + ', Length(Source) = ' + IntToStr(Length(Source))); +{$ENDIF} + Result := 0; + i := SourceIdx; + while i < SourceIdx + SourceBytes do + begin + wc := Cardinal(Source[Integer(i)]); + if wc = 0 then //zero terminator + break; + Inc(i); + if (wc and $80) <> 0 then + begin + Assert(i < SourceIdx + SourceBytes, 'Utf8ToWs: Incomplete multibyte char'); + wc := wc and $3F; + if (wc and $20) <> 0 then + begin + c := Byte(Source[Integer(i)]); + Inc(i); + Assert((c and $C0) = $80, 'Utf8ToWs: Malformed trail byte or out of range char'); + Assert(i < SourceIdx + SourceBytes, 'Utf8ToWs: Incomplete multibyte char'); + wc := (wc shl 6) or (c and $3F); + end; + c := Byte(Source[Integer(i)]); + Inc(i); + Assert((c and $C0) = $80, 'Utf8ToWs: Malformed trail byte'); + wc := (wc shl 6) or (c and $3F); + end; + + if not (Result + 1 < MaxDestBytes) then + Break; + {$IFDEF CLR} + Dest[Integer(Result + DestIdx)] := Byte(wc); + Dest[Integer(Result + DestIdx + 1)] := Byte(wc shr 8); + {$ELSE} + Cardinal(Pointer(Cardinal(Dest) + DestIdx + Result)^) := wc; + {$ENDIF} + Inc(Result, SizeOf(WideChar)); + end; + + if AddNull and (MaxDestBytes > 0) then begin + if Result >= MaxDestBytes then + Result := MaxDestBytes - SizeOf(WideChar); + {$IFDEF CLR} + Dest[Integer(Result + DestIdx)] := 0; + Dest[Integer(Result + DestIdx + 1)] := 0; + {$ELSE} + Marshal.WriteInt16(Dest, Integer(DestIdx + Result), 0); + {$ENDIF} + Inc(Result, SizeOf(WideChar)); + end; +end; + +{$IFDEF CLR} +{ TDAList } +constructor TDAList.Create; +begin + inherited Create; + + SetCapacity(10); +end; + +destructor TDAList.Destroy; +begin + Clear; + + inherited; +end; + +procedure TDAList.Clear; +begin + FCount := 0; + SetCapacity(0); +end; + +procedure TDAList.Delete(Index: Integer); +begin + if (Index < 0) or (Index >= FCount) then + TList.Error({$IFNDEF CLR}@{$ENDIF}SListIndexError, Index); + Dec(FCount); + if Index < FCount then + {$IFDEF CLR} + System.Array.Copy(FList, Index + 1, FList, Index, FCount - Index); + {$ELSE}//TODO + System.Move(FList[Index + 1], FList[Index], + (FCount - Index) * SizeOf(Pointer)); + {$ENDIF} +end; + +function TDAList.IndexOf(Item: TObject): Integer; +begin + Result := 0; + while (Result < FCount) and (FList[Result] <> Item) do + Inc(Result); + if Result = FCount then + Result := -1; +end; + +function TDAList.Last: TObject; +begin + Result := Get(FCount - 1); +end; + +function TDAList.Remove(Item: TObject): Integer; +begin + Result := IndexOf(Item); + if Result >= 0 then + Delete(Result); +end; + +procedure QuickSort(var SortList: array of TObject; L, R: Integer; + SCompare: TListSortCompare); +var + I, J: Integer; + P, T: TObject; +begin + repeat + I := L; + J := R; + P := SortList[(L + R) shr 1]; + repeat + while SCompare(SortList[I], P) < 0 do + Inc(I); + while SCompare(SortList[J], P) > 0 do + Dec(J); + if I <= J then + begin + T := SortList[I]; + SortList[I] := SortList[J]; + SortList[J] := T; + Inc(I); + Dec(J); + end; + until I > J; + if L < J then + QuickSort(SortList, L, J, SCompare); + L := I; + until I >= R; +end; + +procedure TDAList.Sort(Compare: TListSortCompare); +begin + if (FList <> nil) and (Count > 0) then + QuickSort(FList, 0, Count - 1, Compare); +end; + +function TDAList.Add(Item: TObject): Integer; +begin + Result := FCount; + if Result = FCapacity then + Grow; + FList[Result] := Item; + Inc(FCount); +end; + +function TDAList.Get(Index: Integer): TObject; +begin + if (Index < 0) or (Index >= FCount) then + TList.Error({$IFNDEF CLR}@{$ENDIF}SListIndexError, Index); + Result := FList[Index]; +end; + +procedure TDAList.Grow; +var + Delta: Integer; +begin + if FCapacity > 64 then + Delta := FCapacity div 4 + else + if FCapacity > 8 then + Delta := 16 + else + Delta := 4; + SetCapacity(FCapacity + Delta); +end; + +procedure TDAList.Put(Index: Integer; Item: TObject); +begin + if (Index < 0) or (Index >= FCount) then + TList.Error({$IFNDEF CLR}@{$ENDIF}SListIndexError, Index); + FList[Index] := Item; +end; + +procedure TDAList.SetCapacity(NewCapacity: Integer); +begin + if (NewCapacity < FCount) or (NewCapacity > MaxListSize) then + TList.Error({$IFNDEF CLR}@{$ENDIF}SListCapacityError, NewCapacity); + if NewCapacity <> FCapacity then + begin + SetLength(FList, NewCapacity); + FCapacity := NewCapacity; + end; +end; +{$ENDIF} + +{$IFDEF CLR} +const + ole32 = 'ole32.dll'; + oleaut32 = 'oleaut32.dll'; + +// Copied from ActiveX.pas (d7) +const + STGM_READ = $00000000; + +[DllImport(oleaut32, CharSet = CharSet.Ansi, SetLastError = True, EntryPoint = 'VariantClear')] +function VariantClear(Value: POleVariant): HResult; external; + +procedure OleVarClear(pValue: POleVariant); +begin + SetOleVariant(pValue, Unassigned); +end; + +function GetOleVariant(pValue: POleVariant): OleVariant; +begin + Result := OleVariant(Marshal.GetObjectForNativeVariant(pValue)); +// Result := OleVariant(Marshal.PtrToStructure(pValue, TypeOf(OleVariant))); +end; + +procedure SetOleVariant(pValue: POleVariant; const Value: OleVariant); +begin + Marshal.GetNativeVariantForObject(TObject(Value), pValue); +end; + +{$ELSE} +procedure OleVarClear(pValue: POleVariant); +begin + pValue^ := Unassigned; +end; + +function GetOleVariant(pValue: POleVariant): OleVariant; +begin + Result := pValue^; +end; + +procedure SetOleVariant(pValue: POleVariant; const Value: OleVariant); +begin + pValue^ := Value; +end; + +{$ENDIF} + + +{$IFNDEF VER6P} +function BoolToStr(const Value: boolean; UseBoolStrs: Boolean = False): string; +const + cSimpleBoolStrs: array [boolean] of String = ('0', '-1'); +begin + if UseBoolStrs then + begin + if Value then + Result := 'True' + else + Result := 'False'; + end + else + Result := cSimpleBoolStrs[Value]; +end; + +function TryStrToBool(const S: string; out Value: Boolean): Boolean; +begin + Result := True; + if SameText(s, 'True') or SameText(s, 'Yes') or SameText(s, '1') then + Value := True + else + if SameText(s, 'False') or SameText(s, 'No') or SameText(s, '0') then + Value := False + else + Result := False; +end; + +function StrToBool(const S: string): Boolean; +begin + if not TryStrToBool(S, Result) then + raise EConvertError.Create('InvalidBoolean - ' + S); +end; + +type + PWordBool = ^WordBool; + +procedure DecodeDateTime(const AValue: TDateTime; out AYear, AMonth, ADay, + AHour, AMinute, ASecond, AMilliSecond: Word); +begin + DecodeDate(AValue, AYear, AMonth, ADay); + DecodeTime(AValue, AHour, AMinute, ASecond, AMilliSecond); +end; + +function WideUpperCase(const S: WideString): WideString; +var + Len: Integer; +begin + Len := Length(S); + SetString(Result, PWideChar(S), Len); + if Len > 0 then CharUpperBuffW(Pointer(Result), Len); +end; + +function VarToWideStr(const V: Variant): WideString; +begin + if not VarIsNull(V) then + Result := V + else + Result := '';; +end; +{$ENDIF} + +{$IFDEF VER6} +procedure ConvertErrorFmt(ResString: PResStringRec; const Args: array of const); local; +begin + raise EConvertError.CreateResFmt(ResString, Args); +end; + +function StrToBool(const S: string): Boolean; +begin + if not TryStrToBool(S, Result) then + ConvertErrorFmt(@SInvalidBoolean, [S]); +end; + +procedure VerifyBoolStrArray; +begin + if Length(TrueBoolStrs) = 0 then + begin + SetLength(TrueBoolStrs, 1); + TrueBoolStrs[0] := DefaultTrueBoolStr; + end; + if Length(FalseBoolStrs) = 0 then + begin + SetLength(FalseBoolStrs, 1); + FalseBoolStrs[0] := DefaultFalseBoolStr; + end; +end; + +function TryStrToBool(const S: string; out Value: Boolean): Boolean; + function CompareWith(const aArray: array of string): Boolean; + var + I: Integer; + begin + Result := False; + for I := Low(aArray) to High(aArray) do + if AnsiSameText(S, aArray[I]) then + begin + Result := True; + Break; + end; + end; +var + LResult: Extended; +begin + Result := TryStrToFloat(S, LResult); + if Result then + Value := LResult <> 0 + else + begin + VerifyBoolStrArray; + Result := CompareWith(TrueBoolStrs); + if Result then + Value := True + else + begin + Result := CompareWith(FalseBoolStrs); + if Result then + Value := False; + end; + end; +end; +{$ENDIF} + +{$IFNDEF CLR} +function TryEncodeDate(Year, Month, Day: Word; var Date: TDateTime): Boolean; +var + I: Integer; + DayTable: PDayTable; +begin + Result := False; + DayTable := @MonthDays[IsLeapYear(Year)]; + if (Year >= 1) and (Year <= 9999) and (Month >= 1) and (Month <= 12) and + (Day >= 1) and (Day <= DayTable^[Month]) then + begin + for I := 1 to Month - 1 do Inc(Day, DayTable^[I]); + I := Year - 1; + Date := I * 365 + I div 4 - I div 100 + I div 400 + Day - DateDelta; + Result := True; + end; +end; + +function TryEncodeTime(Hour, Min, Sec, MSec: Word; var Time: TDateTime): Boolean; +begin + Result := False; + if (Hour < 24) and (Min < 60) and (Sec < 60) and (MSec < 1000) then + begin + Time := (Hour * 3600000 + Min * 60000 + Sec * 1000 + MSec) / MSecsPerDay; + Result := True; + end; +end; + +function TryEncodeDateTime(const AYear, AMonth, ADay, AHour, AMinute, ASecond, + AMilliSecond: Word; out AValue: TDateTime): Boolean; +var + LTime: TDateTime; +begin + Result := TryEncodeDate(AYear, AMonth, ADay, AValue); + if Result then + begin + Result := TryEncodeTime(AHour, AMinute, ASecond, AMilliSecond, LTime); + if Result then + if AValue > 0 then + AValue := AValue + LTime + else + AValue := AValue - LTime; + end; +end; + +function EncodeDateTime(const AYear, AMonth, ADay, AHour, AMinute, ASecond, + AMilliSecond: Word): TDateTime; +begin + if not TryEncodeDateTime(AYear, AMonth, ADay, + AHour, AMinute, ASecond, AMilliSecond, Result) then + raise EConvertError.Create(SDateEncodeError); +end; +{$ENDIF} + +function Reverse4(Value: cardinal): cardinal; +begin + Result := Cardinal((byte(Value) shl 24) or (byte(Value shr 8) shl 16) + or (byte(Value shr 16) shl 8) or byte(Value shr 24)); +end; + +{$IFNDEF CLR} +procedure Reverse8(pValue: IntPtr); +var + FirstByte: PByte; + LastByte: PByte; + TmpValue: Byte; + i: integer; +begin + FirstByte := PByte(pValue); + LastByte := FirstByte; + Inc(LastByte, SizeOf(Int64) - 1); + for i := 0 to 3 do begin + TmpValue := LastByte^; + LastByte^ := FirstByte^; + FirstByte^ := TmpValue; + Inc(FirstByte); + Dec(LastByte); + end; +end; +{$ENDIF} + +{$IFDEF VER8} +function UTF8Encode(const WS: WideString): UTF8String; +begin + Result := UTF8String(System.Array(nil)); + if Assigned(WS) then + Result := System.Text.Encoding.UTF8.GetBytes(WS); +end; + +function UTF8Decode(const S: UTF8String): WideString; +begin + Result := WideString(System.String(nil)); + if Assigned(S) then + Result := System.Text.Encoding.UTF8.GetString(TBytes(S), 0, High(TBytes(S)) + 1); +end; +{$ENDIF} + +{$IFDEF HAVE_COMPRESS} +procedure CheckZLib; +begin + if not Assigned(CompressProc) then + raise Exception.Create(SCompressorNotLinked); + if not Assigned(UncompressProc) then + raise Exception.Create(SUncompressorNotLinked); +end; + +procedure DoCompress(dest: IntPtr; destLen: IntPtr; const source: IntPtr; sourceLen: longint); +begin + Assert(Assigned(CompressProc), SCompressorNotLinked); + CompressProc(dest, destLen, source, sourceLen) +end; + +procedure DoUncompress(dest: IntPtr; destlen: IntPtr; source: IntPtr; sourceLne: longint); +begin + Assert(Assigned(UncompressProc), SUncompressorNotLinked); + UncompressProc(dest, destLen, source, sourceLne) +end; + +{$IFDEF HAVE_COMPRESS_INTERNAL} +function CCheck(code: Integer): Integer; +begin + Result := code; + if code < 0 then + raise ECompressionError.Create(sError); +end; + +function DCheck(code: Integer): Integer; +begin + Result := code; + if code < 0 then + raise EDecompressionError.Create(sError); +end; + +function compress(dest: IntPtr; destLen: IntPtr; const source: IntPtr; sourceLen: longint): longint; +var + strm: TZStreamRec; +begin + FillChar(@strm, sizeof(strm), 0); + strm.zalloc := zlibAllocMem; + strm.zfree := zlibFreeMem; + strm.next_in := source; + strm.avail_in := sourceLen; + strm.next_out := dest; + strm.avail_out := Integer(destLen^); + CCheck(deflateInit_(strm, Z_DEFAULT_COMPRESSION{Z_BEST_COMPRESSION}, zlib_version, sizeof(strm))); + try + Result := CCheck(deflate(strm, Z_FINISH)); + if Result <> Z_STREAM_END then + raise EZlibError.CreateRes(@sTargetBufferTooSmall); + finally + CCheck(deflateEnd(strm)); + end; + Integer(destLen^) := strm.total_out; +end; + +function uncompress(dest: IntPtr; destlen: IntPtr; source: IntPtr; sourceLne: longint): longint; +var + strm: TZStreamRec; +begin + FillChar(@strm, sizeof(strm), 0); + strm.zalloc := zlibAllocMem; + strm.zfree := zlibFreeMem; + strm.next_in := source; + strm.avail_in := sourcelne; + strm.next_out := dest; + strm.avail_out := Integer(destlen^); + DCheck(inflateInit_(strm, zlib_version, sizeof(strm))); + try + Result := DCheck(inflate(strm, Z_FINISH)); + if Result <> Z_STREAM_END then + raise EZlibError.CreateRes(@sTargetBufferTooSmall); + finally + DCheck(inflateEnd(strm)); + end; +end; +{$ENDIF} +{$ENDIF} + +{$IFDEF MSWINDOWS} +var + lpVersionInformation: TOSVersionInfo; + +initialization + lpVersionInformation.dwOSVersionInfoSize := sizeof(lpVersionInformation); +{$IFDEF VER6P} + {$WARN SYMBOL_PLATFORM OFF} +{$ENDIF} +{$IFDEF CLR} + IsWin9x := False; +{$ELSE} + Win32Check(GetVersionEx(lpVersionInformation)); + IsWin9x := lpVersionInformation.dwPlatformId = VER_PLATFORM_WIN32_WINDOWS; +{$ENDIF} +{$ENDIF} + +{$IFDEF HAVE_COMPRESS_INTERNAL} + CompressProc := compress; + UncompressProc := uncompress; +{$ENDIF} +end. diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.CRAccess.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.CRAccess.pas new file mode 100644 index 0000000..a957602 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.CRAccess.pas @@ -0,0 +1,5 @@ +{$I ..\Dac.inc} + +unit CoreLab.Dac.CRAccess; + +{$I ..\CRAccess.pas} \ No newline at end of file diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.CRBatchMove.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.CRBatchMove.pas new file mode 100644 index 0000000..4f77d4f --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.CRBatchMove.pas @@ -0,0 +1,5 @@ +{$I ..\Dac.inc} + +unit CoreLab.Dac.CRBatchMove; + +{$I ..\CRBatchMove.pas} diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.CRConnectionPool.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.CRConnectionPool.pas new file mode 100644 index 0000000..ff3a159 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.CRConnectionPool.pas @@ -0,0 +1,5 @@ +{$I ..\Dac.inc} + +unit CoreLab.Dac.CRConnectionPool; + +{$I ..\CRConnectionPool.pas} diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.CRParser.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.CRParser.pas new file mode 100644 index 0000000..f108889 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.CRParser.pas @@ -0,0 +1,5 @@ +{$I ..\Dac.inc} + +unit CoreLab.Dac.CRParser; + +{$I ..\CRParser.pas} \ No newline at end of file diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.DAConsts.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.DAConsts.pas new file mode 100644 index 0000000..818aaa3 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.DAConsts.pas @@ -0,0 +1,3 @@ +unit CoreLab.Dac.DAConsts; + +{$I ..\DAConsts.pas} diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.DADump.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.DADump.pas new file mode 100644 index 0000000..b7e2c55 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.DADump.pas @@ -0,0 +1,5 @@ +{$I ..\Dac.inc} + +unit CoreLab.Dac.DADump; + +{$I ..\DADump.pas} \ No newline at end of file diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.DALoader.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.DALoader.pas new file mode 100644 index 0000000..4c33a2d --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.DALoader.pas @@ -0,0 +1,5 @@ +{$I ..\Dac.inc} + +unit CoreLab.Dac.DALoader; + +{$I ..\DALoader.pas} \ No newline at end of file diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.DASQLMonitor.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.DASQLMonitor.pas new file mode 100644 index 0000000..86a9ac1 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.DASQLMonitor.pas @@ -0,0 +1,5 @@ +{$I ..\Dac.inc} + +unit CoreLab.Dac.DASQLMonitor; + +{$I ..\DASQLMonitor.pas} \ No newline at end of file diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.DAScript.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.DAScript.pas new file mode 100644 index 0000000..c8cb703 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.DAScript.pas @@ -0,0 +1,5 @@ +{$I ..\Dac.inc} + +unit CoreLab.Dac.DAScript; + +{$I ..\DAScript.pas} \ No newline at end of file diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.DBAccess.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.DBAccess.pas new file mode 100644 index 0000000..6e915b0 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.DBAccess.pas @@ -0,0 +1,5 @@ +{$I ..\Dac.inc} + +unit CoreLab.Dac.DBAccess; + +{$I ..\DBAccess.pas} \ No newline at end of file diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.DBMonitorClient.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.DBMonitorClient.pas new file mode 100644 index 0000000..d24dba6 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.DBMonitorClient.pas @@ -0,0 +1,5 @@ +{$I ..\Dac.inc} + +unit CoreLab.Dac.DBMonitorClient; + +{$I ..\DBMonitorClient.pas} \ No newline at end of file diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.DBMonitorIntf.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.DBMonitorIntf.pas new file mode 100644 index 0000000..3c0e89a --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.DBMonitorIntf.pas @@ -0,0 +1,5 @@ +{$I ..\Dac.inc} + +unit CoreLab.Dac.DBMonitorIntf; + +{$I ..\DBMonitorIntf.pas} \ No newline at end of file diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.DacVcl.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.DacVcl.pas new file mode 100644 index 0000000..92cea89 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.DacVcl.pas @@ -0,0 +1,5 @@ +{$I ..\Dac.inc} + +unit CoreLab.Dac.DacVcl; + +{$I ..\DacVcl.pas} \ No newline at end of file diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.DataAdapter.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.DataAdapter.pas new file mode 100644 index 0000000..913878a --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.DataAdapter.pas @@ -0,0 +1,339 @@ +unit CoreLab.Dac.DataAdapter; + +interface + +uses Classes, DB, System.Data, Variants; + +type + TDataTableArr = array of DataTable; + IDataParameterArr = array of IDataParameter; + + DADataAdapter = class (TComponent) + FDataSet: TDataSet; + FData: System.Data.DataSet; + + procedure CheckTDataSet; + + protected + function CanLocateField(Field: TField): boolean; virtual; + function GetItemType(Field: TField): System.Type; virtual; + function GetItemValue(Field: TField): TObject; virtual; + procedure SetItemValue(Field: TField; Value: TObject); virtual; + function ItemToVariant(Field: TField; Value: TObject): Variant; virtual; + + public + function Fill(Data: DataSet; tableName: string): integer; + function Update(Data: DataSet; tableName: string): integer; + + property DataSet: TDataSet read FDataSet write FDataSet; + end; + +implementation + +uses MemUtils, SysUtils; + +procedure DADataAdapter.CheckTDataSet; +begin + if FDataSet = nil then + raise Exception.Create('DADataAdapter.DataSet is not defined!'); +end; + +function DADataAdapter.CanLocateField(Field: TField): boolean; +begin + case Field.DataType of + {ftBoolean,} + ftString, ftFixedChar, ftWideString, + ftAutoInc, ftSmallint, ftWord, ftInteger, ftLargeint, + ftFloat, ftCurrency, + ftDateTime, ftDate, ftTime: + Result := True; + else + case Field.DataType of + ftBlob, ftMemo{$IFDEF VER10P}, ftWideMemo{$ENDIF}: + Result := False; + else + Result := True; + end; + end +end; + +function DADataAdapter.GetItemType(Field: TField): System.Type; +begin + case Field.DataType of + ftBoolean: Result := typeof(Boolean); + ftString, ftFixedChar, ftWideString, ftMemo{$IFDEF VER10P}, ftWideMemo{$ENDIF}: Result := typeof(String); + ftAutoInc, ftSmallint, ftWord, ftInteger, ftLargeint: Result := typeof(Longint); + ftFloat, ftCurrency: Result := typeof(Double); + ftDateTime, ftDate, ftTime: Result := typeof(System.DateTime); + ftBlob: Result := typeof(TBytes); + ftBytes, ftVarBytes: Result := typeof(TBytes); + ftBCD: Result := typeof(Borland.Delphi.System.Currency); + else + Result := typeof(Variant);//ftADT, ftArray, ftReference, ftDataSet, ftVariant, + end; +end; + +function DADataAdapter.GetItemValue(Field: TField): TObject; +var + MS: TMemoryStream; + i: integer; + Buf: TBytes; +begin + if Field.IsNull then begin + Result := Convert.DBNull; + Exit; + end; + case Field.DataType of + ftDateTime, ftDate, ftTime: + Result := System.DateTime(Field.Value); + ftBlob: begin; + MS := TMemoryStream.Create; + try + TBlobField(Field).SaveToStream(MS); + SetLength(Buf, MS.Size); + for i := 0 to MS.Size - 1 do begin + Buf[i] := MS.Memory[i]; + end; + finally + MS.Free; + end; + Result := TObject(Buf); + end; + else + Result := Field.Value; + end; +end; + +procedure DADataAdapter.SetItemValue(Field: TField; Value: TObject); +var + MS: TMemoryStream; + i: integer; +begin + if Value = Convert.DBNull then + Field.Clear + else + case Field.DataType of + ftDateTime, ftDate, ftTime: + Field.Value := Variant(TDateTime(System.DateTime(Value))); + ftBlob: begin; + MS := TMemoryStream.Create; + try + for i := 0 to Length(TBytes(Value)) - 1 do + MS.Write(TBytes(Value)[i]); + TBlobField(Field).LoadFromStream(MS); + finally + MS.Free; + end; + end; + else + Field.Value := Variant(Value); + end; +end; + +function DADataAdapter.ItemToVariant(Field: TField; Value: TObject): Variant; +begin + if VarIsNull(Variant(Value)) then begin + Result := Variant(Convert.DBNull); + Exit; + end; + case Field.DataType of + ftDateTime, ftDate, ftTime: + Result := Variant(TDateTime(System.DateTime(Value))); + else + Result := Variant(Value); + end; +end; + +function DADataAdapter.Fill(Data: DataSet; tableName: string): integer; +var + dataTable: System.Data.DataTable; + dataRow: System.Data.DataRow; + dataColumn: System.Data.DataColumn; + Ind, i: integer; + OldActive: boolean; +begin + CheckTDataSet; + Result := 0; + Ind := Data.Tables.IndexOf(tableName); + if Ind < 0 then + dataTable := Data.Tables.Add(tableName) + else + dataTable := Data.Tables.Item[tableName]; + OldActive := FDataSet.Active; + if not FDataSet.Active then + FDataSet.Open; + try + for i := 0 to FDataSet.Fields.Count - 1 do begin + if not FDataSet.Fields[i].Visible or + (dataTable.Columns.IndexOf(FDataSet.Fields[i].FieldName) >= 0) + then + continue; + dataColumn := dataTable.Columns.Add(FDataSet.Fields[i].FieldName, GetItemType(FDataSet.Fields[i])); + dataColumn.ReadOnly := not FDataSet.Fields[i].CanModify; + end; + + FDataSet.FindFirst; + while not FDataSet.EOF do begin + dataRow := dataTable.NewRow; + for i := 0 to FDataSet.Fields.Count - 1 do + if FDataSet.Fields[i].Visible then + dataRow.set_Item(FDataSet.Fields[i].FieldName, GetItemValue(FDataSet.Fields[i])); + dataTable.Rows.Add(dataRow); + FDataSet.Next; + Inc(Result); + end; + dataTable.AcceptChanges; + finally + FDataSet.Active := OldActive + end; +end; + +function DADataAdapter.Update(Data: DataSet; tableName: string): integer; +var + Ind, i: integer; + dataTable: System.Data.DataTable; + dataRow: System.Data.DataRow; + OldActive: boolean; + + function CompareValues(Obj1, Obj2: TObject): boolean; + var + V1, V2: Variant; + i: integer; + begin + V1 := Variant(Obj1); + V2 := Variant(Obj2); + if VarIsArray(V1) and VarIsArray(V2) then begin + if (VarArrayLowBound(V1, 1) <> VarArrayLowBound(V2, 1)) or + (VarArrayHighBound(V1, 1) <> VarArrayHighBound(V2, 1)) + then begin + Result := False; + Exit; + end; + for i := VarArrayLowBound(V1, 1) to VarArrayHighBound(V1, 1) do begin + if V1[i] <> V2[i] then begin + Result := False; + Exit; + end; + end; + Result := True; + end + else + Result := VarEqual(V1, V2); + end; + + procedure EditRecord; + var + j: integer; + dataColumn: System.Data.DataColumn; + Field: TField; + begin + for j := 0 to dataTable.Columns.Count - 1 do begin + dataColumn := dataTable.Columns.Item[j]; + Field := FDataSet.FieldByName(dataColumn.ColumnName); + if + Field.CanModify and + ((dataRow.RowState = DataRowState.Added) or + not CompareValues(dataRow.get_Item(dataColumn.ColumnName), dataRow.get_Item(dataColumn.ColumnName, DataRowVersion.Original))) + then begin + SetItemValue(Field, dataRow.get_Item(dataColumn.ColumnName)); + end; + end; + end; + + procedure LocateRecord; + var + j: integer; + KeyFields, Keys, St: string; + KeyValues, FinalKeyValues: Variant; + KeyCount: integer; + dataColumn: System.Data.DataColumn; + + procedure AddKeyValue(ColumnName: string); + var + Field: TField; + begin + Field := FDataSet.FieldByName(ColumnName); + if CanLocateField(Field) then begin + if KeyFields <> '' then + KeyFields := KeyFields + ';'; + KeyFields := KeyFields + ColumnName; + KeyValues[KeyCount] := ItemToVariant(Field, dataRow.get_Item(ColumnName, DataRowVersion.Original)); + Inc(KeyCount); + end; + end; + + begin + Keys := Trim(IProviderSupport(FDataSet).PSGetKeyFields); + KeyFields := ''; + KeyCount := 0; + KeyValues := VarArrayCreate([0, dataTable.Columns.Count - 1], varObject); + if Keys <> '' then begin + j := 1; + while True do begin + St := ExtractFieldName(Keys, j); + if St = '' then + break; + AddKeyValue(St); + end; + end + else begin + for j := 0 to dataTable.Columns.Count - 1 do begin + dataColumn := dataTable.Columns.Item[j]; + AddKeyValue(dataColumn.ColumnName); + end; + end; + if KeyCount = 1 then + FinalKeyValues := KeyValues[0] + else + if KeyCount > 1 then + FinalKeyValues := KeyValues + else + raise Exception.Create('Cannot locate record'); + if not FDataSet.Locate(KeyFields, FinalKeyValues, []) then + raise Exception.Create('Cannot locate record'); + end; + +begin + Result := 0; + Ind := Data.Tables.IndexOf(tableName); + if Ind < 0 then + raise Exception.Create('Has no table'); + dataTable := Data.Tables.Item[tableName]; + OldActive := FDataSet.Active; + try + for i := 0 to dataTable.Rows.Count - 1 do begin + dataRow := dataTable.Rows.Item[i]; + case dataRow.RowState of + DataRowState.Added: begin + if not FDataSet.Active then + FDataSet.Open; + FDataSet.Append; + EditRecord; + FDataSet.Post; + Inc(Result); + end; + DataRowState.Deleted: begin + if not FDataSet.Active then + FDataSet.Open; + LocateRecord; + FDataSet.Delete; + Inc(Result); + end; + DataRowState.Modified: begin + if not FDataSet.Active then + FDataSet.Open; + LocateRecord; + FDataSet.Edit; + EditRecord; + FDataSet.Post; + Inc(Result); + end; + end; + end; + dataTable.AcceptChanges; + finally + FDataSet.Active := OldActive; + end; +end; + +end. diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.CRColFrame.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.CRColFrame.pas new file mode 100644 index 0000000..b155810 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.CRColFrame.pas @@ -0,0 +1,6 @@ +{$I ..\Dac.inc} + +unit CoreLab.Dac.Design.CRColFrame; + +{$I ..\Design\CRColFrame.pas} + diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.CRDataEditor.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.CRDataEditor.pas new file mode 100644 index 0000000..8910e42 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.CRDataEditor.pas @@ -0,0 +1,6 @@ +{$I ..\Dac.inc} + +unit CoreLab.Dac.Design.CRDataEditor; + +{$I ..\Design\CRDataEditor.pas} + diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.CREditor.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.CREditor.pas new file mode 100644 index 0000000..46191b4 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.CREditor.pas @@ -0,0 +1,6 @@ +{$I ..\Dac.inc} + +unit CoreLab.Dac.Design.CREditor; + +{$I ..\Design\CREditor.pas} + diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.CRFrame.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.CRFrame.pas new file mode 100644 index 0000000..f98f7d2 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.CRFrame.pas @@ -0,0 +1,6 @@ +{$I ..\Dac.inc} + +unit CoreLab.Dac.Design.CRFrame; + +{$I ..\Design\CRFrame.pas} + diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.CRTabEditor.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.CRTabEditor.pas new file mode 100644 index 0000000..c6b7028 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.CRTabEditor.pas @@ -0,0 +1,6 @@ +{$I ..\Dac.inc} + +unit CoreLab.Dac.Design.CRTabEditor; + +{$I ..\Design\CRTabEditor.pas} + diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DAConnectionEditor.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DAConnectionEditor.pas new file mode 100644 index 0000000..861b0d6 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DAConnectionEditor.pas @@ -0,0 +1,6 @@ +{$I ..\Dac.inc} + +unit CoreLab.Dac.Design.DAConnectionEditor; + +{$I ..\Design\DAConnectionEditor.pas} + diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DADataEditor.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DADataEditor.pas new file mode 100644 index 0000000..51ae122 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DADataEditor.pas @@ -0,0 +1,6 @@ +{$I ..\Dac.inc} + +unit CoreLab.Dac.Design.DADataEditor; + +{$I ..\Design\DADataEditor.pas} + diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DADesign.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DADesign.pas new file mode 100644 index 0000000..9e6c1a4 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DADesign.pas @@ -0,0 +1,7 @@ +{$I ..\Dac.inc} + +unit CoreLab.Dac.Design.DADesign; + +{$I ..\Design\DADesign.pas} + + diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DADesignUtils.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DADesignUtils.pas new file mode 100644 index 0000000..2bb97a2 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DADesignUtils.pas @@ -0,0 +1,6 @@ +{$I ..\Dac.inc} + +unit CoreLab.Dac.Design.DADesignUtils; + +{$I ..\Design\DADesignUtils.pas} + diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DADualListEditor.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DADualListEditor.pas new file mode 100644 index 0000000..cb0f2ca --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DADualListEditor.pas @@ -0,0 +1,8 @@ +{$I ..\Dac.inc} + +unit CoreLab.Dac.Design.DADualListEditor; + +{$I ..\Design\DADualListEditor.pas} + + + diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DADumpEditor.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DADumpEditor.pas new file mode 100644 index 0000000..14289d6 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DADumpEditor.pas @@ -0,0 +1,8 @@ +{$I ..\Dac.inc} + +unit CoreLab.Dac.Design.DADumpEditor; + +{$I ..\Design\DADumpEditor.pas} + + + diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DADumpProgress.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DADumpProgress.pas new file mode 100644 index 0000000..1a2d997 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DADumpProgress.pas @@ -0,0 +1,8 @@ +{$I ..\Dac.inc} + +unit CoreLab.Dac.Design.DADumpProgress; + +{$I ..\Design\DADumpProgress.pas} + + + diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DAMacrosFrame.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DAMacrosFrame.pas new file mode 100644 index 0000000..6ef0e08 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DAMacrosFrame.pas @@ -0,0 +1,6 @@ +{$I ..\Dac.inc} + +unit CoreLab.Dac.Design.DAMacrosFrame; + +{$I ..\Design\DAMacrosFrame.pas} + diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DAMenu.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DAMenu.pas new file mode 100644 index 0000000..27611a5 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DAMenu.pas @@ -0,0 +1,9 @@ +{$I ..\Dac.inc} + +unit CoreLab.Dac.Design.DAMenu; + +{$DEFINE DAMENU_HEADER} +{$I ..\Design\DAMenu.pas} + + + diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DAParamValueEditor.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DAParamValueEditor.pas new file mode 100644 index 0000000..4320810 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DAParamValueEditor.pas @@ -0,0 +1,6 @@ +{$I ..\Dac.inc} + +unit CoreLab.Dac.Design.DAParamValueEditor; + +{$I ..\Design\DAParamValueEditor.pas} + diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DAParamsFrame.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DAParamsFrame.pas new file mode 100644 index 0000000..c1e5185 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DAParamsFrame.pas @@ -0,0 +1,6 @@ +{$I ..\Dac.inc} + +unit CoreLab.Dac.Design.DAParamsFrame; + +{$I ..\Design\DAParamsFrame.pas} + diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DAQueryEditor.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DAQueryEditor.pas new file mode 100644 index 0000000..25caf2d --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DAQueryEditor.pas @@ -0,0 +1,6 @@ +{$I ..\Dac.inc} + +unit CoreLab.Dac.Design.DAQueryEditor; + +{$I ..\Design\DAQueryEditor.pas} + diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DASPCallFrame.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DASPCallFrame.pas new file mode 100644 index 0000000..6911ba4 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DASPCallFrame.pas @@ -0,0 +1,6 @@ +{$I ..\Dac.inc} + +unit CoreLab.Dac.Design.DASPCallFrame; + +{$I ..\Design\DASPCallFrame.pas} + diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DASQLEditor.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DASQLEditor.pas new file mode 100644 index 0000000..a2cbe39 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DASQLEditor.pas @@ -0,0 +1,6 @@ +{$I ..\Dac.inc} + +unit CoreLab.Dac.Design.DASQLEditor; + +{$I ..\Design\DASQLEditor.pas} + diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DASQLFrame.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DASQLFrame.pas new file mode 100644 index 0000000..c20a4d3 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DASQLFrame.pas @@ -0,0 +1,6 @@ +{$I ..\Dac.inc} + +unit CoreLab.Dac.Design.DASQLFrame; + +{$I ..\Design\DASQLFrame.pas} + diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DASQLGeneratorFrame.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DASQLGeneratorFrame.pas new file mode 100644 index 0000000..1f4899a --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DASQLGeneratorFrame.pas @@ -0,0 +1,6 @@ +{$I ..\Dac.inc} + +unit CoreLab.Dac.Design.DASQLGeneratorFrame; + +{$I ..\Design\DASQLGeneratorFrame.pas} + diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DAScriptEditor.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DAScriptEditor.pas new file mode 100644 index 0000000..7aca006 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DAScriptEditor.pas @@ -0,0 +1,6 @@ +{$I ..\Dac.inc} + +unit CoreLab.Dac.Design.DAScriptEditor; + +{$I ..\Design\DAScriptEditor.pas} + diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DAStoredProcEditor.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DAStoredProcEditor.pas new file mode 100644 index 0000000..3bf67a6 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DAStoredProcEditor.pas @@ -0,0 +1,6 @@ +{$I ..\Dac.inc} + +unit CoreLab.Dac.Design.DAStoredProcEditor; + +{$I ..\Design\DAStoredProcEditor.pas} + diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DATableEditor.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DATableEditor.pas new file mode 100644 index 0000000..178f101 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DATableEditor.pas @@ -0,0 +1,6 @@ +{$I ..\Dac.inc} + +unit CoreLab.Dac.Design.DATableEditor; + +{$I ..\Design\DATableEditor.pas} + diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DAUpdateSQLEditor.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DAUpdateSQLEditor.pas new file mode 100644 index 0000000..a54a9ef --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DAUpdateSQLEditor.pas @@ -0,0 +1,6 @@ +{$I ..\Dac.inc} + +unit CoreLab.Dac.Design.DAUpdateSQLEditor; + +{$I ..\Design\DAUpdateSQLEditor.pas} + diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DAUpdateSQLFrame.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DAUpdateSQLFrame.pas new file mode 100644 index 0000000..61ab303 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DAUpdateSQLFrame.pas @@ -0,0 +1,6 @@ +{$I ..\Dac.inc} + +unit CoreLab.Dac.Design.DAUpdateSQLFrame; + +{$I ..\Design\DAUpdateSQLFrame.pas} + diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DBToolsClient.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DBToolsClient.pas new file mode 100644 index 0000000..347d003 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DBToolsClient.pas @@ -0,0 +1,5 @@ +{$I ..\Dac.inc} + +unit CoreLab.Dac.Design.DBToolsClient; + +{$I ..\Design\DBToolsClient.pas} diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DBToolsIntf.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DBToolsIntf.pas new file mode 100644 index 0000000..6826905 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DBToolsIntf.pas @@ -0,0 +1,5 @@ +{$I ..\Dac.inc} + +unit CoreLab.Dac.Design.DBToolsIntf; + +{$I ..\Design\DBToolsIntf.pas} diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DacReg.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DacReg.pas new file mode 100644 index 0000000..05b2ece --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.DacReg.pas @@ -0,0 +1,22 @@ +{$I ..\Dac.inc} + +unit CoreLab.Dac.Design.DacReg; + +{$IFDEF VER10P} + +{$R ..\..\Images\CoreLab.Dac.VirtualTable.TVirtualTable.bmp} +{$R ..\..\Images\CoreLab.Dac.VirtualTable.TVirtualTable16.bmp} +{$R ..\..\Images\CoreLab.Dac.VirtualTable.TVirtualTable32.bmp} +{$R ..\..\Images\CoreLab.Dac.CRBatchMove.TCRBatchMove.bmp} +{$R ..\..\Images\CoreLab.Dac.CRBatchMove.TCRBatchMove16.bmp} +{$R ..\..\Images\CoreLab.Dac.CRBatchMove.TCRBatchMove32.bmp} + +{$ELSE} + +{$R ..\..\Images\Delphi8\CoreLab.Dac.VirtualTable.TVirtualTable.bmp} +{$R ..\..\Images\Delphi8\CoreLab.Dac.CRBatchMove.TCRBatchMove.bmp} + +{$ENDIF} + +{$I ..\Design\DacReg.pas} + diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.Download.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.Download.pas new file mode 100644 index 0000000..1431b1f --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.Download.pas @@ -0,0 +1,5 @@ +{$I ..\Dac.inc} + +unit CoreLab.Dac.Design.Download; + +{$I ..\Design\Download.pas} diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.HelpUtils.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.HelpUtils.pas new file mode 100644 index 0000000..fc6b88b --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.HelpUtils.pas @@ -0,0 +1,7 @@ +{$I ..\Dac.inc} + +unit CoreLab.Dac.Design.HelpUtils; + +{$I ..\Design\HelpUtils.pas} + + diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.VTDataEditor.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.VTDataEditor.pas new file mode 100644 index 0000000..0985240 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.VTDataEditor.pas @@ -0,0 +1,6 @@ +{$I ..\Dac.inc} + +unit CoreLab.Dac.Design.VTDataEditor; + +{$I ..\Design\VTDataEditor.pas} + diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.VTDesign.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.VTDesign.pas new file mode 100644 index 0000000..085d166 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Design.VTDesign.pas @@ -0,0 +1,5 @@ +{$I ..\Dac.inc} + +unit CoreLab.Dac.Design.VTDesign; + +{$I ..\Design\VTDesign.pas} diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.MemDS.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.MemDS.pas new file mode 100644 index 0000000..e15f953 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.MemDS.pas @@ -0,0 +1,5 @@ +{$I ..\Dac.inc} + +unit CoreLab.Dac.MemDS; + +{$I ..\MemDS.pas} \ No newline at end of file diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.MemData.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.MemData.pas new file mode 100644 index 0000000..8663d04 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.MemData.pas @@ -0,0 +1,5 @@ +{$I ..\Dac.inc} + +unit CoreLab.Dac.MemData; + +{$I ..\MemData.pas} \ No newline at end of file diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.MemUtils.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.MemUtils.pas new file mode 100644 index 0000000..7ef0d6c --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.MemUtils.pas @@ -0,0 +1,5 @@ +{$I ..\Dac.inc} + +unit CoreLab.Dac.MemUtils; + +{$I ..\MemUtils.pas} \ No newline at end of file diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.VirtualTable.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.VirtualTable.pas new file mode 100644 index 0000000..70da6b6 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.VirtualTable.pas @@ -0,0 +1,5 @@ +{$I ..\Dac.inc} + +unit CoreLab.Dac.VirtualTable; + +{$I ..\VirtualTable.pas} \ No newline at end of file diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Win32Timer.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Win32Timer.pas new file mode 100644 index 0000000..4b75c2a --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Dac.Win32Timer.pas @@ -0,0 +1,5 @@ +{$I ..\Dac.inc} + +unit Corelab.Dac.Win32Timer; + +{$I ..\Win32Timer.pas} diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.CRThread.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.CRThread.pas new file mode 100644 index 0000000..6a5bef2 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.CRThread.pas @@ -0,0 +1,5 @@ +{$I ..\Sdac.inc} + +unit CoreLab.Sdac.CRThread; + +{$I ..\CRThread.pas} diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.DataAdapter.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.DataAdapter.pas new file mode 100644 index 0000000..4ed5b14 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.DataAdapter.pas @@ -0,0 +1,20 @@ +unit CoreLab.Sdac.DataAdapter; + +interface + +uses + DB, System.Data.Common, System.Data, CoreLab.Dac.DataAdapter, + Variants, System.ComponentModel; + +type + TDataTableArr = array of DataTable; + IDataParameterArr = array of IDataParameter; + + MSDataAdapter = class (DADataAdapter) + published + property DataSet; + end; + +implementation + +end. diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.Design.DataAdapter.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.Design.DataAdapter.pas new file mode 100644 index 0000000..8636f3e --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.Design.DataAdapter.pas @@ -0,0 +1,9 @@ +unit CoreLab.Sdac.Design.DataAdapter; + +interface + +implementation + +{$R ..\..\Images\CoreLab.Sdac.DataAdapter.MSDataAdapter.bmp} + +end. diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.Design.MSConnectionEditor.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.Design.MSConnectionEditor.pas new file mode 100644 index 0000000..561fe66 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.Design.MSConnectionEditor.pas @@ -0,0 +1,7 @@ + +{$I ..\SDac.inc} + +unit CoreLab.SDac.Design.MSConnectionEditor; + +{$I ..\Design\MSConnectionEditor.pas} + diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.Design.MSDesign.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.Design.MSDesign.pas new file mode 100644 index 0000000..c7f8912 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.Design.MSDesign.pas @@ -0,0 +1,8 @@ +{$I ..\Sdac.inc} + +unit CoreLab.Sdac.Design.MSDesign; + +{$I ..\Design\MSDesign.pas} + + + diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.Design.MSDesignUtils.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.Design.MSDesignUtils.pas new file mode 100644 index 0000000..5d19fe8 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.Design.MSDesignUtils.pas @@ -0,0 +1,6 @@ +{$I ..\Sdac.inc} + +unit CoreLab.Sdac.Design.MSDesignUtils; + +{$I ..\Design\MSDesignUtils.pas} + diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.Design.MSDumpEditor.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.Design.MSDumpEditor.pas new file mode 100644 index 0000000..a986c14 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.Design.MSDumpEditor.pas @@ -0,0 +1,8 @@ +{$I ..\Sdac.inc} + +unit CoreLab.Sdac.Design.MSDumpEditor; + +{$I ..\Design\MSDumpEditor.pas} + + + diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.Design.MSMenu.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.Design.MSMenu.pas new file mode 100644 index 0000000..a88900d --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.Design.MSMenu.pas @@ -0,0 +1,8 @@ +{$I ..\Sdac.inc} + +unit CoreLab.Sdac.Design.MSMenu; + +{$I ..\Design\MSMenu.pas} + + + diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.Design.MSNamesEditor.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.Design.MSNamesEditor.pas new file mode 100644 index 0000000..1a495c3 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.Design.MSNamesEditor.pas @@ -0,0 +1,7 @@ + +{$I ..\SDac.inc} + +unit CoreLab.SDac.Design.MSNamesEditor; + +{$I ..\Design\MSNamesEditor.pas} + diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.Design.MSParamsFrame.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.Design.MSParamsFrame.pas new file mode 100644 index 0000000..d712da4 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.Design.MSParamsFrame.pas @@ -0,0 +1,7 @@ + +{$I ..\SDac.inc} + +unit CoreLab.SDac.Design.MSParamsFrame; + +{$I ..\Design\MSParamsFrame.pas} + diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.Design.MSQueryEditor.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.Design.MSQueryEditor.pas new file mode 100644 index 0000000..32d3f8a --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.Design.MSQueryEditor.pas @@ -0,0 +1,7 @@ + +{$I ..\SDac.inc} + +unit CoreLab.SDac.Design.MSQueryEditor; + +{$I ..\Design\MSQueryEditor.pas} + diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.Design.MSReg.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.Design.MSReg.pas new file mode 100644 index 0000000..363b5d4 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.Design.MSReg.pas @@ -0,0 +1,82 @@ +{$I ..\Sdac.inc} + +unit CoreLab.Sdac.Design.MSReg; + +{$IFDEF VER10P} + +{$IFNDEF STD} +{$R ..\..\Images\CoreLab.Dac.CRBatchMove.TCRBatchMove.bmp} +{$R ..\..\Images\CoreLab.Dac.CRBatchMove.TCRBatchMove16.bmp} +{$R ..\..\Images\CoreLab.Dac.CRBatchMove.TCRBatchMove32.bmp} +{$ENDIF} + +{$R ..\..\Images\CoreLab.Sdac.SdacVcl.TMSConnectDialog.bmp} +{$R ..\..\Images\CoreLab.Sdac.MSSQLMonitor.TMSSQLMonitor.bmp} +{$R ..\..\Images\CoreLab.Sdac.MSAccess.TMSUpdateSQL.bmp} +{$R ..\..\Images\CoreLab.Sdac.MSAccess.TMSTable.bmp} +{$R ..\..\Images\CoreLab.Sdac.MSAccess.TMSStoredProc.bmp} +{$R ..\..\Images\CoreLab.Sdac.MSAccess.TMSSQL.bmp} +{$R ..\..\Images\CoreLab.Sdac.MSScript.TMSScript.bmp} +{$R ..\..\Images\CoreLab.Sdac.MSAccess.TMSQuery.bmp} +{$R ..\..\Images\CoreLab.Sdac.MSAccess.TMSMetadata.bmp} +{$R ..\..\Images\CoreLab.Sdac.MSLoader.TMSLoader.bmp} +{$R ..\..\Images\CoreLab.Sdac.MSAccess.TMSConnection.bmp} +{$R ..\..\Images\CoreLab.Sdac.MSAccess.TMSDataSource.bmp} +{$R ..\..\Images\CoreLab.Sdac.MSServiceBroker.TMSServiceBroker.bmp} +{$R ..\..\Images\CoreLab.Sdac.MSDump.TMSDump.bmp} + +{$R ..\..\Images\CoreLab.Sdac.SdacVcl.TMSConnectDialog16.bmp} +{$R ..\..\Images\CoreLab.Sdac.MSSQLMonitor.TMSSQLMonitor16.bmp} +{$R ..\..\Images\CoreLab.Sdac.MSAccess.TMSUpdateSQL16.bmp} +{$R ..\..\Images\CoreLab.Sdac.MSAccess.TMSTable16.bmp} +{$R ..\..\Images\CoreLab.Sdac.MSAccess.TMSStoredProc16.bmp} +{$R ..\..\Images\CoreLab.Sdac.MSAccess.TMSSQL16.bmp} +{$R ..\..\Images\CoreLab.Sdac.MSScript.TMSScript16.bmp} +{$R ..\..\Images\CoreLab.Sdac.MSAccess.TMSQuery16.bmp} +{$R ..\..\Images\CoreLab.Sdac.MSAccess.TMSMetadata16.bmp} +{$R ..\..\Images\CoreLab.Sdac.MSLoader.TMSLoader16.bmp} +{$R ..\..\Images\CoreLab.Sdac.MSAccess.TMSConnection16.bmp} +{$R ..\..\Images\CoreLab.Sdac.MSAccess.TMSDataSource16.bmp} +{$R ..\..\Images\CoreLab.Sdac.MSServiceBroker.TMSServiceBroker16.bmp} +{$R ..\..\Images\CoreLab.Sdac.MSDump.TMSDump16.bmp} + +{$R ..\..\Images\CoreLab.Sdac.SdacVcl.TMSConnectDialog32.bmp} +{$R ..\..\Images\CoreLab.Sdac.MSSQLMonitor.TMSSQLMonitor32.bmp} +{$R ..\..\Images\CoreLab.Sdac.MSAccess.TMSUpdateSQL32.bmp} +{$R ..\..\Images\CoreLab.Sdac.MSAccess.TMSTable32.bmp} +{$R ..\..\Images\CoreLab.Sdac.MSAccess.TMSStoredProc32.bmp} +{$R ..\..\Images\CoreLab.Sdac.MSAccess.TMSSQL32.bmp} +{$R ..\..\Images\CoreLab.Sdac.MSScript.TMSScript32.bmp} +{$R ..\..\Images\CoreLab.Sdac.MSAccess.TMSQuery32.bmp} +{$R ..\..\Images\CoreLab.Sdac.MSAccess.TMSMetadata32.bmp} +{$R ..\..\Images\CoreLab.Sdac.MSLoader.TMSLoader32.bmp} +{$R ..\..\Images\CoreLab.Sdac.MSAccess.TMSConnection32.bmp} +{$R ..\..\Images\CoreLab.Sdac.MSAccess.TMSDataSource32.bmp} +{$R ..\..\Images\CoreLab.Sdac.MSServiceBroker.TMSServiceBroker32.bmp} +{$R ..\..\Images\CoreLab.Sdac.MSDump.TMSDump32.bmp} + + +{$ELSE} + +{$IFNDEF STD} +{$R ..\..\Images\Delphi8\CoreLab.Dac.CRBatchMove.TCRBatchMove.bmp} +{$ENDIF} + +{$R ..\..\Images\Delphi8\CoreLab.Sdac.SdacVcl.TMSConnectDialog.bmp} +{$R ..\..\Images\Delphi8\CoreLab.Sdac.MSSQLMonitor.TMSSQLMonitor.bmp} +{$R ..\..\Images\Delphi8\CoreLab.Sdac.MSAccess.TMSUpdateSQL.bmp} +{$R ..\..\Images\Delphi8\CoreLab.Sdac.MSAccess.TMSTable.bmp} +{$R ..\..\Images\Delphi8\CoreLab.Sdac.MSAccess.TMSStoredProc.bmp} +{$R ..\..\Images\Delphi8\CoreLab.Sdac.MSAccess.TMSSQL.bmp} +{$R ..\..\Images\Delphi8\CoreLab.Sdac.MSScript.TMSScript.bmp} +{$R ..\..\Images\Delphi8\CoreLab.Sdac.MSAccess.TMSQuery.bmp} +{$R ..\..\Images\Delphi8\CoreLab.Sdac.MSAccess.TMSMetadata.bmp} +{$R ..\..\Images\Delphi8\CoreLab.Sdac.MSLoader.TMSLoader.bmp} +{$R ..\..\Images\Delphi8\CoreLab.Sdac.MSAccess.TMSConnection.bmp} +{$R ..\..\Images\Delphi8\CoreLab.Sdac.MSAccess.TMSDataSource.bmp} +{$R ..\..\Images\Delphi8\CoreLab.Sdac.MSServiceBroker.TMSServiceBroker.bmp} +{$R ..\..\Images\Delphi8\CoreLab.Sdac.MSDump.TMSDump.bmp} + +{$ENDIF} + +{$I ..\Design\MSReg.pas} diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.Design.MSSPCallFrame.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.Design.MSSPCallFrame.pas new file mode 100644 index 0000000..696b345 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.Design.MSSPCallFrame.pas @@ -0,0 +1,7 @@ + +{$I ..\SDac.inc} + +unit CoreLab.SDac.Design.MSSPCallFrame; + +{$I ..\Design\MSSPCallFrame.pas} + diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.Design.MSSQLEditor.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.Design.MSSQLEditor.pas new file mode 100644 index 0000000..e372245 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.Design.MSSQLEditor.pas @@ -0,0 +1,7 @@ + +{$I ..\SDac.inc} + +unit CoreLab.SDac.Design.MSSQLEditor; + +{$I ..\Design\MSSQLEditor.pas} + diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.Design.MSStoredProcEditor.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.Design.MSStoredProcEditor.pas new file mode 100644 index 0000000..f955b1b --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.Design.MSStoredProcEditor.pas @@ -0,0 +1,7 @@ + +{$I ..\SDac.inc} + +unit CoreLab.SDac.Design.MSStoredProcEditor; + +{$I ..\Design\MSStoredProcEditor.pas} + diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.Design.MSUpdateSQLEditor.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.Design.MSUpdateSQLEditor.pas new file mode 100644 index 0000000..3d44d5f --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.Design.MSUpdateSQLEditor.pas @@ -0,0 +1,7 @@ + +{$I ..\SDac.inc} + +unit CoreLab.SDac.Design.MSUpdateSQLEditor; + +{$I ..\Design\MSUpdateSQLEditor.pas} + diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.Design.SdacAbout.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.Design.SdacAbout.pas new file mode 100644 index 0000000..0d2e77e --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.Design.SdacAbout.pas @@ -0,0 +1,8 @@ +{$I ..\Sdac.inc} + +unit CoreLab.Sdac.Design.SdacAbout; + +{$I ..\Design\SdacAbout.pas} + + + diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.MSAccess.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.MSAccess.pas new file mode 100644 index 0000000..23bfd20 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.MSAccess.pas @@ -0,0 +1,5 @@ +{$I ..\Sdac.inc} + +unit CoreLab.Sdac.MSAccess; + +{$I ..\MSAccess.pas} diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.MSConnectForm.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.MSConnectForm.pas new file mode 100644 index 0000000..f69c291 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.MSConnectForm.pas @@ -0,0 +1,5 @@ +{$I ..\Sdac.inc} + +unit CoreLab.Sdac.MSConnectForm; + +{$I ..\MSConnectForm.pas} \ No newline at end of file diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.MSConnectionPool.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.MSConnectionPool.pas new file mode 100644 index 0000000..6651de0 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.MSConnectionPool.pas @@ -0,0 +1,5 @@ +{$I ..\Sdac.inc} + +unit CoreLab.Sdac.MSConnectionPool; + +{$I ..\MSConnectionPool.pas} \ No newline at end of file diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.MSConsts.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.MSConsts.pas new file mode 100644 index 0000000..7a755c8 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.MSConsts.pas @@ -0,0 +1,5 @@ +{$I ..\Sdac.inc} + +unit CoreLab.Sdac.MSConsts; + +{$I ..\MSConsts.pas} \ No newline at end of file diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.MSDump.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.MSDump.pas new file mode 100644 index 0000000..6b649cf --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.MSDump.pas @@ -0,0 +1,5 @@ +{$I ..\Sdac.inc} + +unit CoreLab.Sdac.MSDump; + +{$I ..\MSDump.pas} \ No newline at end of file diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.MSLoader.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.MSLoader.pas new file mode 100644 index 0000000..19eade4 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.MSLoader.pas @@ -0,0 +1,5 @@ +{$I ..\Sdac.inc} + +unit CoreLab.Sdac.MSLoader; + +{$I ..\MSLoader.pas} \ No newline at end of file diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.MSParser.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.MSParser.pas new file mode 100644 index 0000000..e57e873 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.MSParser.pas @@ -0,0 +1,5 @@ +{$I ..\Sdac.inc} + +unit CoreLab.Sdac.MSParser; + +{$I ..\MSParser.pas} \ No newline at end of file diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.MSSQLMonitor.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.MSSQLMonitor.pas new file mode 100644 index 0000000..edb4a48 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.MSSQLMonitor.pas @@ -0,0 +1,8 @@ +{$I ..\Sdac.inc} + +unit CoreLab.Sdac.MSSQLMonitor; + +{$I ..\MSSQLMonitor.pas} + + + diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.MSScript.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.MSScript.pas new file mode 100644 index 0000000..5abd1e7 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.MSScript.pas @@ -0,0 +1,8 @@ + +{$I ..\SDac.inc} + +unit CoreLab.Sdac.MSScript; + +{$I ..\MSScript.pas} + + diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.MSServiceBroker.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.MSServiceBroker.pas new file mode 100644 index 0000000..e3aaf30 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.MSServiceBroker.pas @@ -0,0 +1,5 @@ +{$I ..\Sdac.inc} + +unit CoreLab.Sdac.MSServiceBroker; + +{$I ..\MSServiceBroker.pas} diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.OLEDBAccess.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.OLEDBAccess.pas new file mode 100644 index 0000000..1395abd --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.OLEDBAccess.pas @@ -0,0 +1,5 @@ +{$I ..\Sdac.inc} + +unit CoreLab.Sdac.OLEDBAccess; + +{$I ..\OLEDBAccess.pas} \ No newline at end of file diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.OLEDBC.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.OLEDBC.pas new file mode 100644 index 0000000..aaf320e --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.OLEDBC.pas @@ -0,0 +1,5 @@ +{$I ..\Sdac.inc} + +unit CoreLab.Sdac.OLEDBC; + +{$I ..\OLEDBC.pas} \ No newline at end of file diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.OLEDBIntf.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.OLEDBIntf.pas new file mode 100644 index 0000000..3f43a59 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.OLEDBIntf.pas @@ -0,0 +1,1356 @@ +{$I ..\Sdac.inc} + +unit CoreLab.Sdac.OLEDBIntf; + +interface + +uses + MemUtils, OLEDBC, + ActiveX, System.Runtime.InteropServices, Variants, Windows; + +const + STGM_READ = $00000000; + +type + IUnknown = System.Object; // ++ should move to MemUtils + TUintArray = array of UINT; + PUintArray = IntPtr; + PPByteArray = IntPtr; + PPOleStr = IntPtr; + PCoServerInfo = IntPtr; + PMultiQI = IntPtr; + + PUINT = IntPtr; + PDWORD = IntPtr; + PLongint = IntPtr; + + OleStr = string; + POleStrList = IntPtr; + + [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Auto)] + DBTIMESTAMP = packed record + year: Smallint; + month: Word; + day: Word; + hour: Word; + minute: Word; + second: Word; + fraction: UINT; + end; + TDBTimeStamp = DBTIMESTAMP; + {$EXTERNALSYM DBTIMESTAMP} + +type + [ComImport, GuidAttribute('1CF2B120-547D-101B-8E65-08002B2BD119'), InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] + IErrorInfo = interface + [PreserveSig] + function GetGUID(out guid: TGUID): HResult; + [PreserveSig] + function GetSource(out bstrSource: WideString): HResult; + [PreserveSig] + function GetDescription(out bstrDescription: WideString): HResult; + [PreserveSig] + function GetHelpFile(out bstrHelpFile: WideString): HResult; + [PreserveSig] + function GetHelpContext(out dwHelpContext: Longint): HResult; + end; + + PBoid = IntPtr; + [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Auto)] + BOID = packed record + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16, ArraySubType = UnmanagedType.U1)] + rgb_: array[0..15] of Byte; + end; + TBoid = BOID; + {$EXTERNALSYM BOID} + + [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Auto)] + XACTTRANSINFO = packed record + uow: BOID; + isoLevel: Integer; + isoFlags: UINT; + grfTCSupported: UINT; + grfRMSupported: UINT; + grfTCSupportedRetaining: UINT; + grfRMSupportedRetaining: UINT; + end; + TXactTransInfo = XACTTRANSINFO; + {$EXTERNALSYM XACTTRANSINFO} + + [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Auto)] + XACTOPT = packed record + ulTimeout: UINT; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 40, ArraySubType = UnmanagedType.I1)] + szDescription: array[0..39] of Shortint; + end; + TXActOpt = XACTOPT; + {$EXTERNALSYM XACTOPT} + + [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Auto)] + XACTSTATS = packed record + cOpen: UINT; + cCommitting: UINT; + cCommitted: UINT; + cAborting: UINT; + cAborted: UINT; + cInDoubt: UINT; + cHeuristicDecision: UINT; + timeTransactionsUp: FILETIME; + end; + TXactStats = XACTSTATS; + {$EXTERNALSYM XACTSTATS} + + PDBBindExt = IntPtr; + [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Auto)] + DBBINDEXT = packed record + pExtension: IntPtr; // PByte; + ulExtension: UINT; + end; + TDBBindExt = DBBINDEXT; + {$EXTERNALSYM DBBINDEXT} + + [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Auto)] + DBOBJECT = packed record + dwFlags: UINT; + [MarshalAs(UnmanagedType.Struct)] + iid: TGUID; + end; + TDBObject = DBOBJECT; + {$EXTERNALSYM DBOBJECT} + + PDBBinding = IntPtr; + [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Auto)] + DBBINDING = packed record + iOrdinal: UINT; + obValue: UINT; + obLength: UINT; + obStatus: UINT; + pTypeInfo: IntPtr; // IUnknown; + pObject: IntPtr; // PDBObject; + pBindExt: IntPtr; // PDBBindExt; + dwPart: DBPART; + dwMemOwner: DBMEMOWNER; + eParamIO: DBPARAMIO; + cbMaxLen: UINT; + dwFlags: UINT; + wType: DBTYPE; + bPrecision: Byte; + bScale: Byte; + end; + TDBBinding = DBBINDING; +{ $IFNDEF VER125} + { $EXTERNALSYM DBBINDING} +{ $ENDIF} + + PDBBindingArray = IntPtr; + TDBBindingArray = packed array of TDBBinding; + + [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Auto)] + DBIDNAME = record + [MarshalAs(UnmanagedType.LPWStr)] + pwszName: PWideChar; + end; + TDBIDName = DBIDNAME; + + [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Auto)] + DBIDGUID = record + guid: TGUID; + end; + TDBIDGuid = DBIDGUID; + + DBPROPID = UINT; + {$EXTERNALSYM DBPROPID} + PDBPROPID = IntPtr; + PDBPropIDArray = IntPtr; + TDBPropIDArray = array[0..MAXBOUND] of DBPROPID; + + PDBID = IntPtr; + [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Auto)] + DBID = packed record + uGuid: DBIDGUID; + eKind: DBKIND; + uName: IntPtr; // DBIDNAME; + end; + TDBID = DBID; + {$EXTERNALSYM DBID} + + _DBID = array [0..23] of byte; + + PDBIDArray = IntPtr; + TDBIDArray = array[0..MAXBOUND] of TDBID; + + PDBPropIDSet = IntPtr; + [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Auto)] + DBPROPIDSET = packed record + rgPropertyIDs: IntPtr; // PDBPropIDArray; + cPropertyIDs: UINT; + guidPropertySet: TGUID; + end; + TDBPropIDSet = DBPROPIDSET; + {$EXTERNALSYM DBPROPIDSET} + + PDBPropIDSetArray = IntPtr; + TDBPropIDSetArray = array[0..MAXBOUND] of TDBPropIDSet; + + PDBProp = packed record + private + Ptr: IntPtr; + + function GetdwPropertyID: DBPROPID; + procedure SetdwPropertyID(Value: DBPROPID); + + function GetdwOptions: DBPROPOPTIONS; + procedure SetdwOptions(Value: DBPROPOPTIONS); + + function GetdwStatus: DBPROPSTATUS; + procedure SetdwStatus(Value: DBPROPSTATUS); + + function Getcolid: _DBID; + procedure Setcolid(Value: _DBID); + + function GetvValue: OleVariant; + procedure SetvValue(Value: OleVariant); + + public + property dwPropertyID: DBPROPID read GetdwPropertyID write SetdwPropertyID; + property dwOptions: DBPROPOPTIONS read GetdwOptions write SetdwOptions; + property dwStatus: DBPROPSTATUS read GetdwStatus write SetdwStatus; + property colid: _DBID read Getcolid write Setcolid; + property vValue: OleVariant read GetvValue write SetvValue; + + class operator Implicit(AValue: IntPtr): PDBProp; + class operator Implicit(AValue: PDBProp): IntPtr; + end; + + [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Auto)] + DBPROP = packed record + dwPropertyID: DBPROPID; + dwOptions: DBPROPOPTIONS; + dwStatus: DBPROPSTATUS; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 24, ArraySubType = UnmanagedType.U1)] + colid: _DBID; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16, ArraySubType = UnmanagedType.U1)] // ?? + vValue: OleVariant; + end; + TDBProp = DBPROP; + {$EXTERNALSYM DBPROP} + + PDBPropArray = IntPtr; + TDBPropArray = array[0..MAXBOUND] of TDBProp; + + + PPDBPropSet = IntPtr; + + PDBPropSet = packed record + private + Ptr: IntPtr; + + function GetrgProperties: PDBPropArray; + procedure SetrgProperties(Value: PDBPropArray); + + function GetcProperties: UINT; + procedure SetcProperties(Value: UINT); + + function GetguidPropertySet: TGUID; + procedure SetguidPropertySet(Value: TGUID); + + public + property rgProperties: PDBPropArray read GetrgProperties write SetrgProperties; + property cProperties: UINT read GetcProperties write SetcProperties; + property guidPropertySet: TGUID read GetguidPropertySet write SetguidPropertySet; + + class operator Implicit(AValue: IntPtr): PDBPropSet; + class operator Implicit(AValue: PDBPropSet): IntPtr; + end; + + [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Auto)] + DBPROPSET = packed record + rgProperties: PDBPropArray; + cProperties: UINT; + [MarshalAs(UnmanagedType.Struct)] + guidPropertySet: TGUID; + end; + TDBPropSet = DBPROPSET; + {$EXTERNALSYM DBPROPSET} + + PDBPropSetArray = IntPtr; + TDBPropSetArray = array[0..MAXBOUND] of TDBPropSet; + + PDBPropInfo = IntPtr; + [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Auto)] + DBPROPINFO = packed record + [MarshalAs(UnmanagedType.LPWStr)] + pwszDescription: PWideChar; + dwPropertyID: DBPROPID; + dwFlags: DBPROPFLAGS; + vtType: Word; + vValues: OleVariant; + end; + TDBPropInfo = DBPROPINFO; + {$EXTERNALSYM DBPROPINFO} + + PDBPropInfoArray = IntPtr; + TDBPropInfoArray = array[0..MAXBOUND] of TDBPropInfo; + + PDBPropInfoSet = IntPtr; +(* + PDBPropInfoSet = ^TDBPropInfoSet; + [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Auto)] + DBPROPINFOSET = packed record + rgPropertyInfos: PDBPropInfoArray; + cPropertyInfos: UINT; + guidPropertySet: TGUID; + end; + TDBPropInfoSet = DBPROPINFOSET; + {$EXTERNALSYM DBPROPINFOSET} + *) + + PDBParams = IntPtr; + [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Auto)] + DBPARAMS = packed record + pData: IntPtr; + cParamSets: UINT; + HACCESSOR: HACCESSOR; + end; + TDBParams = DBPARAMS; + {$EXTERNALSYM DBPARAMS} + + PDBColumnInfo = IntPtr; + [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Auto)] + DBCOLUMNINFO = packed record + [MarshalAs(UnmanagedType.LPWStr)] + pwszName: PWideChar; + pTypeInfo: IntPtr; + iOrdinal: UINT; + dwFlags: DBCOLUMNFLAGS; + ulColumnSize: UINT; + wType: DBTYPE; + bPrecision: Byte; + bScale: Byte; + columnid: DBID; + end; + TDBColumnInfo = DBCOLUMNINFO; + {$EXTERNALSYM DBCOLUMNINFO} + + PDBColumnInfoArray = IntPtr; + TDBColumnInfoArray = array[0..MAXCOLS] of TDBColumnInfo; + + PDBLiteralInfo = IntPtr; + [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Auto)] + DBLITERALINFO = packed record + [MarshalAs(UnmanagedType.LPWStr)] + pwszLiteralValue: PWideChar; + [MarshalAs(UnmanagedType.LPWStr)] + pwszInvalidChars: PWideChar; + [MarshalAs(UnmanagedType.LPWStr)] + pwszInvalidStartingChars: PWideChar; + lt: UINT; + fSupported: BOOL; + cchMaxLen: UINT; + end; + TDBLiteralInfo = DBLITERALINFO; + {$EXTERNALSYM DBLITERALINFO} + + PDBLiteralInfoArray = IntPtr; + TDBLiteralInfoArray = array[0..MAXBOUND] of TDBLiteralInfo; + + PDBColumnDesc = IntPtr; + [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Auto)] + DBCOLUMNDESC = packed record + [MarshalAs(UnmanagedType.LPWStr)] + pwszTypeName: PWideChar; + pTypeInfo: IntPtr; + rgPropertySets: IntPtr; + pclsid: IntPtr; + cPropertySets: UINT; + ulColumnSize: UINT; + dbcid: DBID; + wType: DBTYPE; + bPrecision: Byte; + bScale: Byte; + end; + TDBColumnDesc = DBCOLUMNDESC; + {$EXTERNALSYM DBCOLUMNDESC} + + PErrorInfo = IntPtr; + [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Auto)] + ERRORINFO = packed record + hrError: HResult; + dwMinor: UINT; + clsid: TGUID; + iid: TGUID; + dispid: Integer; + end; + TErrorInfo = ERRORINFO; + {$EXTERNALSYM ERRORINFO} + + PDBParamInfo = IntPtr; +(* PDBParamInfo = ^TDBParamInfo; + DBPARAMINFO = packed record + dwFlags: DBPARAMFLAGS; + iOrdinal: UINT; + pwszName: PWideChar; + pTypeInfo: ITypeInfo; + ulParamSize: UINT; + wType: DBTYPE; + bPrecision: Byte; + bScale: Byte; + end; + TDBParamInfo = DBPARAMINFO; + {$EXTERNALSYM DBPARAMINFO}*) + + PDBParamBindInfo = IntPtr; + [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Auto)] + DBPARAMBINDINFO = packed record + pwszDataSourceType: IntPtr; + pwszName: IntPtr; + ulParamSize: UINT; + dwFlags: DBPARAMFLAGS; + bPrecision: Byte; + bScale: Byte; + end; + TDBParamBindInfo = DBPARAMBINDINFO; + {$EXTERNALSYM DBPARAMBINDINFO} + + PDBParamBindInfoArray = IntPtr; + TDBParamBindInfoArray = array[0..MAXBOUND] of TDBParamBindInfo; + + PDBNumeric = IntPtr; + [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Auto)] + DB_NUMERIC = packed record + precision: Byte; + scale: Byte; + sign: Byte; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16, ArraySubType = UnmanagedType.U1)] + val: array[0..15] of Byte; + end; + TDBNumeric = DB_NUMERIC; + {$EXTERNALSYM DB_NUMERIC} +const + SizeOfTDBNumeric = 19; +// *********************************************************************// +// DBID Values +// *********************************************************************// + +var + DB_NULLID: _DBID = ($00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $01, $00, $00, $00, $00, $00, $00, $00); + +type + TVariantArray = array [0..0] of OleVariant; + PVariantArray = IntPtr; + + TGUIDArray = array [0..0] of TGUID; + PGUIDArray = IntPtr; + +// *********************************************************************// +// Interface: ITransaction +// GUID: {0FB15084-AF41-11CE-BD2B-204C4F4F5020} +// *********************************************************************// +{$IFNDEF VER6P} + {$NODEFINE ITransaction} +{$ENDIF} + [ComImport, GuidAttribute('0FB15084-AF41-11CE-BD2B-204C4F4F5020'), InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] + ITransaction = interface + [PreserveSig] + function Commit(fRetaining: BOOL; grfTC: UINT; grfRM: UINT): HResult; + [PreserveSig] + function Abort(pboidReason: PBOID; fRetaining: BOOL; fAsync: BOOL): HResult; + [PreserveSig] + function GetTransactionInfo(out pinfo: XACTTRANSINFO): HResult; + end; + +// *********************************************************************// +// Interface: ITransactionOptions +// GUID: {3A6AD9E0-23B9-11CF-AD60-00AA00A74CCD} +// *********************************************************************// + [ComImport, GuidAttribute('3A6AD9E0-23B9-11CF-AD60-00AA00A74CCD'), InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] + ITransactionOptions = interface + [PreserveSig] + function SetOptions(var pOptions: XACTOPT): HResult; + [PreserveSig] + function GetOptions(var pOptions: XACTOPT): HResult; + end; + +// *********************************************************************// +// Interface: IAccessor +// GUID: {0C733A8C-2A1C-11CE-ADE5-00AA0044773D} +// *********************************************************************// + [ComImport, GuidAttribute('0C733A8C-2A1C-11CE-ADE5-00AA0044773D'), InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] + IAccessor = interface + [PreserveSig] + function AddRefAccessor( + HACCESSOR: HACCESSOR; + [Out, MarshalAs(UnmanagedType.U4)] + out pcRefCount: UINT): HResult; + [PreserveSig] + function CreateAccessor( + dwAccessorFlags: UINT; + cBindings: UINT; + rgBindings: PDBBindingArray; + cbRowSize: UINT; + var phAccessor: HACCESSOR; + rgStatus: PUintArray + ): HResult; + [PreserveSig] + function GetBindings(HACCESSOR: HACCESSOR; + [Out, MarshalAs(UnmanagedType.U4)] + out pdwAccessorFlags: UINT; + var pcBindings: UINT; + out prgBindings: PDBBinding): HResult; + [PreserveSig] + function ReleaseAccessor(HACCESSOR: HACCESSOR; + pcRefCount: PUINT): HResult; + end; + +// *********************************************************************// +// Interface: IRowset +// GUID: {0C733A7C-2A1C-11CE-ADE5-00AA0044773D} +// *********************************************************************// + [ComImport, GuidAttribute('0C733A7C-2A1C-11CE-ADE5-00AA0044773D'), InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] + IRowset = interface + [PreserveSig] + function AddRefRows(cRows: UINT; rghRows: PUintArray; rgRefCounts: PUintArray; + rgRowStatus: PUintArray): HResult; + [PreserveSig] + function GetData(HROW: HROW; HACCESSOR: HACCESSOR; pData: IntPtr): HResult; + [PreserveSig] + function GetNextRows(hReserved: HCHAPTER; lRowsOffset: Integer; cRows: Integer; + out pcRowsObtained: UINT; var prghRows: PUintArray): HResult; + [PreserveSig] + function ReleaseRows( + cRows: UINT; + rghRows: PUintArray; + rgRowOptions, + rgRefCounts, + rgRowStatus: PUintArray): HResult; + [PreserveSig] + function RestartPosition(hReserved: HCHAPTER): HResult; + end; + +// *********************************************************************// +// Interface: IRowsetInfo +// GUID: {0C733A55-2A1C-11CE-ADE5-00AA0044773D} +// *********************************************************************// + [ComImport, GuidAttribute('0C733A55-2A1C-11CE-ADE5-00AA0044773D'), InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] + IRowsetInfo = interface + [PreserveSig] + function GetProperties(cPropertyIDSets: UINT; rgPropertyIDSets: PDBPropIDSetArray; + out pcPropertySets: UINT; out prgPropertySets: PDBPropSet): HResult; + [PreserveSig] + function GetReferencedRowset(iOrdinal: UINT; + [In, MarshalAs(UnmanagedType.LPStruct)] + const riid: TGUID; + [Out, MarshalAs(UnmanagedType.IUnknown)] + out ppReferencedRowset: IUnknown): HResult; + [PreserveSig] + function GetSpecification( + [In, MarshalAs(UnmanagedType.LPStruct)] + const riid: TGUID; + [Out, MarshalAs(UnmanagedType.IUnknown)] + out ppSpecification: IUnknown): HResult; + end; + +// *********************************************************************// +// Interface: IRowsetLocate +// GUID: {0C733A7D-2A1C-11CE-ADE5-00AA0044773D} +// *********************************************************************// + [ComImport, GuidAttribute('0C733A7D-2A1C-11CE-ADE5-00AA0044773D'), InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] + IRowsetLocate = interface + // IRowset + [PreserveSig] + function AddRefRows(cRows: UINT; rghRows: PUintArray; rgRefCounts: PUintArray; + rgRowStatus: PUintArray): HResult; + [PreserveSig] + function GetData(HROW: HROW; HACCESSOR: HACCESSOR; pData: IntPtr): HResult; + [PreserveSig] + function GetNextRows(hReserved: HCHAPTER; lRowsOffset: Integer; cRows: Integer; + out pcRowsObtained: UINT; var prghRows: PUintArray): HResult; + [PreserveSig] + function ReleaseRows(cRows: UINT; rghRows: PUintArray; rgRowOptions, + rgRefCounts, rgRowStatus: PUintArray): HResult; + [PreserveSig] + function RestartPosition(hReserved: HCHAPTER): HResult; + + // IRowsetLocate + [PreserveSig] + function Compare(hReserved: HCHAPTER; cbBookmark1: UINT; pBookmark1: IntPtr; + cbBookmark2: UINT; pBookmark2: IntPtr; out pComparison: UINT): HResult; + [PreserveSig] + function GetRowsAt( + hReserved1: HWATCHREGION; + hReserved2: HCHAPTER; + cbBookmark: UINT; + pBookmark: IntPtr; + lRowsOffset: Integer; + cRows: Integer; + out pcRowsObtained: UINT; + var prghRows: PUintArray): HResult; + [PreserveSig] + function GetRowsByBookmark(hReserved: HCHAPTER; cRows: UINT; rgcbBookmarks: PUintArray; + rgpBookmarks: PPByteArray; rghRows, rgRowStatus: PUintArray): HResult; + [PreserveSig] + function Hash(hReserved: HCHAPTER; cBookmarks: UINT; rgcbBookmarks: PUintArray; + rgpBookmarks: PPByteArray; rgHashedValues, + rgBookmarkStatus: PUintArray): HResult; + end; + +// *********************************************************************// +// Interface: IRowsetChange +// GUID: {0C733A05-2A1C-11CE-ADE5-00AA0044773D} +// *********************************************************************// + [ComImport, GuidAttribute('0C733A05-2A1C-11CE-ADE5-00AA0044773D'), InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] + IRowsetChange = interface + [PreserveSig] + function DeleteRows(hReserved: HCHAPTER; cRows: UINT; rghRows: PUintArray; + rgRowStatus: PUintArray): HResult; + [PreserveSig] + function SetData(HROW: HROW; HACCESSOR: HACCESSOR; pData: IntPtr): HResult; + [PreserveSig] + function InsertRow(hReserved: HCHAPTER; HACCESSOR: HACCESSOR; pData: IntPtr; + out phRow: HROW): HResult; + end; + +// *********************************************************************// +// Interface: IRowsetUpdate +// GUID: {0C733A6D-2A1C-11CE-ADE5-00AA0044773D} +// *********************************************************************// + [ComImport, GuidAttribute('0C733A6D-2A1C-11CE-ADE5-00AA0044773D'), InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] + IRowsetUpdate = interface + // IRowsetChange + [PreserveSig] + function DeleteRows(hReserved: HCHAPTER; cRows: UINT; rghRows: PUintArray; + rgRowStatus: PUintArray): HResult; + [PreserveSig] + function SetData(HROW: HROW; HACCESSOR: HACCESSOR; pData: IntPtr): HResult; + [PreserveSig] + function InsertRow(hReserved: HCHAPTER; HACCESSOR: HACCESSOR; pData: IntPtr; + out phRow: HROW): HResult; + + // IRowsetUpdate + [PreserveSig] + function GetOriginalData(HROW: HROW; HACCESSOR: HACCESSOR; pData: IntPtr): HResult; + [PreserveSig] + function GetPendingRows(hReserved: HCHAPTER; dwRowStatus: DBPENDINGSTATUS; + [Out, MarshalAs(UnmanagedType.U4)] + out pcPendingRows: UINT; + prgPendingRows: PPHROW; prgPendingStatus: PPDBPENDINGSTATUS): HResult; + [PreserveSig] + function GetRowStatus(hReserved: HCHAPTER; + [Out, MarshalAs(UnmanagedType.U4)] + out cRows: UINT; + rghRows: PUintArray; + rgPendingStatus: PUintArray): HResult; + [PreserveSig] + function Undo( + hReserved: HCHAPTER; + cRows: UINT; + rghRows: PUintArray; + pcRowsUndone: PUINT; + prgRowsUndone: PPHROW; + prgRowStatus: PPDBROWSTATUS + ): HResult; + [PreserveSig] + function Update( + hReserved: HCHAPTER; + cRows: UINT; + rghRows: PUintArray; + pcRows: PUINT; + prgRows: PPHROW; + out prgRowStatus: PDBROWSTATUS + ): HResult; + end; + +// *********************************************************************// +// Interface: IMultipleResults +// GUID: {0C733A90-2A1C-11CE-ADE5-00AA0044773D} +// *********************************************************************// + [ComImport, GuidAttribute('0C733A90-2A1C-11CE-ADE5-00AA0044773D'), InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] + IMultipleResults = interface + [PreserveSig] + function GetResult( + [In, MarshalAs(UnmanagedType.IUnknown)] + const punkOuter: IUnknown; + reserved: Integer; + [In, MarshalAs(UnmanagedType.LPStruct)] + const riid: TGUID; + [Out, MarshalAs(UnmanagedType.U4)] + out pcRowsAffected: Integer; + [Out, MarshalAs(UnmanagedType.Interface)] + out ppRowset: IUnknown): HResult; + end; + +// *********************************************************************// +// Interface: ICommandPrepare +// GUID: {0C733A26-2A1C-11CE-ADE5-00AA0044773D} +// *********************************************************************// + [ComImport, GuidAttribute('0C733A26-2A1C-11CE-ADE5-00AA0044773D'), InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] + ICommandPrepare = interface + [PreserveSig] + function Prepare(cExpectedRuns: UINT): HResult; + [PreserveSig] + function Unprepare: HResult; + end; + +// *********************************************************************// +// Interface: ICommandProperties +// GUID: {0C733A79-2A1C-11CE-ADE5-00AA0044773D} +// *********************************************************************// + + [ComImport, GuidAttribute('0C733A79-2A1C-11CE-ADE5-00AA0044773D'), InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] + ICommandProperties = interface + [PreserveSig] + function GetProperties(cPropertyIDSets: UINT; rgPropertyIDSets: PDBPropIDSetArray; + var pcPropertySets: UINT; out prgPropertySets: PDBPropSet): HResult; + [PreserveSig] + function SetProperties(cPropertySets: UINT; rgPropertySets: PDBPropSetArray): HResult; + end; + +// *********************************************************************// +// Interface: ICommand +// GUID: {0C733A63-2A1C-11CE-ADE5-00AA0044773D} +// *********************************************************************// + [ComImport, GuidAttribute('0C733A63-2A1C-11CE-ADE5-00AA0044773D'), InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] + ICommand = interface + [PreserveSig] + function Cancel: HResult; + [PreserveSig] + function Execute( + [In, MarshalAs(UnmanagedType.IUnknown)] + const punkOuter: IUnknown; + [In, MarshalAs(UnmanagedType.LPStruct)] + const riid: TGUID; + var pParams: DBPARAMS; + [Out, MarshalAs(UnmanagedType.I4)] + out pcRowsAffected: Integer; + [Out, MarshalAs(UnmanagedType.Interface)] + out ppRowset: IUnknown): HResult; + [PreserveSig] + function GetDBSession( + [In, MarshalAs(UnmanagedType.LPStruct)] + const riid: TGUID; + [Out, MarshalAs(UnmanagedType.IUnknown)] + out ppSession: IUnknown): HResult; + end; + +// *********************************************************************// +// Interface: ICommandText +// GUID: {0C733A27-2A1C-11CE-ADE5-00AA0044773D} +// *********************************************************************// + [ComImport, GuidAttribute('0C733A27-2A1C-11CE-ADE5-00AA0044773D'), InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] + ICommandText = interface(ICommand) + [PreserveSig] + function Cancel: HResult; + [PreserveSig] + function Execute( + [In, MarshalAs(UnmanagedType.IUnknown)] + const punkOuter: IUnknown; + [In, MarshalAs(UnmanagedType.LPStruct)] + const riid: TGUID; + var pParams: DBPARAMS; + [Out, MarshalAs(UnmanagedType.I4)] + out pcRowsAffected: Integer; + [Out, MarshalAs(UnmanagedType.Interface)] + out ppRowset: IUnknown): HResult; + [PreserveSig] + function GetDBSession( + [In, MarshalAs(UnmanagedType.LPStruct)] + const riid: TGUID; + [Out, MarshalAs(UnmanagedType.IUnknown)] + out ppSession: IUnknown): HResult; + + [PreserveSig] + function GetCommandText( // WANING! System.Data.Common.UnsafeNativeMethods.GetCommandText has no parameters! + [MarshalAs(UnmanagedType.LPStruct)] + var pguidDialect: TGUID; + out ppwszCommand: IntPtr): HResult; + [PreserveSig] + function SetCommandText( + [In, MarshalAs(UnmanagedType.LPStruct)] + const rguidDialect: TGUID; + [In, MarshalAs(UnmanagedType.LPWStr)] + const pwszCommand: string): HResult; + end; + +// *********************************************************************// +// Interface: ICommandWithParameters +// GUID: {0C733A64-2A1C-11CE-ADE5-00AA0044773D} +// *********************************************************************// + [ComImport, GuidAttribute('0C733A64-2A1C-11CE-ADE5-00AA0044773D'), InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] + ICommandWithParameters = interface + [PreserveSig] + function GetParameterInfo( + [Out, MarshalAs(UnmanagedType.I4)] + var pcParams: UINT32; + out prgParamInfo: PDBPARAMINFO; + ppNamesBuffer: PPOleStr): HResult; + [PreserveSig] + function MapParameterNames( + cParamNames: UINT; + rgParamNames: POleStrList; + rgParamOrdinals: PUintArray): HResult; + [PreserveSig] + function SetParameterInfo( + cParams: UINT; + rgParamOrdinals: PUintArray; + rgParamBindInfo: PDBParamBindInfoArray): HResult; + end; + +// *********************************************************************// +// Interface: IColumnsRowset +// GUID: {0C733A10-2A1C-11CE-ADE5-00AA0044773D} +// *********************************************************************// + [ComImport, GuidAttribute('0C733A10-2A1C-11CE-ADE5-00AA0044773D'), InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] + IColumnsRowset = interface + [PreserveSig] + function GetAvailableColumns(var pcOptColumns: UINT; + var prgOptColumns: PDBID): HResult; + [PreserveSig] + function GetColumnsRowset( + [In, MarshalAs(UnmanagedType.IUnknown)] + const punkOuter: IUnknown; + cOptColumns: UINT; + rgOptColumns: PDBIDArray; + [In, MarshalAs(UnmanagedType.LPStruct)] + const riid: TGUID; + cPropertySets: UINT; + rgPropertySets: PDBPropSetArray; + [Out, MarshalAs(UnmanagedType.IUnknown)] + out pColRowset: IUnknown): HResult; + end; + +// *********************************************************************// +// Interface: IColumnsInfo +// GUID: {0C733A11-2A1C-11CE-ADE5-00AA0044773D} +// *********************************************************************// + [ComImport, GuidAttribute('0C733A11-2A1C-11CE-ADE5-00AA0044773D'), InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] + IColumnsInfo = interface + [PreserveSig] + function GetColumnInfo(var pcColumns: UINT; out prgInfo: PDBColumnInfo; + out ppStringsBuffer: IntPtr): HResult; + [PreserveSig] + function MapColumnIDs(cColumnIDs: UINT; rgColumnIDs: PDBIDArray; + rgColumns: PUintArray): HResult; + end; + +// *********************************************************************// +// Interface: IDBCreateCommand +// GUID: {0C733A1D-2A1C-11CE-ADE5-00AA0044773D} +// *********************************************************************// + [ComImport, GuidAttribute('0C733A1D-2A1C-11CE-ADE5-00AA0044773D'), InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] + IDBCreateCommand = interface + [PreserveSig] + function CreateCommand( + [In, MarshalAs(UnmanagedType.IUnknown)] + const punkOuter: IUnknown; + [In, MarshalAs(UnmanagedType.LPStruct)] + const riid: TGUID; + [Out, MarshalAs(UnmanagedType.IUnknown)] + out ppCommand: IUnknown): HResult; + end; + +// *********************************************************************// +// Interface: IDBCreateSession +// GUID: {0C733A5D-2A1C-11CE-ADE5-00AA0044773D} +// *********************************************************************// + [ComImport, GuidAttribute('0C733A5D-2A1C-11CE-ADE5-00AA0044773D'), InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] + IDBCreateSession = interface + [PreserveSig] + function CreateSession( + [In, MarshalAs(UnmanagedType.IUnknown)] + const punkOuter: IUnknown; + [In, MarshalAs(UnmanagedType.LPStruct)] + const riid: TGUID; + [Out, MarshalAs(UnmanagedType.IUnknown)] + out ppDBSession: IUnknown): HResult; + end; + +// *********************************************************************// +// Interface: ISourcesRowset +// GUID: {0C733A1E-2A1C-11CE-ADE5-00AA0044773D} +// *********************************************************************// + [ComImport, GuidAttribute('0C733A1E-2A1C-11CE-ADE5-00AA0044773D'), InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] + ISourcesRowset = interface + [PreserveSig] + function GetSourcesRowset( + [In, MarshalAs(UnmanagedType.IUnknown)] + const punkOuter: IUnknown; + [In, MarshalAs(UnmanagedType.LPStruct)] + const riid: TGUID; + cPropertySets: UINT; + rgProperties: PDBPropSetArray; + [Out, MarshalAs(UnmanagedType.IUnknown)] + out ppSourcesRowset: IUnknown): HResult; + end; + +// *********************************************************************// +// Interface: IDBProperties +// GUID: {0C733A8A-2A1C-11CE-ADE5-00AA0044773D} +// *********************************************************************// + [ComImport, GuidAttribute('0C733A8A-2A1C-11CE-ADE5-00AA0044773D'), InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] + IDBProperties = interface + [PreserveSig] + function GetProperties(cPropertyIDSets: UINT; rgPropertyIDSets: PDBPropIDSetArray; + var pcPropertySets: UINT; out prgPropertySets: PDBPropSet): HResult; + [PreserveSig] + function GetPropertyInfo(cPropertyIDSets: UINT; rgPropertyIDSets: PDBPropIDSetArray; + var pcPropertyInfoSets: UINT; out prgPropertyInfoSets: PDBPropInfoSet; + ppDescBuffer: PPOleStr): HResult; + [PreserveSig] + function SetProperties(cPropertySets: UINT; rgPropertySets: PDBPropSetArray): HResult; + end; + +// *********************************************************************// +// Interface: IDBInitialize +// GUID: {0C733A8B-2A1C-11CE-ADE5-00AA0044773D} +// *********************************************************************// + [ComImport, GuidAttribute('0C733A8B-2A1C-11CE-ADE5-00AA0044773D'), InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] + IDBInitialize = interface + [PreserveSig] + function Initialize: HResult; + [PreserveSig] + function Uninitialize: HResult; + end; + +// *********************************************************************// +// Interface: IDBDataSourceAdmin +// GUID: {0C733A7A-2A1C-11CE-ADE5-00AA0044773D} +// *********************************************************************// + [ComImport, GuidAttribute('0C733A7A-2A1C-11CE-ADE5-00AA0044773D'), InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] + IDBDataSourceAdmin = interface + [PreserveSig] + function CreateDataSource(cPropertySets: UINT; + rgPropertySets: PDBPropSetArray; + [In, MarshalAs(UnmanagedType.IUnknown)] + const punkOuter: IUnknown; + [In, MarshalAs(UnmanagedType.LPStruct)] + const riid: TGUID; + [Out, MarshalAs(UnmanagedType.IUnknown)] + out ppDBSession: IUnknown): HResult; + [PreserveSig] + function DestroyDataSource: HResult; + [PreserveSig] + function GetCreationProperties(cPropertyIDSets: UINT; + rgPropertyIDSets: PDBPropIDSetArray; + pcPropertyInfoSets: PUINT; + out prgPropertyInfoSets: PDBPropInfoSet; + ppDescBuffer: PPOleStr): HResult; + [PreserveSig] + function ModifyDataSource(cPropertySets: UINT; + rgPropertySets: PDBPropSetArray): HResult; + end; + +// *********************************************************************// +// Interface: ISessionProperties +// GUID: {0C733A85-2A1C-11CE-ADE5-00AA0044773d} +// *********************************************************************// + [ComImport, GuidAttribute('0C733A85-2A1C-11CE-ADE5-00AA0044773d'), InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] + ISessionProperties = interface + [PreserveSig] + function GetProperties(cPropertyIDSets: UINT; rgPropertyIDSets: PDBPropIDSetArray; + var pcPropertySets: UINT; out prgPropertySets: PDBPropSet): HResult; + [PreserveSig] + function SetProperties(cPropertySets: UINT; rgPropertySets: PDBPropSetArray): HResult; + end; + +// *********************************************************************// +// Interface: ITransactionLocal +// GUID: {0C733A5F-2A1C-11CE-ADE5-00AA0044773D} +// *********************************************************************// + [ComImport, GuidAttribute('0C733A5F-2A1C-11CE-ADE5-00AA0044773D'), InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] + ITransactionLocal = interface + // ITransaction + [PreserveSig] + function Commit(fRetaining: BOOL; grfTC: UINT; grfRM: UINT): HResult; + [PreserveSig] + function Abort(pboidReason: PBOID; fRetaining: BOOL; fAsync: BOOL): HResult; + [PreserveSig] + function GetTransactionInfo(out pinfo: XACTTRANSINFO): HResult; + + // ITransactionLocal + [PreserveSig] + function GetOptionsObject(out ppOptions: ITransactionOptions): HResult; + [PreserveSig] + function StartTransaction(isoLevel: Integer; isoFlags: UINT; + const pOtherOptions: ITransactionOptions; + pulTransactionLevel: PUINT): HResult; + end; + +// *********************************************************************// +// Interface: IDBPromptInitialize +// GUID: {2206CCB0-19C1-11D1-89E0-00C04FD7A829} +// *********************************************************************// + [ComImport, GuidAttribute('2206CCB0-19C1-11D1-89E0-00C04FD7A829'), InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] + IDBPromptInitialize = interface + [PreserveSig] + function PromptDataSource( + [In, MarshalAs(UnmanagedType.IUnknown)] + const pUnkOuter: IUnknown; + hWndParent: HWND; + dwPromptOptions: DBPROMPTOPTIONS; cSourceTypeFilter: ULONG; + rgSourceTypeFilter: PDBSOURCETYPE; + [Out, MarshalAs(UnmanagedType.LPWStr)] + pszProviderFilter: OleStr; + [In, MarshalAs(UnmanagedType.LPStruct)] + const riid: TIID; + [MarshalAs(UnmanagedType.IUnknown)] + var DataSource: IUnknown): HResult; + [PreserveSig] + function PromptFileName(hWndParent: HWND; dwPromptOptions: DBPROMPTOPTIONS; + pwszInitialDirectory, pwszInitialFile: OleStr; + [MarshalAs(UnmanagedType.LPWStr)] + var ppwszSelectedFile: OleStr): HResult; + end; + +// *********************************************************************// +// Interface: IDataInitialize +// GUID: {2206CCB1-19C1-11D1-89E0-00C04FD7A829} +// *********************************************************************// + [ComImport, GuidAttribute('2206CCB1-19C1-11D1-89E0-00C04FD7A829'), InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] + IDataInitialize = interface + [PreserveSig] + function GetDataSource( + [In, MarshalAs(UnmanagedType.IUnknown)] + const pUnkOuter: IUnknown; + dwClsCtx: DWORD; + [In, MarshalAs(UnmanagedType.LPWStr)] + const pwszInitializationString: OleStr; + [In, MarshalAs(UnmanagedType.LPStruct)] + const riid: TGUID; + [Out, MarshalAs(UnmanagedType.IUnknown)] + out DataSource: IUnknown): HResult; + [PreserveSig] + function GetInitializationString( + [In, MarshalAs(UnmanagedType.IUnknown)] + const DataSource: IUnknown; + fIncludePassword: Boolean; + [Out, MarshalAs(UnmanagedType.LPWStr)] + out pwszInitString: OleStr): HResult; + function CreateDBInstance( + [In, MarshalAs(UnmanagedType.LPStruct)] + const clsidProvider: TGUID; + [In, MarshalAs(UnmanagedType.IUnknown)] + const pUnkOuter: IUnknown; + dwClsCtx: DWORD; + [MarshalAs(UnmanagedType.LPWStr)] + pwszReserved: OleStr; + riid: TIID; + [MarshalAs(UnmanagedType.IUnknown)] + var DataSource: IUnknown): HResult; + function CreateDBInstanceEx( + [In, MarshalAs(UnmanagedType.LPStruct)] + const clsidProvider: TGUID; + [In, MarshalAs(UnmanagedType.IUnknown)] + const pUnkOuter: IUnknown; + dwClsCtx: DWORD; + [MarshalAs(UnmanagedType.LPWStr)] + pwszReserved: OleStr; + pServerInfo: PCoServerInfo; + cmq: ULONG; + rgmqResults: PMultiQI): HResult; + function LoadStringFromStorage( + [MarshalAs(UnmanagedType.LPWStr)] + pwszFileName: OleStr; + [Out, MarshalAs(UnmanagedType.LPWStr)] + out pwszInitializationString: OleStr): HResult; + function WriteStringToStorage( + [MarshalAs(UnmanagedType.LPWStr)] + pwszFileName, + [MarshalAs(UnmanagedType.LPWStr)] + pwszInitializationString: OleStr; + dwCreationDisposition: DWORD): HResult; + end; + + [ComImport, GuidAttribute('0c733a7b-2a1c-11ce-ade5-00aa0044773d'), InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] + IDBSchemaRowset = interface + [PreserveSig] + function GetRowset ( + [In, MarshalAs(UnmanagedType.IUnknown)] + const pUnkOuter: IUnknown; + [In, MarshalAs(UnmanagedType.LPStruct)] + const rguidSchema: TGUID; + cRestrictions: UINT; rgRestrictions: PVariantArray; + [In, MarshalAs(UnmanagedType.LPStruct)] + const riid: TGUID; + cPropertySets: UINT; rgPropertySets: PDBPropSetArray; + [Out, MarshalAs(UnmanagedType.IUnknown)] + out ppRowset: IUnknown): HResult; + [PreserveSig] + function GetSchemas (out pcSchemas: UINT; out prgSchemas: PGUIDArray; + prgRestrictionSupport: PUINTArray): HResult; + end; + + [ComImport, + GuidAttribute('0C733A69-2A1C-11CE-ADE5-00AA0044773D'), + InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] + IOpenRowset = interface // (IUnknown) + [PreserveSig] + function OpenRowset([in, MarshalAs(UnmanagedType.IUnknown)] punkOuter: TObject; + pTableID: PDBID; pIndexID: PDBID; + [MarshalAs(UnmanagedType.LPStruct)] riid: TGUID; cPropertySets: UINT; + rgPropertySets: PDBPropSetArray; + [MarshalAs(UnmanagedType.IUnknown)] var ppRowset): HResult; + end; + + [ComImport, + GuidAttribute('5CF4CA13-EF21-11d0-97E7-00C04FC2AD98'), + InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] + IRowsetFastLoad = interface // (IUnknown) + [PreserveSig] + function InsertRow(HACCESSOR: HACCESSOR; pData: IntPtr): HResult; + [PreserveSig] + function Commit(fDone: boolean): HResult; + end; + + [ComImport, GuidAttribute('0c733a95-2a1c-11ce-ade5-00aa0044773d'), InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] + IDBAsynchStatus = interface + [PreserveSig] + function Abort(Chapter: HCHAPTER; Operation: DBASYNCHOP): HRESULT; + [PreserveSig] + function GetStatus(Chapter: HCHAPTER; Operation: DBASYNCHOP; var Progress: UINT; + var ProgressMax: UINT; var AsynchPhase: DWORD; var StatusText: PWideChar): HRESULT; + end; + + [ComImport, GuidAttribute('1FF1F743-8BB0-4c00-ACC4-C10E43B08FC1'), InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] + ISSAsynchStatus = interface(IDBAsynchStatus) + [PreserveSig] + function WaitForAsynchCompletion(MillisecTimeOut: DWORD): HRESULT; + end; + + [ComImport, GuidAttribute('0c733a67-2a1c-11ce-ade5-00aa0044773d'), InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] + IErrorRecords = interface + [PreserveSig] + function (* [local] *) AddErrorRecord( + (* [in] *) const pErrorInfo: ERRORINFO; + (* [in] *) dwLookupID: DWORD; + (* [in] *) const pdispparams: DISPPARAMS; + [In, MarshalAs(UnmanagedType.IUnknown)] + (* [in] *) const punkCustomError: IUnknown; + (* [in] *) dwDynamicErrorID: DWORD): HResult; + + [PreserveSig] + function (* [local] *) GetBasicErrorInfo( + (* [in] *) ulRecordNum: ULONG; + (* [out] *) out pErrorInfo: ERRORINFO): HResult; + + [PreserveSig] + function (* [local] *) GetCustomErrorObject( + (* [in] *) ulRecordNum: ULONG; + [In, MarshalAs(UnmanagedType.LPStruct)] + (* [in] *) const riid: TGUID; + [Out, MarshalAs(UnmanagedType.IUnknown)] + (* [iid_is][out] *) out ppObject: IUnknown): HResult; + + [PreserveSig] + function (* [local] *) GetErrorInfo( + (* [in] *) ulRecordNum: ULONG; + (* [in] *) lcid: LCID; + (* [out] *) + [Out, MarshalAs(UnmanagedType.IUnknown)] + out ppErrorInfo: IErrorInfo): HResult; + + [PreserveSig] + function (* [local] *) GetErrorParameters( + (* [in] *) ulRecordNum: ULONG; + (* [out] *) out pdispparams: DISPPARAMS): HResult; + + [PreserveSig] + function (* [local] *) GetRecordCount( + (* [out] *) out pcRecords: ULONG): HResult; + end; + {$EXTERNALSYM IErrorRecords} + +// the structure returned by ISQLServerErrorInfo::GetSQLServerInfo + [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Auto)] + SSERRORINFO = record + [MarshalAs(UnmanagedType.LPWStr)] + pwszMessage: PWideChar; + [MarshalAs(UnmanagedType.LPWStr)] + pwszServer: PWideChar; + [MarshalAs(UnmanagedType.LPWStr)] + pwszProcedure: PWideChar; + lNative: UINT; + bState: BYTE; + bClass: BYTE; + wLineNumber: WORD; + end; + PSSERRORINFO = IntPtr; + + [ComImport, GuidAttribute('5CF4CA12-EF21-11d0-97E7-00C04FC2AD98'), InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] + ISQLServerErrorInfo = interface + [PreserveSig] + function GetErrorInfo( + (* [out] *) out ppErrorInfo: PSSERRORINFO; + (* [out] *) out ppStringsBuffer: IntPtr{PWideChar}): HResult; + end; + + /// WARINING - in 64bit OSes DBBKMARK is int64 + DBBKMARK = integer; + + [ComImport, GuidAttribute('0c733a30-2a1c-11ce-ade5-00aa0044773d'), InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] + ISequentialStream = interface + [PreserveSig] + function Read( + pv: IntPtr; + cb: Longint; + pcbRead: PLongint): HResult; + [PreserveSig] + function Write( + pv: IntPtr; + cb: Longint; + pcbWritten: PLongint): HResult; + end; + +function GetErrorInfo(dwReserved: Longint; out errinfo: IErrorInfo): HResult; +function CoGetMalloc(dwMemContext: Longint; out malloc: IMalloc): HResult; + +implementation + +uses + SysUtils; + +(* +procedure SetOleVariant(pValue: POleVariant; const Value: OleVariant); +var + Temp: TBytes; +begin + SetLength(Temp, 16); + Marshal.Copy(pValue, Temp, 0, 16); + Temp[0] := 1; + Marshal.GetNativeVariantForObject(TObject(Value), pValue); + Marshal.Copy(pValue, Temp, 0, 16); + Temp[0] := 2; +end; +*) + +{ PDBProp } + +function PDBProp.GetdwPropertyID: DBPROPID; +begin + Result := DBPROPID(Marshal.ReadInt32(Ptr, 0)); +end; + +procedure PDBProp.SetdwPropertyID(Value: DBPROPID); +begin + Marshal.WriteInt32(Ptr, 0, Integer(Value)); +end; + +function PDBProp.GetdwOptions: DBPROPOPTIONS; +begin + Result := DBPROPID(Marshal.ReadInt32(Ptr, 4)); +end; + +procedure PDBProp.SetdwOptions(Value: DBPROPOPTIONS); +begin + Marshal.WriteInt32(Ptr, 4, Integer(Value)); +end; + +function PDBProp.GetdwStatus: DBPROPSTATUS; +begin + Result := DBPROPID(Marshal.ReadInt32(Ptr, 8)); +end; + +procedure PDBProp.SetdwStatus(Value: DBPROPSTATUS); +begin + Marshal.WriteInt32(Ptr, 8, Integer(Value)); +end; + +function PDBProp.Getcolid: _DBID; +var + Temp: array of byte; +begin +{$IFDEF VER8} + SetLength(Temp, 0); //To avoid compiler warning. Delphi8 bug. +{$ENDIF} + Marshal.Copy(IntPtr(Integer(Ptr) + 12), Temp, 0, Length(DB_NULLID)); + Result := Temp; +end; + +procedure PDBProp.Setcolid(Value: _DBID); +var + Temp: array of byte; +begin + Temp := Value; + Marshal.Copy(Temp, 0, IntPtr(Integer(Ptr) + 12), Length(DB_NULLID)); +end; + +function PDBProp.GetvValue: OleVariant; +var + pValue: POleVariant; +begin + pValue := IntPtr(Integer(Ptr) + 12 + 24); + Result := GetOleVariant(pValue); +end; + +procedure PDBProp.SetvValue(Value: OleVariant); +var + pValue: POleVariant; +begin + pValue := IntPtr(Integer(Ptr) + 12 + 24); + SetOleVariant(pValue, Value); +end; + +class operator PDBProp.Implicit(AValue: IntPtr): PDBProp; +begin + Result.Ptr := AValue; +end; + +class operator PDBProp.Implicit(AValue: PDBProp): IntPtr; +begin + Result := AValue.Ptr; +end; + +{ PDBPropSet } + +class operator PDBPropSet.Implicit(AValue: IntPtr): PDBPropSet; +begin + Result.Ptr := AValue; +end; + +class operator PDBPropSet.Implicit(AValue: PDBPropSet): IntPtr; +begin + Result := AValue.Ptr; +end; + +function PDBPropSet.GetrgProperties: PDBPropArray; +begin + Result := Marshal.ReadIntPtr(Ptr); +end; + +procedure PDBPropSet.SetrgProperties(Value: PDBPropArray); +begin + Marshal.WriteIntPtr(Ptr, Value); +end; + +function PDBPropSet.GetcProperties: UINT; +begin + Result := UINT(Marshal.ReadInt32(Ptr, 4)); +end; + +procedure PDBPropSet.SetcProperties(Value: UINT); +begin + Marshal.WriteInt32(Ptr, 4, Integer(Value)); +end; + +function PDBPropSet.GetguidPropertySet: TGUID; +begin + Result := TGUID(Marshal.PtrToStructure(IntPtr(Integer(Ptr) + 8), TypeOf(TGUID))); +end; + +procedure PDBPropSet.SetguidPropertySet(Value: TGUID); +begin + Marshal.StructureToPtr(TObject(Value), IntPtr(Integer(Ptr) + 8), False); +end; + +const + ole32 = 'ole32.dll'; + oleaut32 = 'oleaut32.dll'; + +[DllImport(oleaut32, CharSet = CharSet.Ansi, SetLastError = True, EntryPoint = 'GetErrorInfo')] +function GetErrorInfo(dwReserved: Longint; out errinfo: IErrorInfo): HResult; external; + +[DllImport(ole32, CharSet = CharSet.Ansi, SetLastError = True, EntryPoint = 'CoGetMalloc')] +function CoGetMalloc(dwMemContext: Longint; out malloc: IMalloc): HResult; external; + +initialization + +end. diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.SdacVcl.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.SdacVcl.pas new file mode 100644 index 0000000..7f357dc --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.Sdac.SdacVcl.pas @@ -0,0 +1,5 @@ +{$I ..\Sdac.inc} + +unit CoreLab.Sdac.SdacVcl; + +{$I ..\SdacVcl.pas} \ No newline at end of file diff --git a/internal/4.10.0.10/1/Source/Net/CoreLab.VirtualTable.Design.DacReg.pas b/internal/4.10.0.10/1/Source/Net/CoreLab.VirtualTable.Design.DacReg.pas new file mode 100644 index 0000000..4718523 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/CoreLab.VirtualTable.Design.DacReg.pas @@ -0,0 +1,21 @@ +{$I ..\Dac.inc} + +unit CoreLab.VirtualTable.Design.DacReg; + +{$IFDEF VER9P} + +{$R ..\..\Images\CoreLab.Dac.VirtualTable.TVirtualTable.bmp} +{$R ..\..\Images\CoreLab.Dac.VirtualTable.TVirtualTable16.bmp} +{$R ..\..\Images\CoreLab.Dac.VirtualTable.TVirtualTable32.bmp} +{$R ..\..\Images\CoreLab.Dac.CRBatchMove.TCRBatchMove.bmp} +{$R ..\..\Images\CoreLab.Dac.CRBatchMove.TCRBatchMove16.bmp} +{$R ..\..\Images\CoreLab.Dac.CRBatchMove.TCRBatchMove32.bmp} + +{$ELSE} + +{$R ..\..\Images\Delphi8\CoreLab.Dac.VirtualTable.TVirtualTable.bmp} +{$R ..\..\Images\Delphi8\CoreLab.Dac.CRBatchMove.TCRBatchMove.bmp} + +{$ENDIF} + +{$I ..\DacReg.pas} diff --git a/internal/4.10.0.10/1/Source/Net/Dac.inc b/internal/4.10.0.10/1/Source/Net/Dac.inc new file mode 100644 index 0000000..3f676f3 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/Dac.inc @@ -0,0 +1 @@ +{$I ..\Dac.inc} diff --git a/internal/4.10.0.10/1/Source/Net/DacGui.inc b/internal/4.10.0.10/1/Source/Net/DacGui.inc new file mode 100644 index 0000000..bcc0d73 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/DacGui.inc @@ -0,0 +1 @@ +{$I ..\DacGui.inc} diff --git a/internal/4.10.0.10/1/Source/Net/DacVer.inc b/internal/4.10.0.10/1/Source/Net/DacVer.inc new file mode 100644 index 0000000..1f39c7b --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/DacVer.inc @@ -0,0 +1 @@ +{$I ..\DacVer.inc} diff --git a/internal/4.10.0.10/1/Source/Net/SdacGui.inc b/internal/4.10.0.10/1/Source/Net/SdacGui.inc new file mode 100644 index 0000000..52073dc --- /dev/null +++ b/internal/4.10.0.10/1/Source/Net/SdacGui.inc @@ -0,0 +1 @@ +{$I ..\SdacGui.inc} diff --git a/internal/4.10.0.10/1/Source/OLEDBAccess.pas b/internal/4.10.0.10/1/Source/OLEDBAccess.pas new file mode 100644 index 0000000..e1df3ad --- /dev/null +++ b/internal/4.10.0.10/1/Source/OLEDBAccess.pas @@ -0,0 +1,10207 @@ + +////////////////////////////////////////////////// +// SQL Server Data Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +// Access via OLE DB +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I Sdac.inc} + +unit OLEDBAccess; +{$ENDIF} + +interface + +uses +{$IFDEF CLR} + Borland.Vcl.TypInfo, Variants, +{$ELSE} + CLRClasses, +{$ENDIF} + Windows, Classes, DBConsts, +{$IFNDEF LITE} + DB, DBAccess, +{$ENDIF} +{$IFDEF VER6P} + FMTBcd, +{$ENDIF} + DAConsts, SysUtils, ActiveX, SyncObjs, OLEDBC, OLEDBIntf, CRAccess, MemData, + MSConsts, CRThread, ComObj; + +const + DefaultSDACDatabase = 'master'; + DefaultPacketSize = 4096; + DefaultConnectionTimeout = 15; + + OLE_DB_INDICATOR_SIZE = sizeof(DWORD); + + MaxNonBlobFieldLen = 8000; // Maximum length of "char", "varchar", "nchar", "nvarchar", fields + + // properties + prOleDBBase = 1000; + + // connection properties + prDatabase = prOleDBBase; // string + prIsolationLevel = prOleDBBase + 1; // TIsolationLevel + prAuthentication = prOleDBBase + 2; // TMSAuthentication + + // dataset options + prReadOnly = prOleDBBase + 6; // boolean + prEnableBCD = prOleDBBase + 7; // boolean + prUniqueRecords = prOleDBBase + 8; // boolean + prCursorType = prOleDBBase + 9; // TMSCursorType + prRequestSQLObjects = prOleDBBase + 10; // boolean + prCursorUpdate = prOleDBBase + 12; // boolean + prLockClearMultipleResults = prOleDBBase + 13; // boolean + prConnectionTimeout = prOleDBBase + 14; // integer + prCommandTimeout = prOleDBBase + 15; // integer + prQuotedIdentifier = prOleDBBase + 16; // boolean + prLanguage = prOleDBBase + 17; // string + prEncrypt = prOleDBBase + 18; // boolean + prNetworkLibrary = prOleDBBase + 19; // string + prPacketSize = prOleDBBase + 20; // integer + prRoAfterUpdate = prOleDBBase + 21; // boolean + //prMultipleConnections = prOleDBBase + 18; // boolean + // if False then unicode fields is supported as TStringsField else as TWideStringField + prWideStrings = prOleDBBase + 22; // boolean + prApplicationName = prOleDBBase + 23; // string + prWorkstationID = prOleDBBase + 24; // string +{$IFDEF VER6P} + prEnableFMTBCD = prOleDBBase + 25; // boolean +{$ENDIF} + prAutoTranslate = prOleDBBase + 26; // boolean + prIsSProc = prOleDBBase + 27; // boolean + prProvider = prOleDBBase + 28; // string + prCanReadParams = prOleDBBase + 29; // boolean + prPersistSecurityInfo = prOleDBBase + 30; // boolean + prInitialFileName = prOleDBBase + 31; // string + prMARS = prOleDBBase + 32; // boolean + prSmartRefresh = prOleDBBase + 33; // boolean + prSmartRefreshMsg = prOleDBBase + 34; // string + prSmartRefreshService = prOleDBBase + 35; // string + prNonBlocking = prOleDBBase + 36; // boolean + prOldPassword = prOleDBBase + 37; // string + prMaxDatabaseSize = prOleDBBase + 38; // integer + prFailoverPartner = prOleDBBase + 39; // string + +type + TCursorTypeChangedProc = procedure of object; + TMSCursorType = (ctDefaultResultSet, ctStatic, ctKeyset, ctDynamic); + TMSCursorTypes = set of TMSCursorType; + + TReadParamsProc = procedure of object; + +{ internal data types } +const + dtMSXML = 100; + +{ internal sub data types } +const + dtChar = 20; + dtText = 22; + dtWide = $8000; + +const + ServerCursorTypes: TMSCursorTypes = [ctStatic, ctKeyset, ctDynamic]; + +type + TOLEDBParamDesc = class(TParamDesc) + protected + FOLEDBType: DBTYPE; // Native OLE DB datatype + FUseDefaultValue: boolean; + + property OLEDBType: DBTYPE read FOLEDBType write FOLEDBType; + property UseDefaultValue: boolean read FUseDefaultValue write FUseDefaultValue; + public + function GetOLEDBType: DBTYPE; + procedure SetOLEDBType(Value: DBTYPE); virtual; + + function GetUseDefaultValue: boolean; + procedure SetUseDefaultValue(Value: boolean); + + function GetValue: variant; override; + function GetAsBlobRef: TBlob; + + procedure SetNull(const Value: boolean); override; + end; + + TRunMethod = procedure of object; + + TOLEDBThreadWrapper = class(TCRThreadWrapper) + protected + procedure DoException(E: Exception); override; + end; + + TExecuteThread = class(TCRThread) + protected + FRunMethod: TRunMethod; + procedure InternalExecute; override; + {$IFDEF CLR} + property Terminated; + {$ENDIF} + end; + +{ TOLEDBConnection } + + TOLEDBProvider = (prAuto, prSQL, prNativeClient, prCompact); + + TMSAuthentication = (auWindows, auServer); + + TIsolationLevel = (ilReadCommitted, ilReadUnCommitted, ilRepeatableRead, ilIsolated, ilSnapshot); + + EMSError = class; + // TMSErrorProc = procedure (E: {$IFDEF LITE}Exception{$ELSE}EDAError{$ENDIF}; var Fail: boolean) of object; + TMSInfoMessageProc = procedure (E: EMSError) of object; + + // ---------- + // Must be declared before(!) TOLEDBConnection declaration to prevent CBuilder compiler bug (pas -> hpp) + + { + AccessorBlock types: + 1. Ordinary. May contain many ordinary fields and only one BLOB field + 1.1. For DefaultResultSet or for CursorUpdate = False. All fields in block must be not ReadOnly + 1.2. In other cases ReadOnly and not ReadOnly fields may contains in one AccessorBlock + 2. ReadOnly. Used only for KeySet and Dynamic if CursorUpdate is True. All fields in block must be ReadOnly + 3. BLOB. May contain only one BLOB field + 4. FetchBlock. Used for dtVariant and dtMemo (not BLOB) fields + + RecordSet may contain only one each of accessor types, and some BLOB accessors if need + } + + TAccessorBlockType = (abOrdinary, abReadOnly, abBLOB, abFetchBlock); + TAccessorBlock = record + BlockType: TAccessorBlockType; + hAcc: HACCESSOR; // OLE DB accessor + BlobFieldNum: integer; // -1, if BLOB field not avaible. This member useful to fetch BLOB streams + FieldNums: array of integer; + end; + + TOLEDBRecordSet = class; + TRestrictions = array of OleVariant; + + TOLEDBConnection = class (TCRConnection) + protected + //FIMalloc: IMalloc; + + { DataSource } + FIDBInitialize: IDBInitialize; + FIDBProperties: IDBProperties; + FIDBCreateSession: IDBCreateSession; + + { Session } + FISessionProperties: ISessionProperties; + FITransactionLocal: ITransactionLocal; + + FCommand: TCRCommand; // Used for ExecSQL. Created on first use + + FDatabase: string; + FIsolationLevel: TIsolationLevel; + // FMultipleConnections: boolean; + FMaxDatabaseSize: integer; // Comact Edition + + FAuthentication: TMSAuthentication; + FProvider: TOLEDBProvider; + + // Init properties + FConnectionTimeout: integer; + FQuotedIdentifier: boolean; + FLanguage: string; + FAutoTranslate: boolean; + FEncrypt: boolean; + FPersistSecurityInfo: boolean; + FNetworkLibrary: string; + FPacketSize: integer; + FApplicationName: string; + FWorkstationID: string; + FInitialFileName: string; + FFailoverPartner: string; + FMultipleActiveResultSets: boolean; + FOldPassword: string; + + FDBMSName: string; + FDBMSVer: string; + FDBMSPrimaryVer: integer; + FProviderFriendlyName: string; + FProviderVer: string; + FProviderPrimaryVer: integer; + FProviderId: TGuid; + + FColumnsRowsetFieldDescs: TFieldDescs; // FieldDescs for non-Native rowsets + FColumnsMetaInfo: TOLEDBRecordSet; // ColumnsRowset + {$IFNDEF LITE} + FFldCatalogNameIdx, FFldSchemaNameIdx, FFldTableNameIdx, FFldColumnNameIdx, + FFldFieldNameIdx, FFldActualFieldNameIdx, FFldPrecisionIdx, FFldScaleIdx, FFldGuidIdx: integer; + FFldColumnNumberIdx, FFldIsAutoIncIdx, FFldTypeIdx, FFldFlagsIdx, FFldColumnSizeIdx, FFldComputeModeIdx: integer; + FFldXMLSchemaCollCatalogNameIdx, FFldXMLSchemaCollSchemaNameIdx, FFldXMLSchemaCollNameIdx: integer; + {$ENDIF} + + FOnInfoMessage: TMSInfoMessageProc; + + procedure ReleaseInterfaces; + function GetSchemaRowset(const Schema: TGUID; rgRestrictions: TRestrictions): IRowset; + + procedure GetConnectionProperties; + procedure SetConnectionProperties; + + procedure SetQuotedIdentifier(const Value: boolean); + + procedure ExecSQL(const Text: string); + + class procedure AssignFieldDescs(Source, Dest: TFieldDescs); + + {$IFDEF CLR} + procedure DoError(E: Exception; var Fail: boolean); override; + {$ENDIF} + procedure CreateDatabase(const Database: string; const Password: string; const Encrypted: boolean); + public + constructor Create; override; + destructor Destroy; override; + + procedure Check(const Status: HRESULT; Component: TObject); virtual; + procedure OLEDBError(const ErrorCode: HRESULT; Component: TObject); + + procedure Connect(const ConnectString: string); override; + procedure Disconnect; override; + + procedure Assign(Source: TOLEDBConnection); + + procedure SetIDBCreateSession(CreateSession: IDBCreateSession); + + { Transaction control } + procedure StartTransaction; override; + procedure Commit; override; + procedure Rollback; override; + + function SetProp(Prop: integer; const Value: variant): boolean; override; + function GetProp(Prop: integer; var Value: variant): boolean; override; + + procedure SetDatabase(const Value: string); + + function CheckIsValid: boolean; override; + + //property Malloc: IMalloc read FIMalloc; + property SessionProperties: ISessionProperties read FISessionProperties; + property DBProperties: IDBProperties read FIDBProperties; + + property DBMSName: string read FDBMSName; + property DBMSVer: string read FDBMSVer; + property DBMSPrimaryVer: integer read FDBMSPrimaryVer; + property ProviderFriendlyName: string read FProviderFriendlyName; + property ProviderVer: string read FProviderVer; + property ProviderPrimaryVer: integer read FProviderPrimaryVer; + + property OnInfoMessage: TMSInfoMessageProc read FOnInfoMessage write FOnInfoMessage; + end; + +{ TOLEDBCommand } + TIntPtrDynArray = array of IntPtr; + + TParamsAccessorData = record + Accessor: IAccessor; + ExecuteParams: DBPARAMS; + rgBindings: TDBBindingArray; + end; + + TOLEDBCommand = class (TCRCommand) + protected + FQueryIntCnt: integer; // Quantity of calls to QueryInterfaces + FIsSProc: boolean; + FRPCCall: boolean; + + FPrepared: boolean; + FConnection: TOLEDBConnection; + + FBreakExecCS: TCriticalSection; // Used to prevent clear FICommandText on BreakExec + FWaitForBreak: boolean; + + // If statement executed w/o errors and warnings then FLastExecWarning is False + // If statement executed with warning then FLastExecWarning is True + // If statement executed with error then raising exception + // Used to analyze CursorType changes in RecordSet + FLastExecWarning: boolean; + + FCommandTimeout: integer; + + { Smart Refresh} + FSmartRefresh: boolean; + FSmartRefreshMsg: string; + FSmartRefreshService: string; + + { NonBlocking} + FNonBlocking: boolean; + FISSAsynchStatus: ISSAsynchStatus; + FExecutor: TOLEDBThreadWrapper; + + { Command } + FICommandText: ICommandText; + FICommandPrepare: ICommandPrepare; + FICommandProperties: ICommandProperties; + + { Rowset } + FRequestIUnknown: boolean; // Indicate current command owner - MSSQL(False) or MSDataSet(True) + FRequestMultipleResults: boolean; // True for ctDefaultResultSet only + FIUnknown: IUnknown; // If requested then must be setted to a nil as it possible + FIUnknownNext: IUnknown; + FIMultipleResults: IMultipleResults; + + FCursorState: TCursorState; + + { Params } + FParamsAccessorData: TParamsAccessorData; + FParamsAccessorDataAvaible: boolean; + FCanReadParams: boolean; + {$IFDEF CLR} + FParamsGC: TIntPtrDynArray; // List of AllocGCHandle(ParamDesc.Value, True) + {$ENDIF} + + { Rows } + FRowsAffected: integer; + FRowsAffectedNext: integer; + + FReadParams: TReadParamsProc; + FNextResultRequested: boolean; // FIUnknownNext getted from OLE DB + + procedure Check(const Status: HRESULT); virtual; + procedure QueryInterfaces(const QueryPrepare: boolean); // QueryPrepare must be True to request IID_ICommandPrepare + procedure ReleaseInterfaces; + + procedure SetCommandProp; + procedure SetParameterInfo; + + { Params } + procedure CreateAndFillParamAccs; + procedure RequestParamsIfPossible; // Call RequestAndFreeParamAccs if interfaces is cleared + + procedure CheckAndAnalyze(const Status: HRESULT); + procedure GetNextResult(out ResultSet: IUnknown; out RowsAffected: integer); + + public + constructor Create; override; + destructor Destroy; override; + + procedure Prepare; override; + procedure Unprepare; override; + function GetPrepared: boolean; override; + + function CreateProcCall(Name: string; const NeedDescribe: boolean; const WideStrings: boolean; + const EnableBcd: boolean; const EnableFmtBcd: boolean): string; + procedure Execute(Iters: integer = 1); override; + procedure DoExecuteTerminate(Sender: TObject); + procedure DoExecuteException(Sender: TObject; E: Exception; var Fail: boolean); + procedure WaitAsynchCompletion; + procedure EndExecute(E: Exception); + + procedure SetConnection(Value: TCRConnection); override; + function GetCursorState: TCursorState; override; + procedure SetCursorState(Value: TCursorState); override; + + function GetProp(Prop: integer; var Value: variant): boolean; override; + function SetProp(Prop: integer; const Value: variant): boolean; override; + + procedure BreakExec; + + // Interface management + function IUnknownIsNull: boolean; + function IUnknownNextIsNull: boolean; + function IMultipleResultsIsNull: boolean; + function ISSAsynchStatusIsNull: boolean; + procedure ClearIUnknown; + procedure ClearIUnknownNext; + procedure ClearIMultipleResults; + procedure ClearISSAsynchStatus; + + { Params } + function GetParamDescType: TParamDescClass; override; + function AddParam: TParamDesc; override; + function GetParam(Index: integer): TOLEDBParamDesc; + property Params; + + property ReadParams: TReadParamsProc read FReadParams write FReadParams; + property Executing; + end; + + +{ TOLEDBRecordSet } + + TFetchAccessorData = record + Accessor: IAccessor; + + AccessorBlocks: array of TAccessorBlock; + end; + + TOLEDBFieldDesc = class (TCRFieldDesc) + private + FOLEDBType: DBTYPE; // Native OLE DB datatype + FIsAutoIncrement: boolean; + FBaseCatalogName: string; + FBaseColumnName: string; + FBaseSchemaName: string; + FBaseTableName: string; + FIsTimestamp: boolean; + FXMLSchemaCollectionCatalogName: string; + FXMLSchemaCollectionSchemaName: string; + FXMLSchemaCollectionName: string; + FXMLTyped: boolean; + public + function ActualNameQuoted(RecordSet: TCRRecordSet; const QuoteNames: boolean): string; override; + + property OLEDBType: DBTYPE read FOLEDBType; // Native OLE DB datatype + + property BaseCatalogName: string read FBaseCatalogName; + property BaseSchemaName: string read FBaseSchemaName; + property BaseTableName: string read FBaseTableName; + property BaseColumnName: string read FBaseColumnName; + property IsAutoIncrement: boolean read FIsAutoIncrement; + property IsTimestamp: boolean read FIsTimestamp; + + property XMLSchemaCollectionCatalogName: string read FXMLSchemaCollectionCatalogName; + property XMLSchemaCollectionSchemaName: string read FXMLSchemaCollectionSchemaName; + property XMLSchemaCollectionName: string read FXMLSchemaCollectionName; + property XMLTyped: boolean read FXMLTyped; + end; + + TOLEDBTableInfo = class(TCRTableInfo) + protected + FMaxTimestamp: Int64; + public + class function LeftQuote: Char; override; + class function RightQuote: Char; override; + property MaxTimestamp: Int64 read FMaxTimestamp write FMaxTimestamp; + end; + + TOLEDBRecordSet = class (TCRRecordSet) + private + FProviderPrimaryVer: integer; + FDBMSPrimaryVer: integer; + FProviderId: TGuid; + FProvider: TOLEDBProvider; + FDisconnectedMode: boolean; + FDatabase: string; + function GetProviderPrimaryVer: integer; + function GetDBMSPrimaryVer: integer; + function GetProviderId: TGuid; + function GetProvider: TOLEDBProvider; + function GetDisconnectedMode: boolean; + function GetDatabase: string; + protected + FLockClearMultipleResults: boolean; // Used to prevent clear FCommand.FIMultipleResult on Close by OpenNext + FroAfterUpdate: boolean; // DataSet.RefreshOptions.roAfterUpdate + + FNativeRowset: boolean; // For non-native rowsets output parameters not supported + FIsColumnsRowset: boolean; // If True then FieldDescs was stored in FColumnsRowsetFieldDescs + + FCommand: TOLEDBCommand; + FFetchAccessorData: TFetchAccessorData; + + { Rowset } + FIRowset: IRowset; + FIRowsetLocate: IRowsetLocate; + FIRowsetUpdate: IRowsetUpdate; + + FCursorType: TMSCursorType; + FReadOnly: boolean; + + FRequestSQLObjects: boolean; + + FEnableBCD: boolean; + {$IFDEF VER6P} + FEnableFMTBCD: boolean; + {$ENDIF} + FUniqueRecords: boolean; + FWideStrings: boolean; + + // Bookmarks + FFetchFromBookmark: boolean; + FProcessDynBofEof: boolean; // True, if processing NoResult for ctDynamic + FBookmarkValue: integer; // OLEDB IRowsetLocate Bookmark value. If FBookmarkValue = - 1 then last fetch is not OK for KeySet cursor + FBookmarkSize: integer; // OLEDB IRowsetLocate Bookmark size. If FBookmarkSize = 4 then bookmark is ordinal otherwise bookmark is special (DBBMK_LAST, DBBMK_FIRST) + FBookmarkOffset: integer; // Offset from pHBlock to bookmark field value + + FFetchBlock: IntPtr; + FFetchBlockSize: integer; + FLastFetchOK: boolean; // True, if previous Fetch was called succesfulity (Result is True) + FLastFetchEnd: boolean; // True, If previous FIRowset.GetNextRows has return DB_S_ENDOFROWSET + FLastFetchBack: boolean; // True, if previous Fetch was called with True parameter + + // HRow for IRowsetUpdate + FHRow: HRow; + FHRowAccessible: boolean; // True, if FHRow is setted to valid value + + FCursorUpdate: boolean; + + FCursorTypeChanged: TCursorTypeChangedProc; + + FSchema: TGUID; + FRestrictions: TRestrictions; + + FFetching: boolean; + FFetchExecutor: TOLEDBThreadWrapper; + FBeforeFetch: boolean; + FAfterFetch: boolean; + + FPopulatingKeyInfo: boolean; + + procedure ClearHRowIfNeed; + + procedure Check(const Status: HRESULT); virtual; + procedure CheckBCDOverflow(const FieldNo: integer {from 1}; RecBuf: IntPtr); + procedure CheckAndAnalyzeFieldsStatus(const Status: HRESULT; const pRec: IntPtr); + + procedure QueryCommandInterfaces(const QueryPrepare: boolean); // Create ConnectionSwap if need. Call FCommand.QueryInterfaces. + procedure ReleaseCommandInterfaces; + procedure QueryRecordSetInterfaces; // Reqests IRowset, IRowsetLocate, IRowsetUpdate + procedure ReleaseRecordSetInterfaces; + procedure ReleaseAllInterfaces(const ReleaseMultipleResults: boolean); + + procedure CreateCommand; override; + procedure SetCommand(Value: TCRCommand); override; + + { Open / Close } + function NeedInitFields: boolean; override; + procedure InternalPrepare; override; + procedure InternalUnPrepare; override; + procedure InternalOpen; override; + procedure InternalClose; override; + + { Fields } + procedure InternalInitFields; override; + function GetIndicatorSize: word; override; + + { Fetch } + procedure AllocFetchBlock; // Also create fetch accessors + function Fetch(FetchBack: boolean = False): boolean; override; + procedure FreeFetchBlock; // Also free fetch accessors + function CanFetchBack: boolean; override; // Return True, if BlockMan is store only one block of records + + { Modify } + procedure RowsetUpdateCommit; + procedure RowsetUpdateRollback; + procedure InternalAppend(RecBuf: IntPtr); override; + procedure InternalDelete; override; + procedure InternalUpdate(RecBuf: IntPtr); override; + procedure InternalAppendOrUpdate(RecBuf: IntPtr; const IsAppend: boolean); + + procedure SetCommandProp; + + procedure RequestParamsIfPossible; // Call FCommand.RequestAndFreeParamAccs if interfaces is cleared + + { TablesInfo } + class function GetTableInfoClass: TTableInfoClass; override; + + //PreCached FConection properties + property ProviderPrimaryVer: integer read GetProviderPrimaryVer; + property DBMSPrimaryVer: integer read GetDBMSPrimaryVer; + property ProviderID: TGuid read GetProviderId; + property Provider: TOLEDBProvider read GetProvider; + property DisconnectedMode: boolean read GetDisconnectedMode; + property Database: string read GetDatabase; + public + constructor Create; override; + destructor Destroy; override; + + { Fields} + function GetFieldDescType: TFieldDescClass; override; + + { Open / Close } + procedure ExecCommand; override; + procedure Open; override; + procedure Reopen; override; + function GetSchemaRowset(const Schema: TGUID; rgRestrictions: TRestrictions): IRowset; + procedure Disconnect; override; + + { Fetch } + procedure FetchAll; override; + procedure DoFetchAll; virtual; + procedure DoFetchTerminate(Sender: TObject); + procedure DoFetchException(Sender: TObject; E: Exception; var Fail: boolean); + procedure DoFetchSendEvent(Sender: TObject; Event: TObject); + procedure EndFetchAll(E: Exception); virtual; + procedure BreakFetch; override; + function CanDisconnect: boolean; override; + + { Fields } + function GetNull(FieldNo: word; RecBuf: IntPtr): boolean; override; + procedure SetNull(FieldNo: word; RecBuf: IntPtr; Value: boolean); override; + function GetStatus(FieldNo: word; RecBuf: IntPtr): DWORD; + procedure SetStatus(FieldNo: word; RecBuf: IntPtr; Value: DWORD); + procedure GetFieldData(Field: TFieldDesc; RecBuf: IntPtr; Dest: IntPtr); override; + procedure GetFieldAsVariant(FieldNo: word; RecBuf: IntPtr; var Value: variant);override; + procedure PutFieldData(Field: TFieldDesc; RecBuf: IntPtr; Source: IntPtr); override; + function IsBlobFieldType(DataType: word): boolean; override; + + { Records } + procedure InsertRecord(RecBuf: IntPtr); override; + procedure UpdateRecord(RecBuf: IntPtr); override; + procedure DeleteRecord; override; + + { Sorting } + procedure SetIndexFieldNames(Value: string); override; + + { Filter/Find/Locate } + + procedure CreateComplexField(RecBuf: IntPtr; FieldIndex: integer; WithBlob: boolean); override; + procedure CreateComplexFields(RecBuf: IntPtr; WithBlob: boolean); override; + procedure FreeComplexFields(RecBuf: IntPtr; WithBlob: boolean); override; + + { Navigation } + procedure SetToBegin; override; + procedure SetToEnd; override; + //procedure GetBookmark(Bookmark: PRecBookmark); override; + procedure SetToBookmark(Bookmark: PRecBookmark); override; + function FetchToBookmarkValue(FetchBack: boolean = False): boolean; // Fetch to Bookmark. Bookmark value is stored in FBookmarkValue. Bookmark value used only for ctStatic and ctKeyset. For ctDynamic method refetched current record in specified direction + function CompareBookmarks(Bookmark1, Bookmark2: PRecBookmark): integer; override; + + function RowsReturn: boolean; override; + + function GetIRowset: IRowset; + function GetICommandText: ICommandText; + procedure SetIRowset( + Rowset: IRowset; + const IsColumnsRowset: boolean); // If True then FieldDescs was stored in FColumnsRowsetFieldDescs + + function GetProp(Prop: integer; var Value: variant): boolean; override; + function SetProp(Prop: integer; const Value: variant): boolean; override; + + property NativeRowset: boolean read FNativeRowset; + property CursorTypeChanged: TCursorTypeChangedProc read FCursorTypeChanged write FCursorTypeChanged; + + property FetchExecutor: TOLEDBThreadWrapper read FFetchExecutor; + end; + +{ TOLEDBPropertiesSet } + + TOLEDBPropertiesSet = class + protected + FConnection: TOLEDBConnection; + FInitPropSet: PDBPROPSET; + + procedure Check(const Status: HRESULT); + function GetInitPropSetStatus: string; + function GetDBPropPtr(Index: UINT): PDBProp; + + function InitProp(const dwPropertyID: DBPROPID; const Required: boolean = False): PDBProp; + + public + constructor Create(Connection: TOLEDBConnection; const GuidPropertySet: TGUID); + destructor Destroy; override; + +// procedure AddProp(const dwPropertyID: DBPROPID; const Value: OleVariant); + procedure AddPropSmallInt(const dwPropertyID: DBPROPID; const Value: smallint); + + procedure AddPropInt(const dwPropertyID: DBPROPID; const Value: integer); + procedure AddPropBool(const dwPropertyID: DBPROPID; const Value: boolean; const Required: boolean = False); + procedure AddPropStr(const dwPropertyID: DBPROPID; const Value: string; const Required: boolean = False); + + procedure SetProperties(Obj: IDBProperties); overload; + procedure SetProperties(Obj: ISessionProperties); overload; + procedure SetProperties(Obj: ICommandProperties); overload; + + property InitPropSet: PDBPROPSET read FInitPropSet; + end; + +{ TOLEDBPropertiesGet } + + TPropValues = array of Variant; + + TOLEDBPropertiesGet = class + protected + FConnection: TOLEDBConnection; + FInitPropSet: PDBPROPSET; + + FPropIds: array of DBPROPID; + FPropIdsGC: IntPtr; + + procedure Check(const Status: HRESULT); + function GetDBPropPtr(rgProperties: PDBPropArray; Index: UINT): PDBProp; + + procedure PrepareToGet; + procedure ProcessResult(rgPropertySets: PDBPropSet; var PropValues: TPropValues); + procedure ClearResult(rgPropertySets: PDBPropSet); + + public + constructor Create(Connection: TOLEDBConnection; const GuidPropertySet: TGUID); + destructor Destroy; override; + + procedure AddPropId(Id: DBPROPID); + + procedure GetProperties(Obj: IDBProperties; var PropValues: TPropValues); overload; + procedure GetProperties(Obj: IRowsetInfo; var PropValues: TPropValues); overload; + procedure GetProperties(Obj: ICommandProperties; var PropValues: TPropValues); overload; + end; + +{ TOLEDBErrors } + EOLEDBError = class; + + TOLEDBErrors = class + protected + FList: TList; + + function GetCount: integer; + function GetError(Index: Integer): EOLEDBError; + + procedure Assign(Source: TOLEDBErrors); + procedure Clear; + + public + constructor Create; + destructor Destroy; override; + + property Count: integer read GetCount; + property Errors[Index: Integer]: EOLEDBError read GetError; default; + end; + +{ EOLEDBError } + +{$IFDEF LITE} + EOLEDBError = class(Exception) + protected + FErrorCode: integer; + + public + property ErrorCode: integer read FErrorCode; + +{$ELSE} + EOLEDBError = class(EDAError) +{$ENDIF} + protected + FErrors: TOLEDBErrors; + FOLEDBErrorCode: integer; + + // GetBasicErrorInfo - ERRORINFO struct + // FhrError: HResult; - equal to FOLEDBErrorCode + // FMinor: UINT; - only for EMSError and equal to FMSSQLErrorCode + // Fclsid: TGUID; - always CLSID_SQLOLEDB + Fiid: TGUID; + // Fdispid: Integer; - always 0 + + // GetErrorInfo - IErrorInfo interface + // Fguid: TGUID; - same as Fiid + // FSource: WideString; - always "Microsoft OLE DB Provider for SQL Server" + // FDescription: WideString; - equal to Message + // FHelpFile: WideString; - not used by sqloledb + // FHelpContext: Longint; - not used by sqloledb + + FMessageWide: WideString; + + function GetErrorCount: integer; + function GetError(Index: Integer): EOLEDBError; + + procedure Assign(Source: EOLEDBError); virtual; + + protected + property iid: TGUID read Fiid; + + public + constructor Create(ErrorCode: integer; Msg: WideString); + destructor Destroy; override; + + property ErrorCount: integer read GetErrorCount; + property Errors[Index: Integer]: EOLEDBError read GetError; default; + + property OLEDBErrorCode: integer read FOLEDBErrorCode; + property MessageWide: WideString read FMessageWide; + // property hrError: HResult read FhrError; + // property Minor: UINT read FMinor; + // property clsid: TGUID read Fclsid; + // property iid: TGUID read Fiid; - protected + // property dispid: Integer read Fdispid; + // property Source: WideString read FSource; + // property Description: WideString read FDescription; + end; + + +{ EMSError } + + EMSError = class(EOLEDBError) + protected + FMSSQLErrorCode: integer; + + FServerName: string; + FProcName: string; + FState: BYTE; + FSeverityClass: BYTE; + FLineNumber: WORD; + FLastMessage: string; + + procedure Assign(Source: EOLEDBError); override; + + public + constructor Create( + const pServerErrorInfo: SSERRORINFO; + OLEDBErrorCode: integer; + Msg: WideString); overload; + + property MSSQLErrorCode: integer read FMSSQLErrorCode; + property ServerName: string read FServerName; + property ProcName: string read FProcName; + property State: BYTE read FState; + property SeverityClass: BYTE read FSeverityClass; + property LineNumber: WORD read FLineNumber; + + property LastMessage: string read FLastMessage; + end; + + function ConvertInternalTypeToOLEDB(const InternalType: word; const IsParam: boolean; + ServerVersion: Integer): word; + + function ConvertOLEDBTypeToInternalFormat( + const OLEDBType: DBTYPE; + const IsLong: Boolean; + const EnableBCD, EnableFMTBCD: boolean; + const WideStrings: boolean; + const IsParam: boolean; + var InternalType: word; ServerVersion: Integer): boolean; + + function DBNumericToBCD(Value: TDBNumeric): TBCD; + function BcdToDBNumeric(const Bcd: TBcd): TDBNumeric; + + function DBNumericToDouble(Value: TDBNumeric): double; + function DoubleToDBNumeric(Value: double; Precision, Scale: integer): TDBNumeric; + + function IsLargeDataTypeUsed(const FieldDesc: TFieldDesc): boolean; overload; + function IsLargeDataTypeUsed(const ParamDesc: TParamDesc): boolean; overload; + + function GetProviderName(const Provider: TOLEDBProvider): string; + function GetProvider(const ProviderName: string): TOLEDBProvider; +const + slDelimiter = #1; + + function BracketIfNeed(const Value: string): string; overload; + function BracketIfNeed(const Value: string; const LeftQ: char; const RightQ: char): string; overload; + function UnbracketIfPossible(const Value: string): string; overload; + function UnbracketIfPossible(const Value: string; var sl: string {Result parts in reverse order delimited by slDelimiter}): string; overload; + function UnbracketIfPossible(const Value: string; out DataBase: string; out Owner: string; out ObjName: string): string; overload; + + function GenerateTableName(const CatalogName: string; + const SchemaName: string; + const TableName: string; + const DefaultCatalogName: string): string; + + function ChangeDecimalSeparator(const Value: Variant): string; + function GetParamNameWODog(const ParamName: string): string; + +{$IFDEF CLR} + procedure QueryIntf(Source: IUnknown; const IID: TInterfaceRef; out Intf); // OLE QueryInterface analog +{$ELSE} + procedure QueryIntf(Source: IUnknown; const IID: TGuid; out Intf); // OLE QueryInterface analog +{$ENDIF} + +{$IFDEF DEBUG} +var + StreamCnt: integer = 0; +{$ENDIF} + +var + __UseRPCCallStyle: boolean; // temporary + ParamsInfoOldBehavior: boolean; // delete 03.06.2006 + +//procedure AddInfoToErr(var S: string; const FormatStr: string; const Args: array of const); overload; // Add additional info to exception message +procedure AddInfoToErr(var E: Exception; const FormatStr: string; const Args: array of const); overload; // Add additional info to exception message + +{$IFDEF SDAC_TEST} +var + __ServerPrepareCount: integer; + __ServerExecuteCount: integer; + __SetCommandPropCount: integer; + __SetRecordSetCommandPropCount: integer; + +{$ENDIF} + +const + LeftQuote = '['; + RightQuote = ']'; + EmptyString = ''; +const + BytesByRef = [dtBlob, dtBytes, dtVarBytes]; + CharsByRef = [dtMemo, dtWideMemo, dtMSXML, dtString, dtWideString]; + +procedure FillBindingForParam(Ordinal: integer; ParamDesc: TOLEDBParamDesc; Connection: TOLEDBConnection; + var pBind: TDBBinding; var BindMemorySize: UINT; const ValueAvaliable: boolean; const IsWide: boolean); + +procedure SaveParamValue(const ParamDesc: TParamDesc; const pBind: TDBBinding; + var ParamsAccessorData: TParamsAccessorData + {$IFDEF HAVE_COMPRESS}; const CompressBlobMode: TCompressBlobMode{$ENDIF} + {$IFDEF CLR}; var ParamsGC: TIntPtrDynArray{$ENDIF}; ServerVersion, ClientVersion: integer); + +implementation + +uses + MemUtils, +{$IFDEF VER6P} + DateUtils, +{$ENDIF} +{$IFDEF CLR} + System.Text, System.Runtime.InteropServices, System.Globalization, System.IO, System.Threading, +{$ELSE} +{$IFDEF VER6P} + Variants, +{$ENDIF} +{$ENDIF} + CRParser, MSParser, Math; + +type + TOLEDBStream = class(TInterfacedObject, ISequentialStream) + protected + FSize: UINT; + FBlob: TBlob; + FPosInBlob: cardinal; + FStreamList: TList; + + public + {$IFDEF CLR} + [PreserveSig] + function Read( + pv: IntPtr; + cb: Longint; + pcbRead: PLongint): HResult; + + [PreserveSig] + function Write( + pv: IntPtr; + cb: Longint; + pcbWritten: PLongint): HResult; + {$ELSE} + function Read(pv: IntPtr; cb: Longint; pcbRead: PLongint): HResult; + stdcall; + function Write(pv: IntPtr; cb: Longint; pcbWritten: PLongint): HResult; + stdcall; + {$ENDIF} + + public + constructor Create(Blob: TBlob {to avoid data copy}; StreamList: TList); + destructor Destroy; override; + + property Size: UINT read FSize; // Return size of stream in bytes + end; + +const + MaxLength = 130; + SizeOfLongWord = 4; + +type +{$IFDEF CLR} + [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Auto)] +{$ENDIF} + RBigInteger = packed record + Data: array[0..MaxLength - 1] of LongWord; + DataLength: integer; + end; + +const + SizeOfRBigInteger = 524; + +type + PBigInteger = IntPtr; + + TBigIntegerAccessor = class + protected + FSelfAllocated: boolean; + FBigIntegerPtr: PBigInteger; + procedure SetBigIntegerPtr(Value: PBigInteger); + function GetDataLength: integer; + procedure SetDataLength(Value: integer); + function GetDataPtr: IntPtr; + function GetData(Index: integer): LongWord; + procedure SetData(Index: integer; Value: LongWord); + function GetBigInteger: RBigInteger; + procedure SetBigInteger(const Value: RBigInteger); + public + constructor Create(BigIntegerPtr: PBigInteger; Allocate: boolean); + destructor Destroy; override; + procedure ClearData; + property DataLength: integer read GetDataLength write SetDataLength; + property DataPtr: IntPtr read GetDataPtr; + property Data[Index: integer]: LongWord read GetData write SetData; + property BigIntegerPtr: PBigInteger read FBigIntegerPtr write SetBigIntegerPtr; + property BigInteger: RBigInteger read GetBigInteger write SetBigInteger; + end; + + TBigInteger = class + public + class procedure CreatePBigIntegerPtr(PBigInt: PBigInteger); + class procedure CreateRBigIntegerStruct(var BigInt: RBigInteger); + class procedure CreatePBigInteger64(PBigInt: PBigInteger; Value: Int64); + class procedure CreatePBigIntegerBCD(PBigInt: PBigInteger; const Value: TBcd); + + class function Add(PBigInt1: PBigInteger; PBigInt2: PBigInteger): RBigInteger; + class function NEGATEPtr(PBigInt: PBigInteger): RBigInteger; + class function NEGATE(const BigInt: RBigInteger): RBigInteger; + class function Mul(PBigInt1: PBigInteger; PBigInt2: PBigInteger): RBigInteger; + class function Mul64(PBigInt1: PBigInteger; Value: Int64): RBigInteger; + end; + +var + dstSmallint: IntPtr; + dstInt: IntPtr; + dstReal: IntPtr; + dstFloat: IntPtr; + dstMoney: IntPtr; + dstDateTime: IntPtr; + dstNVarChar: IntPtr; + dstNVarCharMax: IntPtr; + dstVarChar: IntPtr; + dstVarCharMax: IntPtr; + + dstBit: IntPtr; + dstTinyInt: IntPtr; + dstBigint: IntPtr; + dstSql_variant: IntPtr; + dstImage: IntPtr; + dstBinary: IntPtr; + dstVarBinary: IntPtr; + dstGuid: IntPtr; + +var + IsWindowsVista: boolean; +{$IFNDEF CLR} + GlobaIMalloc: IMalloc; +{$ENDIF} + +procedure FreeCoMem(ptr: IntPtr); +begin +{$IFDEF CLR} + Marshal.FreeCoTaskMem(ptr); +{$ELSE} + if GlobaIMalloc = nil then + CoGetMalloc(1, GlobaIMalloc); + GlobaIMalloc.Free(ptr); +{$ENDIF} +end; + +{$IFDEF LITE} +procedure DatabaseError(const Message: string; Component: TComponent = nil); +begin + if Assigned(Component) and (Component.Name <> '') then + raise Exception.Create(Format('%s: %s', [Component.Name, Message])) else + raise Exception.Create(Message); +end; + +procedure DatabaseErrorFmt(const Message: string; const Args: array of const; + Component: TComponent = nil); +begin + DatabaseError(Format(Message, Args), Component); +end; +{$ENDIF} + +procedure AddInfoToErr(var S: WideString; const FormatStr: string; const Args: array of const); overload; // Add additional info to exception message +var + s1: WideString; +begin + s1 := Format(FormatStr, Args); + if s1 <> '' then + S := S + #10 + s1; +end; + +procedure AddInfoToErr(var E: Exception; const FormatStr: string; const Args: array of const); overload; // Add additional info to exception message +var + S: WideString; +{ $IFDEF CLR} + ENew: Exception; +{ $ENDIF} +begin + if IsClass(E, EOLEDBError) then + S := EOLEDBError(E).MessageWide + else + S := E.Message; + AddInfoToErr(S, FormatStr, Args); +{ $IFDEF CLR} + if IsClass(E, EMSError) then begin + ENew := EMSError.Create(EMSError(E).ErrorCode, S); + EMSError(ENew).Assign(EMSError(E)); + end + else + if IsClass(E, EOLEDBError) then begin + ENew := EOLEDBError.Create(EOLEDBError(E).ErrorCode, S); + EOLEDBError(ENew).Assign(EOLEDBError(E)); + end + else +{$IFNDEF LITE} + if IsClass(E, EDAError) then + ENew := EDAError.Create(EDAError(E).ErrorCode, S) + else +{$ENDIF} + ENew := Exception.Create(S); + E := ENew; +{ $ELSE} +// E.Message := S; +{ $ENDIF} +end; + +{$WARNINGS OFF} +function ConvertInternalTypeToOLEDB(const InternalType: word; const IsParam: boolean; + ServerVersion: Integer): word; +begin + case InternalType of + // Integer fields + dtBoolean: + Result := DBTYPE_BOOL; + dtInt8: + if ServerVersion <> 3 then + Result := DBTYPE_I1 + else + Result := DBTYPE_UI1; + dtWord: + if ServerVersion <> 3 then + Result := DBTYPE_I2 + else + Result := DBTYPE_UI2; + dtInt16: + Result := DBTYPE_I2; + dtInt32: + Result := DBTYPE_I4; + dtUInt32: + Result := DBTYPE_UI4; + dtInt64: + Result := DBTYPE_I8; + + // Float fields + dtFloat: + Result := DBTYPE_R8; + dtCurrency: + if ServerVersion <> 3 then + Result := DBTYPE_R8 + // Result := DBTYPE_CY; Currency type cannot be used over TCurrencyField uses double to store + else + Result := DBTYPE_CY; + // Multibyte fields + dtDateTime: + if ServerVersion <> 3 then + Result := DBTYPE_DATE + else + Result := DBTYPE_DBTIMESTAMP; + dtDate, dtTime: + Result := DBTYPE_DATE; + dtString: + Result := DBTYPE_STR; + dtWideString: + Result := DBTYPE_WSTR; + dtExtString: + Result := DBTYPE_STR; + dtExtWideString: + Result := DBTYPE_WSTR; + dtBytes, dtVarBytes: + Result := DBTYPE_BYTES; + dtExtVarBytes: + Result := DBTYPE_BYTES; + dtMemo, dtWideMemo, dtMSXML, dtBlob: + Result := DBTYPE_IUNKNOWN; + {$IFDEF VER5P} + dtGuid: + Result := DBTYPE_GUID; + dtVariant: + Result := DBTYPE_VARIANT; + {$ENDIF} + dtBCD: + if ServerVersion <> 3 then + Result := DBTYPE_CY + else + Result := DBTYPE_NUMERIC; + {$IFDEF VER6P} + dtFmtBCD: + if IsParam and (ServerVersion <> 3) then + Result := DBTYPE_STR + else + Result := DBTYPE_NUMERIC; + {$ENDIF} + dtUnknown: + Result := DBTYPE_VARIANT; + else + Assert(False, Format('Invalid internal field type $%X (%d)', [InternalType, InternalType])); + end; +end; +{$WARNINGS ON} + +function ConvertOLEDBTypeToInternalFormat( + const OLEDBType: DBTYPE; + const IsLong: boolean; + const EnableBCD, EnableFMTBCD: boolean; + const WideStrings: boolean; + const IsParam: boolean; + var InternalType: word; ServerVersion: Integer): boolean; +begin + Result := True; + case OLEDBType of // List of types must be synchronized with InternalInitFields types list + // Integer fields + DBTYPE_BOOL: + InternalType := dtBoolean; + DBTYPE_UI1: + InternalType := dtWord; + DBTYPE_I2: + InternalType := dtInt16; + DBTYPE_I4: + InternalType := dtInt32; + DBTYPE_UI2, DBTYPE_UI4:{WAR For OLE DB info only. Signed/unsigned conversion} + if ServerVersion <> 3 then + InternalType := dtInt32 + else + case OLEDBType of + DBTYPE_UI2: + InternalType := dtUInt16; + DBTYPE_UI4: + InternalType := dtUInt32; + end; + DBTYPE_I8: + InternalType := dtInt64; + + // Float fields + DBTYPE_NUMERIC: + if EnableBCD then begin + {$IFDEF VER6P} + if EnableFMTBCD then + InternalType := dtFmtBCD + else + {$ENDIF} + InternalType := dtBCD; + end + else + InternalType := dtFloat; + DBTYPE_R4, DBTYPE_R8: + InternalType := dtFloat; + DBTYPE_CY: + InternalType := dtCurrency; + + // Multibyte fields + DBTYPE_DBTIMESTAMP, DBTYPE_DATE: + InternalType := dtDateTime; + DBTYPE_STR: + begin + if IsLong then + InternalType := dtMemo + else + InternalType := dtString; + end; + DBTYPE_WSTR: + begin + if IsLong then begin + if WideStrings then + InternalType := dtWideMemo + else + InternalType := dtMemo; + end + else + if WideStrings then + InternalType := dtWideString + else + InternalType := dtString; + end; + DBTYPE_BYTES: + begin + if IsLong then + InternalType := dtBlob + else + InternalType := dtBytes; + end; + DBTYPE_GUID: + {$IFDEF VER5P} + InternalType := dtGuid; + {$ELSE} + InternalType := dtString; + {$ENDIF} + DBTYPE_VARIANT: + {$IFDEF VER5P} + {$IFDEF LITE} + InternalType := dtString; + {$ELSE} + {$IFDEF CLR} + if IsParam and (ServerVersion = 9) then + InternalType := dtVariant + else + InternalType := dtString; + {$ELSE} + InternalType := dtVariant; + {$ENDIF} + {$ENDIF} + {$ELSE} + InternalType := dtString; + {$ENDIF} + DBTYPE_XML: + InternalType := dtMSXML; + DBTYPE_UDT: + InternalType := dtVarBytes; + else + Result := False; + end; +end; + +function ConvertCRParamTypeToOLEDB(const InternalType: TParamDirection): word; +begin + case InternalType of + pdUnknown: + Result := DBPARAMIO_INPUT; + pdInput: + Result := DBPARAMIO_INPUT; + pdOutput, pdResult: + Result := DBPARAMIO_OUTPUT; + pdInputOutput: + Result := DBPARAMIO_INPUT + DBPARAMIO_OUTPUT; + else + Result := DBPARAMIO_INPUT; + end; +end; + +{$WARNINGS OFF} +function ConvertOLEDBParamTypeToCR(const Value: word): TParamDirection; +begin + case Value of + DBPARAMTYPE_INPUT: + Result := pdInput; + DBPARAMTYPE_INPUTOUTPUT: + Result := pdInputOutput; + DBPARAMTYPE_RETURNVALUE: + Result := pdResult; + else + Assert(False, Format('Invalid value %d', [Value])); + end; +end; +{$WARNINGS ON} + +{$WARNINGS OFF} +function ConvertIsolationLevelToOLEDBIsoLevel(const Value: TIsolationLevel):Integer; +begin + case Value of + ilReadCommitted: + Result := ISOLATIONLEVEL_READCOMMITTED; + ilReadUnCommitted: + Result := ISOLATIONLEVEL_READUNCOMMITTED; + ilRepeatableRead: + Result := ISOLATIONLEVEL_REPEATABLEREAD; + ilIsolated: + Result := ISOLATIONLEVEL_ISOLATED; + ilSnapshot: + Result := ISOLATIONLEVEL_SNAPSHOT; + else + Assert(False, Format('Invalid value %d', [Integer(Value)])); + end; +end; +{$WARNINGS ON} + +{$IFNDEF CLR} +const + SizeOfFraction = 32; +{$ENDIF} + +function DBNumericToBCD(Value: TDBNumeric): TBCD; +var + i, j, k: integer; + SignificantBytes: integer; + Remainder, tmp: word; +{$IFDEF CLR} + ResultCLR: array[0..33] of byte; +{$ENDIF} + function FindStart: boolean; + begin + SignificantBytes := 16; + while (SignificantBytes > 0) and (Value.Val[SignificantBytes - 1] = 0) do + dec(SignificantBytes); + Result := SignificantBytes > 0; + end; + +begin + if Value.Sign = 0 then + {$IFDEF CLR}ResultCLR[1]{$ELSE}Result.SignSpecialPlaces{$ENDIF} := (1 shl 7) + Value.Scale + else + {$IFDEF CLR}ResultCLR[1]{$ELSE}Result.SignSpecialPlaces{$ENDIF} := (0 shl 7) + Value.Scale; + + if not FindStart then begin + {$IFDEF CLR} + for i := 2 to 33 do + ResultCLR[i] := 0; + Result.FromBytes(ResultCLR); + {$ELSE} + System.FillChar(Result.Fraction, Length(Result.Fraction), 0); + {$ENDIF} + + {$IFDEF CLR}ResultCLR[0]{$ELSE}Result.Precision{$ENDIF} := 8; // if value is zero + {$IFDEF CLR}ResultCLR[1]{$ELSE}Result.SignSpecialPlaces{$ENDIF} := 2; + + {$IFDEF CLR} + Result.FromBytes(ResultCLR); + {$ENDIF} + exit; + end; + + {$IFDEF CLR} + for i := 2 to 33 do + ResultCLR[i] := 0; + Result.FromBytes(ResultCLR); + {$ELSE} + System.FillChar(Result.Fraction, Length(Result.Fraction), 0); + {$ENDIF} + + k := SignificantBytes - 1; + j := 31; + while k >= 0 do begin + Remainder := 0; + for i := k downto 0 do begin + tmp := (Byte(Value.Val[i]) + Remainder); + Value.Val[i] := tmp div 100; + Remainder := (tmp mod 100) shl 8; + end; + {$IFDEF CLR}ResultCLR[j + 2]{$ELSE}Result.Fraction[j]{$ENDIF} := (((Remainder shr 8) mod 10)) + (((Remainder shr 8) div 10) shl 4); + if Value.Val[k] = 0 then + dec(k); + dec(j); + end; + + {$IFDEF CLR}ResultCLR[0]{$ELSE}Result.Precision{$ENDIF} := Value.Precision; + i := 31 - (Value.Precision div 2); + j := i; + + if (Value.Precision mod 2) = 1 then begin + while i <= 30 do begin + {$IFDEF CLR}ResultCLR[i - j + 2]{$ELSE}Result.Fraction[i - j]{$ENDIF} := + ({$IFDEF CLR}ResultCLR[i + 2]{$ELSE}Result.Fraction[i]{$ENDIF} and $0f) shl 4 + + {$IFDEF CLR}ResultCLR[i + 1 + 2]{$ELSE}Result.Fraction[i + 1]{$ENDIF} shr 4; + inc(i); + end; + {$IFDEF CLR}ResultCLR[i - j + 2]{$ELSE}Result.Fraction[i - j]{$ENDIF} := + ({$IFDEF CLR}ResultCLR[i + 2]{$ELSE}Result.Fraction[i]{$ENDIF} and $0f) shl 4; + end + else begin + while i <= 30 do begin + {$IFDEF CLR}ResultCLR[i - j + 2]{$ELSE}Result.Fraction[i - j]{$ENDIF} := + {$IFDEF CLR}ResultCLR[i + 1 + 2]{$ELSE}Result.Fraction[i + 1]{$ENDIF}; + inc(i); + end; + end; + + for i := 31 - j + 1 to 31 do + {$IFDEF CLR}ResultCLR[i + 2]{$ELSE}Result.Fraction[i]{$ENDIF} := 0; +{$IFDEF CLR} + Result := TBcd.FromBytes(ResultCLR); +{$ENDIF} +end; + +{$IFNDEF VER6P} +function IsBcdNegative(const Bcd: TBcd): Boolean; +begin + Result := (Bcd.SignSpecialPlaces and (1 shl 7)) <> 0; +end; +{$ENDIF} + +function BcdToDBNumeric(const Bcd: TBcd): TDBNumeric; +var + Value: TBigIntegerAccessor; + BytesCount: integer; +{$IFDEF CLR} + i: integer; +{$ENDIF} +begin + Value := TBigIntegerAccessor.Create(nil, True); + try + Value.ClearData; + TBigInteger.CreatePBigIntegerBCD(Value.BigIntegerPtr, Bcd); + + if Value.DataLength > (Length(Result.val) div SizeOfLongWord) then + raise Exception.Create(SNumericOverflow); + + Result.precision := Bcd.Precision; + + Result.scale := Bcd.SignSpecialPlaces and $3F; + + if IsBcdNegative(Bcd) then + Result.Sign := 0 + else + Result.Sign := 1; + + BytesCount := Result.precision div 2; + if (Result.precision mod 2) <> 0 then + Inc(BytesCount); + {$IFDEF CLR} + for i := 0 to BytesCount - 1 do + Result.val[i] := Marshal.ReadByte(Value.DataPtr, i); + {$ELSE} + FillChar(@Result.val[0], Length(Result.val), $00); + CopyBuffer(Value.DataPtr, @Result.val[0], BytesCount); + {$ENDIF} + finally + Value.Free; + end; +end; + +{$IFNDEF VER6P} +const + MaxFMTBcdFractionSize = 64; + SInvalidBcdValue = '%s is not a valid BCD value'; + +type +{ Exception classes } + + EBcdException = class(Exception); + EBcdOverflowException = class(EBcdException); + +procedure OverflowError(const Message: string); +begin + raise EBcdOverflowException.Create(Message); +end; + +procedure BcdErrorFmt(const Message, BcdAsString: string); +begin + raise EBcdException.Create(Format(Message, [BcdAsString])); +end; + +function FractionToStr(const pIn: PChar; count: SmallInt; + DecPosition: ShortInt; Negative: Boolean; + StartWithDecimal: Boolean): string; +var + NibblesIn, BytesIn, DigitsOut: Integer; + P, POut: PChar; + Dot: Char; + + procedure AddOneChar(Value: Char); + begin + P[0] := Value; + Inc(P); + Inc(DigitsOut); + end; + procedure AddDigit(Value: Char); + begin + if ((DecPosition > 0) and (NibblesIn = DecPosition)) or + ((NibblesIn = 0) and StartWithDecimal) then + begin + if DigitsOut = 0 then AddOneChar('0'); + AddOneChar(Dot); + end; + if (Value > #0) or (DigitsOut > 0) then + AddOneChar(Char(Integer(Value)+48)); + Inc(NibblesIn); + end; + +begin + POut := AllocMem(Count + 3); // count + negative/decimal/zero + try + Dot := DecimalSeparator; + P := POut; + DigitsOut := 0; + BytesIn := 0; + NibblesIn := 0; + while NibblesIn < Count do + begin + AddDigit(Char(Integer(pIn[BytesIn]) SHR 4)); + if NibblesIn < Count then + AddDigit(Char(Integer(pIn[BytesIn]) AND 15)); + Inc(BytesIn); + end; + while (DecPosition > 0) and (NibblesIn > DecPosition) and (DigitsOut > 1) do + begin + if POut[DigitsOut-1] = '0' then + begin + Dec(DigitsOut); + POut[DigitsOut] := #0; + end else + break; + end; + if POut[DigitsOut-1] = Dot then + Dec(DigitsOut); + POut[DigitsOut] := #0; + SetString(Result, POut, DigitsOut); + finally + FreeMem(POut, Count + 2); + end; + if Result = '' then Result := '0' + else if Negative then Result := '-' + Result; +end; + +function BcdToStr(const Bcd: TBcd): string; +var + NumDigits: Integer; + pStart: PChar; + DecPos: SmallInt; + Negative: Boolean; +begin + if (Bcd.Precision = 0) or (Bcd.Precision > MaxFMTBcdFractionSize) then + OverFlowError(SBcdOverFlow) + else + begin + Negative := Bcd.SignSpecialPlaces and (1 shl 7) <> 0; + NumDigits := Bcd.Precision; + pStart := pCHAR(@Bcd.Fraction); // move to fractions + // use lower 6 bits of iSignSpecialPlaces. + if (Bcd.SignSpecialPlaces and 63) > 0 then + begin + DecPos := ShortInt(NumDigits - (Bcd.SignSpecialPlaces and 63)); + end else + DecPos := NumDigits + 1; // out of range + Result := FractionToStr(pStart, NumDigits, DecPos, Negative, + (NumDigits = Bcd.SignSpecialPlaces and 63)); + if Result[1] in ['0', '-'] then + if (Result = '-0') or (Result = '0.0') or (Result = '-0.0') then Result := '0'; + end; +end; + +function BcdToDouble(const Bcd: TBcd): Double; +begin + Result := StrToFloat(BcdToStr(Bcd)); +end; + +function InvalidBcdString(PValue: PChar): Boolean; +var + Dot: Char; + P: PChar; +begin + Dot := DecimalSeparator; + P := PValue; + Result := False; + while P^ <> #0 do + begin + if not (P^ in ['0'..'9', '-', Dot]) then + begin + Result := True; + break; + end; + Inc(P); + end; +end; + +procedure StrToFraction(pTo: PChar; pFrom: PChar; count: SmallInt); pascal; +var + Dot: Char; +begin + Dot := DecimalSeparator; + asm + // From bytes to nibbles, both left aligned + PUSH ESI + PUSH EDI + PUSH EBX + MOV ESI,pFrom // move pFrom to ESI + MOV EDI,pTo // move pTo to EDI + XOR ECX,ECX // set ECX to 0 + MOV CX,count // store count in CX + MOV DL,0 // Flag: when to store + CLD +@@1: LODSB // moves [ESI] into al + CMP AL,Dot + JE @@4 + SUB AL,'0' + CMP DL,0 + JNE @@2 + SHL AL,4 + MOV AH,AL + JMP @@3 +@@2: OR AL,AH // takes AH and ors in AL + STOSB // always moves AL into [EDI] +@@3: NOT dl // flip all bits +@@4: LOOP @@1 // decrements cx and checks if it's 0 + CMP DL,0 // are any bytes left unstored? + JE @@5 + MOV AL,AH // if so, move to al + STOSB // and store to [EDI] +@@5: POP EBX + POP EDI + POP ESI + end; +end; + +function TryStrToBcd(const AValue: string; var Bcd: TBcd): Boolean; +const + spaceChars: set of Char = [ ' ', #6, #10, #13, #14]; + digits: set of Char = ['0'..'9']; +var + Neg: Boolean; + NumDigits, DecimalPos: Word; + pTmp, pSource: PChar; + Dot : Char; +begin + Dot := DecimalSeparator; + if InvalidBcdString(PChar(AValue)) then + begin + Result := False; + exit; + end; + if (AValue = '0') or (AValue = '') then + begin + Result := True; + Bcd.Precision := 8; + Bcd.SignSpecialPlaces := 2; + pSource := PChar(@Bcd.Fraction); + System.FillChar(PSource^, SizeOf(Bcd.Fraction), 0); + Exit + end; + Result := True; + Neg := False; + DecimalPos := Pos(Dot, AValue); + + pSource := pCHAR(AValue); + { Strip leading whitespace } + while (pSource^ in spaceChars) or (pSource^ = '0') do + begin + Inc(pSource); + if DecimalPos > 0 then Dec(DecimalPos); + end; + + { Strip trailing whitespace } + pTmp := @pSource[ StrLen( pSource ) -1 ]; + while pTmp^ in spaceChars do + begin + pTmp^ := #0; + Dec(pTmp); + end; + + { Is the number negative? } + if pSource^ = '-' then + begin + Neg := TRUE; + if DecimalPos > 0 then Dec(DecimalPos); + end; + if (pSource^ = '-') or (pSource^ ='+') then + Inc(pSource); + + { Clear structure } + pTmp := pCHAR(@Bcd.Fraction); + System.FillChar(pTmp^, SizeOf(Bcd.Fraction), 0); + if (pSource[0] = '0') then + begin + Inc(PSource); // '0.' scenario + if DecimalPos > 0 then Dec(DecimalPos); + end; + NumDigits := StrLen(pSource); + if (NumDigits > MaxFMTBcdFractionSize) then + begin + if (DecimalPos > 0) and (DecimalPos <= MaxFMTBcdFractionSize) then + NumDigits := MaxFMTBcdFractionSize // truncate to 64 + else begin + Bcd.Precision := NumDigits; + Exit; + end; + end; + + if NumDigits > 0 then + StrToFraction(pTmp, pSource, SmallInt(NumDigits)) + else begin + Bcd.Precision := 10; + Bcd.SignSpecialPlaces := 2; + end; + + if DecimalPos > 0 then + begin + Bcd.Precision := Byte(NumDigits-1); + if Neg then + Bcd.SignSpecialPlaces := ( 1 shl 7 ) + (BYTE(NumDigits - DecimalPos)) + else + Bcd.SignSpecialPlaces := ( 0 shl 7 ) + (BYTE(NumDigits - DecimalPos)); + end else + begin + Bcd.Precision := Byte(NumDigits); + if Neg then + Bcd.SignSpecialPlaces := (1 shl 7) + else + Bcd.SignSpecialPlaces := (0 shl 7); + end; +end; + +function StrToBcd(const AValue: string): TBcd; +var + Success: Boolean; +begin + Success := TryStrToBcd(AValue, Result); + if not Success then + BcdErrorFmt(SInvalidBcdValue, AValue); +end; + +{$ENDIF} + +function DBNumericToDouble(Value: TDBNumeric): double; +var + Bcd: TBcd; +begin + Bcd := DBNumericToBcd(Value); + Result := BcdToDouble(Bcd); +end; + +function DoubleToDBNumeric(Value: double; Precision, Scale: integer): TDBNumeric; +var + Bcd: TBcd; + Str: string; +begin + //Str := FloatToStrF(Value, ffFixed, Precision, Scale); + if (Precision = 0) and (Scale = 0) then + Str := Format('%f', [Value]) + else + Str := Format('%.' + IntToStr(Scale) + 'f', [Value]); + Bcd := StrToBcd(Str); + Result := BcdToDBNumeric(Bcd); +end; + +function IsLargeDataTypeUsed(const FieldDesc: TFieldDesc): boolean; +begin + Result := FieldDesc.DataType = dtBlob; + if not Result then + Result := ((FieldDesc.DataType = dtMemo) or (FieldDesc.DataType = dtWideMemo)) and (((not dtWide) and FieldDesc.SubDataType) = dtText); + if not Result then + Result := FieldDesc.DataType = dtMSXML; +end; + +function IsLargeDataTypeUsed(const ParamDesc: TParamDesc): boolean; +begin + Result := + (ParamDesc.GetDataType = dtBlob) or + (ParamDesc.GetDataType = dtMemo) or + (ParamDesc.GetDataType = dtWideMemo) or + (ParamDesc.GetDataType = dtMSXML); +end; + +function IsOutputLOB(ParamDesc: TParamDesc; ServerVersion, ClientVersion: integer): boolean; +begin + Result := ((ParamDesc.GetDataType = dtMemo) or (ParamDesc.GetDataType = dtWideMemo)) and + (ParamDesc.GetParamType in [pdOutput, pdInputOutput]) and + (ServerVersion = 9) and + (ClientVersion = 9); +end; + +function GetProviderName(const Provider: TOLEDBProvider): string; +begin + case Provider of + prAuto, prSQL: + Result := 'SQLOLEDB.1'; + prNativeClient: + Result := 'SQLNCLI.1'; + prCompact: + Result := 'MICROSOFT.SQLSERVER.MOBILE.OLEDB.3.0'; + else + Assert(False); + Result := ''; + end; +end; + +function GetProvider(const ProviderName: string): TOLEDBProvider; +var + Name: string; +begin + Name := Uppercase(ProviderName); + if Name = SSQLOLEDB then + Result := prSQL + else + if Name = SSQLNativeClient then + Result := prNativeClient + else + if Name = SSQLEverywhere then + Result := prCompact + else + Result := prAuto; +end; + +// FetchBlock support +function IsNeedFetchBlock(const FieldDesc: TFieldDesc; ServerVersion: integer): boolean; // Return True if field need to fetch into separate buffer +var + DataType: word; +begin + Assert(FieldDesc.FieldDescKind = fdkData, 'IsNeedFetchBlock ' + FieldDesc.Name); + DataType := FieldDesc.DataType; + case DataType of + dtExtString, dtExtWideString, dtExtVarBytes, dtVariant: + Result := True; + dtMemo, dtWideMemo, dtMSXML: + Result := not IsLargeDataTypeUsed(FieldDesc); + dtFloat, dtBcd: + Result := (ServerVersion = 3) and (TOLEDBFieldDesc(FieldDesc).OLEDBType = DBTYPE_NUMERIC); + else + Result := False; + end; +end; + +procedure IncFetchBlockOffset(var FetchBlockOffset: integer; const DataType: TDataType); +begin + case DataType of + dtExtString, dtExtWideString: + Inc(FetchBlockOffset, OLE_DB_INDICATOR_SIZE + MaxNonBlobFieldLen + 2 {#0#0 terminator} + sizeof(UINT) {Length}); + dtMemo, dtWideMemo, dtMSXML: + Inc(FetchBlockOffset, OLE_DB_INDICATOR_SIZE + MaxNonBlobFieldLen + 2 {#0#0 terminator}); + dtExtVarBytes: + Inc(FetchBlockOffset, OLE_DB_INDICATOR_SIZE + MaxNonBlobFieldLen + sizeof(UINT) {Length}); + dtVariant: + Inc(FetchBlockOffset, OLE_DB_INDICATOR_SIZE + sizeof(OleVariant)); + dtFloat, dtBcd: + Inc(FetchBlockOffset, OLE_DB_INDICATOR_SIZE + SizeOfTDBNumeric); + else + Assert(False); + end; +end; + +// Brackets support +function IsBracketPresent(const Value: string): boolean; +var + l: integer; +begin + Assert(Pos('.', Value) = 0, 'In func IsBracketPresent delimited values not allowed'); + + l := Length(Value); + if (l <= 1) then + Result := False + else + Result := ((Value[1] = '"') and (Value[l] = '"')) or + ((Value[1] = '[') and (Value[l] = ']')); +end; + +function Unbracket(const Value: string): string; +begin + if IsBracketPresent(Value) then + Result := Copy(Value, 2, length(Value) - 2) + else + Result := Value; +end; + +function IsBracketNeed(Value: string): boolean; +var + i: integer; +begin + Assert(Pos('.', Value) = 0, 'In func IsBracketNeeds delimited values not allowed'); + + Value := Unbracket(Value); + Result := False; + for i := 1 to Length(Value) do + if i = 1 then + case Value[i] of + 'a'..'z', 'A'..'Z', '_', '@', '#':; // NoBracketableStartingChars = ['a'..'z', 'A'..'Z', '_', '@', '#']; + else + begin + Result := True; + Exit; + end; + end + else + case Value[i] of + 'a'..'z', 'A'..'Z', '_', '@', '#', '0'..'9', '$':; // NoBracketableChars = NoBracketableStartingChars + ['0'..'9', '$']; + else + begin + Result := True; + Exit; + end; + end; +end; + +// Rules see in MSDN (mk:@MSITStore:D:\Program%20Files\Microsoft%20Visual%20Studio\MSDN\2003JAN\1033\acdata.chm::/ac_8_con_03_89rn.htm, +// mk:@MSITStore:D:\Program%20Files\Microsoft%20Visual%20Studio\MSDN\2003JAN\1033\acdata.chm::/ac_8_con_03_6e9e.htm) +function BracketIfNeed(const Value: string): string; +begin + Result := BracketIfNeed(Value, Char('['), Char(']')); +end; + +function BracketIfNeed(const Value: string; const LeftQ: char; const RightQ: char): string; +var + i: integer; +begin + i := Pos('.', Value); + if i <> 0 then + Result := BracketIfNeed(Copy(Value, 1, i - 1)) + '.' + BracketIfNeed(Copy(Value, i + 1, Length(Value) - i)) + else + if not IsBracketPresent(Value) and + IsBracketNeed(Value) then + Result := LeftQ + Value + RightQ + else + Result := Value; +end; + +function UnbracketIfPossible(const Value: string; const NeedSl: boolean; var sl: String {Result parts in reverse order delimited by slDelimiter}): string; overload; +var +{$IFNDEF CLR} + p: PChar; +{$ENDIF} + DotPos: integer; + l: integer; +begin + Result := Value; + l := Length(Value); +{$IFDEF CLR} + DotPos := Value.IndexOf('.'); +{$ELSE} + p := StrScan(PChar(Value), '.'); // i := Pos('.', Value); + if p = nil then + DotPos := -1 + else + DotPos := p - PChar(Value); +{$ENDIF} + + if (l < 3) then begin + if (DotPos = -1) and NeedSl then + sl := Result + slDelimiter + sl; + Exit; + end; + + if DotPos <> -1 then begin +{ if DotPos = 0 then + Result := UnbracketIfPossible(Copy(Value, DotPos + 2, l - DotPos - 1), sl) + else} + Result := UnbracketIfPossible(Copy(Value, 1, DotPos), sl) + '.' + UnbracketIfPossible(Copy(Value, DotPos + 2, l - DotPos - 1), sl) + end + else + begin + if IsBracketPresent(Value) and + not IsBracketNeed(Value) then + Result := Copy(Value, 2, l - 2) + else + Result := Value; + if NeedSl then + sl := Result + slDelimiter + sl; + end; +end; + +function UnbracketIfPossible(const Value: string): string; overload; +var + sl: string; +begin + Result := UnbracketIfPossible(Value, False, sl); +end; + +function UnbracketIfPossible(const Value: string; var sl: string {Result parts in reverse order delimited by slDelimiter}): string; overload; +begin + Result := UnbracketIfPossible(Value, True, sl); +end; + +{$IFDEF CLR} +function UnbracketIfPossible(const Value: string; out DataBase: string; out Owner: string; out ObjName: string): string; +const + d: array[0..0] of char = (slDelimiter); +var + sl: string; + i: integer; + + SubSl: array of string; +begin + sl := ''; + UnbracketIfPossible(Value, sl); + if sl = '' then + Exit; + + SubSl := sl.Split(d); + i := Length(SubSl); + if i > 0 then begin + ObjName := SubSl[0]; + if i > 1 then begin + Owner := SubSl[1]; + if i > 2 then + Database := SubSl[2]; + end; + end; +end; +{$ELSE} +function UnbracketIfPossible(const Value: string; out DataBase: string; out Owner: string; out ObjName: string): string; + function GetSubStr(var Src: PChar): string; + var + p: PChar; + l: integer; + begin + p := StrScan(Src, slDelimiter); + if p = nil then + Result := '' + else + begin + l := p - Src; + SetLength(Result, l); + Move(Src^, PChar(Result)^, l); + Src := Src + l + 1{slDelimiter}; + end; + end; + +var + sl: string; + p: PChar; +begin + sl := ''; + UnbracketIfPossible(Value, sl); + if sl = '' then + Exit; + + p := PChar(sl); + ObjName := GetSubStr(p); + Owner := GetSubStr(p); + Database := GetSubStr(p); +end; +{$ENDIF} + +function GenerateTableName(const CatalogName: string; + const SchemaName: string; + const TableName: string; + const DefaultCatalogName: string): string; +begin + if (CatalogName <> '') and not SameText(CatalogName, DefaultCatalogName) then + Result := Format('%s.%s.%s', + [BracketIfNeed(CatalogName), + BracketIfNeed(SchemaName), + BracketIfNeed(TableName)]) + else + if SchemaName <> '' then + Result := Format('%s.%s', + [BracketIfNeed(SchemaName), + BracketIfNeed(TableName)]) + else + Result := Format('%s', + [BracketIfNeed(TableName)]); +end; + +function ChangeDecimalSeparator(const Value: Variant): string; +var + i: integer; +begin +{$IFDEF VER6P} + Result := Value; +{$ELSE} + if TVarData(Value).VType = varSingle then + Result := FloatToStr(TVarData(Value).VSingle) + else + if TVarData(Value).VType = varDouble then + Result := FloatToStr(TVarData(Value).VDouble) + else + Result := Value; +{$ENDIF} + if DecimalSeparator <> '.' then begin + i := 2; + while i < Length(Result) do begin + if Result[i] = DecimalSeparator then begin + Result[i] := '.'; + Break; + end; + Inc(i); + end; + end; +end; + +function GetParamNameWODog(const ParamName: string): string; +begin + if (ParamName <> '') and (ParamName[1] = '@') then + Result := Copy(ParamName, 2, 1000) + else + Result := ParamName; +end; + +{$IFDEF CLR} +procedure QueryIntf(Source: IUnknown; const IID: TInterfaceRef; out Intf); // OLE QueryInterface analog +begin + Assert(Source <> nil); + Intf := nil; + if Source is IID then + Intf := Source as IID + else + raise EOLEDBError.Create(E_NOINTERFACE, 'QueryInterface failed'); +end; + +{$ELSE} + +procedure QueryIntf(Source: IUnknown; const IID: TGuid; out Intf); // OLE QueryInterface analog +begin + Assert(Source <> nil); + if Source.QueryInterface(IID, Intf) <> S_OK then + raise EOLEDBError.Create(E_NOINTERFACE, 'QueryInterface failed'); +end; +{$ENDIF} + +function Min(const A, B: Integer): Integer; +begin + if A < B then + Result := A + else + Result := B; +end; + +{ TOLEDBParamDesc } + +function TOLEDBParamDesc.GetOLEDBType: DBTYPE; +begin + Result := FOLEDBType; +end; + +procedure TOLEDBParamDesc.SetOLEDBType(Value: DBTYPE); +begin + FOLEDBType := Value; +end; + +function TOLEDBParamDesc.GetUseDefaultValue: boolean; +begin + Result := FUseDefaultValue; +end; + +procedure TOLEDBParamDesc.SetUseDefaultValue(Value: boolean); +begin + FUseDefaultValue := Value; +end; + +function TOLEDBParamDesc.GetValue: variant; +begin + if not GetNull + and not VarIsEmpty(FData) + and not VarIsNull(FData) + {$IFDEF CLR} + and (FData is TSharedObject) + {$ELSE} + and (TVarData(FData).VType = varByRef) + {$ENDIF} + then begin + if GetAsBlobRef.IsUnicode then + Result := GetAsBlobRef.AsWideString + else + Result := GetAsBlobRef.AsString; + end + else + Result := inherited GetValue; +end; + +function TOLEDBParamDesc.GetAsBlobRef: TBlob; +begin + Result := TBlob({$IFDEF CLR}FData{$ELSE}TVarData(FData).VPointer{$ENDIF}); +end; + +procedure TOLEDBParamDesc.SetNull(const Value: boolean); +begin + FIsNull := Value; + if not((DataType = dtBlob) or (DataType = dtMemo) or (DataType = dtWideMemo)) then + FData := Unassigned; +end; +{ TExecuteThread } + +procedure TExecuteThread.InternalExecute; +begin + if Assigned(FRunMethod) then + FRunMethod; +end; + +{ TOLEDBThreadWrapper } + +procedure TOLEDBThreadWrapper.DoException(E: Exception); +begin + if E is EOLEDBError then begin + Assert(FException = nil); + FException := EOLEDBError.Create(EOLEDBError(E).ErrorCode, EOLEDBError(E).Message); + EOLEDBError(FException).Assign(EOLEDBError(E)); + end + else + inherited; +end; + +{ TOLEDBStream } + +constructor TOLEDBStream.Create(Blob: TBlob {to avoid data copy}; StreamList: TList); +begin + inherited Create; + + {$IFDEF DEBUG} Inc(StreamCnt); {$ENDIF} + + FBlob := Blob; + FPosInBlob := 0; + + FSize := Blob.Size; + FStreamList := StreamList; + + if FStreamList <> nil then + FStreamList.Add(Self); +end; + +destructor TOLEDBStream.Destroy; +begin + if FStreamList <> nil then + {$IFDEF CLR} + FStreamList.Remove(Self); + {$ELSE} + FStreamList.Remove(pointer(Self)); + {$ENDIF} + + inherited; + {$IFDEF DEBUG} Dec(StreamCnt); {$ENDIF} +end; + +function TOLEDBStream.Read( + pv: IntPtr; + cb: Longint; + pcbRead: PLongint +): HResult; +var + cbSrcReadBytes: longint; + cbDstWriteBytes: longint; + +begin + try + cbSrcReadBytes := Min(Integer(FSize - FPosInBlob), cb); + cbDstWriteBytes := FBlob.Read(FPosInBlob, cbSrcReadBytes, pv); + Inc(FPosInBlob, cbDstWriteBytes); + + if pcbRead <> nil then + Marshal.WriteInt32(pcbRead, cbDstWriteBytes); + Result := S_OK; + except + Result := S_FALSE; + end; +end; + +function TOLEDBStream.Write( + pv: IntPtr; + cb: Longint; + pcbWritten: PLongint +): HResult; +begin + try + FBlob.Write(FPosInBlob, cb, pv); + Inc(FPosInBlob, cb); + Inc(FSize, cb); + + if pcbWritten <> nil then + Marshal.WriteInt32(pcbWritten, cb); + Result := S_OK; + except + Result := S_FALSE; + end; +end; + +{ TBigIntegerAccessor } + +constructor TBigIntegerAccessor.Create(BigIntegerPtr: PBigInteger; Allocate: boolean); +begin + inherited Create; + + if not Allocate then + FBigIntegerPtr := BigIntegerPtr + else begin + FBigIntegerPtr := Marshal.AllocHGlobal(SizeOfRBigInteger); + FSelfAllocated := True; + end; +end; + +destructor TBigIntegerAccessor.Destroy; +begin + if FSelfAllocated then + Marshal.FreeHGlobal(FBigIntegerPtr); + + inherited; +end; + +procedure TBigIntegerAccessor.SetBigIntegerPtr(Value: PBigInteger); +begin + if FSelfAllocated then begin + Marshal.FreeHGlobal(FBigIntegerPtr); + FSelfAllocated := False; + end; + FBigIntegerPtr := Value; +end; + +function TBigIntegerAccessor.GetDataLength: integer; +begin + Result := Marshal.ReadInt32(FBigIntegerPtr, MaxLength * SizeOfLongWord) +end; + +procedure TBigIntegerAccessor.SetDataLength(Value: integer); +begin + Marshal.WriteInt32(FBigIntegerPtr, MaxLength * SizeOfLongWord, Value); +end; + +function TBigIntegerAccessor.GetDataPtr: IntPtr; +begin + Result := FBigIntegerPtr; +end; + +function TBigIntegerAccessor.GetData(Index: integer): LongWord; +begin + Result := LongWord(Marshal.ReadInt32(FBigIntegerPtr, Index * SizeOfLongWord)); +end; + +procedure TBigIntegerAccessor.SetData(Index: integer; Value: LongWord); +begin + Marshal.WriteInt32(FBigIntegerPtr, Index * SizeOfLongWord, Integer(Value)); +end; + +procedure TBigIntegerAccessor.ClearData; +var + i: integer; +begin + for i := 0 to MaxLength - 1 do + Data[i] := 0; +end; + +function TBigIntegerAccessor.GetBigInteger: RBigInteger; +{$IFDEF CLR} +var + i: integer; +{$ENDIF} +begin +{$IFDEF CLR} + Result.DataLength := GetDataLength; + for i := 0 to MaxLength - 1 do + Result.Data[i] := Data[i]; + //Result := RBigInteger(Marshal.PtrToStructure(FBigIntegerPtr, TypeOf(RBigInteger))); +{$ELSE} + Result := RBigInteger(FBigIntegerPtr^); +{$ENDIF} +end; + +procedure TBigIntegerAccessor.SetBigInteger(const Value: RBigInteger); +{$IFDEF CLR} +var + i: integer; +{$ENDIF} +begin + Assert(FBigIntegerPtr <> nil); +{$IFDEF CLR} + DataLength := Value.DataLength; + for i := 0 to MaxLength - 1 do + Data[i] := Value.Data[i]; + //Marshal.StructureToPtr(TObject(Value), FBigIntegerPtr, False); +{$ELSE} + RBigInteger(FBigIntegerPtr^) := Value; +{$ENDIF} +end; + +{ TBigInteger } + +class procedure TBigInteger.CreatePBigIntegerPtr(PBigInt: PBigInteger); +var + BigIntAcc: TBigIntegerAccessor; +begin + BigIntAcc := TBigIntegerAccessor.Create(PBigInt, False); + try + BigIntAcc.DataLength := 1; + BigIntAcc.ClearData; + finally + BigIntAcc.Free; + end; +end; + +class procedure TBigInteger.CreateRBigIntegerStruct(var BigInt: RBigInteger); +{$IFDEF CLR} +var + i: integer; +{$ENDIF} +begin + BigInt.DataLength := 1; +{$IFDEF CLR} + for i := 0 to MaxLength - 1 do + BigInt.Data[i] := 0; +{$ELSE} + MemUtils.FillChar(@BigInt.Data[0], MaxLength * SizeOfLongWord, $00); +{$ENDIF} +end; + +class procedure TBigInteger.CreatePBigInteger64(PBigInt: PBigInteger; Value: Int64); +var + BigIntAcc: TBigIntegerAccessor; +begin + BigIntAcc := TBigIntegerAccessor.Create(PBigInt, False); + try + BigIntAcc.ClearData; + BigIntAcc.DataLength := 0; + + while (Value <> 0) and (BigIntAcc.DataLength < MaxLength) do begin + BigIntAcc.Data[BigIntAcc.DataLength] := LongWord(Value and $FFFFFFFF); + Value := Value shr 32; + BigIntAcc.DataLength := BigIntAcc.DataLength + 1; + end; + + if (Value <> 0) or (LongWord(BigIntAcc.Data[MaxLength - 1] and $80000000) <> 0) then + raise Exception.Create('Positive overflow in constructor.'); + + if BigIntAcc.DataLength = 0 then + BigIntAcc.DataLength := 1; + finally + BigIntAcc.Free; + end; +end; + +class procedure TBigInteger.CreatePBigIntegerBCD(PBigInt: PBigInteger; const Value: TBcd); +var + Multiplier: TBigIntegerAccessor; + Result, Tmp: TBigIntegerAccessor; + BigIntAcc: TBigIntegerAccessor; + Radix: integer; + posVal: Integer; + Val: TBytes; + i: Integer; + k: integer; +begin + Multiplier := nil; + Result := nil; + Tmp := nil; + BigIntAcc := nil; + try + Multiplier := TBigIntegerAccessor.Create(nil, True); + Result := TBigIntegerAccessor.Create(nil, True); + Tmp := TBigIntegerAccessor.Create(nil, True); + BigIntAcc := TBigIntegerAccessor.Create(PBigInt, False); + + TBigInteger.CreatePBigInteger64(Multiplier.BigIntegerPtr, 1); + TBigInteger.CreatePBigIntegerPtr(Result.BigIntegerPtr); + + SetLength(Val, SizeOfFraction); + {$IFDEF CLR} + for i := 0 to SizeOfFraction - 1 do + Val[i] := Value.Fraction[i]; + {$ELSE} + MemUtils.CopyBuffer(@Value.Fraction[0], @Val[0], Length(Val)); + {$ENDIF} + + k := (Value.Precision div 2); + if (Value.Precision mod 2) = 0 then + Dec(k); + + for i := k downto 0 do begin + Radix := 100; + if (i = k) then begin + if (Value.Precision mod 2) = 0 then + posVal := (val[i] and $0F) + ((val[i] and $F0) shr 4) * 10 + else begin + posVal := (val[i] and $F0) shr 4; + Radix := 10; + end; + end + else + posVal := (val[i] and $0F) + ((val[i] and $F0) shr 4) * 10; + + Assert(posVal < Radix); + + Tmp.BigInteger := Mul64(Multiplier.BigIntegerPtr, posVal); + Result.BigInteger := Add(Result.BigIntegerPtr, Tmp.BigIntegerPtr); + + if (i - 1) >= 0 then + Multiplier.BigInteger := Mul64(Multiplier.BigIntegerPtr, Radix); + end; + + BigIntAcc.ClearData; + for i := 0 to Result.DataLength - 1 do + BigIntAcc.Data[i] := Result.Data[i]; + + BigIntAcc.DataLength := Result.DataLength; + finally + Multiplier.Free; + Result.Free; + Tmp.Free; + BigIntAcc.Free; + end; +end; + +class function TBigInteger.Add(PBigInt1: PBigInteger; PBigInt2: PBigInteger): RBigInteger; +var + carry, sum: Int64; + i, lastPos: Integer; + BigInt1Acc, BigInt2Acc: TBigIntegerAccessor; +begin + BigInt1Acc := TBigIntegerAccessor.Create(PBigInt1, False); + BigInt2Acc := TBigIntegerAccessor.Create(PBigInt2, False); + try + TBigInteger.CreateRBigIntegerStruct(Result); + + if BigInt1Acc.DataLength > BigInt2Acc.DataLength then + Result.DataLength := BigInt1Acc.DataLength + else + Result.dataLength := BigInt2Acc.DataLength; + carry := 0; + for i := 0 to Result.DataLength - 1 do begin + sum := Int64(BigInt1Acc.data[i]) + Int64(BigInt2Acc.data[i]) + carry; + carry := sum shr 32; + Result.Data[i] := LongWord(sum and $FFFFFFFF); + end; + + if (carry <> 0) and (Result.DataLength < MaxLength) then begin + Result.Data[Result.DataLength] := LongWord(carry); + Result.DataLength := Result.DataLength + 1; + end; + + while (Result.DataLength > 1) and (Result.Data[Result.DataLength - 1] = 0) do + Result.DataLength := Result.DataLength - 1; + + // overflow check + lastPos := maxLength - 1; + if (longword(BigInt1Acc.Data[lastPos] and $80000000) = longword(BigInt2Acc.Data[lastPos] and $80000000)) and + (longword(Result.Data[lastPos] and $80000000) <> longword(BigInt1Acc.Data[lastPos] and $80000000)) then + begin + raise Exception.Create('overflow!'); + end; + finally + BigInt1Acc.Free; + BigInt2Acc.Free; + end; +end; + +class function TBigInteger.NEGATEPtr(PBigInt: PBigInteger): RBigInteger; +var + carry, val: Int64; + i, index: Integer; + BigIntAcc: TBigIntegerAccessor; +begin + BigIntAcc := TBigIntegerAccessor.Create(PBigInt, False); + try + // handle neg of zero separately since it'll cause an overflow + // if we proceed. + if (BigIntAcc.DataLength = 1) and (BigIntAcc.Data[0] = 0) then begin + TBigInteger.CreateRBigIntegerStruct(Result); + Exit; + end; + + // 1's complement + for i := 0 to MaxLength - 1 do + Result.Data[i] := LongWord(not(BigIntAcc.Data[i])); + + // add one to result of 1's complement + carry := 1; + index := 0; + + while (carry <> 0) and (index < maxLength) do begin + val := Int64(Result.Data[index]); + Inc(val); + + Result.Data[index] := LongWord(val and $FFFFFFFF); + carry := val shr 32; + Inc(index); + end; + + if LongWord(BigIntAcc.Data[maxLength-1] and $80000000) = LongWord(Result.Data[MaxLength-1] and $80000000) then + raise Exception.Create('Overflow in negation.'); + + Result.DataLength := MaxLength; + + while (Result.DataLength > 1) and (Result.Data[Result.DataLength - 1] = 0) do + Result.DataLength := Result.DataLength - 1; + finally + BigIntAcc.Free; + end; +end; + +class function TBigInteger.NEGATE(const BigInt: RBigInteger): RBigInteger; +{$IFDEF CLR} +var + BigIntAcc: TBigIntegerAccessor; +{$ENDIF} +begin +{$IFDEF CLR} + BigIntAcc := TBigIntegerAccessor.Create(nil, True); + try + BigIntAcc.BigInteger := BigInt; + Result := NEGATEPtr(BigIntAcc.BigIntegerPtr); + finally + BigIntAcc.Free; + end; +{$ELSE} + Result := NEGATEPtr(@BigInt); +{$ENDIF} +end; + +class function TBigInteger.Mul(PBigInt1: PBigInteger; PBigInt2: PBigInteger): RBigInteger; +var + BigInt1Acc, BigInt2Acc: TBigIntegerAccessor; + nbi1, nbi2: RBigInteger; + mcarry, val: Int64; + bi1Neg, bi2Neg, isMaxNeg: Boolean; + b1, b2: Longword; + i, j, k, lastPos: Integer; +begin + BigInt1Acc := TBigIntegerAccessor.Create(PBigInt1, False); + BigInt2Acc := TBigIntegerAccessor.Create(PBigInt2, False); + try + lastPos := maxLength - 1; + bi1Neg := false; + bi2Neg := false; + + // take the absolute value of the inputs + try + if longword(BigInt1Acc.Data[lastPos] and $80000000) <> 0 then begin + bi1Neg := true; + nbi1 := NEGATEPtr(PBigInt1); + end + else + //nbi1 := bi1^; + nbi1 := BigInt1Acc.BigInteger; + + + if longword(BigInt2Acc.Data[lastPos] and $80000000) <> 0 then begin + bi2Neg := true; + nbi2 := NEGATEPtr(PBigInt2); + end + else + //nbi2 := bi2^; + nbi2 := BigInt2Acc.BigInteger; + except + end; + + TBigInteger.CreateRBigIntegerStruct(Result); + + // multiply the absolute values + for i := 0 to nbi1.dataLength - 1 do begin + if nbi1.data[i] = 0 then + continue; + + mcarry := 0; + k := i; + for j := 0 to nbi2.dataLength - 1 do begin + // k = i + j + // val := Int64(nbi1.data[i]) * Int64(nbi2.data[j]); + b1 := nbi1.data[i]; + b2 := nbi2.data[j]; + {$IFDEF CLR} + val := Int64(b1) * Int64(b2); + {$ELSE} + asm + MOV EAX, b1 + MUL b2 + MOV dword ptr [val+$00], EAX + MOV dword ptr [val+$04], EDX + end; + {$ENDIF} + val := val + Int64(result.data[k]) + mcarry; + + result.data[k] := longword(val and $FFFFFFFF); + mcarry := val shr 32; + Inc(k); + end; + + if mcarry <> 0 then + result.data[i + nbi2.dataLength] := longword(mcarry); + end; + + result.dataLength := nbi1.dataLength + nbi2.dataLength; + if result.dataLength > maxLength then + result.dataLength := maxLength; + + while (result.dataLength > 1) and (result.data[result.dataLength - 1] = 0) do + result.dataLength := result.dataLength - 1; + + // overflow check (result is -ve) + if longword(result.data[lastPos] and $80000000) <> 0 then begin + if (bi1Neg <> bi2Neg) and (result.data[lastPos] = $80000000) then begin + // handle the special case where multiplication produces + // a max negative number in 2's complement. + + if result.dataLength = 1 then + Exit + else begin + isMaxNeg := true; + i := 0; + while (i < result.dataLength - 1) and isMaxNeg do begin + if result.data[i] <> 0 then + isMaxNeg := false; + Inc(i); + end; + + if isMaxNeg then + Exit; + end; + end; + + raise Exception.Create('Multiplication overflow.'); + end; + + // if input has different signs, then result is -ve + if bi1Neg <> bi2Neg then + Result := NEGATE(Result); + finally + BigInt1Acc.Free; + BigInt2Acc.Free; + end; +end; + +class function TBigInteger.Mul64(PBigInt1: PBigInteger; value: Int64): RBigInteger; +var + BigIntAcc2: TBigIntegerAccessor; +begin + BigIntAcc2 := TBigIntegerAccessor.Create(nil, True); + try + TBigInteger.CreatePBigInteger64(BigIntAcc2.BigIntegerPtr, Value); + Result := Mul(PBigInt1, BigIntAcc2.BigIntegerPtr); + finally + BigIntAcc2.Free; + end; +end; + +{ TOLEDBConnection } + +constructor TOLEDBConnection.Create; +begin + inherited; + + FIsolationLevel := ilReadCommitted; + FCommand := nil; + + FAuthentication := auServer; + FProvider := prSQL; + + FDatabase := ''; + FQuotedIdentifier := True; + FPacketSize := DefaultPacketSize; + FAutoTranslate := True; + FConnectionTimeout := DefaultConnectionTimeout; + FOldPassword := ''; + FMaxDatabaseSize := 4091; + FFailoverPartner := ''; +end; + +destructor TOLEDBConnection.Destroy; +begin + Disconnect; + FCommand.Free; + inherited; +end; + +procedure TOLEDBConnection.ReleaseInterfaces; +begin + FISessionProperties := nil; + FITransactionLocal := nil; + + FIDBInitialize := nil; + FIDBProperties := nil; + FIDBCreateSession := nil; +end; + +{$IFDEF SQL_TRANSACTION} +procedure TOLEDBConnection.StartTransaction; +begin +{$WARNINGS OFF} + case FIsolationLevel of + ilReadCommitted: + ExecSQL('SET TRANSACTION ISOLATION LEVEL READ COMMITTED'); + ilReadUnCommitted: + ExecSQL('SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED'); + ilRepeatableRead: + ExecSQL('SET TRANSACTION ISOLATION LEVEL REPEATABLE READ'); + ilIsolated: + ExecSQL('SET TRANSACTION ISOLATION LEVEL SERIALIZABLE '); + else + Assert(False, Format('Invalid value %d', [Integer(FIsolationLevel)])); + end; +{$WARNINGS ON} + ExecSQL('BEGIN TRAN'); +end; + +procedure TOLEDBConnection.Commit; +begin + ExecSQL('COMMIT'); +end; + +procedure TOLEDBConnection.Rollback; +begin + ExecSQL('ROLLBACK'); +end; + +{$ELSE} +{$IFDEF CLR} +procedure TOLEDBConnection.StartTransaction; +var + pulTransactionLevel: PUINT; +begin + if FITransactionLocal <> nil then begin + pulTransactionLevel := Marshal.AllocHGlobal(4); + try + Check(FITransactionLocal.StartTransaction(ConvertIsolationLevelToOLEDBIsoLevel(FIsolationLevel), 0, nil, pulTransactionLevel), Component); + finally + Marshal.FreeHGlobal(pulTransactionLevel); + end; + end; +end; +{$ELSE} +procedure TOLEDBConnection.StartTransaction; +var + ulTransactionLevel: UINT; +begin + if FITransactionLocal <> nil then + Check(FITransactionLocal.StartTransaction(ConvertIsolationLevelToOLEDBIsoLevel(FIsolationLevel), 0, nil, @ulTransactionLevel), Component); +end; +{$ENDIF} + +procedure TOLEDBConnection.Commit; +begin + if FITransactionLocal <> nil then + Check(ITransaction(FITransactionLocal).Commit(False{WAR may be troubles with server cursors}, XACTTC_SYNC, 0), Component); +end; + +procedure TOLEDBConnection.Rollback; +begin + if FITransactionLocal <> nil then + Check(ITransaction(FITransactionLocal).Abort(nil, False, False), Component); +end; +{$ENDIF} + +procedure TOLEDBConnection.Check(const Status: HRESULT; Component: TObject); +begin + if Status <> S_OK then + OLEDBError(Status, Component); +end; + +procedure TOLEDBConnection.OLEDBError(const ErrorCode: HRESULT; Component: TObject); +{$IFDEF CLR} + function MarshalErrInfo(Err: PSSERRORINFO): SSERRORINFO; + begin + Result := SSERRORINFO(Marshal.PtrToStructure(Err, TypeOf(SSERRORINFO))); + end; +{$ELSE} + function MarshalErrInfo(Err: PSSERRORINFO): SSERRORINFO; + begin + Result.pwszMessage := Err.pwszMessage; + Result.pwszServer := Err.pwszServer; + Result.pwszProcedure := Err.pwszProcedure; + Result.lNative := Err.lNative; + Result.bState := Err.bState; + Result.bClass := Err.bClass; + Result.wLineNumber := Err.wLineNumber; + end; +{$ENDIF} + +var + pIErrorInfoAll: IErrorInfo; + // pIErrorInfo: IErrorInfo; + pIErrorRecords: IErrorRecords; + pISQLServerErrorInfo: ISQLServerErrorInfo; + pssErrInfo: PSSERRORINFO; + ssErrInfo: SSERRORINFO; + pStrBuf: IntPtr; // pWideChar; + + Msg: WideString; + s1: WideString; + + i, RecordCount: Cardinal; + //pIMalloc: IMalloc; + + Err: EOLEDBError; + Fail: boolean; + + // Descr, Src: WideString; + + ErrInfo: ERRORINFO; + iu: IUnknown; + + // Buffer + ssErrInfoBuf: SSERRORINFO; + +begin + if (ErrorCode = 0) and not Assigned(FOnInfoMessage) then + Exit; + + s1 := ''; + Err := nil; + RecordCount := 0; + //CoGetMalloc(1, pIMalloc); + + if GetErrorInfo(0, pIErrorInfoAll) = S_OK then begin + pIErrorInfoAll.GetDescription(Msg); + {$IFDEF CLR} + pIErrorRecords := pIErrorInfoAll as IErrorRecords; + {$ELSE} + pIErrorInfoAll.QueryInterface(IID_IErrorRecords, pIErrorRecords); + {$ENDIF} + pIErrorRecords.GetRecordCount(RecordCount); + + if RecordCount > 0 then begin /// i and RecordCount is unigned int! + for i := RecordCount - 1 downto 0 do begin// Ignore all error messages without last + if (pIErrorRecords.GetCustomErrorObject(i, IID_ISQLServerErrorInfo, iu) = S_OK) then + pISQLServerErrorInfo := ISQLServerErrorInfo(iu); + iu := nil; + if (pISQLServerErrorInfo <> nil) and + (pISQLServerErrorInfo.GetErrorInfo(pssErrInfo, pStrBuf) = S_OK) and + (pssErrInfo <> nil) then begin + {$IFDEF CLR} + ssErrInfo := SSERRORINFO(Marshal.PtrToStructure(pssErrInfo, TypeOf(SSERRORINFO))); + if s1 = '' then begin + ssErrInfoBuf := ssErrInfo; + s1 := ssErrInfo.pwszMessage; + end + else + s1 := ssErrInfo.pwszMessage + #$D#$A + s1; + {$ELSE} + if s1 = '' then begin + ssErrInfoBuf := MarshalErrInfo(pssErrInfo); + s1 := pssErrInfo^.pwszMessage; + end + else + s1 := pssErrInfo^.pwszMessage + WideString(#$D#$A) + s1; + {$ENDIF} + FreeCoMem(pStrBuf); + FreeCoMem(pssErrInfo); + //pIMalloc.Free(pStrBuf); + //pIMalloc.Free(pssErrInfo); + end; + end; + if s1 <> '' then + Err := EMSError.Create(ssErrInfoBuf, ErrorCode, s1); + end; + end; + + if Err = nil then // this is OLE DB error. As example - repeated Connection.Rollback or non-convergence types of field and parameter + begin + if ErrorCode = 0 then + Exit; // No error and no message + + if Msg = '' then + Msg := Format(SOLEDBError, [ErrorCode]); + if ErrorCode = CO_E_NOTINITIALIZED then + Msg := Msg + '.'#$D#$A'CoInitialize has not been called.'; + + Err := EOLEDBError.Create(ErrorCode, Msg); + end; + +{$IFNDEF LITE} + Err.Component := Component; +{$ENDIF} + Err.FOLEDBErrorCode := ErrorCode; + if RecordCount > 0 then /// i and RecordCount is unigned int! + for i := 0 to RecordCount - 1 do begin// Ignore all error messages without last + if pIErrorRecords.GetCustomErrorObject(i, IID_ISQLServerErrorInfo, iu) = S_OK then begin + pISQLServerErrorInfo := ISQLServerErrorInfo(iu); + if (pISQLServerErrorInfo <> nil) and + (pISQLServerErrorInfo.GetErrorInfo(pssErrInfo, pStrBuf) = S_OK) and + (pssErrInfo <> nil) then begin + // EMSError + + ssErrInfo := MarshalErrInfo(pssErrInfo); + Err.FErrors.FList.Add(EMSError.Create(ssErrInfo, 0, ssErrInfo.pwszMessage)); + + FreeCoMem(pStrBuf); + FreeCoMem(pssErrInfo); + //pIMalloc.Free(pStrBuf); + //pIMalloc.Free(pssErrInfo); + end + else + Err.FErrors.FList.Add(EOLEDBError.Create(ErrorCode, Msg)); + end; + + with Err.Errors[Err.ErrorCount - 1] do begin + if pIErrorRecords.GetBasicErrorInfo(i, ErrInfo) = S_OK then begin + // GetBasicErrorInfo - ERRORINFO struct + FOLEDBErrorCode := ErrInfo.hrError; + // FMinor := ErrInfo.dwMinor; + // Fclsid := ErrInfo.clsid; + Fiid := ErrInfo.iid; + // Fdispid := ErrInfo.dispid; + end; + + (* if pIErrorRecords.GetErrorInfo(i, GetUserDefaultLCID(), pIErrorInfo) = S_OK then begin + // GetErrorInfo - IErrorInfo interface + // pIErrorInfo.GetGUID(Fguid); - same as Fiid + pIErrorInfo.GetSource(FSource); + pIErrorInfo.GetDescription(FDescription); + // pIErrorInfo.GetHelpFile(FHelpFile); - not used by sqloledb + // pIErrorInfo.GetHelpContext(FdwHelpContext); - not used by sqloledb + end;*) + end; + end; + + if (ErrorCode = 0) and Assigned(FOnInfoMessage) then begin + Assert(Err <> nil); + try + FOnInfoMessage(Err as EMSError); + finally + Err.Free; + end; + end + else + begin + Fail := True; + try + if Assigned(OnError) then + DoError(Err{$IFNDEF LITE} as EDAError{$ENDIF}, Fail); + if Fail then + raise Err + else + Abort; + finally + if not Fail then + Err.Free; + end; + end; +end; + +procedure TOLEDBConnection.GetConnectionProperties; +var + PropValues: TPropValues; +begin + with TOLEDBPropertiesGet.Create(Self, DBPROPSET_DATASOURCEINFO) do + try + AddPropId(DBPROP_DBMSNAME); + AddPropId(DBPROP_DBMSVER); + AddPropId(DBPROP_PROVIDERFRIENDLYNAME); + AddPropId(DBPROP_PROVIDERVER); + if FProvider = prCompact then + AddPropId(DBPROP_PROVIDERNAME); + GetProperties(FIDBProperties, PropValues); + finally + Free; + end; + FDBMSName := PropValues[0]; + FDBMSVer := PropValues[1]; + FDBMSPrimaryVer := StrToInt(Copy(FDBMSVer, 1, Pos('.', FDBMSVer) - 1)); + + FProviderFriendlyName := PropValues[2]; + FProviderVer := PropValues[3]; + FProviderPrimaryVer := StrToInt(Copy(FProviderVer, 1, Pos('.', FProviderVer) - 1)); + + if (FProvider = prCompact) and (FProviderFriendlyName = '') then begin + FProviderFriendlyName := PropValues[4]; + if Pos('.dll', LowerCase(FProviderFriendlyName)) > 0 then + SetLength(FProviderFriendlyName, Length(FProviderFriendlyName) - 4); + end; + + if FProvider = prCompact then begin + if (FProviderPrimaryVer <> 3) then + DatabaseError(SBadProviderName) + end + else + if (FProviderPrimaryVer < 7) and not IsWindowsVista then + DatabaseError(SWrongMDACVer); +end; + +procedure TOLEDBConnection.SetConnectionProperties; +var + BufLen: cardinal; +// ComputerName: array[0..MAX_COMPUTERNAME_LENGTH] of char; +{$IFDEF CLR} + AppName: StringBuilder; +{$ELSE} + AppName: array[0..MAX_PATH + 100] of char; +{$ENDIF} + s: string; + +begin + // Set initialization properties + if FProvider <> prCompact then begin + with TOLEDBPropertiesSet.Create(Self, DBPROPSET_DBINIT) do + try + // Auth props + if FServer <> '' then + AddPropStr(DBPROP_INIT_DATASOURCE, FServer) + else + AddPropStr(DBPROP_INIT_DATASOURCE, '(local)'); + AddPropStr(DBPROP_INIT_CATALOG, FDatabase); + AddPropInt(DBPROP_INIT_TIMEOUT, FConnectionTimeout); + + case FAuthentication of + auWindows: + AddPropStr(DBPROP_AUTH_INTEGRATED, ''); + auServer: + if (FUserName = '') and (FPassword = '') then + AddPropStr(DBPROP_AUTH_USERID, 'sa') + else + begin + AddPropStr(DBPROP_AUTH_USERID, FUserName); + AddPropStr(DBPROP_AUTH_PASSWORD, FPassword); + end; + end; + + if FPersistSecurityInfo then + AddPropBool(DBPROP_AUTH_PERSIST_SENSITIVE_AUTHINFO, FPersistSecurityInfo); + + // Prompt props + AddPropSmallInt(DBPROP_INIT_PROMPT, DBPROMPT_NOPROMPT); + AddPropInt(DBPROP_INIT_HWND, 0); + + SetProperties(FIDBProperties); + finally + Free; + end; + + // Set common SQL Server properties + with TOLEDBPropertiesSet.Create(Self, DBPROPSET_SQLSERVERDBINIT) do + try + if FWorkstationID <> '' then + AddPropStr(SSPROP_INIT_WSID, FWorkstationID); + + if FApplicationName <> '' then + AddPropStr(SSPROP_INIT_APPNAME, FApplicationName) + else + begin + {$IFDEF CLR} + AppName := StringBuilder.Create(MAX_PATH + 100); + try + BufLen := MAX_PATH + 100; + GetModuleFileName(0, AppName, BufLen); + s := ExtractFileName(AppName.ToString); + finally + AppName.Free; + end; + {$ELSE} + BufLen := sizeof(AppName); + GetModuleFileName(0, AppName, BufLen); + s := ExtractFileName(AppName); + {$ENDIF} + AddPropStr(SSPROP_INIT_APPNAME, s); + end; + + if FLanguage <> '' then + AddPropStr(SSPROP_INIT_CURRENTLANGUAGE, FLanguage, True); + + AddPropBool(SSPROP_INIT_AUTOTRANSLATE, FAutoTranslate, True); + + if GUIDToString(FProviderId) = GUIDToString(CLSID_SQLNCLI) then begin + if FMultipleActiveResultSets then + AddPropBool(SSPROP_INIT_MARSCONNECTION, FMultipleActiveResultSets); + if FOldPassword <> '' then + AddPropStr(SSPROP_AUTH_OLD_PASSWORD, FOldPassword); + end + else + if FOldPassword <> '' then + raise Exception.Create(SSQLNCLINeedsChangePwd); + + if FInitialFileName <> '' then + AddPropStr(SSPROP_INIT_FILENAME, FInitialFileName); + + if FFailoverPartner <> '' then + AddPropStr(SSPROP_INIT_FAILOVERPARTNER, FFailoverPartner); + + SetProperties(FIDBProperties); + finally + Free; + end; + + /// Isolated for easy error detection + if FEncrypt then /// Set only if FEncrypt = True. This needs for prevent troubles with 7.xxx clients + with TOLEDBPropertiesSet.Create(Self, DBPROPSET_SQLSERVERDBINIT) do + try + AddPropBool(SSPROP_INIT_ENCRYPT, FEncrypt); + try + SetProperties(FIDBProperties); + except + on E: Exception do + begin + AddInfoToErr(E, SBadEncrypt, []); + raise E; + end; + end; + finally + Free; + end; + /// Isolated for easy error detection + if FNetworkLibrary <> '' then + with TOLEDBPropertiesSet.Create(Self, DBPROPSET_SQLSERVERDBINIT) do + try + AddPropStr(SSPROP_INIT_NETWORKLIBRARY, FNetworkLibrary, True); + try + SetProperties(FIDBProperties); + except + on E: Exception do begin + AddInfoToErr(E, SBadNetworkLibrary, []); + raise E; + end; + end; + finally + Free; + end; + + /// Isolated for easy error detection + with TOLEDBPropertiesSet.Create(Self, DBPROPSET_SQLSERVERDBINIT) do + try + AddPropInt(SSPROP_INIT_PACKETSIZE, FPacketSize); + try + SetProperties(FIDBProperties); + except + on E: Exception do begin + AddInfoToErr(E, SBadPacketSize, []); + raise E; + end; + end; + finally + Free; + end; + end + else begin + with TOLEDBPropertiesSet.Create(Self, DBPROPSET_DBINIT) do + try + AddPropStr(DBPROP_INIT_DATASOURCE, FDatabase, True); + try + SetProperties(FIDBProperties); + except + on E: Exception do begin + AddInfoToErr(E, SBadDatabaseFile, []); + raise E; + end; + end; + finally + Free; + end; + + + with TOLEDBPropertiesSet.Create(Self, DBPROPSET_SSCE_DBINIT) do + try + if FPassword <> '' then + AddPropStr(DBPROP_SSCE_DBPASSWORD, FPassword); + //if FMaxDatabaseSize <> 128 then + AddPropInt(DBPROP_SSCE_MAX_DATABASE_SIZE, FMaxDatabaseSize); + + SetProperties(FIDBProperties); + finally + Free; + end; + end; +end; + +procedure TOLEDBConnection.Connect(const ConnectString: string); + procedure SetSessionProperties; + var + OLEDBProperties: TOLEDBPropertiesSet; + begin + OLEDBProperties := TOLEDBPropertiesSet.Create(Self, DBPROPSET_SESSION); + try + //Set transaction properties + with OLEDBProperties do begin + AddPropInt(DBPROP_SESS_AUTOCOMMITISOLEVELS, ConvertIsolationLevelToOLEDBIsoLevel(FIsolationLevel)) + end; + OLEDBProperties.SetProperties(FISessionProperties); + finally + OLEDBProperties.Free; + end; + end; + + procedure SetDataSourceProperties; + var + OLEDBProperties: TOLEDBPropertiesSet; + begin + OLEDBProperties := TOLEDBPropertiesSet.Create(Self, DBPROPSET_DATASOURCE); + try + //Set transaction properties + with OLEDBProperties do begin + AddPropBool(DBPROP_MULTIPLECONNECTIONS, True); + SetProperties(FIDBProperties); + end; + finally + OLEDBProperties.Free; + end; + end; + + function OpenProvider(const clsid: array of TGuid): HRESULT; + var + i: integer; + begin + Result := 0; + for i := Low(clsid) to High(clsid) do begin + Result := CoCreateInstance(clsid[i], + nil, + CLSCTX_INPROC_SERVER, + IID_IDBInitialize, + FIDBInitialize); + if Result <> REGDB_E_CLASSNOTREG then begin + FProviderId := clsid[i]; + Exit; + end; + end; + end; + +var + hr: HRESULT; + iu: IUnknown; +begin + if not FConnected then begin + try + hr := 0; + if FProvider = prAuto then + hr := OpenProvider([CLSID_SQLNCLI, CLSID_SQLOLEDB]) + else + if FProvider = prSQL then + hr := OpenProvider([CLSID_SQLOLEDB]) + else + if FProvider = prNativeClient then + hr := OpenProvider([CLSID_SQLNCLI]) + else + if FProvider = prCompact then + hr := OpenProvider([CLSID_SQLSERVERCE_3_0]) + else + DatabaseError(SBadProviderName); + if hr = REGDB_E_CLASSNOTREG then + DatabaseError(SMSSQLNotFound) + else + Check(hr, Component); + + QueryIntf(FIDBInitialize, {$IFDEF CLR}IDBProperties{$ELSE}IID_IDBProperties{$ENDIF}, FIDBProperties); + + //Set initialization properties. + SetConnectionProperties; + // SetDatabase(FDatabase); - setted on SetConnectionProperties + + //Now establish the connection to the data source. + hr := FIDBInitialize.Initialize; + if (hr = E_FAIL) and (FProvider = prCompact) then begin // Database file is not exist + CreateDatabase(FDatabase, FPassword, FEncrypt); + hr := FIDBInitialize.Initialize; + end; + Check(hr, Component); + + if FProvider <> prCompact then + SetDataSourceProperties; + + //Create the SessionObject + QueryIntf(FIDBInitialize, {$IFDEF CLR}IDBCreateSession{$ELSE}IID_IDBCreateSession{$ENDIF}, FIDBCreateSession); + Check(FIDBCreateSession.CreateSession(nil, IID_ISessionProperties, iu), Component); + FISessionProperties := ISessionProperties(iu); + if FProvider <> prCompact then + SetSessionProperties; + QueryIntf(FISessionProperties, {$IFDEF CLR}ITransactionLocal{$ELSE}IID_ITransactionLocal{$ENDIF}, FITransactionLocal); + + // Get properties ------------------------------ + GetConnectionProperties; + inherited; + FConnected := True; + + if not FQuotedIdentifier then + SetQuotedIdentifier(FQuotedIdentifier); + + except + on EFailOver do; + else begin + ReleaseInterfaces; + raise; + end; + end; + end; +end; + +procedure TOLEDBConnection.Disconnect; +begin + if FConnected then begin + if FIDBInitialize <> nil then + FIDBInitialize.Uninitialize;// check not need + + ReleaseInterfaces; + + FConnected := False; + FreeAndNil(FColumnsMetaInfo); + FreeAndNil(FColumnsRowsetFieldDescs); + end; +end; + +procedure TOLEDBConnection.Assign(Source: TOLEDBConnection); +begin + FConnectionTimeout := Source.FConnectionTimeout; + FServer := Source.FServer; + FUsername := Source.FUsername; + FPassword := Source.FPassword; + FDatabase := Source.FDatabase; + + FIsolationLevel := Source.FIsolationLevel; + FAuthentication := Source.FAuthentication; + FProvider := Source.FProvider; + + FQuotedIdentifier := Source.FQuotedIdentifier; + FLanguage := Source.FLanguage; + FEncrypt := Source.FEncrypt; + FPersistSecurityInfo := Source.FPersistSecurityInfo; + FAutoTranslate := Source.FAutoTranslate; + FNetworkLibrary := Source.FNetworkLibrary; + FApplicationName := Source.FApplicationName; + FWorkstationID := Source.FWorkstationID; + FPacketSize := Source.FPacketSize; + FMaxDatabaseSize := Source.FMaxDatabaseSize; +end; + +procedure TOLEDBConnection.SetIDBCreateSession(CreateSession: IDBCreateSession); +var + iu: IUnknown; +begin + Assert(not FConnected); + + //Obtain access to the SQLOLEDB provider. + try + FIDBCreateSession := CreateSession; + Check(FIDBCreateSession.CreateSession(nil, IID_ISessionProperties, iu), Component); + FISessionProperties := ISessionProperties(iu); + QueryIntf(FISessionProperties, {$IFDEF CLR}ITransactionLocal{$ELSE}IID_ITransactionLocal{$ENDIF}, FITransactionLocal); + + FConnected := True; + if not FQuotedIdentifier then + SetQuotedIdentifier(FQuotedIdentifier); + except + ReleaseInterfaces; + raise; + end; +end; + +function TOLEDBConnection.GetProp(Prop: integer; var Value: variant): boolean; +begin + Result := True; + + case Prop of + prDatabase: + Value := FDatabase; // string + prIsolationLevel: + Value := Integer(FIsolationLevel); + prAuthentication: + Value := Integer(FAuthentication); //TMSAuthentication + prConnectionTimeout: + Value := Integer(FConnectionTimeout); + prMaxDatabaseSize: + Value := Integer(FMaxDatabaseSize); + else + Result := inherited GetProp(Prop, Value); + end; + +end; + +function TOLEDBConnection.SetProp(Prop: integer; const Value: variant): boolean; +begin + Result := True; + case Prop of + prDatabase: + SetDatabase(Value); + prIsolationLevel: + FIsolationLevel := TIsolationLevel(Integer(Value)); + {prMultipleConnections: + FMultipleConnections := boolean(Value^);} + prAuthentication: + FAuthentication := TMSAuthentication(Integer(Value)); //TMSAuthentication + prProvider: + FProvider := TOLEDBProvider(Integer(Value)); + prConnectionTimeout: + FConnectionTimeout := Integer(Value); + prQuotedIdentifier: + SetQuotedIdentifier(boolean(Value)); + prLanguage: + FLanguage := Value; + prAutoTranslate: + FAutoTranslate := Boolean(Value); + prEncrypt: + FEncrypt := Boolean(Value); + prPersistSecurityInfo: + FPersistSecurityInfo := Boolean(Value); + prNetworkLibrary: + FNetworkLibrary := Value; + prApplicationName: + FApplicationName := Value; + prWorkstationID: + FWorkstationID := Value; + prPacketSize: + FPacketSize := Integer(Value); + prInitialFileName: + FInitialFileName := Value; + prMARS: + FMultipleActiveResultSets := Value; + prOldPassword: + FOldPassword := Value; + prMaxDatabaseSize: + FMaxDatabaseSize := Value; + prFailoverPartner: + FFailoverPartner := Value; + else + Result := inherited SetProp(Prop, Value); + end; +end; + +function TOLEDBConnection.CheckIsValid: boolean; +begin + FIsValid := FIDBInitialize <> nil; + if FIsValid then + try + ExecSQL(SCheckConnection); + except + FIsValid := False; + end; + Result := FIsValid; +end; + +procedure TOLEDBConnection.SetDatabase(const Value: string); +var + OLEDBProperties: TOLEDBPropertiesSet; +begin + if FIDBProperties <> nil then begin + OLEDBProperties := TOLEDBPropertiesSet.Create(Self, DBPROPSET_DATASOURCE); + try + with OLEDBProperties do + AddPropStr(DBPROP_CURRENTCATALOG, BracketIfNeed(Value)); + OLEDBProperties.SetProperties(FIDBProperties); + finally + OLEDBProperties.Free; + end; + end; + FDatabase := Value; +end; + +procedure TOLEDBConnection.SetQuotedIdentifier(const Value: boolean); +begin + FQuotedIdentifier := Value; + + if FConnected then + if Value then + ExecSQL('SET QUOTED_IDENTIFIER ON') + else + ExecSQL('SET QUOTED_IDENTIFIER OFF'); +end; + +procedure TOLEDBConnection.ExecSQL(const Text: string); +begin + if FCommand = nil then begin + FCommand := TOLEDBCommand.Create; + TOLEDBCommand(FCommand).FConnection := Self; + end; + + with FCommand do begin + SetSQL(Text); + try + Execute; + finally + FCommand.SetCursorState(csInactive); // To prevent blocking execute on second exec + end; + end; +end; + +class procedure TOLEDBConnection.AssignFieldDescs(Source, Dest: TFieldDescs); +var + i: integer; + Field, FieldSource: TOLEDBFieldDesc; +begin + Dest.Clear; + for i := 0 to Source.Count - 1 do begin + FieldSource := Source[i] as TOLEDBFieldDesc; + Field := TOLEDBFieldDesc.Create; + Dest.Add(Field); + Field.Name := FieldSource.Name; + Field.ActualName := FieldSource.ActualName; + // FTableName: string; //table of name that holds this field + Field.DataType := FieldSource.DataType; + Field.SubDataType := FieldSource.SubDataType; + Field.Length := FieldSource.Length; // precision for number + Field.Scale := FieldSource.Scale; + Field.FieldNo := FieldSource.FieldNo; + Field.ActualFieldNo := FieldSource.ActualFieldNo; + Field.Size := FieldSource.Size; + //Field.DataSize := FieldSource.DataSize; + Field.Offset := FieldSource.Offset; + Field.DataOffset := FieldSource.DataOffset; + Field.Required := FieldSource.Required; + Field.ReadOnly := FieldSource.ReadOnly; + Field.IsKey := FieldSource.IsKey; + Field.Fixed := FieldSource.Fixed; + Field.Hidden := FieldSource.Hidden; + //Field.ObjectType := FieldSource.ObjectType; + //Field.ParentField := FieldSource.ParentField; + //Field.HiddenObject := FieldSource.HiddenObject; + //FHandle: IntPtr; // IntPtr to field specific data + //FReserved: boolean; // reserved flag for perfomance optimization + end; +end; + +{$IFDEF CLR} +procedure TOLEDBConnection.DoError(E: Exception; var Fail: boolean); +begin + inherited; +end; +{$ENDIF} + +procedure TOLEDBConnection.CreateDatabase(const Database: string; const Password: string; const Encrypted: boolean); +var + pIDBDataSourceAdmin: IDBDataSourceAdmin; + pIUnknownSession: IUnknown; + + PPropertySet: IntPtr; + PropertySet: PDBPropSet; + PDBProperty: IntPtr; + DBProperty: PDBProp; + PSSCEProperty: IntPtr; + SSCEProperty: PDBPROP; +begin + PPropertySet := nil; + PDBProperty := nil; + PSSCEProperty := nil; + try + Check(CoCreateInstance(CLSID_SQLSERVERCE_3_0, nil, CLSCTX_INPROC_SERVER, + IID_IDBDataSourceAdmin, pIDBDataSourceAdmin), Component); + + PDBProperty := Marshal.AllocHGlobal(SizeOfDBProp); + FillChar(PDBProperty, SizeOfDBProp, $00); + DBProperty := PDBProperty; + DBProperty.dwPropertyID := DBPROP_INIT_DATASOURCE; + DBProperty.dwOptions := DBPROPOPTIONS_REQUIRED; + DBProperty.vValue := Database; + + PSSCEProperty := Marshal.AllocHGlobal(SizeOfDBProp * 2); + FillChar(PSSCEProperty, SizeOfDBProp * 2, $00); + SSCEProperty := PSSCEProperty; + SSCEProperty.dwPropertyID := DBPROP_SSCE_ENCRYPTDATABASE; + SSCEProperty.dwOptions := DBPROPOPTIONS_REQUIRED; + SSCEProperty.vValue := VarAsType(Encrypted, VT_BOOL); + + SSCEProperty := IntPtr(Integer(PSSCEProperty) + SizeOfDBProp); + SSCEProperty.dwPropertyID := DBPROP_SSCE_DBPASSWORD; + SSCEProperty.dwOptions := DBPROPOPTIONS_REQUIRED; + SSCEProperty.vValue := Password; + + PPropertySet := Marshal.AllocHGlobal(SizeOf(DBPROPSET) * 2); + FillChar(PPropertySet, SizeOf(DBPROPSET) * 2, $00); + PropertySet := PPropertySet; + PropertySet.guidPropertySet := DBPROPSET_DBINIT; + PropertySet.rgProperties := PDBProperty; + PropertySet.cProperties := 1; + + PropertySet := IntPtr(Integer(PPropertySet) + SizeOf(DBPROPSET)); + PropertySet.guidPropertySet := DBPROPSET_SSCE_DBINIT ; + PropertySet.rgProperties := PSSCEProperty; + PropertySet.cProperties := 2; + + Check(pIDBDataSourceAdmin.CreateDataSource(2, PPropertySet, nil, + IID_IUnknown, pIUnknownSession), Component); + finally + pIUnknownSession := nil; + if PPropertySet <> nil then + Marshal.FreeHGlobal(PPropertySet); + if PSSCEProperty <> nil then + Marshal.FreeHGlobal(PSSCEProperty); + if PDBProperty <> nil then + Marshal.FreeHGlobal(PDBProperty); + end; +end; + +function TOLEDBConnection.GetSchemaRowset(const Schema: TGUID; rgRestrictions: TRestrictions): IRowset; +var + i: integer; + iu: IUnknown; + DBSchemaRowset: IDBSchemaRowset; + rgRestrictionsPtr: IntPtr; +begin + for i := Low(rgRestrictions) to High(rgRestrictions) do + if (VarType(rgRestrictions[i]) = varOleStr) and (String(rgRestrictions[i]) = '') then + rgRestrictions[i] := Null; // + // rgRestrictions[i] := Unassigned; + // TVarData(rgRestrictions[i]).VType := varNull; + + QueryIntf(SessionProperties, {$IFDEF CLR}IDBSchemaRowset{$ELSE}IID_IDBSchemaRowset{$ENDIF}, DBSchemaRowset); + +{$IFDEF CLR} + i := 16 {SizeOf(OleVariant)} * Length(rgRestrictions); + rgRestrictionsPtr := Marshal.AllocHGlobal(i); + try + FillChar(rgRestrictionsPtr, i, 0); + for i := Low(rgRestrictions) to High(rgRestrictions) do + SetOleVariant(IntPtr(Integer(rgRestrictionsPtr) + 16 {SizeOf(OleVariant)} * (Integer(i) - Low(rgRestrictions))), rgRestrictions[i]); +{$ELSE} + rgRestrictionsPtr := @rgRestrictions[0]; +{$ENDIF} + Check(DBSchemaRowset.GetRowset(nil, Schema, Length(rgRestrictions), rgRestrictionsPtr, + IID_IRowset, 0, nil, iu), Component); +{$IFDEF CLR} + finally + for i := Low(rgRestrictions) to High(rgRestrictions) do + OleVarClear(IntPtr(Integer(rgRestrictionsPtr) + 16 {SizeOf(OleVariant)} * (Integer(i) - Low(rgRestrictions)))); + Marshal.FreeHGlobal(rgRestrictionsPtr); + end; +{$ENDIF} + Result := IRowset(iu); + iu := nil; +end; + +{ TOLEDBCommand } + +procedure TOLEDBCommand.Check(const Status: HRESULT); +begin + Assert(FConnection <> nil); + if Status <> S_OK then + FConnection.Check(Status, Component); +end; + +constructor TOLEDBCommand.Create; +begin + inherited; + FQueryIntCnt := 0; + FRequestIUnknown := False; + FParamsAccessorDataAvaible := False; + + FRowsAffected := -1; + + FCursorState := csInactive; + + FBreakExecCS := TCriticalSection.Create; +end; + +destructor TOLEDBCommand.Destroy; +begin + if FNonBlocking and (FISSAsynchStatus <> nil) then + BreakExec; + FISSAsynchStatus := nil; + ClearIMultipleResults; + FIUnknownNext := nil; /// Clear this interface before RequestParams to avoid AV. See TDbxSdaTestSet.DoTestSPNextRecordSet + RequestParamsIfPossible; + UnPrepare; + Assert(FQueryIntCnt = 0, Format('TOLEDBCommand.Destroy - interfaces not released (%d)', [FQueryIntCnt])); + FBreakExecCS.Free; + + inherited; +end; + +procedure TOLEDBCommand.QueryInterfaces(const QueryPrepare: boolean); // QueryPrepare must be True to request IID_ICommandPrepare +var + CreateCommand: IDBCreateCommand; + iu: IUnknown; +begin + if FQueryIntCnt = 0 then begin + Assert(FConnection <> nil); + QueryIntf(FConnection.FISessionProperties, {$IFDEF CLR}IDBCreateCommand{$ELSE}IID_IDBCreateCommand{$ENDIF}, CreateCommand); + + Check(CreateCommand.CreateCommand(nil, IID_ICommandText, iu)); + FICommandText := ICommandText(iu); + if QueryPrepare then + QueryIntf(FICommandText, {$IFDEF CLR}ICommandPrepare{$ELSE}IID_ICommandPrepare{$ENDIF}, FICommandPrepare) + else + FICommandPrepare := nil; + QueryIntf(FICommandText, {$IFDEF CLR}ICommandProperties{$ELSE}IID_ICommandProperties{$ENDIF}, FICommandProperties); + end; + + Inc(FQueryIntCnt); +end; + +procedure TOLEDBCommand.ReleaseInterfaces; +begin + if FQueryIntCnt = 0 then // Exception on TOLEDBRecordSet.InternalOpen -> TOLEDBRecordSet.QueryCommandInterfaces -> TOLEDBCommand.QueryInterfaces + Exit; + + if FQueryIntCnt = 1 then begin + FBreakExecCS.Acquire; + try + FICommandText := nil; + finally + FBreakExecCS.Release; + end; + FICommandPrepare := nil; + FICommandProperties := nil; + end; + + Dec(FQueryIntCnt); +end; +(*procedure TOLEDBCommand.GetCommandProp; +var + rgPropertySets, pPropSet: PDBPropSet; + cPropertySets: UINT; + s: string; +// PropCnt: integer; +begin + try + Check(FICommandProperties.GetProperties(0, nil, + cPropertySets, PDBPropSet(rgPropertySets))); + + Assert(rgPropertySets <> nil, 'Cannot get connection properties'); + + pPropSet := rgPropertySets; // DBPROPSET_ROWSET +// PropCnt := pPropSet.cProperties; + s := pPropSet.rgProperties[0].vValue; + PChar(pPropSet) := PChar(pPropSet) + sizeof(DBPropSet);//DBPROPSET_SQLSERVERROWSET + s := pPropSet.rgProperties[0].vValue; + s := pPropSet.rgProperties[1].vValue; + s := pPropSet.rgProperties[2].vValue; + s := pPropSet.rgProperties[3].vValue; + finally + + FConnection.Malloc.Free(rgPropertySets.rgProperties); + FConnection.Malloc.Free(rgPropertySets); + end; +end; + +type + PDBParamInfoArray = ^TDBParamInfoArray; + TDBParamInfoArray = array[0..MAXBOUND] of DBPARAMINFO; +*) + +procedure TOLEDBCommand.SetCommandProp; +var + OLEDBProperties: TOLEDBPropertiesSet; + Str: WideString; + g: TGUID; +begin +{$IFDEF SDAC_TEST} + Inc(__SetCommandPropCount); +{$ENDIF} + Assert(FICommandText <> nil); + + Str := FSQL; + g := DBGUID_DEFAULT; + + Check(FICommandText.SetCommandText(g, {$IFDEF CLR}Str{$ELSE}PWideChar(Str){$ENDIF})); + + OLEDBProperties := TOLEDBPropertiesSet.Create(FConnection, DBPROPSET_ROWSET); + try + with OLEDBProperties do begin + if FConnection.FProvider <> prCompact then + AddPropInt(DBPROP_COMMANDTIMEOUT, FCommandTimeout); + if FNonBlocking and (not FRequestIUnknown) then begin + if GUIDToString(FConnection.FProviderId) <> GUIDToString(CLSID_SQLNCLI) then + raise Exception.Create(SSQLNCLINeeds); + AddPropInt(DBPROP_ROWSET_ASYNCH, DBPROPVAL_ASYNCH_INITIALIZE); + end; + end; + OLEDBProperties.SetProperties(FICommandProperties); + finally + OLEDBProperties.Free; + end; + + if FSmartRefresh then begin + OLEDBProperties := TOLEDBPropertiesSet.Create(FConnection, DBPROPSET_SQLSERVERROWSET); + try + with OLEDBProperties do begin + AddPropStr(SSPROP_QP_NOTIFICATION_MSGTEXT, WideString(FSmartRefreshMsg), True); + AddPropStr(SSPROP_QP_NOTIFICATION_OPTIONS, Format('service=%s', [FSmartRefreshService]), True); + end; + OLEDBProperties.SetProperties(FICommandProperties); + finally + OLEDBProperties.Free; + end; + end; +end; + +procedure TOLEDBCommand.SetParameterInfo; +var + CommandWithParameters: ICommandWithParameters; + + i: integer; + rgParamOrdinals: array of UInt; + rgParamBindInfo: array of TDBParamBindInfo; + ParamDesc: TParamDesc; + hr: HResult; + ParamCount: integer; + + ParamVarType: TVarType; + prgParamOrdinals: IntPtr; + prgParamBindInfo: IntPtr; +{$IFDEF CLR} + rgParamOrdinalsGC: GCHandle; + rgParamBindInfoGC: GCHandle; +{$ENDIF} + IsUnicode: boolean; + +begin + QueryIntf(FICommandText, {$IFDEF CLR}ICommandWithParameters{$ELSE}IID_ICommandWithParameters{$ENDIF}, CommandWithParameters); + CommandWithParameters.SetParameterInfo(0, nil, nil); /// Clear, just in case + + ParamCount := FParams.Count; + + if ParamCount <> 0 then begin + SetLength(rgParamOrdinals, ParamCount); + SetLength(rgParamBindInfo, ParamCount); + + //OFS('================================='); + for i := 0 to ParamCount - 1 do begin + ParamDesc := FParams[i]; + rgParamOrdinals[i] := i + 1; + + case ParamDesc.GetDataType and varTypeMask of + dtUnknown: begin + ParamVarType := VarType(ParamDesc.Value); + case ParamVarType of + varSmallint: { vt_i2 2 } + rgParamBindInfo[i].pwszDataSourceType := dstSmallint; + varInteger: { vt_i4 3 } + rgParamBindInfo[i].pwszDataSourceType := dstInt; + varSingle: { vt_r4 4 } + rgParamBindInfo[i].pwszDataSourceType := dstReal; + varDouble: { vt_r8 5 } + rgParamBindInfo[i].pwszDataSourceType := dstFloat; + varCurrency: { vt_cy 6 } + rgParamBindInfo[i].pwszDataSourceType := dstMoney; + varDate: { vt_date 7 } + rgParamBindInfo[i].pwszDataSourceType := dstDatetime; + varOleStr: { vt_bstr 8 } + rgParamBindInfo[i].pwszDataSourceType := dstNVarchar; + {$IFNDEF CLR} + varString: + rgParamBindInfo[i].pwszDataSourceType := dstVarchar; + {$ENDIF} + varBoolean: { vt_bool 11 } + rgParamBindInfo[i].pwszDataSourceType := dstBit; + {$IFDEF VER6P} + varShortInt: + rgParamBindInfo[i].pwszDataSourceType := dstTinyint; + varWord: + rgParamBindInfo[i].pwszDataSourceType := dstInt; + varInt64: { vt_i8 20 } + rgParamBindInfo[i].pwszDataSourceType := dstBigint; + {$ENDIF} + varByte: { vt_ui1 17 } + rgParamBindInfo[i].pwszDataSourceType := dstSmallint; + varLongWord: { vt_ui4 19 } + rgParamBindInfo[i].pwszDataSourceType := dstBigint; + else + rgParamBindInfo[i].pwszDataSourceType := dstSql_variant; + end; + end; + + dtString, dtExtString: + if IsOutputLOB(ParamDesc, FConnection.DBMSPrimaryVer, FConnection.ProviderPrimaryVer) then + rgParamBindInfo[i].pwszDataSourceType := dstVarcharMax + else + rgParamBindInfo[i].pwszDataSourceType := dstVarchar; + + dtWideString, dtExtWideString: + if IsOutputLOB(ParamDesc, FConnection.DBMSPrimaryVer, FConnection.ProviderPrimaryVer) then + rgParamBindInfo[i].pwszDataSourceType := dstNVarcharMax + else + rgParamBindInfo[i].pwszDataSourceType := dstNVarchar; + + dtInt8: + rgParamBindInfo[i].pwszDataSourceType := dstTinyint; + dtInt16: + rgParamBindInfo[i].pwszDataSourceType := dstSmallint; + dtInt32, dtUInt16: + rgParamBindInfo[i].pwszDataSourceType := dstInt; + dtInt64, dtUInt32: + rgParamBindInfo[i].pwszDataSourceType := dstBigint; + dtFloat: + rgParamBindInfo[i].pwszDataSourceType := dstFloat; + dtDate, dtTime, dtDateTime: + rgParamBindInfo[i].pwszDataSourceType := dstDatetime; + dtBoolean: + rgParamBindInfo[i].pwszDataSourceType := dstBit; + dtCurrency: + rgParamBindInfo[i].pwszDataSourceType := dstMoney; + dtBlob: + rgParamBindInfo[i].pwszDataSourceType := dstImage; + dtMemo, dtWideMemo, dtMSXML: begin + {$IFDEF CLR} + IsUnicode := (VarType(ParamDesc.Value) = varOleStr) or (VarType(ParamDesc.Value) = varString); + if not IsUnicode + and (ParamDesc.Value <> nil) + and (ParamDesc.Value is TBlob) then + IsUnicode := TBlob(ParamDesc.Value).IsUnicode; + {$ELSE} + IsUnicode := VarType(ParamDesc.Value) = varOleStr; + if not IsUnicode + and (VarType(ParamDesc.Value) = varByRef) + and (TVarData(ParamDesc.Value).VPointer <> nil) then begin + // Assert(TObject(TVarData(ParamDesc.Value).VPointer) is TBlob); - trial + IsUnicode := TBlob(TVarData(ParamDesc.Value).VPointer).IsUnicode; + end; + {$ENDIF} + + if IsUnicode then + rgParamBindInfo[i].pwszDataSourceType := dstNVarchar + else + rgParamBindInfo[i].pwszDataSourceType := dstVarchar; + end; + + {$IFDEF VER5P} + dtVariant: + rgParamBindInfo[i].pwszDataSourceType := dstSql_variant; + {$ENDIF} + dtBytes: + rgParamBindInfo[i].pwszDataSourceType := dstBinary; + dtVarBytes, dtExtVarBytes: + rgParamBindInfo[i].pwszDataSourceType := dstVarbinary; + + {$IFDEF VER6P} + dtFMTBCD, + {$ENDIF} + dtBCD: + rgParamBindInfo[i].pwszDataSourceType := dstMoney; + + dtGuid: + rgParamBindInfo[i].pwszDataSourceType := dstGuid; + + else + Assert(False, Format('Unknown datatype for param %s[%d] = %X', [ParamDesc.GetName, i, ParamDesc.GetDataType])); + end; + + case ParamDesc.GetDataType of + dtString, dtExtString, dtBytes, dtVarBytes, dtExtVarBytes: + if ParamDesc.GetSize > 0 then + rgParamBindInfo[i].ulParamSize := ParamDesc.GetSize + else + rgParamBindInfo[i].ulParamSize := MaxNonBlobFieldLen; + dtWideString, dtExtWideString: + if ParamDesc.GetSize > 0 then + rgParamBindInfo[i].ulParamSize := ParamDesc.GetSize + else + rgParamBindInfo[i].ulParamSize := MaxNonBlobFieldLen div SizeOf(WideChar); + else + rgParamBindInfo[i].ulParamSize := $FFFFFFF; + end; + case ParamDesc.GetParamType of + pdInput: + rgParamBindInfo[i].dwFlags := DBPARAMFLAGS_ISINPUT + DBPARAMFLAGS_ISNULLABLE; + pdOutput, pdResult: + rgParamBindInfo[i].dwFlags := DBPARAMFLAGS_ISOUTPUT + DBPARAMFLAGS_ISNULLABLE; + pdUnknown, pdInputOutput: + rgParamBindInfo[i].dwFlags := DBPARAMFLAGS_ISINPUT + DBPARAMFLAGS_ISOUTPUT + DBPARAMFLAGS_ISNULLABLE; + end; + + rgParamBindInfo[i].pwszName := nil; + + {OFS(ParamDesc.GetName); + OFS(' ' + Marshal.PtrToStringUni(rgParamBindInfo[i].pwszDataSourceType)); + OFS(' ulParamSize = ' + IntToStr(rgParamBindInfo[i].ulParamSize)); + OFS(' dwFlags = ' + IntToStr(rgParamBindInfo[i].dwFlags)); + OFS(' bPrecision = ' + IntToStr(rgParamBindInfo[i].bPrecision)); + OFS(' bScale = ' + IntToStr(rgParamBindInfo[i].bScale));//} + + end; + {$IFDEF CLR} + try + rgParamOrdinalsGC := GCHandle.Alloc(rgParamOrdinals, GCHandleType.Pinned); + prgParamOrdinals := Marshal.UnsafeAddrOfPinnedArrayElement(rgParamOrdinals, 0); + + rgParamBindInfoGC := GCHandle.Alloc(rgParamBindInfo, GCHandleType.Pinned); + prgParamBindInfo := Marshal.UnsafeAddrOfPinnedArrayElement(rgParamBindInfo, 0); + + {$ELSE} + + prgParamOrdinals := @rgParamOrdinals[0]; + prgParamBindInfo := @rgParamBindInfo[0]; + {$ENDIF} + + {OFS('prgParamOrdinals'); + OFS(prgParamOrdinals, ParamCount * 4, OFSFileName); + OFS('prgParamBindInfo'); + OFS(prgParamBindInfo, ParamCount * sizeof(rgParamBindInfo[0]), OFSFileName);//} + hr := CommandWithParameters.SetParameterInfo(ParamCount, prgParamOrdinals, prgParamBindInfo); + {$IFDEF CLR} + finally + if IntPtr(rgParamOrdinalsGC) <> nil then + rgParamOrdinalsGC.Free; + if IntPtr(rgParamBindInfoGC) <> nil then + rgParamBindInfoGC.Free; + end; + {$ENDIF} + + if hr <> DB_S_TYPEINFOOVERRIDDEN then + Check(hr); + end; +end; + +procedure TOLEDBCommand.Prepare; +begin + if GetPrepared then + Exit; + + QueryInterfaces(True); + try + FRPCCall := FIsSProc and __UseRPCCallStyle; + SetCommandProp; + if FRPCCall or (not ParamsInfoOldBehavior) then + SetParameterInfo; + + Check(FICommandPrepare.Prepare(0)); // If statement is wrong in some cases exception may be occured in other place + {$IFDEF SDAC_TEST} + Inc(__ServerPrepareCount); + {$ENDIF} + + inherited; + FPrepared := True; + except + ReleaseInterfaces; + raise; + end; +end; + +procedure TOLEDBCommand.Unprepare; +begin + if GetPrepared then begin + FIUnknown := nil; + RequestParamsIfPossible; + + if (FICommandPrepare <> nil) and not FRPCCall then + Check(FICommandPrepare.UnPrepare); + inherited; + FPrepared := False; + FRPCCall := False; + + ReleaseInterfaces; + end; +end; + +function TOLEDBCommand.GetPrepared: boolean; +begin + Result := FPrepared; +end; + +{$IFNDEF VER6P} +type + _TParamDesc = class (TParamDesc); +{$ENDIF} + +procedure FillBindingForParam(Ordinal: integer; ParamDesc: TOLEDBParamDesc; Connection: TOLEDBConnection; + var pBind: TDBBinding; var BindMemorySize: UINT; const ValueAvaliable: boolean; const IsWide: boolean); + + procedure SetBindDefaults; + begin + pBind.dwPart := DBPART_STATUS or DBPART_LENGTH or DBPART_VALUE; // WAR Length is not always need and may be removed in some cases + {$IFNDEF CLR} + pointer(pBind.pTypeInfo) := nil; + {$ENDIF} + pBind.pBindExt := nil; + pBind.dwMemOwner := DBMEMOWNER_CLIENTOWNED; + pBind.dwFlags := 0; + pBind.bPrecision := 11; + pBind.bScale := 0; + end; + + procedure SetBindData; + function GetMaxLen: integer; // Also correct pBind.wType. Must be called AFTER ConvertInternalTypeToOLEDB + var + IsUnicode: boolean; + DataType: word; + begin + DataType := ParamDesc.GetDataType; + case DataType of + dtUnknown: + Result := sizeof(OleVariant); + dtString: + if not ValueAvaliable then + Result := MaxNonBlobFieldLen + else + Result := ParamDesc.GetSize + 1{#0}; + dtWideString: + Result := (ParamDesc.GetSize + 1{#0}) * sizeof(WideChar); + dtBytes, dtVarBytes: + Result := ParamDesc.GetSize; + dtInt8: + Result := sizeof(byte); + dtInt16, dtWord: + if Connection.FProvider = prCompact then begin + if (ParamDesc.OLEDBType = DBTYPE_UI1) then begin + Result := SizeOf(Byte); + pBind.wType := DBTYPE_UI1; + end + else + Result := sizeof(word); + end + else + Result := sizeof(word); + dtInt32: + Result := sizeof(dword); + dtFloat: + if Connection.FProvider = prCompact then begin + if (ParamDesc.OLEDBType = DBTYPE_R4) then begin + Result := SizeOf(Single); + pBind.wType := DBTYPE_R4; + end + else + if (ParamDesc.OLEDBType = DBTYPE_NUMERIC) then begin + Result := SizeOfTDBNumeric; + pBind.wType := DBTYPE_NUMERIC; + end + else + Result := SizeOf(double); + end + else + Result := sizeof(double); + dtCurrency: + Result := sizeof(double); + // Result := sizeof(Currency); Currency type cannot be used over TCurrencyField uses double to store + dtDate: + Result := sizeof(TDateTime); + dtDateTime, dtTime: + begin + Result := sizeof(TDBTimeStamp); + pBind.wType := DBTYPE_DBTIMESTAMP; + end; + dtBoolean: + Result := sizeof(WordBool); + dtInt64: + Result := sizeof(Int64); + dtBlob, dtMemo, dtWideMemo, dtMSXML: + if Connection.FProvider <> prCompact then + if IsOutputLOB(ParamDesc, Connection.DBMSPrimaryVer, Connection.ProviderPrimaryVer) then + Result := SizeOf(TOLEDBStream) // varchar(max) + else + Result := 0 // Only Input, store ByRef + else begin + if ((DataType = dtMemo) or (DataType = dtWideMemo)) and (ParamDesc.OLEDBType in [DBTYPE_STR, DBTYPE_WSTR]) then begin + Result := TBlob(ParamDesc.GetObject).Size; + pBind.wType := ParamDesc.OLEDBType; + end + else + Result := SizeOf(TOLEDBStream); + end; + {$IFDEF VER5P} + dtGuid: + Result := sizeof(TGuid); + dtVariant: + Result := sizeof(OleVariant); + {$ENDIF} + dtBCD: + if Connection.FProvider <> prCompact then + Result := sizeof(Currency) + else begin + Result := SizeOfTDBNumeric; + pBind.wType := DBTYPE_NUMERIC; + end; + {$IFDEF VER6P} + dtFmtBCD: + if Connection.FProvider <> prCompact then + Result := SizeOfTBcd * 2 + else + Result := SizeOfTDBNumeric; + {$ENDIF} + else + Result := 0; + end; + + if (Connection.FProvider = prCompact) and IsLargeDataTypeUsed(ParamDesc) and ParamDesc.GetNull then begin + Result := 0; + case ParamDesc.GetDataType of + dtBlob: + pBind.wType := DBTYPE_BYTES; + dtMemo, dtWideMemo: + pBind.wType := DBTYPE_WSTR; + else + Assert(False); + end; + end; + + // Optimization for input-only parameters + if (((ParamDesc.GetParamType = pdInput) and (DataType in CharsByRef + BytesByRef) {$IFDEF CLR}and (DataType <> dtString){$ENDIF}) + or (DataType = dtBlob) + or (DataType = dtMemo) + or (DataType = dtWideMemo) + or (DataType = dtMSXML)) + and (Connection.FProvider <> prCompact) + and (not IsOutputLOB(ParamDesc, Connection.DBMSPrimaryVer, Connection.ProviderPrimaryVer)) then begin + // Only Input, store ByRef + Result := 4; + if (DataType in BytesByRef) then // This is Bytes by Ref + pBind.wType := DBTYPE_BYREF or DBTYPE_BYTES + else // This is (Wide)String by Ref + begin + {$IFDEF CLR} + if not ValueAvaliable then + IsUnicode := (ParamDesc.GetDataType in [dtWideString, dtExtWideString]) or IsWide + else + IsUnicode := (VarType(ParamDesc.Value) = varOleStr) or (VarType(ParamDesc.Value) = varString); + if not IsUnicode + and (ParamDesc.Value <> nil) + and (ParamDesc.Value is TBlob) then + IsUnicode := TBlob(ParamDesc.Value).IsUnicode; + {$ELSE} + if not ValueAvaliable then + IsUnicode := (ParamDesc.GetDataType in [dtWideString, dtExtWideString]) or IsWide + else + IsUnicode := VarType(ParamDesc.Value) = varOleStr; + if not IsUnicode + and (VarType(ParamDesc.Value) = varByRef) + and (TVarData(ParamDesc.Value).VPointer <> nil) then begin + // Assert(TObject(TVarData(ParamDesc.Value).VPointer) is TBlob); - trial + IsUnicode := TBlob(TVarData(ParamDesc.Value).VPointer).IsUnicode; + end; + {$ENDIF} + + if IsUnicode then // WideString + pBind.wType := DBTYPE_BYREF or DBTYPE_WSTR + else // (VType = varString) String + pBind.wType := DBTYPE_BYREF or DBTYPE_STR; + end; + end + else + if (ParamDesc.GetParamType in [pdOutput, pdInputOutput]) // Truncate params, if too long + and (DataType in [dtString, dtWideString, dtBytes, dtVarBytes]) then begin + if not ((Connection.DBMSPrimaryVer >= 9) and (Connection.ProviderPrimaryVer >=9) and (Result > MaxNonBlobFieldLen)) then + if DataType = dtString then + Result := MaxNonBlobFieldLen + 1 + else + Result := MaxNonBlobFieldLen; + end; + + Assert(Result >= 0); +// Assert(Result <= MaxNonBlobFieldLen + 1); + end; + + var + ServerVersion: integer; + begin +{ if pBind.iOrdinal = 1 then + OFS('=========================================='); + OFS('--------------------------'); + OFS('ParamDesc.GetName ' + ParamDesc.GetName); + OFS('VarType(ParamDesc.Value) = ' + IntToStr(VarType(ParamDesc.Value)));} + + pBind.iOrdinal := Ordinal; + pBind.eParamIO := ConvertCRParamTypeToOLEDB(ParamDesc.GetParamType); + if IsLargeDataTypeUsed(ParamDesc) and // "text", "ntext", "image" + (pBind.eParamIO in [DBPARAMIO_OUTPUT, DBPARAMIO_INPUT + DBPARAMIO_OUTPUT]) then + if not IsOutputLOB(ParamDesc, Connection.DBMSPrimaryVer, Connection.ProviderPrimaryVer) then // "varchar(max)" + DatabaseErrorFmt(SBadOutputParam, [ParamDesc.GetName]); + + // int64 parameters conversion + if ((Connection.ProviderPrimaryVer < 8) and not IsWindowsVista) and (Connection.FProvider <> prCompact) and + (ParamDesc.GetDataType = dtInt64) then + ParamDesc.SetDataType(dtFloat); + + // currency parameters conversion + if (ParamDesc.GetDataType = dtCurrency) and (VarType(ParamDesc.Value) = varCurrency) then + ParamDesc.SetDataType(dtBCD); // To prevent SQL Server exception on setting float value to smallmoney parameter + + if Connection <> nil then + ServerVersion := Connection.DBMSPrimaryVer + else + ServerVersion := 0; + pBind.wType := ConvertInternalTypeToOLEDB(ParamDesc.GetDataType, True, ServerVersion); + (* Not used + if pBind.wType = DBTYPE_IUNKNOWN then begin + GetMem1(pBind.pObject, sizeof(DBOBJECT)); + pBind.pObject^.iid := IID_ISequentialStream; + if pBind.eParamIO = DBPARAMIO_INPUT then + pBind.pObject^.dwFlags := STGM_READ + else + pBind.pObject^.dwFlags := STGM_READWRITE; + end;*) + + pBind.obStatus := BindMemorySize; + pBind.obLength := BindMemorySize + sizeof(DWORD); + pBind.obValue := BindMemorySize + sizeof(DWORD) + sizeof(UINT); + + pBind.cbMaxLen := GetMaxLen; // Also correct pBind.wType. Must be called AFTER ConvertInternalTypeToOLEDB + if not ((ServerVersion = 3) and ((pBind.wType = DBTYPE_BYTES) or (pBind.wType = DBTYPE_WSTR))) then + Assert(pBind.cbMaxLen > 0, Format('Unknown datatype for param %s[%d] = %X', [ParamDesc.GetName, Ordinal, ParamDesc.GetDataType])); + BindMemorySize := pBind.obValue + pBind.cbMaxLen; + + {OFS('iOrdinal = ' + IntToStr(pBind.iOrdinal)); + OFS('obValue = ' + IntToStr(pBind.obValue)); + OFS('obLength = ' + IntToStr(pBind.obLength)); + OFS('obStatus = ' + IntToStr(pBind.obStatus)); + OFS('pTypeInfo = ' + IntToStr(Integer(pBind.pTypeInfo))); + OFS('pObject = ' + IntToStr(Integer(pBind.pObject))); + OFS('pBindExt = ' + IntToStr(Integer(pBind.pBindExt))); + OFS('dwPart = ' + IntToStr(pBind.dwPart)); + OFS('dwMemOwner = ' + IntToStr(pBind.dwMemOwner)); + OFS('eParamIO = ' + IntToStr(pBind.eParamIO)); + OFS('cbMaxLen = ' + IntToStr(pBind.cbMaxLen)); + OFS('dwFlags = ' + IntToStr(pBind.dwFlags)); + OFS('wType = ' + IntToStr(pBind.wType)); + OFS('bPrecision = ' + IntToStr(pBind.bPrecision)); + OFS('bScale = ' + IntToStr(pBind.bScale));} + end; + +begin + SetBindDefaults; + SetBindData; +end; + +procedure SaveParamValue(const ParamDesc: TParamDesc; const pBind: TDBBinding; + var ParamsAccessorData: TParamsAccessorData{$IFDEF HAVE_COMPRESS}; + const CompressBlobMode: TCompressBlobMode{$ENDIF} + {$IFDEF CLR}; var ParamsGC: TIntPtrDynArray{$ENDIF}; ServerVersion, ClientVersion: integer); +var + pStatus: PDWORD; + pLength: PUINT; + pValue: IntPtr; + // pParamData: PVarData; + ParamVarType: TVarType; + ParamVarPtr: IntPtr; + + s: string; + l: UINT; + ws: WideString; + + c: Currency; + i64: Int64; + + Blob: TBlob; +{$IFDEF CLR} + d: double; + b: TBytes; +{$ENDIF} +{$IFDEF VER6P} + DotPos: integer; + Bcd: TBcd; +{$ENDIF} +{$IFDEF HAVE_COMPRESS} + Compress: boolean; +{$ENDIF} + dt: TDateTime; + AYear, AMonth, ADay, AHour, AMinute, ASecond, AMilliSecond: Word; + DBTimeStamp: TDBTimeStamp; + DBNumeric: TDBNumeric; + Stream: ISequentialStream; + OLEDBStream: TOLEDBStream; +begin + {OFS('-------'); + OFS('[' + IntToStr(pBind.iOrdinal) + ']'); + OFS('pBind.eParamIO=' + IntToStr(pBind.eParamIO)); + OFS('pBind.obValue=' + IntToStr(pBind.obValue)); + OFS('pBind.obLength=' + IntToStr(pBind.obLength)); + OFS('pBind.obStatus=' + IntToStr(pBind.obStatus)); + OFS('pBind.wType=' + IntToStr(pBind.wType)); + OFS('pBind.dwFlags=' + IntToStr(pBind.dwFlags)); + OFS('pBind.bPrecision=' + IntToStr(pBind.bPrecision)); + OFS('pBind.bScale=' + IntToStr(pBind.bScale)); + OFS('pBind.cbMaxLen=' + IntToStr(pBind.cbMaxLen)); + OFS('ParamDesc.GetNull=' + BoolToStr(ParamDesc.GetNull, True)); + OFS('ParamDesc.GetParamType=' + IntToStr(Integer(ParamDesc.GetParamType))); + OFS('ParamDesc.GetDataType=' + IntToStr(ParamDesc.GetDataType));} + if pBind.eParamIO in [DBPARAMIO_INPUT, DBPARAMIO_INPUT + DBPARAMIO_OUTPUT] then begin + pStatus := PDWORD(UINT(Integer(ParamsAccessorData.ExecuteParams.pData)) + pBind.obStatus); + pValue := IntPtr(UINT(Integer(ParamsAccessorData.ExecuteParams.pData)) + pBind.obValue); // Destination + + if TOLEDBParamDesc(ParamDesc).UseDefaultValue then begin + FillChar(pValue, pBind.cbMaxLen, 0); + Marshal.WriteInt32(pStatus, Integer(DBSTATUS_S_DEFAULT)); + end + else + if ParamDesc.GetNull then begin + FillChar(pValue, pBind.cbMaxLen, 0); + Marshal.WriteInt32(pStatus, Integer(DBSTATUS_S_ISNULL)); + end + else + begin + Marshal.WriteInt32(pStatus, Integer(DBSTATUS_S_OK)); + + pLength := PUINT(UINT(Integer(ParamsAccessorData.ExecuteParams.pData)) + pBind.obLength); + ParamVarType := VarType(ParamDesc.Value); + // pParamData := @TVarData(ParamDesc.Value); // Source + + if (((ParamDesc.GetParamType = pdInput) and (ParamDesc.GetDataType in CharsByRef + BytesByRef){$IFDEF CLR}and (ParamDesc.GetDataType <> dtString){$ENDIF}) + or (ParamDesc.GetDataType in [dtBlob, dtMemo, dtWideMemo, dtMSXML])) and (ServerVersion <> 3) and (not IsOutputLOB(ParamDesc, ServerVersion, ClientVersion)) + then begin + // Optimization for input-only parameters, store by ref + if ParamVarType = varArray + varByte then begin + {$IFDEF CLR} + l := Length(ParamsGC); + SetLength(ParamsGC, l + 1); + ParamsGC[l] := AllocGCHandle(ParamDesc.Value, True); + ParamVarPtr := GetAddrOfPinnedObject(ParamsGC[l]); + l := VarArrayHighBound(ParamDesc.Value, 1) - VarArrayLowBound(ParamDesc.Value, 1) + 1; + {$ELSE} + ParamVarPtr := TVarData(ParamDesc.Value).VArray.Data; + l := TVarData(ParamDesc.Value).VArray.Bounds[0].ElementCount; + {$ENDIF} + Marshal.WriteIntPtr(pValue, ParamVarPtr); + Marshal.WriteInt32(pLength, l); + end + else + {$IFDEF CLR} + if ParamDesc.Value is TBlob then begin + Assert(ParamDesc.Value <> nil); + Blob := TBlob(ParamDesc.Value); + {$ELSE} + if ParamVarType = varByRef then begin + Assert(TVarData(ParamDesc.Value).VPointer <> nil); + // Assert(TObject(TVarData(ParamDesc.Value).VPointer) is TBlob); - trial + Blob := TVarData(ParamDesc.Value).VPointer; + {$ENDIF} + Blob.Defrag; + {$IFDEF HAVE_COMPRESS} + Compress := Blob is TCompressedBlob; + if Compress then + TCompressedBlob(Blob).Compressed := (CompressBlobMode = cbServer) or (CompressBlobMode = cbClientServer); + if Compress and TCompressedBlob(Blob).Compressed then + Marshal.WriteInt32(pLength, Integer(TCompressedBlob(Blob).CompressedSize)) + else + {$ENDIF} + Marshal.WriteInt32(pLength, Integer(Blob.Size)); + if IntPtr(Blob.FirstPiece) = nil then + Marshal.WriteIntPtr(pValue, nil) + else + Marshal.WriteIntPtr(pValue, IntPtr(Integer(Blob.FirstPiece) + sizeof(TPieceHeader))); + end + else + begin // CharsByRef Input parameter + {$IFDEF CLR} + l := Length(ParamsGC); + SetLength(ParamsGC, l + 1); + ParamsGC[l] := AllocGCHandle(ParamDesc.Value, True); + ParamVarPtr := GetAddrOfPinnedObject(ParamsGC[l]); + {$ELSE} + ParamVarPtr := TVarData(ParamDesc.Value).VPointer; + if (ParamVarPtr = nil) and (ParamDesc.Value = '') then + ParamVarPtr := PChar(EmptyString); + {$ENDIF} + Marshal.WriteIntPtr(pValue, ParamVarPtr); + if (ParamDesc.GetDataType in CharsByRef) then + if ParamVarPtr <> nil then begin + {$IFDEF CLR} + l := Length(ParamDesc.Value) * SizeOf(WideChar); + {$ELSE} + if ParamVarType = varOleStr then // WideString + l := Integer(StrLenW(ParamVarPtr) * SizeOf(WideChar)) + else // Pascal string + l := StrLen(ParamVarPtr) + {$ENDIF} + end + else + l := 0 + else + l := Integer(ParamDesc.GetSize); + Marshal.WriteInt32(pLength, l); + end; + end + else + case ParamDesc.GetDataType of + dtUnknown: + SetOleVariant(pValue, ParamDesc.Value); + dtString: + begin + s := ParamDesc.Value; + l := Length(s); + if l > pBind.cbMaxLen - 1{#0} then // Truncate too long values + l := pBind.cbMaxLen - 1{#0}; + Marshal.WriteInt32(pLength, l); + + if l > 0 then + CopyBufferAnsi(s, pValue, l + 1{#0}); + end; + dtWideString: + begin + ws := ParamDesc.Value; + l := Length(ws) * sizeof(WideChar); + if l > (pBind.cbMaxLen - 1{#0}) * sizeof(WideChar) then // Truncate too long values + l := (pBind.cbMaxLen - 1{#0}) * sizeof(WideChar); + Marshal.WriteInt32(pLength, l); + + if l > 0 then + CopyBufferUni(ws, pValue, l + 2{#0#0}); + end; + dtBytes, dtVarBytes: + begin + case ParamVarType of + varArray + varByte: + begin + {$IFDEF CLR} + b := ParamDesc.Value; + l := Length(b); + if l > pBind.cbMaxLen then // Truncate too long values + l := pBind.cbMaxLen; + Marshal.Copy(b, 0, pValue, l); + {$ELSE} + l := TVarData(ParamDesc.Value).VArray.Bounds[0].ElementCount; + if l > pBind.cbMaxLen then // Truncate too long values + l := pBind.cbMaxLen; + Move(TVarData(ParamDesc.Value).VArray.Data^, pValue^, l); + {$ENDIF} + Marshal.WriteInt32(pLength, l); + end; + varOleStr: + begin + s := ParamDesc.Value; + l := Length(s); + if l > pBind.cbMaxLen {without #0} then // Truncate too long values + l := pBind.cbMaxLen {without #0}; + Marshal.WriteInt32(pLength, l); + + if l > 0 then + CopyBufferAnsi(s, pValue, l); + end; + else + {$IFDEF LITE} + raise Exception.Create('Unknown BLOB field type (must be varArray + varByte, varOleStr)'); + {$ELSE} + raise EDatabaseError.Create('Unknown BLOB field type (must be varArray + varByte, varOleStr)'); + {$ENDIF} + end; + end; + dtInt8: + Marshal.WriteInt16(pValue, Byte(ParamDesc.Value)); + dtInt16: + Marshal.WriteInt16(pValue, SmallInt(ParamDesc.Value)); + dtWord: + if (ServerVersion = 3) and (pBind.wType = DBTYPE_UI1) then + Marshal.WriteByte(pValue, Byte(ParamDesc.Value)) + else + Marshal.WriteInt16(pValue, SmallInt(Word(ParamDesc.Value))); + dtInt32: + Marshal.WriteInt32(pValue, Integer(ParamDesc.Value)); + dtFloat: + if ServerVersion = 3 then begin + if (pBind.wType = DBTYPE_R4) then + Marshal.WriteInt32(pValue, BitConverter.ToInt32(BitConverter.GetBytes(Single(ParamDesc.Value)), 0)) + else + if (pBind.wType = DBTYPE_NUMERIC) then begin + DBNumeric := DoubleToDBNumeric(Double(ParamDesc.Value), pBind.bPrecision, pBind.bScale); + {$IFDEF CLR} + Marshal.StructureToPtr(TObject(DBNumeric), pValue, False); + {$ELSE} + PDBNumeric(pValue)^ := DBNumeric; + {$ENDIF} + end + else + Marshal.WriteInt64(pValue, BitConverter.DoubleToInt64Bits(Double(ParamDesc.Value))); + end + else + Marshal.WriteInt64(pValue, BitConverter.DoubleToInt64Bits(Double(ParamDesc.Value))); + dtCurrency: begin + if (ServerVersion = 3) and (pBind.wType = DBTYPE_CY) then begin + {$IFDEF CLR} + c := ParamDesc.Value; + d := c; + d := d * 10000; + i64 := Convert.ToInt64(d); + Marshal.WriteInt64(pValue, i64); + {$ELSE} + PCurrency(pValue)^ := ParamDesc.Value; + {$ENDIF} + end + else + Marshal.WriteInt64(pValue, BitConverter.DoubleToInt64Bits(Double(ParamDesc.Value))); + // PCurrency(pValue)^ := ParamDesc.Value; Currency type cannot be used over TCurrencyField uses double to store + end; + dtDate: + Marshal.WriteInt64(pValue, BitConverter.DoubleToInt64Bits(TDateTime(ParamDesc.Value))); + dtDateTime, dtTime: + begin + dt := TDateTime(ParamDesc.Value); + DecodeDateTime(dt, AYear, AMonth, ADay, AHour, AMinute, ASecond, AMilliSecond); + DBTimeStamp.year := AYear; + DBTimeStamp.month := AMonth; + DBTimeStamp.day := ADay; + DBTimeStamp.hour := AHour; + DBTimeStamp.minute := AMinute; + DBTimeStamp.second := ASecond; + DBTimeStamp.fraction := AMilliSecond * 1000000 ; // milliseconds to billionths of a second + {$IFDEF CLR} + Marshal.StructureToPtr(TObject(DBTimeStamp), pValue, False); + {$ELSE} + PDBTimeStamp(pValue)^ := DBTimeStamp; + {$ENDIF} + end; + dtBoolean: + Marshal.WriteInt16(pValue, SmallInt(WordBool(Boolean(ParamDesc.Value)))); // Convert to boolean is useful to bypass Delphi bug + dtInt64: + begin + {$IFDEF VER6P} + i64 := ParamDesc.Value; // Explicit Convert! + Marshal.WriteInt64(pValue, i64); + {$ELSE} + if ParamVarType in [$000E, $0014] then + PInt64(pValue)^ := PInt64(@TVarData(ParamDesc.Value).VInteger)^ + else + PInt64(pValue)^ := TVarData(ParamDesc.Value).VInteger; + {$ENDIF} + end; + {$IFDEF VER5P} + dtGuid: + {$IFDEF CLR} + Marshal.StructureToPtr(TObject(StringToGUID(ParamDesc.Value)), pValue, False); + {$ELSE} + PGuid(pValue)^ := StringToGUID(ParamDesc.Value); + {$ENDIF} + dtVariant: + SetOleVariant(pValue, ParamDesc.Value); + {$ENDIF} + dtBCD: + if (ServerVersion = 3) then begin + Assert(pBind.wType = DBTYPE_NUMERIC); + DBNumeric := DoubleToDBNumeric(ParamDesc.Value, 0, 0); + {$IFDEF CLR} + Marshal.StructureToPtr(TObject(DBNumeric), pValue, False); + {$ELSE} + PDBNumeric(pValue)^ := DBNumeric; + {$ENDIF} + end + else begin + {$IFNDEF VER6P} + if ParamVarType in [$000E, $0014] then + PCurrency(pValue)^ := PInt64(@TVarData(ParamDesc.Value).VInteger)^ + else + {$ENDIF} + begin + c := ParamDesc.Value; + {$IFDEF CLR} + d := c; + d := d * 10000; + i64 := Convert.ToInt64(d); + {$ELSE} + i64 := PInt64(@c)^; + {$ENDIF} + Marshal.WriteInt64(pValue, i64); + end; + end; + {$IFDEF VER6P} + dtFmtBCD: + if (ServerVersion = 3) then begin + Assert(pBind.wType = DBTYPE_NUMERIC); + if VarIsFMTBcd(ParamDesc.Value) then + //Assert(VarIsFMTBcd(ParamDesc.Value)); + DBNumeric := BcdToDBNumeric(VarToBcd(ParamDesc.Value)) + else begin + s := ParamDesc.Value; + if DecimalSeparator <> '.' then begin + DotPos := Pos(DecimalSeparator, s); + if DotPos <> 0 then + s[DotPos] := '.'; + end; + Bcd := StrToBcd(s); + DBNumeric := BcdToDBNumeric(Bcd); + end; + {$IFDEF CLR} + Marshal.StructureToPtr(TObject(DBNumeric), pValue, False); + {$ELSE} + PDBNumeric(pValue)^ := DBNumeric; + {$ENDIF} + end + else + begin + s := ParamDesc.Value; + if DecimalSeparator <> '.' then begin + DotPos := Pos(DecimalSeparator, s); + if DotPos <> 0 then + s[DotPos] := '.'; + end; + l := Length(s); + Marshal.WriteInt32(pLength, l); + + if l > 0 then + CopyBufferAnsi(s, pValue, l + 1{#0}); + end; + {$ENDIF} + dtMemo, dtWideMemo, dtBlob: + if pBind.wType = DBTYPE_IUNKNOWN then begin + // Create stream + OLEDBStream := TOLEDBStream.Create(ParamDesc.GetObject as TBlob, nil{FStreamList}); + Stream := OLEDBStream; + Marshal.WriteIntPtr(pValue, Marshal.GetIUnknownForObject(OLEDBStream)); + // Set stream size + Marshal.WriteInt32(pLength, Integer(OLEDBStream.Size)); + end + else begin + ws := (ParamDesc.GetObject as TBlob).AsWideString; + l := Length(ws) * sizeof(WideChar); + if l > (pBind.cbMaxLen - 1{#0}) * sizeof(WideChar) then // Truncate too long values + l := (pBind.cbMaxLen - 1{#0}) * sizeof(WideChar); + Marshal.WriteInt32(pLength, l); + + if l > 0 then + CopyBufferUni(ws, pValue, l + 2{#0#0}); + end; + else + Assert(False, Format('ParamDesc - %s, Unknown DataType = %d', [ParamDesc.GetName, ParamDesc.GetDataType])); + end; + end; + end; +end; + +procedure TOLEDBCommand.CreateAndFillParamAccs; +var + ParamCnt: integer; + + procedure PrepareParamAcc(out BindMemorySize: UINT); // Set preliminary binding data + var + i: integer; + begin + Assert(Length(FParamsAccessorData.rgBindings) <> 0); + for i := 0 to ParamCnt - 1 do + FParamsAccessorData.rgBindings[i].pObject := nil; + + BindMemorySize := 0; + for i := 0 to ParamCnt - 1 do + FillBindingForParam(i + 1, TOLEDBParamDesc(FParams[i]), FConnection, FParamsAccessorData.rgBindings[i], BindMemorySize, True, False); + end; + +var +{$IFDEF CLR} + rgBindingsGC: GCHandle; +{$ENDIF} + rgBindings: PDBBinding; + rgStatus: PUINT; + i: integer; + BindMemorySize: UINT; + +begin + Assert(FICommandText <> nil, 'FICommandText must be setted to CreateAndFillParamAccs'); + Assert(not FParamsAccessorDataAvaible, 'procedure CreateAndFillParamAccs already called'); + ParamCnt := FParams.Count; + rgStatus := Marshal.AllocHGlobal(ParamCnt * SizeOf(UINT)); +{$IFNDEF CLR} + IntPtr(FParamsAccessorData.Accessor) := nil; +{$ENDIF} + + FCanReadParams := False; + + try + try + FParamsAccessorData.ExecuteParams.HACCESSOR := 0; + FParamsAccessorData.ExecuteParams.pData := nil; + FParamsAccessorData.ExecuteParams.cParamSets := 1; + + SetLength(FParamsAccessorData.rgBindings, ParamCnt); + PrepareParamAcc(BindMemorySize); + + FParamsAccessorData.ExecuteParams.pData := Marshal.AllocHGlobal(BindMemorySize); + FillChar(FParamsAccessorData.ExecuteParams.pData, BindMemorySize, 0); + + for i := 0 to ParamCnt - 1 do + SaveParamValue(FParams[i], FParamsAccessorData.rgBindings[i], + FParamsAccessorData{$IFDEF HAVE_COMPRESS}, FCompressBlob{$ENDIF} + {$IFDEF CLR}, FParamsGC{$ENDIF}, FConnection.DBMSPrimaryVer, FConnection.ProviderPrimaryVer); + + + QueryIntf(FICommandText, {$IFDEF CLR}IAccessor{$ELSE}IID_IAccessor{$ENDIF}, FParamsAccessorData.Accessor); + {$IFDEF CLR} + rgBindingsGC := GCHandle.Alloc(FParamsAccessorData.rgBindings, GCHandleType.Pinned); + rgBindings := Marshal.UnsafeAddrOfPinnedArrayElement(FParamsAccessorData.rgBindings, 0); + {$ELSE} + rgBindings := @FParamsAccessorData.rgBindings[0]; + {$ENDIF} + Check(FParamsAccessorData.Accessor.CreateAccessor( + DBACCESSOR_PARAMETERDATA, ParamCnt, rgBindings, BindMemorySize, + FParamsAccessorData.ExecuteParams.HACCESSOR, rgStatus)); + FParamsAccessorDataAvaible := True; + except + if FParamsAccessorData.ExecuteParams.pData <> nil then + Marshal.FreeHGlobal(FParamsAccessorData.ExecuteParams.pData); + FParamsAccessorData.ExecuteParams.pData := nil; + + if Length(FParamsAccessorData.rgBindings) <> 0 then begin + for i := 0 to ParamCnt - 1 do + begin + if FParamsAccessorData.rgBindings[i].pObject <> nil then + Marshal.FreeHGlobal(FParamsAccessorData.rgBindings[i].pObject); + end; + SetLength(FParamsAccessorData.rgBindings, 0); + end; + + FParamsAccessorDataAvaible := False; + raise; + end; + finally + Marshal.FreeHGlobal(rgStatus); + {$IFDEF CLR} + if IntPtr(rgBindingsGC) <> nil then + rgBindingsGC.Free; + {$ENDIF} + end; +end; + +procedure TOLEDBCommand.Execute(Iters: integer = 1); + procedure DoExecute; + var + AsynchComplete: boolean; + + function OpenOrExec: IUnknown; + var + Params: DBPARAMS; + RequestInt: TGUID; + hr: HRESULT; + + begin + if not GetPrepared then + SetCommandProp; + + if FRequestIUnknown or (FNonBlocking and (not FRequestIUnknown)) then + RequestInt := IID_IUnknown + else + RequestInt := IID_NULL; + + FWaitForBreak := False; + try + + if FRPCCall then + SetParameterInfo; + if FParams.Count = 0 then begin + Params.HACCESSOR := 0; + Params.pData := nil; + Params.cParamSets := 0; + hr := ICommand(FICommandText).Execute(nil, RequestInt, Params, FRowsAffected, Result); + end + else + begin + CreateAndFillParamAccs; + hr := ICommand(FICommandText).Execute(nil, RequestInt, FParamsAccessorData.ExecuteParams, FRowsAffected, Result); + end; + + AsynchComplete := True; + if FNonBlocking and (hr = DB_S_ASYNCHRONOUS) then + AsynchComplete := False + else + CheckAndAnalyze(hr); + + {$IFDEF SDAC_TEST} + Inc(__ServerExecuteCount); + {$ENDIF} + except + on E: Exception do begin + if (E is EOLEDBError) and (EOLEDBError(E).ErrorCode = DB_E_ABORTLIMITREACHED) then + Unprepare; + Result := nil; + FIUnknown := nil; + ClearIMultipleResults; + FISSAsynchStatus := nil; + + raise; + end; + end; + end; + + var + IUnk: IUnknown; + begin + Assert(FIUnknown = nil); + FLastExecWarning := False; + if FIMultipleResults = nil then begin + IUnk := OpenOrExec; // After call IUnk may be [nil, IUnknown (message), IUnknown (cursor)] + Assert(FRequestIUnknown or FNonBlocking or (IUnk = nil)); + + if FRequestIUnknown and (IUnk <> nil) then begin + if FRequestMultipleResults then + QueryIntf(IUnk, {$IFDEF CLR}IMultipleResults{$ELSE}IID_IMultipleResults{$ENDIF}, FIMultipleResults) + else // This is a server cursor or DbxSda call + FIUnknown := IUnk; + IUnk := nil; + end; + + if not FRequestIUnknown and FNonBlocking and not AsynchComplete then begin + Assert(IUnk <> nil); + QueryIntf(IUnk, {$IFNDEF CLR}IID_ISSAsynchStatus{$ELSE}ISSAsynchStatus{$ENDIF}, FISSAsynchStatus); + end; + end; + + if FRequestIUnknown and (FIMultipleResults <> nil) then + if FIUnknownNext = nil then + GetNextResult(FIUnknown, FRowsAffected) + else + begin + FIUnknown := FIUnknownNext; + FIUnknownNext := nil; + FRowsAffected := FRowsAffectedNext; + end; + end; +begin + if (FCursorState <> csInactive) and (FCursorState <> csPrepared) then + Exit; + + FExecuting := True; + SetCursorState(csExecuting); + QueryInterfaces(False); // If QueryInterfaces already called then do nothing + try + DoExecute; + if FNonBlocking and (FISSAsynchStatus <> nil) then begin + Assert(FExecutor = nil); + FExecutor := TOLEDBThreadWrapper.Create(TExecuteThread, True); + FExecutor.OnException := DoExecuteException; + FExecutor.OnTerminate := DoExecuteTerminate; + TExecuteThread(FExecutor.FThread).FRunMethod := WaitAsynchCompletion; + FExecutor.FreeOnTerminate := True; + FExecutor.Resume; + end; + except + on E: Exception do begin + if (not FNonBlocking) or FRequestIUnknown or (FISSAsynchStatus = nil) then + EndExecute(E); + raise; + end; + end; + if (not FNonBlocking) or FRequestIUnknown or (FISSAsynchStatus = nil) then + EndExecute(nil); +end; + +procedure TOLEDBCommand.DoExecuteTerminate(Sender: TObject); // MainThread context +begin + EndExecute(FExecutor.FException); + FExecutor := nil; +end; + +procedure TOLEDBCommand.DoExecuteException(Sender: TObject; E: Exception; var Fail: boolean); // MainThread context +begin + if (E is EOLEDBError) then + FConnection.DoError(EOLEDBError(E), Fail); +end; + +procedure TOLEDBCommand.WaitAsynchCompletion; // FExecuter.FThread context +var + hr: HRESULT; + Completed: boolean; +begin + if (FISSAsynchStatus <> nil) then begin + try + Completed := False; + while not TExecuteThread(FExecutor.FThread).Terminated do begin + hr := FISSAsynchStatus.WaitForAsynchCompletion(100); + Completed := hr <> DB_S_ASYNCHRONOUS; + if Completed then + break; + end; + if not Completed then + FISSAsynchStatus.Abort(DB_NULL_HCHAPTER, DBASYNCHOP_OPEN); + finally + ClearISSAsynchStatus; + end; + end; +end; + +procedure TOLEDBCommand.EndExecute(E: Exception); // MainThread context +begin + try + RequestParamsIfPossible; + ReleaseInterfaces; + + + if FIUnknown = nil then + FCursorState := csInactive + else + FCursorState := csExecuted; + + if Assigned(FAfterExecute) then // Must be after RequestParamsIfPossible + FAfterExecute(E = nil); + finally + FExecuting := False; + end; +end; + +function TOLEDBCommand.CreateProcCall(Name: string; const NeedDescribe: boolean; const WideStrings: boolean; + const EnableBcd: boolean; const EnableFmtBcd: boolean): string; + + procedure DescribeParams(const MasterDatabase: boolean; out OriginalDatabase: string); + var + ParamsMetaInfo: TOLEDBRecordSet; + + procedure FillParams; + function GetOffsetByName(const Name: string): integer; + var + i: integer; + begin + for i := 0 to ParamsMetaInfo.Fields.Count - 1 do + if ParamsMetaInfo.Fields[i].Name = Name then begin + Result := ParamsMetaInfo.Fields[i].Offset; + Exit; + end; + Result := - maxint; + Assert(False, 'Unknown field name ' + Name); + end; + + var + NameFld, TypeNameFld, TypeFld, HasDefaultFld, DefaultFld, DataTypeFld, OctetLengthFld, CharMaxLenFld: integer; // offsets + + Param: TParamDesc; + ParamType: TParamDirection; + + s, ParamName: string; + DataType: word; + + IsLong: boolean; + + RecBuf: IntPtr; + ws: WideString; + dt: integer; + begin + FParams.Clear; + + NameFld := GetOffsetByName('PARAMETER_NAME'); // DataSize = 129 + TypeNameFld := GetOffsetByName('TYPE_NAME'); // DataSize = 129 + TypeFld := GetOffsetByName('PARAMETER_TYPE'); // DataSize = 4 + HasDefaultFld := GetOffsetByName('PARAMETER_HASDEFAULT'); // DataSize = 2 + DefaultFld := GetOffsetByName('PARAMETER_DEFAULT'); // DataSize = 256 + DataTypeFld := GetOffsetByName('DATA_TYPE'); // DataSize = 4 + OctetLengthFld := GetOffsetByName('CHARACTER_OCTET_LENGTH'); // DataSize = 4 + CharMaxLenFld := GetOffsetByName('CHARACTER_MAXIMUM_LENGTH'); // DataSize = 4 + + RecBuf := nil; + ParamsMetaInfo.AllocRecBuf(IntPtr(RecBuf)); + try + while True do begin + ParamsMetaInfo.GetNextRecord(RecBuf); + if ParamsMetaInfo.Eof then + Break; + + IsLong := Marshal.ReadInt32(RecBuf, OctetLengthFld) >= maxInt - 1; + dt := Marshal.ReadInt32(RecBuf, DataTypeFld); + + if ConvertOLEDBTypeToInternalFormat(dt, IsLong, EnableBcd, {$IFDEF VER6P}EnableFMTBCD{$ELSE}False{$ENDIF}, WideStrings, True, DataType, FConnection.DBMSPrimaryVer) then begin + ParamType := ConvertOLEDBParamTypeToCR(Marshal.ReadInt32(RecBuf, TypeFld)); + Param := TOLEDBParamDesc.Create; + Param.SetParamType(ParamType); + FParams.Add(Param); + + //Choice "Bytes" and "VarBytes" + s := Marshal.PtrToStringUni(IntPtr(Integer(RecBuf) + TypeNameFld)); + if (DataType = dtBytes) and (s = 'varbinary') then // WAR user-defined types? + DataType := dtVarBytes; + Param.SetDataType(DataType); + + ParamName := GetParamNameWODog(Marshal.PtrToStringUni(IntPtr(Integer(RecBuf) + NameFld))); + Param.SetName(ParamName); + + if Word(Marshal.ReadInt16(RecBuf, HasDefaultFld)) <> 0 then begin + ws := Marshal.PtrToStringUni(IntPtr(Integer(RecBuf) + DefaultFld)); + Param.SetValue(ws); + end; + + if IsLargeDataTypeUsed(Param) and + ((ParamType = pdOutput) or (ParamType = pdInputOutput)) then + Param.SetParamType(pdInput); + + Param.SetSize(Marshal.ReadInt32(RecBuf, CharMaxLenFld)); + end + else begin + s := Marshal.PtrToStringUni(IntPtr(Integer(RecBuf) + TypeNameFld)); + DatabaseErrorFmt(SBadFieldType, [s, dt]); + end; + end; + finally + if RecBuf <> nil then + ParamsMetaInfo.FreeRecBuf(RecBuf); + end; + end; + + procedure ParseFullName(out Database: string; out Owner: string; out ProcName: string); + begin + UnbracketIfPossible(Name, OriginalDatabase, Owner, ProcName); + if OriginalDatabase <> '' then + Database := OriginalDatabase + else + if not MasterDatabase then + Database := FConnection.FDatabase + else + Database := DefaultSDACDatabase; + end; + var + Database, Owner, ProcName: string; + rgRestrictions: TRestrictions; + + Rowset: IRowset; + + begin + ParseFullName(Database, Owner, ProcName); + SetLength(rgRestrictions, 3); + if (Length(ProcName) > 1) and (ProcName[1] = '#') then // for temporary stored procedures + rgRestrictions[0] := 'tempdb' + else + rgRestrictions[0] := DataBase; + rgRestrictions[1] := Owner; + rgRestrictions[2] := ProcName; + + + Rowset := FConnection.GetSchemaRowset(DBSCHEMA_PROCEDURE_PARAMETERS, rgRestrictions); + + ParamsMetaInfo := nil; + try + ParamsMetaInfo := TOLEDBRecordSet.Create; + ParamsMetaInfo.SetConnection(FConnection); + ParamsMetaInfo.SetProp(prFetchAll, True); + + ParamsMetaInfo.SetIRowset(Rowset, False); + ParamsMetaInfo.Open; + + FillParams; + finally + if ParamsMetaInfo <> nil then begin + ParamsMetaInfo.Close; + ParamsMetaInfo.UnPrepare; + ParamsMetaInfo.Free; + end; + end; + end; + +var + i: integer; + BracketAdded: boolean; + Database, s, s1: string; + ParamName: string; +begin + if FConnection = nil then + DatabaseError(SConnectionNotDefined); + + FConnection.Connect(''); + + if NeedDescribe then begin + DescribeParams(False, Database); + if (FParams.Count = 0) and (Database = '') then begin + s := LowerCase(Copy(Name, 1, 3)); + if (s = 'sp_') or (s = 'xp_') then + DescribeParams(True, Database); + end; + end; + + i := Pos(';', Name); + if i = 0 then + s := 'CALL ' + BracketIfNeed(Name, Char('"'), Char('"'){May be bug in MS SQL Server}) + ' ' + else begin + s := Name; + s1 := Copy(Name, i, 1024); + Delete(s, i, 1024); + s := 'CALL ' + BracketIfNeed(s, Char('"'), Char('"'){May be bug in MS SQL Server}) + s1 + end; + + BracketAdded := False; + for i := 0 to FParams.Count - 1 do begin + ParamName := FParams[i].GetName; + if ParamName = '' then + ParamName := '?' + else + ParamName := ':' + ParamName; + if FParams[i].GetParamType = pdResult then + s := ParamName + ' = ' + s + else begin + if BracketAdded then + s := s + ', ' + ParamName + else begin + BracketAdded := True; + s := s + '(' + ParamName + end; + end; + end; + if BracketAdded then + s := s + ')'; + FSQL := '{' + s + '}'; + Result := FSQL; +end; + +procedure ConvertStreamToBlob(const pValue: IntPtr; const Length: integer; Blob: TBlob; + {$IFDEF HAVE_COMPRESS}CompressBlobMode: TCompressBlobMode;{$ENDIF} OmitXMLPreamble: boolean = False); +var + Stream: ISequentialStream; + BytesReadedFromStream: Longint; + p, pXML: IntPtr; + + Piece: PPieceHeader; + PieceSize: integer; +{$IFDEF CLR} + o: System.Object; + otype: System.Type; +{$ENDIF} + pBytesReadedFromStream: IntPtr; + FirstRead: boolean; + BlobSize: integer; + SizeAvailable: boolean; +begin + p := Marshal.ReadIntPtr(pValue); + Assert(p <> nil); + + BlobSize := Length; + SizeAvailable := BlobSize > 0; +{$IFDEF CLR} + otype := System.Type.GetTypeFromCLSID(CLSID_SQLOLEDB); + o := Marshal.GetObjectForIUnknown(p); + Stream := ISequentialStream(Marshal.CreateWrapperOfType(o, otype)); + o := nil; +{$ELSE} + IntPtr(Stream) := IntPtr(p); +{$ENDIF} + pBytesReadedFromStream := Marshal.AllocHGlobal(SizeOf(Integer)); + try + Assert(Stream <> nil); + + if OmitXMLPreamble then begin + // Skip FF FE bytes, CR 16149 + pXML := Marshal.AllocHGlobal(SizeOf(WideChar)); + try + Stream.Read(pXML, SizeOf(WideChar), pBytesReadedFromStream); + if SizeAvailable then + Dec(BlobSize, SizeOf(WideChar)); + finally + Marshal.FreeHGlobal(pXML); + end; + end; + + PieceSize := 10 * 1024; + FirstRead := True; + repeat + if (BlobSize >= DefaultPieceSize) or not SizeAvailable then begin + if not FirstRead then + PieceSize := DefaultPieceSize; + end + else + PieceSize := BlobSize; + + Blob.AllocPiece(Piece, PieceSize); + try + {$IFDEF CLR} + Stream.Read(IntPtr(Integer(Piece) + SizeOf(TPieceHeader)), PieceSize, pBytesReadedFromStream); + BytesReadedFromStream := Marshal.ReadInt32(pBytesReadedFromStream); + {$ELSE} + Stream.Read(IntPtr(Integer(Piece) + SizeOf(TPieceHeader)), PieceSize, @BytesReadedFromStream); + {$ENDIF} + Piece.Used := BytesReadedFromStream; + if SizeAvailable then + Dec(BlobSize, BytesReadedFromStream); + finally + Blob.CompressPiece(Piece); + if IntPtr(Piece) <> nil then + Blob.AppendPiece(Piece); + FirstRead := False; + end; + until ((BlobSize = 0) and SizeAvailable) or ((PieceSize <> BytesReadedFromStream) and not SizeAvailable); + {$IFDEF HAVE_COMPRESS} + if (Blob is TCompressedBlob) and ((CompressBlobMode = cbClient) or (CompressBlobMode = cbClientServer)) then + TCompressedBlob(Blob).Compressed := True; + {$ENDIF} + finally + {$IFDEF CLR} + Marshal.ReleaseComObject(Stream); + Marshal.Release(p); + {$ENDIF} + Marshal.FreeHGlobal(pBytesReadedFromStream); + end; +end; + +procedure TOLEDBCommand.RequestParamsIfPossible; // Call RequestAndFreeParamAccs if interfaces is cleared + procedure RequestAndFreeParamAccs; + procedure ProcessParam(ParamDesc: TParamDesc; var pBind: TDBBinding); + var + pStatus: PDWORD; + Status: DWORD; + pValue: IntPtr; + pLength: PUINT; + l: UINT; + + c: Currency; + i64: Int64; + + {$IFDEF CLR} + Bcd: TBcd; + b: TBytes; + d: double; + {$ENDIF} + DBTimeStamp: TDBTimeStamp; + dt: TDateTime; + {$IFDEF VER6P} + DBNumeric: TDBNumeric; + {$ENDIF} + Blob: TSharedObject; + begin + if (ParamDesc.GetParamType in [pdUnknown, pdInputOutput, pdOutput, pdResult]) + and not ((ParamDesc.GetParamType = pdUnknown) and (ParamDesc.GetDataType in [dtBlob, dtMemo, dtWideMemo, dtMSXML])) then begin + pStatus := PDWORD(UINT(Integer(FParamsAccessorData.ExecuteParams.pData)) + pBind.obStatus); + Status := DWORD(Marshal.ReadInt32(pStatus)); + if not IsOutputLOB(ParamDesc, FConnection.DBMSPrimaryVer, FConnection.ProviderPrimaryVer) then + ParamDesc.SetNull((Status = DBSTATUS_S_ISNULL) or (Status = DBSTATUS_E_UNAVAILABLE)) + else begin + Blob := ParamDesc.GetObject; + try + ParamDesc.SetNull((Status = DBSTATUS_S_ISNULL) or (Status = DBSTATUS_E_UNAVAILABLE)); + finally + ParamDesc.SetObject(Blob); + end; + end; + + if ParamDesc.GetNull then + Marshal.WriteInt32(pStatus, Integer(DBSTATUS_S_ISNULL)) + else + begin + pValue := IntPtr(UINT(Integer(FParamsAccessorData.ExecuteParams.pData)) + pBind.obValue); + pLength := PUINT(UINT(Integer(FParamsAccessorData.ExecuteParams.pData)) + pBind.obLength); + case ParamDesc.GetDataType of + dtUnknown: + ParamDesc.SetValue(GetOleVariant(pValue)); + dtString: + ParamDesc.SetValue(Marshal.PtrToStringAnsi(pValue)); + dtWideString: + ParamDesc.SetValue(Marshal.PtrToStringUni(pValue)); + dtBytes, dtVarBytes: + begin + l := Marshal.ReadInt32(pLength); + if l > 0 then begin + {$IFDEF CLR} + SetLength(b, l); + Marshal.Copy(pValue, b, 0, l); + ParamDesc.Value := b; + {$ELSE} + ParamDesc.SetValue(VarArrayCreate([0, l - 1], varByte)); + CopyBuffer(pValue, TVarData(ParamDesc.Value).VArray.Data, l); + {$ENDIF} + end; + end; + dtInt8: + ParamDesc.SetValue(Byte(Marshal.ReadByte(pValue))); + dtInt16: + ParamDesc.SetValue(SmallInt(Marshal.ReadInt16(pValue))); + dtWord: + ParamDesc.SetValue(Word(Marshal.ReadInt16(pValue))); + dtInt32: + ParamDesc.SetValue(Integer(Marshal.ReadInt32(pValue))); + dtFloat: + ParamDesc.SetValue(BitConverter.Int64BitsToDouble(Marshal.ReadInt64(pValue))); + dtCurrency: + ParamDesc.SetValue(BitConverter.Int64BitsToDouble(Marshal.ReadInt64(pValue))); + // ParamDesc.SetValue(PCurrency(pValue)^); Currency type cannot be used over TCurrencyField uses double to store + dtDate: + ParamDesc.SetValue(TDateTime(BitConverter.Int64BitsToDouble(Marshal.ReadInt64(pValue)))); + dtDateTime, dtTime: + begin + {$IFDEF CLR} + DBTimeStamp := TDBTimeStamp(Marshal.PtrToStructure(pValue, TypeOf(TDBTimeStamp))); + {$ELSE} + DBTimeStamp := PDBTimeStamp(pValue)^; + {$ENDIF} + dt := EncodeDateTime(DBTimeStamp.year, DBTimeStamp.month, DBTimeStamp.day, DBTimeStamp.hour, DBTimeStamp.minute, DBTimeStamp.second, DBTimeStamp.fraction div 1000000{Billionths of a second to milliseconds}); + ParamDesc.SetValue(dt); + end; + dtBoolean: + ParamDesc.SetValue(Boolean(WordBool(Marshal.ReadInt16(pValue)))); + dtInt64: + {$IFDEF VER6P} + ParamDesc.SetValue(Marshal.ReadInt64(pValue)); + {$ELSE} + begin + TVarData(_TParamDesc(ParamDesc).FData).VType := $000E; + PInt64(@TVarData(ParamDesc.Value).VInteger)^ := PInt64(pValue)^; + end; + {$ENDIF} + {$IFDEF VER5P} + dtGuid: + {$IFDEF CLR} + ParamDesc.SetValue(GUIDToString(TGuid(Marshal.PtrToStructure(pValue, TypeOf(TGuid))))); + {$ELSE} + ParamDesc.SetValue(GUIDToString(PGuid(pValue)^)); + {$ENDIF} + dtVariant: + ParamDesc.SetValue(GetOleVariant(pValue)); + {$ENDIF} + dtBCD: + begin + i64 := Marshal.ReadInt64(pValue); + {$IFDEF CLR} + d := i64; + d := d / 10000; + c := d; + {$ELSE} + c := PCurrency(@i64)^; + {$ENDIF} + ParamDesc.SetValue(c); + end; + {$IFDEF VER6P} + dtFmtBCD: + if FConnection.FProvider <> prCompact then + ParamDesc.SetValue(Marshal.PtrToStringAnsi(pValue)) + else begin + {$IFDEF CLR} + DBNumeric := TDBNumeric(Marshal.PtrToStructure(pValue, TypeOf(TDBNumeric))); + {$ELSE} + DBNumeric := PDBNumeric(pValue)^; + {$ENDIF} + ParamDesc.SetValue(VarFMTBcdCreate(DBNumericToBcd(DBNumeric))); + end; + {$ENDIF} + dtMemo, dtWideMemo: begin + Blob := ParamDesc.GetObject; + Assert(Blob <> nil); + TBlob(Blob).Clear; + ConvertStreamToBlob(pValue, 0, TBlob(Blob){$IFDEF HAVE_COMPRESS}, FCompressBlob{$ENDIF}); + end; + else + Assert(False, Format('ParamDesc - %s, Unknown DataType = %d', [ParamDesc.GetName, ParamDesc.GetDataType])); + end; + end; + end; + end; + var + i: integer; + + ParamCnt: integer; + + begin + Assert(FIUnknown = nil, 'Before RequestAndFreeParamAccs interface FIUnknown must be released'); + Assert(FIMultipleResults = nil, 'Before RequestAndFreeParamAccs interface FIMultipleResults must be released'); + + if FParamsAccessorDataAvaible then begin + ParamCnt := FParams.Count; + try + if FConnection <> nil then begin + if FParamsAccessorData.ExecuteParams.HACCESSOR <> 0 then + Check(FParamsAccessorData.Accessor.ReleaseAccessor(FParamsAccessorData.ExecuteParams.HACCESSOR, nil)); + FParamsAccessorData.ExecuteParams.HACCESSOR := 0; + FParamsAccessorData.Accessor := nil; + + for i := 0 to ParamCnt - 1 do + ProcessParam(FParams[i], FParamsAccessorData.rgBindings[i]); + end; + + if FParamsAccessorData.ExecuteParams.pData <> nil then + Marshal.FreeHGlobal(FParamsAccessorData.ExecuteParams.pData); + FParamsAccessorData.ExecuteParams.pData := nil; + + finally + if Length(FParamsAccessorData.rgBindings) <> 0 then begin + for i := 0 to ParamCnt - 1 do + if FParamsAccessorData.rgBindings[i].pObject <> nil then + Marshal.FreeHGlobal(FParamsAccessorData.rgBindings[i].pObject); + SetLength(FParamsAccessorData.rgBindings, 0); + end; + + FParamsAccessorDataAvaible := False; + + (*// Remove unused streams + for i := FStreamList.Count - 1 downto 0 do + TOLEDBStream(FStreamList[i])._Release; + Assert(FStreamList.Count = 0);*) + end; + + FCanReadParams := True; + if Assigned(FReadParams) and (FConnection <> nil) then + FReadParams; + end; + end; + +{$IFDEF CLR} +var + i: integer; +{$ENDIF} + +begin +{$IFDEF CLR} + for i := Low(FParamsGC) to High(FParamsGC) do + FreeGCHandle(FParamsGC[i]); + SetLength(FParamsGC, 0); +{$ENDIF} + + if (FIUnknown = nil) then begin + if (FIMultipleResults <> nil) and not FNextResultRequested then begin + GetNextResult(FIUnknownNext, FRowsAffectedNext); + FNextResultRequested := True; + end; + + if (FIMultipleResults = nil) and (FParams <> nil) and (FParams.Count > 0) then + RequestAndFreeParamAccs; + end; +end; + +procedure TOLEDBCommand.CheckAndAnalyze(const Status: HRESULT); +const + ParamHeader = 'Parameter[%d] %s - %s (Status = %Xh).'; +var + i: integer; + ParamStatus: DWORD; + ParamName: string; + Msg: WideString; +begin + if Status <> S_OK then + try + Check(Status); + except + on E: Exception do + begin + if (Status and $80000000) <> 0 then begin // Severity bit (see OLEDBC.pas line 5489) is not 0 + if Status = DB_E_OBJECTOPEN then + DatabaseError(SObjectOpen) + else + if FParamsAccessorData.ExecuteParams.pData = nil then + raise + else + begin + Msg := ''; + with FParamsAccessorData do + for i := 0 to FParams.Count - 1 do begin + ParamName := FParams[i].GetName; + if ParamName = '' then + ParamName := IntToStr(i) + else + ParamName := ':' + ParamName; + ParamStatus := DWORD(Marshal.ReadInt32(ExecuteParams.pData, rgBindings[i].obStatus)); + case ParamStatus of + DBSTATUS_S_OK, DBSTATUS_S_ISNULL, DBSTATUS_S_DEFAULT:; + DBSTATUS_E_BADACCESSOR: + AddInfoToErr(Msg, ParamHeader, [i, ParamName, SInvalidParamType, ParamStatus]); + DBSTATUS_E_CANTCONVERTVALUE: + AddInfoToErr(Msg, ParamHeader, [i, ParamName, SInvalidValue, ParamStatus]); + DBSTATUS_S_TRUNCATED: + AddInfoToErr(Msg, ParamHeader, [i, ParamName, SDataTruncated, ParamStatus]); + DBSTATUS_E_SIGNMISMATCH: + AddInfoToErr(Msg, ParamHeader, [i, ParamName, SSignMismatch, ParamStatus]); + DBSTATUS_E_DATAOVERFLOW: + AddInfoToErr(Msg, ParamHeader, [i, ParamName, SDataOverflow, ParamStatus]); + DBSTATUS_E_CANTCREATE: + AddInfoToErr(Msg, ParamHeader, [i, ParamName, SOutOfMemory, ParamStatus]); + DBSTATUS_E_UNAVAILABLE: + {AddInfoToErr(Msg, ParamHeader, [i, ParamName, SUnavaible, ParamStatus])}; + DBSTATUS_E_INTEGRITYVIOLATION: + AddInfoToErr(Msg, ParamHeader, [i, ParamName, SIntegrityViolation, ParamStatus]); + DBSTATUS_E_SCHEMAVIOLATION: + AddInfoToErr(Msg, ParamHeader, [i, ParamName, SShemaViolation, ParamStatus]); + DBSTATUS_E_BADSTATUS: + AddInfoToErr(Msg, ParamHeader, [i, ParamName, SBadStatus, ParamStatus]); + else + AddInfoToErr(Msg, ParamHeader, [i, ParamName, SUnknownStatus, ParamStatus]); + end; + end; // for + AddInfoToErr(E, Msg, []); + raise E; + end; // if Status = DB_E_OBJECTOPEN + end + else // if (Status and $80000000) <> 0 then begin + if Status = DB_S_ERRORSOCCURRED then + FLastExecWarning := True; + end; // on E: Exception do begin + end; // try..except..end; +end; + +procedure TOLEDBCommand.GetNextResult(out ResultSet: IUnknown; out RowsAffected: integer); +var + hr: HRESULT; + OldRowsAffected: integer; +begin + try + repeat + OldRowsAffected := FRowsAffected; + hr := FIMultipleResults.GetResult(nil, 0, IID_IUnknown, RowsAffected, ResultSet); + + if (hr <> DB_S_NORESULT) then + CheckAndAnalyze(hr); + FConnection.OLEDBError(0, Component); // Check Info messages + + if ResultSet <> nil then begin + OldRowsAffected := RowsAffected; + Break; + end; + + if FWaitForBreak then begin + FWaitForBreak := False; + FConnection.OLEDBError(DB_E_CANCELED, Component); + end; + + until hr <> S_OK; + RowsAffected := OldRowsAffected; + finally + if ResultSet = nil then + ClearIMultipleResults; // Rowsets not also provided + end; + +end; + +procedure TOLEDBCommand.SetConnection(Value: TCRConnection); +begin + if Value <> FConnection then begin + inherited; + + FConnection := TOLEDBConnection(Value); + end; +end; + +function TOLEDBCommand.GetCursorState: TCursorState; +begin + Result := FCursorState; +end; + +procedure TOLEDBCommand.SetCursorState(Value: TCursorState); +begin + FCursorState := Value; +end; + +function TOLEDBCommand.GetProp(Prop: integer; var Value: variant): boolean; +begin + Result := True; + + case Prop of + prRowsProcessed: + if FRowsAffected = -1 then + Value := 0 + else + Value := FRowsAffected; + prScanParams: + Value := False; + prCanReadParams: + Value := FCanReadParams; + prIsSProc: + Value := FIsSProc; + prNonBlocking: + Value := FNonBlocking; + else + Result := inherited GetProp(Prop, Value); + end; +end; + +function TOLEDBCommand.SetProp(Prop: integer; const Value: variant): boolean; +begin + Result := True; + case Prop of + prScanParams:; + prCommandTimeout: + FCommandTimeout := Value; + prIsSProc: + FIsSProc := Boolean(Value); + prCanReadParams: + FCanReadParams := Value; + prSmartRefresh: + FSmartRefresh := Value; + prSmartRefreshMsg: + FSmartRefreshMsg := Value; + prSmartRefreshService: + FSmartRefreshService := Value; + prNonBlocking: + FNonBlocking := Value; + else + Result := inherited SetProp(Prop, Value); + end; +end; + +function TOLEDBCommand.IUnknownIsNull: boolean; +begin + Result := FIUnknown = nil; +end; + +function TOLEDBCommand.IUnknownNextIsNull: boolean; +begin + Result := FIUnknownNext = nil; +end; + +function TOLEDBCommand.IMultipleResultsIsNull: boolean; +begin + Result := FIMultipleResults = nil; +end; + +function TOLEDBCommand.ISSAsynchStatusIsNull: boolean; +begin + Result := FISSAsynchStatus = nil; +end; + +procedure TOLEDBCommand.ClearIUnknown; +begin + FIUnknown := nil; +end; + +procedure TOLEDBCommand.ClearIUnknownNext; +begin + FIUnknownNext := nil; +end; + +procedure TOLEDBCommand.ClearIMultipleResults; +begin +{$IFDEF CLR} + if FIMultipleResults <> nil then + Marshal.ReleaseComObject(FIMultipleResults); +{$ENDIF} + FIMultipleResults := nil; // Rowsets not also provided +end; + +procedure TOLEDBCommand.ClearISSAsynchStatus; +begin + FISSAsynchStatus := nil; +end; + +procedure TOLEDBCommand.BreakExec; +begin + if FNonBlocking and not ISSAsynchStatusIsNull then + FExecutor.Terminate + else begin + FBreakExecCS.Acquire; + try + if FICommandText <> nil then + Check(ICommand(FICommandText).Cancel); + FWaitForBreak := True; + finally + FBreakExecCS.Release; + end; + end; +end; + +function TOLEDBCommand.GetParamDescType: TParamDescClass; +begin + Result := TOLEDBParamDesc; +end; + +function TOLEDBCommand.AddParam: TParamDesc; +begin + Result := TOLEDBParamDesc.Create; + FParams.Add(Result); +end; + +function TOLEDBCommand.GetParam(Index: integer): TOLEDBParamDesc; +begin + Result := TOLEDBParamDesc(FParams[Index]); +end; + +{ TOLEDBFieldDesc } + +function TOLEDBFieldDesc.ActualNameQuoted(RecordSet: TCRRecordSet; const QuoteNames: boolean): string; +begin + if FActualNameQuoted[QuoteNames] <> '' then + Result := FActualNameQuoted[QuoteNames] + else + begin + if FTableInfo <> nil then begin + if QuoteNames then + Result := FTableInfo.Quote(BaseColumnName, LeftQuote, RightQuote) + else + Result := BaseColumnName; + FActualNameQuoted[QuoteNames] := Result; + end + else begin + if QuoteNames then + Result := TOLEDBRecordSet(RecordSet).GetTableInfoClass.Quote(BaseColumnName, LeftQuote, RightQuote) + else + Result := BaseColumnName; + FActualNameQuoted[QuoteNames] := Result; + end; + end; +end; + +{ TMSTableInfo } + +class function TOLEDBTableInfo.LeftQuote: Char; +begin + Result := {$IFDEF CLR}CoreLab.Sdac.{$ENDIF}OLEDBAccess.LeftQuote; +end; + +class function TOLEDBTableInfo.RightQuote: Char; +begin + Result := {$IFDEF CLR}CoreLab.Sdac.{$ENDIF}OLEDBAccess.RightQuote; +end; + +{ TOLEDBRecorSet } + +constructor TOLEDBRecordSet.Create; +begin + FEnableBCD := False; + FUniqueRecords := False; + FRequestSQLObjects := False; + FCursorUpdate := True; + FCursorTypeChanged := nil; + + FLockClearMultipleResults := False; + FroAfterUpdate := False; + + FWideStrings := True; // Native fields mapping + + inherited; + FNativeRowset := True; + FCursorType := ctDefaultResultSet; + FFetchRows := 25; +end; + +destructor TOLEDBRecordSet.Destroy; +begin + Assert((not FNativeRowset) or (FIRowset = nil), 'TOLEDBRecordSet.Destroy - interfaces not released'); + inherited; +end; + +function TOLEDBRecordSet.GetFieldDescType: TFieldDescClass; +begin + Result := TOLEDBFieldDesc; +end; + +procedure TOLEDBRecordSet.ClearHRowIfNeed; +{$IFDEF CLR} +var + rghRows: PUintArray; + GCHandle: IntPtr; +{$ENDIF} +begin + if FHRowAccessible and (FCursorType in ServerCursorTypes) then begin + Assert(FIRowset <> nil, 'TOLEDBRecordSet.ClearHRowIfNeed - FIRowset must be setted'); + + {$IFDEF CLR} + GCHandle := AllocGCHandle(TObject(FHRow), True); + try + rghRows := GetAddrOfPinnedObject(GCHandle); + Check(FIRowset.ReleaseRows(1, rghRows, nil, nil, nil)); + finally + FreeGCHandle(GCHandle); + end; + {$ELSE} + Check(FIRowset.ReleaseRows(1, @FHRow, nil, nil, nil)); + {$ENDIF} + FHRow := MaxLongint; + FHRowAccessible := False; + end; +end; + +function TOLEDBRecordSet.GetIndicatorSize: word; +begin + Result := FieldCount * OLE_DB_INDICATOR_SIZE; +end; + +function TOLEDBRecordSet.IsBlobFieldType(DataType: word): boolean; +begin + Result := inherited IsBlobFieldType(DataType) or (DataType = dtMSXML); +end; + +procedure TOLEDBRecordSet.CreateComplexField(RecBuf: IntPtr; FieldIndex: integer; WithBlob: boolean); +var + Blob: TSharedObject; + FieldDesc: TFieldDesc; +begin + FieldDesc := Fields[FieldIndex]; + case FieldDesc.DataType of + dtBlob, dtMemo, dtWideMemo, dtMSXML: + if WithBlob then begin + {$IFDEF HAVE_COMPRESS} + if FieldDesc.DataType = dtBlob then + Blob := TCompressedBlob.Create + else + {$ENDIF} + Blob := TBlob.Create; + TBlob(Blob).EnableRollback; + SetObject(FieldIndex + 1, RecBuf, Blob); + end; + else + inherited; + end; +end; + +procedure TOLEDBRecordSet.CreateComplexFields(RecBuf: IntPtr; WithBlob: boolean); +var + i: integer; + Blob: TBlob; + Field: TFieldDesc; +begin + inherited; + + if WithBlob then + for i := 0 to FieldCount - 1 do begin + Field := Fields[i]; + if (Field.FieldDescKind <> fdkCalculated) and (((Field.DataType = dtMemo) or (Field.DataType = dtWideMemo)) and ((Field.SubDataType and dtWide) <> 0)) or (Field.DataType = dtMSXML) then begin + Blob := TBlob(GetGCHandleTarget(Marshal.ReadIntPtr(RecBuf, Field.Offset))); + Blob.IsUnicode := True; + end + end; +end; + +procedure TOLEDBRecordSet.FreeComplexFields(RecBuf: IntPtr; WithBlob: boolean); +var + i: integer; + Handle: IntPtr; + so: TSharedObject; + b: boolean; + Field: TFieldDesc; +begin + inherited; + + for i := 0 to FieldCount - 1 do begin + Field := Fields[i]; + if (Field.FieldDescKind <> fdkCalculated) and (Field.DataType = dtMSXML) and WithBlob then begin + Handle := Marshal.ReadIntPtr(RecBuf, Field.Offset); + so := TSharedObject(GetGCHandleTarget(Handle)); + b := (so <> nil) and (so.RefCount = 1); + so.Free; + if b then + Marshal.WriteIntPtr(RecBuf, Field.Offset, nil); + end; + end; +end; + +function TOLEDBRecordSet.GetStatus(FieldNo: word; RecBuf: IntPtr): DWORD; +begin + Result := DWORD(Marshal.ReadInt32(RecBuf, DataSize + FieldNo{numeration from 0?} * OLE_DB_INDICATOR_SIZE)); +end; + +procedure TOLEDBRecordSet.SetStatus(FieldNo: word; RecBuf: IntPtr; Value: DWORD); +begin + Marshal.WriteInt32(RecBuf, DataSize + FieldNo{numeration from 0?} * OLE_DB_INDICATOR_SIZE, Integer(Value)); +end; + +function TOLEDBRecordSet.GetNull(FieldNo: word; RecBuf: IntPtr): boolean; +begin + Result := GetStatus(FieldNo - 1 {numeration from 1?}, RecBuf) = DBSTATUS_S_ISNULL; + if Result then + Result := GetNullByBlob(FieldNo, RecBuf); +end; + +procedure TOLEDBRecordSet.SetNull(FieldNo: word; RecBuf: IntPtr; Value: boolean); +begin + if Value then + SetStatus(FieldNo - 1 {numeration from 1?}, RecBuf, DBSTATUS_S_ISNULL) + else + SetStatus(FieldNo - 1 {numeration from 1?}, RecBuf, DBSTATUS_S_OK); +end; + +procedure TOLEDBRecordSet.GetFieldData(Field: TFieldDesc; RecBuf: IntPtr; Dest: IntPtr); +begin + case Field.DataType of + dtString, dtWideString, dtMemo, dtWideMemo, dtMSXML: + begin + if Field.Length = 0 then + CopyBuffer(IntPtr(Integer(RecBuf) + Field.Offset), Dest, sizeof(IntPtr) {ISeqStream}) + else + inherited; + end; + dtBlob: + CopyBuffer(IntPtr(Integer(RecBuf) + Field.Offset), Dest, sizeof(TBlob)); + dtBCD: + begin + CheckBCDOverflow(Field.FieldNo, RecBuf); + inherited; + end; + else + inherited; + end; +end; + +procedure TOLEDBRecordSet.GetFieldAsVariant(FieldNo: word; RecBuf: IntPtr; var Value: variant); +begin + CheckBCDOverflow(FieldNo, RecBuf); + + inherited; +end; + +procedure TOLEDBRecordSet.PutFieldData(Field: TFieldDesc; RecBuf: IntPtr; Source: IntPtr); +begin + case Field.DataType of + dtString, dtWideString, dtMemo, dtWideMemo, dtMSXML: + begin + if Field.Length = 0 then + CopyBuffer(Source, IntPtr(Integer(RecBuf) + Field.Offset), sizeof(IntPtr) {ISeqStream}) + else + inherited; + end; + dtBlob: + CopyBuffer(Source, IntPtr(Integer(RecBuf) + Field.Offset), sizeof(TBlob)); + else + inherited; + end; +end; + +{ Open/Close } + +function TOLEDBRecordSet.NeedInitFields: boolean; +begin + Result := FCommand.FIsSProc and Prepared; +end; + +procedure TOLEDBRecordSet.InternalPrepare; +var + ColumnsInfo: IColumnsInfo; + + cColumns: UINT; + prgInfo: PDBCOLUMNINFO; + pStringsBuffer: IntPtr; + + //Malloc: IMalloc; +begin + QueryCommandInterfaces(True); + try + SetCommandProp; + inherited; + finally + ReleaseCommandInterfaces; /// FCommand.QueryIntCnt counter is increased in inherited + end; + + try + // Detect CommandType + if FNativeRowset and not FCommand.FRPCCall then begin + // If statement is wrong in some cases exception may be occured now + QueryIntf(FCommand.FICommandPrepare, {$IFDEF CLR}IColumnsInfo{$ELSE}IID_IColumnsInfo{$ENDIF}, ColumnsInfo); + Assert(ColumnsInfo <> nil); + + pStringsBuffer := nil; + try + // If statement is wrong in some cases exception may be occured now + Check(ColumnsInfo.GetColumnInfo(cColumns, PDBCOLUMNINFO(prgInfo), pStringsBuffer)); + + if cColumns > 0 then + CommandType := ctCursor + else + CommandType := ctStatement; + finally + FreeCoMem(prgInfo); + FreeCoMem(pStringsBuffer); + end; + end; + except + InternalUnPrepare; + raise; + end; +end; + +procedure TOLEDBRecordSet.InternalUnPrepare; +begin + try + inherited; + finally + if FNativeRowset then begin + // ReleaseCommandInterfaces; + if not FLockClearMultipleResults then begin + FCommand.ClearIMultipleResults; + FCommand.FIUnknownNext := nil; + end; + FCommand.FIUnknown := nil; + ReleaseRecordSetInterfaces; + end; + CommandType := ctUnknown; + end; +end; + +procedure TOLEDBRecordSet.InsertRecord(RecBuf: IntPtr); + procedure AppItem; + var + Block: PBlockHeader; + Item: PItemHeader; + begin + Assert(IntPtr(BlockMan.FirstBlock) = nil); + + // Nearly copied from TBlockManager.AddFreeBlock + BlockMan.AllocBlock(Block, 1); + Item := IntPtr(Integer(Block) + sizeof(TBlockHeader)); + Item.Prev := nil; + Item.Next := nil; + Item.Block := Block; + Item.Flag := flFree; + + BlockMan.FirstFree := Item; + Block.UsedItems := 0; + //------------------ + + CurrentItem := AppendItem; + end; + +var + Appended: boolean; + i: integer; +begin +// ODS(Format('+ TOLEDBRecordSet.InsertRecord FI = %d, CI = %d, LI = %d, BOF = %s, EOF = %s', [Integer(FirstItem), Integer(CurrentItem), Integer(LastItem), BoolToStr(BOF, True), BoolToStr(EOF, True)])); + if (FIRowsetUpdate <> nil) then begin + if IntPtr(CurrentItem) = nil then begin + if IntPtr(FirstItem) <> nil then + CurrentItem := FirstItem + else + if IntPtr(LastItem) <> nil then + CurrentItem := LastItem; + end; + + Appended := IntPtr(CurrentItem) = nil; + if Appended then + AppItem + else + if HasComplexFields then + FreeComplexFields(IntPtr(Integer(CurrentItem.Block) + sizeof(TBlockHeader) + sizeof(TItemHeader)), True); + + InternalAppend(RecBuf); + PutRecord(RecBuf); + ReorderItems(CurrentItem, roInsert); + + if FCursorType = ctKeySet then begin + FirstItem := nil; + CurrentItem := nil; + LastItem := nil; + + SetToEnd; + end + else + begin + Assert(FCursorType = ctDynamic); + if HasBlobFields then + for i := 0 to FieldCount - 1 do + if IsBlobFieldType(Fields[i].DataType) then + TBlob(GetObject(Fields[i].FieldNo, RecBuf)).Commit; + + FirstItem := nil; + CurrentItem := nil; + LastItem := nil; + + FLastFetchBack := False; + SetToEnd; + end; + end + else + if ((FCursorType in ServerCursorTypes) and not FCursorUpdate) then begin + if FRecordCount = 0 then + begin + InternalAppend(RecBuf); + + AppItem; + PutRecord(RecBuf); + ReorderItems(CurrentItem, roInsert); + + CurrentItem := nil; +// SetToEnd; - no sense for keyset cursors + FBof := False; +{ SetToEnd; + + FBof := FirstItem = nil; + FEof := LastItem = nil;} + end + else + begin + InternalAppend(RecBuf); + + if HasComplexFields then + FreeComplexFields(RecBuf, True); + SetToEnd; + CurrentItem := LastItem; + + FBof := IntPtr(FirstItem) = nil; + FEof := IntPtr(LastItem) = nil; + end; + end + else + inherited; +// ODS(Format('+ TOLEDBRecordSet.InsertRecord FI = %d, CI = %d, LI = %d, BOF = %s, EOF = %s', [Integer(FirstItem), Integer(CurrentItem), Integer(LastItem), BoolToStr(BOF, True), BoolToStr(EOF, True)])); +end; + +procedure TOLEDBRecordSet.UpdateRecord(RecBuf: IntPtr); +begin + inherited; + if (FCursorType in ServerCursorTypes) and FroAfterUpdate then + FetchToBookmarkValue; +end; + +procedure TOLEDBRecordSet.DeleteRecord; +begin + if (FIRowsetUpdate <> nil) + or ((FCursorType in ServerCursorTypes) and not FCursorUpdate) then begin + InternalDelete; + RemoveRecord; + if FCursorType = ctDynamic then + FRecordCount := - 1; + + Fetch; + CurrentItem := FirstItem; + + if IntPtr(CurrentItem) = nil then begin + Fetch(True); + CurrentItem := FirstItem; + end; + end + else + inherited; +end; + +procedure TOLEDBRecordSet.SetIndexFieldNames(Value: string); +begin + if FCursorType in ServerCursorTypes then + DatabaseError(SLocalSortingServerCursor); + + inherited SetIndexFieldNames(Value); +end; + +procedure TOLEDBRecordSet.SetToBegin; +begin + case FCursorType of + ctStatic, ctKeyset: + try + FFetchFromBookmark := True; + FBookmarkSize := sizeof(byte); + FBookmarkValue := DBBMK_FIRST; + Fetch; + finally + FFetchFromBookmark := False; + FBookmarkSize := sizeof(FBookmarkValue); + end; + ctDynamic: + while Fetch(True) do; + end; + inherited; +end; + +procedure TOLEDBRecordSet.SetToEnd; +begin + if FCursorType in [ctStatic, ctKeyset] then + try + FFetchFromBookmark := True; + FBookmarkSize := sizeof(byte); + FBookmarkValue := DBBMK_LAST; + Fetch; + finally + FFetchFromBookmark := False; + FBookmarkSize := sizeof(FBookmarkValue); + end + else + FetchAll; + inherited; +end; + +function TOLEDBRecordSet.FetchToBookmarkValue(FetchBack: boolean = False): boolean; // Fetch to Bookmark. Bookmark value is stored in FBookmarkValue. Bookmark value used only for ctStatic and ctKeyset. For ctDynamic method refetched current record in specified direction +begin + Assert(FCursorType in ServerCursorTypes); + try + FFetchFromBookmark := True; + Result := Fetch(FetchBack); + finally + FFetchFromBookmark := False; + end; +end; + +procedure TOLEDBRecordSet.SetToBookmark(Bookmark: PRecBookmark); +begin + if FCursorType in [ctStatic, ctKeyset] then begin + // Cannot optimize - used to RefreshRecord + // if (FBookmarkValue <> Bookmark.Order) or (CurrentItem = nil) then begin + FBookmarkValue := Bookmark.Order; + FetchToBookmarkValue; + end; + + inherited; +end; + +function TOLEDBRecordSet.CompareBookmarks(Bookmark1, Bookmark2: PRecBookmark): integer; +const + RetCodes: array[Boolean, Boolean] of ShortInt = ((2,-1),(1,0)); +begin + if FCursorType in [ctKeyset, ctStatic] then begin + // Copied from TData.CompareBookmarks + Result := RetCodes[IntPtr(Bookmark1) = nil, IntPtr(Bookmark2) = nil]; + if Result = 2 then begin + if Bookmark1.Order >= Bookmark2.Order then + if Bookmark1.Order = Bookmark2.Order then + Result := 0 + else + Result := 1 + else + Result := -1 + end; + end + else + Result := inherited CompareBookmarks(Bookmark1, Bookmark2); + +end; + +function TOLEDBRecordSet.CanFetchBack: boolean; +begin + Result := FCursorType in ServerCursorTypes; +end; + +procedure TOLEDBRecordSet.DoFetchTerminate(Sender: TObject); // MainThread context +begin + EndFetchAll(FFetchExecutor.FException); + FFetchExecutor := nil; +end; + +procedure TOLEDBRecordSet.DoFetchException(Sender: TObject; E: Exception; var Fail: boolean); // MainThread context +begin + if (E is EOLEDBError) then + FCommand.FConnection.DoError(EOLEDBError(E), Fail); +end; + +const + FE_AFTERFETCH = 1; + +procedure TOLEDBRecordSet.DoFetchSendEvent(Sender: TObject; Event: TObject); +begin + if Integer(Event) = FE_AFTERFETCH then + DoAfterFetch; +end; + +procedure TOLEDBRecordSet.FetchAll; +begin + if (FCommand.GetCursorState < csFetchingAll) or (FCursorType = ctDynamic) then begin + FCommand.SetCursorState(csFetchingAll); + if FCommand.FNonBlocking then begin + FFetchExecutor := TOLEDBThreadWrapper.Create(TExecuteThread, True); + TExecuteThread(FFetchExecutor.FThread).FRunMethod := DoFetchAll; + FFetchExecutor.OnException := DoFetchException; + FFetchExecutor.OnTerminate := DoFetchTerminate; + FFetchExecutor.OnSendEvent := DoFetchSendEvent; + FFetchExecutor.FreeOnTerminate := True; + StringHeap.ThreadSafety := True; + // FFetchExecutor.Resume; // moved to TCustomMSDataSet.SetActive + end + else + DoFetchAll; + end; +end; + +procedure TOLEDBRecordSet.DoFetchAll; // FFetchExecutor.FThread context +begin + FFetching := True; + try + while Fetch do + if (FFetchExecutor <> nil) and FWaitForFetchBreak then + Break; + finally + FFetching := False; + end; +end; + +procedure TOLEDBRecordSet.EndFetchAll(E: Exception); // MainThread context +begin + if FCommand.FNonBlocking then + StringHeap.ThreadSafety := True; +end; + +procedure TOLEDBRecordSet.BreakFetch; +begin + inherited; + + if FCommand.FNonBlocking and (FFetchExecutor <> nil) and not FFetchExecutor.Thread.Suspended then + FFetchExecutor.Terminate; +end; + +function TOLEDBRecordSet.CanDisconnect: boolean; +begin + Result := inherited CanDisconnect + and (FCommand.FIUnknown = nil) + and (FIRowset = nil) + and (FCommand.FIUnknownNext = nil) + and (FCommand.FIMultipleResults = nil); +end; + +function TOLEDBRecordSet.RowsReturn: boolean; +begin + if CommandType <> ctUnknown then + Result := inherited RowsReturn + else //we need to know this info even if CommandType is not set(TCustomDADataSet.DoAfterExecute) + Result := (FCommand.FIUnknown <> nil) or (FIRowset <> nil); +end; + +procedure TOLEDBRecordSet.RowsetUpdateCommit; +const + RowHeader = '%s (Status = %Xh).'; +var +{$IFDEF CLR} + rghRows: PUintArray; + GCHandle: IntPtr; +{$ENDIF} + pRowStatus: PDBRowStatus; + RowStatus: DBRowStatus; + Msg: WideString; +begin + try + {$IFDEF CLR} + GCHandle := AllocGCHandle(TObject(FHRow), True); + try + rghRows := GetAddrOfPinnedObject(GCHandle); + Check(FIRowsetUpdate.Update(DB_NULL_HCHAPTER, 1, rghRows, nil, nil, pRowStatus)); + finally + FreeGCHandle(GCHandle); + end; + {$ELSE} + Check(FIRowsetUpdate.Update(DB_NULL_HCHAPTER, 1, @FHRow, nil, nil, pRowStatus)); + {$ENDIF} + except + on e: Exception do begin + if pRowStatus <> nil then begin + Msg := ''; + RowStatus := DBRowStatus(Marshal.ReadInt32(pRowStatus)); + case RowStatus of + DBROWSTATUS_S_OK:; + DBROWSTATUS_S_MULTIPLECHANGES: + AddInfoToErr(Msg, RowHeader, [SRowMultipleChanges, RowStatus]); + DBROWSTATUS_S_PENDINGCHANGES: + AddInfoToErr(Msg, RowHeader, [SRowPendingChanges, RowStatus]); + DBROWSTATUS_E_CANCELED: + AddInfoToErr(Msg, RowHeader, [SRowCanceled, RowStatus]); + //DBROWSTATUS_E_CANTRELEASE = $00000006; + DBROWSTATUS_E_CONCURRENCYVIOLATION: + AddInfoToErr(Msg, RowHeader, [SRowConcurrencyViolation, RowStatus]); + DBROWSTATUS_E_DELETED: + AddInfoToErr(Msg, RowHeader, [SRowDeleted, RowStatus]); + //DBROWSTATUS_E_PENDINGINSERT = $00000009; + //DBROWSTATUS_E_NEWLYINSERTED = $0000000A; + DBROWSTATUS_E_INTEGRITYVIOLATION: + AddInfoToErr(Msg, RowHeader, [SRowIntegrityViolation, RowStatus]); + DBROWSTATUS_E_INVALID: + Assert(False); + //DBROWSTATUS_E_MAXPENDCHANGESEXCEEDED = $0000000D; + //DBROWSTATUS_E_OBJECTOPEN = $0000000E; + //DBROWSTATUS_E_OUTOFMEMORY = $0000000F; + DBROWSTATUS_E_PERMISSIONDENIED: + AddInfoToErr(Msg, RowHeader, [SRowPermissionDenied, RowStatus]); + DBROWSTATUS_E_LIMITREACHED: + AddInfoToErr(Msg, RowHeader, [SRowLimitReached, RowStatus]); + DBROWSTATUS_E_SCHEMAVIOLATION: + AddInfoToErr(Msg, RowHeader, [SRowSchemaViolation, RowStatus]); + DBROWSTATUS_E_FAIL: + AddInfoToErr(Msg, RowHeader, [SRowFail, RowStatus]); + else + AddInfoToErr(Msg, RowHeader, [SUnknownStatus, RowStatus]); + end; + + FreeCoMem(pRowStatus); + AddInfoToErr(E, Msg, []); + end; + + // ----- + RowsetUpdateRollback; + // -----} + + raise E; + end; + end; +end; + +procedure TOLEDBRecordSet.RowsetUpdateRollback; +{$IFDEF CLR} +var + rghRows: PUintArray; + GCHandle: IntPtr; +{$ENDIF} +begin +{$IFDEF CLR} + GCHandle := AllocGCHandle(TObject(FHRow), True); + try + rghRows := GetAddrOfPinnedObject(GCHandle); + Check(FIRowsetUpdate.Undo(0, 1, rghRows, nil, nil, nil)); + finally + FreeGCHandle(GCHandle); + end; +{$ELSE} + Check(FIRowsetUpdate.Undo(0, 1, @FHRow, nil, nil, nil)); +{$ENDIF} +//Assert(cRows = 1); + +{ Check(FIRowsetUpdate.GetRowStatus(0, 1, @FHRow, @pRowStatus)); + FHRowAccessible := True; ClearHRowIfNeed; + + Check(FIRowsetUpdate.GetRowStatus(0, 1, @FHRow, @pRowStatus)); + FHRowAccessible := True; ClearHRowIfNeed; +//Check(FIRowsetUpdate.GetRowStatus(0, 1, @FHRow, @pRowStatus)); +} +end; + +procedure TOLEDBRecordSet.InternalAppend(RecBuf: IntPtr); +begin + if (FIRowsetUpdate <> nil) then begin + ClearHRowIfNeed; + InternalAppendOrUpdate(RecBuf, True); + end + else + inherited; + + if FCursorType = ctKeySet then + Inc(FRecordCount); +end; + +procedure TOLEDBRecordSet.InternalDelete; +var + hr: HResult; +{$IFDEF CLR} + rghRows: PUintArray; + GCHandle: IntPtr; +{$ENDIF} +begin + if FIRowsetUpdate = nil then + inherited + else + begin + Assert(FIRowsetUpdate <> nil, 'FCommand.FIRowsetUpdate must be setted'); + Assert(FHRowAccessible, 'FHRow must be accessible'); + + {$IFDEF CLR} + GCHandle := AllocGCHandle(TObject(FHRow), True); + try + rghRows := GetAddrOfPinnedObject(GCHandle); + hr := IRowsetChange(FIRowsetUpdate).DeleteRows(0, 1, rghRows, nil); + finally + FreeGCHandle(GCHandle); + end; + {$ELSE} + hr := FIRowsetUpdate.DeleteRows(0, 1, @FHRow, nil); + {$ENDIF} + Check(hr); + RowsetUpdateCommit; + end; +end; + +procedure TOLEDBRecordSet.InternalUpdate(RecBuf: IntPtr); +begin + if FIRowsetUpdate = nil then + inherited + else + begin + Assert(FHRowAccessible, 'FHRow must be accessible'); + InternalAppendOrUpdate(RecBuf, False); + end; +end; + +procedure TOLEDBRecordSet.InternalAppendOrUpdate(RecBuf: IntPtr; const IsAppend: boolean); +var + StreamList: TList; + + procedure SetDataToRow(const Row: hRow; const pRec: IntPtr); + procedure PrepareConvertableFields; // Server Cursors. Before send data to OLEDB + var + i: integer; + pValue: IntPtr; + HeapBuf: IntPtr; + Size: integer; + Field: TFieldDesc; + {$IFDEF VER5P} + g: TGUID; + {$ENDIF} + {$IFDEF VER6P} + Bcd: TBcd; + s: string; + DotPos, l: integer; + {$ENDIF} + {$IFDEF CLR} + BcdBuf: TBytes; + {$ENDIF} + begin + {$IFDEF VER8} + SetLength(BcdBuf, 0); // To avoid compiler warning. Delphi8 bug. + {$ENDIF} + for i := 0 to Fields.Count - 1 do begin + Field := Fields[i]; + if Field.FieldDescKind = fdkData then begin + pValue := IntPtr(Integer(pRec) + Field.Offset); + case Field.DataType of + dtBytes: + Marshal.WriteInt32(pValue, Field.Length, Field.Length); + dtVarBytes: + Marshal.WriteInt32(pValue, sizeof(word) + Field.Length, Marshal.ReadInt16(pRec, Field.Offset)); + dtExtVarBytes: + if not GetNull(i + 1, pRec) then + begin + HeapBuf := Marshal.ReadIntPtr(pValue); //HeapBuf := IntPtr(IntPtr(pValue)^); + Size := Marshal.ReadInt16(HeapBuf); + Marshal.WriteInt32(pValue, sizeof(IntPtr {IntPtr to OLEDBBuf/StringHeap}), Size); + Marshal.WriteIntPtr(pValue, IntPtr(Integer(HeapBuf) + sizeof(word))); + end; + {$IFDEF VER6P} + dtFmtBCD: + begin + {$IFDEF CLR} + Marshal.Copy(pValue, BcdBuf, 0, 34); + Bcd := TBcd.FromBytes(BcdBuf); + {$ELSE} + Bcd := PBcd(pValue)^; + {$ENDIF} + // DBNumeric + s := BcdToStr(Bcd); + if DecimalSeparator <> '.' then begin + DotPos := Pos(DecimalSeparator, s); + if DotPos <> 0 then + s[DotPos] := '.'; + end; + l := Length(s); + // Marshal.WriteInt32(pLength, l); + + if l > 0 then + CopyBufferAnsi(s, pValue, l + 1{#0}); + end; + {$ENDIF} + {$IFDEF VER5P} + dtGuid: + if not GetNull(i + 1, pRec) then + begin + g := StringToGUID(Marshal.PtrToStringAnsi(pValue)); + {$IFDEF CLR} + Marshal.StructureToPtr(TObject(g), pValue, False); + {$ELSE} + CopyBuffer(@g, pValue, sizeof(g)); + {$ENDIF} + end; + {$ENDIF} + end; + end; + end; + end; + + procedure PostPlainAccessorBlock( + const AccessorBlock: TAccessorBlock; + out NeedToPost: boolean // Used to skip unchanged BLOB fields + ); + procedure ConvertBlobToStream(BlobField: TFieldDesc; const pValue: IntPtr); + var + OLEDBStream: TOLEDBStream; + Blob: TBlob; + pUnk: IntPtr; + + begin + Blob := TBlob(GetGCHandleTarget(Marshal.ReadIntPtr(pValue))); + + // Assert(FCursorType in [ctKeyset, ctDynamic] and FCursorUpdate); + NeedToPost := Blob.CanRollback; + + if NeedToPost then begin + // Create stream + OLEDBStream := TOLEDBStream.Create(Blob, StreamList); + pUnk := Marshal.GetIUnknownForObject(OLEDBStream); + Marshal.AddRef(pUnk); + Marshal.WriteIntPtr(pValue, pUnk); + + // Set stream size + Marshal.WriteInt32(pRec, BlobField.Offset + sizeof(IntPtr{ISeqStream}), OLEDBStream.Size); + end; + end; + + var + pValue: IntPtr; + BlobField: TFieldDesc; + + begin + NeedToPost := True; + if AccessorBlock.BlobFieldNum = -1 then + Exit; + + BlobField := Fields[AccessorBlock.BlobFieldNum]; + pValue := IntPtr(Integer(pRec) + BlobField.Offset); + if not GetNull(AccessorBlock.BlobFieldNum + 1, pRec) then + ConvertBlobToStream(BlobField, pValue); + end; + + var + FetchBlockOffset: integer; + + procedure PostExternalAccessorBlock(const AccessorBlock: TAccessorBlock); + var + i, l, p: integer; + Blob: TSharedObject; + pValue, pc: IntPtr; + pov: POleVariant; + + Field: TFieldDesc; + FieldNum: integer; + ServerVersion: integer; + + begin + Assert(AccessorBlock.BlobFieldNum = - 1); + ServerVersion := ProviderPrimaryVer; + + for i := 0 to Length(AccessorBlock.FieldNums) - 1 do begin + FieldNum := AccessorBlock.FieldNums[i]; + Field := Fields[FieldNum]; + if IsNeedFetchBlock(Field, ServerVersion) then begin + pValue := IntPtr(Integer(pRec) + Field.Offset); + case Field.DataType of + dtMemo, dtWideMemo, dtMSXML: begin + Blob := TSharedObject(GetGCHandleTarget(Marshal.ReadIntPtr(pValue))); + pc := IntPtr(Integer(FFetchBlock) + FetchBlockOffset + OLE_DB_INDICATOR_SIZE); + + p := 0; + if not GetNull(FieldNum + 1, pRec) then begin + l := TBlob(Blob).Size; + if l > MaxNonBlobFieldLen then // see IncFetchBlockOffset + l := MaxNonBlobFieldLen; + + if l > 0 then + p := TBlob(Blob).Read(0, l, pc); + end; + Marshal.WriteByte(pc, p, 0{#0}); + if TBlob(Blob).IsUnicode then + Marshal.WriteByte(pc, p + 1, 0{#0}); + end; + dtVariant: begin + Blob := TSharedObject(GetGCHandleTarget(Marshal.ReadIntPtr(pValue))); + pov := POleVariant(Integer(FFetchBlock) + FetchBlockOffset + OLE_DB_INDICATOR_SIZE); + Marshal.WriteInt16(pov, varEmpty); // TVarData(pov^).VType := varEmpty; + SetOleVariant(pov, TVariantObject(Blob).Value); + end; + else + Assert(False); + end; + IncFetchBlockOffset(FetchBlockOffset, Field.DataType); + end; + end; + end; + + procedure CopyStatusFBlock(const ToFBlock: boolean); // if ToFBlock is True then status is copied from pRec to FetchBlock. Otherwise - from FetchBlock to pRec + var + i: integer; + FetchBlockOffset: integer; + Status: DWORD; + + begin + FetchBlockOffset := 0; + for i := 0 to Fields.Count - 1 do + if (Fields[i].FieldDescKind = fdkData) and IsNeedFetchBlock(Fields[i], ProviderPrimaryVer) then begin + if ToFBlock then begin + Status := GetStatus(i, pRec); + Marshal.WriteInt32(FFetchBlock, FetchBlockOffset, Integer(Status)); + end + else + begin + Status := DWORD(Marshal.ReadInt32(FFetchBlock, FetchBlockOffset)); + SetStatus(i, pRec, Status); + end; + IncFetchBlockOffset(FetchBlockOffset, Fields[i].DataType); + end; + end; + + var + AccNum: integer; + hr: HResult; + NeedToPost: boolean; + begin + PrepareConvertableFields; + + FetchBlockOffset := 0; + try + for AccNum := 0 to Length(FFetchAccessorData.AccessorBlocks) - 1 do begin + Assert(Length(FFetchAccessorData.AccessorBlocks[AccNum].FieldNums) = 1); // CR 4082 + if not IsAppend // Edit + or not GetNull(FFetchAccessorData.AccessorBlocks[AccNum].FieldNums[0] + 1, pRec) + or (FFetchAccessorData.AccessorBlocks[AccNum].BlockType = abBlob) then begin + case FFetchAccessorData.AccessorBlocks[AccNum].BlockType of + abFetchBlock: begin + // Prepare data + CopyStatusFBlock(True); + PostExternalAccessorBlock(FFetchAccessorData.AccessorBlocks[AccNum]); + // Set data to IRowset + if FHRowAccessible then + hr := FIRowsetUpdate.SetData(FHRow, FFetchAccessorData.AccessorBlocks[AccNum].hAcc, FFetchBlock) + else + hr := FIRowsetUpdate.InsertRow(0, FFetchAccessorData.AccessorBlocks[AccNum].hAcc, FFetchBlock, FHRow); + CopyStatusFBlock(False); + + // Analyze OLE DB result + CheckAndAnalyzeFieldsStatus(hr, pRec); + FHRowAccessible := True; + end; + abOrdinary, abBLOB: begin + // Prepare data + PostPlainAccessorBlock(FFetchAccessorData.AccessorBlocks[AccNum], NeedToPost); + if NeedToPost then begin + // Set data to IRowset + if FHRowAccessible then + hr := FIRowsetUpdate.SetData(FHRow, FFetchAccessorData.AccessorBlocks[AccNum].hAcc, pRec) + else + hr := FIRowsetUpdate.InsertRow(0, FFetchAccessorData.AccessorBlocks[AccNum].hAcc, pRec, FHRow); + + // Analyze OLE DB result + CheckAndAnalyzeFieldsStatus(hr, pRec); + FHRowAccessible := True; + end; + end; + abReadOnly:; + end; + end; + end; + except + if FHRowAccessible then + RowsetUpdateRollback; + raise; + end; + + if FHRowAccessible then + RowsetUpdateCommit; + end; + +var + pRec, pRecOld: IntPtr; + i: integer; + OLEDBStream: TOLEDBStream; + +begin + Assert(FIRowsetUpdate <> nil, 'FCommand.FIRowsetUpdate must be setted'); + + StreamList := nil; + pRecOld := RecBuf; + + /// Store old values to prevent conversion. Blob fields is not stored + pRec := Marshal.AllocHGlobal(RecordSize); + try + StreamList := TList.Create; + CopyBuffer(pRecOld, pRec, RecordSize); + SetDataToRow(FHRow, pRec); + finally + Marshal.FreeHGlobal(pRec); + + // Remove streams + for i := StreamList.Count - 1 downto 0 do begin + OLEDBStream := TOLEDBStream(StreamList[i]); + {$IFDEF CLR} + OLEDBStream.Free; + {$ELSE} + OLEDBStream._Release; + {$ENDIF} + if GUIDToString(ProviderId) = GUIDToString(CLSID_SQLNCLI) then + OLEDBStream.FStreamList := nil; + end; + Assert((StreamList.Count = 0) or (GUIDToString(ProviderId) = GUIDToString(CLSID_SQLNCLI)), 'StreamList.Count = ' + IntToStr(StreamList.Count)); + StreamList.Free; + end; +end; + +procedure TOLEDBRecordSet.SetCommandProp; +var + OLEDBProperties: TOLEDBPropertiesSet; + IRowsetUpdateRequired: boolean; + IsSQLEverywhere: boolean; +begin +{$IFDEF SDAC_TEST} + Inc(__SetRecordSetCommandPropCount); +{$ENDIF} + + Assert(FNativeRowset, 'FNativeRowset must be True'); + Assert(FCommand.FIMultipleResults = nil, 'FCommand.FIMultipleResults must be nil'); + + IsSQLEverywhere := Provider = prCompact; + if FCursorType in ServerCursorTypes then begin + // Server cursor has no sence in disconnected mode + if DisconnectedMode then + DatabaseError(SDMandServerCursors); + FFetchRows := 1; /// !!! + FFetchAll := False; + FCommand.FRequestMultipleResults := False; + end + else + FCommand.FRequestMultipleResults := not IsSQLEverywhere; + + IRowsetUpdateRequired := (ProviderPrimaryVer = 7); + + OLEDBProperties := TOLEDBPropertiesSet.Create(FCommand.FConnection, DBPROPSET_ROWSET); + try + with OLEDBProperties do begin + // AddPropInt(DBPROP_ACCESSORDER, DBPROPVAL_AO_SEQUENTIALSTORAGEOBJECTS); - no performance improvement + AddPropInt(DBPROP_ACCESSORDER, DBPROPVAL_AO_RANDOM); + + case FCursorType of + ctDefaultResultSet: + begin + if not IsSQLEverywhere then + AddPropBool(DBPROP_UNIQUEROWS, FUniqueRecords or not FReadOnly); + AddPropBool(DBPROP_IColumnsRowset, FRequestSQLObjects); + if not IsSQLEverywhere then begin + AddPropBool(DBPROP_IMultipleResults, FCommand.FRequestMultipleResults); + AddPropBool(DBPROP_SERVERCURSOR, False); + end; + AddPropBool(DBPROP_OWNINSERT, False); + AddPropBool(DBPROP_OTHERINSERT, False); + AddPropBool(DBPROP_OTHERUPDATEDELETE, False); + AddPropBool(DBPROP_OWNUPDATEDELETE, False); + AddPropBool(DBPROP_IRowsetChange, False); + AddPropBool(DBPROP_IRowsetUpdate, False); + end; + ctStatic: + begin + {Static RO} + AddPropBool(DBPROP_SERVERCURSOR, True); + AddPropBool(DBPROP_IRowsetChange, False); + AddPropBool(DBPROP_IRowsetUpdate, False); + AddPropBool(DBPROP_OWNINSERT, False); + AddPropBool(DBPROP_OTHERINSERT, False); + AddPropBool(DBPROP_OTHERUPDATEDELETE, False); + AddPropBool(DBPROP_OWNUPDATEDELETE, False); + AddPropBool(DBPROP_REMOVEDELETED, False); + AddPropBool(DBPROP_IRowsetResynch, False); + AddPropBool(DBPROP_CHANGEINSERTEDROWS, False); + AddPropBool(DBPROP_SERVERDATAONINSERT, False); + AddPropBool(DBPROP_UNIQUEROWS, False); + AddPropBool(DBPROP_CANFETCHBACKWARDS, not FUniDirectional); + + // Bookmarks + AddPropBool(DBPROP_IRowsetLocate, True); + AddPropBool(DBPROP_BOOKMARKS, True); + end; + ctKeyset: + begin + {Keyset} + AddPropBool(DBPROP_SERVERCURSOR, True); + AddPropBool(DBPROP_OTHERINSERT, False); + AddPropBool(DBPROP_OTHERUPDATEDELETE, True); + AddPropBool(DBPROP_OWNINSERT, True); + AddPropBool(DBPROP_OWNUPDATEDELETE, True); + AddPropBool(DBPROP_UNIQUEROWS, False); + AddPropBool(DBPROP_IMMOBILEROWS, True); + AddPropBool(DBPROP_CANFETCHBACKWARDS, not FUniDirectional); + + // Bookmarks + AddPropBool(DBPROP_IRowsetLocate, True); + AddPropBool(DBPROP_BOOKMARKS, True); + AddPropBool(DBPROP_REMOVEDELETED, True); + + // RO or RW cursor + AddPropBool(DBPROP_IRowsetUpdate, not FReadOnly and FCursorUpdate, IRowsetUpdateRequired); + AddPropBool(DBPROP_CHANGEINSERTEDROWS, True); + + // Transactions support + AddPropBool(DBPROP_COMMITPRESERVE, True); + AddPropBool(DBPROP_ABORTPRESERVE, True); + + end; + ctDynamic: + begin + {Dynamic} + AddPropBool(DBPROP_SERVERCURSOR, True); + AddPropBool(DBPROP_OTHERINSERT, True); + AddPropBool(DBPROP_OTHERUPDATEDELETE, True); + AddPropBool(DBPROP_OWNINSERT, True); + AddPropBool(DBPROP_OWNUPDATEDELETE, True); + AddPropBool(DBPROP_UNIQUEROWS, False); + AddPropBool(DBPROP_IMMOBILEROWS, False); + AddPropBool(DBPROP_CANFETCHBACKWARDS, not FUniDirectional); + + // Bookmarks + AddPropBool(DBPROP_IRowsetLocate, False); + AddPropBool(DBPROP_BOOKMARKS, False); + AddPropBool(DBPROP_REMOVEDELETED, True); + + // RO or RW cursor + AddPropBool(DBPROP_IRowsetUpdate, not FReadOnly and FCursorUpdate, IRowsetUpdateRequired); + AddPropBool(DBPROP_CHANGEINSERTEDROWS, False); + + AddPropBool(DBPROP_IRowsetScroll, False); + AddPropBool(DBPROP_CANHOLDROWS, False); + AddPropBool(DBPROP_LITERALBOOKMARKS, False); + AddPropBool(DBPROP_SERVERDATAONINSERT, False); + + // Transactions support + AddPropBool(DBPROP_COMMITPRESERVE, True); + AddPropBool(DBPROP_ABORTPRESERVE, True); + + end; + end; + end; + OLEDBProperties.SetProperties(FCommand.FICommandProperties); + finally + OLEDBProperties.Free; + end; +end; + +procedure TOLEDBRecordSet.QueryCommandInterfaces(const QueryPrepare: boolean); // Create ConnectionSwap if need. Call FCommand.QueryInterfaces. +begin + FCommand.QueryInterfaces(QueryPrepare); +end; + +procedure TOLEDBRecordSet.ReleaseCommandInterfaces; +begin + FCommand.ReleaseInterfaces; +end; + +procedure TOLEDBRecordSet.QueryRecordSetInterfaces; +{ procedure GetProperties; + const + PropSetCnt = 1; + PropCnt = 12; + var + RowsetInfo: IRowsetInfo; + + rgPropertyIDSets: PDBPropIDSetArray; + DBPropIDArray: array[0..PropCnt - 1] of DBPROPID; + + rgPropertySets: PDBPropSet; + cPropertySets: UINT; + b: boolean; + i: integer; + st: DBPROPSTATUS; + begin + FIRowset.QueryInterface(IID_IRowsetInfo, RowsetInfo); + + DBPropIDArray[0] := DBPROP_SERVERCURSOR; + DBPropIDArray[1] := DBPROP_IRowsetChange; + DBPropIDArray[2] := DBPROP_IRowsetUpdate; + DBPropIDArray[3] := DBPROP_OWNINSERT; + DBPropIDArray[4] := DBPROP_OTHERINSERT; + DBPropIDArray[5] := DBPROP_OTHERUPDATEDELETE; + DBPropIDArray[6] := DBPROP_OWNUPDATEDELETE; + DBPropIDArray[7] := DBPROP_REMOVEDELETED; + DBPropIDArray[8] := DBPROP_IRowsetResynch; + DBPropIDArray[9] := DBPROP_CHANGEINSERTEDROWS; + DBPropIDArray[10] := DBPROP_SERVERDATAONINSERT; + DBPropIDArray[11] := DBPROP_UNIQUEROWS; + + GetMem1(rgPropertyIDSets, PropSetCnt * sizeof(DBPropIDSet)); + try + rgPropertyIDSets[0].guidPropertySet := DBPROPSET_ROWSET; + rgPropertyIDSets[0].cPropertyIDs := PropCnt; + rgPropertyIDSets[0].rgPropertyIDs := @DBPropIDArray; + + Check(RowsetInfo.GetProperties(PropSetCnt, rgPropertyIDSets, + cPropertySets, PDBPropSet(rgPropertySets))); + + Assert(rgPropertySets <> nil, 'Cannot get properties'); + + for i := 0 to PropCnt - 1 do + begin + b := rgPropertySets.rgProperties[i].vValue; + st := rgPropertySets.rgProperties[i].dwStatus; + b := not b; + end; + + finally + FreeMem1(rgPropertyIDSets); + FCommand.FConnection.Malloc.Free(rgPropertySets.rgProperties); + FCommand.FConnection.Malloc.Free(rgPropertySets); + end; + end; +} +begin + try + if FNativeRowset then begin + Assert(FIRowset = nil, 'Duplicate call to TOLEDBRecordSet.QueryRecordSetInterfaces'); + Assert(FCommand.FIUnknown <> nil, 'FCommand.FIUnknown must be setted'); + + QueryIntf(FCommand.FIUnknown, {$IFDEF CLR}IRowset{$ELSE}IID_IRowset{$ENDIF}, FIRowset); + + if FCursorType in [ctKeyset, ctStatic] then begin + QueryIntf(FIRowset, {$IFDEF CLR}IRowsetLocate{$ELSE}IID_IRowsetLocate{$ENDIF}, FIRowsetLocate); + Assert(FIRowsetLocate <> nil); + end; + + {if (FCursorType in [ctKeyset, ctDynamic]) then + GetProperties;} + if (FCursorType in [ctKeyset, ctDynamic]) + and not FReadOnly + and FCursorUpdate then + QueryIntf(FIRowset, {$IFDEF CLR}IRowsetUpdate{$ELSE}IID_IRowsetUpdate{$ENDIF}, FIRowsetUpdate); + + FCommand.FIUnknown := nil; + end; + except + ReleaseRecordSetInterfaces; + end; +end; + +procedure TOLEDBRecordSet.ReleaseRecordSetInterfaces; +begin + FIRowsetUpdate := nil; + + FIRowset := nil; + FIRowsetLocate := nil; + + if FNativeRowset then + RequestParamsIfPossible; +end; + +procedure TOLEDBRecordSet.ReleaseAllInterfaces(const ReleaseMultipleResults: boolean); +begin + FreeFetchBlock; + FCommand.FIUnknown := nil; + ReleaseRecordSetInterfaces; +end; + +procedure TOLEDBRecordSet.InternalOpen; +begin + FLastFetchBack := False; + FLastFetchOK := True; + FLastFetchEnd := False; + FHRowAccessible := False; + if FCursorType = ctDynamic then + FRecordCount := - 1; + + FProcessDynBofEof := False; + + try + if FNativeRowset then + QueryCommandInterfaces(False); // If QueryInterfaces already called then do nothing. Need to prevent clear FICommandText & FICommandProperties after command.execute before CreateFieldDescByRowset + + inherited; + except + if FNativeRowset then + ReleaseCommandInterfaces; + + if FCommand.GetCursorState = csFetched then + FCommand.SetCursorState(csInactive); + + raise; + end; +end; + +procedure TOLEDBRecordSet.InternalClose; +begin + if FCommand.FNonBlocking and (FFetchExecutor <> nil) then + BreakFetch; + + ClearHRowIfNeed; + FreeFetchBlock; + if FNativeRowset then begin + if not FLockClearMultipleResults then begin + FCommand.ClearIMultipleResults; + FCommand.FIUnknownNext := nil; + end; + FCommand.FIUnknown := nil; + RequestParamsIfPossible; + end; + if FIRowset <> nil then // If FIRowset is not closed on Fetch by any reason + ReleaseRecordSetInterfaces; + + FreeData; // To destroy Blobs + + if Assigned(FAfterExecFetch) then + FAfterExecFetch(True); + + if FNativeRowset then + ReleaseCommandInterfaces; + + FCommand.FCursorState := csInactive; + if not Prepared then + CommandType := ctUnknown; + + FCommand.FNextResultRequested := False; + FLastFetchEnd := False; + + inherited; +end; + +procedure TOLEDBRecordSet.ExecCommand; + procedure ProcessCursorType;// Analyze CursorType changes + var + ActualCursorType: TMSCursorType; // Cursor type after OLEDB execute. + ActualSCReadOnly: boolean; // ReadOnly after OLEDB execute. Only for server cursors and CursorUpdate = True + + procedure AnalyzeCursorType; // Analyzed by FCommand.FIUnknown + var + RowsetInfo: IRowsetInfo; + PropValues: TPropValues; + + begin + with TOLEDBPropertiesGet.Create(FCommand.FConnection, DBPROPSET_ROWSET) do + try + AddPropId(DBPROP_SERVERCURSOR); + AddPropId(DBPROP_OTHERUPDATEDELETE); + AddPropId(DBPROP_IRowsetLocate); + AddPropId(DBPROP_IRowsetUpdate); + + // Getting info interface + if FCommand.FIUnknown <> nil then begin + QueryIntf(FCommand.FIUnknown, {$IFDEF CLR}IRowsetInfo{$ELSE}IID_IRowsetInfo{$ENDIF}, RowsetInfo); + GetProperties(RowsetInfo, PropValues); + end + else + begin + Assert(FCommand.FICommandProperties <> nil); + GetProperties(FCommand.FICommandProperties, PropValues); + end; + finally + Free; + end; + + if {DBPROP_SERVERCURSOR} PropValues[0] = False then + ActualCursorType := ctDefaultResultSet + else + begin // Static, KeySet, Dynamic + if {DBPROP_OTHERUPDATEDELETE} PropValues[1] = False then begin // Static + ActualCursorType := ctStatic; + ActualSCReadOnly := True; + end + else + begin // KeySet, Dynamic + if {DBPROP_IRowsetLocate} PropValues[2] = False then // Dynamic + ActualCursorType := ctDynamic + else + ActualCursorType := ctKeySet; // KeySet + + ActualSCReadOnly := {DBPROP_IRowsetUpdate} PropValues[3] = False; + end; + end; + end; + + var + IsChanged, IsROChanged: boolean; + begin + ActualCursorType := FCursorType; + ActualSCReadOnly := FReadOnly; + AnalyzeCursorType; + + IsROChanged := (FCursorType in ServerCursorTypes) and FCursorUpdate and (FReadOnly <> ActualSCReadOnly); + IsChanged := (FCursorType <> ActualCursorType) + or IsROChanged; + + if IsChanged then begin + FCursorType := ActualCursorType; + if IsROChanged then + FReadOnly := ActualSCReadOnly; + + Assert(Assigned(FCursorTypeChanged)); + try + FCursorTypeChanged; // may be exception + except + FCommand.FIUnknown := nil; + FCommand.ClearIMultipleResults; + raise; + end; + end; + end; + +begin + if not FNativeRowset then + Exit; // CommandExec is not need for non-Native rowsets + + QueryCommandInterfaces(False); + try + if not Prepared + and (FCommand.FIMultipleResults = nil) + and FNativeRowset then // This is a first call to non-prepared DataSet.Command.Execute + SetCommandProp; + inherited; + + if (FCommand.FIUnknown <> nil) + and FCommand.FLastExecWarning then + ProcessCursorType; + + /// Must be after ProcessCursorType to prevent wrong setting CommandType + if (FCommand.FIUnknown <> nil) + or (FIRowset <> nil) then + CommandType := ctCursor + else + CommandType := ctStatement; + + finally + ReleaseCommandInterfaces; + if CommandType <> ctCursor then + FCommand.SetCursorState(csInactive); + end; +end; + +procedure TOLEDBRecordSet.Open; +begin + try + inherited; + except + if FCommand.FQueryIntCnt > 0 then + FCommand.ReleaseInterfaces; + raise; + end; +end; + +procedure TOLEDBRecordSet.Reopen; +begin + if not FNativeRowset then begin + Close; + SetIRowset(FCommand.FConnection.GetSchemaRowset(FSchema, FRestrictions), False); + end; + + inherited; +end; + +function TOLEDBRecordSet.GetSchemaRowset(const Schema: TGUID; rgRestrictions: TRestrictions): IRowset; +begin + FSchema := Schema; + FRestrictions := rgRestrictions; + + Assert(FCommand.FConnection <> nil); + Result := FCommand.FConnection.GetSchemaRowset(FSchema, FRestrictions); +end; + +procedure TOLEDBRecordSet.Disconnect; +begin + Assert(FCommand <> nil); + FCommand.FIUnknown := nil; + // FCommand.FIMultipleRes + + //Cache connection depenednt information + GetProviderPrimaryVer; + GetDBMSPrimaryVer; + GetProviderId; + GetProvider; + GetDisconnectedMode; + GetDatabase; + + ReleaseAllInterfaces(True); + inherited; +end; + +procedure TOLEDBRecordSet.CreateCommand; +var + Cmd: TOLEDBCommand; +begin + Cmd := TOLEDBCommand.Create; + Cmd.FRequestIUnknown := True; + SetCommand(Cmd); +end; + +procedure TOLEDBRecordSet.SetCommand(Value: TCRCommand); +begin + inherited; + + FCommand := TOLEDBCommand(Value); +end; + +function TOLEDBRecordSet.GetIRowset: IRowset; +begin + Result := FIRowset; +end; + +function TOLEDBRecordSet.GetICommandText: ICommandText; +begin + Result := FCommand.FICommandText; +end; + +procedure TOLEDBRecordSet.SetIRowset( + Rowset: IRowset; + const IsColumnsRowset: boolean); // If True then FieldDescs was stored in FColumnsRowsetFieldDescs +begin + Close; + Unprepare; + + FIRowset := Rowset; + FNativeRowset := False; + FReadOnly := True; // Non-native rowset cannot be modified + FCommand.FCursorState := csExecuted; + FFlatBuffers := True; + CommandType := ctUnknown; + FIsColumnsRowset := IsColumnsRowset; +end; + +procedure TOLEDBRecordSet.Check(const Status: HRESULT); +begin + if FNativeRowset then + FCommand.FConnection.Check(Status, Component) + else + if Status <> S_OK then + raise EOLEDBError.Create(Status, Format(SOLEDBError, [Status])); +end; + +procedure TOLEDBRecordSet.RequestParamsIfPossible; +begin + if (FIRowsetLocate = nil) and (FIRowsetUpdate = nil) and (FIRowset = nil) then begin + FCommand.RequestParamsIfPossible; + if (FCommand.FIUnknown = nil) + and ((FCommand.GetCursorState = csFetching) or (FCommand.GetCursorState = csFetchingAll)) then begin + FCommand.SetCursorState(csFetched); + if not Prepared then + ReleaseCommandInterfaces; + end; + end; +end; + +class function TOLEDBRecordSet.GetTableInfoClass: TTableInfoClass; +begin + Result := TOLEDBTableInfo; +end; + +function TOLEDBRecordSet.GetProviderPrimaryVer: integer; +begin + if (FCommand <> nil) and (FCommand.FConnection <> nil) then + FProviderPrimaryVer := FCommand.FConnection.ProviderPrimaryVer; + Result := FProviderPrimaryVer; +end; + +function TOLEDBRecordSet.GetDBMSPrimaryVer: integer; +begin + if (FCommand <> nil) and (FCommand.FConnection <> nil) then + FDBMSPrimaryVer := FCommand.FConnection.DBMSPrimaryVer; + Result := FDBMSPrimaryVer; +end; + +function TOLEDBRecordSet.GetProviderId: TGuid; +begin + if (FCommand <> nil) and (FCommand.FConnection <> nil) then + FProviderId := FCommand.FConnection.FProviderId; + Result := FProviderId; +end; + +function TOLEDBRecordSet.GetProvider: TOLEDBProvider; +begin + if (FCommand <> nil) and (FCommand.FConnection <> nil) then + FProvider := FCommand.FConnection.FProvider; + Result := FProvider; +end; + +function TOLEDBRecordSet.GetDisconnectedMode: boolean; +begin + if (FCommand <> nil) and (FCommand.FConnection <> nil) then + FDisconnectedMode := FCommand.FConnection.DisconnectedMode; + Result := FDisconnectedMode; +end; + +function TOLEDBRecordSet.GetDatabase: string; +begin + if (FCommand <> nil) and (FCommand.FConnection <> nil) then + FDatabase := FCommand.FConnection.FDatabase; + Result := FDatabase; +end; + +procedure TOLEDBRecordSet.CheckBCDOverflow(const FieldNo: integer {from 1}; RecBuf: IntPtr); +begin + if (Fields[FieldNo - 1].DataType = dtBCD) + and (GetStatus(FieldNo - 1, RecBuf) = DBSTATUS_E_DATAOVERFLOW) then + raise Exception.Create(SBCDOverflow); +end; + +procedure TOLEDBRecordSet.CheckAndAnalyzeFieldsStatus(const Status: HRESULT; const pRec: IntPtr); +const + FieldHeader = 'Field[%d] %s - %s (Status = %Xh).'; +var + i: integer; + FieldStatus: DWORD; + FieldName: string; + Msg: WideString; +begin + if (Status <> S_OK) and (Status <> DB_S_ERRORSOCCURRED) then + try + Check(Status); + except + on E: Exception do begin + Msg := ''; + for i := 0 to FFields.Count - 1 do + if FFields[i].FieldDescKind = fdkData then begin + FieldName := FFields[i].Name; + if FieldName = '' then + FieldName := IntToStr(i) + else + FieldName := ':' + FieldName; + FieldStatus := GetStatus(i, pRec); + case FieldStatus of + DBSTATUS_S_OK, DBSTATUS_S_ISNULL, DBSTATUS_S_DEFAULT:; + DBSTATUS_E_BADACCESSOR: + AddInfoToErr(Msg, FieldHeader, [i, FieldName, SBadAccessor, FieldStatus]); + DBSTATUS_E_CANTCONVERTVALUE: + AddInfoToErr(Msg, FieldHeader, [i, FieldName, SInvalidValue, FieldStatus]); + DBSTATUS_S_TRUNCATED: + AddInfoToErr(Msg, FieldHeader, [i, FieldName, SDataTruncated, FieldStatus]); + DBSTATUS_E_SIGNMISMATCH: + AddInfoToErr(Msg, FieldHeader, [i, FieldName, SSignMismatch, FieldStatus]); + DBSTATUS_E_DATAOVERFLOW: + AddInfoToErr(Msg, FieldHeader, [i, FieldName, SDataOverflow, FieldStatus]); + DBSTATUS_E_CANTCREATE: + AddInfoToErr(Msg, FieldHeader, [i, FieldName, SCantCreate, FieldStatus]); + DBSTATUS_E_UNAVAILABLE: + {AddInfoToErr(Msg, FieldHeader, [i, FieldName, SUnavaible, FieldStatus])}; + DBSTATUS_E_PERMISSIONDENIED: + AddInfoToErr(Msg, FieldHeader, [i, FieldName, SPermissionDenied, FieldStatus]); + DBSTATUS_E_INTEGRITYVIOLATION: + AddInfoToErr(Msg, FieldHeader, [i, FieldName, SIntegrityViolation, FieldStatus]); + DBSTATUS_E_SCHEMAVIOLATION: + AddInfoToErr(Msg, FieldHeader, [i, FieldName, SShemaViolation, FieldStatus]); + DBSTATUS_E_BADSTATUS: + AddInfoToErr(Msg, FieldHeader, [i, FieldName, SBadStatus, FieldStatus]); + else + AddInfoToErr(Msg, FieldHeader, [i, FieldName, SUnknownStatus, FieldStatus]); + end; + end; + AddInfoToErr(E, Msg, []); + raise E; + end; + end; +end; + +procedure TOLEDBRecordSet.InternalInitFields; + function ConvertDBCOLUMNINFOToFieldDesc( + // const prgInfoEl: PDBCOLUMNINFO; + const FieldName: string; // prgInfoEl.pwszName + const ActualFieldName: string; // if prgInfoEl.columnid.eKind = DBKIND_NAME then ActualFieldName := prgInfoEl.columnid.uName.pwszName else ActualFieldName := prgInfoEl.pwszName; + const FieldNo: integer; // prgInfoEl.iOrdinal + const OLEDBType: DBTYPE; // prgInfoEl.wType + const dwFlags: DBCOLUMNFLAGS; // prgInfoEl.dwFlags + const IsAutoIncrement: boolean; + const Precision: integer; //prgInfoEl.bPrecision + const Scale: integer; //prgInfoEl.bScale + const ColumnSize: UINT; // prgInfoEl.ulColumnSize + + // Options + const LongStrings: boolean; + // Result + Field: TOLEDBFieldDesc + ): boolean;// return False, if this field type not supported + + function IsFlagSetted(const Flag: UINT): boolean; + begin + Result := (dwFlags and Flag) <> 0; + end; + + procedure ConvertFlags; + begin + // DBCOLUMNFLAGS_ISFIXEDLENGTH, DBCOLUMNFLAGS_ISLONG, + // DBCOLUMNFLAGS_ISNULLABLE, DBCOLUMNFLAGS_MAYBENULL + // DBCOLUMNFLAGS_WRITE, DBCOLUMNFLAGS_WRITEUNKNOWN + // DBCOLUMNFLAGS_ISROWID, DBCOLUMNFLAGS_ISROWVER + // DBCOLUMNFLAGS_SCALEISNEGATIVE + + Field.Fixed := IsFlagSetted(DBCOLUMNFLAGS_ISFIXEDLENGTH); + Field.IsKey := IsFlagSetted(DBCOLUMNFLAGS_KEYCOLUMN); + Field.Required := not IsFlagSetted(DBCOLUMNFLAGS_ISNULLABLE); + Field.FIsTimestamp := IsFlagSetted(DBCOLUMNFLAGS_ISROWVER); + + Field.ReadOnly := + (not IsFlagSetted(DBCOLUMNFLAGS_WRITE) and + not IsFlagSetted(DBCOLUMNFLAGS_WRITEUNKNOWN)); + + if FNativeRowset + and not (FCursorType in ServerCursorTypes) + and Field.ReadOnly then + Field.ReadOnly := Field.FIsTimestamp or IsAutoIncrement; + + Field.FIsAutoIncrement := IsAutoIncrement; + end; + + function CreateUniqueFieldName(const FieldName: string): string; + var + AliasNum: integer; + begin + if FieldName = '' then begin + AliasNum := 1; + repeat + Result := 'COLUMN' + IntToStr(AliasNum); + Inc(AliasNum); + until FindField(Result) = nil; + end + else + Result := FieldName; + end; + + var + InternalType: word; + + begin + Field.SubDataType := dtUnknown; + + Result := ConvertOLEDBTypeToInternalFormat(OLEDBType, IsFlagSetted(DBCOLUMNFLAGS_ISLONG), FEnableBCD, {$IFDEF VER6P}FEnableFMTBCD{$ELSE}False{$ENDIF}, FWideStrings, False, InternalType, DBMSPrimaryVer); + if not Result then + Exit; + + // --- Correct access to SQL 2000 server from 7.0 Client + if FNativeRowset + and ((ProviderPrimaryVer < 8) and not IsWindowsVista) + and (Provider <> prCompact) + and (OLEDBType = DBTYPE_NUMERIC) + and (Precision = 19) then + InternalType := dtInt64; + // --- + + {$IFDEF LITE} + if (InternalType = dtFmtBCD) + and not ((Scale > 4) or (Precision > 14)) then + InternalType := dtBCD; + {$ENDIF} + + Field.DataType := InternalType; + + if FNativeRowset then + Field.Name := CreateUniqueFieldName(FieldName) + else + Field.Name := FieldName; + Field.ActualName := ActualFieldName; + Field.FieldNo := FieldNo; + + ConvertFlags; + // Correct access to 'bigint' fields from Delphi4 + {$IFDEF VER4} + if Field.DataType = dtInt64 then + Field.ReadOnly := True; + {$ENDIF} + + {if FNativeRowset then + Field.Hidden := integer(prgInfoEl.columnid.uGuid.pguid) <> 1; + // :( This is impossible becouse we needs TField for update SQLs and for ColumnsMetaInfo} + + // WAR Field.Size must be syncronized with actual data size in PutFieldData, GetFieldData, and possible PutFieldAsVariant, GetFieldAsVariant + + case InternalType of + // Integer fields + dtBoolean: + Field.Size := sizeof(WordBool); + dtInt8: begin + Field.Size := sizeof(byte); + if DBMSPrimaryVer = 3 then + Field.SubDataType := Field.SubDataType or dtUInt8; + end; + dtWord: begin + if (DBMSPrimaryVer = 3) and (OLEDBType = DBTYPE_UI1) then + Field.SubDataType := Field.SubDataType or dtUInt8; + Field.Size := sizeof(word); + end; + dtInt16: + Field.Size := sizeof(smallint); + dtInt32, dtUInt32: + Field.Size := sizeof(integer); + dtInt64: + Field.Size := sizeof(int64); + + // Float fields + dtFloat: + begin + Field.Size := sizeof(double); + Field.Scale := Scale; + Field.Length := Precision; // Precision cannot be greater then 15 + + if OLEDBType = DBTYPE_R4 then begin + Field.Length := 7; + if DBMSPrimaryVer = 3 then + Field.SubDataType := Field.SubDataType or dtSingle; + end + else + if OLEDBType = DBTYPE_R8 then + Field.Length := 15; + end; + dtCurrency: + begin + Field.Size := sizeof(double); + //Field.Size := sizeof(currency); //Currency type cannot be used over TCurrencyField uses double to store + Field.Scale := Scale; + Field.Length := Precision; // Precision cannot be greater then 15 + end; + + // Multibyte fields + dtBCD: + begin + Field.Size := sizeof(Currency); + Field.Scale := Scale; + Field.Length := Precision; + end; + + {$IFDEF VER6P} + dtFmtBCD: + begin + if Precision < SizeOfTBcd then + Field.Size := SizeOfTBcd + 1{'+/-'} + 1{'.'} + 1{#0} + else + Field.Size := Precision + 1{'.'} + 1 {#0}; // To right notation of large NUMERIC values + Field.Scale := Scale; + Field.Length := Precision; + end; + {$ENDIF} + + dtDateTime: + if DBMSPrimaryVer <> 3 then + Field.Size := sizeof(TDateTime) + else + Field.Size := sizeof(TDBTimeStamp); + dtDate, dtTime: + Field.Size := sizeof(TDateTime); + {$IFDEF VER5P} + dtGuid: + begin + Field.Length := 38; { Length(GuidString) } + Field.Size := Field.Length + 1; + end; + {$ENDIF} + dtString, dtWideString, dtMemo, dtWideMemo, dtMSXML: + begin + Field.Length := 0; // WAR Field.Size must be syncronized with actual data size in PutFieldData, GetFieldData, and possible PutFieldAsVariant, GetFieldAsVariant + {$IFNDEF VER5P} + if prgInfoEl.wType = DBTYPE_GUID then + begin + Field.Length := 38; { Length(GuidString) } + Field.Size := Word(Field.Length + 1); + end + else + {$ENDIF} + if IsFlagSetted(DBCOLUMNFLAGS_ISLONG) then begin + // This is a MS SQL 'text' or 'ntext' field + Field.SubDataType := dtText; + Field.Size := Word(sizeof(IntPtr)) {ISeqStream}; + if not FReadOnly then + Field.Size := Word(Field.Size + Word(sizeof(integer))) {DBLENGTH}; + end + else // This is a MS SQL 'char', 'varchar', 'nchar' or 'nvarchar' field + begin + if not LongStrings and (ColumnSize > 255) then begin + if InternalType = dtWideString then + Field.DataType := dtWideMemo + else + Field.DataType := dtMemo; + Field.Size := Word(sizeof(IntPtr)) {ISeqStream}; + if not FReadOnly then + Field.Size := Word(Field.Size + Word(sizeof(integer))) {DBLENGTH}; + end + else + begin + Field.Length := ColumnSize; + if InternalType = dtWideString then + Field.Size := Word((ColumnSize + 1) * sizeof(WideChar)) + else + Field.Size := Word(ColumnSize + 1); + + if not FFlatBuffers and (Field.Size >= FlatBufferLimit) and (FCursorType = ctDefaultResultSet) then + begin + Field.Size := Word(sizeof(IntPtr)); + if InternalType = dtString then + Field.DataType := dtExtString + else + Field.DataType := dtExtWideString; + end; + end; + end; + + if (OLEDBType = DBTYPE_WSTR) or (OLEDBType = DBTYPE_XML) then + Field.SubDataType := Field.SubDataType or dtWide; + end; + dtBytes, dtVarBytes, dtBlob: + begin + if IsFlagSetted(DBCOLUMNFLAGS_ISLONG) then begin + // This is a MS SQL 'image' field + // WAR Field.Size must be syncronized with actual data size in PutFieldData, GetFieldData, and possible PutFieldAsVariant, GetFieldAsVariant + Field.Size := Word(sizeof(IntPtr)) {ISeqStream}; + if not FReadOnly then + Field.Size := Word(Field.Size + Word(sizeof(integer))) {DBLENGTH}; + end + else + begin + Field.Length := Word(ColumnSize); + + if Field.Fixed then begin + if FReadOnly then + Field.Size := Word(Field.Length) + else + Field.Size := Word(Field.Length + Word(sizeof(UINT))) {OLE DB readed bytes}; + end + else + if FFlatBuffers or (ColumnSize < FlatBufferLimit) or (FCursorType <> ctDefaultResultSet) then + begin + Field.DataType := dtVarBytes; + Field.Size := Word(Word(sizeof(word)) {Readed bytes} + Field.Length + Word(sizeof(UINT))) {OLE DB readed bytes}; + end + else + begin + Field.Length := Word(ColumnSize); + Field.DataType := dtExtVarBytes; + Field.Size := Word(sizeof(IntPtr) {IntPtr to OLEDBBuf/StringHeap} + sizeof(UINT)) {OLE DB readed bytes}; + end; + end; + end; + {$IFDEF VER5P} + dtVariant: + Field.Size := sizeof(TVariantObject); + {$ENDIF} + else + Result := False; + end; + end; + + procedure CreateFieldDescs( + const IUnk: IUnknown; + const ByInfo: boolean // if True, then FieldDescs creates with using ColumnsInfo, otherwise - using ColumnsRowset + ); + + procedure CreateFieldDescsByInfo; + function GetHiddenColumnsCount: UINT; + var + PropValues: TPropValues; + begin + with TOLEDBPropertiesGet.Create(FCommand.FConnection, DBPROPSET_ROWSET) do + try + AddPropId(DBPROP_HIDDENCOLUMNS); + GetProperties(FCommand.FICommandProperties, PropValues); + finally + Free; + end; + Result := PropValues[0]; + end; + + var + ColumnsInfo: IColumnsInfo; + i: integer; + Field, BookmarkField: TOLEDBFieldDesc; + + cColumns: UINT; + prgInfo: PDBCOLUMNINFO; + prgInfoEl: PDBCOLUMNINFO; + rgInfoEl: {$IFDEF CLR}DBCOLUMNINFO{$ELSE}PDBCOLUMNINFO{$ENDIF}; + pStringsBuffer: IntPtr; + + //Malloc: IMalloc; + + ActualFieldName: string; + + begin + if IUnk = nil then + Exit; // This query does not return rowset + + QueryIntf(IUnk, {$IFDEF CLR}IColumnsInfo{$ELSE}IID_IColumnsInfo{$ENDIF}, ColumnsInfo); + Assert(ColumnsInfo <> nil); + + pStringsBuffer := nil; + Check(ColumnsInfo.GetColumnInfo(cColumns, PDBCOLUMNINFO(prgInfo), pStringsBuffer)); + + {$IFDEF LITE} + Assert(not FUniqueRecords); + {$ENDIF} + // Add hidden columns count for SQL 2000 + if FNativeRowset and ((ProviderPrimaryVer >= 8) or IsWindowsVista) and FUniqueRecords then + cColumns := cColumns + GetHiddenColumnsCount; + + if cColumns > 0 then + try + BookmarkField := nil; + prgInfoEl := prgInfo; + for i := 0 to cColumns - 1 do begin + {$IFDEF CLR} + Assert(prgInfoEl <> nil); + rgInfoEl := DBCOLUMNINFO(Marshal.PtrToStructure(prgInfoEl, TypeOf(DBCOLUMNINFO))); + {$ELSE} + rgInfoEl := prgInfoEl; + {$ENDIF} + Field := TOLEDBFieldDesc.Create; + try + if rgInfoEl.columnid.eKind = DBKIND_NAME then + ActualFieldName := Marshal.PtrToStringUni(rgInfoEl.columnid.uName{$IFNDEF CLR}.pwszName{$ENDIF}) + else + ActualFieldName := rgInfoEl.pwszName; + + if ConvertDBCOLUMNINFOToFieldDesc( + // rgInfoEl + rgInfoEl.pwszName, + ActualFieldName, + rgInfoEl.iOrdinal, + rgInfoEl.wType, + rgInfoEl.dwFlags, + False, + rgInfoEl.bPrecision, + rgInfoEl.bScale, + rgInfoEl.ulColumnSize, + FLongStrings, Field) then begin + + Field.FOLEDBType := rgInfoEl.wType; + if Field.FieldNo > 0 then + FFields.Add(Field) + else // Bookmark column have FieldNo = 0 + begin + Field.Hidden := True; + BookmarkField := Field; + FBookmarkOffset := - 1; + end; + end + else + if FNativeRowset then + DatabaseErrorFmt(SBadFieldType, [rgInfoEl.pwszName, rgInfoEl.wType]) + else + Field.Free; + except + Field.Free; + BookmarkField.Free; + raise; + end; + prgInfoEl := IntPtr(Integer(prgInfoEl) + + {$IFDEF CLR} + Marshal.SizeOf(TypeOf(DBCOLUMNINFO)) + {$ELSE} + sizeof(DBCOLUMNINFO) + {$ENDIF}); + end; + if BookmarkField <> nil then + FFields.Add(BookmarkField); + + finally + {if FCommand.FConnection = nil then + CoGetMalloc(1, Malloc) + else + Malloc := FCommand.FConnection.Malloc;} + + FreeCoMem(prgInfo); + FreeCoMem(pStringsBuffer); + //Malloc.Free(prgInfo); + //Malloc.Free(pStringsBuffer); + + //Malloc := nil; + end; + end; + + {$IFNDEF LITE} + procedure CreateFieldDescsByRowset; + var + RecBuf: IntPtr; + ColumnsMetaInfo: TOLEDBRecordSet; + + procedure CheckColumnsMetaInfo; + begin + if FCommand.FConnection.FColumnsMetaInfo <> nil then + ColumnsMetaInfo := FCommand.FConnection.FColumnsMetaInfo + else + begin + ColumnsMetaInfo := TOLEDBRecordSet.Create; + FCommand.FConnection.FColumnsMetaInfo := ColumnsMetaInfo; + + ColumnsMetaInfo.SetConnection(FCommand.FConnection); + ColumnsMetaInfo.SetProp(prFetchAll, False); + ColumnsMetaInfo.SetProp(prFetchRows, 1); + ColumnsMetaInfo.SetProp(prUniDirectional, True); + FCommand.FConnection.FFldCatalogNameIdx := -1; + end; + end; + + procedure CheckColumnsMetaInfoIdx; + begin + Assert(ColumnsMetaInfo <> nil); + if FCommand.FConnection.FFldCatalogNameIdx <> - 1 then + Exit; + + with FCommand.FConnection do begin + FFldCatalogNameIdx := FColumnsMetaInfo.Fields.IndexOf(FColumnsMetaInfo.FindField('DBCOLUMN_BASECATALOGNAME')); // SQL Everywhere + FFldSchemaNameIdx := FColumnsMetaInfo.Fields.IndexOf(FColumnsMetaInfo.FindField('DBCOLUMN_BASESCHEMANAME')); // SQL Everywhere + + FFldTableNameIdx := FColumnsMetaInfo.Fields.IndexOf(FColumnsMetaInfo.FieldByName('DBCOLUMN_BASETABLENAME')); + FFldColumnNameIdx := FColumnsMetaInfo.Fields.IndexOf(FColumnsMetaInfo.FieldByName('DBCOLUMN_BASECOLUMNNAME')); + + FFldPrecisionIdx := FColumnsMetaInfo.Fields.IndexOf(FColumnsMetaInfo.FieldByName('DBCOLUMN_PRECISION')); + FFldScaleIdx := FColumnsMetaInfo.Fields.IndexOf(FColumnsMetaInfo.FieldByName('DBCOLUMN_SCALE')); + FFldGuidIdx := FColumnsMetaInfo.Fields.IndexOf(FColumnsMetaInfo.FieldByName('DBCOLUMN_GUID')); + + /// ??? May be swap? + FFldFieldNameIdx := FColumnsMetaInfo.Fields.IndexOf(FColumnsMetaInfo.FieldByName('DBCOLUMN_IDNAME')); + FFldActualFieldNameIdx := FColumnsMetaInfo.Fields.IndexOf(FColumnsMetaInfo.FieldByName('DBCOLUMN_NAME')); + + FFldColumnNumberIdx := FColumnsMetaInfo.Fields.IndexOf(FColumnsMetaInfo.FieldByName('DBCOLUMN_NUMBER')); + + FFldIsAutoIncIdx := FColumnsMetaInfo.Fields.IndexOf(FColumnsMetaInfo.FindField('DBCOLUMN_ISAUTOINCREMENT')); // SQL Everywhere + FFldTypeIdx := FColumnsMetaInfo.Fields.IndexOf(FColumnsMetaInfo.FieldByName('DBCOLUMN_TYPE')); + FFldFlagsIdx := FColumnsMetaInfo.Fields.IndexOf(FColumnsMetaInfo.FieldByName('DBCOLUMN_FLAGS')); + FFldColumnSizeIdx := FColumnsMetaInfo.Fields.IndexOf(FColumnsMetaInfo.FieldByName('DBCOLUMN_COLUMNSIZE')); + FFldComputeModeIdx := FColumnsMetaInfo.Fields.IndexOf(FColumnsMetaInfo.FindField('DBCOLUMN_COMPUTEMODE')); + + // xml schema support + FFldXMLSchemaCollCatalogNameIdx := FColumnsMetaInfo.Fields.IndexOf(FColumnsMetaInfo.FindField('DBCOLUMN_XML_SCHEMACOLLECTION_CATALOGNAME')); + FFldXMLSchemaCollSchemaNameIdx := FColumnsMetaInfo.Fields.IndexOf(FColumnsMetaInfo.FindField('DBCOLUMN_XML_SCHEMACOLLECTION_SCHEMANAME')); + FFldXMLSchemaCollNameIdx := FColumnsMetaInfo.Fields.IndexOf(FColumnsMetaInfo.FindField('DBCOLUMN_XML_SCHEMACOLLECTIONNAME')); + end; + + end; + + procedure FillTablesAliases; + var + Parser: TMSParser; + TableName: string;// Table or view name + StLex, Alias: string; + CodeLexem: integer; + TableInfo: TCRTableInfo; + begin + TablesInfo.BeginUpdate; + Parser := TMSParser.Create(FCommand.SQL); + Parser.OmitBlank := False; + Parser.OmitComment := True; + try + if Parser.ToLexem(lxSELECT) <> lcEnd then + if Parser.ToLexem(lxFROM) <> lcEnd then + repeat + repeat + CodeLexem := Parser.GetNext(StLex);// Omit blank + until CodeLexem <> lcBlank; + + // TableName + TableName := StLex; + while True do begin + CodeLexem := Parser.GetNext(StLex); + + if (Length(StLex) > 0) and (StLex[1] = ',') then + Break; + + if {(Length(StLex) > 0) and (StLex[1] in ['[, ' + '], ' + '", ' + '.']) and} (CodeLexem <> 0) and (CodeLexem <> lcBlank) then + TableName := TableName + StLex + else + Break; + end; + + // 'AS' clause + if Parser.GetNext(Alias) = lxAS then + Parser.GetNext(Alias) + else + Parser.Back; + + // Alias + if Parser.GetNext(Alias) = lcIdent then + Parser.GetNext(StLex) + else begin + Alias := ''; + Parser.Back; + end; + + TableName := UnBracketIfPossible(TableName); + Assert(TableName <> '', 'TableName cannot be empty'); // ++++ + + TableInfo := TablesInfo.FindByName(TableName); + if TableInfo = nil then begin + TableInfo := TablesInfo.Add; + TableInfo.TableName := TableName; + TableInfo.TableAlias := ''; + TableInfo.IsView := True; + end; + + if Alias <> '' then + TableInfo.TableAlias := TableInfo.NormalizeName(Alias); + until (StLex <> ','); + finally + Parser.Free; + TablesInfo.EndUpdate; + end; + end; + + function GetStrValue(Idx: integer): string; + var + Field: TOLEDBFieldDesc; + begin + if ColumnsMetaInfo.GetNull(Idx + 1, RecBuf) then + Result := '' + else + begin + Field := TOLEDBFieldDesc(ColumnsMetaInfo.Fields[Idx]); + if (Field.SubDataType and dtWide) = 0 then + Result := Marshal.PtrToStringAnsi(IntPtr(Integer(RecBuf) + Field.Offset)) + else + Result := Marshal.PtrToStringUni(IntPtr(Integer(RecBuf) + Field.Offset)); + end; + end; + + function GetWordValue(Idx: integer): Word; + begin + if ColumnsMetaInfo.GetNull(Idx + 1, RecBuf) then + Result := 0 + else + Result := Word(Marshal.ReadInt16(RecBuf, ColumnsMetaInfo.Fields[Idx].Offset)); + end; + + function GetLongWordValue(Idx: integer): Word; + begin + if ColumnsMetaInfo.GetNull(Idx + 1, RecBuf) then + Result := 0 + else + Result := LongWord(Marshal.ReadInt32(RecBuf, ColumnsMetaInfo.Fields[Idx].Offset)); + end; + + function GetUINTValue(Idx: integer): UINT; + begin + if ColumnsMetaInfo.GetNull(Idx + 1, RecBuf) then + Result := 0 + else + Result := UINT(Marshal.ReadInt32(RecBuf, ColumnsMetaInfo.Fields[Idx].Offset)); + end; + + function GetSmallIntValue(Idx: integer): SmallInt; + begin + if ColumnsMetaInfo.GetNull(Idx + 1, RecBuf) then + Result := 0 + else + Result := SmallInt(Marshal.ReadInt16(RecBuf, ColumnsMetaInfo.Fields[Idx].Offset)); + end; + + var + ColumnsRowset: IColumnsRowset; + CMIRowset: IRowset; + + Field, BookmarkField: TOLEDBFieldDesc; + FieldNo: integer; + TableName: string; + + FieldName, ActualFieldName: string; + iu: IUnknown; + FldGuidValue: string; + + TableInfo: TCRTableInfo; + IsAutoIncrement: boolean; + + ColumnsRecordSet: TOLEDBRecordSet; + Value: variant; + begin + if IUnk = nil then + Exit; // This query does not return rowset + + Assert (FRequestSQLObjects and FNativeRowset); + + QueryIntf(IUnk, {$IFDEF CLR}IColumnsRowset{$ELSE}IID_IColumnsRowset{$ENDIF}, ColumnsRowset); + Check(ColumnsRowset.GetColumnsRowset(nil, 0, nil, IID_IRowset, 0, nil, iu));{Default properties - default result set} + CMIRowset := IRowset(iu); + Assert(CMIRowset <> nil); + try + FBookmarkOffset := - 2; + BookmarkField := nil; + CheckColumnsMetaInfo; + + ColumnsMetaInfo.SetIRowset(CMIRowset, True); + //ColumnsMetaInfo.Prepare; + ColumnsMetaInfo.Open; + + RecBuf := nil; + try + CheckColumnsMetaInfoIdx; + + ColumnsMetaInfo.AllocRecBuf(IntPtr(RecBuf)); + + while True do begin + ColumnsMetaInfo.GetNextRecord(RecBuf); + if ColumnsMetaInfo.Eof then + Break; + + FieldNo := GetLongWordValue(FCommand.FConnection.FFldColumnNumberIdx); + Assert(FieldNo >= 0); // Bookmark column have FieldNo = 0 + + Field := TOLEDBFieldDesc.Create; + try + { + SELECT BaseColumnName AS ColumnAlias ... + + FIConnection.ProviderVer = [07.01.0623, 07.01.0690, 07.01.0819, 07.01.0961] + FieldName = BaseColumnName + ActualName = ColumnAlias + BaseColumnName = BaseColumnName + + FIConnection.ProviderVer = [08.00.0194, 08.00.0528, 08.10.7430, 08.10.9001] + FieldName = ColumnAlias + ActualName = ColumnAlias + BaseColumnName = BaseColumnName + } + + ActualFieldName := GetStrValue(FCommand.FConnection.FFldActualFieldNameIdx); + if (ProviderPrimaryVer < 8) and not IsWindowsVista then + FieldName := ActualFieldName + else + FieldName := GetStrValue(FCommand.FConnection.FFldFieldNameIdx); + + IsAutoIncrement := False; + if FCommand.FConnection.FFldIsAutoIncIdx <> - 1 then + IsAutoIncrement := WordBool(GetWordValue(FCommand.FConnection.FFldIsAutoIncIdx)); + + if ConvertDBCOLUMNINFOToFieldDesc( + // prgInfoEl + FieldName, + ActualFieldName, + FieldNo, + GetWordValue(FCommand.FConnection.FFldTypeIdx), + GetUINTValue(FCommand.FConnection.FFldFlagsIdx), + IsAutoIncrement, + GetWordValue(FCommand.FConnection.FFldPrecisionIdx), + GetSmallIntValue(FCommand.FConnection.FFldScaleIdx), + GetUINTValue(FCommand.FConnection.FFldColumnSizeIdx), + + // Options + FLongStrings, Field) then begin + + Field.FOLEDBType := GetWordValue(FCommand.FConnection.FFldTypeIdx); + if FCommand.FConnection.FFldCatalogNameIdx <> -1 then + Field.FBaseCatalogName := GetStrValue(FCommand.FConnection.FFldCatalogNameIdx); + if FCommand.FConnection.FFldSchemaNameIdx <> -1 then + Field.FBaseSchemaName := GetStrValue(FCommand.FConnection.FFldSchemaNameIdx); + Field.FBaseTableName := GetStrValue(FCommand.FConnection.FFldTableNameIdx); + Field.FBaseColumnName := GetStrValue(FCommand.FConnection.FFldColumnNameIdx); + + if FCommand.FConnection.FFldXMLSchemaCollCatalogNameIdx <> -1 then + Field.FXMLSchemaCollectionCatalogName := GetStrValue(FCommand.FConnection.FFldXMLSchemaCollCatalogNameIdx); + if FCommand.FConnection.FFldXMLSchemaCollSchemaNameIdx <> -1 then + Field.FXMLSchemaCollectionSchemaName := GetStrValue(FCommand.FConnection.FFldXMLSchemaCollSchemaNameIdx); + if FCommand.FConnection.FFldXMLSchemaCollNameIdx <> -1 then + Field.FXMLSchemaCollectionName := GetStrValue(FCommand.FConnection.FFldXMLSchemaCollNameIdx); + Field.FXMLTyped := (Field.XMLSchemaCollectionCatalogName <> '') or (Field.XMLSchemaCollectionSchemaName <> '') or + (Field.FXMLSchemaCollectionName <> ''); + + Field.ReadOnly := Field.ReadOnly or (Field.FBaseColumnName = ''); + + if FCommand.FConnection.FFldComputeModeIdx <> -1 then + Field.ReadOnly := Field.ReadOnly or (GetUINTValue(FCommand.FConnection.FFldComputeModeIdx) <> DBCOMPUTEMODE_NOTCOMPUTED); + + if (not FUniqueRecords) or (FCursorType in ServerCursorTypes) then // Hide implicitly requested columns + if (ProviderPrimaryVer >= 8) or IsWindowsVista then begin + FldGuidValue := LowerCase(GetStrValue(FCommand.FConnection.FFldGuidIdx)); + Field.Hidden := (FldGuidValue <> '') and (FldGuidValue <> '{' + LowerCase(IntToHex(FieldNo, 8))+'-0000-0000-0000-000000000000' + '}') + end + else + Field.Hidden := not ColumnsMetaInfo.GetNull(FCommand.FConnection.FFldGuidIdx + 1, RecBuf); + + // Fill TablesInfo structure + TableName := GenerateTableName(Field.BaseCatalogName, Field.BaseSchemaName, Field.BaseTableName, Database); + if TableName <> '' then begin + TableInfo := TablesInfo.FindByName(TableName); + TablesInfo.BeginUpdate; + try + if TableInfo = nil then begin + TableInfo := TablesInfo.Add; + TableInfo.TableName := TableName; + TableInfo.TableAlias := ''; + end; + finally + TablesInfo.EndUpdate; + end; + Field.TableInfo := TableInfo; + end + else + Field.TableInfo := nil; + + if FieldNo > 0 then + FFields.Add(Field) + else // Bookmark column have FieldNo = 0 + begin + Field.Hidden := True; + BookmarkField := Field; + FBookmarkOffset := - 1; + end; + + end + else + if FNativeRowset then + DatabaseErrorFmt(SBadFieldType, [FieldName, GetWordValue(FCommand.FConnection.FFldTypeIdx)]) + else + Field.Free; + except + Field.Free; + BookmarkField.Free; + raise; + end; + end; + + if BookmarkField <> nil then + FFields.Add(BookmarkField); + + if (Provider = prCompact) and (not FPopulatingKeyInfo) and (FUniqueRecords or not FReadOnly) then begin + if TablesInfo.Count > 0 then begin + TableInfo := TablesInfo[0]; + ColumnsRecordSet := TOLEDBRecordSet.Create; + FPopulatingKeyInfo := True; + try + ColumnsRecordSet.SetConnection(FCommand.FConnection); + ColumnsRecordSet.SetSQL(Format( + 'SELECT' + LineSeparator + + ' A.COLUMN_NAME, B.AUTOINC_INCREMENT' + LineSeparator + + 'FROM' + LineSeparator + + ' INFORMATION_SCHEMA.KEY_COLUMN_USAGE A, INFORMATION_SCHEMA.COLUMNS B' + LineSeparator + + 'WHERE' + LineSeparator + + ' A.TABLE_NAME = B.TABLE_NAME and A.COLUMN_NAME = B.COLUMN_NAME and A.TABLE_NAME = %s', [QuotedStr(TableInfo.TableName)])); + ColumnsRecordSet.Open; + if RecBuf <> nil then + ColumnsMetaInfo.FreeRecBuf(RecBuf); + ColumnsRecordSet.AllocRecBuf(RecBuf); + while True do begin + ColumnsRecordSet.GetNextRecord(RecBuf); + if ColumnsRecordSet.Eof then + Break; + if not ColumnsRecordSet.GetNull(ColumnsRecordSet.FieldByName('COLUMN_NAME').FieldNo, RecBuf) then begin + ColumnsRecordSet.GetFieldAsVariant(ColumnsRecordSet.FieldByName('COLUMN_NAME').FieldNo, RecBuf, Value); + Field := TOLEDBFieldDesc(FFields.FindField(String(Value))); + if Field <> nil then begin + Field.IsKey := True; + Field.FIsAutoIncrement := not ColumnsRecordSet.GetNull(ColumnsRecordSet.FieldByName('AUTOINC_INCREMENT').FieldNo, RecBuf); + if FNativeRowset and not (FCursorType in ServerCursorTypes) then + Field.ReadOnly := Field.FIsTimestamp or Field.IsAutoIncrement; + end; + end; + end; + finally + ColumnsRecordSet.FreeRecBuf(RecBuf); + RecBuf := nil; + ColumnsRecordSet.Close; + ColumnsRecordSet.Free; + FPopulatingKeyInfo := False; + end; + end; + end; + + finally + if RecBuf <> nil then + ColumnsMetaInfo.FreeRecBuf(RecBuf); + if ColumnsMetaInfo <> nil then begin + ColumnsMetaInfo.Close; + ColumnsMetaInfo.UnPrepare; + end; + if IsLibrary then + FreeAndNil(FCommand.FConnection.FColumnsMetaInfo); + end; + finally + {$IFDEF CLR} + if CMIRowset <> nil then + Marshal.ReleaseComObject(CMIRowset); + {$ENDIF} + end; + Assert(not (FCursorType in [ctStatic, ctKeySet]) or (FBookmarkOffset <> - 2)); + + TablesInfo.Normalize; + FillTablesAliases; + // For + // SELECT FieldName FieldAlias FROM TableName TableAlias + // must be + // Field.Name = 'FieldAlias' + // Field.ActualName = 'FieldAlias' + // Field.TableName = '' ??? + // Field.BaseColumnName = 'c_int' + // Field.BaseTableName = 'ALL_TYPES' + + end; + {$ENDIF} + + var + Connection: TOLEDBConnection; + + begin + if ByInfo then begin + if FNativeRowset or not FIsColumnsRowset then + CreateFieldDescsByInfo + else + begin + // Detect true connection + Connection := FCommand.FConnection; + + if Connection.FColumnsRowsetFieldDescs <> nil then + Connection.AssignFieldDescs(Connection.FColumnsRowsetFieldDescs, FFields) + else + begin + CreateFieldDescsByInfo; + Connection.FColumnsRowsetFieldDescs := TFieldDescs.Create; + try + try + Connection.AssignFieldDescs(FFields, Connection.FColumnsRowsetFieldDescs) // Save fields for columnsrowset + except + FreeAndNil(Connection.FColumnsRowsetFieldDescs); + raise; + end; + finally + if IsLibrary then + FreeAndNil(Connection.FColumnsRowsetFieldDescs); + end; + end; + end; + end + else + {$IFNDEF LITE} + CreateFieldDescsByRowset; + {$ELSE} + Assert(False); + {$ENDIF} + end; + +begin + inherited; // Empty proc call + + if not FNativeRowset then + CommandType := ctCursor; + + if CommandType = ctUnknown then begin // This is a FieldDefs.Update call + + QueryCommandInterfaces(False); + try + SetCommandProp; + FCommand.Execute; + finally + ReleaseCommandInterfaces; /// FCommand.QueryIntCnt counter is increased in inherited + end; + CreateFieldDescs(FCommand.FIUnknown, not FRequestSQLObjects); + + // Free interfaces + {$IFDEF CLR} + if FCommand.FIMultipleResults <> nil then + Marshal.ReleaseComObject(FCommand.FIMultipleResults); + if FCommand.FIUnknown <> nil then + Marshal.ReleaseComObject(FCommand.FIUnknown); + {$ENDIF} + FCommand.FIUnknown := nil; + FCommand.ClearIMultipleResults; + + // Free param accessors (must be after clearing interfaces) + RequestParamsIfPossible; + + // We does not need to process non-Native rowsets or ServerCursors + // QueryRecordSetInterfaces not required too + Exit; + end; + + if not FNativeRowset then + CreateFieldDescs(FIRowset, True) + else + begin + Assert(FIRowset = nil); + if Prepared and not FCommand.FRPCCall then + CreateFieldDescs(FCommand.FICommandPrepare, not FRequestSQLObjects) + else + CreateFieldDescs(FCommand.FIUnknown, not FRequestSQLObjects); + end; +end; + +procedure TOLEDBRecordSet.AllocFetchBlock; +var + UseIRowsetUpdate: boolean; + + function AddFieldToABList(const FieldNum: integer): integer; // Add new AB, if need. If AB already present then return its index + function AddAB(const BlockType: TAccessorBlockType): integer; + var + l: integer; + begin + l := Length(FFetchAccessorData.AccessorBlocks); + SetLength(FFetchAccessorData.AccessorBlocks, l + 1); + + FFetchAccessorData.AccessorBlocks[l].BlockType := BlockType; + FFetchAccessorData.AccessorBlocks[l].hAcc := 0; + FFetchAccessorData.AccessorBlocks[l].BlobFieldNum := -1; + + Result := l; + end; + + var + BlockType: TAccessorBlockType; + FieldDesc: TOLEDBFieldDesc; + i: integer; + IsLarge: boolean; + IsDBNumeric: boolean; + begin + Result := -1; + try + FieldDesc := Fields[FieldNum] as TOLEDBFieldDesc; + IsLarge := IsLargeDataTypeUsed(FieldDesc); + IsDBNumeric := (ProviderPrimaryVer = 3) and (FieldDesc.OLEDBType = DBTYPE_NUMERIC); + if IsNeedFetchBlock(FieldDesc, ProviderPrimaryVer) then + BlockType := abFetchBlock // This is a string by ref - long string conversion used + else + if FieldDesc.ReadOnly and UseIRowsetUpdate then + BlockType := abReadOnly + else + if IsLarge and UseIRowsetUpdate then + BlockType := abBLOB + else + BlockType := abOrdinary; + + if not (FCursorType in [ctKeySet, ctDynamic]) // CR 4082 + and (BlockType <> abBLOB) then + for i := 0 to Length(FFetchAccessorData.AccessorBlocks) - 1 do + if FFetchAccessorData.AccessorBlocks[i].BlockType = BlockType then begin + // Test BLOB fields + if IsLarge then begin + if FFetchAccessorData.AccessorBlocks[i].BlobFieldNum = - 1 then + FFetchAccessorData.AccessorBlocks[i].BlobFieldNum := FieldNum + else + begin + BlockType := abBLOB; + Result := AddAB(BlockType); + FFetchAccessorData.AccessorBlocks[Result].BlobFieldNum := FieldNum; + Exit; + end; + end; + // Test numeric fields in Everywhere + if IsDBNumeric then begin + Result := AddAB(BlockType); + Exit; + end; + + Result := i; + Exit; + end; + + // Accessor block not found! Create new + Result := AddAB(BlockType); + if IsLarge then + FFetchAccessorData.AccessorBlocks[Result].BlobFieldNum := FieldNum; + finally + Assert(Result <> - 1); + + i := Length(FFetchAccessorData.AccessorBlocks[Result].FieldNums); + SetLength(FFetchAccessorData.AccessorBlocks[Result].FieldNums, i + 1); + FFetchAccessorData.AccessorBlocks[Result].FieldNums[i] := FieldNum; + end; + + end; + + // Fill internal structures in accessor block + procedure FillBindingStructInAccBlock( + rgBindings: TDBBindingArray; + var AccessorBlock: TAccessorBlock); + var + Cnt, i, l: integer; + FieldNum: integer; + Field: TFieldDesc; + + Obj: OLEDBIntf.DBOBJECT; + begin + Cnt := Length(AccessorBlock.FieldNums); + Assert(Cnt > 0); + //OFS('+FillBindingStructInAccBlock'); + for i := 0 to Cnt - 1 do + with rgBindings[i] do begin + FieldNum := AccessorBlock.FieldNums[i]; + Field := FFields[FieldNum]; + iOrdinal := Field.FieldNo; + + obValue := Field.Offset; + obLength := 0; + obStatus := DataSize + FieldNum * OLE_DB_INDICATOR_SIZE; + + dwPart := DBPART_VALUE or DBPART_STATUS; + dwMemOwner := DBMEMOWNER_CLIENTOWNED; + eParamIO := DBPARAMIO_NOTPARAM; + cbMaxLen := Field.Size; + + if (FCursorType in [ctStatic, ctKeyset]) and (iOrdinal = 0) then + dwFlags := DBCOLUMNFLAGS_ISBOOKMARK + else + dwFlags := 0; + + wType := ConvertInternalTypeToOLEDB(Field.dataType, False, DBMSPrimaryVer); + if (DBMSPrimaryVer = 3) then begin + if (TOLEDBFieldDesc(Field).OLEDBType = DBTYPE_R4) then + wType := DBTYPE_R4; + if (TOLEDBFieldDesc(Field).OLEDBType = DBTYPE_UI1) then begin + wType := DBTYPE_UI1; + cbMaxLen := SizeOf(Word); + end; + if (TOLEDBFieldDesc(Field).OLEDBType = DBTYPE_NUMERIC) then begin + wType := DBTYPE_NUMERIC; + cbMaxLen := SizeOfTDBNumeric; + end; + end; + + if not IsLargeDataTypeUsed(Field) then begin //??? + case Field.DataType of + dtExtString, dtExtWideString: + begin + if Field.DataType = dtExtString then + l := 1 + else + if Field.DataType = dtExtWideString then + l := 2 + else + begin + l := 0; + Assert(False); + end; + + Assert(AccessorBlock.BlockType = abFetchBlock); + dwPart := DBPART_VALUE or DBPART_STATUS or DBPART_LENGTH; + cbMaxLen := MaxNonBlobFieldLen + l; + obStatus := FFetchBlockSize; + obLength := obStatus + OLE_DB_INDICATOR_SIZE; + obValue := obLength + 4; + IncFetchBlockOffset(FFetchBlockSize, Field.DataType); + end; + dtMemo, dtWideMemo, dtMSXML: // Long string conversion used + begin + Assert(AccessorBlock.BlockType = abFetchBlock); + if (Field.SubDataType and dtWide) = 0 then begin + wType := DBTYPE_STR; + l := 1; + end + else + begin + wType := DBTYPE_WSTR; + l := 2; + end; + cbMaxLen := MaxNonBlobFieldLen + l; + obStatus := FFetchBlockSize; + obValue := obStatus + OLE_DB_INDICATOR_SIZE; + IncFetchBlockOffset(FFetchBlockSize, dtMemo); + end; + dtVariant: + begin + Assert(AccessorBlock.BlockType = abFetchBlock); + wType := DBTYPE_VARIANT; + cbMaxLen := sizeof(OleVariant); + obStatus := FFetchBlockSize; + obValue := obStatus + OLE_DB_INDICATOR_SIZE; + IncFetchBlockOffset(FFetchBlockSize, dtVariant); + end; + dtBytes: + if not FReadOnly then begin + dwPart := DBPART_VALUE or DBPART_STATUS or DBPART_LENGTH; + obValue := Field.Offset; + obLength := obValue + Field.Length; + cbMaxLen := Field.Length; + end; + dtVarBytes: + begin + dwPart := DBPART_VALUE or DBPART_STATUS or DBPART_LENGTH; + obValue := Field.Offset + sizeof(word); + obLength := obValue + Field.Length; + cbMaxLen := Field.Length; + end; + dtExtVarBytes: + begin + Assert(AccessorBlock.BlockType = abFetchBlock); + + cbMaxLen := MaxNonBlobFieldLen; // WAR on changing must change FetchExternalAccessorBlock FetchExternalAccessorBlock + dwPart := DBPART_VALUE or DBPART_STATUS or DBPART_LENGTH; + obStatus := FFetchBlockSize; + obValue := obStatus + OLE_DB_INDICATOR_SIZE; + obLength := obValue + cbMaxLen; + IncFetchBlockOffset(FFetchBlockSize, Field.DataType); + end; + dtFloat, dtBcd: + if (DBMSPrimaryVer = 3) and (TOLEDBFieldDesc(Field).OLEDBType = DBTYPE_NUMERIC) then begin + Assert(AccessorBlock.BlockType = abFetchBlock); + wType := DBTYPE_NUMERIC; + cbMaxLen := SizeOfTDBNumeric; + obStatus := FFetchBlockSize; + obValue := obStatus + OLE_DB_INDICATOR_SIZE; + IncFetchBlockOffset(FFetchBlockSize, Field.DataType); + end; + end; + end + else + begin + Assert(Field.DataType in [dtMemo, dtWideMemo, dtBlob, dtMSXML], 'Non-compartible values of Field.DataType and IsStreamUsed'); + + Obj.iid := IID_ISequentialStream; + Obj.dwFlags := STGM_READ; + l := sizeof(DBOBJECT); + pObject := Marshal.AllocHGlobal(l); + {$IFDEF CLR} + Marshal.StructureToPtr(TObject(Obj), pObject, False); + {$ELSE} + DBOBJECT(pObject^) := Obj; + {$ENDIF} + + if not FReadOnly then begin + dwPart := DBPART_VALUE or DBPART_STATUS or DBPART_LENGTH; + obLength := obValue + sizeof(IntPtr); + end; + + end; + + if wType in [DBTYPE_NUMERIC, DBTYPE_VARNUMERIC] then begin + bPrecision := Field.Length; + bScale := Field.Scale; + end; + + {OFS('---'); + OFS('Field.Name = ' + Field.Name); + OFS('iOrdinal = ' + IntToStr(iOrdinal)); + OFS('obValue = ' + IntToStr(obValue)); + OFS('obLength = ' + IntToStr(obLength)); + OFS('obStatus = ' + IntToStr(obStatus)); + OFS('pTypeInfo = ' + IntToStr(Integer(pTypeInfo))); + //OFS('pObject = ' + IntToStr(Integer(pObject))); + OFS('pBindExt = ' + IntToStr(Integer(pBindExt))); + OFS('dwPart = ' + IntToStr(Integer(dwPart))); + //dwMemOwner: DBMEMOWNER; + //eParamIO: DBPARAMIO; + OFS('cbMaxLen = ' + IntToStr(cbMaxLen)); + OFS('dwFlags = ' + IntToStr(dwFlags)); + OFS('wType = ' + IntToStr(Integer(wType))); + OFS('bPrecision = ' + IntToStr(bPrecision)); + OFS('bScale = ' + IntToStr(bScale));} + end; + //OFS('-FillBindingStructInAccBlock'); + end; + +var + i, j: integer; + + rgStatus: PUINT; + rgBindings: TDBBindingArray; +{$IFDEF CLR} + rgBindingsGC: GCHandle; +{$ENDIF} + hr: HResult; + + FieldCntAB: integer; + +begin + rgStatus := nil; + + FFetchBlock := nil; + FFetchBlockSize := 0; + UseIRowsetUpdate := (FCursorType in [ctKeyset, ctDynamic]) and FCursorUpdate; + + QueryIntf(FIRowset, {$IFDEF CLR}IAccessor{$ELSE}IID_IAccessor{$ENDIF}, FFetchAccessorData.Accessor); + + // Separate fields to AccessorBlocks + for i := 0 to Fields.Count - 1 do + if Fields[i].FieldDescKind = fdkData then + AddFieldToABList(i); + + // CreateAccessors + for i := 0 to Length(FFetchAccessorData.AccessorBlocks) - 1 do begin + FieldCntAB := Length(FFetchAccessorData.AccessorBlocks[i].FieldNums); + try + rgStatus := Marshal.AllocHGlobal(FieldCntAB * SizeOf(UINT)); + SetLength(rgBindings, FieldCntAB); + + for j := 0 to FieldCntAB - 1 do + with rgBindings[j] do begin + {$IFDEF CLR} + if pTypeInfo <> nil then + Marshal.Release(pTypeInfo); + {$ELSE} + pTypeInfo := nil; + {$ENDIF} + pObject := nil; + pBindExt := nil; + end; + + FillBindingStructInAccBlock(rgBindings, FFetchAccessorData.AccessorBlocks[i]); + + // Create accessor + {$IFDEF CLR} + rgBindingsGC := GCHandle.Alloc(rgBindings, GCHandleType.Pinned); + try + hr := FFetchAccessorData.Accessor.CreateAccessor(DBACCESSOR_ROWDATA, FieldCntAB, Marshal.UnsafeAddrOfPinnedArrayElement(rgBindings, 0), 0, FFetchAccessorData.AccessorBlocks[i].hAcc, rgStatus); + finally + rgBindingsGC.Free; + end; + {$ELSE} + hr := FFetchAccessorData.Accessor.CreateAccessor(DBACCESSOR_ROWDATA, FieldCntAB, rgBindings, 0, FFetchAccessorData.AccessorBlocks[i].hAcc, rgStatus); + {$ENDIF} + Check(hr); + finally + if Length(rgBindings) <> 0 then begin + for j := 0 to FieldCntAB - 1 do + if rgBindings[j].pObject <> nil then + Marshal.FreeHGlobal(rgBindings[j].pObject); + SetLength(rgBindings, 0); + end; + if rgStatus <> nil then begin + Marshal.FreeHGlobal(rgStatus); + rgStatus := nil; + end; + end; + end; + + if FFetchBlockSize <> 0 then + FFetchBlock := Marshal.AllocHGlobal(FFetchBlockSize); +end; + +procedure TOLEDBRecordSet.FreeFetchBlock; +var + AccNum: integer; +begin + if FFetchAccessorData.Accessor = nil then + Exit; + + with FFetchAccessorData do begin + for AccNum := 0 to Length(AccessorBlocks) - 1 do + Check(Accessor.ReleaseAccessor(AccessorBlocks[AccNum].hAcc, nil)); + {$IFDEF CLR} + Marshal.ReleaseComObject(Accessor); + {$ENDIF} + Accessor := nil; + SetLength(AccessorBlocks, 0); + end; + + if FFetchBlock <> nil then + Marshal.FreeHGlobal(FFetchBlock); +end; + +function TOLEDBRecordSet.Fetch(FetchBack: boolean = False): boolean; +var + OldFetchFromBookmark: boolean; + + procedure GetDataFromRow(const Row: hRow; const pRec: IntPtr); + procedure PrepareConvertableFields; // After get data from OLEDB + var + i: integer; + pValue: IntPtr; + + OleDbBuf: IntPtr; + Field: TOLEDBFieldDesc; + + {$IFDEF VER6P} + {$IFOPT C+} + FieldStatus: DWORD; + {$ENDIF} + {$IFDEF CLR} + BcdOut: TBcd; + g: TGuid; + p: IntPtr; + j: integer; + BcdBuf: TBytes; + s: string; + DBNum: TDBNumeric; + Data: TBytes; + {$ELSE} + FieldLength, FieldScale: word; + {$IFDEF VER9} + Delta: word; + {$ENDIF} + {$ENDIF} + Bcd: TBcd; + {$ENDIF} + DBTimeStamp: TDBTimeStamp; + dt: TDateTime; + d: double; + CurrTimestamp: Int64; + begin + for i := 0 to Fields.Count - 1 do begin + Field := TOLEDBFieldDesc(Fields[i]); + if Field.FieldDescKind <> fdkData then + SetNull(i + 1, pRec, True) + else + begin + pValue := IntPtr(Integer(pRec) + Field.Offset); + + // Get max Timestamp value for RefreshQuick + if Field.IsTimestamp and (Field.TableInfo <> nil) then begin + {$IFDEF CLR} + SetLength(Data, SizeOf(Int64)); + Marshal.Copy(pValue, Data, 0, SizeOf(Int64)); + System.Array.Reverse(Data, 0, SizeOf(Int64)); + CurrTimestamp := BitConverter.ToInt64(Data, 0); + {$ELSE} + CurrTimestamp := Marshal.ReadInt64(pValue); + Reverse8(@CurrTimestamp); + {$ENDIF} + if {$IFDEF VER7P}UInt64{$ENDIF}(TOLEDBTableInfo(Field.TableInfo).FMaxTimestamp) < {$IFDEF VER7P}UInt64{$ENDIF}(CurrTimestamp) then + TOLEDBTableInfo(Field.TableInfo).FMaxTimestamp := CurrTimestamp; + end; + + OleDbBuf := nil; + try + case Field.DataType of + dtVarBytes: + Marshal.WriteInt16(pValue, SmallInt(UINT(Marshal.ReadInt32(pValue, sizeof(word) + Field.Length)))); + {$IFDEF VER6P} + dtFmtBCD: + if not GetNull(i + 1, pRec) then begin + {$IFOPT C+} + FieldStatus := GetStatus(i, pRec); + Assert(FieldStatus = DBSTATUS_S_OK, Field.Name + ': FieldStatus = $' + IntToHex(FieldStatus, 8){ + ', Value = ' + Marshal.PtrToStringAnsi(pValue)}); + {$ENDIF} + {$IFDEF CLR} + DBNum := TDBNumeric(Marshal.PtrToStructure(pValue, TypeOf(TDBNumeric))); + Bcd := DBNumericToBCD(DBNum); + NormalizeBcd(Bcd, BcdOut, Field.Length, Field.Scale); + + // Copied from TBcd.ToBytes + SetLength(BcdBuf, 34); + BcdBuf[0] := BcdOut.Precision; + BcdBuf[1] := BcdOut.SignSpecialPlaces; + for j := 0 to 31 do + BcdBuf[j + 2] := BcdOut.Fraction[j]; + Marshal.Copy(BcdBuf, 0, pValue, 34); + {$ELSE} + Bcd := DBNumericToBCD(TDBNumeric(pValue^)); + + FieldLength := Field.Length; + FieldScale := Field.Scale; + {$IFDEF VER9} // Delphi 9 NormalizeBcd Bug + Delta := FieldLength - FieldScale; + if Delta > 34 then begin + Delta := 34; + FieldLength := FieldScale + Delta; + end; + {$ENDIF} + NormalizeBcd(Bcd, PBcd(pValue)^, FieldLength, FieldScale); + {$ENDIF} + end; + {$ENDIF} + {$IFDEF VER5P} + dtGuid: + if not GetNull(i + 1, pRec) then + {$IFDEF CLR} + begin + g := TGUID(Marshal.PtrToStructure(pValue, TypeOf(TGUID))); + s := '{' + GUIDToString(g) + '}'; + p := Marshal.StringToHGlobalAnsi(s); + try + StrLCopy(pValue, p, 38); + finally + Marshal.FreeHGlobal(p); + end; + end; + {$ELSE} + StrLCopy(pValue, @GUIDToString(PGUID(pValue)^)[1], 38); + {$ENDIF} + {$ENDIF} + dtDateTime: + if (Provider = prCompact) and (not GetNull(i + 1, pRec)) then begin + {$IFDEF CLR} + DBTimeStamp := TDBTimeStamp(Marshal.PtrToStructure(pValue, TypeOf(TDBTimeStamp))); + {$ELSE} + DBTimeStamp := PDBTimeStamp(pValue)^; + {$ENDIF} + dt := {$IFNDEF CLR}MemUtils.{$ENDIF}EncodeDateTime(DBTimeStamp.year, DBTimeStamp.month, DBTimeStamp.day, DBTimeStamp.hour, DBTimeStamp.minute, DBTimeStamp.second, DBTimeStamp.fraction div 1000000{Billionths of a second to milliseconds}); + Marshal.WriteInt64(pValue, BitConverter.DoubleToInt64Bits(Double(dt))); + end; + dtCurrency: + if Provider = prCompact then begin + {$IFDEF CLR} + d := Marshal.ReadInt64(pValue); + d := d / 10000; + {$ELSE} + d := Currency(pValue^); + {$ENDIF} + Marshal.WriteInt64(pValue, BitConverter.DoubleToInt64Bits(d)); + end; + dtFloat: + if (not GetNull(i + 1, pRec)) and (Provider = prCompact) then begin + if (Field.SubDataType and dtSingle) <> 0 then begin + {$IFDEF CLR} + BcdBuf := BitConverter.GetBytes(Marshal.ReadInt64(pValue)); + d := BitConverter.ToSingle(BcdBuf, 0); + {$ELSE} + d := Single(pValue^); + {$ENDIF} + Marshal.WriteInt64(pValue, BitConverter.DoubleToInt64Bits(d)); + end + end; + dtWord: + if (not GetNull(i + 1, pRec)) and (Provider = prCompact) and ((Field.SubDataType and dtUInt8) <> 0) then + Marshal.WriteByte(IntPtr(Integer(pValue) + 1), 0); + end; + finally + if OleDbBuf <> nil then + FreeCoMem(OleDbBuf); + end; + end; + end; + end; + + procedure FetchPlainAccessorBlock(const AccessorBlock: TAccessorBlock); + var + hr: HResult; + Blob: TBlob; + Field: TFieldDesc; + pValue: IntPtr; + Length: integer; + + begin + // Get data from IRowset + hr := FIRowset.GetData(Row, AccessorBlock.hAcc, pRec); + CheckAndAnalyzeFieldsStatus(hr, pRec); + + // ConvertMemoToBlob; + if AccessorBlock.BlobFieldNum <> -1 then begin + Field := Fields[AccessorBlock.BlobFieldNum]; + pValue := IntPtr(Integer(pRec) + Field.Offset); + Length := Marshal.ReadInt32(pRec, Field.Offset + SizeOf(IntPtr)); + if FReadOnly then + Length := 0; + {$IFDEF HAVE_COMPRESS} + if Field.DataType = dtBlob then + Blob := TCompressedBlob.Create((Field.SubDataType and dtWide) <> 0) + else + {$ENDIF} + Blob := TBlob.Create((Field.SubDataType and dtWide) <> 0); + + try + if (GetStatus(AccessorBlock.BlobFieldNum, pRec) <> DBSTATUS_S_ISNULL) then // Can't use GetNull->GetNullByBlob + ConvertStreamToBlob(pValue, Length, Blob{$IFDEF HAVE_COMPRESS}, FCommand.FCompressBlob{$ENDIF}, + (Field is TOLEDBFieldDesc) and (TOLEDBFieldDesc(Field).OLEDBType = DBTYPE_XML)); + finally + Marshal.WriteInt32(pValue, Integer(Blob.GCHandle)); + end; + end; + end; + + var + FetchBlockOffset: integer; + + procedure FetchExternalAccessorBlock(const AccessorBlock: TAccessorBlock); + var + hr: HResult; + i, FieldNum: integer; + Status: DWORD; + Blob: TSharedObject; + pc: IntPtr; + pValue, pFetchBlockValue: IntPtr; + + Field: TFieldDesc; + l: integer; + + Size: word; + HeapBuf: IntPtr; + t: boolean; + DBNumeric: TDBNumeric; + d: double; + {$IFNDEF CLR} + c: currency; + {$ENDIF} + i64: Int64; + + begin + Assert(AccessorBlock.BlobFieldNum = - 1); + // Get data from IRowset + hr := FIRowset.GetData(Row, AccessorBlock.hAcc, FFetchBlock); + + // Copy status from external buf to pRec. Need to correct work CheckAndAnalyzeFieldsStatus + for i := 0 to Length(AccessorBlock.FieldNums) - 1 do begin + FieldNum := AccessorBlock.FieldNums[i]; + Field := Fields[FieldNum]; + if IsNeedFetchBlock(Field, ProviderPrimaryVer) and (Field.FieldDescKind = fdkData) then begin + Status := DWORD(Marshal.ReadInt32(FFetchBlock, FetchBlockOffset)); + SetStatus(FieldNum, pRec, Status); + + pFetchBlockValue := IntPtr(Integer(FFetchBlock) + FetchBlockOffset + OLE_DB_INDICATOR_SIZE); + pValue := IntPtr(Integer(pRec) + Field.Offset); + + case Field.DataType of + dtExtString, dtExtWideString: begin + if GetNull(FieldNum + 1, pRec) then + Marshal.WriteIntPtr(pValue, nil) + else + begin + if Field.Fixed then + t := TrimFixedChar + else + t := TrimVarChar; + l := Marshal.ReadInt32(pFetchBlockValue); + pFetchBlockValue := IntPtr(Integer(pFetchBlockValue) + 4); + if Field.DataType = dtExtString then + Marshal.WriteIntPtr(pValue, StringHeap.AllocStr(pFetchBlockValue, t, l)) + else + Marshal.WriteIntPtr(pValue, StringHeap.AllocWideStr(pFetchBlockValue, t, l div 2)); + end; + end; + dtExtVarBytes: + if GetNull(FieldNum + 1, pRec) then + Marshal.WriteIntPtr(pValue, nil) + else + begin + Size := UINT(Marshal.ReadInt32(pFetchBlockValue, MaxNonBlobFieldLen)); + HeapBuf := StringHeap.NewBuf(Size + sizeof(Word)); + CopyBuffer(pFetchBlockValue, IntPtr(Integer(HeapBuf) + sizeof(Word)), Size); + Marshal.WriteIntPtr(pValue, HeapBuf); + Marshal.WriteInt16(HeapBuf, SmallInt(Word(Size))); + end; + dtMemo, dtWideMemo, dtMSXML: begin + Blob := TBlob.Create((Field.SubDataType and dtWide) <> 0); + if Status <> DBSTATUS_S_ISNULL then begin + pc := pFetchBlockValue; + if TBlob(Blob).IsUnicode then + l := integer(StrLenW(pc)) * integer(sizeof(WideChar)) // D2005 CLR bug + else + l := StrLen(pc); + if l > 0 then begin + TBlob(Blob).Write(0, l, pc); + TBlobUtils.SetModified(TBlob(Blob), False); + end; + end; + Marshal.WriteInt32(pValue, Integer(Blob.GCHandle)); + end; + dtVariant: begin + Blob := TVariantObject.Create; + + TVariantObject(Blob).Value := GetOleVariant(pFetchBlockValue); + OleVarClear(pFetchBlockValue); + + Marshal.WriteInt32(pValue, Integer(Blob.GCHandle)); + end; + dtFloat, dtBcd: + if not GetNull(FieldNum + 1, pRec) then begin + {$IFDEF CLR} + DBNumeric := TDBNumeric(Marshal.PtrToStructure(pFetchBlockValue, TypeOf(TDBNumeric))); + {$ELSE} + DBNumeric := TDBNumeric(pFetchBlockValue^); + {$ENDIF} + d := DBNumericToDouble(DBNumeric); + if Field.DataType = dtFloat then + Marshal.WriteInt64(pValue, BitConverter.DoubleToInt64Bits(d)) + else begin + {$IFDEF CLR} + d := d * 10000; + i64 := Round(d); + {$ELSE} + c := d; + i64 := Int64((@c)^); + {$ENDIF} + Marshal.WriteInt64(pValue, i64); + end; + end; + else + Assert(False); + end; + IncFetchBlockOffset(FetchBlockOffset, Field.DataType); + Assert(FetchBlockOffset <= FFetchBlockSize); + + end; + end; + CheckAndAnalyzeFieldsStatus(hr, pRec); + end; + + var + AccNum: integer; + + begin + FetchBlockOffset := 0; + for AccNum := 0 to Length(FFetchAccessorData.AccessorBlocks) - 1 do + if FFetchAccessorData.AccessorBlocks[AccNum].BlockType = abFetchBlock then + FetchExternalAccessorBlock(FFetchAccessorData.AccessorBlocks[AccNum]) + else + FetchPlainAccessorBlock(FFetchAccessorData.AccessorBlocks[AccNum]); + + PrepareConvertableFields; + end; + + procedure CreateBlockStruct(const pHBlock: PBlockHeader; const RowsObtained: UINT); + var + pHItem: PItemHeader; + i: integer; + ui: UINT; + + begin + // Create Items + pHItem := IntPtr(Integer(pHBlock) + sizeof(TBlockHeader)); + if IntPtr(FirstItem) = nil then + FirstItem := pHItem; + + if IntPtr(LastItem) = nil then begin + LastItem := pHItem; + pHItem.Order := 0; + end; + + for i := 0 to RowsObtained - 1 do begin + pHItem.Prev := LastItem; + pHItem.Next := nil; + pHItem.Block := pHBlock; + pHItem.Flag := flUsed; + pHItem.Rollback := nil; + pHItem.Status := isUnmodified; + pHItem.UpdateResult := urNone; + pHItem.FilterResult := fsNotChecked; + + LastItem.Next := pHItem; + + if not (FCursorType in ServerCursorTypes) then + pHItem.Order := LastItem.Order + 1; + + LastItem := pHItem; + + UpdateCachedBuffer(pHItem, pHItem); + + pHItem := IntPtr(Integer(pHItem) + sizeof(TItemHeader) + RecordSize); + end; + + FirstItem.Prev := nil; + LastItem.Next := nil; + + case FCursorType of + ctDefaultResultSet: + if Filtered and not FFetchAll then + InitFetchedItems(IntPtr(Integer(pHBlock) + sizeof(TBlockHeader)), False, FetchBack) + else + Inc(FRecordCount, RowsObtained); + ctStatic, ctKeySet: + begin + if FBookmarkOffset = - 1 then + FBookmarkOffset := sizeof(TBlockHeader) + sizeof(TItemHeader) + Fields[Fields.Count - 1].Offset; + LastItem.Order := Marshal.ReadInt32(IntPtr(pHBlock), FBookmarkOffset); + FBookmarkValue := LastItem.Order; + end; + ctDynamic:; + end; + + // Free items + ui := UINT(FFetchRows) - RowsObtained; + if ui > 0 then + for i := 0 to ui - 1 do begin + pHItem.Prev := nil; + pHItem.Next := BlockMan.FirstFree; + pHItem.Block := pHBlock; + pHItem.Flag := flFree; + pHItem.Rollback := nil; + + if IntPtr(BlockMan.FirstFree) <> nil then + BlockMan.FirstFree.Prev := pHItem; + BlockMan.FirstFree := pHItem; + + pHItem := IntPtr(Integer(pHItem) + sizeof(TItemHeader) + RecordSize); + end; + + pHBlock.UsedItems := RowsObtained; + end; + + procedure InitBlock(pHBlock: PBlockHeader); + var + i, j: integer; + Ptr: IntPtr; + Field: TFieldDesc; + begin + if not HasComplexFields then + Exit; + + // Create complex filds + for i := 0 to FFetchRows - 1 do begin + Ptr := IntPtr(Integer(pHBlock) + sizeof(TBlockHeader) + i * (RecordSize + sizeof(TItemHeader)) + sizeof(TItemHeader)); + + /// We does not need to call CreateComplexFields(Ptr, True) because (in difference with ODAC) we fetch BLOB(IStream) IntPtrs directly to RecBuf + for j := 0 to FieldCount - 1 do begin + Field := Fields[j]; + if Field.FieldDescKind <> fdkCalculated then + case Field.DataType of + dtBlob, dtMemo, dtWideMemo, dtMSXML, dtVariant, dtExtString, dtExtWideString, dtExtVarBytes: + Marshal.WriteIntPtr(Ptr, Field.Offset, nil); + end; + end; + end; + end; + + procedure ClearBlock(pHBlock: PBlockHeader); + var + i: integer; + Free: PItemHeader; + begin + if IntPtr(pHBlock) = nil then + Exit; + + // Free complex filds + Free := IntPtr(Integer(pHBlock) + sizeof(TBlockHeader)); + for i := 1 to pHBlock.ItemCount do begin + if HasComplexFields and (Free.Flag <> flFree) then + FreeComplexFields(IntPtr(Integer(Free) + sizeof(TItemHeader)), True); + Free := IntPtr(Integer(Free) + sizeof(TItemHeader) + RecordSize); + end; + end; + + function GetRowsFromOLEDB(var RowsObtained: UINT; prghRows: PUintArray): HResult; + var + RowsOffset, RowsRequested: integer; + {$IFDEF CLR} + p: IntPtr; + {$ENDIF} + begin + // Backward fetch processing + if FetchBack then + RowsRequested := - FFetchRows + else + RowsRequested := FFetchRows; + + RowsOffset := 0; + + // Get data from OLEDB + if (FCursorType in [ctKeyset, ctStatic]) then begin + if not FFetchFromBookmark then + if FetchBack then + RowsOffset := - 1 + else + RowsOffset := + 1; + + Assert(FIRowsetLocate <> nil); + /// FIRowsetLocate.GetRowsAt does not change current IRowset fetch position + + {$IFDEF CLR} + p := Marshal.AllocHGlobal(SizeOf(Integer)); + try + Marshal.WriteInt32(p, FBookmarkValue); + Result := FIRowsetLocate.GetRowsAt(0, DB_NULL_HCHAPTER, FBookmarkSize, p, RowsOffset, RowsRequested, RowsObtained, prghRows); + finally + Marshal.FreeHGlobal(p); + end; + {$ELSE} + Result := FIRowsetLocate.GetRowsAt(0, DB_NULL_HCHAPTER, FBookmarkSize, @FBookmarkValue, RowsOffset, RowsRequested, RowsObtained, prghRows); + {$ENDIF} + end + else + begin + if (FCursorType = ctDynamic) then begin + if FLastFetchOK then begin + if FFetchFromBookmark then begin // Reread previous readed row + if FLastFetchBack = FetchBack then begin + if FetchBack then + RowsOffset := + 1 + else + RowsOffset := - 1; + end; + end + else + if FLastFetchBack <> FetchBack then + if FetchBack then + RowsOffset := - 1 + else + RowsOffset := + 1; + end + else + if FLastFetchBack = FetchBack then + if FetchBack then + RowsOffset := + 1 + else + RowsOffset := - 1; + end; + + Result := FIRowset.GetNextRows(DB_NULL_HCHAPTER, RowsOffset, RowsRequested, RowsObtained, prghRows); + end; + FLastFetchBack := FetchBack; + FFetchFromBookmark := False; // Clear flag, setted on InternalOpen + end; + + procedure ProcessNoResult; + begin + case FCursorType of + ctDefaultResultSet: + ReleaseAllInterfaces(False); // Process parameters + ctStatic: + begin + Assert(not FFetchFromBookmark, 'Cannot fetch to bookmark with Static cursor type'); + if not OldFetchFromBookmark {to prevent recursion on empty resultset} then + FetchToBookmarkValue; + end; + ctKeySet: + begin + if FCursorUpdate then + Assert(not FFetchFromBookmark, 'Cannot fetch to bookmark with KeySet cursor type'); +{ else + FBookmarkValue := - 1;} + end; + ctDynamic: + begin + CurrentItem := nil; // FHRow is not accessible and we need to refetch data from server + + if not FProcessDynBofEof then begin + try + FProcessDynBofEof := True; + if FetchBack then begin + FBof := True; + + // Server cursor position is under first row, FHRow is not accessible + // Need to call GetNextRows with params (RowsOffset = 1, RowsRequested = - 1) + FLastFetchOK := True; + if not FetchToBookmarkValue(True) then + FEof := True; + end + else + begin + FEof := True; + + // Server cursor position is below last row, FHRow is not accessible + // Need to call GetNextRows with params (RowsOffset = - 1, RowsRequested = 1) + FLastFetchOK := True; + if not FetchToBookmarkValue then + FBof := True; + end; + + if not FLastFetchOK then begin + FLastFetchOK := True; + FLastFetchBack := False; + end; + finally + FProcessDynBofEof := False; + end; + + if FBof or FEof then + CurrentItem := nil; + end; + end; + end; + end; + + procedure FirstFetch; + var + Field: TOLEDBFieldDesc; + i: integer; + begin + // This is a first call to Fetch. + // Query interfaces, create accessors etc + + Assert(FCommand.GetCursorState >= csExecuted); + if FCommand.GetCursorState = csExecuted then + FCommand.SetCursorState(csFetching); + + QueryRecordSetInterfaces; + AllocFetchBlock; + + if FCursorType in [ctStatic, ctKeySet] then begin + // Setting FRecordCount for ctStatic, ctKeySet + SetToEnd; + if IntPtr(LastItem) <> nil then begin + FRecordCount := LastItem.Order; + SetToBegin; + end; + FFetchFromBookmark := FCursorType in [ctKeyset, ctStatic]; /// First record reading without offsetting + end; + FBookmarkValue := DBBMK_FIRST; + FBookmarkSize := sizeof(FBookmarkValue); + + // Clear MaxTimestamp for RefreshQuick + for i := 0 to Fields.Count - 1 do begin + Field := TOLEDBFieldDesc(Fields[i]); + if Field.IsTimestamp and (Field.TableInfo <> nil) then + TOLEDBTableInfo(Field.TableInfo).FMaxTimestamp := 0; + end; + end; + +var + pHBlock: PBlockHeader; + NewBlock: boolean; + + hr: HResult; + RowsObtained: UINT; + rghRows: TUintArray; + prghRows: PUintArray; + GCHandle: IntPtr; + + i: integer; + pRec, pData: IntPtr; + + Cancel: boolean; + + IsThisFirstFetch: boolean; + InThread: boolean; +begin + Result := False; + Assert(FCommand <> nil); +{$IFDEF CLR} + InThread := FCommand.FNonBlocking and (FFetchExecutor <> nil) and (Thread.CurrentThread = FFetchExecutor.Thread.Handle); +{$ELSE} + InThread := FCommand.FNonBlocking and (FFetchExecutor <> nil) and (GetCurrentThreadId = FFetchExecutor.Thread.ThreadID); +{$ENDIF} + try + if Fields.Count = 0 then + DatabaseError(SNoResultSet, nil); /// Warning - constant SNoResultSet used for detecting in TCustomMSDataSet.OpenNext + + IsThisFirstFetch := + ((FCommand.FIUnknown <> nil) or not FNativeRowset) + and (Length(FFetchAccessorData.AccessorBlocks) = 0); + try + if IsThisFirstFetch then + FirstFetch; // This is a first call to Fetch. FIUnknown tested for prevent recreating accessors after fetching all strings + + DoBeforeFetch(Cancel); + + if Cancel or FWaitForFetchBreak then + Exit; + + if FIRowset = nil then + begin + Result := False; + Exit; + end; + + if (FCursorType = ctKeySet) and not FCursorUpdate and (FBookmarkValue = - 1) then + begin + Result := False; + Exit; + end; + + OldFetchFromBookmark := FFetchFromBookmark; + + // Clear previous obtained rows + ClearHRowIfNeed; + Assert(not FHRowAccessible); + + pHBlock := nil; + GCHandle := nil; + prghRows := nil; + RowsObtained := 0; + SetLength(rghRows, FFetchRows); + try + // Get next rows + GCHandle := AllocGCHandle(rghRows, True); + prghRows := GetAddrOfPinnedObject(GCHandle); + // prghRows := @rghRows[0]; + if FLastFetchEnd then + RowsObtained := 0 + else + begin + hr := GetRowsFromOLEDB(RowsObtained, prghRows); + FLastFetchEnd := FNativeRowset and (FCursorType = ctDefaultResultSet) and (hr = DB_S_ENDOFROWSET); // CR10007 + + // Process rows + if (hr <> DB_S_ENDOFROWSET) + and (hr <> DB_S_ROWLIMITEXCEEDED) + and not ((hr = DB_E_BADBOOKMARK) and (FBookmarkValue = DBBMK_FIRST)) + and not ((hr = DB_E_BADSTARTPOSITION) and (ProviderPrimaryVer = 7))then + Check(hr); + end; + if RowsObtained > 0 then begin + NewBlock := (IntPtr(BlockMan.FirstBlock) = nil) or (not FUniDirectional and not (FCursorType in ServerCursorTypes)); + if NewBlock then + BlockMan.AllocBlock(pHBlock, FFetchRows) + else begin + pHBlock := BlockMan.FirstBlock; + // Refresh block: drop values of blobs + ClearBlock(pHBlock); + end; + InitBlock(pHBlock); + pRec := IntPtr(Integer(pHBlock) + sizeof(TBlockHeader) + sizeof(TItemHeader)); + for i := 0 to RowsObtained - 1 do + begin + pData := IntPtr(Integer(pRec) + i * (RecordSize + sizeof(TItemHeader))); + GetDataFromRow(rghRows[i], pData); + end; + end; + finally + FreeGCHandle(GCHandle); + if RowsObtained > 0 then begin + // Release row handle(s) if need + if FCursorType in ServerCursorTypes then begin + Assert(RowsObtained = 1); + FHRow := rghRows[0]; + FHRowAccessible := True; + end + else + Check(FIRowset.ReleaseRows(RowsObtained, prghRows, nil, nil, nil)); + end; + + if Length(rghRows) <> 0 then + SetLength(rghRows, 0); + end; + Result := RowsObtained > 0; + FLastFetchOK := Result; + + if IntPtr(pHBlock) <> nil then begin + if Result then + CreateBlockStruct(pHBlock, RowsObtained) + else + BlockMan.FreeBlock(pHBlock); + end; + + if FNativeRowset and not Result then + ProcessNoResult; + + Assert(not (FCursorType in [ctDynamic]{ServerCursorTypes}) or FProcessDynBofEof or (FHRowAccessible or (FBOF and FEOF)), 'Row must be accessible after Fetch for non-empty dataset with server cursor'); + except + on e: exception do begin + if FetchBack then + FBOF := True + else + FEOF := True; + + ClearBlock(pHBlock); + FreeFetchBlock; + ReleaseRecordSetInterfaces; + + raise; + end; + end; + finally + if Assigned(FOnAfterFetch) then + if InThread and FAfterFetch then + FFetchExecutor.Thread.SendEvent(TObject(FE_AFTERFETCH)) + else + DoAfterFetch; + end; +end; + +function TOLEDBRecordSet.GetProp(Prop: integer; var Value: variant): boolean; +begin + Result := True; + case Prop of + prReadOnly: + Value := FReadOnly; + prEnableBCD: + Value := FEnableBCD; + {$IFDEF VER6P} + prEnableFMTBCD: + Value := FEnableFMTBCD; + {$ENDIF} + prUniqueRecords: + Value := FUniqueRecords; + prCursorType: + Value := Integer(TMSCursorType(FCursorType)); + prCursorUpdate: + Value := FCursorUpdate; + prLockClearMultipleResults: + Value := FLockClearMultipleResults; + prIsSProc: + FCommand.GetProp(prIsSProc, Value); + prNonBlocking: + FCommand.GetProp(prNonBlocking, Value); +{ prBeforeFetch: + Value := FBeforeFetch; + prAfterFetch: + Value := FAfterFetch;} + else + Result := inherited GetProp(Prop, Value); + end; +end; + +function TOLEDBRecordSet.SetProp(Prop: integer; const Value: variant): boolean; +begin + Result := True; + case Prop of + prReadOnly: + FReadOnly := Value; + prCommandTimeout: + begin + Assert(FCommand <> nil); + FCommand.FCommandTimeout := Value; + end; + prEnableBCD: + FEnableBCD := Value; + {$IFDEF VER6P} + prEnableFMTBCD: + FEnableFMTBCD := Value; + {$ENDIF} + prUniqueRecords: + FUniqueRecords := Value; + prCursorType: + begin + FCursorType := TMSCursorType(Integer(Value)); + if FCursorType in ServerCursorTypes then + FFetchAll := False; + end; + prRequestSQLObjects: + FRequestSQLObjects := Value; + prCursorUpdate: + FCursorUpdate := Value; + prLockClearMultipleResults: + FLockClearMultipleResults := Value; + prRoAfterUpdate: + FroAfterUpdate := Value; + prWideStrings: + FWideStrings := Value; + prIsSProc: + FCommand.SetProp(prIsSProc, Value); + prSmartRefresh: + FCommand.SetProp(prSmartRefresh, Value); + prSmartRefreshMsg: + FCommand.SetProp(prSmartRefreshMsg, Value); + prSmartRefreshService: + FCommand.SetProp(prSmartRefreshService, Value); + prNonBlocking: + FCommand.SetProp(prNonBlocking, Value); +{ prBeforeFetch: + FBeforeFetch := Boolean(Value); + prAfterFetch: + FAfterFetch := Boolean(Value);} + else + Result := inherited SetProp(Prop, Value); + end; +end; + +{ TOLEDBProperties } + +{ TOLEDBPropertiesSet } + +const + MaxPropCount = 20; + +constructor TOLEDBPropertiesSet.Create(Connection: TOLEDBConnection; const GuidPropertySet: TGUID); +begin + inherited Create; + + FConnection := Connection; + + FInitPropSet := Marshal.AllocHGlobal(SizeOf(DBPROPSET)); + FInitPropSet.cProperties := 0; + FInitPropSet.guidPropertySet := GuidPropertySet; + FInitPropSet.rgProperties := nil; + + FInitPropSet.rgProperties := Marshal.AllocHGlobal(MaxPropCount * SizeOfDBProp); + FillChar(FInitPropSet.rgProperties, MaxPropCount * SizeOfDBProp, 0); + +end; + +destructor TOLEDBPropertiesSet.Destroy; +var + i: integer; + rgProperty: PDBProp; +begin + if IntPtr(FInitPropSet) <> nil then begin + if FInitPropSet.rgProperties <> nil then begin + for i := 0 to Integer(FInitPropSet.cProperties) - 1 do begin + rgProperty := GetDBPropPtr(i); + rgProperty.vValue := Unassigned; + end; + + Marshal.FreeHGlobal(FInitPropSet.rgProperties); + end; + + Marshal.FreeHGlobal(FInitPropSet); + end; + + inherited; +end; + +procedure TOLEDBPropertiesSet.Check(const Status: HRESULT); +begin + try + FConnection.Check(Status, nil); + except + on E: Exception do begin + AddInfoToErr(E, GetInitPropSetStatus, []); + raise E; + end; + end; +end; + +function TOLEDBPropertiesSet.GetInitPropSetStatus: string; +var + i: integer; + p: PDBProp; +begin + Result := GUIDToString(FInitPropSet.guidPropertySet); + + for i := 0 to FInitPropSet.cProperties - 1 do begin + p := GetDBPropPtr(i); + if p.dwStatus <> 0 then + Result := Format('%s'#$D#$A'[%d] := $%X. PropId := %d', [Result, i, p.dwStatus, p.dwPropertyID]); + end; + +end; + +function TOLEDBPropertiesSet.GetDBPropPtr(Index: UINT): PDBProp; +begin + Assert(Index <= FInitPropSet.cProperties); + Result := IntPtr(Integer(FInitPropSet.rgProperties) + Integer(Index * SizeOfDBProp)); +end; + +function TOLEDBPropertiesSet.InitProp(const dwPropertyID: DBPROPID; const Required: boolean = False): PDBProp; +begin + Assert(FInitPropSet.cProperties <= MaxPropCount); + + Result := GetDBPropPtr(FInitPropSet.cProperties); + Result.dwPropertyID := dwPropertyID; + if Required then + Result.dwOptions := DBPROPOPTIONS_REQUIRED + else + Result.dwOptions := DBPROPOPTIONS_OPTIONAL; + Result.colid := DB_NULLID; +end; + + +procedure TOLEDBPropertiesSet.AddPropSmallInt(const dwPropertyID: DBPROPID; const Value: Smallint); +var + p: PDBProp; +begin + p := InitProp(dwPropertyID); + + p.vValue := VarAsType(Value, VT_I2); + FInitPropSet.cProperties := FInitPropSet.cProperties + 1; +end; + +procedure TOLEDBPropertiesSet.AddPropInt(const dwPropertyID: DBPROPID; const Value: Integer); +var + p: PDBProp; +begin + p := InitProp(dwPropertyID, True); + + p.vValue := VarAsType(Value, VT_I4); + FInitPropSet.cProperties := FInitPropSet.cProperties + 1; +end; + +procedure TOLEDBPropertiesSet.AddPropBool(const dwPropertyID: DBPROPID; const Value: boolean; const Required: boolean = False); +var + p: PDBProp; +begin + p := InitProp(dwPropertyID, Required); + + p.vValue := VarAsType(Value, VT_BOOL); + + FInitPropSet.cProperties := FInitPropSet.cProperties + 1; +end; + +procedure TOLEDBPropertiesSet.AddPropStr(const dwPropertyID: DBPROPID; const Value: string; const Required: boolean = False); +var + p: PDBProp; +begin + p := InitProp(dwPropertyID, Required); + p.vValue := Value; + + FInitPropSet.cProperties := FInitPropSet.cProperties + 1; +end; + +procedure TOLEDBPropertiesSet.SetProperties(Obj: IDBProperties); +begin + Assert(Obj <> nil); + Check(Obj.SetProperties(1, PDBPropSetArray(FInitPropSet))); +end; + +procedure TOLEDBPropertiesSet.SetProperties(Obj: ISessionProperties); +begin + Assert(Obj <> nil); + Check(Obj.SetProperties(1, PDBPropSetArray(FInitPropSet))); +end; + +procedure TOLEDBPropertiesSet.SetProperties(Obj: ICommandProperties); +begin + Assert(Obj <> nil); + Check(Obj.SetProperties(1, PDBPropSetArray(FInitPropSet))); +end; + +{ TOLEDBPropertiesGet } + +constructor TOLEDBPropertiesGet.Create(Connection: TOLEDBConnection; const GuidPropertySet: TGUID); +begin + inherited Create; + + FConnection := Connection; + + FInitPropSet := Marshal.AllocHGlobal(SizeOf(DBPROPSET)); + FInitPropSet.cProperties := 0; + FInitPropSet.rgProperties := nil; + FInitPropSet.guidPropertySet := GuidPropertySet; +end; + +destructor TOLEDBPropertiesGet.Destroy; +begin + Marshal.FreeHGlobal(FInitPropSet); + inherited; +end; + +procedure TOLEDBPropertiesGet.AddPropId(Id: DBPROPID); +begin + Assert(FPropIdsGC = nil); + SetLength(FPropIds, Length(FPropIds) + 1); + FPropIds[Length(FPropIds) - 1] := Id; +end; + +procedure TOLEDBPropertiesGet.Check(const Status: HRESULT); +begin + FConnection.Check(Status, nil); +end; + +function TOLEDBPropertiesGet.GetDBPropPtr(rgProperties: PDBPropArray; Index: UINT): PDBProp; +begin + Assert(Index <= FInitPropSet.cProperties); + Result := IntPtr(Integer(rgProperties) + Integer(Index * SizeOfDBProp)); +end; + +procedure TOLEDBPropertiesGet.PrepareToGet; +begin + FPropIdsGC := AllocGCHandle(FPropIds, True); + FInitPropSet.rgProperties := GetAddrOfPinnedObject(FPropIdsGC); + FInitPropSet.cProperties := Length(FPropIds); +end; + +procedure TOLEDBPropertiesGet.ProcessResult(rgPropertySets: PDBPropSet; var PropValues: TPropValues); +var + i: integer; +begin + SetLength(PropValues, FInitPropSet.cProperties); + for i := 0 to FInitPropSet.cProperties - 1 do + PropValues[i] := GetDBPropPtr(rgPropertySets.rgProperties, i).vValue; +end; + +procedure TOLEDBPropertiesGet.ClearResult(rgPropertySets: PDBPropSet); +var + i: integer; +begin + FreeGCHandle(FPropIdsGC); + FPropIdsGC := nil; + FInitPropSet.rgProperties := nil; + + for i := 0 to FInitPropSet.cProperties - 1 do + GetDBPropPtr(rgPropertySets.rgProperties, i).vValue := Unassigned; + + FreeCoMem(rgPropertySets.rgProperties); + FreeCoMem(rgPropertySets); + //FConnection.Malloc.Free(rgPropertySets.rgProperties); + //FConnection.Malloc.Free(rgPropertySets); +end; + +procedure TOLEDBPropertiesGet.GetProperties(Obj: IDBProperties; var PropValues: TPropValues); +var + cPropertySets: UINT; + rgPropertySets: PDBPropSet; +begin + Assert(Obj <> nil); + PrepareToGet; + try + Check(Obj.GetProperties(1, PDBPropIDSetArray(FInitPropSet), cPropertySets, rgPropertySets)); + ProcessResult(rgPropertySets, PropValues); + finally + ClearResult(rgPropertySets); + end; +end; + +procedure TOLEDBPropertiesGet.GetProperties(Obj: IRowsetInfo; var PropValues: TPropValues); +var + cPropertySets: UINT; + rgPropertySets: PDBPropSet; +begin + Assert(Obj <> nil); + PrepareToGet; + try + Check(Obj.GetProperties(1, PDBPropIDSetArray(FInitPropSet), cPropertySets, rgPropertySets)); + ProcessResult(rgPropertySets, PropValues); + finally + ClearResult(rgPropertySets); + end; +end; + +procedure TOLEDBPropertiesGet.GetProperties(Obj: ICommandProperties; var PropValues: TPropValues); +var + cPropertySets: UINT; + rgPropertySets: PDBPropSet; +begin + Assert(Obj <> nil); + PrepareToGet; + try + Check(Obj.GetProperties(1, PDBPropIDSetArray(FInitPropSet), cPropertySets, rgPropertySets)); + ProcessResult(rgPropertySets, PropValues); + finally + ClearResult(rgPropertySets); + end; +end; + +{ TOLEDBErrors } + +constructor TOLEDBErrors.Create; +begin + inherited; + FList := TList.Create; +end; + +destructor TOLEDBErrors.Destroy; +begin + Clear; + FList.Free; + inherited; +end; + +procedure TOLEDBErrors.Clear; +var + i: integer; +begin + for i := 0 to FList.Count - 1 do + TObject(FList[i]).Free; + FList.Clear; +end; + +function TOLEDBErrors.GetCount: integer; +begin + Result := FList.Count; +end; + +function TOLEDBErrors.GetError(Index: Integer): EOLEDBError; +begin + Result := EOLEDBError(FList[Index]); +end; + +procedure TOLEDBErrors.Assign(Source: TOLEDBErrors); +var + i: integer; + SrcErr, DstErr: EOLEDBError; +begin + Clear; + for i := 0 to Source.Count - 1 do begin + SrcErr := Source.Errors[i]; + DstErr := nil; + if SrcErr is EMSError then + DstErr := EMSError.Create(SrcErr.ErrorCode, SrcErr.Message) + else + if SrcErr is EOLEDBError then + DstErr := EOLEDBError.Create(SrcErr.ErrorCode, SrcErr.Message) + else + Assert(False); + + DstErr.Assign(SrcErr); + FList.Add(DstErr); + end; +end; + +{ EOLEDBError } + +constructor EOLEDBError.Create(ErrorCode: integer; Msg: WideString); +begin +{$IFDEF LITE} + inherited Create(Msg); + + FErrorCode := ErrorCode; + Message := Msg; +{$ELSE} + inherited Create(ErrorCode, Msg); +{$ENDIF} + FMessageWide := Msg; + + FErrors := TOLEDBErrors.Create; +end; + +destructor EOLEDBError.Destroy; +begin + FErrors.Free; + + inherited; +end; + +function EOLEDBError.GetErrorCount: integer; +begin + Result := FErrors.Count; +end; + +function EOLEDBError.GetError(Index: Integer): EOLEDBError; +begin + Result := FErrors[Index]; +end; + +procedure EOLEDBError.Assign(Source: EOLEDBError); +begin + FOLEDBErrorCode := Source.FOLEDBErrorCode; + Fiid := Source.Fiid; +{$IFNDEF LITE} + Component := Source.Component; +{$ENDIF} + FErrors.Assign(Source.FErrors); +end; + +{ EMSError } + +constructor EMSError.Create(const pServerErrorInfo: SSERRORINFO; OLEDBErrorCode: integer; Msg: WideString); +begin + inherited Create(pServerErrorInfo.lNative, Msg); +{$IFDEF LITE} + FErrorCode := pServerErrorInfo.lNative; +{$ENDIF} + + FMSSQLErrorCode := pServerErrorInfo.lNative; + FServerName := pServerErrorInfo.pwszServer; + FProcName := pServerErrorInfo.pwszProcedure; + FState := pServerErrorInfo.bState; + FSeverityClass := pServerErrorInfo.bClass; + FLineNumber := pServerErrorInfo.wLineNumber; + FLastMessage := pServerErrorInfo.pwszMessage; +end; + +procedure EMSError.Assign(Source: EOLEDBError); +var + Src: EMSError; +begin + inherited; + + if Source is EMSError then begin + Src := EMSError(Source); + FMSSQLErrorCode := Src.FMSSQLErrorCode; + + FServerName := Src.ServerName; + FProcName := Src.ProcName; + FState := Src.State; + FSeverityClass := Src.SeverityClass; + FLineNumber := Src.LineNumber; + FLastMessage := Src.LastMessage; + end; +end; + +var + DataSourceTypes: TBytes; +{$IFDEF CLR} + DataSourceTypesGC: GCHandle; +{$ENDIF} + +procedure InitDataSourceTypes; +var + pDataSourceTypes: IntPtr; + byteIndex: integer; + + function AddType(const TypeName: WideString): IntPtr; + var + Cnt: integer; + begin + Result := IntPtr(Integer(pDataSourceTypes) + byteIndex); + Cnt := Encoding.Unicode.{$IFNDEF VER5}GetBytes{$ELSE}GetBytesWide{$ENDIF}(TypeName, 0, Length(TypeName), DataSourceTypes, byteIndex); + DataSourceTypes[byteIndex + Cnt] := 0; + DataSourceTypes[byteIndex + Cnt + 1] := 0; + byteIndex := byteIndex + Cnt + 2; + Assert(byteIndex + Cnt < Length(DataSourceTypes)); + end; + +begin + //SetLength(DataSourceTypes, 300); + SetLength(DataSourceTypes, 350); +{$IFDEF CLR} + DataSourceTypesGC := GCHandle.Alloc(DataSourceTypes, GCHandleType.Pinned); + pDataSourceTypes := Marshal.UnsafeAddrOfPinnedArrayElement(DataSourceTypes, 0); +{$ELSE} + pDataSourceTypes := @DataSourceTypes[0]; +{$ENDIF} + byteIndex := 0; + + dstSmallint := AddType('smallint'); + dstInt := AddType('int'); + dstReal := AddType('real'); + dstFloat := AddType('float'); + dstMoney := AddType('money'); + dstDateTime := AddType('datetime'); + dstNVarChar := AddType('nvarchar'); + dstNVarCharMax := AddType('nvarchar(max)'); + dstVarChar := AddType('varchar'); + dstVarCharMax := AddType('varchar(max)'); + dstBit := AddType('bit'); + dstTinyInt := AddType('tinyint'); + dstBigint := AddType('bigint'); + dstSql_variant := AddType('sql_variant'); + dstImage := AddType('image'); + dstBinary := AddType('binary'); + dstVarBinary := AddType('varbinary'); + dstGuid := AddType('uniqueidentifier'); +end; + +procedure FinalizeDataSourceTypes; +begin +{$IFDEF CLR} + if IntPtr(DataSourceTypesGC) <> nil then + DataSourceTypesGC.Free; +{$ENDIF} +end; + +var + OSVersionInfo: TOSVersionInfo; + +initialization + __UseRPCCallStyle := True; + InitDataSourceTypes; + ParamsInfoOldBehavior := False; // delete 03.06.2006 + // Windows Vista detecting + OSVersionInfo.dwOSVersionInfoSize := SizeOf(TOSVersionInfo); + Windows.GetVersionEx(OSVersionInfo); + IsWindowsVista := OSVersionInfo.dwMajorVersion = 6; + + +finalization +{$IFDEF DEBUG} if StreamCnt <> 0 then MessageBox(0, PChar(IntToStr(StreamCnt) + ' Stream(s) hasn''t been released'), 'DA warning', MB_OK); {$ENDIF} + FinalizeDataSourceTypes; +{$IFNDEF CLR} + GlobaIMalloc := nil; +{$ENDIF} +end. diff --git a/internal/4.10.0.10/1/Source/OLEDBC.pas b/internal/4.10.0.10/1/Source/OLEDBC.pas new file mode 100644 index 0000000..e898db5 --- /dev/null +++ b/internal/4.10.0.10/1/Source/OLEDBC.pas @@ -0,0 +1,5448 @@ + +{$IFNDEF CLR} + +{$I Sdac.inc} + +unit OLEDBC; +{$ENDIF} + + +interface + +uses +{$IFDEF CLR} + System.Runtime.InteropServices, MemUtils, Variants, +{$ELSE} + CLRClasses, +{$ENDIF} + ActiveX, Windows, SysUtils; + +{$HPPEMIT '#include '} +{$HPPEMIT '#include '} + +{$IFNDEF VER6P} +{$IFNDEF VER125} +{$HPPEMIT '#include '} +{$ENDIF} + +{$HPPEMIT 'typedef System::DelphiInterface _di_ITransaction;'} +{$ENDIF} + + +// *********************************************************************// +// GUID declarations // +// *********************************************************************// +const + CLSID_SQLOLEDB_ENUMERATOR: TGUID = '{dfa22b8e-e68d-11d0-97e4-00c04fc2ad98}'; + CLSID_OLEDB_ENUMERATOR: TGUID = '{C8B522D0-5CF3-11CE-ADE5-00AA0044773D}'; {MSDAENUM} + CLSID_EXTENDEDERRORINFO: TGUID = '{C8B522CF-5CF3-11CE-ADE5-00AA0044773D}'; {MSDAERR} + CLSID_MSDAVTM: TGUID = '{0C733A8E-2A1C-11CE-ADE5-00AA0044773D}'; {MSDAVTM} + CLSID_OLEDB_CONVERSIONLIBRARY: TGUID = '{C8B522D1-5CF3-11CE-ADE5-00AA0044773D}'; {MSDADC} + CLSID_OLEDB_ROWPOSITIONLIBRARY: TGUID = '{2048EEE6-7FA2-11D0-9E6A-00A0C9138C29}'; {RowPosition.RowPosition} + CLSID_DATALINKS: TGUID = '{2206CDB2-19C1-11D1-89E0-00C04FD7A829}'; {DataLinks} + +{$IFNDEF VER6P} + {$NODEFINE IID_ITransaction} +{$ENDIF} + + IID_ITransaction: TGUID = '{0FB15084-AF41-11CE-BD2B-204C4F4F5020}'; + IID_ITransactionOptions: TGUID = '{3A6AD9E0-23B9-11CF-AD60-00AA00A74CCD}'; + IID_ITransactionDispenser: TGUID = '{3A6AD9E1-23B9-11CF-AD60-00AA00A74CCD}'; + IID_ITransactionOutcomeEvents: TGUID = '{3A6AD9E2-23B9-11CF-AD60-00AA00A74CCD}'; + IID_IAccessor: TGUID = '{0C733A8C-2A1C-11CE-ADE5-00AA0044773D}'; + IID_IRowset: TGUID = '{0C733A7C-2A1C-11CE-ADE5-00AA0044773D}'; + IID_IRowsetInfo: TGUID = '{0C733A55-2A1C-11CE-ADE5-00AA0044773D}'; + IID_IRowsetLocate: TGUID = '{0C733A7D-2A1C-11CE-ADE5-00AA0044773D}'; + IID_IRowsetResynch: TGUID = '{0C733A84-2A1C-11CE-ADE5-00AA0044773D}'; + IID_IRowsetScroll: TGUID = '{0C733A7E-2A1C-11CE-ADE5-00AA0044773D}'; + IID_IRowsetChange: TGUID = '{0C733A05-2A1C-11CE-ADE5-00AA0044773D}'; + IID_IRowsetUpdate: TGUID = '{0C733A6D-2A1C-11CE-ADE5-00AA0044773D}'; + IID_IRowsetIndex: TGUID = '{0C733A82-2A1C-11CE-ADE5-00AA0044773D}'; + IID_IMultipleResults: TGUID = '{0C733A90-2A1C-11CE-ADE5-00AA0044773D}'; + IID_IConvertType: TGUID = '{0C733A88-2A1C-11CE-ADE5-00AA0044773D}'; + IID_ICommandPrepare: TGUID = '{0C733A26-2A1C-11CE-ADE5-00AA0044773D}'; + IID_ICommandProperties: TGUID = '{0C733A79-2A1C-11CE-ADE5-00AA0044773D}'; + IID_ICommand: TGUID = '{0C733A63-2A1C-11CE-ADE5-00AA0044773D}'; + IID_ICommandWithParameters: TGUID = '{0C733A64-2A1C-11CE-ADE5-00AA0044773D}'; + + IID_ICommandText: TGUID = '{0C733A27-2A1C-11CE-ADE5-00AA0044773D}'; + IID_IColumnsRowset: TGUID = '{0C733A10-2A1C-11CE-ADE5-00AA0044773D}'; + IID_IColumnsInfo: TGUID = '{0C733A11-2A1C-11CE-ADE5-00AA0044773D}'; + IID_IDBCreateCommand: TGUID = '{0C733A1D-2A1C-11CE-ADE5-00AA0044773D}'; + IID_IDBCreateSession: TGUID = '{0C733A5D-2A1C-11CE-ADE5-00AA0044773D}'; + IID_ISourcesRowset: TGUID = '{0C733A1E-2A1C-11CE-ADE5-00AA0044773D}'; + IID_IDBProperties: TGUID = '{0C733A8A-2A1C-11CE-ADE5-00AA0044773D}'; + IID_IDBInitialize: TGUID = '{0C733A8B-2A1C-11CE-ADE5-00AA0044773D}'; + IID_IDBInfo: TGUID = '{0C733A89-2A1C-11CE-ADE5-00AA0044773D}'; + IID_IDBDataSourceAdmin: TGUID = '{0C733A7A-2A1C-11CE-ADE5-00AA0044773D}'; + IID_ISessionProperties: TGUID = '{0C733A85-2A1C-11CE-ADE5-00AA0044773d}'; + IID_IIndexDefinition: TGUID = '{0C733A68-2A1C-11CE-ADE5-00AA0044773D}'; + IID_ITableDefinition: TGUID = '{0C733A86-2A1C-11CE-ADE5-00AA0044773D}'; + IID_IOpenRowset: TGUID = '{0C733A69-2A1C-11CE-ADE5-00AA0044773D}'; + IID_IRowsetFastLoad: TGUID = '{5CF4CA13-EF21-11d0-97E7-00C04FC2AD98}'; + IID_IErrorLookup: TGUID = '{0C733A66-2A1C-11CE-ADE5-00AA0044773D}'; + IID_ISQLErrorInfo: TGUID = '{0C733A74-2A1C-11CE-ADE5-00AA0044773D}'; + IID_IGetDataSource: TGUID = '{0C733A75-2A1C-11CE-ADE5-00AA0044773D}'; + IID_ITransactionLocal: TGUID = '{0C733A5F-2A1C-11CE-ADE5-00AA0044773D}'; + IID_ITransactionJoin: TGUID = '{0C733A5E-2A1C-11CE-ADE5-00AA0044773D}'; + IID_ITransactionObject: TGUID = '{0C733A60-2A1C-11CE-ADE5-00AA0044773D}'; + IID_IDBAsynchStatus: TGUID = '{0C733A95-2A1C-11CE-ADE5-00AA0044773D}'; + IID_ISSAsynchStatus: TGUID = '{1FF1F743-8BB0-4c00-ACC4-C10E43B08FC1}'; + IID_IRowsetFind: TGUID = '{0C733A9D-2A1C-11CE-ADE5-00AA0044773D}'; + IID_IRowPosition: TGUID = '{0C733A94-2A1C-11CE-ADE5-00AA0044773D}'; + IID_IRowPositionChange: TGUID = '{0997A571-126E-11D0-9F8A-00A0C9A0631E}'; + IID_IViewRowset: TGUID = '{0C733A97-2A1C-11CE-ADE5-00AA0044773D}'; + IID_IViewChapter: TGUID = '{0C733A98-2A1C-11CE-ADE5-00AA0044773D}'; + IID_IViewSort: TGUID = '{0C733A9A-2A1C-11CE-ADE5-00AA0044773D}'; + IID_IViewFilter: TGUID = '{0C733A9B-2A1C-11CE-ADE5-00AA0044773D}'; + IID_IRowsetView: TGUID = '{0C733A99-2A1C-11CE-ADE5-00AA0044773D}'; + IID_IMDFind: TGUID = '{A07CCCD2-8148-11D0-87BB-00C04FC33942}'; + IID_IMDRangeRowset: TGUID = '{0C733AA0-2A1C-11CE-ADE5-00AA0044773D}'; + IID_IAlterTable: TGUID = '{0C733AA5-2A1C-11CE-ADE5-00AA0044773D}'; + IID_IAlterIndex: TGUID = '{0C733AA6-2A1C-11CE-ADE5-00AA0044773D}'; + IID_ICommandPersist: TGUID = '{0C733AA7-2A1C-11CE-ADE5-00AA0044773D}'; + IID_IRowsetChapterMember: TGUID = '{0C733AA8-2A1C-11CE-ADE5-00AA0044773D}'; + IID_IRowsetRefresh: TGUID = '{0C733AA9-2A1C-11CE-ADE5-00AA0044773D}'; + IID_IParentRowset: TGUID = '{0C733AAA-2A1C-11CE-ADE5-00AA0044773D}'; + IID_ITrusteeGroupAdmin: TGUID = '{0C733AA2-2A1C-11CE-ADE5-00AA0044773D}'; + IID_IObjectAccessControl: TGUID = '{0C733AA3-2A1C-11CE-ADE5-00AA0044773D}'; + IID_ISecurityInfo: TGUID = '{0C733AA4-2A1C-11CE-ADE5-00AA0044773D}'; + IID_IDBPromptInitialize: TGUID = '{2206CCB0-19C1-11D1-89E0-00C04FD7A829}'; + IID_IDataInitialize: TGUID = '{2206CCB1-19C1-11D1-89E0-00C04FD7A829}'; + + DBSCHEMA_TABLES_INFO: TGUID = '{C8B522E0-5CF3-11CE-ADE5-00AA0044773D}'; + MDGUID_MDX: TGUID = '{A07CCCD0-8148-11D0-87BB-00C04FC33942}'; + DBGUID_MDX: TGUID = '{A07CCCD0-8148-11D0-87BB-00C04FC33942}'; + MDSCHEMA_CUBES: TGUID = '{C8B522D8-5CF3-11CE-ADE5-00AA0044773D}'; + MDSCHEMA_DIMENSIONS: TGUID = '{C8B522D9-5CF3-11CE-ADE5-00AA0044773D}'; + MDSCHEMA_HIERARCHIES: TGUID = '{C8B522DA-5CF3-11CE-ADE5-00AA0044773D}'; + MDSCHEMA_LEVELS: TGUID = '{C8B522DB-5CF3-11CE-ADE5-00AA0044773D}'; + MDSCHEMA_MEASURES: TGUID = '{C8B522DC-5CF3-11CE-ADE5-00AA0044773D}'; + MDSCHEMA_PROPERTIES: TGUID = '{C8B522DD-5CF3-11CE-ADE5-00AA0044773D}'; + MDSCHEMA_MEMBERS: TGUID = '{C8B522DE-5CF3-11CE-ADE5-00AA0044773D}'; + DBPROPSET_TRUSTEE: TGUID = '{C8B522E1-5CF3-11CE-ADE5-00AA0044773D}'; + + DBOBJECT_TABLE: TGUID = '{C8B522E2-5CF3-11CE-ADE5-00AA0044773D}'; + DBOBJECT_COLUMN: TGUID = '{C8B522E4-5CF3-11CE-ADE5-00AA0044773D}'; + DBOBJECT_DATABASE: TGUID = '{C8B522E5-5CF3-11CE-ADE5-00AA0044773D}'; + DBOBJECT_PROCEDURE: TGUID = '{C8B522E6-5CF3-11CE-ADE5-00AA0044773D}'; + DBOBJECT_VIEW: TGUID = '{C8B522E7-5CF3-11CE-ADE5-00AA0044773D}'; + DBOBJECT_SCHEMA: TGUID = '{C8B522E8-5CF3-11CE-ADE5-00AA0044773D}'; + DBOBJECT_DOMAIN: TGUID = '{C8B522E9-5CF3-11CE-ADE5-00AA0044773D}'; + DBOBJECT_COLLATION: TGUID = '{C8B522EA-5CF3-11CE-ADE5-00AA0044773D}'; + DBOBJECT_TRUSTEE: TGUID = '{C8B522EB-5CF3-11CE-ADE5-00AA0044773D}'; + DBOBJECT_SCHEMAROWSET: TGUID = '{C8B522EC-5CF3-11CE-ADE5-00AA0044773D}'; + DBOBJECT_CHARACTERSET: TGUID = '{C8B522ED-5CF3-11CE-ADE5-00AA0044773D}'; + DBOBJECT_TRANSLATION: TGUID = '{C8B522EE-5CF3-11CE-ADE5-00AA0044773D}'; + + DB_PROPERTY_CHECK_OPTION: TGUID = '{C8B5220B-5CF3-11CE-ADE5-00AA0044773D}'; + DB_PROPERTY_CONSTRAINT_CHECK_DEFERRED: TGUID = '{C8B521F0-5CF3-11CE-ADE5-00AA0044773D}'; + DB_PROPERTY_DROP_CASCADE: TGUID = '{C8B521F3-5CF3-11CE-ADE5-00AA0044773D}'; + DB_PROPERTY_UNIQUE: TGUID = '{C8B521F5-5CF3-11CE-ADE5-00AA0044773D}'; + DB_PROPERTY_ON_COMMIT_PRESERVE_ROWS: TGUID = '{C8B52230-5CF3-11CE-ADE5-00AA0044773D}'; + DB_PROPERTY_PRIMARY: TGUID = '{C8B521FC-5CF3-11CE-ADE5-00AA0044773D}'; + DB_PROPERTY_CLUSTERED: TGUID = '{C8B521FF-5CF3-11CE-ADE5-00AA0044773D}'; + DB_PROPERTY_NONCLUSTERED: TGUID = '{C8B52200-5CF3-11CE-ADE5-00AA0044773D}'; + DB_PROPERTY_BTREE: TGUID = '{C8B52201-5CF3-11CE-ADE5-00AA0044773D}'; + DB_PROPERTY_HASH: TGUID = '{C8B52202-5CF3-11CE-ADE5-00AA0044773D}'; + DB_PROPERTY_FILLFACTOR: TGUID = '{C8B52203-5CF3-11CE-ADE5-00AA0044773D}'; + DB_PROPERTY_INITIALSIZE: TGUID = '{C8B52204-5CF3-11CE-ADE5-00AA0044773D}'; + DB_PROPERTY_DISALLOWNULL: TGUID = '{C8B52205-5CF3-11CE-ADE5-00AA0044773D}'; + DB_PROPERTY_IGNORENULL: TGUID = '{C8B52206-5CF3-11CE-ADE5-00AA0044773D}'; + DB_PROPERTY_IGNOREANYNULL: TGUID = '{C8B52207-5CF3-11CE-ADE5-00AA0044773D}'; + DB_PROPERTY_SORTBOOKMARKS: TGUID = '{C8B52208-5CF3-11CE-ADE5-00AA0044773D}'; + DB_PROPERTY_AUTOMATICUPDATE: TGUID = '{C8B52209-5CF3-11CE-ADE5-00AA0044773D}'; + DB_PROPERTY_EXPLICITUPDATE: TGUID = '{C8B5220A-5CF3-11CE-ADE5-00AA0044773D}'; + + DBGUID_LIKE_SQL: TGUID = '{C8B521F6-5CF3-11CE-ADE5-00AA0044773D}'; + DBGUID_LIKE_DOS: TGUID = '{C8B521F7-5CF3-11CE-ADE5-00AA0044773D}'; + DBGUID_LIKE_OFS: TGUID = '{C8B521F8-5CF3-11CE-ADE5-00AA0044773D}'; + DBGUID_LIKE_MAPI: TGUID = '{C8B521F9-5CF3-11CE-ADE5-00AA0044773D}'; + + DBSCHEMA_ASSERTIONS: TGUID = '{C8B52210-5CF3-11CE-ADE5-00AA0044773D}'; + DBSCHEMA_CATALOGS: TGUID = '{C8B52211-5CF3-11CE-ADE5-00AA0044773D}'; + DBSCHEMA_CHARACTER_SETS: TGUID = '{C8B52212-5CF3-11CE-ADE5-00AA0044773D}'; + DBSCHEMA_COLLATIONS: TGUID = '{C8B52213-5CF3-11CE-ADE5-00AA0044773D}'; + DBSCHEMA_COLUMNS: TGUID = '{C8B52214-5CF3-11CE-ADE5-00AA0044773D}'; + DBSCHEMA_CHECK_CONSTRAINTS: TGUID = '{C8B52215-5CF3-11CE-ADE5-00AA0044773D}'; + DBSCHEMA_CONSTRAINT_COLUMN_USAGE: TGUID = '{C8B52216-5CF3-11CE-ADE5-00AA0044773D}'; + DBSCHEMA_CONSTRAINT_TABLE_USAGE: TGUID = '{C8B52217-5CF3-11CE-ADE5-00AA0044773D}'; + DBSCHEMA_KEY_COLUMN_USAGE: TGUID = '{C8B52218-5CF3-11CE-ADE5-00AA0044773D}'; + DBSCHEMA_REFERENTIAL_CONSTRAINTS: TGUID = '{C8B52219-5CF3-11CE-ADE5-00AA0044773D}'; + DBSCHEMA_TABLE_CONSTRAINTS: TGUID = '{C8B5221A-5CF3-11CE-ADE5-00AA0044773D}'; + DBSCHEMA_COLUMN_DOMAIN_USAGE: TGUID = '{C8B5221B-5CF3-11CE-ADE5-00AA0044773D}'; + DBSCHEMA_INDEXES: TGUID = '{C8B5221E-5CF3-11CE-ADE5-00AA0044773D}'; + DBSCHEMA_COLUMN_PRIVILEGES: TGUID = '{C8B52221-5CF3-11CE-ADE5-00AA0044773D}'; + DBSCHEMA_TABLE_PRIVILEGES: TGUID = '{C8B52222-5CF3-11CE-ADE5-00AA0044773D}'; + DBSCHEMA_USAGE_PRIVILEGES: TGUID = '{C8B52223-5CF3-11CE-ADE5-00AA0044773D}'; + DBSCHEMA_PROCEDURES: TGUID = '{C8B52224-5CF3-11CE-ADE5-00AA0044773D}'; + DBSCHEMA_SCHEMATA: TGUID = '{C8B52225-5CF3-11CE-ADE5-00AA0044773D}'; + DBSCHEMA_SQL_LANGUAGES: TGUID = '{C8B52226-5CF3-11CE-ADE5-00AA0044773D}'; + DBSCHEMA_STATISTICS: TGUID = '{C8B52227-5CF3-11CE-ADE5-00AA0044773D}'; + DBSCHEMA_TABLES: TGUID = '{C8B52229-5CF3-11CE-ADE5-00AA0044773D}'; + DBSCHEMA_TRANSLATIONS: TGUID = '{C8B5222A-5CF3-11CE-ADE5-00AA0044773D}'; + DBSCHEMA_PROVIDER_TYPES: TGUID = '{C8B5222C-5CF3-11CE-ADE5-00AA0044773D}'; + DBSCHEMA_VIEWS: TGUID = '{C8B5222D-5CF3-11CE-ADE5-00AA0044773D}'; + DBSCHEMA_VIEW_COLUMN_USAGE: TGUID = '{C8B5222E-5CF3-11CE-ADE5-00AA0044773D}'; + DBSCHEMA_VIEW_TABLE_USAGE: TGUID = '{C8B5222F-5CF3-11CE-ADE5-00AA0044773D}'; + DBSCHEMA_PROCEDURE_PARAMETERS: TGUID = '{C8B522B8-5CF3-11CE-ADE5-00AA0044773D}'; + DBSCHEMA_FOREIGN_KEYS: TGUID = '{C8B522C4-5CF3-11CE-ADE5-00AA0044773D}'; + DBSCHEMA_PRIMARY_KEYS: TGUID = '{C8B522C5-5CF3-11CE-ADE5-00AA0044773D}'; + DBSCHEMA_PROCEDURE_COLUMNS: TGUID = '{C8B522C9-5CF3-11CE-ADE5-00AA0044773D}'; + + DBCOL_SELFCOLUMNS: TGUID = '{C8B52231-5CF3-11CE-ADE5-00AA0044773D}'; + DBCOL_SPECIALCOL: TGUID = '{C8B52232-5CF3-11CE-ADE5-00AA0044773D}'; + PSGUID_QUERY: TGUID = '{49691C90-7E17-101A-A91C-08002B2ECDA9}'; + + DBPROPSET_COLUMN: TGUID = '{C8B522B9-5CF3-11CE-ADE5-00AA0044773D}'; + DBPROPSET_DATASOURCE: TGUID = '{C8B522BA-5CF3-11CE-ADE5-00AA0044773D}'; + DBPROPSET_DATASOURCEINFO: TGUID = '{C8B522BB-5CF3-11CE-ADE5-00AA0044773D}'; + DBPROPSET_INDEX: TGUID = '{C8B522BD-5CF3-11CE-ADE5-00AA0044773D}'; + DBPROPSET_DBINIT: TGUID = '{C8B522BC-5CF3-11CE-ADE5-00AA0044773D}'; + DBPROPSET_ROWSET: TGUID = '{C8B522BE-5CF3-11CE-ADE5-00AA0044773D}'; + DBPROPSET_SESSION: TGUID = '{C8B522C6-5CF3-11CE-ADE5-00AA0044773D}'; + DBPROPSET_TABLE: TGUID = '{C8B522BF-5CF3-11CE-ADE5-00AA0044773D}'; + DBPROPSET_PROPERTIESINERROR: TGUID = '{C8B522D4-5CF3-11CE-ADE5-00AA0044773D}'; + DBPROPSET_VIEW: TGUID = '{C8B522DF-5CF3-11CE-ADE5-00AA0044773D}'; + + DBPROPSET_COLUMNALL = '{C8B522F0-5CF3-11CE-ADE5-00AA0044773D}'; + DBPROPSET_CONSTRAINTALL = '{C8B522FA-5CF3-11CE-ADE5-00AA0044773D}'; + DBPROPSET_DATASOURCEALL: TGUID = '{C8B522C0-5CF3-11CE-ADE5-00AA0044773D}'; + DBPROPSET_DATASOURCEINFOALL: TGUID = '{C8B522C1-5CF3-11CE-ADE5-00AA0044773D}'; + DBPROPSET_DBINITALL: TGUID = '{C8B522CA-5CF3-11CE-ADE5-00AA0044773D}'; + DBPROPSET_INDEXALL = '{C8B522F1-5CF3-11CE-ADE5-00AA0044773D}'; + DBPROPSET_ROWSETALL: TGUID = '{C8B522C2-5CF3-11CE-ADE5-00AA0044773D}'; + DBPROPSET_SESSIONALL: TGUID = '{C8B522C7-5CF3-11CE-ADE5-00AA0044773D}'; + DBPROPSET_TABLEALL = '{C8B522F2-5CF3-11CE-ADE5-00AA0044773D}'; + DBPROPSET_TRUSTEEALL = '{C8B522F3-5CF3-11CE-ADE5-00AA0044773D}'; + + // SQL Everywhere Provider Specific Property Sets + DBPROPSET_SSCE_DBINIT: TGUID = '{2B9AB5BA-4F6C-4ddd-BF18-24DD4BD41848}'; + DBPROPSET_SSCE_COLUMN: TGUID = '{352CC8D5-9181-11d3-B27B-00C04F68DBFF}'; + DBPROPSET_SSCE_ROWSET: TGUID = '{5C17C602-A107-11d3-B27B-00C04F68DBFF}'; + DBPROPSET_SSCE_SESSION: TGUID = '{22FE7D33-5E5C-4a45-B723-8BED2374A06B}'; + + DBGUID_DEFAULT: TGUID = '{C8B521FB-5CF3-11CE-ADE5-00AA0044773D}'; + DBGUID_SQL: TGUID = '{C8B522D7-5CF3-11CE-ADE5-00AA0044773D}'; + +// *********************************************************************// +// Constant Declarations // +// *********************************************************************// + +const + MAXCOLS = 4096; + MAXBOUND = 65535; { High bound for arrays } + OLEDBVER = $0210; + {$EXTERNALSYM OLEDBVER} + DB_INVALID_HACCESSOR = $00; + {$EXTERNALSYM DB_INVALID_HACCESSOR} + DB_NULL_HROW = $00; + {$EXTERNALSYM DB_NULL_HROW} + DBWATCHREGION_NULL = nil; + {$EXTERNALSYM DBWATCHREGION_NULL} + DB_NULL_HCHAPTER = $00; + {$EXTERNALSYM DB_NULL_HCHAPTER} + STD_BOOKMARKLENGTH = 1; + {$EXTERNALSYM STD_BOOKMARKLENGTH} + DB_INVALIDCOLUMN = HIGH(ULONG); + {$EXTERNALSYM DB_INVALIDCOLUMN} + DBCIDGUID: TGuid = '{0C733A81-2A1C-11CE-ADE5-00AA0044773D}'; + {$EXTERNALSYM DBCIDGUID} + DB_NULLGUID: TGuid = '{00000000-0000-0000-0000-000000000000}'; + {$EXTERNALSYM DB_NULLGUID} + DBPROPVAL_BMK_NUMERIC = $00000001; + {$EXTERNALSYM DBPROPVAL_BMK_NUMERIC} + DBPROPVAL_BMK_KEY = $00000002; + {$EXTERNALSYM DBPROPVAL_BMK_KEY} + DBPROPVAL_CL_START = $00000001; + {$EXTERNALSYM DBPROPVAL_CL_START} + DBPROPVAL_CL_END = $00000002; + {$EXTERNALSYM DBPROPVAL_CL_END} + DBPROPVAL_CU_DML_STATEMENTS = $00000001; + {$EXTERNALSYM DBPROPVAL_CU_DML_STATEMENTS} + DBPROPVAL_CU_TABLE_DEFINITION = $00000002; + {$EXTERNALSYM DBPROPVAL_CU_TABLE_DEFINITION} + DBPROPVAL_CU_INDEX_DEFINITION = $00000004; + {$EXTERNALSYM DBPROPVAL_CU_INDEX_DEFINITION} + DBPROPVAL_CU_PRIVILEGE_DEFINITION = $00000008; + {$EXTERNALSYM DBPROPVAL_CU_PRIVILEGE_DEFINITION} + DBPROPVAL_CD_NOTNULL = $00000001; + {$EXTERNALSYM DBPROPVAL_CD_NOTNULL} + DBPROPVAL_CB_NULL = $00000001; + {$EXTERNALSYM DBPROPVAL_CB_NULL} + DBPROPVAL_CB_NON_NULL = $00000002; + {$EXTERNALSYM DBPROPVAL_CB_NON_NULL} + DBPROPVAL_FU_NOT_SUPPORTED = $00000001; + {$EXTERNALSYM DBPROPVAL_FU_NOT_SUPPORTED} + DBPROPVAL_FU_COLUMN = $00000002; + {$EXTERNALSYM DBPROPVAL_FU_COLUMN} + DBPROPVAL_FU_TABLE = $00000004; + {$EXTERNALSYM DBPROPVAL_FU_TABLE} + DBPROPVAL_FU_CATALOG = $00000008; + {$EXTERNALSYM DBPROPVAL_FU_CATALOG} + DBPROPVAL_GB_NOT_SUPPORTED = $00000001; + {$EXTERNALSYM DBPROPVAL_GB_NOT_SUPPORTED} + DBPROPVAL_GB_EQUALS_SELECT = $00000002; + {$EXTERNALSYM DBPROPVAL_GB_EQUALS_SELECT} + DBPROPVAL_GB_CONTAINS_SELECT = $00000004; + {$EXTERNALSYM DBPROPVAL_GB_CONTAINS_SELECT} + DBPROPVAL_GB_NO_RELATION = $00000008; + {$EXTERNALSYM DBPROPVAL_GB_NO_RELATION} + DBPROPVAL_HT_DIFFERENT_CATALOGS = $00000001; + {$EXTERNALSYM DBPROPVAL_HT_DIFFERENT_CATALOGS} + DBPROPVAL_HT_DIFFERENT_PROVIDERS = $00000002; + {$EXTERNALSYM DBPROPVAL_HT_DIFFERENT_PROVIDERS} + DBPROPVAL_IC_UPPER = $00000001; + {$EXTERNALSYM DBPROPVAL_IC_UPPER} + DBPROPVAL_IC_LOWER = $00000002; + {$EXTERNALSYM DBPROPVAL_IC_LOWER} + DBPROPVAL_IC_SENSITIVE = $00000004; + {$EXTERNALSYM DBPROPVAL_IC_SENSITIVE} + DBPROPVAL_IC_MIXED = $00000008; + {$EXTERNALSYM DBPROPVAL_IC_MIXED} + DBPROPVAL_LM_NONE = $00000001; + {$EXTERNALSYM DBPROPVAL_LM_NONE} + DBPROPVAL_LM_READ = $00000002; + {$EXTERNALSYM DBPROPVAL_LM_READ} + DBPROPVAL_LM_INTENT = $00000004; + {$EXTERNALSYM DBPROPVAL_LM_INTENT} + DBPROPVAL_LM_RITE = $00000008; + {$EXTERNALSYM DBPROPVAL_LM_RITE} + DBPROPVAL_NP_OKTODO = $00000001; + {$EXTERNALSYM DBPROPVAL_NP_OKTODO} + DBPROPVAL_NP_ABOUTTODO = $00000002; + {$EXTERNALSYM DBPROPVAL_NP_ABOUTTODO} + DBPROPVAL_NP_SYNCHAFTER = $00000004; + {$EXTERNALSYM DBPROPVAL_NP_SYNCHAFTER} + DBPROPVAL_NP_FAILEDTODO = $00000008; + {$EXTERNALSYM DBPROPVAL_NP_FAILEDTODO} + DBPROPVAL_NP_DIDEVENT = $00000010; + {$EXTERNALSYM DBPROPVAL_NP_DIDEVENT} + DBPROPVAL_NC_END = $00000001; + {$EXTERNALSYM DBPROPVAL_NC_END} + DBPROPVAL_NC_HIGH = $00000002; + {$EXTERNALSYM DBPROPVAL_NC_HIGH} + DBPROPVAL_NC_LOW = $00000004; + {$EXTERNALSYM DBPROPVAL_NC_LOW} + DBPROPVAL_NC_START = $00000008; + {$EXTERNALSYM DBPROPVAL_NC_START} + DBPROPVAL_OO_BLOB = $00000001; + {$EXTERNALSYM DBPROPVAL_OO_BLOB} + DBPROPVAL_OO_IPERSIST = $00000002; + {$EXTERNALSYM DBPROPVAL_OO_IPERSIST} + DBPROPVAL_CB_DELETE = $00000001; + {$EXTERNALSYM DBPROPVAL_CB_DELETE} + DBPROPVAL_CB_PRESERVE = $00000002; + {$EXTERNALSYM DBPROPVAL_CB_PRESERVE} + DBPROPVAL_SU_DML_STATEMENTS = $00000001; + {$EXTERNALSYM DBPROPVAL_SU_DML_STATEMENTS} + DBPROPVAL_SU_TABLE_DEFINITION = $00000002; + {$EXTERNALSYM DBPROPVAL_SU_TABLE_DEFINITION} + DBPROPVAL_SU_INDEX_DEFINITION = $00000004; + {$EXTERNALSYM DBPROPVAL_SU_INDEX_DEFINITION} + DBPROPVAL_SU_PRIVILEGE_DEFINITION = $00000008; + {$EXTERNALSYM DBPROPVAL_SU_PRIVILEGE_DEFINITION} + DBPROPVAL_SQ_CORRELATEDSUBQUERIES = $00000001; + {$EXTERNALSYM DBPROPVAL_SQ_CORRELATEDSUBQUERIES} + DBPROPVAL_SQ_COMPARISON = $00000002; + {$EXTERNALSYM DBPROPVAL_SQ_COMPARISON} + DBPROPVAL_SQ_EXISTS = $00000004; + {$EXTERNALSYM DBPROPVAL_SQ_EXISTS} + DBPROPVAL_SQ_IN = $00000008; + {$EXTERNALSYM DBPROPVAL_SQ_IN} + DBPROPVAL_SQ_QUANTIFIED = $00000010; + {$EXTERNALSYM DBPROPVAL_SQ_QUANTIFIED} + DBPROPVAL_SS_ISEQUENTIALSTREAM = $00000001; + {$EXTERNALSYM DBPROPVAL_SS_ISEQUENTIALSTREAM} + DBPROPVAL_SS_ISTREAM = $00000002; + {$EXTERNALSYM DBPROPVAL_SS_ISTREAM} + DBPROPVAL_SS_ISTORAGE = $00000004; + {$EXTERNALSYM DBPROPVAL_SS_ISTORAGE} + DBPROPVAL_SS_ILOCKBYTES = $00000008; + {$EXTERNALSYM DBPROPVAL_SS_ILOCKBYTES} + DBPROPVAL_TI_CHAOS = $00000010; + {$EXTERNALSYM DBPROPVAL_TI_CHAOS} + DBPROPVAL_TI_READUNCOMMITTED = $00000100; + {$EXTERNALSYM DBPROPVAL_TI_READUNCOMMITTED} + DBPROPVAL_TI_BROWSE = $00000100; + {$EXTERNALSYM DBPROPVAL_TI_BROWSE} + DBPROPVAL_TI_CURSORSTABILITY = $00001000; + {$EXTERNALSYM DBPROPVAL_TI_CURSORSTABILITY} + DBPROPVAL_TI_READCOMMITTED = $00001000; + {$EXTERNALSYM DBPROPVAL_TI_READCOMMITTED} + DBPROPVAL_TI_REPEATABLEREAD = $00010000; + {$EXTERNALSYM DBPROPVAL_TI_REPEATABLEREAD} + DBPROPVAL_TI_SERIALIZABLE = $00100000; + {$EXTERNALSYM DBPROPVAL_TI_SERIALIZABLE} + DBPROPVAL_TI_ISOLATED = $00100000; + {$EXTERNALSYM DBPROPVAL_TI_ISOLATED} + DBPROPVAL_TR_COMMIT_DC = $00000001; + {$EXTERNALSYM DBPROPVAL_TR_COMMIT_DC} + DBPROPVAL_TR_COMMIT = $00000002; + {$EXTERNALSYM DBPROPVAL_TR_COMMIT} + DBPROPVAL_TR_COMMIT_NO = $00000004; + {$EXTERNALSYM DBPROPVAL_TR_COMMIT_NO} + DBPROPVAL_TR_ABORT_DC = $00000008; + {$EXTERNALSYM DBPROPVAL_TR_ABORT_DC} + DBPROPVAL_TR_ABORT = $00000010; + {$EXTERNALSYM DBPROPVAL_TR_ABORT} + DBPROPVAL_TR_ABORT_NO = $00000020; + {$EXTERNALSYM DBPROPVAL_TR_ABORT_NO} + DBPROPVAL_TR_DONTCARE = $00000040; + {$EXTERNALSYM DBPROPVAL_TR_DONTCARE} + DBPROPVAL_TR_BOTH = $00000080; + {$EXTERNALSYM DBPROPVAL_TR_BOTH} + DBPROPVAL_TR_NONE = $00000100; + {$EXTERNALSYM DBPROPVAL_TR_NONE} + DBPROPVAL_TR_OPTIMISTIC = $00000200; + {$EXTERNALSYM DBPROPVAL_TR_OPTIMISTIC} + DBPROPVAL_RT_FREETHREAD = $00000001; + {$EXTERNALSYM DBPROPVAL_RT_FREETHREAD} + DBPROPVAL_RT_APTMTTHREAD = $00000002; + {$EXTERNALSYM DBPROPVAL_RT_APTMTTHREAD} + DBPROPVAL_RT_SINGLETHREAD = $00000004; + {$EXTERNALSYM DBPROPVAL_RT_SINGLETHREAD} + DBPROPVAL_UP_CHANGE = $00000001; + {$EXTERNALSYM DBPROPVAL_UP_CHANGE} + DBPROPVAL_UP_DELETE = $00000002; + {$EXTERNALSYM DBPROPVAL_UP_DELETE} + DBPROPVAL_UP_INSERT = $00000004; + {$EXTERNALSYM DBPROPVAL_UP_INSERT} + DBPROPVAL_SQL_NONE = $00000000; + {$EXTERNALSYM DBPROPVAL_SQL_NONE} + DBPROPVAL_SQL_ODBC_MINIMUM = $00000001; + {$EXTERNALSYM DBPROPVAL_SQL_ODBC_MINIMUM} + DBPROPVAL_SQL_ODBC_CORE = $00000002; + {$EXTERNALSYM DBPROPVAL_SQL_ODBC_CORE} + DBPROPVAL_SQL_ODBC_EXTENDED = $00000004; + {$EXTERNALSYM DBPROPVAL_SQL_ODBC_EXTENDED} + DBPROPVAL_SQL_ANSI89_IEF = $00000008; + {$EXTERNALSYM DBPROPVAL_SQL_ANSI89_IEF} + DBPROPVAL_SQL_ANSI92_ENTRY = $00000010; + {$EXTERNALSYM DBPROPVAL_SQL_ANSI92_ENTRY} + DBPROPVAL_SQL_FIPS_TRANSITIONAL = $00000020; + {$EXTERNALSYM DBPROPVAL_SQL_FIPS_TRANSITIONAL} + DBPROPVAL_SQL_ANSI92_INTERMEDIATE = $00000040; + {$EXTERNALSYM DBPROPVAL_SQL_ANSI92_INTERMEDIATE} + DBPROPVAL_SQL_ANSI92_FULL = $00000080; + {$EXTERNALSYM DBPROPVAL_SQL_ANSI92_FULL} + DBPROPVAL_SQL_ESCAPECLAUSES = $00000100; + {$EXTERNALSYM DBPROPVAL_SQL_ESCAPECLAUSES} + DBPROPVAL_IT_BTREE = $00000001; + {$EXTERNALSYM DBPROPVAL_IT_BTREE} + DBPROPVAL_IT_HASH = $00000002; + {$EXTERNALSYM DBPROPVAL_IT_HASH} + DBPROPVAL_IT_CONTENT = $00000003; + {$EXTERNALSYM DBPROPVAL_IT_CONTENT} + DBPROPVAL_IT_OTHER = $00000004; + {$EXTERNALSYM DBPROPVAL_IT_OTHER} + DBPROPVAL_IN_DISALLOWNULL = $00000001; + {$EXTERNALSYM DBPROPVAL_IN_DISALLOWNULL} + DBPROPVAL_IN_IGNORENULL = $00000002; + {$EXTERNALSYM DBPROPVAL_IN_IGNORENULL} + DBPROPVAL_IN_IGNOREANYNULL = $00000004; + {$EXTERNALSYM DBPROPVAL_IN_IGNOREANYNULL} + DBPROPVAL_TC_NONE = $00000000; + {$EXTERNALSYM DBPROPVAL_TC_NONE} + DBPROPVAL_TC_DML = $00000001; + {$EXTERNALSYM DBPROPVAL_TC_DML} + DBPROPVAL_TC_DDL_COMMIT = $00000002; + {$EXTERNALSYM DBPROPVAL_TC_DDL_COMMIT} + DBPROPVAL_TC_DDL_IGNORE = $00000004; + {$EXTERNALSYM DBPROPVAL_TC_DDL_IGNORE} + DBPROPVAL_TC_ALL = $00000008; + {$EXTERNALSYM DBPROPVAL_TC_ALL} + DBPROPVAL_OA_NOTSUPPORTED = $00000001; + {$EXTERNALSYM DBPROPVAL_OA_NOTSUPPORTED} + DBPROPVAL_OA_ATEXECUTE = $00000002; + {$EXTERNALSYM DBPROPVAL_OA_ATEXECUTE} + DBPROPVAL_OA_ATROWRELEASE = $00000004; + {$EXTERNALSYM DBPROPVAL_OA_ATROWRELEASE} + DBPROPVAL_MR_NOTSUPPORTED = $00000000; + {$EXTERNALSYM DBPROPVAL_MR_NOTSUPPORTED} + DBPROPVAL_MR_SUPPORTED = $00000001; + {$EXTERNALSYM DBPROPVAL_MR_SUPPORTED} + DBPROPVAL_MR_CONCURRENT = $00000002; + {$EXTERNALSYM DBPROPVAL_MR_CONCURRENT} + DBPROPVAL_PT_GUID_NAME = $00000001; + {$EXTERNALSYM DBPROPVAL_PT_GUID_NAME} + DBPROPVAL_PT_GUID_PROPID = $00000002; + {$EXTERNALSYM DBPROPVAL_PT_GUID_PROPID} + DBPROPVAL_PT_NAME = $00000004; + {$EXTERNALSYM DBPROPVAL_PT_NAME} + DBPROPVAL_PT_GUID = $00000008; + {$EXTERNALSYM DBPROPVAL_PT_GUID} + DBPROPVAL_PT_PROPID = $00000010; + {$EXTERNALSYM DBPROPVAL_PT_PROPID} + DBPROPVAL_PT_PGUID_NAME = $00000020; + {$EXTERNALSYM DBPROPVAL_PT_PGUID_NAME} + DBPROPVAL_PT_PGUID_PROPID = $00000040; + {$EXTERNALSYM DBPROPVAL_PT_PGUID_PROPID} + DBPROPVAL_NT_SINGLEROW = $00000001; + {$EXTERNALSYM DBPROPVAL_NT_SINGLEROW} + DBPROPVAL_NT_MULTIPLEROWS = $00000002; + {$EXTERNALSYM DBPROPVAL_NT_MULTIPLEROWS} + DBPROPVAL_ASYNCH_INITIALIZE = $00000001; + {$EXTERNALSYM DBPROPVAL_ASYNCH_INITIALIZE} + DBPROPVAL_ASYNCH_SEQUENTIALPOPULATION = $00000002; + {$EXTERNALSYM DBPROPVAL_ASYNCH_SEQUENTIALPOPULATION} + DBPROPVAL_ASYNCH_RANDOMPOPULATION = $00000004; + {$EXTERNALSYM DBPROPVAL_ASYNCH_RANDOMPOPULATION} + DBPROPVAL_OP_EQUAL = $00000001; + {$EXTERNALSYM DBPROPVAL_OP_EQUAL} + DBPROPVAL_OP_RELATIVE = $00000002; + {$EXTERNALSYM DBPROPVAL_OP_RELATIVE} + DBPROPVAL_OP_STRING = $00000004; + {$EXTERNALSYM DBPROPVAL_OP_STRING} + DBPROPVAL_CO_EQUALITY = $00000001; + {$EXTERNALSYM DBPROPVAL_CO_EQUALITY} + DBPROPVAL_CO_STRING = $00000002; + {$EXTERNALSYM DBPROPVAL_CO_STRING} + DBPROPVAL_CO_CASESENSITIVE = $00000004; + {$EXTERNALSYM DBPROPVAL_CO_CASESENSITIVE} + DBPROPVAL_CO_CASEINSENSITIVE = $00000008; + {$EXTERNALSYM DBPROPVAL_CO_CASEINSENSITIVE} + DBPROPVAL_CO_CONTAINS = $00000010; + {$EXTERNALSYM DBPROPVAL_CO_CONTAINS} + DBPROPVAL_CO_BEGINSWITH = $00000020; + {$EXTERNALSYM DBPROPVAL_CO_BEGINSWITH} + DBPROPVAL_ASYNCH_BACKGROUNDPOPULATION = $00000008; + {$EXTERNALSYM DBPROPVAL_ASYNCH_BACKGROUNDPOPULATION} + DBPROPVAL_ASYNCH_PREPOPULATE = $00000010; + {$EXTERNALSYM DBPROPVAL_ASYNCH_PREPOPULATE} + DBPROPVAL_ASYNCH_POPULATEONDEMAND = $00000020; + {$EXTERNALSYM DBPROPVAL_ASYNCH_POPULATEONDEMAND} + DBPROPVAL_LM_SINGLEROW = $00000002; + {$EXTERNALSYM DBPROPVAL_LM_SINGLEROW} + DBPROPVAL_SQL_SUBMINIMUM = $00000200; + {$EXTERNALSYM DBPROPVAL_SQL_SUBMINIMUM} + DBPROPVAL_DST_TDP = $00000001; + {$EXTERNALSYM DBPROPVAL_DST_TDP} + DBPROPVAL_DST_MDP = $00000002; + {$EXTERNALSYM DBPROPVAL_DST_MDP} + DBPROPVAL_DST_TDPANDMDP = $00000003; + {$EXTERNALSYM DBPROPVAL_DST_TDPANDMDP} + MDPROPVAL_AU_UNSUPPORTED = $00000000; + {$EXTERNALSYM MDPROPVAL_AU_UNSUPPORTED} + MDPROPVAL_AU_UNCHANGED = $00000001; + {$EXTERNALSYM MDPROPVAL_AU_UNCHANGED} + MDPROPVAL_AU_UNKNOWN = $00000002; + {$EXTERNALSYM MDPROPVAL_AU_UNKNOWN} + MDPROPVAL_MF_WITH_CALCMEMBERS = $00000001; + {$EXTERNALSYM MDPROPVAL_MF_WITH_CALCMEMBERS} + MDPROPVAL_MF_WITH_NAMEDSETS = $00000002; + {$EXTERNALSYM MDPROPVAL_MF_WITH_NAMEDSETS} + MDPROPVAL_MF_CREATE_CALCMEMBERS = $00000004; + {$EXTERNALSYM MDPROPVAL_MF_CREATE_CALCMEMBERS} + MDPROPVAL_MF_CREATE_NAMEDSETS = $00000008; + {$EXTERNALSYM MDPROPVAL_MF_CREATE_NAMEDSETS} + MDPROPVAL_MF_SCOPE_SESSION = $00000010; + {$EXTERNALSYM MDPROPVAL_MF_SCOPE_SESSION} + MDPROPVAL_MF_SCOPE_GLOBAL = $00000020; + {$EXTERNALSYM MDPROPVAL_MF_SCOPE_GLOBAL} + MDPROPVAL_MMF_COUSIN = $00000001; + {$EXTERNALSYM MDPROPVAL_MMF_COUSIN} + MDPROPVAL_MMF_PARALLELPERIOD = $00000002; + {$EXTERNALSYM MDPROPVAL_MMF_PARALLELPERIOD} + MDPROPVAL_MMF_OPENINGPERIOD = $00000004; + {$EXTERNALSYM MDPROPVAL_MMF_OPENINGPERIOD} + MDPROPVAL_MMF_CLOSINGPERIOD = $00000008; + {$EXTERNALSYM MDPROPVAL_MMF_CLOSINGPERIOD} + MDPROPVAL_MNF_MEDIAN = $00000001; + {$EXTERNALSYM MDPROPVAL_MNF_MEDIAN} + MDPROPVAL_MNF_VAR = $00000002; + {$EXTERNALSYM MDPROPVAL_MNF_VAR} + MDPROPVAL_MNF_STDDEV = $00000004; + {$EXTERNALSYM MDPROPVAL_MNF_STDDEV} + MDPROPVAL_MNF_RANK = $00000008; + {$EXTERNALSYM MDPROPVAL_MNF_RANK} + MDPROPVAL_MNF_AGGREGATE = $00000010; + {$EXTERNALSYM MDPROPVAL_MNF_AGGREGATE} + MDPROPVAL_MNF_COVARIANCE = $00000020; + {$EXTERNALSYM MDPROPVAL_MNF_COVARIANCE} + MDPROPVAL_MNF_CORRELATION = $00000040; + {$EXTERNALSYM MDPROPVAL_MNF_CORRELATION} + MDPROPVAL_MNF_LINREGSLOPE = $00000080; + {$EXTERNALSYM MDPROPVAL_MNF_LINREGSLOPE} + MDPROPVAL_MNF_LINREGVARIANCE = $00000100; + {$EXTERNALSYM MDPROPVAL_MNF_LINREGVARIANCE} + MDPROPVAL_MNF_LINREG2 = $00000200; + {$EXTERNALSYM MDPROPVAL_MNF_LINREG2} + MDPROPVAL_MNF_LINREGPOINT = $00000400; + {$EXTERNALSYM MDPROPVAL_MNF_LINREGPOINT} + MDPROPVAL_MNF_DRILLDOWNLEVEL = $00000800; + {$EXTERNALSYM MDPROPVAL_MNF_DRILLDOWNLEVEL} + MDPROPVAL_MNF_DRILLDOWNMEMBERTOP = $00001000; + {$EXTERNALSYM MDPROPVAL_MNF_DRILLDOWNMEMBERTOP} + MDPROPVAL_MNF_DRILLDOWNMEMBERBOTTOM = $00002000; + {$EXTERNALSYM MDPROPVAL_MNF_DRILLDOWNMEMBERBOTTOM} + MDPROPVAL_MNF_DRILLDOWNLEVELTOP = $00004000; + {$EXTERNALSYM MDPROPVAL_MNF_DRILLDOWNLEVELTOP} + MDPROPVAL_MNF_DRILLDOWNLEVELBOTTOM = $00008000; + {$EXTERNALSYM MDPROPVAL_MNF_DRILLDOWNLEVELBOTTOM} + MDPROPVAL_MNF_DRILLUPMEMBER = $00010000; + {$EXTERNALSYM MDPROPVAL_MNF_DRILLUPMEMBER} + MDPROPVAL_MNF_DRILLUPLEVEL = $00020000; + {$EXTERNALSYM MDPROPVAL_MNF_DRILLUPLEVEL} + MDPROPVAL_MSF_TOPPERCENT = $00000001; + {$EXTERNALSYM MDPROPVAL_MSF_TOPPERCENT} + MDPROPVAL_MSF_BOTTOMPERCENT = $00000002; + {$EXTERNALSYM MDPROPVAL_MSF_BOTTOMPERCENT} + MDPROPVAL_MSF_TOPSUM = $00000004; + {$EXTERNALSYM MDPROPVAL_MSF_TOPSUM} + MDPROPVAL_MSF_BOTTOMSUM = $00000008; + {$EXTERNALSYM MDPROPVAL_MSF_BOTTOMSUM} + MDPROPVAL_MSF_PERIODSTODATE = $00000010; + {$EXTERNALSYM MDPROPVAL_MSF_PERIODSTODATE} + MDPROPVAL_MSF_LASTPERIODS = $00000020; + {$EXTERNALSYM MDPROPVAL_MSF_LASTPERIODS} + MDPROPVAL_MSF_YTD = $00000040; + {$EXTERNALSYM MDPROPVAL_MSF_YTD} + MDPROPVAL_MSF_QTD = $00000080; + {$EXTERNALSYM MDPROPVAL_MSF_QTD} + MDPROPVAL_MSF_MTD = $00000100; + {$EXTERNALSYM MDPROPVAL_MSF_MTD} + MDPROPVAL_MSF_WTD = $00000200; + {$EXTERNALSYM MDPROPVAL_MSF_WTD} + MDPROPVAL_MSF_DRILLDOWNMEMBBER = $00000400; + {$EXTERNALSYM MDPROPVAL_MSF_DRILLDOWNMEMBBER} + MDPROPVAL_MSF_DRILLDOWNLEVEL = $00000800; + {$EXTERNALSYM MDPROPVAL_MSF_DRILLDOWNLEVEL} + MDPROPVAL_MSF_DRILLDOWNMEMBERTOP = $00001000; + {$EXTERNALSYM MDPROPVAL_MSF_DRILLDOWNMEMBERTOP} + MDPROPVAL_MSF_DRILLDOWNMEMBERBOTTOM = $00002000; + {$EXTERNALSYM MDPROPVAL_MSF_DRILLDOWNMEMBERBOTTOM} + MDPROPVAL_MSF_DRILLDOWNLEVELTOP = $00004000; + {$EXTERNALSYM MDPROPVAL_MSF_DRILLDOWNLEVELTOP} + MDPROPVAL_MSF_DRILLDOWNLEVELBOTTOM = $00008000; + {$EXTERNALSYM MDPROPVAL_MSF_DRILLDOWNLEVELBOTTOM} + MDPROPVAL_MSF_DRILLUPMEMBER = $00010000; + {$EXTERNALSYM MDPROPVAL_MSF_DRILLUPMEMBER} + MDPROPVAL_MSF_DRILLUPLEVEL = $00020000; + {$EXTERNALSYM MDPROPVAL_MSF_DRILLUPLEVEL} + MDPROPVAL_MSF_TOGGLEDRILLSTATE = $00040000; + {$EXTERNALSYM MDPROPVAL_MSF_TOGGLEDRILLSTATE} + MDPROPVAL_MD_SELF = $00000001; + {$EXTERNALSYM MDPROPVAL_MD_SELF} + MDPROPVAL_MD_BEFORE = $00000002; + {$EXTERNALSYM MDPROPVAL_MD_BEFORE} + MDPROPVAL_MD_AFTER = $00000004; + {$EXTERNALSYM MDPROPVAL_MD_AFTER} + MDPROPVAL_MSC_LESSTHAN = $00000001; + {$EXTERNALSYM MDPROPVAL_MSC_LESSTHAN} + MDPROPVAL_MSC_GREATERTHAN = $00000002; + {$EXTERNALSYM MDPROPVAL_MSC_GREATERTHAN} + MDPROPVAL_MSC_LESSTHANEQUAL = $00000004; + {$EXTERNALSYM MDPROPVAL_MSC_LESSTHANEQUAL} + MDPROPVAL_MSC_GREATERTHANEQUAL = $00000008; + {$EXTERNALSYM MDPROPVAL_MSC_GREATERTHANEQUAL} + MDPROPVAL_MC_SINGLECASE = $00000001; + {$EXTERNALSYM MDPROPVAL_MC_SINGLECASE} + MDPROPVAL_MC_SEARCHEDCASE = $00000002; + {$EXTERNALSYM MDPROPVAL_MC_SEARCHEDCASE} + MDPROPVAL_MOQ_OUTERREFERENCE = $00000001; + {$EXTERNALSYM MDPROPVAL_MOQ_OUTERREFERENCE} + MDPROPVAL_MOQ_DATASOURCE_CUBE = $00000001; + {$EXTERNALSYM MDPROPVAL_MOQ_DATASOURCE_CUBE} + MDPROPVAL_MOQ_CATALOG_CUBE = $00000002; + {$EXTERNALSYM MDPROPVAL_MOQ_CATALOG_CUBE} + MDPROPVAL_MOQ_SCHEMA_CUBE = $00000004; + {$EXTERNALSYM MDPROPVAL_MOQ_SCHEMA_CUBE} + MDPROPVAL_MOQ_CUBE_DIM = $00000008; + {$EXTERNALSYM MDPROPVAL_MOQ_CUBE_DIM} + MDPROPVAL_MOQ_DIM_HIER = $00000010; + {$EXTERNALSYM MDPROPVAL_MOQ_DIM_HIER} + MDPROPVAL_MOQ_DIMHIER_LEVEL = $00000020; + {$EXTERNALSYM MDPROPVAL_MOQ_DIMHIER_LEVEL} + MDPROPVAL_MOQ_LEVEL_MEMBER = $00000040; + {$EXTERNALSYM MDPROPVAL_MOQ_LEVEL_MEMBER} + MDPROPVAL_MOQ_MEMBER_MEMBER = $00000080; + {$EXTERNALSYM MDPROPVAL_MOQ_MEMBER_MEMBER} + MDPROPVAL_FS_FULL_SUPPORT = $00000001; + {$EXTERNALSYM MDPROPVAL_FS_FULL_SUPPORT} + MDPROPVAL_FS_GENERATED_COLUMN = $00000002; + {$EXTERNALSYM MDPROPVAL_FS_GENERATED_COLUMN} + MDPROPVAL_FS_GENERATED_DIMENSION = $00000003; + {$EXTERNALSYM MDPROPVAL_FS_GENERATED_DIMENSION} + MDPROPVAL_FS_NO_SUPPORT = $00000004; + {$EXTERNALSYM MDPROPVAL_FS_NO_SUPPORT} + MDPROPVAL_NL_NAMEDLEVELS = $00000001; + {$EXTERNALSYM MDPROPVAL_NL_NAMEDLEVELS} + MDPROPVAL_NL_NUMBEREDLEVELS = $00000002; + {$EXTERNALSYM MDPROPVAL_NL_NUMBEREDLEVELS} + MDPROPVAL_MJC_SINGLECUBE = $00000001; + {$EXTERNALSYM MDPROPVAL_MJC_SINGLECUBE} + MDPROPVAL_MJC_MULTICUBES = $00000002; + {$EXTERNALSYM MDPROPVAL_MJC_MULTICUBES} + MDPROPVAL_MJC_IMPLICITCUBE = $00000004; + {$EXTERNALSYM MDPROPVAL_MJC_IMPLICITCUBE} + MDPROPVAL_RR_NORANGEROWSET = $00000001; + {$EXTERNALSYM MDPROPVAL_RR_NORANGEROWSET} + MDPROPVAL_RR_READONLY = $00000002; + {$EXTERNALSYM MDPROPVAL_RR_READONLY} + MDPROPVAL_RR_UPDATE = $00000004; + {$EXTERNALSYM MDPROPVAL_RR_UPDATE} + MDPROPVAL_MS_MULTIPLETUPLES = $00000001; + {$EXTERNALSYM MDPROPVAL_MS_MULTIPLETUPLES} + MDPROPVAL_MS_SINGLETUPLE = $00000002; + {$EXTERNALSYM MDPROPVAL_MS_SINGLETUPLE} + DBPROPVAL_AO_SEQUENTIAL = $00000000; + {$EXTERNALSYM DBPROPVAL_AO_SEQUENTIAL} + DBPROPVAL_AO_SEQUENTIALSTORAGEOBJECTS = $00000001; + {$EXTERNALSYM DBPROPVAL_AO_SEQUENTIALSTORAGEOBJECTS} + DBPROPVAL_AO_RANDOM = $00000002; + {$EXTERNALSYM DBPROPVAL_AO_RANDOM} + DBPROPVAL_BD_ROWSET = $00000000; + {$EXTERNALSYM DBPROPVAL_BD_ROWSET} + DBPROPVAL_BD_INTRANSACTION = $00000001; + {$EXTERNALSYM DBPROPVAL_BD_INTRANSACTION} + DBPROPVAL_BD_XTRANSACTION = $00000002; + {$EXTERNALSYM DBPROPVAL_BD_XTRANSACTION} + DBPROPVAL_BD_REORGANIZATION = $00000003; + {$EXTERNALSYM DBPROPVAL_BD_REORGANIZATION} + BMK_DURABILITY_ROWSET = DBPROPVAL_BD_ROWSET; + {$EXTERNALSYM BMK_DURABILITY_ROWSET} + BMK_DURABILITY_INTRANSACTION = DBPROPVAL_BD_INTRANSACTION; + {$EXTERNALSYM BMK_DURABILITY_INTRANSACTION} + BMK_DURABILITY_XTRANSACTION = DBPROPVAL_BD_XTRANSACTION; + {$EXTERNALSYM BMK_DURABILITY_XTRANSACTION} + BMK_DURABILITY_REORGANIZATION = DBPROPVAL_BD_REORGANIZATION; + {$EXTERNALSYM BMK_DURABILITY_REORGANIZATION} + DBPROPVAL_BO_NOLOG = $00000000; + {$EXTERNALSYM DBPROPVAL_BO_NOLOG} + DBPROPVAL_BO_NOINDEXUPDATE = $00000001; + {$EXTERNALSYM DBPROPVAL_BO_NOINDEXUPDATE} + DBPROPVAL_BO_REFINTEGRITY = $00000002; + {$EXTERNALSYM DBPROPVAL_BO_REFINTEGRITY} + DBPROPVAL_STGM_READ = OF_READ; + {$EXTERNALSYM DBPROPVAL_STGM_READ} + DBPROPVAL_STGM_WRITE = OF_WRITE; + {$EXTERNALSYM DBPROPVAL_STGM_WRITE} + DBPROPVAL_STGM_READWRITE = OF_READWRITE; + {$EXTERNALSYM DBPROPVAL_STGM_READWRITE} + DBPROPVAL_STGM_SHARE_DENY_NONE = OF_SHARE_DENY_NONE; + {$EXTERNALSYM DBPROPVAL_STGM_SHARE_DENY_NONE} + DBPROPVAL_STGM_SHARE_DENY_READ = OF_SHARE_DENY_READ; + {$EXTERNALSYM DBPROPVAL_STGM_SHARE_DENY_READ} + DBPROPVAL_STGM_SHARE_DENY_WRITE = OF_SHARE_DENY_WRITE; + {$EXTERNALSYM DBPROPVAL_STGM_SHARE_DENY_WRITE} + DBPROPVAL_STGM_SHARE_EXCLUSIVE = OF_SHARE_EXCLUSIVE; + {$EXTERNALSYM DBPROPVAL_STGM_SHARE_EXCLUSIVE} + DBPROPVAL_STGM_DIRECT = $00010000; + {$EXTERNALSYM DBPROPVAL_STGM_DIRECT} + DBPROPVAL_STGM_TRANSACTED = $00020000; + {$EXTERNALSYM DBPROPVAL_STGM_TRANSACTED} + DBPROPVAL_STGM_CREATE = OF_CREATE; + {$EXTERNALSYM DBPROPVAL_STGM_CREATE} + DBPROPVAL_STGM_CONVERT = $00040000; + {$EXTERNALSYM DBPROPVAL_STGM_CONVERT} + DBPROPVAL_STGM_FAILIFTHERE = $00080000; + {$EXTERNALSYM DBPROPVAL_STGM_FAILIFTHERE} + DBPROPVAL_STGM_PRIORITY = $00100000; + {$EXTERNALSYM DBPROPVAL_STGM_PRIORITY} + DBPROPVAL_STGM_DELETEONRELEASE = $00200000; + {$EXTERNALSYM DBPROPVAL_STGM_DELETEONRELEASE} + DBPROPVAL_GB_COLLATE = $00000010; + {$EXTERNALSYM DBPROPVAL_GB_COLLATE} + DBPROPVAL_CS_UNINITIALIZED = $00000000; + {$EXTERNALSYM DBPROPVAL_CS_UNINITIALIZED} + DBPROPVAL_CS_INITIALIZED = $00000001; + {$EXTERNALSYM DBPROPVAL_CS_INITIALIZED} + DBPROPVAL_CS_COMMUNICATIONFAILURE = $00000002; + {$EXTERNALSYM DBPROPVAL_CS_COMMUNICATIONFAILURE} + DBPROPVAL_RD_RESETALL = $ffffffff; + {$EXTERNALSYM DBPROPVAL_RD_RESETALL} + DBPROPVAL_OS_RESOURCEPOOLING = $00000001; + {$EXTERNALSYM DBPROPVAL_OS_RESOURCEPOOLING} + DBPROPVAL_OS_TXNENLISTMENT = $00000002; + {$EXTERNALSYM DBPROPVAL_OS_TXNENLISTMENT} + DBPROPVAL_OS_CLIENTCURSOR = $00000004; + {$EXTERNALSYM DBPROPVAL_OS_CLIENTCURSOR} + DBPROPVAL_OS_ENABLEALL = $ffffffff; + {$EXTERNALSYM DBPROPVAL_OS_ENABLEALL} + DBPROPVAL_BI_CROSSROWSET = $00000001; + {$EXTERNALSYM DBPROPVAL_BI_CROSSROWSET} + DB_IMP_LEVEL_ANONYMOUS = $00; + {$EXTERNALSYM DB_IMP_LEVEL_ANONYMOUS} + DB_IMP_LEVEL_IDENTIFY = $01; + {$EXTERNALSYM DB_IMP_LEVEL_IDENTIFY} + DB_IMP_LEVEL_IMPERSONATE = $02; + {$EXTERNALSYM DB_IMP_LEVEL_IMPERSONATE} + DB_IMP_LEVEL_DELEGATE = $03; + {$EXTERNALSYM DB_IMP_LEVEL_DELEGATE} + DBPROMPT_PROMPT = $01; + {$EXTERNALSYM DBPROMPT_PROMPT} + DBPROMPT_COMPLETE = $02; + {$EXTERNALSYM DBPROMPT_COMPLETE} + DBPROMPT_COMPLETEREQUIRED = $03; + {$EXTERNALSYM DBPROMPT_COMPLETEREQUIRED} + DBPROMPT_NOPROMPT = $04; + {$EXTERNALSYM DBPROMPT_NOPROMPT} + DB_PROT_LEVEL_NONE = $00; + {$EXTERNALSYM DB_PROT_LEVEL_NONE} + DB_PROT_LEVEL_CONNECT = $01; + {$EXTERNALSYM DB_PROT_LEVEL_CONNECT} + DB_PROT_LEVEL_CALL = $02; + {$EXTERNALSYM DB_PROT_LEVEL_CALL} + DB_PROT_LEVEL_PKT = $03; + {$EXTERNALSYM DB_PROT_LEVEL_PKT} + DB_PROT_LEVEL_PKT_INTEGRITY = $04; + {$EXTERNALSYM DB_PROT_LEVEL_PKT_INTEGRITY} + DB_PROT_LEVEL_PKT_PRIVACY = $05; + {$EXTERNALSYM DB_PROT_LEVEL_PKT_PRIVACY} + DB_MODE_READ = $01; + {$EXTERNALSYM DB_MODE_READ} + DB_MODE_WRITE = $02; + {$EXTERNALSYM DB_MODE_WRITE} + DB_MODE_READWRITE = $03; + {$EXTERNALSYM DB_MODE_READWRITE} + DB_MODE_SHARE_DENY_READ = $04; + {$EXTERNALSYM DB_MODE_SHARE_DENY_READ} + DB_MODE_SHARE_DENY_WRITE = $08; + {$EXTERNALSYM DB_MODE_SHARE_DENY_WRITE} + DB_MODE_SHARE_EXCLUSIVE = $0c; + {$EXTERNALSYM DB_MODE_SHARE_EXCLUSIVE} + DB_MODE_SHARE_DENY_NONE = $10; + {$EXTERNALSYM DB_MODE_SHARE_DENY_NONE} + DBCOMPUTEMODE_COMPUTED = $01; + {$EXTERNALSYM DBCOMPUTEMODE_COMPUTED} + DBCOMPUTEMODE_DYNAMIC = $02; + {$EXTERNALSYM DBCOMPUTEMODE_DYNAMIC} + DBCOMPUTEMODE_NOTCOMPUTED = $03; + {$EXTERNALSYM DBCOMPUTEMODE_NOTCOMPUTED} + DBPROPVAL_DF_INITIALLY_DEFERRED = $01; + {$EXTERNALSYM DBPROPVAL_DF_INITIALLY_DEFERRED} + DBPROPVAL_DF_INITIALLY_IMMEDIATE = $02; + {$EXTERNALSYM DBPROPVAL_DF_INITIALLY_IMMEDIATE} + DBPROPVAL_DF_NOT_DEFERRABLE = $03; + {$EXTERNALSYM DBPROPVAL_DF_NOT_DEFERRABLE} + DBPARAMTYPE_INPUT = $01; + {$EXTERNALSYM DBPARAMTYPE_INPUT} + DBPARAMTYPE_INPUTOUTPUT = $02; + {$EXTERNALSYM DBPARAMTYPE_INPUTOUTPUT} + DBPARAMTYPE_OUTPUT = $03; + {$EXTERNALSYM DBPARAMTYPE_OUTPUT} + DBPARAMTYPE_RETURNVALUE = $04; + {$EXTERNALSYM DBPARAMTYPE_RETURNVALUE} + DB_PT_UNKNOWN = $01; + {$EXTERNALSYM DB_PT_UNKNOWN} + DB_PT_PROCEDURE = $02; + {$EXTERNALSYM DB_PT_PROCEDURE} + DB_PT_FUNCTION = $03; + {$EXTERNALSYM DB_PT_FUNCTION} + DB_REMOTE = $01; + {$EXTERNALSYM DB_REMOTE} + DB_LOCAL_SHARED = $02; + {$EXTERNALSYM DB_LOCAL_SHARED} + DB_LOCAL_EXCLUSIVE = $03; + {$EXTERNALSYM DB_LOCAL_EXCLUSIVE} + DB_COLLATION_ASC = $01; + {$EXTERNALSYM DB_COLLATION_ASC} + DB_COLLATION_DESC = $02; + {$EXTERNALSYM DB_COLLATION_DESC} + DB_UNSEARCHABLE = $01; + {$EXTERNALSYM DB_UNSEARCHABLE} + DB_LIKE_ONLY = $02; + {$EXTERNALSYM DB_LIKE_ONLY} + DB_ALL_EXCEPT_LIKE = $03; + {$EXTERNALSYM DB_ALL_EXCEPT_LIKE} + DB_SEARCHABLE = $04; + {$EXTERNALSYM DB_SEARCHABLE} + MDTREEOP_CHILDREN = $01; + {$EXTERNALSYM MDTREEOP_CHILDREN} + MDTREEOP_SIBLINGS = $02; + {$EXTERNALSYM MDTREEOP_SIBLINGS} + MDTREEOP_PARENT = $04; + {$EXTERNALSYM MDTREEOP_PARENT} + MDTREEOP_SELF = $08; + {$EXTERNALSYM MDTREEOP_SELF} + MDTREEOP_DESCENDANTS = $10; + {$EXTERNALSYM MDTREEOP_DESCENDANTS} + MDTREEOP_ANCESTORS = $20; + {$EXTERNALSYM MDTREEOP_ANCESTORS} + MD_DIMTYPE_UNKNOWN = $00; + {$EXTERNALSYM MD_DIMTYPE_UNKNOWN} + MD_DIMTYPE_TIME = $01; + {$EXTERNALSYM MD_DIMTYPE_TIME} + MD_DIMTYPE_MEASURE = $02; + {$EXTERNALSYM MD_DIMTYPE_MEASURE} + MD_DIMTYPE_OTHER = $03; + {$EXTERNALSYM MD_DIMTYPE_OTHER} + MDLEVEL_TYPE_UNKNOWN = $0000; + {$EXTERNALSYM MDLEVEL_TYPE_UNKNOWN} + MDLEVEL_TYPE_REGULAR = $0000; + {$EXTERNALSYM MDLEVEL_TYPE_REGULAR} + MDLEVEL_TYPE_ALL = $0001; + {$EXTERNALSYM MDLEVEL_TYPE_ALL} + MDLEVEL_TYPE_CALCULATED = $0002; + {$EXTERNALSYM MDLEVEL_TYPE_CALCULATED} + MDLEVEL_TYPE_TIME = $0004; + {$EXTERNALSYM MDLEVEL_TYPE_TIME} + MDLEVEL_TYPE_RESERVED1 = $0008; + {$EXTERNALSYM MDLEVEL_TYPE_RESERVED1} + MDLEVEL_TYPE_TIME_YEARS = $0014; + {$EXTERNALSYM MDLEVEL_TYPE_TIME_YEARS} + MDLEVEL_TYPE_TIME_HALF_YEAR = $0024; + {$EXTERNALSYM MDLEVEL_TYPE_TIME_HALF_YEAR} + MDLEVEL_TYPE_TIME_QUARTERS = $0044; + {$EXTERNALSYM MDLEVEL_TYPE_TIME_QUARTERS} + MDLEVEL_TYPE_TIME_MONTHS = $0084; + {$EXTERNALSYM MDLEVEL_TYPE_TIME_MONTHS} + MDLEVEL_TYPE_TIME_WEEKS = $0104; + {$EXTERNALSYM MDLEVEL_TYPE_TIME_WEEKS} + MDLEVEL_TYPE_TIME_DAYS = $0204; + {$EXTERNALSYM MDLEVEL_TYPE_TIME_DAYS} + MDLEVEL_TYPE_TIME_HOURS = $0304; + {$EXTERNALSYM MDLEVEL_TYPE_TIME_HOURS} + MDLEVEL_TYPE_TIME_MINUTES = $0404; + {$EXTERNALSYM MDLEVEL_TYPE_TIME_MINUTES} + MDLEVEL_TYPE_TIME_SECONDS = $0804; + {$EXTERNALSYM MDLEVEL_TYPE_TIME_SECONDS} + MDLEVEL_TYPE_TIME_UNDEFINED = $1004; + {$EXTERNALSYM MDLEVEL_TYPE_TIME_UNDEFINED} + MDMEASURE_AGGR_UNKNOWN = $00; + {$EXTERNALSYM MDMEASURE_AGGR_UNKNOWN} + MDMEASURE_AGGR_SUM = $01; + {$EXTERNALSYM MDMEASURE_AGGR_SUM} + MDMEASURE_AGGR_COUNT = $02; + {$EXTERNALSYM MDMEASURE_AGGR_COUNT} + MDMEASURE_AGGR_MIN = $03; + {$EXTERNALSYM MDMEASURE_AGGR_MIN} + MDMEASURE_AGGR_MAX = $04; + {$EXTERNALSYM MDMEASURE_AGGR_MAX} + MDMEASURE_AGGR_AVG = $05; + {$EXTERNALSYM MDMEASURE_AGGR_AVG} + MDMEASURE_AGGR_VAR = $06; + {$EXTERNALSYM MDMEASURE_AGGR_VAR} + MDMEASURE_AGGR_STD = $07; + {$EXTERNALSYM MDMEASURE_AGGR_STD} + MDMEASURE_AGGR_CALCULATED = $7f; + {$EXTERNALSYM MDMEASURE_AGGR_CALCULATED} + MDPROP_MEMBER = $01; + {$EXTERNALSYM MDPROP_MEMBER} + MDPROP_CELL = $02; + {$EXTERNALSYM MDPROP_CELL} + MDMEMBER_TYPE_UNKNOWN = $00; + {$EXTERNALSYM MDMEMBER_TYPE_UNKNOWN} + MDMEMBER_TYPE_REGULAR = $01; + {$EXTERNALSYM MDMEMBER_TYPE_REGULAR} + MDMEMBER_TYPE_ALL = $02; + {$EXTERNALSYM MDMEMBER_TYPE_ALL} + MDMEMBER_TYPE_MEASURE = $03; + {$EXTERNALSYM MDMEMBER_TYPE_MEASURE} + MDMEMBER_TYPE_FORMULA = $04; + {$EXTERNALSYM MDMEMBER_TYPE_FORMULA} + MDMEMBER_TYPE_RESERVE1 = $05; + {$EXTERNALSYM MDMEMBER_TYPE_RESERVE1} + MDMEMBER_TYPE_RESERVE2 = $06; + {$EXTERNALSYM MDMEMBER_TYPE_RESERVE2} + MDMEMBER_TYPE_RESERVE3 = $07; + {$EXTERNALSYM MDMEMBER_TYPE_RESERVE3} + MDMEMBER_TYPE_RESERVE4 = $08; + {$EXTERNALSYM MDMEMBER_TYPE_RESERVE4} + MDDISPINFO_DRILLED_DOWN = $00010000; + {$EXTERNALSYM MDDISPINFO_DRILLED_DOWN} + MDDISPINFO_PARENT_SAME_AS_PREV = $00020000; + {$EXTERNALSYM MDDISPINFO_PARENT_SAME_AS_PREV} + DB_COUNTUNAVAILABLE = -1; + {$EXTERNALSYM DB_COUNTUNAVAILABLE} + MDFF_BOLD = $01; + {$EXTERNALSYM MDFF_BOLD} + MDFF_ITALIC = $02; + {$EXTERNALSYM MDFF_ITALIC} + MDFF_UNDERLINE = $04; + {$EXTERNALSYM MDFF_UNDERLINE} + MDFF_STRIKEOUT = $08; + {$EXTERNALSYM MDFF_STRIKEOUT} + MDAXIS_COLUMNS = $00000000; + {$EXTERNALSYM MDAXIS_COLUMNS} + MDAXIS_ROWS = $00000001; + {$EXTERNALSYM MDAXIS_ROWS} + MDAXIS_PAGES = $00000002; + {$EXTERNALSYM MDAXIS_PAGES} + MDAXIS_SECTIONS = $00000003; + {$EXTERNALSYM MDAXIS_SECTIONS} + MDAXIS_CHAPTERS = $00000004; + {$EXTERNALSYM MDAXIS_CHAPTERS} + MDAXIS_SLICERS = $ffffffff; + {$EXTERNALSYM MDAXIS_SLICERS} + GENERATE_METHOD_EXACT = 0; + {$EXTERNALSYM GENERATE_METHOD_EXACT} + GENERATE_METHOD_PREFIX = 1; + {$EXTERNALSYM GENERATE_METHOD_PREFIX} + GENERATE_METHOD_INFLECT = 2; + {$EXTERNALSYM GENERATE_METHOD_INFLECT} + PROPID_QUERY_RANKVECTOR = $2; + {$EXTERNALSYM PROPID_QUERY_RANKVECTOR} + PROPID_QUERY_RANK = $3; + {$EXTERNALSYM PROPID_QUERY_RANK} + PROPID_QUERY_HITCOUNT = $4; + {$EXTERNALSYM PROPID_QUERY_HITCOUNT} + PROPID_QUERY_ALL = $6; + {$EXTERNALSYM PROPID_QUERY_ALL} + PROPID_STG_CONTENTS = $13; + {$EXTERNALSYM PROPID_STG_CONTENTS} + VECTOR_RANK_MIN = 0; + {$EXTERNALSYM VECTOR_RANK_MIN} + VECTOR_RANK_MAX = 1; + {$EXTERNALSYM VECTOR_RANK_MAX} + VECTOR_RANK_INNER = 2; + {$EXTERNALSYM VECTOR_RANK_INNER} + VECTOR_RANK_DICE = 3; + {$EXTERNALSYM VECTOR_RANK_DICE} + VECTOR_RANK_JACCARD = 4; + {$EXTERNALSYM VECTOR_RANK_JACCARD} + DBSETFUNC_NONE = $0; + {$EXTERNALSYM DBSETFUNC_NONE} + DBSETFUNC_ALL = $1; + {$EXTERNALSYM DBSETFUNC_ALL} + DBSETFUNC_DISTINCT = $2; + {$EXTERNALSYM DBSETFUNC_DISTINCT} + PROXIMITY_UNIT_WORD = 0; + {$EXTERNALSYM PROXIMITY_UNIT_WORD} + PROXIMITY_UNIT_SENTENCE = 1; + {$EXTERNALSYM PROXIMITY_UNIT_SENTENCE} + PROXIMITY_UNIT_PARAGRAPH = 2; + {$EXTERNALSYM PROXIMITY_UNIT_PARAGRAPH} + PROXIMITY_UNIT_CHAPTER = 3; + {$EXTERNALSYM PROXIMITY_UNIT_CHAPTER} + CRESTRICTIONS_DBSCHEMA_ASSERTIONS = 3; + {$EXTERNALSYM CRESTRICTIONS_DBSCHEMA_ASSERTIONS} + CRESTRICTIONS_DBSCHEMA_CATALOGS = 1; + {$EXTERNALSYM CRESTRICTIONS_DBSCHEMA_CATALOGS} + CRESTRICTIONS_DBSCHEMA_CHARACTER_SETS = 3; + {$EXTERNALSYM CRESTRICTIONS_DBSCHEMA_CHARACTER_SETS} + CRESTRICTIONS_DBSCHEMA_COLLATIONS = 3; + {$EXTERNALSYM CRESTRICTIONS_DBSCHEMA_COLLATIONS} + CRESTRICTIONS_DBSCHEMA_COLUMNS = 4; + {$EXTERNALSYM CRESTRICTIONS_DBSCHEMA_COLUMNS} + CRESTRICTIONS_DBSCHEMA_CHECK_CONSTRAINTS = 3; + {$EXTERNALSYM CRESTRICTIONS_DBSCHEMA_CHECK_CONSTRAINTS} + CRESTRICTIONS_DBSCHEMA_CONSTRAINT_COLUMN_USAGE = 4; + {$EXTERNALSYM CRESTRICTIONS_DBSCHEMA_CONSTRAINT_COLUMN_USAGE} + CRESTRICTIONS_DBSCHEMA_CONSTRAINT_TABLE_USAGE = 3; + {$EXTERNALSYM CRESTRICTIONS_DBSCHEMA_CONSTRAINT_TABLE_USAGE} + CRESTRICTIONS_DBSCHEMA_KEY_COLUMN_USAGE = 7; + {$EXTERNALSYM CRESTRICTIONS_DBSCHEMA_KEY_COLUMN_USAGE} + CRESTRICTIONS_DBSCHEMA_REFERENTIAL_CONSTRAINTS = 3; + {$EXTERNALSYM CRESTRICTIONS_DBSCHEMA_REFERENTIAL_CONSTRAINTS} + CRESTRICTIONS_DBSCHEMA_TABLE_CONSTRAINTS = 7; + {$EXTERNALSYM CRESTRICTIONS_DBSCHEMA_TABLE_CONSTRAINTS} + CRESTRICTIONS_DBSCHEMA_COLUMN_DOMAIN_USAGE = 4; + {$EXTERNALSYM CRESTRICTIONS_DBSCHEMA_COLUMN_DOMAIN_USAGE} + CRESTRICTIONS_DBSCHEMA_INDEXES = 5; + {$EXTERNALSYM CRESTRICTIONS_DBSCHEMA_INDEXES} + CRESTRICTIONS_DBSCHEMA_OBJECT_ACTIONS = 1; + {$EXTERNALSYM CRESTRICTIONS_DBSCHEMA_OBJECT_ACTIONS} + CRESTRICTIONS_DBSCHEMA_OBJECTS = 1; + {$EXTERNALSYM CRESTRICTIONS_DBSCHEMA_OBJECTS} + CRESTRICTIONS_DBSCHEMA_COLUMN_PRIVILEGES = 6; + {$EXTERNALSYM CRESTRICTIONS_DBSCHEMA_COLUMN_PRIVILEGES} + CRESTRICTIONS_DBSCHEMA_TABLE_PRIVILEGES = 5; + {$EXTERNALSYM CRESTRICTIONS_DBSCHEMA_TABLE_PRIVILEGES} + CRESTRICTIONS_DBSCHEMA_USAGE_PRIVILEGES = 6; + {$EXTERNALSYM CRESTRICTIONS_DBSCHEMA_USAGE_PRIVILEGES} + CRESTRICTIONS_DBSCHEMA_PROCEDURES = 4; + {$EXTERNALSYM CRESTRICTIONS_DBSCHEMA_PROCEDURES} + CRESTRICTIONS_DBSCHEMA_SCHEMATA = 3; + {$EXTERNALSYM CRESTRICTIONS_DBSCHEMA_SCHEMATA} + CRESTRICTIONS_DBSCHEMA_SQL_LANGUAGES = 0; + {$EXTERNALSYM CRESTRICTIONS_DBSCHEMA_SQL_LANGUAGES} + CRESTRICTIONS_DBSCHEMA_STATISTICS = 3; + {$EXTERNALSYM CRESTRICTIONS_DBSCHEMA_STATISTICS} + CRESTRICTIONS_DBSCHEMA_TABLES = 4; + {$EXTERNALSYM CRESTRICTIONS_DBSCHEMA_TABLES} + CRESTRICTIONS_DBSCHEMA_TRANSLATIONS = 3; + {$EXTERNALSYM CRESTRICTIONS_DBSCHEMA_TRANSLATIONS} + CRESTRICTIONS_DBSCHEMA_PROVIDER_TYPES = 2; + {$EXTERNALSYM CRESTRICTIONS_DBSCHEMA_PROVIDER_TYPES} + CRESTRICTIONS_DBSCHEMA_VIEWS = 3; + {$EXTERNALSYM CRESTRICTIONS_DBSCHEMA_VIEWS} + CRESTRICTIONS_DBSCHEMA_VIEW_COLUMN_USAGE = 3; + {$EXTERNALSYM CRESTRICTIONS_DBSCHEMA_VIEW_COLUMN_USAGE} + CRESTRICTIONS_DBSCHEMA_VIEW_TABLE_USAGE = 3; + {$EXTERNALSYM CRESTRICTIONS_DBSCHEMA_VIEW_TABLE_USAGE} + CRESTRICTIONS_DBSCHEMA_PROCEDURE_PARAMETERS = 4; + {$EXTERNALSYM CRESTRICTIONS_DBSCHEMA_PROCEDURE_PARAMETERS} + CRESTRICTIONS_DBSCHEMA_FOREIGN_KEYS = 6; + {$EXTERNALSYM CRESTRICTIONS_DBSCHEMA_FOREIGN_KEYS} + CRESTRICTIONS_DBSCHEMA_PRIMARY_KEYS = 3; + {$EXTERNALSYM CRESTRICTIONS_DBSCHEMA_PRIMARY_KEYS} + CRESTRICTIONS_DBSCHEMA_PROCEDURE_COLUMNS = 4; + {$EXTERNALSYM CRESTRICTIONS_DBSCHEMA_PROCEDURE_COLUMNS} + CRESTRICTIONS_DBSCHEMA_TABLES_INFO = 4; + {$EXTERNALSYM CRESTRICTIONS_DBSCHEMA_TABLES_INFO} + CRESTRICTIONS_MDSCHEMA_CUBES = 3; + {$EXTERNALSYM CRESTRICTIONS_MDSCHEMA_CUBES} + CRESTRICTIONS_MDSCHEMA_DIMENSIONS = 5; + {$EXTERNALSYM CRESTRICTIONS_MDSCHEMA_DIMENSIONS} + CRESTRICTIONS_MDSCHEMA_HIERARCHIES = 6; + {$EXTERNALSYM CRESTRICTIONS_MDSCHEMA_HIERARCHIES} + CRESTRICTIONS_MDSCHEMA_LEVELS = 7; + {$EXTERNALSYM CRESTRICTIONS_MDSCHEMA_LEVELS} + CRESTRICTIONS_MDSCHEMA_MEASURES = 5; + {$EXTERNALSYM CRESTRICTIONS_MDSCHEMA_MEASURES} + CRESTRICTIONS_MDSCHEMA_PROPERTIES = 9; + {$EXTERNALSYM CRESTRICTIONS_MDSCHEMA_PROPERTIES} + CRESTRICTIONS_MDSCHEMA_MEMBERS = 12; + {$EXTERNALSYM CRESTRICTIONS_MDSCHEMA_MEMBERS} + +// *********************************************************************// +// Declaration of Enumerations // +// *********************************************************************// + +// TX_MISC_CONSTANTS constants + +type + TOleEnum = Integer; + TX_MISC_CONSTANTS = TOleEnum; + {$EXTERNALSYM TX_MISC_CONSTANTS} +const + MAX_TRAN_DESC = $00000028; + {$EXTERNALSYM MAX_TRAN_DESC} + +// ISOLATIONLEVEL constants +type + ISOLATIONLEVEL = TOleEnum; + {$EXTERNALSYM ISOLATIONLEVEL} +const + ISOLATIONLEVEL_UNSPECIFIED = $FFFFFFFF; + {$EXTERNALSYM ISOLATIONLEVEL_UNSPECIFIED} + ISOLATIONLEVEL_CHAOS = $00000010; + {$EXTERNALSYM ISOLATIONLEVEL_CHAOS} + ISOLATIONLEVEL_READUNCOMMITTED = $00000100; + {$EXTERNALSYM ISOLATIONLEVEL_READUNCOMMITTED} + ISOLATIONLEVEL_BROWSE = $00000100; + {$EXTERNALSYM ISOLATIONLEVEL_BROWSE} + ISOLATIONLEVEL_CURSORSTABILITY = $00001000; + {$EXTERNALSYM ISOLATIONLEVEL_CURSORSTABILITY} + ISOLATIONLEVEL_READCOMMITTED = $00001000; + {$EXTERNALSYM ISOLATIONLEVEL_READCOMMITTED} + ISOLATIONLEVEL_REPEATABLEREAD = $00010000; + {$EXTERNALSYM ISOLATIONLEVEL_REPEATABLEREAD} + ISOLATIONLEVEL_SERIALIZABLE = $00100000; + {$EXTERNALSYM ISOLATIONLEVEL_SERIALIZABLE} + ISOLATIONLEVEL_ISOLATED = $00100000; + {$EXTERNALSYM ISOLATIONLEVEL_ISOLATED} + ISOLATIONLEVEL_SNAPSHOT = $01000000; + {$EXTERNALSYM ISOLATIONLEVEL_SNAPSHOT} + +// ISOFLAG constants +type + ISOFLAG = TOleEnum; + {$EXTERNALSYM ISOFLAG} +const + ISOFLAG_RETAIN_COMMIT_DC = $00000001; + {$EXTERNALSYM ISOFLAG_RETAIN_COMMIT_DC} + ISOFLAG_RETAIN_COMMIT = $00000002; + {$EXTERNALSYM ISOFLAG_RETAIN_COMMIT} + ISOFLAG_RETAIN_COMMIT_NO = $00000003; + {$EXTERNALSYM ISOFLAG_RETAIN_COMMIT_NO} + ISOFLAG_RETAIN_ABORT_DC = $00000004; + {$EXTERNALSYM ISOFLAG_RETAIN_ABORT_DC} + ISOFLAG_RETAIN_ABORT = $00000008; + {$EXTERNALSYM ISOFLAG_RETAIN_ABORT} + ISOFLAG_RETAIN_ABORT_NO = $0000000C; + {$EXTERNALSYM ISOFLAG_RETAIN_ABORT_NO} + ISOFLAG_RETAIN_DONTCARE = $00000005; + {$EXTERNALSYM ISOFLAG_RETAIN_ABORT_NO} + ISOFLAG_RETAIN_BOTH = $0000000A; + {$EXTERNALSYM ISOFLAG_RETAIN_BOTH} + ISOFLAG_RETAIN_NONE = $0000000F; + {$EXTERNALSYM ISOFLAG_RETAIN_NONE} + ISOFLAG_OPTIMISTIC = $00000010; + {$EXTERNALSYM ISOFLAG_OPTIMISTIC} + ISOFLAG_READONLY = $00000020; + {$EXTERNALSYM ISOFLAG_READONLY} + +// XACTTC constants +type + XACTTC = TOleEnum; + {$EXTERNALSYM XACTTC} +const + XACTTC_SYNC_PHASEONE = $00000001; + {$EXTERNALSYM XACTTC_SYNC_PHASEONE} + XACTTC_SYNC_PHASETWO = $00000002; + {$EXTERNALSYM XACTTC_SYNC_PHASETWO} + XACTTC_SYNC = $00000002; + {$EXTERNALSYM XACTTC_SYNC} + XACTTC_ASYNC_PHASEONE = $00000004; + {$EXTERNALSYM XACTTC_ASYNC_PHASEONE} + XACTTC_ASYNC = $00000004; + {$EXTERNALSYM XACTTC_ASYNC} + +// XACTRM constants +type + XACTRM = TOleEnum; + {$EXTERNALSYM XACTRM} +const + XACTRM_OPTIMISTICLASTWINS = $00000001; + {$EXTERNALSYM XACTRM_OPTIMISTICLASTWINS} + XACTRM_NOREADONLYPREPARES = $00000002; + {$EXTERNALSYM XACTRM_NOREADONLYPREPARES} + +// XACTCONST constants +type + XACTCONST = TOleEnum; + {$EXTERNALSYM XACTCONST} +const + XACTCONST_TIMEOUTINFINITE = $00000000; + {$EXTERNALSYM XACTCONST_TIMEOUTINFINITE} + +// XACTHEURISTIC constants +type + XACTHEURISTIC = TOleEnum; + {$EXTERNALSYM XACTHEURISTIC} +const + XACTHEURISTIC_ABORT = $00000001; + {$EXTERNALSYM XACTHEURISTIC_ABORT} + XACTHEURISTIC_COMMIT = $00000002; + {$EXTERNALSYM XACTHEURISTIC_COMMIT} + XACTHEURISTIC_DAMAGE = $00000003; + {$EXTERNALSYM XACTHEURISTIC_DAMAGE} + XACTHEURISTIC_DANGER = $00000004; + {$EXTERNALSYM XACTHEURISTIC_DANGER} + +// XACTSTAT constants +type + XACTSTAT = TOleEnum; + {$EXTERNALSYM XACTSTAT} +const + XACTSTAT_NONE = $00000000; + {$EXTERNALSYM XACTSTAT_NONE} + XACTSTAT_OPENNORMAL = $00000001; + {$EXTERNALSYM XACTSTAT_OPENNORMAL} + XACTSTAT_OPENREFUSED = $00000002; + {$EXTERNALSYM XACTSTAT_OPENREFUSED} + XACTSTAT_PREPARING = $00000004; + {$EXTERNALSYM XACTSTAT_PREPARING} + XACTSTAT_PREPARED = $00000008; + {$EXTERNALSYM XACTSTAT_PREPARED} + XACTSTAT_PREPARERETAINING = $00000010; + {$EXTERNALSYM XACTSTAT_PREPARERETAINING} + XACTSTAT_PREPARERETAINED = $00000020; + {$EXTERNALSYM XACTSTAT_PREPARERETAINED} + XACTSTAT_COMMITTING = $00000040; + {$EXTERNALSYM XACTSTAT_COMMITTING} + XACTSTAT_COMMITRETAINING = $00000080; + {$EXTERNALSYM XACTSTAT_COMMITRETAINING} + XACTSTAT_ABORTING = $00000100; + {$EXTERNALSYM XACTSTAT_ABORTING} + XACTSTAT_ABORTED = $00000200; + {$EXTERNALSYM XACTSTAT_ABORTED} + XACTSTAT_COMMITTED = $00000400; + {$EXTERNALSYM XACTSTAT_COMMITTED} + XACTSTAT_HEURISTIC_ABORT = $00000800; + {$EXTERNALSYM XACTSTAT_HEURISTIC_ABORT} + XACTSTAT_HEURISTIC_COMMIT = $00001000; + {$EXTERNALSYM XACTSTAT_HEURISTIC_COMMIT} + XACTSTAT_HEURISTIC_DAMAGE = $00002000; + {$EXTERNALSYM XACTSTAT_HEURISTIC_DAMAGE} + XACTSTAT_HEURISTIC_DANGER = $00004000; + {$EXTERNALSYM XACTSTAT_HEURISTIC_DANGER} + XACTSTAT_FORCED_ABORT = $00008000; + {$EXTERNALSYM XACTSTAT_FORCED_ABORT} + XACTSTAT_FORCED_COMMIT = $00010000; + {$EXTERNALSYM XACTSTAT_FORCED_COMMIT} + XACTSTAT_INDOUBT = $00020000; + {$EXTERNALSYM XACTSTAT_INDOUBT} + XACTSTAT_CLOSED = $00040000; + {$EXTERNALSYM XACTSTAT_CLOSED} + XACTSTAT_OPEN = $00000003; + {$EXTERNALSYM XACTSTAT_OPEN} + XACTSTAT_NOTPREPARED = $0007FFC3; + {$EXTERNALSYM XACTSTAT_NOTPREPARED} + XACTSTAT_ALL = $0007FFFF; + {$EXTERNALSYM XACTSTAT_ALL} + +// XACT_E constants +type + XACT_E = TOleEnum; + {$EXTERNALSYM XACT_E} +const + XACT_E_FIRST = $8004D000; + {$EXTERNALSYM XACT_E_FIRST} + XACT_E_LAST = $8004D01E; + {$EXTERNALSYM XACT_E_LAST} + XACT_S_FIRST = $0004D000; + {$EXTERNALSYM XACT_S_FIRST} + XACT_S_LAST = $0004D009; + {$EXTERNALSYM XACT_S_LAST} + XACT_E_ALREADYOTHERSINGLEPHASE = $8004D000; + {$EXTERNALSYM XACT_E_ALREADYOTHERSINGLEPHASE} + XACT_E_CANTRETAIN = $8004D001; + {$EXTERNALSYM XACT_E_CANTRETAIN} + XACT_E_COMMITFAILED = $8004D002; + {$EXTERNALSYM XACT_E_COMMITFAILED} + XACT_E_COMMITPREVENTED = $8004D003; + {$EXTERNALSYM XACT_E_COMMITPREVENTED} + XACT_E_HEURISTICABORT = $8004D004; + {$EXTERNALSYM XACT_E_HEURISTICABORT} + XACT_E_HEURISTICCOMMIT = $8004D005; + {$EXTERNALSYM XACT_E_HEURISTICCOMMIT} + XACT_E_HEURISTICDAMAGE = $8004D006; + {$EXTERNALSYM XACT_E_HEURISTICDAMAGE} + XACT_E_HEURISTICDANGER = $8004D007; + {$EXTERNALSYM XACT_E_HEURISTICDANGER} + XACT_E_ISOLATIONLEVEL = $8004D008; + {$EXTERNALSYM XACT_E_ISOLATIONLEVEL} + XACT_E_NOASYNC = $8004D009; + {$EXTERNALSYM XACT_E_NOASYNC} + XACT_E_NOENLIST = $8004D00A; + {$EXTERNALSYM XACT_E_NOENLIST} + XACT_E_NOISORETAIN = $8004D00B; + {$EXTERNALSYM XACT_E_NOISORETAIN} + XACT_E_NORESOURCE = $8004D00C; + {$EXTERNALSYM XACT_E_NORESOURCE} + XACT_E_NOTCURRENT = $8004D00D; + {$EXTERNALSYM XACT_E_NOTCURRENT} + XACT_E_NOTRANSACTION = $8004D00E; + {$EXTERNALSYM XACT_E_NOTRANSACTION} + XACT_E_NOTSUPPORTED = $8004D00F; + {$EXTERNALSYM XACT_E_NOTSUPPORTED} + XACT_E_UNKNOWNRMGRID = $8004D010; + {$EXTERNALSYM XACT_E_UNKNOWNRMGRID} + XACT_E_WRONGSTATE = $8004D011; + {$EXTERNALSYM XACT_E_WRONGSTATE} + XACT_E_WRONGUOW = $8004D012; + {$EXTERNALSYM XACT_E_WRONGUOW} + XACT_E_XTIONEXISTS = $8004D013; + {$EXTERNALSYM XACT_E_XTIONEXISTS} + XACT_E_NOIMPORTOBJECT = $8004D014; + {$EXTERNALSYM XACT_E_NOIMPORTOBJECT} + XACT_E_INVALIDCOOKIE = $8004D015; + {$EXTERNALSYM XACT_E_INVALIDCOOKIE} + XACT_E_INDOUBT = $8004D016; + {$EXTERNALSYM XACT_E_INDOUBT} + XACT_E_NOTIMEOUT = $8004D017; + {$EXTERNALSYM XACT_E_NOTIMEOUT} + XACT_E_ALREADYINPROGRESS = $8004D018; + {$EXTERNALSYM XACT_E_ALREADYINPROGRESS} + XACT_E_ABORTED = $8004D019; + {$EXTERNALSYM XACT_E_ABORTED} + XACT_E_LOGFULL = $8004D01A; + {$EXTERNALSYM XACT_E_LOGFULL} + XACT_E_TMNOTAVAILABLE = $8004D01B; + {$EXTERNALSYM XACT_E_TMNOTAVAILABLE} + XACT_E_CONNECTION_DOWN = $8004D01C; + {$EXTERNALSYM XACT_E_CONNECTION_DOWN} + XACT_E_CONNECTION_DENIED = $8004D01D; + {$EXTERNALSYM XACT_E_CONNECTION_DENIED} + XACT_E_REENLISTTIMEOUT = $8004D01E; + {$EXTERNALSYM XACT_E_REENLISTTIMEOUT} + XACT_S_ASYNC = $0004D000; + {$EXTERNALSYM XACT_S_ASYNC} + XACT_S_DEFECT = $0004D001; + {$EXTERNALSYM XACT_S_DEFECT} + XACT_S_READONLY = $0004D002; + {$EXTERNALSYM XACT_S_READONLY} + XACT_S_SOMENORETAIN = $0004D003; + {$EXTERNALSYM XACT_S_SOMENORETAIN} + XACT_S_OKINFORM = $0004D004; + {$EXTERNALSYM XACT_S_OKINFORM} + XACT_S_MADECHANGESCONTENT = $0004D005; + {$EXTERNALSYM XACT_S_MADECHANGESCONTENT} + XACT_S_MADECHANGESINFORM = $0004D006; + {$EXTERNALSYM XACT_S_MADECHANGESINFORM} + XACT_S_ALLNORETAIN = $0004D007; + {$EXTERNALSYM XACT_S_ALLNORETAIN} + XACT_S_ABORTING = $0004D008; + {$EXTERNALSYM XACT_S_ABORTING} + XACT_S_SINGLEPHASE = $0004D009; + {$EXTERNALSYM XACT_S_SINGLEPHASE} + +// DBKINDENUM constants +type + DBKINDENUM = TOleEnum; + {$EXTERNALSYM DBKINDENUM} +const + DBKIND_GUID_NAME = $00000000; + {$EXTERNALSYM DBKIND_GUID_NAME} + DBKIND_GUID_PROPID = $00000001; + {$EXTERNALSYM DBKIND_GUID_PROPID} + DBKIND_NAME = $00000002; + {$EXTERNALSYM DBKIND_NAME} + DBKIND_PGUID_NAME = $00000003; + {$EXTERNALSYM DBKIND_PGUID_NAME} + DBKIND_PGUID_PROPID = $00000004; + {$EXTERNALSYM DBKIND_PGUID_PROPID} + DBKIND_PROPID = $00000005; + {$EXTERNALSYM DBKIND_PROPID} + DBKIND_GUID = $00000006; + {$EXTERNALSYM DBKIND_GUID} + +const + DBTYPE_EMPTY = $00000000; + {$EXTERNALSYM DBTYPE_EMPTY} + DBTYPE_NULL = $00000001; + {$EXTERNALSYM DBTYPE_NULL} + DBTYPE_I2 = $00000002; + {$EXTERNALSYM DBTYPE_I2} + DBTYPE_I4 = $00000003; + {$EXTERNALSYM DBTYPE_I4} + DBTYPE_R4 = $00000004; + {$EXTERNALSYM DBTYPE_R4} + DBTYPE_R8 = $00000005; + {$EXTERNALSYM DBTYPE_R8} + DBTYPE_CY = $00000006; + {$EXTERNALSYM DBTYPE_CY} + DBTYPE_DATE = $00000007; + {$EXTERNALSYM DBTYPE_DATE} + DBTYPE_BSTR = $00000008; + {$EXTERNALSYM DBTYPE_BSTR} + DBTYPE_IDISPATCH = $00000009; + {$EXTERNALSYM DBTYPE_IDISPATCH} + DBTYPE_ERROR = $0000000A; + {$EXTERNALSYM DBTYPE_ERROR} + DBTYPE_BOOL = $0000000B; + {$EXTERNALSYM DBTYPE_BOOL} + DBTYPE_VARIANT = $0000000C; + {$EXTERNALSYM DBTYPE_VARIANT} + DBTYPE_IUNKNOWN = $0000000D; + {$EXTERNALSYM DBTYPE_IUNKNOWN} + DBTYPE_DECIMAL = $0000000E; + {$EXTERNALSYM DBTYPE_DECIMAL} + DBTYPE_UI1 = $00000011; + {$EXTERNALSYM DBTYPE_UI1} + DBTYPE_ARRAY = $00002000; + {$EXTERNALSYM DBTYPE_ARRAY} + DBTYPE_BYREF = $00004000; + {$EXTERNALSYM DBTYPE_BYREF} + DBTYPE_I1 = $00000010; + {$EXTERNALSYM DBTYPE_I1} + DBTYPE_UI2 = $00000012; + {$EXTERNALSYM DBTYPE_UI2} + DBTYPE_UI4 = $00000013; + {$EXTERNALSYM DBTYPE_UI4} + DBTYPE_I8 = $00000014; + {$EXTERNALSYM DBTYPE_I8} + DBTYPE_UI8 = $00000015; + {$EXTERNALSYM DBTYPE_UI8} + DBTYPE_GUID = $00000048; + {$EXTERNALSYM DBTYPE_GUID} + DBTYPE_VECTOR = $00001000; + {$EXTERNALSYM DBTYPE_VECTOR} + DBTYPE_RESERVED = $00008000; + {$EXTERNALSYM DBTYPE_RESERVED} + DBTYPE_BYTES = $00000080; + {$EXTERNALSYM DBTYPE_BYTES} + DBTYPE_STR = $00000081; + {$EXTERNALSYM DBTYPE_STR} + DBTYPE_WSTR = $00000082; + {$EXTERNALSYM DBTYPE_WSTR} + DBTYPE_NUMERIC = $00000083; + {$EXTERNALSYM DBTYPE_NUMERIC} + DBTYPE_UDT = $00000084; + {$EXTERNALSYM DBTYPE_UDT} + DBTYPE_DBDATE = $00000085; + {$EXTERNALSYM DBTYPE_DBDATE} + DBTYPE_DBTIME = $00000086; + {$EXTERNALSYM DBTYPE_DBTIME} + DBTYPE_DBTIMESTAMP = $00000087; + {$EXTERNALSYM DBTYPE_DBTIMESTAMP} + DBTYPE_XML = $0000008D; // introduced in SQL 2005 + {$EXTERNALSYM DBTYPE_XML} + +// DBTYPEENUM constants +type + DBTYPEENUM = TOleEnum; + {$EXTERNALSYM DBTYPEENUM} + +// DBTYPEENUM15 constants +type + DBTYPEENUM15 = TOleEnum; + {$EXTERNALSYM DBTYPEENUM15} +const + DBTYPE_HCHAPTER = $00000088; + {$EXTERNALSYM DBTYPE_HCHAPTER} + +// DBTYPEENUM20 constants +type + DBTYPEENUM20 = TOleEnum; + {$EXTERNALSYM DBTYPEENUM20} +const + DBTYPE_FILETIME = $00000040; + {$EXTERNALSYM DBTYPE_FILETIME} + DBTYPE_DBFILETIME = $00000089; + {$EXTERNALSYM DBTYPE_DBFILETIME} + DBTYPE_PROPVARIANT = $0000008A; + {$EXTERNALSYM DBTYPE_PROPVARIANT} + DBTYPE_VARNUMERIC = $0000008B; + {$EXTERNALSYM DBTYPE_VARNUMERIC} + +// DBPARTENUM constants +type + DBPARTENUM = TOleEnum; + {$EXTERNALSYM DBPARTENUM} +const + DBPART_INVALID = $00000000; + {$EXTERNALSYM DBPART_INVALID} + DBPART_VALUE = $00000001; + {$EXTERNALSYM DBPART_VALUE} + DBPART_LENGTH = $00000002; + {$EXTERNALSYM DBPART_LENGTH} + DBPART_STATUS = $00000004; + {$EXTERNALSYM DBPART_STATUS} + +// DBPARAMIOENUM constants +type + DBPARAMIOENUM = TOleEnum; + {$EXTERNALSYM DBPARAMIOENUM} +const + DBPARAMIO_NOTPARAM = $00000000; + {$EXTERNALSYM DBPARAMIO_NOTPARAM} + DBPARAMIO_INPUT = $00000001; + {$EXTERNALSYM DBPARAMIO_INPUT} + DBPARAMIO_OUTPUT = $00000002; + {$EXTERNALSYM DBPARAMIO_OUTPUT} + +// DBBINDFLAGENUM constants +type + DBBINDFLAGENUM = TOleEnum; + {$EXTERNALSYM DBBINDFLAGENUM} +const + DBBINDFLAG_HTML = $00000001; + {$EXTERNALSYM DBBINDFLAG_HTML} + +// DBMEMOWNERENUM constants +type + DBMEMOWNERENUM = TOleEnum; + {$EXTERNALSYM DBMEMOWNERENUM} +const + DBMEMOWNER_CLIENTOWNED = $00000000; + {$EXTERNALSYM DBMEMOWNER_CLIENTOWNED} + DBMEMOWNER_PROVIDEROWNED = $00000001; + {$EXTERNALSYM DBMEMOWNER_PROVIDEROWNED} + +// DBSTATUSENUM constants +type + DBSTATUSENUM = TOleEnum; + {$EXTERNALSYM DBSTATUSENUM} +const + DBSTATUS_S_OK = $00000000; + {$EXTERNALSYM DBSTATUS_S_OK} + DBSTATUS_E_BADACCESSOR = $00000001; + {$EXTERNALSYM DBSTATUS_E_BADACCESSOR} + DBSTATUS_E_CANTCONVERTVALUE = $00000002; + {$EXTERNALSYM DBSTATUS_E_CANTCONVERTVALUE} + DBSTATUS_S_ISNULL = $00000003; + {$EXTERNALSYM DBSTATUS_S_ISNULL} + DBSTATUS_S_TRUNCATED = $00000004; + {$EXTERNALSYM DBSTATUS_S_TRUNCATED} + DBSTATUS_E_SIGNMISMATCH = $00000005; + {$EXTERNALSYM DBSTATUS_E_SIGNMISMATCH} + DBSTATUS_E_DATAOVERFLOW = $00000006; + {$EXTERNALSYM DBSTATUS_E_DATAOVERFLOW} + DBSTATUS_E_CANTCREATE = $00000007; + {$EXTERNALSYM DBSTATUS_E_CANTCREATE} + DBSTATUS_E_UNAVAILABLE = $00000008; + {$EXTERNALSYM DBSTATUS_E_UNAVAILABLE} + DBSTATUS_E_PERMISSIONDENIED = $00000009; + {$EXTERNALSYM DBSTATUS_E_PERMISSIONDENIED} + DBSTATUS_E_INTEGRITYVIOLATION = $0000000A; + {$EXTERNALSYM DBSTATUS_E_INTEGRITYVIOLATION} + DBSTATUS_E_SCHEMAVIOLATION = $0000000B; + {$EXTERNALSYM DBSTATUS_E_SCHEMAVIOLATION} + DBSTATUS_E_BADSTATUS = $0000000C; + {$EXTERNALSYM DBSTATUS_E_BADSTATUS} + DBSTATUS_S_DEFAULT = $0000000D; + {$EXTERNALSYM DBSTATUS_S_DEFAULT} + +// DBSTATUSENUM20 constants +type + DBSTATUSENUM20 = TOleEnum; + {$EXTERNALSYM DBSTATUSENUM20} +const + MDSTATUS_S_CELLEMPTY = $0000000E; + {$EXTERNALSYM MDSTATUS_S_CELLEMPTY} + DBSTATUS_S_IGNORE = $0000000F; + {$EXTERNALSYM DBSTATUS_S_IGNORE} + +// DBROWSTATUSENUM constants +type + DBROWSTATUSENUM = TOleEnum; + {$EXTERNALSYM DBROWSTATUSENUM} +const + DBROWSTATUS_S_OK = $00000000; + {$EXTERNALSYM DBROWSTATUS_S_OK} + DBROWSTATUS_S_MULTIPLECHANGES = $00000002; + {$EXTERNALSYM DBROWSTATUS_S_MULTIPLECHANGES} + DBROWSTATUS_S_PENDINGCHANGES = $00000003; + {$EXTERNALSYM DBROWSTATUS_S_PENDINGCHANGES} + DBROWSTATUS_E_CANCELED = $00000004; + {$EXTERNALSYM DBROWSTATUS_E_CANCELED} + DBROWSTATUS_E_CANTRELEASE = $00000006; + {$EXTERNALSYM DBROWSTATUS_E_CANTRELEASE} + DBROWSTATUS_E_CONCURRENCYVIOLATION = $00000007; + {$EXTERNALSYM DBROWSTATUS_E_CONCURRENCYVIOLATION} + DBROWSTATUS_E_DELETED = $00000008; + {$EXTERNALSYM DBROWSTATUS_E_DELETED} + DBROWSTATUS_E_PENDINGINSERT = $00000009; + {$EXTERNALSYM DBROWSTATUS_E_PENDINGINSERT} + DBROWSTATUS_E_NEWLYINSERTED = $0000000A; + {$EXTERNALSYM DBROWSTATUS_E_NEWLYINSERTED} + DBROWSTATUS_E_INTEGRITYVIOLATION = $0000000B; + {$EXTERNALSYM DBROWSTATUS_E_INTEGRITYVIOLATION} + DBROWSTATUS_E_INVALID = $0000000C; + {$EXTERNALSYM DBROWSTATUS_E_INVALID} + DBROWSTATUS_E_MAXPENDCHANGESEXCEEDED = $0000000D; + {$EXTERNALSYM DBROWSTATUS_E_MAXPENDCHANGESEXCEEDED} + DBROWSTATUS_E_OBJECTOPEN = $0000000E; + {$EXTERNALSYM DBROWSTATUS_E_OBJECTOPEN} + DBROWSTATUS_E_OUTOFMEMORY = $0000000F; + {$EXTERNALSYM DBROWSTATUS_E_OUTOFMEMORY} + DBROWSTATUS_E_PERMISSIONDENIED = $00000010; + {$EXTERNALSYM DBROWSTATUS_E_PERMISSIONDENIED} + DBROWSTATUS_E_LIMITREACHED = $00000011; + {$EXTERNALSYM DBROWSTATUS_E_LIMITREACHED} + DBROWSTATUS_E_SCHEMAVIOLATION = $00000012; + {$EXTERNALSYM DBROWSTATUS_E_SCHEMAVIOLATION} + DBROWSTATUS_E_FAIL = $00000013; + {$EXTERNALSYM DBROWSTATUS_E_FAIL} + +// DBROWSTATUSENUM20 constants +type + DBROWSTATUSENUM20 = TOleEnum; + {$EXTERNALSYM DBROWSTATUSENUM20} +const + DBROWSTATUS_S_NOCHANGE = $00000014; + {$EXTERNALSYM DBROWSTATUS_S_NOCHANGE} + +// DBCOLUMNFLAGSENUM constants +type + DBCOLUMNFLAGSENUM = TOleEnum; + {$EXTERNALSYM DBCOLUMNFLAGSENUM} +const + DBCOLUMNFLAGS_ISBOOKMARK = $00000001; + {$EXTERNALSYM DBCOLUMNFLAGS_ISBOOKMARK} + DBCOLUMNFLAGS_MAYDEFER = $00000002; + {$EXTERNALSYM DBCOLUMNFLAGS_MAYDEFER} + DBCOLUMNFLAGS_WRITE = $00000004; + {$EXTERNALSYM DBCOLUMNFLAGS_WRITE} + DBCOLUMNFLAGS_WRITEUNKNOWN = $00000008; + {$EXTERNALSYM DBCOLUMNFLAGS_WRITEUNKNOWN} + DBCOLUMNFLAGS_ISFIXEDLENGTH = $00000010; + {$EXTERNALSYM DBCOLUMNFLAGS_ISFIXEDLENGTH} + DBCOLUMNFLAGS_ISNULLABLE = $00000020; + {$EXTERNALSYM DBCOLUMNFLAGS_ISNULLABLE} + DBCOLUMNFLAGS_MAYBENULL = $00000040; + {$EXTERNALSYM DBCOLUMNFLAGS_MAYBENULL} + DBCOLUMNFLAGS_ISLONG = $00000080; + {$EXTERNALSYM DBCOLUMNFLAGS_ISLONG} + DBCOLUMNFLAGS_ISROWID = $00000100; + {$EXTERNALSYM DBCOLUMNFLAGS_ISROWID} + DBCOLUMNFLAGS_ISROWVER = $00000200; + {$EXTERNALSYM DBCOLUMNFLAGS_ISROWVER} + DBCOLUMNFLAGS_CACHEDEFERRED = $00001000; + {$EXTERNALSYM DBCOLUMNFLAGS_CACHEDEFERRED} + +// DBCOLUMNFLAGSENUM20 constants +type + DBCOLUMNFLAGSENUM20 = TOleEnum; + {$EXTERNALSYM DBCOLUMNFLAGSENUM20} +const + DBCOLUMNFLAGS_SCALEISNEGATIVE = $00004000; + {$EXTERNALSYM DBCOLUMNFLAGS_SCALEISNEGATIVE} + DBCOLUMNFLAGS_KEYCOLUMN = $00008000; + {$EXTERNALSYM DBCOLUMNFLAGS_KEYCOLUMN} + +// DBCOLUMNFLAGS15ENUM constants +type + DBCOLUMNFLAGS15ENUM = TOleEnum; + {$EXTERNALSYM DBCOLUMNFLAGS15ENUM} +const + DBCOLUMNFLAGS_ISCHAPTER = $00002000; + {$EXTERNALSYM DBCOLUMNFLAGS_ISCHAPTER} + +// DBBOOKMARK constants +type + DBBOOKMARK = TOleEnum; + {$EXTERNALSYM DBBOOKMARK} +const + DBBMK_INVALID = $00000000; + {$EXTERNALSYM DBBMK_INVALID} + DBBMK_FIRST = $00000001; + {$EXTERNALSYM DBBMK_FIRST} + DBBMK_LAST = $00000002; + {$EXTERNALSYM DBBMK_LAST} + +// DBPROPENUM constants +type + DBPROPENUM = TOleEnum; + {$EXTERNALSYM DBPROPENUM} +const + DBPROP_ABORTPRESERVE = $00000002; + {$EXTERNALSYM DBPROP_ABORTPRESERVE} + DBPROP_ACTIVESESSIONS = $00000003; + {$EXTERNALSYM DBPROP_ACTIVESESSIONS} + DBPROP_APPENDONLY = $000000BB; + {$EXTERNALSYM DBPROP_APPENDONLY} + DBPROP_ASYNCTXNABORT = $000000A8; + {$EXTERNALSYM DBPROP_ASYNCTXNABORT} + DBPROP_ASYNCTXNCOMMIT = $00000004; + {$EXTERNALSYM DBPROP_ASYNCTXNCOMMIT} + DBPROP_AUTH_CACHE_AUTHINFO = $00000005; + {$EXTERNALSYM DBPROP_AUTH_CACHE_AUTHINFO} + DBPROP_AUTH_ENCRYPT_PASSWORD = $00000006; + {$EXTERNALSYM DBPROP_AUTH_ENCRYPT_PASSWORD} + DBPROP_AUTH_INTEGRATED = $00000007; + {$EXTERNALSYM DBPROP_AUTH_INTEGRATED} + DBPROP_AUTH_MASK_PASSWORD = $00000008; + {$EXTERNALSYM DBPROP_AUTH_MASK_PASSWORD} + DBPROP_AUTH_PASSWORD = $00000009; + {$EXTERNALSYM DBPROP_AUTH_PASSWORD} + DBPROP_AUTH_PERSIST_ENCRYPTED = $0000000A; + {$EXTERNALSYM DBPROP_AUTH_PERSIST_ENCRYPTED} + DBPROP_AUTH_PERSIST_SENSITIVE_AUTHINFO = $0000000B; + {$EXTERNALSYM DBPROP_AUTH_PERSIST_SENSITIVE_AUTHINFO} + DBPROP_AUTH_USERID = $0000000C; + {$EXTERNALSYM DBPROP_AUTH_USERID} + DBPROP_BLOCKINGSTORAGEOBJECTS = $0000000D; + {$EXTERNALSYM DBPROP_BLOCKINGSTORAGEOBJECTS} + DBPROP_BOOKMARKS = $0000000E; + {$EXTERNALSYM DBPROP_BOOKMARKS} + DBPROP_BOOKMARKSKIPPED = $0000000F; + {$EXTERNALSYM DBPROP_BOOKMARKSKIPPED} + DBPROP_BOOKMARKTYPE = $00000010; + {$EXTERNALSYM DBPROP_BOOKMARKTYPE} + DBPROP_BYREFACCESSORS = $00000078; + {$EXTERNALSYM DBPROP_BYREFACCESSORS} + DBPROP_CACHEDEFERRED = $00000011; + {$EXTERNALSYM DBPROP_CACHEDEFERRED} + DBPROP_CANFETCHBACKWARDS = $00000012; + {$EXTERNALSYM DBPROP_CANFETCHBACKWARDS} + DBPROP_CANHOLDROWS = $00000013; + {$EXTERNALSYM DBPROP_CANHOLDROWS} + DBPROP_CANSCROLLBACKWARDS = $00000015; + {$EXTERNALSYM DBPROP_CANSCROLLBACKWARDS} + DBPROP_CATALOGLOCATION = $00000016; + {$EXTERNALSYM DBPROP_CATALOGLOCATION} + DBPROP_CATALOGTERM = $00000017; + {$EXTERNALSYM DBPROP_CATALOGTERM} + DBPROP_CATALOGUSAGE = $00000018; + {$EXTERNALSYM DBPROP_CATALOGUSAGE} + DBPROP_CHANGEINSERTEDROWS = $000000BC; + {$EXTERNALSYM DBPROP_CHANGEINSERTEDROWS} + DBPROP_COL_AUTOINCREMENT = $0000001A; + {$EXTERNALSYM DBPROP_COL_AUTOINCREMENT} + DBPROP_COL_DEFAULT = $0000001B; + {$EXTERNALSYM DBPROP_COL_DEFAULT} + DBPROP_COL_DESCRIPTION = $0000001C; + {$EXTERNALSYM DBPROP_COL_DESCRIPTION} + DBPROP_COL_FIXEDLENGTH = $000000A7; + {$EXTERNALSYM DBPROP_COL_FIXEDLENGTH} + DBPROP_COL_NULLABLE = $0000001D; + {$EXTERNALSYM DBPROP_COL_NULLABLE} + DBPROP_COL_PRIMARYKEY = $0000001E; + {$EXTERNALSYM DBPROP_COL_PRIMARYKEY} + DBPROP_COL_UNIQUE = $0000001F; + {$EXTERNALSYM DBPROP_COL_UNIQUE} + DBPROP_COLUMNDEFINITION = $00000020; + {$EXTERNALSYM DBPROP_COLUMNDEFINITION} + DBPROP_COLUMNRESTRICT = $00000021; + {$EXTERNALSYM DBPROP_COLUMNRESTRICT} + DBPROP_COMMANDTIMEOUT = $00000022; + {$EXTERNALSYM DBPROP_COMMANDTIMEOUT} + DBPROP_COMMITPRESERVE = $00000023; + {$EXTERNALSYM DBPROP_COMMITPRESERVE} + DBPROP_CONCATNULLBEHAVIOR = $00000024; + {$EXTERNALSYM DBPROP_CONCATNULLBEHAVIOR} + DBPROP_CURRENTCATALOG = $00000025; + {$EXTERNALSYM DBPROP_CURRENTCATALOG} + DBPROP_DATASOURCENAME = $00000026; + {$EXTERNALSYM DBPROP_DATASOURCENAME} + DBPROP_DATASOURCEREADONLY = $00000027; + {$EXTERNALSYM DBPROP_DATASOURCEREADONLY} + DBPROP_DBMSNAME = $00000028; + {$EXTERNALSYM DBPROP_DBMSNAME} + DBPROP_DBMSVER = $00000029; + {$EXTERNALSYM DBPROP_DBMSVER} + DBPROP_DEFERRED = $0000002A; + {$EXTERNALSYM DBPROP_DEFERRED} + DBPROP_DELAYSTORAGEOBJECTS = $0000002B; + {$EXTERNALSYM DBPROP_DELAYSTORAGEOBJECTS} + DBPROP_DSOTHREADMODEL = $000000A9; + {$EXTERNALSYM DBPROP_DSOTHREADMODEL} + DBPROP_GROUPBY = $0000002C; + {$EXTERNALSYM DBPROP_GROUPBY} + DBPROP_HETEROGENEOUSTABLES = $0000002D; + {$EXTERNALSYM DBPROP_HETEROGENEOUSTABLES} + DBPROP_IAccessor = $00000079; + {$EXTERNALSYM DBPROP_IAccessor} + DBPROP_IColumnsInfo = $0000007A; + {$EXTERNALSYM DBPROP_IColumnsInfo} + DBPROP_IColumnsRowset = $0000007B; + {$EXTERNALSYM DBPROP_IColumnsRowset} + DBPROP_IConnectionPointContainer = $0000007C; + {$EXTERNALSYM DBPROP_IConnectionPointContainer} + DBPROP_IConvertType = $000000C2; + {$EXTERNALSYM DBPROP_IConvertType} + DBPROP_IRowset = $0000007E; + {$EXTERNALSYM DBPROP_IRowset} + DBPROP_IRowsetChange = $0000007F; + {$EXTERNALSYM DBPROP_IRowsetChange} + DBPROP_IRowsetIdentity = $00000080; + {$EXTERNALSYM DBPROP_IRowsetIdentity} + DBPROP_IRowsetIndex = $0000009F; + {$EXTERNALSYM DBPROP_IRowsetIndex} + DBPROP_IRowsetInfo = $00000081; + {$EXTERNALSYM DBPROP_IRowsetInfo} + DBPROP_IRowsetLocate = $00000082; + {$EXTERNALSYM DBPROP_IRowsetLocate} + DBPROP_IRowsetResynch = $00000084; + {$EXTERNALSYM DBPROP_IRowsetResynch} + DBPROP_IRowsetScroll = $00000085; + {$EXTERNALSYM DBPROP_IRowsetScroll} + DBPROP_IRowsetUpdate = $00000086; + {$EXTERNALSYM DBPROP_IRowsetUpdate} + DBPROP_ISupportErrorInfo = $00000087; + {$EXTERNALSYM DBPROP_ISupportErrorInfo} + DBPROP_ILockBytes = $00000088; + {$EXTERNALSYM DBPROP_ILockBytes} + DBPROP_ISequentialStream = $00000089; + {$EXTERNALSYM DBPROP_ISequentialStream} + DBPROP_IStorage = $0000008A; + {$EXTERNALSYM DBPROP_IStorage} + DBPROP_IStream = $0000008B; + {$EXTERNALSYM DBPROP_IStream} + DBPROP_IDENTIFIERCASE = $0000002E; + {$EXTERNALSYM DBPROP_IDENTIFIERCASE} + DBPROP_IMMOBILEROWS = $0000002F; + {$EXTERNALSYM DBPROP_IMMOBILEROWS} + DBPROP_INDEX_AUTOUPDATE = $00000030; + {$EXTERNALSYM DBPROP_INDEX_AUTOUPDATE} + DBPROP_INDEX_CLUSTERED = $00000031; + {$EXTERNALSYM DBPROP_INDEX_CLUSTERED} + DBPROP_INDEX_FILLFACTOR = $00000032; + {$EXTERNALSYM DBPROP_INDEX_FILLFACTOR} + DBPROP_INDEX_INITIALSIZE = $00000033; + {$EXTERNALSYM DBPROP_INDEX_INITIALSIZE} + DBPROP_INDEX_NULLCOLLATION = $00000034; + {$EXTERNALSYM DBPROP_INDEX_NULLCOLLATION} + DBPROP_INDEX_NULLS = $00000035; + {$EXTERNALSYM DBPROP_INDEX_NULLS} + DBPROP_INDEX_PRIMARYKEY = $00000036; + {$EXTERNALSYM DBPROP_INDEX_PRIMARYKEY} + DBPROP_INDEX_SORTBOOKMARKS = $00000037; + {$EXTERNALSYM DBPROP_INDEX_SORTBOOKMARKS} + DBPROP_INDEX_TEMPINDEX = $000000A3; + {$EXTERNALSYM DBPROP_INDEX_TEMPINDEX} + DBPROP_INDEX_TYPE = $00000038; + {$EXTERNALSYM DBPROP_INDEX_TYPE} + DBPROP_INDEX_UNIQUE = $00000039; + {$EXTERNALSYM DBPROP_INDEX_UNIQUE} + DBPROP_INIT_DATASOURCE = $0000003B; + {$EXTERNALSYM DBPROP_INIT_DATASOURCE} + DBPROP_INIT_HWND = $0000003C; + {$EXTERNALSYM DBPROP_INIT_HWND} + DBPROP_INIT_IMPERSONATION_LEVEL = $0000003D; + {$EXTERNALSYM DBPROP_INIT_IMPERSONATION_LEVEL} + DBPROP_INIT_LCID = $000000BA; + {$EXTERNALSYM DBPROP_INIT_LCID} + DBPROP_INIT_LOCATION = $0000003E; + {$EXTERNALSYM DBPROP_INIT_LOCATION} + DBPROP_INIT_MODE = $0000003F; + {$EXTERNALSYM DBPROP_INIT_MODE} + DBPROP_INIT_PROMPT = $00000040; + {$EXTERNALSYM DBPROP_INIT_PROMPT} + DBPROP_INIT_PROTECTION_LEVEL = $00000041; + {$EXTERNALSYM DBPROP_INIT_PROTECTION_LEVEL} + DBPROP_INIT_PROVIDERSTRING = $000000A0; + {$EXTERNALSYM DBPROP_INIT_PROVIDERSTRING} + DBPROP_INIT_TIMEOUT = $00000042; + {$EXTERNALSYM DBPROP_INIT_TIMEOUT} + DBPROP_LITERALBOOKMARKS = $00000043; + {$EXTERNALSYM DBPROP_LITERALBOOKMARKS} + DBPROP_LITERALIDENTITY = $00000044; + {$EXTERNALSYM DBPROP_LITERALIDENTITY} + DBPROP_MARSHALLABLE = $000000C5; + {$EXTERNALSYM DBPROP_MARSHALLABLE} + DBPROP_MAXINDEXSIZE = $00000046; + {$EXTERNALSYM DBPROP_MAXINDEXSIZE} + DBPROP_MAXOPENROWS = $00000047; + {$EXTERNALSYM DBPROP_MAXOPENROWS} + DBPROP_MAXPENDINGROWS = $00000048; + {$EXTERNALSYM DBPROP_MAXPENDINGROWS} + DBPROP_MAXROWS = $00000049; + {$EXTERNALSYM DBPROP_MAXROWS} + DBPROP_MAXROWSIZE = $0000004A; + {$EXTERNALSYM DBPROP_MAXROWSIZE} + DBPROP_MAXROWSIZEINCLUDESBLOB = $0000004B; + {$EXTERNALSYM DBPROP_MAXROWSIZEINCLUDESBLOB} + DBPROP_MAXTABLESINSELECT = $0000004C; + {$EXTERNALSYM DBPROP_MAXTABLESINSELECT} + DBPROP_MAYWRITECOLUMN = $0000004D; + {$EXTERNALSYM DBPROP_MAYWRITECOLUMN} + DBPROP_MEMORYUSAGE = $0000004E; + {$EXTERNALSYM DBPROP_MEMORYUSAGE} + DBPROP_MULTIPLEPARAMSETS = $000000BF; + {$EXTERNALSYM DBPROP_MULTIPLEPARAMSETS} + DBPROP_MULTIPLERESULTS = $000000C4; + {$EXTERNALSYM DBPROP_MULTIPLERESULTS} + DBPROP_MULTIPLESTORAGEOBJECTS = $00000050; + {$EXTERNALSYM DBPROP_MULTIPLESTORAGEOBJECTS} + DBPROP_MULTITABLEUPDATE = $00000051; + {$EXTERNALSYM DBPROP_MULTITABLEUPDATE} + DBPROP_NOTIFICATIONGRANULARITY = $000000C6; + {$EXTERNALSYM DBPROP_NOTIFICATIONGRANULARITY} + DBPROP_NOTIFICATIONPHASES = $00000052; + {$EXTERNALSYM DBPROP_NOTIFICATIONPHASES} + DBPROP_NOTIFYCOLUMNSET = $000000AB; + {$EXTERNALSYM DBPROP_NOTIFYCOLUMNSET} + DBPROP_NOTIFYROWDELETE = $000000AD; + {$EXTERNALSYM DBPROP_NOTIFYROWDELETE} + DBPROP_NOTIFYROWFIRSTCHANGE = $000000AE; + {$EXTERNALSYM DBPROP_NOTIFYROWFIRSTCHANGE} + DBPROP_NOTIFYROWINSERT = $000000AF; + {$EXTERNALSYM DBPROP_NOTIFYROWINSERT} + DBPROP_NOTIFYROWRESYNCH = $000000B1; + {$EXTERNALSYM DBPROP_NOTIFYROWRESYNCH} + DBPROP_NOTIFYROWSETCHANGED = $000000D3; + {$EXTERNALSYM DBPROP_NOTIFYROWSETCHANGED} + DBPROP_NOTIFYROWSETRELEASE = $000000B2; + {$EXTERNALSYM DBPROP_NOTIFYROWSETRELEASE} + DBPROP_NOTIFYROWSETFETCHPOSITIONCHANGE = $000000B3; + {$EXTERNALSYM DBPROP_NOTIFYROWSETFETCHPOSITIONCHANGE} + DBPROP_NOTIFYROWUNDOCHANGE = $000000B4; + {$EXTERNALSYM DBPROP_NOTIFYROWUNDOCHANGE} + DBPROP_NOTIFYROWUNDODELETE = $000000B5; + {$EXTERNALSYM DBPROP_NOTIFYROWUNDODELETE} + DBPROP_NOTIFYROWUNDOINSERT = $000000B6; + {$EXTERNALSYM DBPROP_NOTIFYROWUNDOINSERT} + DBPROP_NOTIFYROWUPDATE = $000000B7; + {$EXTERNALSYM DBPROP_NOTIFYROWUPDATE} + DBPROP_NULLCOLLATION = $00000053; + {$EXTERNALSYM DBPROP_NULLCOLLATION} + DBPROP_OLEOBJECTS = $00000054; + {$EXTERNALSYM DBPROP_OLEOBJECTS} + DBPROP_ORDERBYCOLUMNSINSELECT = $00000055; + {$EXTERNALSYM DBPROP_ORDERBYCOLUMNSINSELECT} + DBPROP_ORDEREDBOOKMARKS = $00000056; + {$EXTERNALSYM DBPROP_ORDEREDBOOKMARKS} + DBPROP_OTHERINSERT = $00000057; + {$EXTERNALSYM DBPROP_OTHERINSERT} + DBPROP_OTHERUPDATEDELETE = $00000058; + {$EXTERNALSYM DBPROP_OTHERUPDATEDELETE} + DBPROP_OUTPUTPARAMETERAVAILABILITY = $000000B8; + {$EXTERNALSYM DBPROP_OUTPUTPARAMETERAVAILABILITY} + DBPROP_OWNINSERT = $00000059; + {$EXTERNALSYM DBPROP_OWNINSERT} + DBPROP_OWNUPDATEDELETE = $0000005A; + {$EXTERNALSYM DBPROP_OWNUPDATEDELETE} + DBPROP_PERSISTENTIDTYPE = $000000B9; + {$EXTERNALSYM DBPROP_PERSISTENTIDTYPE} + DBPROP_PREPAREABORTBEHAVIOR = $0000005B; + {$EXTERNALSYM DBPROP_PREPAREABORTBEHAVIOR} + DBPROP_PREPARECOMMITBEHAVIOR = $0000005C; + {$EXTERNALSYM DBPROP_PREPARECOMMITBEHAVIOR} + DBPROP_PROCEDURETERM = $0000005D; + {$EXTERNALSYM DBPROP_PROCEDURETERM} + DBPROP_PROVIDERNAME = $00000060; + {$EXTERNALSYM DBPROP_PROVIDERNAME} + DBPROP_PROVIDERFILENAME = DBPROP_PROVIDERNAME; + {$EXTERNALSYM DBPROP_PROVIDERFILENAME} + DBPROP_PROVIDEROLEDBVER = $00000061; + {$EXTERNALSYM DBPROP_PROVIDEROLEDBVER} + DBPROP_PROVIDERVER = $00000062; + {$EXTERNALSYM DBPROP_PROVIDERVER} + DBPROP_QUICKRESTART = $00000063; + {$EXTERNALSYM DBPROP_QUICKRESTART} + DBPROP_QUOTEDIDENTIFIERCASE = $00000064; + {$EXTERNALSYM DBPROP_QUOTEDIDENTIFIERCASE} + DBPROP_REENTRANTEVENTS = $00000065; + {$EXTERNALSYM DBPROP_REENTRANTEVENTS} + DBPROP_REMOVEDELETED = $00000066; + {$EXTERNALSYM DBPROP_REMOVEDELETED} + DBPROP_REPORTMULTIPLECHANGES = $00000067; + {$EXTERNALSYM DBPROP_REPORTMULTIPLECHANGES} + DBPROP_RETURNPENDINGINSERTS = $000000BD; + {$EXTERNALSYM DBPROP_RETURNPENDINGINSERTS} + DBPROP_ROWRESTRICT = $00000068; + {$EXTERNALSYM DBPROP_ROWRESTRICT} + DBPROP_ROWSETCONVERSIONSONCOMMAND = $000000C0; + {$EXTERNALSYM DBPROP_ROWSETCONVERSIONSONCOMMAND} + DBPROP_ROWTHREADMODEL = $00000069; + {$EXTERNALSYM DBPROP_ROWTHREADMODEL} + DBPROP_SCHEMATERM = $0000006A; + {$EXTERNALSYM DBPROP_SCHEMATERM} + DBPROP_SCHEMAUSAGE = $0000006B; + {$EXTERNALSYM DBPROP_SCHEMAUSAGE} + DBPROP_SERVERCURSOR = $0000006C; + {$EXTERNALSYM DBPROP_SERVERCURSOR} + DBPROP_SESS_AUTOCOMMITISOLEVELS = $000000BE; + {$EXTERNALSYM DBPROP_SESS_AUTOCOMMITISOLEVELS} + DBPROP_SQLSUPPORT = $0000006D; + {$EXTERNALSYM DBPROP_SQLSUPPORT} + DBPROP_STRONGIDENTITY = $00000077; + {$EXTERNALSYM DBPROP_STRONGIDENTITY} + DBPROP_STRUCTUREDSTORAGE = $0000006F; + {$EXTERNALSYM DBPROP_STRUCTUREDSTORAGE} + DBPROP_SUBQUERIES = $00000070; + {$EXTERNALSYM DBPROP_SUBQUERIES} + DBPROP_SUPPORTEDTXNDDL = $000000A1; + {$EXTERNALSYM DBPROP_SUPPORTEDTXNDDL} + DBPROP_SUPPORTEDTXNISOLEVELS = $00000071; + {$EXTERNALSYM DBPROP_SUPPORTEDTXNISOLEVELS} + DBPROP_SUPPORTEDTXNISORETAIN = $00000072; + {$EXTERNALSYM DBPROP_SUPPORTEDTXNISORETAIN} + DBPROP_TABLETERM = $00000073; + {$EXTERNALSYM DBPROP_TABLETERM} + DBPROP_TBL_TEMPTABLE = $0000008C; + {$EXTERNALSYM DBPROP_TBL_TEMPTABLE} + DBPROP_TRANSACTEDOBJECT = $00000074; + {$EXTERNALSYM DBPROP_TRANSACTEDOBJECT} + DBPROP_UPDATABILITY = $00000075; + {$EXTERNALSYM DBPROP_UPDATABILITY} + DBPROP_USERNAME = $00000076; + {$EXTERNALSYM DBPROP_USERNAME} + +// DBPROPENUM15 constants +type + DBPROPENUM15 = TOleEnum; + {$EXTERNALSYM DBPROPENUM15} +const + DBPROP_FILTEROPS = $000000D0; + {$EXTERNALSYM DBPROP_FILTEROPS} + DBPROP_FILTERCOMPAREOPS = $000000D1; + {$EXTERNALSYM DBPROP_FILTERCOMPAREOPS} + DBPROP_FINDCOMPAREOPS = $000000D2; + {$EXTERNALSYM DBPROP_FINDCOMPAREOPS} + DBPROP_IChapteredRowset = $000000CA; + {$EXTERNALSYM DBPROP_IChapteredRowset} + DBPROP_IDBAsynchStatus = $000000CB; + {$EXTERNALSYM DBPROP_IDBAsynchStatus} + DBPROP_IRowsetFind = $000000CC; + {$EXTERNALSYM DBPROP_IRowsetFind} + DBPROP_IRowsetView = $000000D4; + {$EXTERNALSYM DBPROP_IRowsetView} + DBPROP_IViewChapter = $000000D5; + {$EXTERNALSYM DBPROP_IViewChapter} + DBPROP_IViewFilter = $000000D6; + {$EXTERNALSYM DBPROP_IViewFilter} + DBPROP_IViewRowset = $000000D7; + {$EXTERNALSYM DBPROP_IViewRowset} + DBPROP_IViewSort = $000000D8; + {$EXTERNALSYM DBPROP_IViewSort} + DBPROP_INIT_ASYNCH = $000000C8; + {$EXTERNALSYM DBPROP_INIT_ASYNCH} + DBPROP_MAXOPENCHAPTERS = $000000C7; + {$EXTERNALSYM DBPROP_MAXOPENCHAPTERS} + DBPROP_MAXORSINFILTER = $000000CD; + {$EXTERNALSYM DBPROP_MAXORSINFILTER} + DBPROP_MAXSORTCOLUMNS = $000000CE; + {$EXTERNALSYM DBPROP_MAXSORTCOLUMNS} + DBPROP_ROWSET_ASYNCH = $000000C9; + {$EXTERNALSYM DBPROP_ROWSET_ASYNCH} + DBPROP_SORTONINDEX = $000000CF; + {$EXTERNALSYM DBPROP_SORTONINDEX} + +// DBPROPENUM20 constants +type + DBPROPENUM20 = TOleEnum; + {$EXTERNALSYM DBPROPENUM20} +const + DBPROP_IMultipleResults = $000000D9; + {$EXTERNALSYM DBPROP_IMultipleResults} + DBPROP_DATASOURCE_TYPE = $000000FB; + {$EXTERNALSYM DBPROP_DATASOURCE_TYPE} + MDPROP_AXES = $000000FC; + {$EXTERNALSYM MDPROP_AXES} + MDPROP_FLATTENING_SUPPORT = $000000FD; + {$EXTERNALSYM MDPROP_FLATTENING_SUPPORT} + MDPROP_MDX_JOINCUBES = $000000FE; + {$EXTERNALSYM MDPROP_MDX_JOINCUBES} + MDPROP_NAMED_LEVELS = $000000FF; + {$EXTERNALSYM MDPROP_NAMED_LEVELS} + MDPROP_RANGEROWSET = $00000100; + {$EXTERNALSYM MDPROP_RANGEROWSET} + MDPROP_MDX_SLICER = $000000DA; + {$EXTERNALSYM MDPROP_MDX_SLICER} + MDPROP_MDX_CUBEQUALIFICATION = $000000DB; + {$EXTERNALSYM MDPROP_MDX_CUBEQUALIFICATION} + MDPROP_MDX_OUTERREFERENCE = $000000DC; + {$EXTERNALSYM MDPROP_MDX_OUTERREFERENCE} + MDPROP_MDX_QUERYBYPROPERTY = $000000DD; + {$EXTERNALSYM MDPROP_MDX_QUERYBYPROPERTY} + MDPROP_MDX_CASESUPPORT = $000000DE; + {$EXTERNALSYM MDPROP_MDX_CASESUPPORT} + MDPROP_MDX_STRING_COMPOP = $000000E0; + {$EXTERNALSYM MDPROP_MDX_STRING_COMPOP} + MDPROP_MDX_DESCFLAGS = $000000E1; + {$EXTERNALSYM MDPROP_MDX_DESCFLAGS} + MDPROP_MDX_SET_FUNCTIONS = $000000E2; + {$EXTERNALSYM MDPROP_MDX_SET_FUNCTIONS} + MDPROP_MDX_MEMBER_FUNCTIONS = $000000E3; + {$EXTERNALSYM MDPROP_MDX_MEMBER_FUNCTIONS} + MDPROP_MDX_NUMERIC_FUNCTIONS = $000000E4; + {$EXTERNALSYM MDPROP_MDX_NUMERIC_FUNCTIONS} + MDPROP_MDX_FORMULAS = $000000E5; + {$EXTERNALSYM MDPROP_MDX_FORMULAS} + MDPROP_MDX_AGGREGATECELL_UPDATE = $000000E6; + {$EXTERNALSYM MDPROP_MDX_AGGREGATECELL_UPDATE} + DBPROP_ACCESSORDER = $000000E7; + {$EXTERNALSYM DBPROP_ACCESSORDER} + DBPROP_BOOKMARKINFO = $000000E8; + {$EXTERNALSYM DBPROP_BOOKMARKINFO} + DBPROP_INIT_CATALOG = $000000E9; + {$EXTERNALSYM DBPROP_INIT_CATALOG} + DBPROP_ROW_BULKOPS = $000000EA; + {$EXTERNALSYM DBPROP_ROW_BULKOPS} + DBPROP_PROVIDERFRIENDLYNAME = $000000EB; + {$EXTERNALSYM DBPROP_PROVIDERFRIENDLYNAME} + DBPROP_LOCKMODE = $000000EC; + {$EXTERNALSYM DBPROP_LOCKMODE} + DBPROP_MULTIPLECONNECTIONS = $000000ED; + {$EXTERNALSYM DBPROP_MULTIPLECONNECTIONS} + DBPROP_UNIQUEROWS = $000000EE; + {$EXTERNALSYM DBPROP_UNIQUEROWS} + DBPROP_SERVERDATAONINSERT = $000000EF; + {$EXTERNALSYM DBPROP_SERVERDATAONINSERT} + DBPROP_STORAGEFLAGS = $000000F0; + {$EXTERNALSYM DBPROP_STORAGEFLAGS} + DBPROP_CONNECTIONSTATUS = $000000F4; + {$EXTERNALSYM DBPROP_CONNECTIONSTATUS} + DBPROP_ALTERCOLUMN = $000000F5; + {$EXTERNALSYM DBPROP_ALTERCOLUMN} + DBPROP_COLUMNLCID = $000000F6; + {$EXTERNALSYM DBPROP_COLUMNLCID} + DBPROP_RESETDATASOURCE = $000000F7; + {$EXTERNALSYM DBPROP_RESETDATASOURCE} + DBPROP_INIT_OLEDBSERVICES = $000000F8; + {$EXTERNALSYM DBPROP_INIT_OLEDBSERVICES} + DBPROP_IRowsetRefresh = $000000F9; + {$EXTERNALSYM DBPROP_IRowsetRefresh} + DBPROP_SERVERNAME = $000000FA; + {$EXTERNALSYM DBPROP_SERVERNAME} + DBPROP_IParentRowset = $00000101; + {$EXTERNALSYM DBPROP_IParentRowset} + DBPROP_HIDDENCOLUMNS = $00000102; + {$EXTERNALSYM DBPROP_HIDDENCOLUMNS} + DBPROP_PROVIDERMEMORY = $00000103; + {$EXTERNALSYM DBPROP_PROVIDERMEMORY} + DBPROP_CLIENTCURSOR = $00000104; + {$EXTERNALSYM DBPROP_CLIENTCURSOR} + +// DBPROPENUM21 constants +type + DBPROPENUM21 = TOleEnum; + {$EXTERNALSYM DBPROPENUM21} +const + DBPROP_TRUSTEE_USERNAME = $000000F1; + {$EXTERNALSYM DBPROP_TRUSTEE_USERNAME} + DBPROP_TRUSTEE_AUTHENTICATION = $000000F2; + {$EXTERNALSYM DBPROP_TRUSTEE_AUTHENTICATION} + DBPROP_TRUSTEE_NEWAUTHENTICATION = $000000F3; + {$EXTERNALSYM DBPROP_TRUSTEE_NEWAUTHENTICATION} + +// DBPROPENUM25 constants +type + DBPROPENUM25 = TOleEnum; + {$EXTERNALSYM DBPROPENUM25} +const + DBPROP_ICommandCost = $0000008D; + {$EXTERNALSYM DBPROP_ICommandCost} + DBPROP_ICommandTree = $0000008E; + {$EXTERNALSYM DBPROP_ICommandTree} + DBPROP_ICommandValidate = $0000008F; + {$EXTERNALSYM DBPROP_ICommandValidate} + DBPROP_IDBSchemaCommand = $00000090; + {$EXTERNALSYM DBPROP_IDBSchemaCommand} + DBPROP_IProvideMoniker = $0000007D; + {$EXTERNALSYM DBPROP_IProvideMoniker} + DBPROP_IQuery = $00000092; + {$EXTERNALSYM DBPROP_IQuery} + DBPROP_IReadData = $00000093; + {$EXTERNALSYM DBPROP_IReadData} + DBPROP_IRowsetAsynch = $00000094; + {$EXTERNALSYM DBPROP_IRowsetAsynch} + DBPROP_IRowsetKeys = $00000097; + {$EXTERNALSYM DBPROP_IRowsetKeys} + DBPROP_IRowsetNewRowAfter = $00000098; + {$EXTERNALSYM DBPROP_IRowsetNewRowAfter} + DBPROP_IRowsetNextRowset = $00000099; + {$EXTERNALSYM DBPROP_IRowsetNextRowset} + DBPROP_IRowsetWatchAll = $0000009B; + {$EXTERNALSYM DBPROP_IRowsetWatchAll} + DBPROP_IRowsetWatchNotify = $0000009C; + {$EXTERNALSYM DBPROP_IRowsetWatchNotify} + DBPROP_IRowsetWatchRegion = $0000009D; + {$EXTERNALSYM DBPROP_IRowsetWatchRegion} + DBPROP_IRowsetWithParameters = $0000009E; + {$EXTERNALSYM DBPROP_IRowsetWithParameters} + +// SQL Everywhere Provider specific properties +const + DBPROP_SSCE_COL_ROWGUID = $000001F9; // SSCE_COLUMN + DBPROP_SSCE_MAXBUFFERSIZE = $000001FA; // SSCE_DBINIT + DBPROP_SSCE_DBPASSWORD = $000001FB; // SSCE_DBINIT + DBPROP_SSCE_ENCRYPTDATABASE = $000001FC; // SSCE_DBINIT + DBPROP_SSCE_DEFAULT_LOCK_ESCALATION = $000001FD; // SSCE_DBINIT + DBPROP_SSCE_TEMPFILE_DIRECTORY = $000001FE; // SSCE_DBINIT + DBPROP_SSCE_DEFAULT_LOCK_TIMEOUT = $000001FF; // SSCE_DBINIT + DBPROP_SSCE_TRANSACTION_COMMIT_MODE = $00000200; // SSCE_SESSION + DBPROP_SSCE_LOCK_TIMEOUT = $00000201; // SSCE_SESSION + DBPROP_SSCE_AUTO_SHRINK_THRESHOLD = $00000202; // SSCE_DBINIT + DBPROP_SSCE_FLUSH_INTERVAL = $00000206; // SSCE_DBINIT + DBPROP_SSCE_MAX_DATABASE_SIZE = $0000020B; // SSCE_DBINIT + DBPROP_SSCE_LOCK_ESCALATION = $0000020C; // SSCE_SESSION + DBPROP_SSCE_LOCK_HINT = $0000020D; // SSCE_ROWSET + DBPROP_SSCE_TEMPFILE_MAX_SIZE = $0000020E; // SSCE_DBINIT + +// Enumeration values for DBPROP_SSCE_LOCK_HINT: +const + DBPROPVAL_SSCE_LH_ROWLOCK = $00000001; // Row-level locking + DBPROPVAL_SSCE_LH_PAGLOCK = $00000002; // Page-level locking + DBPROPVAL_SSCE_LH_TABLOCK = $00000004; // Table-level locking + DBPROPVAL_SSCE_LH_DBLOCK = $00000008; // Database-level locking + DBPROPVAL_SSCE_LH_NOLOCK = $00000010; // No lock option + DBPROPVAL_SSCE_LH_HOLDLOCK = $00000020; // Hold lock option + DBPROPVAL_SSCE_LH_UPDLOCK = $00000040; // Update lock type + DBPROPVAL_SSCE_LH_XLOCK = $00000080; // Exclusive lock type + +// Enumeration values for DBPROP_SSCE_TRANSACTION_COMMIT_MODE: +const + DBPROPVAL_SSCE_TCM_DEFAULT = $00000000; // Asynchronously commit transactions to disk + DBPROPVAL_SSCE_TCM_FLUSH = $00000001; // Synchronously commit transactions to disk + + // Bit mask specifying which properties in DBPROPSET_SSCE_DBINIT + // were not honored when creating / opening the data source. This + // bit mask is returned as the first parameter in the error object + // if the minor error code is SSCE_M_INITPROPCONFLICT + SSCE_DBINIT_CONFLICT_MAXBUFFERSIZE = $00000001; + SSCE_DBINIT_CONFLICT_AUTO_SHRINK_THRESHOLD = $00000004; + SSCE_DBINIT_CONFLICT_FLUSH_INTERVAL = $00000008; + SSCE_DBINIT_CONFLICT_MAX_DATABASE_SIZE = $00000020; + SSCE_DBINIT_CONFLICT_TEMPFILE_DIRECTORY = $00000040; + SSCE_DBINIT_CONFLICT_DEFAULTESCALATION = $00000080; + SSCE_DBINIT_CONFLICT_DEFAULTTIMEOUT = $00000100; + SSCE_DBINIT_CONFLICT_MAX_TMPDB_SIZE = $00000200; + +// DBPROPENUMDEPRECATED constants +type + DBPROPENUMDEPRECATED = TOleEnum; + {$EXTERNALSYM DBPROPENUMDEPRECATED} +const + DBPROP_IRowsetExactScroll = $0000009A; + {$EXTERNALSYM DBPROP_IRowsetExactScroll} + +// DBCOMMANDOPENUM constants +type + DBCOMMANDOPENUM = TOleEnum; + {$EXTERNALSYM DBCOMMANDOPENUM} +const + DBOP_scalar_constant = $00000000; + {$EXTERNALSYM DBOP_scalar_constant} + DBOP_DEFAULT = $00000001; + {$EXTERNALSYM DBOP_DEFAULT} + DBOP_NULL = $00000002; + {$EXTERNALSYM DBOP_NULL} + DBOP_bookmark_name = $00000003; + {$EXTERNALSYM DBOP_bookmark_name} + DBOP_catalog_name = $00000004; + {$EXTERNALSYM DBOP_catalog_name} + DBOP_column_name = $00000005; + {$EXTERNALSYM DBOP_column_name} + DBOP_schema_name = $00000006; + {$EXTERNALSYM DBOP_schema_name} + DBOP_outall_name = $00000007; + {$EXTERNALSYM DBOP_outall_name} + DBOP_qualifier_name = $00000008; + {$EXTERNALSYM DBOP_qualifier_name} + DBOP_qualified_column_name = $00000009; + {$EXTERNALSYM DBOP_qualified_column_name} + DBOP_table_name = $0000000A; + {$EXTERNALSYM DBOP_table_name} + DBOP_nested_table_name = $0000000B; + {$EXTERNALSYM DBOP_nested_table_name} + DBOP_nested_column_name = $0000000C; + {$EXTERNALSYM DBOP_nested_column_name} + DBOP_row = $0000000D; + {$EXTERNALSYM DBOP_row} + DBOP_table = $0000000E; + {$EXTERNALSYM DBOP_table} + DBOP_sort = $0000000F; + {$EXTERNALSYM DBOP_sort} + DBOP_distinct = $00000010; + {$EXTERNALSYM DBOP_distinct} + DBOP_distinct_order_preserving = $00000011; + {$EXTERNALSYM DBOP_distinct_order_preserving} + DBOP_alias = $00000012; + {$EXTERNALSYM DBOP_alias} + DBOP_cross_join = $00000013; + {$EXTERNALSYM DBOP_cross_join} + DBOP_union_join = $00000014; + {$EXTERNALSYM DBOP_union_join} + DBOP_inner_join = $00000015; + {$EXTERNALSYM DBOP_inner_join} + DBOP_left_semi_join = $00000016; + {$EXTERNALSYM DBOP_left_semi_join} + DBOP_right_semi_join = $00000017; + {$EXTERNALSYM DBOP_right_semi_join} + DBOP_left_anti_semi_join = $00000018; + {$EXTERNALSYM DBOP_left_anti_semi_join} + DBOP_right_anti_semi_join = $00000019; + {$EXTERNALSYM DBOP_right_anti_semi_join} + DBOP_left_outer_join = $0000001A; + {$EXTERNALSYM DBOP_left_outer_join} + DBOP_right_outer_join = $0000001B; + {$EXTERNALSYM DBOP_right_outer_join} + DBOP_full_outer_join = $0000001C; + {$EXTERNALSYM DBOP_full_outer_join} + DBOP_natural_join = $0000001D; + {$EXTERNALSYM DBOP_natural_join} + DBOP_natural_left_outer_join = $0000001E; + {$EXTERNALSYM DBOP_natural_left_outer_join} + DBOP_natural_right_outer_join = $0000001F; + {$EXTERNALSYM DBOP_natural_right_outer_join} + DBOP_natural_full_outer_join = $00000020; + {$EXTERNALSYM DBOP_natural_full_outer_join} + DBOP_set_intersection = $00000021; + {$EXTERNALSYM DBOP_set_intersection} + DBOP_set_union = $00000022; + {$EXTERNALSYM DBOP_set_union} + DBOP_set_left_difference = $00000023; + {$EXTERNALSYM DBOP_set_left_difference} + DBOP_set_right_difference = $00000024; + {$EXTERNALSYM DBOP_set_right_difference} + DBOP_set_anti_difference = $00000025; + {$EXTERNALSYM DBOP_set_anti_difference} + DBOP_bag_intersection = $00000026; + {$EXTERNALSYM DBOP_bag_intersection} + DBOP_bag_union = $00000027; + {$EXTERNALSYM DBOP_bag_union} + DBOP_bag_left_difference = $00000028; + {$EXTERNALSYM DBOP_bag_left_difference} + DBOP_bag_right_difference = $00000029; + {$EXTERNALSYM DBOP_bag_right_difference} + DBOP_bag_anti_difference = $0000002A; + {$EXTERNALSYM DBOP_bag_anti_difference} + DBOP_division = $0000002B; + {$EXTERNALSYM DBOP_division} + DBOP_relative_sampling = $0000002C; + {$EXTERNALSYM DBOP_relative_sampling} + DBOP_absolute_sampling = $0000002D; + {$EXTERNALSYM DBOP_absolute_sampling} + DBOP_transitive_closure = $0000002E; + {$EXTERNALSYM DBOP_transitive_closure} + DBOP_recursive_union = $0000002F; + {$EXTERNALSYM DBOP_recursive_union} + DBOP_aggregate = $00000030; + {$EXTERNALSYM DBOP_aggregate} + DBOP_remote_table = $00000031; + {$EXTERNALSYM DBOP_remote_table} + DBOP_select = $00000032; + {$EXTERNALSYM DBOP_select} + DBOP_order_preserving_select = $00000033; + {$EXTERNALSYM DBOP_order_preserving_select} + DBOP_project = $00000034; + {$EXTERNALSYM DBOP_project} + DBOP_project_order_preserving = $00000035; + {$EXTERNALSYM DBOP_project_order_preserving} + DBOP_top = $00000036; + {$EXTERNALSYM DBOP_top} + DBOP_top_percent = $00000037; + {$EXTERNALSYM DBOP_top_percent} + DBOP_top_plus_ties = $00000038; + {$EXTERNALSYM DBOP_top_plus_ties} + DBOP_top_percent_plus_ties = $00000039; + {$EXTERNALSYM DBOP_top_percent_plus_ties} + DBOP_rank = $0000003A; + {$EXTERNALSYM DBOP_rank} + DBOP_rank_ties_equally = $0000003B; + {$EXTERNALSYM DBOP_rank_ties_equally} + DBOP_rank_ties_equally_and_skip = $0000003C; + {$EXTERNALSYM DBOP_rank_ties_equally_and_skip} + DBOP_navigate = $0000003D; + {$EXTERNALSYM DBOP_navigate} + DBOP_nesting = $0000003E; + {$EXTERNALSYM DBOP_nesting} + DBOP_unnesting = $0000003F; + {$EXTERNALSYM DBOP_unnesting} + DBOP_nested_apply = $00000040; + {$EXTERNALSYM DBOP_nested_apply} + DBOP_cross_tab = $00000041; + {$EXTERNALSYM DBOP_cross_tab} + DBOP_is_NULL = $00000042; + {$EXTERNALSYM DBOP_is_NULL} + DBOP_is_NOT_NULL = $00000043; + {$EXTERNALSYM DBOP_is_NOT_NULL} + DBOP_equal = $00000044; + {$EXTERNALSYM DBOP_equal} + DBOP_not_equal = $00000045; + {$EXTERNALSYM DBOP_not_equal} + DBOP_less = $00000046; + {$EXTERNALSYM DBOP_less} + DBOP_less_equal = $00000047; + {$EXTERNALSYM DBOP_less_equal} + DBOP_greater = $00000048; + {$EXTERNALSYM DBOP_greater} + DBOP_greater_equal = $00000049; + {$EXTERNALSYM DBOP_greater_equal} + DBOP_equal_all = $0000004A; + {$EXTERNALSYM DBOP_equal_all} + DBOP_not_equal_all = $0000004B; + {$EXTERNALSYM DBOP_not_equal_all} + DBOP_less_all = $0000004C; + {$EXTERNALSYM DBOP_less_all} + DBOP_less_equal_all = $0000004D; + {$EXTERNALSYM DBOP_less_equal_all} + DBOP_greater_all = $0000004E; + {$EXTERNALSYM DBOP_greater_all} + DBOP_greater_equal_all = $0000004F; + {$EXTERNALSYM DBOP_greater_equal_all} + DBOP_equal_any = $00000050; + {$EXTERNALSYM DBOP_equal_any} + DBOP_not_equal_any = $00000051; + {$EXTERNALSYM DBOP_not_equal_any} + DBOP_less_any = $00000052; + {$EXTERNALSYM DBOP_less_any} + DBOP_less_equal_any = $00000053; + {$EXTERNALSYM DBOP_less_equal_any} + DBOP_greater_any = $00000054; + {$EXTERNALSYM DBOP_greater_any} + DBOP_greater_equal_any = $00000055; + {$EXTERNALSYM DBOP_greater_equal_any} + DBOP_anybits = $00000056; + {$EXTERNALSYM DBOP_anybits} + DBOP_allbits = $00000057; + {$EXTERNALSYM DBOP_allbits} + DBOP_anybits_any = $00000058; + {$EXTERNALSYM DBOP_anybits_any} + DBOP_allbits_any = $00000059; + {$EXTERNALSYM DBOP_allbits_any} + DBOP_anybits_all = $0000005A; + {$EXTERNALSYM DBOP_anybits_all} + DBOP_allbits_all = $0000005B; + {$EXTERNALSYM DBOP_allbits_all} + DBOP_between = $0000005C; + {$EXTERNALSYM DBOP_between} + DBOP_between_unordered = $0000005D; + {$EXTERNALSYM DBOP_between_unordered} + DBOP_match = $0000005E; + {$EXTERNALSYM DBOP_match} + DBOP_match_unique = $0000005F; + {$EXTERNALSYM DBOP_match_unique} + DBOP_match_partial = $00000060; + {$EXTERNALSYM DBOP_match_partial} + DBOP_match_partial_unique = $00000061; + {$EXTERNALSYM DBOP_match_partial_unique} + DBOP_match_full = $00000062; + {$EXTERNALSYM DBOP_match_full} + DBOP_match_full_unique = $00000063; + {$EXTERNALSYM DBOP_match_full_unique} + DBOP_scalar_parameter = $00000064; + {$EXTERNALSYM DBOP_scalar_parameter} + DBOP_scalar_function = $00000065; + {$EXTERNALSYM DBOP_scalar_function} + DBOP_plus = $00000066; + {$EXTERNALSYM DBOP_plus} + DBOP_minus = $00000067; + {$EXTERNALSYM DBOP_minus} + DBOP_times = $00000068; + {$EXTERNALSYM DBOP_times} + DBOP_over = $00000069; + {$EXTERNALSYM DBOP_over} + DBOP_div = $0000006A; + {$EXTERNALSYM DBOP_div} + DBOP_modulo = $0000006B; + {$EXTERNALSYM DBOP_modulo} + DBOP_power = $0000006C; + {$EXTERNALSYM DBOP_power} + DBOP_like = $0000006D; + {$EXTERNALSYM DBOP_like} + DBOP_sounds_like = $0000006E; + {$EXTERNALSYM DBOP_sounds_like} + DBOP_like_any = $0000006F; + {$EXTERNALSYM DBOP_like_any} + DBOP_like_all = $00000070; + {$EXTERNALSYM DBOP_like_all} + DBOP_is_INVALID = $00000071; + {$EXTERNALSYM DBOP_is_INVALID} + DBOP_is_TRUE = $00000072; + {$EXTERNALSYM DBOP_is_TRUE} + DBOP_is_FALSE = $00000073; + {$EXTERNALSYM DBOP_is_FALSE} + DBOP_and = $00000074; + {$EXTERNALSYM DBOP_and} + DBOP_or = $00000075; + {$EXTERNALSYM DBOP_or} + DBOP_xor = $00000076; + {$EXTERNALSYM DBOP_xor} + DBOP_equivalent = $00000077; + {$EXTERNALSYM DBOP_equivalent} + DBOP_not = $00000078; + {$EXTERNALSYM DBOP_not} + DBOP_implies = $00000079; + {$EXTERNALSYM DBOP_implies} + DBOP_overlaps = $0000007A; + {$EXTERNALSYM DBOP_overlaps} + DBOP_case_condition = $0000007B; + {$EXTERNALSYM DBOP_case_condition} + DBOP_case_value = $0000007C; + {$EXTERNALSYM DBOP_case_value} + DBOP_nullif = $0000007D; + {$EXTERNALSYM DBOP_nullif} + DBOP_cast = $0000007E; + {$EXTERNALSYM DBOP_cast} + DBOP_coalesce = $0000007F; + {$EXTERNALSYM DBOP_coalesce} + DBOP_position = $00000080; + {$EXTERNALSYM DBOP_position} + DBOP_extract = $00000081; + {$EXTERNALSYM DBOP_extract} + DBOP_char_length = $00000082; + {$EXTERNALSYM DBOP_char_length} + DBOP_octet_length = $00000083; + {$EXTERNALSYM DBOP_octet_length} + DBOP_bit_length = $00000084; + {$EXTERNALSYM DBOP_bit_length} + DBOP_substring = $00000085; + {$EXTERNALSYM DBOP_substring} + DBOP_upper = $00000086; + {$EXTERNALSYM DBOP_upper} + DBOP_lower = $00000087; + {$EXTERNALSYM DBOP_lower} + DBOP_trim = $00000088; + {$EXTERNALSYM DBOP_trim} + DBOP_translate = $00000089; + {$EXTERNALSYM DBOP_translate} + DBOP_convert = $0000008A; + {$EXTERNALSYM DBOP_convert} + DBOP_string_concat = $0000008B; + {$EXTERNALSYM DBOP_string_concat} + DBOP_current_date = $0000008C; + {$EXTERNALSYM DBOP_current_date} + DBOP_current_time = $0000008D; + {$EXTERNALSYM DBOP_current_time} + DBOP_current_timestamp = $0000008E; + {$EXTERNALSYM DBOP_current_timestamp} + DBOP_content_select = $0000008F; + {$EXTERNALSYM DBOP_content_select} + DBOP_content = $00000090; + {$EXTERNALSYM DBOP_content} + DBOP_content_freetext = $00000091; + {$EXTERNALSYM DBOP_content_freetext} + DBOP_content_proximity = $00000092; + {$EXTERNALSYM DBOP_content_proximity} + DBOP_content_vector_or = $00000093; + {$EXTERNALSYM DBOP_content_vector_or} + DBOP_delete = $00000094; + {$EXTERNALSYM DBOP_delete} + DBOP_update = $00000095; + {$EXTERNALSYM DBOP_update} + DBOP_insert = $00000096; + {$EXTERNALSYM DBOP_insert} + DBOP_min = $00000097; + {$EXTERNALSYM DBOP_min} + DBOP_max = $00000098; + {$EXTERNALSYM DBOP_max} + DBOP_count = $00000099; + {$EXTERNALSYM DBOP_count} + DBOP_sum = $0000009A; + {$EXTERNALSYM DBOP_sum} + DBOP_avg = $0000009B; + {$EXTERNALSYM DBOP_avg} + DBOP_any_sample = $0000009C; + {$EXTERNALSYM DBOP_any_sample} + DBOP_stddev = $0000009D; + {$EXTERNALSYM DBOP_stddev} + DBOP_stddev_pop = $0000009E; + {$EXTERNALSYM DBOP_stddev_pop} + DBOP_var = $0000009F; + {$EXTERNALSYM DBOP_var} + DBOP_var_pop = $000000A0; + {$EXTERNALSYM DBOP_var_pop} + DBOP_first = $000000A1; + {$EXTERNALSYM DBOP_first} + DBOP_last = $000000A2; + {$EXTERNALSYM DBOP_last} + DBOP_in = $000000A3; + {$EXTERNALSYM DBOP_in} + DBOP_exists = $000000A4; + {$EXTERNALSYM DBOP_exists} + DBOP_unique = $000000A5; + {$EXTERNALSYM DBOP_unique} + DBOP_subset = $000000A6; + {$EXTERNALSYM DBOP_subset} + DBOP_proper_subset = $000000A7; + {$EXTERNALSYM DBOP_proper_subset} + DBOP_superset = $000000A8; + {$EXTERNALSYM DBOP_superset} + DBOP_proper_superset = $000000A9; + {$EXTERNALSYM DBOP_proper_superset} + DBOP_disjoint = $000000AA; + {$EXTERNALSYM DBOP_disjoint} + DBOP_pass_through = $000000AB; + {$EXTERNALSYM DBOP_pass_through} + DBOP_defined_by_GUID = $000000AC; + {$EXTERNALSYM DBOP_defined_by_GUID} + DBOP_text_command = $000000AD; + {$EXTERNALSYM DBOP_text_command} + DBOP_SQL_select = $000000AE; + {$EXTERNALSYM DBOP_SQL_select} + DBOP_prior_command_tree = $000000AF; + {$EXTERNALSYM DBOP_prior_command_tree} + DBOP_add_columns = $000000B0; + {$EXTERNALSYM DBOP_add_columns} + DBOP_column_list_anchor = $000000B1; + {$EXTERNALSYM DBOP_column_list_anchor} + DBOP_column_list_element = $000000B2; + {$EXTERNALSYM DBOP_column_list_element} + DBOP_command_list_anchor = $000000B3; + {$EXTERNALSYM DBOP_command_list_anchor} + DBOP_command_list_element = $000000B4; + {$EXTERNALSYM DBOP_command_list_element} + DBOP_from_list_anchor = $000000B5; + {$EXTERNALSYM DBOP_from_list_anchor} + DBOP_from_list_element = $000000B6; + {$EXTERNALSYM DBOP_from_list_element} + DBOP_project_list_anchor = $000000B7; + {$EXTERNALSYM DBOP_project_list_anchor} + DBOP_project_list_element = $000000B8; + {$EXTERNALSYM DBOP_project_list_element} + DBOP_row_list_anchor = $000000B9; + {$EXTERNALSYM DBOP_row_list_anchor} + DBOP_row_list_element = $000000BA; + {$EXTERNALSYM DBOP_row_list_element} + DBOP_scalar_list_anchor = $000000BB; + {$EXTERNALSYM DBOP_scalar_list_anchor} + DBOP_scalar_list_element = $000000BC; + {$EXTERNALSYM DBOP_scalar_list_element} + DBOP_set_list_anchor = $000000BD; + {$EXTERNALSYM DBOP_set_list_anchor} + DBOP_set_list_element = $000000BE; + {$EXTERNALSYM DBOP_set_list_element} + DBOP_sort_list_anchor = $000000BF; + {$EXTERNALSYM DBOP_sort_list_anchor} + DBOP_sort_list_element = $000000C0; + {$EXTERNALSYM DBOP_sort_list_element} + DBOP_alter_character_set = $000000C1; + {$EXTERNALSYM DBOP_alter_character_set} + DBOP_alter_collation = $000000C2; + {$EXTERNALSYM DBOP_alter_collation} + DBOP_alter_domain = $000000C3; + {$EXTERNALSYM DBOP_alter_domain} + DBOP_alter_index = $000000C4; + {$EXTERNALSYM DBOP_alter_index} + DBOP_alter_procedure = $000000C5; + {$EXTERNALSYM DBOP_alter_procedure} + DBOP_alter_schema = $000000C6; + {$EXTERNALSYM DBOP_alter_schema} + DBOP_alter_table = $000000C7; + {$EXTERNALSYM DBOP_alter_table} + DBOP_alter_trigger = $000000C8; + {$EXTERNALSYM DBOP_alter_trigger} + DBOP_alter_view = $000000C9; + {$EXTERNALSYM DBOP_alter_view} + DBOP_coldef_list_anchor = $000000CA; + {$EXTERNALSYM DBOP_coldef_list_anchor} + DBOP_coldef_list_element = $000000CB; + {$EXTERNALSYM DBOP_coldef_list_element} + DBOP_create_assertion = $000000CC; + {$EXTERNALSYM DBOP_create_assertion} + DBOP_create_character_set = $000000CD; + {$EXTERNALSYM DBOP_create_character_set} + DBOP_create_collation = $000000CE; + {$EXTERNALSYM DBOP_create_collation} + DBOP_create_domain = $000000CF; + {$EXTERNALSYM DBOP_create_domain} + DBOP_create_index = $000000D0; + {$EXTERNALSYM DBOP_create_index} + DBOP_create_procedure = $000000D1; + {$EXTERNALSYM DBOP_create_procedure} + DBOP_create_schema = $000000D2; + {$EXTERNALSYM DBOP_create_schema} + DBOP_create_synonym = $000000D3; + {$EXTERNALSYM DBOP_create_synonym} + DBOP_create_table = $000000D4; + {$EXTERNALSYM DBOP_create_table} + DBOP_create_temporary_table = $000000D5; + {$EXTERNALSYM DBOP_create_temporary_table} + DBOP_create_translation = $000000D6; + {$EXTERNALSYM DBOP_create_translation} + DBOP_create_trigger = $000000D7; + {$EXTERNALSYM DBOP_create_trigger} + DBOP_create_view = $000000D8; + {$EXTERNALSYM DBOP_create_view} + DBOP_drop_assertion = $000000D9; + {$EXTERNALSYM DBOP_drop_assertion} + DBOP_drop_character_set = $000000DA; + {$EXTERNALSYM DBOP_drop_character_set} + DBOP_drop_collation = $000000DB; + {$EXTERNALSYM DBOP_drop_collation} + DBOP_drop_domain = $000000DC; + {$EXTERNALSYM DBOP_drop_domain} + DBOP_drop_index = $000000DD; + {$EXTERNALSYM DBOP_drop_index} + DBOP_drop_procedure = $000000DE; + {$EXTERNALSYM DBOP_drop_procedure} + DBOP_drop_schema = $000000DF; + {$EXTERNALSYM DBOP_drop_schema} + DBOP_drop_synonym = $000000E0; + {$EXTERNALSYM DBOP_drop_synonym} + DBOP_drop_table = $000000E1; + {$EXTERNALSYM DBOP_drop_table} + DBOP_drop_translation = $000000E2; + {$EXTERNALSYM DBOP_drop_translation} + DBOP_drop_trigger = $000000E3; + {$EXTERNALSYM DBOP_drop_trigger} + DBOP_drop_view = $000000E4; + {$EXTERNALSYM DBOP_drop_view} + DBOP_foreign_key = $000000E5; + {$EXTERNALSYM DBOP_foreign_key} + DBOP_grant_privileges = $000000E6; + {$EXTERNALSYM DBOP_grant_privileges} + DBOP_index_list_anchor = $000000E7; + {$EXTERNALSYM DBOP_index_list_anchor} + DBOP_index_list_element = $000000E8; + {$EXTERNALSYM DBOP_index_list_element} + DBOP_primary_key = $000000E9; + {$EXTERNALSYM DBOP_primary_key} + DBOP_property_list_anchor = $000000EA; + {$EXTERNALSYM DBOP_property_list_anchor} + DBOP_property_list_element = $000000EB; + {$EXTERNALSYM DBOP_property_list_element} + DBOP_referenced_table = $000000EC; + {$EXTERNALSYM DBOP_referenced_table} + DBOP_rename_object = $000000ED; + {$EXTERNALSYM DBOP_rename_object} + DBOP_revoke_privileges = $000000EE; + {$EXTERNALSYM DBOP_revoke_privileges} + DBOP_schema_authorization = $000000EF; + {$EXTERNALSYM DBOP_schema_authorization} + DBOP_unique_key = $000000F0; + {$EXTERNALSYM DBOP_unique_key} + +// DBPARAMFLAGSENUM constants +type + DBPARAMFLAGSENUM = TOleEnum; + {$EXTERNALSYM DBPARAMFLAGSENUM} +const + DBPARAMFLAGS_ISINPUT = $00000001; + {$EXTERNALSYM DBPARAMFLAGS_ISINPUT} + DBPARAMFLAGS_ISOUTPUT = $00000002; + {$EXTERNALSYM DBPARAMFLAGS_ISOUTPUT} + DBPARAMFLAGS_ISSIGNED = $00000010; + {$EXTERNALSYM DBPARAMFLAGS_ISSIGNED} + DBPARAMFLAGS_ISNULLABLE = $00000040; + {$EXTERNALSYM DBPARAMFLAGS_ISNULLABLE} + DBPARAMFLAGS_ISLONG = $00000080; + {$EXTERNALSYM DBPARAMFLAGS_ISLONG} + +// DBPARAMFLAGSENUM20 constants +type + DBPARAMFLAGSENUM20 = TOleEnum; + {$EXTERNALSYM DBPARAMFLAGSENUM20} +const + DBPARAMFLAGS_SCALEISNEGATIVE = $00000100; + {$EXTERNALSYM DBPARAMFLAGS_SCALEISNEGATIVE} + +// DBPROPFLAGSENUM constants +type + DBPROPFLAGSENUM = TOleEnum; + {$EXTERNALSYM DBPROPFLAGSENUM} +const + DBPROPFLAGS_NOTSUPPORTED = $00000000; + {$EXTERNALSYM DBPROPFLAGS_NOTSUPPORTED} + DBPROPFLAGS_COLUMN = $00000001; + {$EXTERNALSYM DBPROPFLAGS_COLUMN} + DBPROPFLAGS_DATASOURCE = $00000002; + {$EXTERNALSYM DBPROPFLAGS_DATASOURCE} + DBPROPFLAGS_DATASOURCECREATE = $00000004; + {$EXTERNALSYM DBPROPFLAGS_DATASOURCECREATE} + DBPROPFLAGS_DATASOURCEINFO = $00000008; + {$EXTERNALSYM DBPROPFLAGS_DATASOURCEINFO} + DBPROPFLAGS_DBINIT = $00000010; + {$EXTERNALSYM DBPROPFLAGS_DBINIT} + DBPROPFLAGS_INDEX = $00000020; + {$EXTERNALSYM DBPROPFLAGS_INDEX} + DBPROPFLAGS_ROWSET = $00000040; + {$EXTERNALSYM DBPROPFLAGS_ROWSET} + DBPROPFLAGS_TABLE = $00000080; + {$EXTERNALSYM DBPROPFLAGS_TABLE} + DBPROPFLAGS_COLUMNOK = $00000100; + {$EXTERNALSYM DBPROPFLAGS_COLUMNOK} + DBPROPFLAGS_READ = $00000200; + {$EXTERNALSYM DBPROPFLAGS_READ} + DBPROPFLAGS_WRITE = $00000400; + {$EXTERNALSYM DBPROPFLAGS_WRITE} + DBPROPFLAGS_REQUIRED = $00000800; + {$EXTERNALSYM DBPROPFLAGS_REQUIRED} + DBPROPFLAGS_SESSION = $00001000; + {$EXTERNALSYM DBPROPFLAGS_SESSION} + +// DBPROPFLAGSENUM21 constants +type + DBPROPFLAGSENUM21 = TOleEnum; + {$EXTERNALSYM DBPROPFLAGSENUM21} +const + DBPROPFLAGS_TRUSTEE = $00002000; + {$EXTERNALSYM DBPROPFLAGS_TRUSTEE} + +// DBPROPOPTIONSENUM constants +type + DBPROPOPTIONSENUM = TOleEnum; + {$EXTERNALSYM DBPROPOPTIONSENUM} +const + DBPROPOPTIONS_REQUIRED = $00000000; + {$EXTERNALSYM DBPROPOPTIONS_REQUIRED} + DBPROPOPTIONS_SETIFCHEAP = $00000001; + {$EXTERNALSYM DBPROPOPTIONS_SETIFCHEAP} + DBPROPOPTIONS_OPTIONAL = $00000001; + {$EXTERNALSYM DBPROPOPTIONS_OPTIONAL} + +// DBPROPSTATUSENUM constants +type + DBPROPSTATUSENUM = TOleEnum; + {$EXTERNALSYM DBPROPSTATUSENUM} +const + DBPROPSTATUS_OK = $00000000; + {$EXTERNALSYM DBPROPSTATUS_OK} + DBPROPSTATUS_NOTSUPPORTED = $00000001; + {$EXTERNALSYM DBPROPSTATUS_NOTSUPPORTED} + DBPROPSTATUS_BADVALUE = $00000002; + {$EXTERNALSYM DBPROPSTATUS_BADVALUE} + DBPROPSTATUS_BADOPTION = $00000003; + {$EXTERNALSYM DBPROPSTATUS_BADOPTION} + DBPROPSTATUS_BADCOLUMN = $00000004; + {$EXTERNALSYM DBPROPSTATUS_BADCOLUMN} + DBPROPSTATUS_NOTALLSETTABLE = $00000005; + {$EXTERNALSYM DBPROPSTATUS_NOTALLSETTABLE} + DBPROPSTATUS_NOTSETTABLE = $00000006; + {$EXTERNALSYM DBPROPSTATUS_NOTSETTABLE} + DBPROPSTATUS_NOTSET = $00000007; + {$EXTERNALSYM DBPROPSTATUS_NOTSET} + DBPROPSTATUS_CONFLICTING = $00000008; + {$EXTERNALSYM DBPROPSTATUS_CONFLICTING} + +// DBPROPSTATUSENUM21 constants +type + DBPROPSTATUSENUM21 = TOleEnum; + {$EXTERNALSYM DBPROPSTATUSENUM21} +const + DBPROPSTATUS_NOTAVAILAVLE = $00000009; + {$EXTERNALSYM DBPROPSTATUS_NOTAVAILAVLE} + +// DBINDEX_COL_ORDERENUM constants +type + DBINDEX_COL_ORDERENUM = TOleEnum; + {$EXTERNALSYM DBINDEX_COL_ORDERENUM} +const + DBINDEX_COL_ORDER_ASC = $00000000; + {$EXTERNALSYM DBINDEX_COL_ORDER_ASC} + DBINDEX_COL_ORDER_DESC = $00000001; + {$EXTERNALSYM DBINDEX_COL_ORDER_DESC} + +// DBCOLUMNDESCFLAGSENUM constants +type + DBCOLUMNDESCFLAGSENUM = TOleEnum; + {$EXTERNALSYM DBCOLUMNDESCFLAGSENUM} +const + DBCOLUMNDESCFLAGS_TYPENAME = $00000001; + {$EXTERNALSYM DBCOLUMNDESCFLAGS_TYPENAME} + DBCOLUMNDESCFLAGS_ITYPEINFO = $00000002; + {$EXTERNALSYM DBCOLUMNDESCFLAGS_ITYPEINFO} + DBCOLUMNDESCFLAGS_PROPERTIES = $00000004; + {$EXTERNALSYM DBCOLUMNDESCFLAGS_PROPERTIES} + DBCOLUMNDESCFLAGS_CLSID = $00000008; + {$EXTERNALSYM DBCOLUMNDESCFLAGS_CLSID} + DBCOLUMNDESCFLAGS_COLSIZE = $00000010; + {$EXTERNALSYM DBCOLUMNDESCFLAGS_COLSIZE} + DBCOLUMNDESCFLAGS_DBCID = $00000020; + {$EXTERNALSYM DBCOLUMNDESCFLAGS_DBCID} + DBCOLUMNDESCFLAGS_WTYPE = $00000040; + {$EXTERNALSYM DBCOLUMNDESCFLAGS_WTYPE} + DBCOLUMNDESCFLAGS_PRECISION = $00000080; + {$EXTERNALSYM DBCOLUMNDESCFLAGS_PRECISION} + DBCOLUMNDESCFLAGS_SCALE = $00000100; + {$EXTERNALSYM DBCOLUMNDESCFLAGS_SCALE} + +// DBEVENTPHASEENUM constants +type + DBEVENTPHASEENUM = TOleEnum; + {$EXTERNALSYM DBEVENTPHASEENUM} +const + DBEVENTPHASE_OKTODO = $00000000; + {$EXTERNALSYM DBEVENTPHASE_OKTODO} + DBEVENTPHASE_ABOUTTODO = $00000001; + {$EXTERNALSYM DBEVENTPHASE_ABOUTTODO} + DBEVENTPHASE_SYNCHAFTER = $00000002; + {$EXTERNALSYM DBEVENTPHASE_SYNCHAFTER} + DBEVENTPHASE_FAILEDTODO = $00000003; + {$EXTERNALSYM DBEVENTPHASE_FAILEDTODO} + DBEVENTPHASE_DIDEVENT = $00000004; + {$EXTERNALSYM DBEVENTPHASE_DIDEVENT} + +// DBREASONENUM constants +type + DBREASONENUM = TOleEnum; + {$EXTERNALSYM DBREASONENUM} +const + DBREASON_ROWSET_FETCHPOSITIONCHANGE = $00000000; + {$EXTERNALSYM DBREASON_ROWSET_FETCHPOSITIONCHANGE} + DBREASON_ROWSET_RELEASE = $00000001; + {$EXTERNALSYM DBREASON_ROWSET_RELEASE} + DBREASON_COLUMN_SET = $00000002; + {$EXTERNALSYM DBREASON_COLUMN_SET} + DBREASON_COLUMN_RECALCULATED = $00000003; + {$EXTERNALSYM DBREASON_COLUMN_RECALCULATED} + DBREASON_ROW_ACTIVATE = $00000004; + {$EXTERNALSYM DBREASON_ROW_ACTIVATE} + DBREASON_ROW_RELEASE = $00000005; + {$EXTERNALSYM DBREASON_ROW_RELEASE} + DBREASON_ROW_DELETE = $00000006; + {$EXTERNALSYM DBREASON_ROW_DELETE} + DBREASON_ROW_FIRSTCHANGE = $00000007; + {$EXTERNALSYM DBREASON_ROW_FIRSTCHANGE} + DBREASON_ROW_INSERT = $00000008; + {$EXTERNALSYM DBREASON_ROW_INSERT} + DBREASON_ROW_RESYNCH = $00000009; + {$EXTERNALSYM DBREASON_ROW_RESYNCH} + DBREASON_ROW_UNDOCHANGE = $0000000A; + {$EXTERNALSYM DBREASON_ROW_UNDOCHANGE} + DBREASON_ROW_UNDOINSERT = $0000000B; + {$EXTERNALSYM DBREASON_ROW_UNDOINSERT} + DBREASON_ROW_UNDODELETE = $0000000C; + {$EXTERNALSYM DBREASON_ROW_UNDODELETE} + DBREASON_ROW_UPDATE = $0000000D; + {$EXTERNALSYM DBREASON_ROW_UPDATE} + DBREASON_ROWSET_CHANGED = $0000000E; + {$EXTERNALSYM DBREASON_ROWSET_CHANGED} + +// DBREASONENUM15 constants +type + DBREASONENUM15 = TOleEnum; + {$EXTERNALSYM DBREASONENUM15} +const + DBREASON_ROWPOSITION_CHANGED = $0000000F; + {$EXTERNALSYM DBREASON_ROWPOSITION_CHANGED} + DBREASON_ROWPOSITION_CHAPTERCHANGED = $00000010; + {$EXTERNALSYM DBREASON_ROWPOSITION_CHAPTERCHANGED} + DBREASON_ROWPOSITION_CLEARED = $00000011; + {$EXTERNALSYM DBREASON_ROWPOSITION_CLEARED} + DBREASON_ROW_ASYNCHINSERT = $00000012; + {$EXTERNALSYM DBREASON_ROW_ASYNCHINSERT} + +// DBREASONENUM25 constants +type + DBREASONENUM25 = TOleEnum; + {$EXTERNALSYM DBREASONENUM25} +const + DBREASON_ROWSET_ROWSADDED = $00000013; + {$EXTERNALSYM DBREASON_ROWSET_ROWSADDED} + DBREASON_ROWSET_POPULATIONCOMPLETE = $00000014; + {$EXTERNALSYM DBREASON_ROWSET_POPULATIONCOMPLETE} + DBREASON_ROWSET_POPULATIONSTOPPED = $00000015; + {$EXTERNALSYM DBREASON_ROWSET_POPULATIONSTOPPED} + +// DBCOMPAREOPSENUM constants +type + DBCOMPAREOPSENUM = TOleEnum; + {$EXTERNALSYM DBCOMPAREOPSENUM} +const + DBCOMPAREOPS_LT = $00000000; + {$EXTERNALSYM DBCOMPAREOPS_LT} + DBCOMPAREOPS_LE = $00000001; + {$EXTERNALSYM DBCOMPAREOPS_LE} + DBCOMPAREOPS_EQ = $00000002; + {$EXTERNALSYM DBCOMPAREOPS_EQ} + DBCOMPAREOPS_GE = $00000003; + {$EXTERNALSYM DBCOMPAREOPS_GE} + DBCOMPAREOPS_GT = $00000004; + {$EXTERNALSYM DBCOMPAREOPS_GT} + DBCOMPAREOPS_BEGINSWITH = $00000005; + {$EXTERNALSYM DBCOMPAREOPS_BEGINSWITH} + DBCOMPAREOPS_CONTAINS = $00000006; + {$EXTERNALSYM DBCOMPAREOPS_CONTAINS} + DBCOMPAREOPS_NE = $00000007; + {$EXTERNALSYM DBCOMPAREOPS_NE} + DBCOMPAREOPS_IGNORE = $00000008; + {$EXTERNALSYM DBCOMPAREOPS_IGNORE} + DBCOMPAREOPS_CASESENSITIVE = $00001000; + {$EXTERNALSYM DBCOMPAREOPS_CASESENSITIVE} + DBCOMPAREOPS_CASEINSENSITIVE = $00002000; + {$EXTERNALSYM DBCOMPAREOPS_CASEINSENSITIVE} + +// DBCOMPAREOPSENUM20 constants +type + DBCOMPAREOPSENUM20 = TOleEnum; + {$EXTERNALSYM DBCOMPAREOPSENUM20} +const + DBCOMPAREOPS_NOTBEGINSWITH = $00000009; + {$EXTERNALSYM DBCOMPAREOPS_NOTBEGINSWITH} + DBCOMPAREOPS_NOTCONTAINS = $0000000A; + {$EXTERNALSYM DBCOMPAREOPS_NOTCONTAINS} + +// DBASYNCHOPENUM constants +type + DBASYNCHOPENUM = TOleEnum; + {$EXTERNALSYM DBASYNCHOPENUM} +const + DBASYNCHOP_OPEN = $00000000; + {$EXTERNALSYM DBASYNCHOP_OPEN} + +// DBASYNCHPHASEENUM constants +type + DBASYNCHPHASEENUM = TOleEnum; + {$EXTERNALSYM DBASYNCHPHASEENUM} +const + DBASYNCHPHASE_INITIALIZATION = $00000000; + {$EXTERNALSYM DBASYNCHPHASE_INITIALIZATION} + DBASYNCHPHASE_POPULATION = $00000001; + {$EXTERNALSYM DBASYNCHPHASE_POPULATION} + DBASYNCHPHASE_COMPLETE = $00000002; + {$EXTERNALSYM DBASYNCHPHASE_COMPLETE} + DBASYNCHPHASE_CANCELED = $00000003; + {$EXTERNALSYM DBASYNCHPHASE_CANCELED} + +// DBSORTENUM constants +type + DBSORTENUM = TOleEnum; + {$EXTERNALSYM DBSORTENUM} +const + DBSORT_ASCENDING = $00000000; + {$EXTERNALSYM DBSORT_ASCENDING} + DBSORT_DESCENDING = $00000001; + {$EXTERNALSYM DBSORT_DESCENDING} + +// DBACCESSORFLAGSENUM constants +type + DBACCESSORFLAGSENUM = TOleEnum; + {$EXTERNALSYM DBACCESSORFLAGSENUM} +const + DBACCESSOR_INVALID = $00000000; + {$EXTERNALSYM DBACCESSOR_INVALID} + DBACCESSOR_PASSBYREF = $00000001; + {$EXTERNALSYM DBACCESSOR_PASSBYREF} + DBACCESSOR_ROWDATA = $00000002; + {$EXTERNALSYM DBACCESSOR_ROWDATA} + DBACCESSOR_PARAMETERDATA = $00000004; + {$EXTERNALSYM DBACCESSOR_PARAMETERDATA} + DBACCESSOR_OPTIMIZED = $00000008; + {$EXTERNALSYM DBACCESSOR_OPTIMIZED} + +// DBACCESSORFLAGSENUM25 constants +type + DBACCESSORFLAGSENUM25 = TOleEnum; + {$EXTERNALSYM DBACCESSORFLAGSENUM25} +const + DBACCESSOR_INHERITED = $00000010; + {$EXTERNALSYM DBACCESSOR_INHERITED} + +// DBBINDSTATUSENUM constants +type + DBBINDSTATUSENUM = TOleEnum; + {$EXTERNALSYM DBBINDSTATUSENUM} +const + DBBINDSTATUS_OK = $00000000; + {$EXTERNALSYM DBBINDSTATUS_OK} + DBBINDSTATUS_BADORDINAL = $00000001; + {$EXTERNALSYM DBBINDSTATUS_BADORDINAL} + DBBINDSTATUS_UNSUPPORTEDCONVERSION = $00000002; + {$EXTERNALSYM DBBINDSTATUS_UNSUPPORTEDCONVERSION} + DBBINDSTATUS_BADBINDINFO = $00000003; + {$EXTERNALSYM DBBINDSTATUS_BADBINDINFO} + DBBINDSTATUS_BADSTORAGEFLAGS = $00000004; + {$EXTERNALSYM DBBINDSTATUS_BADSTORAGEFLAGS} + DBBINDSTATUS_NOINTERFACE = $00000005; + {$EXTERNALSYM DBBINDSTATUS_NOINTERFACE} + DBBINDSTATUS_MULTIPLESTORAGE = $00000006; + {$EXTERNALSYM DBBINDSTATUS_MULTIPLESTORAGE} + +// DBCOMPAREENUM constants +type + DBCOMPAREENUM = TOleEnum; + {$EXTERNALSYM DBCOMPAREENUM} +const + DBCOMPARE_LT = $00000000; + {$EXTERNALSYM DBCOMPARE_LT} + DBCOMPARE_EQ = $00000001; + {$EXTERNALSYM DBCOMPARE_EQ} + DBCOMPARE_GT = $00000002; + {$EXTERNALSYM DBCOMPARE_GT} + DBCOMPARE_NE = $00000003; + {$EXTERNALSYM DBCOMPARE_NE} + DBCOMPARE_NOTCOMPARABLE = $00000004; + {$EXTERNALSYM DBCOMPARE_NOTCOMPARABLE} + +// DBPOSITIONFLAGSENUM constants +type + DBPOSITIONFLAGSENUM = TOleEnum; + {$EXTERNALSYM DBPOSITIONFLAGSENUM} +const + DBPOSITION_OK = $00000000; + {$EXTERNALSYM DBPOSITION_OK} + DBPOSITION_NOROW = $00000001; + {$EXTERNALSYM DBPOSITION_NOROW} + DBPOSITION_BOF = $00000002; + {$EXTERNALSYM DBPOSITION_BOF} + DBPOSITION_EOF = $00000003; + {$EXTERNALSYM DBPOSITION_EOF} + +// DBPENDINGSTATUSENUM constants +type + DBPENDINGSTATUSENUM = TOleEnum; + {$EXTERNALSYM DBPENDINGSTATUSENUM} +const + DBPENDINGSTATUS_NEW = $00000001; + {$EXTERNALSYM DBPENDINGSTATUS_NEW} + DBPENDINGSTATUS_CHANGED = $00000002; + {$EXTERNALSYM DBPENDINGSTATUS_CHANGED} + DBPENDINGSTATUS_DELETED = $00000004; + {$EXTERNALSYM DBPENDINGSTATUS_DELETED} + DBPENDINGSTATUS_UNCHANGED = $00000008; + {$EXTERNALSYM DBPENDINGSTATUS_UNCHANGED} + DBPENDINGSTATUS_INVALIDROW = $00000010; + {$EXTERNALSYM DBPENDINGSTATUS_INVALIDROW} + +// DBSEEKENUM constants +type + DBSEEKENUM = TOleEnum; + {$EXTERNALSYM DBSEEKENUM} +const + DBSEEK_INVALID = $00000000; + {$EXTERNALSYM DBSEEK_INVALID} + DBSEEK_FIRSTEQ = $00000001; + {$EXTERNALSYM DBSEEK_FIRSTEQ} + DBSEEK_LASTEQ = $00000002; + {$EXTERNALSYM DBSEEK_LASTEQ} + DBSEEK_GE = $00000004; + {$EXTERNALSYM DBSEEK_GE} + DBSEEK_GT = $00000008; + {$EXTERNALSYM DBSEEK_GT} + DBSEEK_LE = $00000010; + {$EXTERNALSYM DBSEEK_LE} + DBSEEK_LT = $00000020; + {$EXTERNALSYM DBSEEK_LT} + +// DBRANGEENUM constants +type + DBRANGEENUM = TOleEnum; + {$EXTERNALSYM DBRANGEENUM} +const + DBRANGE_INCLUSIVESTART = $00000000; + {$EXTERNALSYM DBRANGE_INCLUSIVESTART} + DBRANGE_INCLUSIVEEND = $00000000; + {$EXTERNALSYM DBRANGE_INCLUSIVEEND} + DBRANGE_EXCLUSIVESTART = $00000001; + {$EXTERNALSYM DBRANGE_EXCLUSIVESTART} + DBRANGE_EXCLUSIVEEND = $00000002; + {$EXTERNALSYM DBRANGE_EXCLUSIVEEND} + DBRANGE_EXCLUDENULLS = $00000004; + {$EXTERNALSYM DBRANGE_EXCLUDENULLS} + DBRANGE_PREFIX = $00000008; + {$EXTERNALSYM DBRANGE_PREFIX} + DBRANGE_MATCH = $00000010; + {$EXTERNALSYM DBRANGE_MATCH} + +// DBRANGEENUM20 constants +type + DBRANGEENUM20 = TOleEnum; + {$EXTERNALSYM DBRANGEENUM20} +const + DBRANGE_MATCH_N_SHIFT = $00000018; + {$EXTERNALSYM DBRANGE_MATCH_N_SHIFT} + DBRANGE_MATCH_N_MASK = $000000FF; + {$EXTERNALSYM DBRANGE_MATCH_N_MASK} + +// DBWATCHNOTIFYENUM constants +type + DBWATCHNOTIFYENUM = TOleEnum; + {$EXTERNALSYM DBWATCHNOTIFYENUM} +const + DBWATCHNOTIFY_ROWSCHANGED = $00000001; + {$EXTERNALSYM DBWATCHNOTIFY_ROWSCHANGED} + DBWATCHNOTIFY_QUERYDONE = $00000002; + {$EXTERNALSYM DBWATCHNOTIFY_QUERYDONE} + DBWATCHNOTIFY_QUERYREEXECUTED = $00000003; + {$EXTERNALSYM DBWATCHNOTIFY_QUERYREEXECUTED} + +// DBWATCHMODEENUM constants +type + DBWATCHMODEENUM = TOleEnum; + {$EXTERNALSYM DBWATCHMODEENUM} +const + DBWATCHMODE_ALL = $00000001; + {$EXTERNALSYM DBWATCHMODE_ALL} + DBWATCHMODE_EXTEND = $00000002; + {$EXTERNALSYM DBWATCHMODE_EXTEND} + DBWATCHMODE_MOVE = $00000004; + {$EXTERNALSYM DBWATCHMODE_MOVE} + DBWATCHMODE_COUNT = $00000008; + {$EXTERNALSYM DBWATCHMODE_COUNT} + +// DBROWCHANGEKINDENUM constants +type + DBROWCHANGEKINDENUM = TOleEnum; + {$EXTERNALSYM DBROWCHANGEKINDENUM} +const + DBROWCHANGEKIND_INSERT = $00000000; + {$EXTERNALSYM DBROWCHANGEKIND_INSERT} + DBROWCHANGEKIND_DELETE = $00000001; + {$EXTERNALSYM DBROWCHANGEKIND_DELETE} + DBROWCHANGEKIND_UPDATE = $00000002; + {$EXTERNALSYM DBROWCHANGEKIND_UPDATE} + DBROWCHANGEKIND_COUNT = $00000003; + {$EXTERNALSYM DBROWCHANGEKIND_COUNT} + +// DBCONVERTFLAGSENUM constants +type + DBCONVERTFLAGSENUM = TOleEnum; + {$EXTERNALSYM DBCONVERTFLAGSENUM} +const + DBCONVERTFLAGS_COLUMN = $00000000; + {$EXTERNALSYM DBCONVERTFLAGS_COLUMN} + DBCONVERTFLAGS_PARAMETER = $00000001; + {$EXTERNALSYM DBCONVERTFLAGS_PARAMETER} + +// DBCONVERTFLAGSENUM20 constants +type + DBCONVERTFLAGSENUM20 = TOleEnum; + {$EXTERNALSYM DBCONVERTFLAGSENUM20} +const + DBCONVERTFLAGS_ISLONG = $00000002; + {$EXTERNALSYM DBCONVERTFLAGS_ISLONG} + DBCONVERTFLAGS_ISFIXEDLENGTH = $00000004; + {$EXTERNALSYM DBCONVERTFLAGS_ISFIXEDLENGTH} + DBCONVERTFLAGS_FROMVARIANT = $00000008; + {$EXTERNALSYM DBCONVERTFLAGS_FROMVARIANT} + +// DBRESOURCEKINDENUM constants +type + DBRESOURCEKINDENUM = TOleEnum; + {$EXTERNALSYM DBRESOURCEKINDENUM} +const + DBRESOURCE_INVALID = $00000000; + {$EXTERNALSYM DBRESOURCE_INVALID} + DBRESOURCE_TOTAL = $00000001; + {$EXTERNALSYM DBRESOURCE_TOTAL} + DBRESOURCE_CPU = $00000002; + {$EXTERNALSYM DBRESOURCE_CPU} + DBRESOURCE_MEMORY = $00000003; + {$EXTERNALSYM DBRESOURCE_MEMORY} + DBRESOURCE_DISK = $00000004; + {$EXTERNALSYM DBRESOURCE_DISK} + DBRESOURCE_NETWORK = $00000005; + {$EXTERNALSYM DBRESOURCE_NETWORK} + DBRESOURCE_RESPONSE = $00000006; + {$EXTERNALSYM DBRESOURCE_RESPONSE} + DBRESOURCE_ROWS = $00000007; + {$EXTERNALSYM DBRESOURCE_ROWS} + DBRESOURCE_OTHER = $00000008; + {$EXTERNALSYM DBRESOURCE_OTHER} + +// DBCOSTUNITENUM constants +type + DBCOSTUNITENUM = TOleEnum; + {$EXTERNALSYM DBCOSTUNITENUM} +const + DBUNIT_INVALID = $00000000; + {$EXTERNALSYM DBUNIT_INVALID} + DBUNIT_WEIGHT = $00000001; + {$EXTERNALSYM DBUNIT_WEIGHT} + DBUNIT_PERCENT = $00000002; + {$EXTERNALSYM DBUNIT_PERCENT} + DBUNIT_MAXIMUM = $00000004; + {$EXTERNALSYM DBUNIT_MAXIMUM} + DBUNIT_MINIMUM = $00000008; + {$EXTERNALSYM DBUNIT_MINIMUM} + DBUNIT_MICRO_SECOND = $00000010; + {$EXTERNALSYM DBUNIT_MICRO_SECOND} + DBUNIT_MILLI_SECOND = $00000020; + {$EXTERNALSYM DBUNIT_MILLI_SECOND} + DBUNIT_SECOND = $00000040; + {$EXTERNALSYM DBUNIT_SECOND} + DBUNIT_MINUTE = $00000080; + {$EXTERNALSYM DBUNIT_MINUTE} + DBUNIT_HOUR = $00000100; + {$EXTERNALSYM DBUNIT_HOUR} + DBUNIT_BYTE = $00000200; + {$EXTERNALSYM DBUNIT_BYTE} + DBUNIT_KILO_BYTE = $00000400; + {$EXTERNALSYM DBUNIT_KILO_BYTE} + DBUNIT_MEGA_BYTE = $00000800; + {$EXTERNALSYM DBUNIT_MEGA_BYTE} + DBUNIT_GIGA_BYTE = $00001000; + {$EXTERNALSYM DBUNIT_GIGA_BYTE} + DBUNIT_NUM_MSGS = $00002000; + {$EXTERNALSYM DBUNIT_NUM_MSGS} + DBUNIT_NUM_LOCKS = $00004000; + {$EXTERNALSYM DBUNIT_NUM_LOCKS} + DBUNIT_NUM_ROWS = $00008000; + {$EXTERNALSYM DBUNIT_NUM_ROWS} + DBUNIT_OTHER = $00010000; + {$EXTERNALSYM DBUNIT_OTHER} + +// DBEXECLIMITSENUM constants +type + DBEXECLIMITSENUM = TOleEnum; + {$EXTERNALSYM DBEXECLIMITSENUM} +const + DBEXECLIMITS_ABORT = $00000001; + {$EXTERNALSYM DBEXECLIMITS_ABORT} + DBEXECLIMITS_STOP = $00000002; + {$EXTERNALSYM DBEXECLIMITS_STOP} + DBEXECLIMITS_SUSPEND = $00000003; + {$EXTERNALSYM DBEXECLIMITS_SUSPEND} + +// DBCOMMANDREUSEENUM constants +type + DBCOMMANDREUSEENUM = TOleEnum; + {$EXTERNALSYM DBCOMMANDREUSEENUM} +const + DBCOMMANDREUSE_NONE = $00000000; + {$EXTERNALSYM DBCOMMANDREUSE_NONE} + DBCOMMANDREUSE_PROPERTIES = $00000001; + {$EXTERNALSYM DBCOMMANDREUSE_PROPERTIES} + DBCOMMANDREUSE_PARAMETERS = $00000002; + {$EXTERNALSYM DBCOMMANDREUSE_PARAMETERS} + +// DBVALUEKINDENUM constants +type + DBVALUEKINDENUM = TOleEnum; + {$EXTERNALSYM DBVALUEKINDENUM} +const + DBVALUEKIND_BYGUID = $00000100; + {$EXTERNALSYM DBVALUEKIND_BYGUID} + DBVALUEKIND_COLDESC = $00000101; + {$EXTERNALSYM DBVALUEKIND_COLDESC} + DBVALUEKIND_ID = $00000102; + {$EXTERNALSYM DBVALUEKIND_ID} + DBVALUEKIND_CONTENT = $00000103; + {$EXTERNALSYM DBVALUEKIND_CONTENT} + DBVALUEKIND_CONTENTVECTOR = $00000104; + {$EXTERNALSYM DBVALUEKIND_CONTENTVECTOR} + DBVALUEKIND_GROUPINFO = $00000105; + {$EXTERNALSYM DBVALUEKIND_GROUPINFO} + DBVALUEKIND_PARAMETER = $00000106; + {$EXTERNALSYM DBVALUEKIND_PARAMETER} + DBVALUEKIND_PROPERTY = $00000107; + {$EXTERNALSYM DBVALUEKIND_PROPERTY} + DBVALUEKIND_SETFUNC = $00000108; + {$EXTERNALSYM DBVALUEKIND_SETFUNC} + DBVALUEKIND_SORTINFO = $00000109; + {$EXTERNALSYM DBVALUEKIND_SORTINFO} + DBVALUEKIND_TEXT = $0000010A; + {$EXTERNALSYM DBVALUEKIND_TEXT} + DBVALUEKIND_COMMAND = $0000010B; + {$EXTERNALSYM DBVALUEKIND_COMMAND} + DBVALUEKIND_MONIKER = $0000010C; + {$EXTERNALSYM DBVALUEKIND_MONIKER} + DBVALUEKIND_ROWSET = $0000010D; + {$EXTERNALSYM DBVALUEKIND_ROWSET} + DBVALUEKIND_LIKE = $0000010E; + {$EXTERNALSYM DBVALUEKIND_LIKE} + DBVALUEKIND_CONTENTPROXIMITY = $0000010F; + {$EXTERNALSYM DBVALUEKIND_CONTENTPROXIMITY} + DBVALUEKIND_IDISPATCH = $00000009; + {$EXTERNALSYM DBVALUEKIND_IDISPATCH} + DBVALUEKIND_IUNKNOWN = $0000000D; + {$EXTERNALSYM DBVALUEKIND_IUNKNOWN} + DBVALUEKIND_EMPTY = $00000000; + {$EXTERNALSYM DBVALUEKIND_EMPTY} + DBVALUEKIND_NULL = $00000001; + {$EXTERNALSYM DBVALUEKIND_NULL} + DBVALUEKIND_I2 = $00000002; + {$EXTERNALSYM DBVALUEKIND_I2} + DBVALUEKIND_I4 = $00000003; + {$EXTERNALSYM DBVALUEKIND_I4} + DBVALUEKIND_R4 = $00000004; + {$EXTERNALSYM DBVALUEKIND_R4} + DBVALUEKIND_R8 = $00000005; + {$EXTERNALSYM DBVALUEKIND_R8} + DBVALUEKIND_CY = $00000006; + {$EXTERNALSYM DBVALUEKIND_CY} + DBVALUEKIND_DATE = $00000007; + {$EXTERNALSYM DBVALUEKIND_DATE} + DBVALUEKIND_BSTR = $00000008; + {$EXTERNALSYM DBVALUEKIND_BSTR} + DBVALUEKIND_ERROR = $0000000A; + {$EXTERNALSYM DBVALUEKIND_ERROR} + DBVALUEKIND_BOOL = $0000000B; + {$EXTERNALSYM DBVALUEKIND_BOOL} + DBVALUEKIND_VARIANT = $0000000C; + {$EXTERNALSYM DBVALUEKIND_VARIANT} + DBVALUEKIND_VECTOR = $00001000; + {$EXTERNALSYM DBVALUEKIND_VECTOR} + DBVALUEKIND_ARRAY = $00002000; + {$EXTERNALSYM DBVALUEKIND_ARRAY} + DBVALUEKIND_BYREF = $00004000; + {$EXTERNALSYM DBVALUEKIND_BYREF} + DBVALUEKIND_I1 = $00000010; + {$EXTERNALSYM DBVALUEKIND_I1} + DBVALUEKIND_UI1 = $00000011; + {$EXTERNALSYM DBVALUEKIND_UI1} + DBVALUEKIND_UI2 = $00000012; + {$EXTERNALSYM DBVALUEKIND_UI2} + DBVALUEKIND_UI4 = $00000013; + {$EXTERNALSYM DBVALUEKIND_UI4} + DBVALUEKIND_I8 = $00000014; + {$EXTERNALSYM DBVALUEKIND_I8} + DBVALUEKIND_UI8 = $00000015; + {$EXTERNALSYM DBVALUEKIND_UI8} + DBVALUEKIND_GUID = $00000048; + {$EXTERNALSYM DBVALUEKIND_GUID} + DBVALUEKIND_BYTES = $00000080; + {$EXTERNALSYM DBVALUEKIND_BYTES} + DBVALUEKIND_STR = $00000081; + {$EXTERNALSYM DBVALUEKIND_STR} + DBVALUEKIND_WSTR = $00000082; + {$EXTERNALSYM DBVALUEKIND_WSTR} + DBVALUEKIND_NUMERIC = $00000083; + {$EXTERNALSYM DBVALUEKIND_NUMERIC} + DBVALUEKIND_DBDATE = $00000085; + {$EXTERNALSYM DBVALUEKIND_DBDATE} + DBVALUEKIND_DBTIME = $00000086; + {$EXTERNALSYM DBVALUEKIND_DBTIME} + DBVALUEKIND_DBTIMESTAMP = $00000087; + {$EXTERNALSYM DBVALUEKIND_DBTIMESTAMP} + +// DBSOURCETYPEENUM constants +type + DBSOURCETYPEENUM = TOleEnum; + {$EXTERNALSYM DBSOURCETYPEENUM} +const + DBSOURCETYPE_DATASOURCE = $00000001; + {$EXTERNALSYM DBSOURCETYPE_DATASOURCE} + DBSOURCETYPE_ENUMERATOR = $00000002; + {$EXTERNALSYM DBSOURCETYPE_ENUMERATOR} + +// DBSOURCETYPEENUM20 constants +type + DBSOURCETYPEENUM20 = TOleEnum; + {$EXTERNALSYM DBSOURCETYPEENUM20} +const + DBSOURCETYPE_DATASOURCE_TDP = $00000001; + {$EXTERNALSYM DBSOURCETYPE_DATASOURCE_TDP} + DBSOURCETYPE_DATASOURCE_MDP = $00000003; + {$EXTERNALSYM DBSOURCETYPE_DATASOURCE_MDP} + +// DBLITERALENUM constants +type + DBLITERALENUM = TOleEnum; + {$EXTERNALSYM DBLITERALENUM} +const + DBLITERAL_INVALID = $00000000; + {$EXTERNALSYM DBLITERAL_INVALID} + DBLITERAL_BINARY_LITERAL = $00000001; + {$EXTERNALSYM DBLITERAL_BINARY_LITERAL} + DBLITERAL_CATALOG_NAME = $00000002; + {$EXTERNALSYM DBLITERAL_CATALOG_NAME} + DBLITERAL_CATALOG_SEPARATOR = $00000003; + {$EXTERNALSYM DBLITERAL_CATALOG_SEPARATOR} + DBLITERAL_CHAR_LITERAL = $00000004; + {$EXTERNALSYM DBLITERAL_CHAR_LITERAL} + DBLITERAL_COLUMN_ALIAS = $00000005; + {$EXTERNALSYM DBLITERAL_COLUMN_ALIAS} + DBLITERAL_COLUMN_NAME = $00000006; + {$EXTERNALSYM DBLITERAL_COLUMN_NAME} + DBLITERAL_CORRELATION_NAME = $00000007; + {$EXTERNALSYM DBLITERAL_CORRELATION_NAME} + DBLITERAL_CURSOR_NAME = $00000008; + {$EXTERNALSYM DBLITERAL_CURSOR_NAME} + DBLITERAL_ESCAPE_PERCENT = $00000009; + {$EXTERNALSYM DBLITERAL_ESCAPE_PERCENT} + DBLITERAL_ESCAPE_UNDERSCORE = $0000000A; + {$EXTERNALSYM DBLITERAL_ESCAPE_UNDERSCORE} + DBLITERAL_INDEX_NAME = $0000000B; + {$EXTERNALSYM DBLITERAL_INDEX_NAME} + DBLITERAL_LIKE_PERCENT = $0000000C; + {$EXTERNALSYM DBLITERAL_LIKE_PERCENT} + DBLITERAL_LIKE_UNDERSCORE = $0000000D; + {$EXTERNALSYM DBLITERAL_LIKE_UNDERSCORE} + DBLITERAL_PROCEDURE_NAME = $0000000E; + {$EXTERNALSYM DBLITERAL_PROCEDURE_NAME} + DBLITERAL_QUOTE = $0000000F; + {$EXTERNALSYM DBLITERAL_QUOTE} + DBLITERAL_SCHEMA_NAME = $00000010; + {$EXTERNALSYM DBLITERAL_SCHEMA_NAME} + DBLITERAL_TABLE_NAME = $00000011; + {$EXTERNALSYM DBLITERAL_TABLE_NAME} + DBLITERAL_TEXT_COMMAND = $00000012; + {$EXTERNALSYM DBLITERAL_TEXT_COMMAND} + DBLITERAL_USER_NAME = $00000013; + {$EXTERNALSYM DBLITERAL_USER_NAME} + DBLITERAL_VIEW_NAME = $00000014; + {$EXTERNALSYM DBLITERAL_VIEW_NAME} + +// DBLITERALENUM20 constants +type + DBLITERALENUM20 = TOleEnum; + {$EXTERNALSYM DBLITERALENUM20} +const + DBLITERAL_CUBE_NAME = $00000015; + {$EXTERNALSYM DBLITERAL_CUBE_NAME} + DBLITERAL_DIMENSION_NAME = $00000016; + {$EXTERNALSYM DBLITERAL_DIMENSION_NAME} + DBLITERAL_HIERARCHY_NAME = $00000017; + {$EXTERNALSYM DBLITERAL_HIERARCHY_NAME} + DBLITERAL_LEVEL_NAME = $00000018; + {$EXTERNALSYM DBLITERAL_LEVEL_NAME} + DBLITERAL_MEMBER_NAME = $00000019; + {$EXTERNALSYM DBLITERAL_MEMBER_NAME} + DBLITERAL_PROPERTY_NAME = $0000001A; + {$EXTERNALSYM DBLITERAL_PROPERTY_NAME} + DBLITERAL_SCHEMA_SEPARATOR = $0000001B; + {$EXTERNALSYM DBLITERAL_SCHEMA_SEPARATOR} + DBLITERAL_QUOTE_SUFFIX = $0000001C; + {$EXTERNALSYM DBLITERAL_QUOTE_SUFFIX} + +// ACCESS_MASKENUM constants +type + ACCESS_MASKENUM = TOleEnum; + {$EXTERNALSYM ACCESS_MASKENUM} +const + PERM_EXCLUSIVE = $00000200; + {$EXTERNALSYM PERM_EXCLUSIVE} + PERM_READDESIGN = $00000400; + {$EXTERNALSYM PERM_READDESIGN} + PERM_WRITEDESIGN = $00000800; + {$EXTERNALSYM PERM_WRITEDESIGN} + PERM_WITHGRANT = $00001000; + {$EXTERNALSYM PERM_WITHGRANT} + PERM_REFERENCE = $00002000; + {$EXTERNALSYM PERM_REFERENCE} + PERM_CREATE = $00004000; + {$EXTERNALSYM PERM_CREATE} + PERM_INSERT = $00008000; + {$EXTERNALSYM PERM_INSERT} + PERM_DELETE = $00010000; + {$EXTERNALSYM PERM_DELETE} + PERM_READCONTROL = $00020000; + {$EXTERNALSYM PERM_READCONTROL} + PERM_WRITEPERMISSIONS = $00040000; + {$EXTERNALSYM PERM_WRITEPERMISSIONS} + PERM_WRITEOWNER = $00080000; + {$EXTERNALSYM PERM_WRITEOWNER} + PERM_MAXIMUM_ALLOWED = $02000000; + {$EXTERNALSYM PERM_MAXIMUM_ALLOWED} + PERM_ALL = $10000000; + {$EXTERNALSYM PERM_ALL} + PERM_EXECUTE = $20000000; + {$EXTERNALSYM PERM_EXECUTE} + PERM_READ = $80000000; + {$EXTERNALSYM PERM_READ} + PERM_UPDATE = $40000000; + {$EXTERNALSYM PERM_UPDATE} + PERM_DROP = $00000100; + {$EXTERNALSYM PERM_DROP} + +//MULTIPLE_TRUSTEE_OPERATION constants +type + MULTIPLE_TRUSTEE_OPERATION = TOleEnum; + {$EXTERNALSYM MULTIPLE_TRUSTEE_OPERATION} +const + NO_MULTIPLE_TRUSTEE = $00000000; + {$EXTERNALSYM NO_MULTIPLE_TRUSTEE} + TRUSTEE_IS_IMPERSONATE = $00000001; + {$EXTERNALSYM TRUSTEE_IS_IMPERSONATE} + +// TRUSTEE_FORM constants +type + TRUSTEE_FORM = TOleEnum; + {$EXTERNALSYM TRUSTEE_FORM} +const + TRUSTEE_IS_SID = $00000000; + {$EXTERNALSYM TRUSTEE_IS_SID} + TRUSTEE_IS_NAME = $00000001; + {$EXTERNALSYM TRUSTEE_IS_NAME} + TRUSTEE_BAD_FORM = $00000002; + {$EXTERNALSYM TRUSTEE_BAD_FORM} + +// TRUSTEE_TYPE constants +type + TRUSTEE_TYPE = TOleEnum; + {$EXTERNALSYM TRUSTEE_TYPE} +const + TRUSTEE_IS_UNKNOWN = $00000000; + {$EXTERNALSYM TRUSTEE_IS_UNKNOWN} + TRUSTEE_IS_USER = $00000001; + {$EXTERNALSYM TRUSTEE_IS_USER} + TRUSTEE_IS_GROUP = $00000002; + {$EXTERNALSYM TRUSTEE_IS_GROUP} + TRUSTEE_IS_DOMAIN = $00000003; + {$EXTERNALSYM TRUSTEE_IS_DOMAIN} + TRUSTEE_IS_ALIAS = $00000004; + {$EXTERNALSYM TRUSTEE_IS_ALIAS} + TRUSTEE_IS_WELL_KNOWN_GROUP = $00000005; + {$EXTERNALSYM TRUSTEE_IS_WELL_KNOWN_GROUP} + TRUSTEE_IS_DELETED = $00000006; + {$EXTERNALSYM TRUSTEE_IS_DELETED} + TRUSTEE_IS_INVALID = $00000007; + {$EXTERNALSYM TRUSTEE_IS_INVALID} + +// ACCESS_MODE constants +type + ACCESS_MODE = TOleEnum; + {$EXTERNALSYM ACCESS_MODE} +const + NOT_USED_ACCESS = $00000000; + {$EXTERNALSYM NOT_USED_ACCESS} + GRANT_ACCESS = $00000001; + {$EXTERNALSYM GRANT_ACCESS} + SET_ACCESS = $00000002; + {$EXTERNALSYM SET_ACCESS} + DENY_ACCESS = $00000003; + {$EXTERNALSYM DENY_ACCESS} + REVOKE_ACCESS = $00000004; + {$EXTERNALSYM REVOKE_ACCESS} + SET_AUDIT_SUCCESS = $00000005; + {$EXTERNALSYM SET_AUDIT_SUCCESS} + SET_AUDIT_FAILURE = $00000006; + {$EXTERNALSYM SET_AUDIT_FAILURE} + +// DBPROPTOPTIONS constants +type + DBPROMPTOPTIONS = TOleEnum; + {$EXTERNALSYM DBPROMPTOPTIONS} +const + DBPROMPTOPTIONS_NONE = 0; + {$EXTERNALSYM DBPROMPTOPTIONS_NONE} + DBPROMPTOPTIONS_WIZARDSHEET = $1; + {$EXTERNALSYM DBPROMPTOPTIONS_WIZARDSHEET} + DBPROMPTOPTIONS_PROPERTYSHEET = $2; + {$EXTERNALSYM DBPROMPTOPTIONS_PROPERTYSHEET} + DBPROMPTOPTIONS_BROWSEONLY = $8; + {$EXTERNALSYM DBPROMPTOPTIONS_BROWSEONLY} + DBPROMPTOPTIONS_DISABLE_PROVIDER_SELECTION = $10; + {$EXTERNALSYM DBPROMPTOPTIONS_DISABLE_PROVIDER_SELECTION} + +type + +// *********************************************************************// +// Declaration of structures, unions and aliases. // +// *********************************************************************// + + DBSTATUS = DWORD; + {$EXTERNALSYM DBSTATUS} + DBTYPE = Word; + {$EXTERNALSYM DBTYPE} + DBKIND = UINT; + {$EXTERNALSYM DBKIND} + DBPARAMIO = UINT; + {$EXTERNALSYM DBPARAMIO} + DBMEMOWNER = UINT; + {$EXTERNALSYM DBMEMOWNER} + DBPART = UINT; + {$EXTERNALSYM DBPART} + DBPROPSTATUS = UINT; + {$EXTERNALSYM DBPROPSTATUS} + DBPROPOPTIONS = UINT; + {$EXTERNALSYM DBPROPOPTIONS} + DBPROPFLAGS = UINT; + {$EXTERNALSYM DBPROPFLAGS} + DBBINDSTATUS = UINT; + {$EXTERNALSYM DBBINDSTATUS} + HWATCHREGION = UINT; + {$EXTERNALSYM HWATCHREGION} + DBINDEX_COL_ORDER = UINT; + {$EXTERNALSYM DBINDEX_COL_ORDER} + DBCOLUMNFLAGS = UINT; + {$EXTERNALSYM DBCOLUMNFLAGS} + DBCOMMANDOP = Word; + {$EXTERNALSYM DBCOMMANDOP} + DBASYNCHOP = UINT; + {$EXTERNALSYM DBASYNCHOP} + DBREASON = UINT; + {$EXTERNALSYM DBREASON} + DBEVENTPHASE = UINT; + {$EXTERNALSYM DBEVENTPHASE} + DBCOLUMNDESCFLAGS = UINT; + {$EXTERNALSYM DBCOLUMNDESCFLAGS} + DBPARAMFLAGS = UINT; + {$EXTERNALSYM DBPARAMFLAGS} + + HACCESSOR = UINT; + PHACCESSOR = ^HACCESSOR; + {$EXTERNALSYM HACCESSOR} + + HCHAPTER = UINT; + PHCHAPTER = HCHAPTER; + {$EXTERNALSYM HCHAPTER} + + HROW = UINT; + PHROW = ^HROW; + PPHROW = ^PHROW; + {$EXTERNALSYM HROW} + + DBROWSTATUS = UINT; + PDBROWSTATUS = IntPtr; // ^DBROWSTATUS; + PPDBROWSTATUS = IntPtr; // ^PDBROWSTATUS; + {$EXTERNALSYM DBROWSTATUS} + + DBPENDINGSTATUS = DWORD; + PDBPENDINGSTATUS = ^DBPENDINGSTATUS; + PPDBPENDINGSTATUS = ^PDBPENDINGSTATUS; + {$EXTERNALSYM DBPENDINGSTATUS} + + DBROWOPTIONS = UINT; + PDBROWOPTIONS = ^DBROWOPTIONS; + {$EXTERNALSYM DBROWOPTIONS} + + DBSOURCETYPE = DWORD; + PDBSOURCETYPE = ^DBSOURCETYPE; + {$EXTERNALSYM DBSOURCETYPE} + +// *********************************************************************// +// Error Constants from OLEDBERR.H +// *********************************************************************// + +// +// Values are 32 bit values layed out as follows: +// +// 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 +// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 +// +-+-+-+-+-+---------------------+-------------------------------+ +// |S|R|C|N|r| Facility | Code | +// +-+-+-+-+-+---------------------+-------------------------------+ +// +// where +// +// S - Severity - indicates success/fail +// +// 0 - Success +// 1 - Fail (COERROR) +// +// R - reserved portion of the facility code, corresponds to NT's +// second severity bit. +// +// C - reserved portion of the facility code, corresponds to NT's +// C field. +// +// N - reserved portion of the facility code. Used to indicate a +// mapped NT status value. +// +// r - reserved portion of the facility code. Reserved for internal +// use. Used to indicate HRESULT values that are not status +// values, but are instead message ids for display strings. +// +// Facility - is the facility code +// +// Code - is the facility's status code +// +// +// Define the facility codes +// +const + FACILITY_WINDOWS = $8; + {$EXTERNALSYM FACILITY_WINDOWS} + FACILITY_ITF = $4; + {$EXTERNALSYM FACILITY_ITF} + + +// +// Define the severity codes +// + STATUS_SEVERITY_SUCCESS = $0; + {$EXTERNALSYM STATUS_SEVERITY_SUCCESS} + STATUS_SEVERITY_COERROR = $2; + {$EXTERNALSYM STATUS_SEVERITY_COERROR} + + +// +// MessageId: DB_E_BOGUS +// +// MessageText: +// +// Dummy error - need this error so that mc puts the above defines +// inside the FACILITY_WINDOWS guard, instead of leaving it empty +// + DB_E_BOGUS = HResult($80040EFF); + {$EXTERNALSYM DB_E_BOGUS} + + +// +// Codes 0x0e00-0x0eff are reserved for the OLE DB group of +// interfaces. +// +// Free codes are: +// +// Error: +// -none- +// +// Success: +// 0x0eea +// 0x0ed7 +// + + +// +// MessageId: DB_E_BADACCESSORHANDLE +// +// MessageText: +// +// Invalid accessor +// + DB_E_BADACCESSORHANDLE = HResult($80040E00); + {$EXTERNALSYM DB_E_BADACCESSORHANDLE} + +// +// MessageId: DB_E_ROWLIMITEXCEEDED +// +// MessageText: +// +// Creating another row would have exceeded the total number of active +// rows supported by the rowset +// + DB_E_ROWLIMITEXCEEDED = HResult($80040E01); + {$EXTERNALSYM DB_E_ROWLIMITEXCEEDED} + +// +// MessageId: DB_E_READONLYACCESSOR +// +// MessageText: +// +// Unable to write with a read-only accessor +// + DB_E_READONLYACCESSOR = HResult($80040E02); + {$EXTERNALSYM DB_E_READONLYACCESSOR} + +// +// MessageId: DB_E_SCHEMAVIOLATION +// +// MessageText: +// +// Given values violate the database schema +// + DB_E_SCHEMAVIOLATION = HResult($80040E03); + {$EXTERNALSYM DB_E_SCHEMAVIOLATION} + +// +// MessageId: DB_E_BADROWHANDLE +// +// MessageText: +// +// Invalid row handle +// + DB_E_BADROWHANDLE = HResult($80040E04); + {$EXTERNALSYM DB_E_BADROWHANDLE} + +// +// MessageId: DB_E_OBJECTOPEN +// +// MessageText: +// +// An object was open +// + DB_E_OBJECTOPEN = HResult($80040E05); + {$EXTERNALSYM DB_E_OBJECTOPEN} + +// @@@+ V1.5 +// +// MessageId: DB_E_BADCHAPTER +// +// MessageText: +// +// Invalid chapter +// + DB_E_BADCHAPTER = HResult($80040E06); + {$EXTERNALSYM DB_E_BADCHAPTER} + +// @@@- V1.5 + +// +// MessageId: DB_E_CANTCONVERTVALUE +// +// MessageText: +// +// A literal value in the command could not be converted to the +// correct type due to a reason other than data overflow +// + DB_E_CANTCONVERTVALUE = HResult($80040E07); + {$EXTERNALSYM DB_E_CANTCONVERTVALUE} + +// +// MessageId: DB_E_BADBINDINFO +// +// MessageText: +// +// Invalid binding info +// + DB_E_BADBINDINFO = HResult($80040E08); + {$EXTERNALSYM DB_E_BADBINDINFO} + +// +// MessageId: DB_SEC_E_PERMISSIONDENIED +// +// MessageText: +// +// Permission denied +// + DB_SEC_E_PERMISSIONDENIED = HResult($80040E09); + {$EXTERNALSYM DB_SEC_E_PERMISSIONDENIED} + +// +// MessageId: DB_E_NOTAREFERENCECOLUMN +// +// MessageText: +// +// Specified column does not contain bookmarks or chapters +// + DB_E_NOTAREFERENCECOLUMN = HResult($80040E0A); + {$EXTERNALSYM DB_E_NOTAREFERENCECOLUMN} + +// @@@+ V2.5 +// +// MessageId: DB_E_LIMITREJECTED +// +// MessageText: +// +// Some cost limits were rejected +// + DB_E_LIMITREJECTED = HResult($80040E0B); + {$EXTERNALSYM DB_E_LIMITREJECTED} + +// @@@- V2.5 + +// +// MessageId: DB_E_NOCOMMAND +// +// MessageText: +// +// No command has been set for the command object +// + DB_E_NOCOMMAND = HResult($80040E0C); + {$EXTERNALSYM DB_E_NOCOMMAND} + +// @@@+ V2.5 +// +// MessageId: DB_E_COSTLIMIT +// +// MessageText: +// +// Unable to find a query plan within the given cost limit +// + DB_E_COSTLIMIT = HResult($80040E0D); + {$EXTERNALSYM DB_E_COSTLIMIT} + +// @@@- V2.5 + +// +// MessageId: DB_E_BADBOOKMARK +// +// MessageText: +// +// Invalid bookmark +// + DB_E_BADBOOKMARK = HResult($80040E0E); + {$EXTERNALSYM DB_E_BADBOOKMARK} + +// +// MessageId: DB_E_BADLOCKMODE +// +// MessageText: +// +// Invalid lock mode +// + DB_E_BADLOCKMODE = HResult($80040E0F); + {$EXTERNALSYM DB_E_BADLOCKMODE} + +// +// MessageId: DB_E_PARAMNOTOPTIONAL +// +// MessageText: +// +// No value given for one or more required parameters +// + DB_E_PARAMNOTOPTIONAL = HResult($80040E10); + {$EXTERNALSYM DB_E_PARAMNOTOPTIONAL} + +// +// MessageId: DB_E_BADCOLUMNID +// +// MessageText: +// +// Invalid column ID +// + DB_E_BADCOLUMNID = HResult($80040E11); + {$EXTERNALSYM DB_E_BADCOLUMNID} + +// +// MessageId: DB_E_BADRATIO +// +// MessageText: +// +// Invalid ratio +// + DB_E_BADRATIO = HResult($80040E12); + {$EXTERNALSYM DB_E_BADRATIO} + +// @@@+ V2.0 +// +// MessageId: DB_E_BADVALUES +// +// MessageText: +// +// Invalid value +// + DB_E_BADVALUES = HResult($80040E13); + {$EXTERNALSYM DB_E_BADVALUES} + +// @@@- V2.0 + +// +// MessageId: DB_E_ERRORSINCOMMAND +// +// MessageText: +// +// The command contained one or more errors +// + DB_E_ERRORSINCOMMAND = HResult($80040E14); + {$EXTERNALSYM DB_E_ERRORSINCOMMAND} + +// +// MessageId: DB_E_CANTCANCEL +// +// MessageText: +// +// The executing command cannot be canceled +// + DB_E_CANTCANCEL = HResult($80040E15); + {$EXTERNALSYM DB_E_CANTCANCEL} + +// +// MessageId: DB_E_DIALECTNOTSUPPORTED +// +// MessageText: +// +// The provider does not support the specified dialect +// + DB_E_DIALECTNOTSUPPORTED = HResult($80040E16); + {$EXTERNALSYM DB_E_DIALECTNOTSUPPORTED} + +// +// MessageId: DB_E_DUPLICATEDATASOURCE +// +// MessageText: +// +// A data source with the specified name already exists +// + DB_E_DUPLICATEDATASOURCE = HResult($80040E17); + {$EXTERNALSYM DB_E_DUPLICATEDATASOURCE} + +// +// MessageId: DB_E_CANNOTRESTART +// +// MessageText: +// +// The rowset was built over a live data feed and cannot be restarted +// + DB_E_CANNOTRESTART = HResult($80040E18); + {$EXTERNALSYM DB_E_CANNOTRESTART} + +// +// MessageId: DB_E_NOTFOUND +// +// MessageText: +// +// No key matching the described characteristics could be found within +// the current range +// + DB_E_NOTFOUND = HResult($80040E19); + {$EXTERNALSYM DB_E_NOTFOUND} + +// +// MessageId: DB_E_NEWLYINSERTED +// +// MessageText: +// +// The provider is unable to determine identity for newly inserted +// rows +// + DB_E_NEWLYINSERTED = HResult($80040E1B); + {$EXTERNALSYM DB_E_NEWLYINSERTED} + +// @@@+ V2.5 +// +// MessageId: DB_E_CANNOTFREE +// +// MessageText: +// +// Ownership of this tree has been given to the provider +// + DB_E_CANNOTFREE = HResult($80040E1A); + {$EXTERNALSYM DB_E_CANNOTFREE} + +// +// MessageId: DB_E_GOALREJECTED +// +// MessageText: +// +// No nonzero weights specified for any goals supported, so goal was +// rejected; current goal was not changed +// + DB_E_GOALREJECTED = HResult($80040E1C); + {$EXTERNALSYM DB_E_GOALREJECTED} + +// @@@- V2.5 + +// +// MessageId: DB_E_UNSUPPORTEDCONVERSION +// +// MessageText: +// +// Requested conversion is not supported +// + DB_E_UNSUPPORTEDCONVERSION = HResult($80040E1D); + {$EXTERNALSYM DB_E_UNSUPPORTEDCONVERSION} + +// +// MessageId: DB_E_BADSTARTPOSITION +// +// MessageText: +// +// lRowsOffset would position you past either end of the rowset, +// regardless of the cRows value specified; cRowsObtained is 0 +// + DB_E_BADSTARTPOSITION = HResult($80040E1E); + {$EXTERNALSYM DB_E_BADSTARTPOSITION} + +// @@@+ V2.0 +// +// MessageId: DB_E_NOQUERY +// +// MessageText: +// +// Information was requested for a query, and the query was not set +// + DB_E_NOQUERY = HResult($80040E1F); + {$EXTERNALSYM DB_E_NOQUERY} + +// @@@- V2.0 + +// +// MessageId: DB_E_NOTREENTRANT +// +// MessageText: +// +// Provider called a method from IRowsetNotify in the consumer and the +// method has not yet returned +// + DB_E_NOTREENTRANT = HResult($80040E20); + {$EXTERNALSYM DB_E_NOTREENTRANT} + +// +// MessageId: DB_E_ERRORSOCCURRED +// +// MessageText: +// +// Errors occurred +// + DB_E_ERRORSOCCURRED = HResult($80040E21); + {$EXTERNALSYM DB_E_ERRORSOCCURRED} + +// +// MessageId: DB_E_NOAGGREGATION +// +// MessageText: +// +// A non-NULL controlling IUnknown was specified and the object being +// created does not support aggregation +// + DB_E_NOAGGREGATION = HResult($80040E22); + {$EXTERNALSYM DB_E_NOAGGREGATION} + +// +// MessageId: DB_E_DELETEDROW +// +// MessageText: +// +// A given HROW referred to a hard- or soft-deleted row +// + DB_E_DELETEDROW = HResult($80040E23); + {$EXTERNALSYM DB_E_DELETEDROW} + +// +// MessageId: DB_E_CANTFETCHBACKWARDS +// +// MessageText: +// +// The rowset does not support fetching backwards +// + DB_E_CANTFETCHBACKWARDS = HResult($80040E24); + {$EXTERNALSYM DB_E_CANTFETCHBACKWARDS} + +// +// MessageId: DB_E_ROWSNOTRELEASED +// +// MessageText: +// +// All HROWs must be released before new ones can be obtained +// + DB_E_ROWSNOTRELEASED = HResult($80040E25); + {$EXTERNALSYM DB_E_ROWSNOTRELEASED} + +// +// MessageId: DB_E_BADSTORAGEFLAG +// +// MessageText: +// +// One of the specified storage flags was not supported +// + DB_E_BADSTORAGEFLAG = HResult($80040E26); + {$EXTERNALSYM DB_E_BADSTORAGEFLAG} + +// @@@+ V1.5 +// +// MessageId: DB_E_BADCOMPAREOP +// +// MessageText: +// +// The comparison operator was invalid +// + DB_E_BADCOMPAREOP = HResult($80040E27); + {$EXTERNALSYM DB_E_BADCOMPAREOP} + +// @@@- V1.5 + +// +// MessageId: DB_E_BADSTATUSVALUE +// +// MessageText: +// +// The specified status flag was neither DBCOLUMNSTATUS_OK nor +// DBCOLUMNSTATUS_ISNULL +// + DB_E_BADSTATUSVALUE = HResult($80040E28); + {$EXTERNALSYM DB_E_BADSTATUSVALUE} + +// +// MessageId: DB_E_CANTSCROLLBACKWARDS +// +// MessageText: +// +// The rowset cannot scroll backwards +// + DB_E_CANTSCROLLBACKWARDS = HResult($80040E29); + {$EXTERNALSYM DB_E_CANTSCROLLBACKWARDS} + +// @@@+ V2.5 +// +// MessageId: DB_E_BADREGIONHANDLE +// +// MessageText: +// +// Invalid region handle +// + DB_E_BADREGIONHANDLE = HResult($80040E2A); + {$EXTERNALSYM DB_E_BADREGIONHANDLE} + +// +// MessageId: DB_E_NONCONTIGUOUSRANGE +// +// MessageText: +// +// The specified set of rows was not contiguous to or overlapping the +// rows in the specified watch region +// + DB_E_NONCONTIGUOUSRANGE = HResult($80040E2B); + {$EXTERNALSYM DB_E_NONCONTIGUOUSRANGE} + +// +// MessageId: DB_E_INVALIDTRANSITION +// +// MessageText: +// +// A transition from ALL* to MOVE* or EXTEND* was specified +// + DB_E_INVALIDTRANSITION = HResult($80040E2C); + {$EXTERNALSYM DB_E_INVALIDTRANSITION} + +// +// MessageId: DB_E_NOTASUBREGION +// +// MessageText: +// +// The specified region is not a proper subregion of the region +// identified by the given watch region handle +// + DB_E_NOTASUBREGION = HResult($80040E2D); + {$EXTERNALSYM DB_E_NOTASUBREGION} + +// @@@- V2.5 + +// +// MessageId: DB_E_MULTIPLESTATEMENTS +// +// MessageText: +// +// The provider does not support multi-statement commands +// + DB_E_MULTIPLESTATEMENTS = HResult($80040E2E); + {$EXTERNALSYM DB_E_MULTIPLESTATEMENTS} + +// +// MessageId: DB_E_INTEGRITYVIOLATION +// +// MessageText: +// +// A specified value violated the integrity constraints for a column or +// table +// + DB_E_INTEGRITYVIOLATION = HResult($80040E2F); + {$EXTERNALSYM DB_E_INTEGRITYVIOLATION} + +// +// MessageId: DB_E_BADTYPENAME +// +// MessageText: +// +// The given type name was unrecognized +// + DB_E_BADTYPENAME = HResult($80040E30); + {$EXTERNALSYM DB_E_BADTYPENAME} + +// +// MessageId: DB_E_ABORTLIMITREACHED +// +// MessageText: +// +// Execution aborted because a resource limit has been reached; no +// results have been returned +// + DB_E_ABORTLIMITREACHED = HResult($80040E31); + {$EXTERNALSYM DB_E_ABORTLIMITREACHED} + +// @@@+ V2.0 +// +// MessageId: DB_E_ROWSETINCOMMAND +// +// MessageText: +// +// Cannot clone a command object whose command tree contains a rowset +// or rowsets +// + DB_E_ROWSETINCOMMAND = HResult($80040E32); + {$EXTERNALSYM DB_E_ROWSETINCOMMAND} + +// +// MessageId: DB_E_CANTTRANSLATE +// +// MessageText: +// +// Cannot represent the current tree as text +// + DB_E_CANTTRANSLATE = HResult($80040E33); + {$EXTERNALSYM DB_E_CANTTRANSLATE} + +// @@@- V2.0 + +// +// MessageId: DB_E_DUPLICATEINDEXID +// +// MessageText: +// +// The specified index already exists +// + DB_E_DUPLICATEINDEXID = HResult($80040E34); + {$EXTERNALSYM DB_E_DUPLICATEINDEXID} + +// +// MessageId: DB_E_NOINDEX +// +// MessageText: +// +// The specified index does not exist +// + DB_E_NOINDEX = HResult($80040E35); + {$EXTERNALSYM DB_E_NOINDEX} + +// +// MessageId: DB_E_INDEXINUSE +// +// MessageText: +// +// The specified index was in use +// + DB_E_INDEXINUSE = HResult($80040E36); + {$EXTERNALSYM DB_E_INDEXINUSE} + +// +// MessageId: DB_E_NOTABLE +// +// MessageText: +// +// The specified table does not exist +// + DB_E_NOTABLE = HResult($80040E37); + {$EXTERNALSYM DB_E_NOTABLE} + +// +// MessageId: DB_E_CONCURRENCYVIOLATION +// +// MessageText: +// +// The rowset was using optimistic concurrency and the value of a +// column has been changed since it was last read +// + DB_E_CONCURRENCYVIOLATION = HResult($80040E38); + {$EXTERNALSYM DB_E_CONCURRENCYVIOLATION} + +// +// MessageId: DB_E_BADCOPY +// +// MessageText: +// +// Errors were detected during the copy +// + DB_E_BADCOPY = HResult($80040E39); + {$EXTERNALSYM DB_E_BADCOPY} + +// +// MessageId: DB_E_BADPRECISION +// +// MessageText: +// +// A specified precision was invalid +// + DB_E_BADPRECISION = HResult($80040E3A); + {$EXTERNALSYM DB_E_BADPRECISION} + +// +// MessageId: DB_E_BADSCALE +// +// MessageText: +// +// A specified scale was invalid +// + DB_E_BADSCALE = HResult($80040E3B); + {$EXTERNALSYM DB_E_BADSCALE} + +// +// MessageId: DB_E_BADTABLEID +// +// MessageText: +// +// Invalid table ID +// + DB_E_BADTABLEID = HResult($80040E3C); + {$EXTERNALSYM DB_E_BADTABLEID} + +// DB_E_BADID is deprecated; use DB_E_BADTABLEID instead + DB_E_BADID = DB_E_BADTABLEID; + {$EXTERNALSYM DB_E_BADID} + +// +// MessageId: DB_E_BADTYPE +// +// MessageText: +// +// A specified type was invalid +// + DB_E_BADTYPE = HResult($80040E3D); + {$EXTERNALSYM DB_E_BADTYPE} + +// +// MessageId: DB_E_DUPLICATECOLUMNID +// +// MessageText: +// +// A column ID was occurred more than once in the specification +// + DB_E_DUPLICATECOLUMNID = HResult($80040E3E); + {$EXTERNALSYM DB_E_DUPLICATECOLUMNID} + +// +// MessageId: DB_E_DUPLICATETABLEID +// +// MessageText: +// +// The specified table already exists +// + DB_E_DUPLICATETABLEID = HResult($80040E3F); + {$EXTERNALSYM DB_E_DUPLICATETABLEID} + +// +// MessageId: DB_E_TABLEINUSE +// +// MessageText: +// +// The specified table was in use +// + DB_E_TABLEINUSE = HResult($80040E40); + {$EXTERNALSYM DB_E_TABLEINUSE} + +// +// MessageId: DB_E_NOLOCALE +// +// MessageText: +// +// The specified locale ID was not supported +// + DB_E_NOLOCALE = HResult($80040E41); + {$EXTERNALSYM DB_E_NOLOCALE} + +// +// MessageId: DB_E_BADRECORDNUM +// +// MessageText: +// +// The specified record number is invalid +// + DB_E_BADRECORDNUM = HResult($80040E42); + {$EXTERNALSYM DB_E_BADRECORDNUM} + +// +// MessageId: DB_E_BOOKMARKSKIPPED +// +// MessageText: +// +// Although the bookmark was validly formed, no row could be found to +// match it +// + DB_E_BOOKMARKSKIPPED = HResult($80040E43); + {$EXTERNALSYM DB_E_BOOKMARKSKIPPED} + +// +// MessageId: DB_E_BADPROPERTYVALUE +// +// MessageText: +// +// The value of a property was invalid +// + DB_E_BADPROPERTYVALUE = HResult($80040E44); + {$EXTERNALSYM DB_E_BADPROPERTYVALUE} + +// +// MessageId: DB_E_INVALID +// +// MessageText: +// +// The rowset was not chaptered +// + DB_E_INVALID = HResult($80040E45); + {$EXTERNALSYM DB_E_INVALID} + +// +// MessageId: DB_E_BADACCESSORFLAGS +// +// MessageText: +// +// Invalid accessor +// + DB_E_BADACCESSORFLAGS = HResult($80040E46); + {$EXTERNALSYM DB_E_BADACCESSORFLAGS} + +// +// MessageId: DB_E_BADSTORAGEFLAGS +// +// MessageText: +// +// Invalid storage flags +// + DB_E_BADSTORAGEFLAGS = HResult($80040E47); + {$EXTERNALSYM DB_E_BADSTORAGEFLAGS} + +// +// MessageId: DB_E_BYREFACCESSORNOTSUPPORTED +// +// MessageText: +// +// By-ref accessors are not supported by this provider +// + DB_E_BYREFACCESSORNOTSUPPORTED = HResult($80040E48); + {$EXTERNALSYM DB_E_BYREFACCESSORNOTSUPPORTED} + +// +// MessageId: DB_E_NULLACCESSORNOTSUPPORTED +// +// MessageText: +// +// Null accessors are not supported by this provider +// + DB_E_NULLACCESSORNOTSUPPORTED = HResult($80040E49); + {$EXTERNALSYM DB_E_NULLACCESSORNOTSUPPORTED} + +// +// MessageId: DB_E_NOTPREPARED +// +// MessageText: +// +// The command was not prepared +// + DB_E_NOTPREPARED = HResult($80040E4A); + {$EXTERNALSYM DB_E_NOTPREPARED} + +// +// MessageId: DB_E_BADACCESSORTYPE +// +// MessageText: +// +// The specified accessor was not a parameter accessor +// + DB_E_BADACCESSORTYPE = HResult($80040E4B); + {$EXTERNALSYM DB_E_BADACCESSORTYPE} + +// +// MessageId: DB_E_WRITEONLYACCESSOR +// +// MessageText: +// +// The given accessor was write-only +// + DB_E_WRITEONLYACCESSOR = HResult($80040E4C); + {$EXTERNALSYM DB_E_WRITEONLYACCESSOR} + +// +// MessageId: DB_SEC_E_AUTH_FAILED +// +// MessageText: +// +// Authentication failed +// + DB_SEC_E_AUTH_FAILED = HResult($80040E4D); + {$EXTERNALSYM DB_SEC_E_AUTH_FAILED} + +// +// MessageId: DB_E_CANCELED +// +// MessageText: +// +// The change was canceled during notification; no columns are changed +// + DB_E_CANCELED = HResult($80040E4E); + {$EXTERNALSYM DB_E_CANCELED} + +// @@@+ V2.0 +// +// MessageId: DB_E_CHAPTERNOTRELEASED +// +// MessageText: +// +// The rowset was single-chaptered and the chapter was not released +// + DB_E_CHAPTERNOTRELEASED = HResult($80040E4F); + {$EXTERNALSYM DB_E_CHAPTERNOTRELEASED} + +// @@@- V2.0 + +// +// MessageId: DB_E_BADSOURCEHANDLE +// +// MessageText: +// +// Invalid source handle +// + DB_E_BADSOURCEHANDLE = HResult($80040E50); + {$EXTERNALSYM DB_E_BADSOURCEHANDLE} + +// +// MessageId: DB_E_PARAMUNAVAILABLE +// +// MessageText: +// +// The provider cannot derive parameter info and SetParameterInfo has +// not been called +// + DB_E_PARAMUNAVAILABLE = HResult($80040E51); + {$EXTERNALSYM DB_E_PARAMUNAVAILABLE} + +// +// MessageId: DB_E_ALREADYINITIALIZED +// +// MessageText: +// +// The data source object is already initialized +// + DB_E_ALREADYINITIALIZED = HResult($80040E52); + {$EXTERNALSYM DB_E_ALREADYINITIALIZED} + +// +// MessageId: DB_E_NOTSUPPORTED +// +// MessageText: +// +// The provider does not support this method +// + DB_E_NOTSUPPORTED = HResult($80040E53); + {$EXTERNALSYM DB_E_NOTSUPPORTED} + +// +// MessageId: DB_E_MAXPENDCHANGESEXCEEDED +// +// MessageText: +// +// The number of rows with pending changes has exceeded the set limit +// + DB_E_MAXPENDCHANGESEXCEEDED = HResult($80040E54); + {$EXTERNALSYM DB_E_MAXPENDCHANGESEXCEEDED} + +// +// MessageId: DB_E_BADORDINAL +// +// MessageText: +// +// The specified column did not exist +// + DB_E_BADORDINAL = HResult($80040E55); + {$EXTERNALSYM DB_E_BADORDINAL} + +// +// MessageId: DB_E_PENDINGCHANGES +// +// MessageText: +// +// There are pending changes on a row with a reference count of zero +// + DB_E_PENDINGCHANGES = HResult($80040E56); + {$EXTERNALSYM DB_E_PENDINGCHANGES} + +// +// MessageId: DB_E_DATAOVERFLOW +// +// MessageText: +// +// A literal value in the command overflowed the range of the type of +// the associated column +// + DB_E_DATAOVERFLOW = HResult($80040E57); + {$EXTERNALSYM DB_E_DATAOVERFLOW} + +// +// MessageId: DB_E_BADHRESULT +// +// MessageText: +// +// The supplied HRESULT was invalid +// + DB_E_BADHRESULT = HResult($80040E58); + {$EXTERNALSYM DB_E_BADHRESULT} + +// +// MessageId: DB_E_BADLOOKUPID +// +// MessageText: +// +// The supplied LookupID was invalid +// + DB_E_BADLOOKUPID = HResult($80040E59); + {$EXTERNALSYM DB_E_BADLOOKUPID} + +// +// MessageId: DB_E_BADDYNAMICERRORID +// +// MessageText: +// +// The supplied DynamicErrorID was invalid +// + DB_E_BADDYNAMICERRORID = HResult($80040E5A); + {$EXTERNALSYM DB_E_BADDYNAMICERRORID} + +// +// MessageId: DB_E_PENDINGINSERT +// +// MessageText: +// +// Unable to get visible data for a newly-inserted row that has not +// yet been updated +// + DB_E_PENDINGINSERT = HResult($80040E5B); + {$EXTERNALSYM DB_E_PENDINGINSERT} + +// +// MessageId: DB_E_BADCONVERTFLAG +// +// MessageText: +// +// Invalid conversion flag +// + DB_E_BADCONVERTFLAG = HResult($80040E5C); + {$EXTERNALSYM DB_E_BADCONVERTFLAG} + +// +// MessageId: DB_E_BADPARAMETERNAME +// +// MessageText: +// +// The given parameter name was unrecognized +// + DB_E_BADPARAMETERNAME = HResult($80040E5D); + {$EXTERNALSYM DB_E_BADPARAMETERNAME} + +// +// MessageId: DB_E_MULTIPLESTORAGE +// +// MessageText: +// +// Multiple storage objects can not be open simultaneously +// + DB_E_MULTIPLESTORAGE = HResult($80040E5E); + {$EXTERNALSYM DB_E_MULTIPLESTORAGE} + +// +// MessageId: DB_E_CANTFILTER +// +// MessageText: +// +// The requested filter could not be opened +// + DB_E_CANTFILTER = HResult($80040E5F); + {$EXTERNALSYM DB_E_CANTFILTER} + +// +// MessageId: DB_E_CANTORDER +// +// MessageText: +// +// The requested order could not be opened +// + DB_E_CANTORDER = HResult($80040E60); + {$EXTERNALSYM DB_E_CANTORDER} + +// @@@+ V2.0 +// +// MessageId: MD_E_BADTUPLE +// +// MessageText: +// +// Bad tuple +// + MD_E_BADTUPLE = HResult($80040E61); + {$EXTERNALSYM MD_E_BADTUPLE} + +// +// MessageId: MD_E_BADCOORDINATE +// +// MessageText: +// +// Bad coordinate +// + MD_E_BADCOORDINATE = HResult($80040E62); + {$EXTERNALSYM MD_E_BADCOORDINATE} + +// +// MessageId: MD_E_INVALIDAXIS +// +// MessageText: +// +// The given aixs was not valid for this Dataset +// + MD_E_INVALIDAXIS = HResult($80040E63); + {$EXTERNALSYM MD_E_INVALIDAXIS} + +// +// MessageId: MD_E_INVALIDCELLRANGE +// +// MessageText: +// +// One or more of the given cell ordinals was invalid +// + MD_E_INVALIDCELLRANGE = HResult($80040E64); + {$EXTERNALSYM MD_E_INVALIDCELLRANGE} + +// +// MessageId: DB_E_NOCOLUMN +// +// MessageText: +// +// The supplied columnID was invalid +// + DB_E_NOCOLUMN = HResult($80040E65); + {$EXTERNALSYM DB_E_NOCOLUMN} + +// +// MessageId: DB_E_COMMANDNOTPERSISTED +// +// MessageText: +// +// The supplied command does not have a DBID +// + DB_E_COMMANDNOTPERSISTED = HResult($80040E67); + {$EXTERNALSYM DB_E_COMMANDNOTPERSISTED} + +// +// MessageId: DB_E_DUPLICATEID +// +// MessageText: +// +// The supplied DBID already exists +// + DB_E_DUPLICATEID = HResult($80040E68); + {$EXTERNALSYM DB_E_DUPLICATEID} + +// +// MessageId: DB_E_OBJECTCREATIONLIMITREACHED +// +// MessageText: +// +// The maximum number of Sessions supported by the provider has +// already been created. The consumer must release one or more +// currently held Sessions before obtaining a new Session Object +// + DB_E_OBJECTCREATIONLIMITREACHED = HResult($80040E69); + {$EXTERNALSYM DB_E_OBJECTCREATIONLIMITREACHED} + +// +// MessageId: DB_E_BADINDEXID +// +// MessageText: +// +// The index ID is invalid +// + DB_E_BADINDEXID = HResult($80040E72); + {$EXTERNALSYM DB_E_BADINDEXID} + +// +// MessageId: DB_E_BADINITSTRING +// +// MessageText: +// +// The initialization string specified does not conform to specificiation +// + DB_E_BADINITSTRING = HResult($80040E73); + {$EXTERNALSYM DB_E_BADINITSTRING} + +// +// MessageId: DB_E_NOPROVIDERSREGISTERED +// +// MessageText: +// +// The OLE DB root enumerator did not return any providers that +// matched any of the SOURCES_TYPEs requested +// + DB_E_NOPROVIDERSREGISTERED = HResult($80040E74); + {$EXTERNALSYM DB_E_NOPROVIDERSREGISTERED} + +// +// MessageId: DB_E_MISMATCHEDPROVIDER +// +// MessageText: +// +// The initialization string specifies a provider which does not match the currently active provider +// + DB_E_MISMATCHEDPROVIDER = HResult($80040E75); + {$EXTERNALSYM DB_E_MISMATCHEDPROVIDER} + +// +// MessageId: SEC_E_BADTRUSTEEID +// +// MessageText: +// +// Invalid trustee value +// + SEC_E_BADTRUSTEEID = HResult($80040E6A); + {$EXTERNALSYM SEC_E_BADTRUSTEEID} + +// +// MessageId: SEC_E_NOTRUSTEEID +// +// MessageText: +// +// The trustee is not for the current data source +// + SEC_E_NOTRUSTEEID = HResult($80040E6B); + {$EXTERNALSYM SEC_E_NOTRUSTEEID} + +// +// MessageId: SEC_E_NOMEMBERSHIPSUPPORT +// +// MessageText: +// +// The trustee does not support memberships/collections +// + SEC_E_NOMEMBERSHIPSUPPORT = HResult($80040E6C); + {$EXTERNALSYM SEC_E_NOMEMBERSHIPSUPPORT} + +// +// MessageId: SEC_E_INVALIDOBJECT +// +// MessageText: +// +// The object is invalid or unknown to the provider +// + SEC_E_INVALIDOBJECT = HResult($80040E6D); + {$EXTERNALSYM SEC_E_INVALIDOBJECT} + +// +// MessageId: SEC_E_NOOWNER +// +// MessageText: +// +// No owner exists for the object +// + SEC_E_NOOWNER = HResult($80040E6E); + {$EXTERNALSYM SEC_E_NOOWNER} + +// +// MessageId: SEC_E_INVALIDACCESSENTRYLIST +// +// MessageText: +// +// The access entry list supplied is invalid +// + SEC_E_INVALIDACCESSENTRYLIST = HResult($80040E6F); + {$EXTERNALSYM SEC_E_INVALIDACCESSENTRYLIST} + +// +// MessageId: SEC_E_INVALIDOWNER +// +// MessageText: +// +// The trustee supplied as owner is invalid or unknown to the provider +// + SEC_E_INVALIDOWNER = HResult($80040E70); + {$EXTERNALSYM SEC_E_INVALIDOWNER} + +// +// MessageId: SEC_E_INVALIDACCESSENTRY +// +// MessageText: +// +// The permission supplied in the access entry list is invalid +// + SEC_E_INVALIDACCESSENTRY = HResult($80040E71); + {$EXTERNALSYM SEC_E_INVALIDACCESSENTRY} + + SEC_E_PERMISSIONDENIED = DB_SEC_E_PERMISSIONDENIED; + {$EXTERNALSYM SEC_E_PERMISSIONDENIED} +// @@@- V2.1 + +// +// MessageId: DB_S_ROWLIMITEXCEEDED +// +// MessageText: +// +// Fetching requested number of rows would have exceeded total number +// of active rows supported by the rowset +// + DB_S_ROWLIMITEXCEEDED = $00040EC0; + {$EXTERNALSYM DB_S_ROWLIMITEXCEEDED} + +// +// MessageId: DB_S_COLUMNTYPEMISMATCH +// +// MessageText: +// +// One or more column types are incompatible; conversion errors will +// occur during copying +// + DB_S_COLUMNTYPEMISMATCH = $00040EC1; + {$EXTERNALSYM DB_S_COLUMNTYPEMISMATCH} + +// +// MessageId: DB_S_TYPEINFOOVERRIDDEN +// +// MessageText: +// +// Parameter type information has been overridden by caller +// + DB_S_TYPEINFOOVERRIDDEN = $00040EC2; + {$EXTERNALSYM DB_S_TYPEINFOOVERRIDDEN} + +// +// MessageId: DB_S_BOOKMARKSKIPPED +// +// MessageText: +// +// Skipped bookmark for deleted or non-member row +// + DB_S_BOOKMARKSKIPPED = $00040EC3; + {$EXTERNALSYM DB_S_BOOKMARKSKIPPED} + +// @@@+ V2.0 +// +// MessageId: DB_S_NONEXTROWSET +// +// MessageText: +// +// There are no more rowsets +// + DB_S_NONEXTROWSET = $00040EC5; + {$EXTERNALSYM DB_S_NONEXTROWSET} + +// @@@- V2.0 + +// +// MessageId: DB_S_ENDOFROWSET +// +// MessageText: +// +// Reached start or end of rowset or chapter +// + DB_S_ENDOFROWSET = $00040EC6; + {$EXTERNALSYM DB_S_ENDOFROWSET} + +// +// MessageId: DB_S_COMMANDREEXECUTED +// +// MessageText: +// +// The provider re-executed the command +// + DB_S_COMMANDREEXECUTED = $00040EC7; + {$EXTERNALSYM DB_S_COMMANDREEXECUTED} + +// +// MessageId: DB_S_BUFFERFULL +// +// MessageText: +// +// Variable data buffer full +// + DB_S_BUFFERFULL = $00040EC8; + {$EXTERNALSYM DB_S_BUFFERFULL} + +// +// MessageId: DB_S_NORESULT +// +// MessageText: +// +// There are no more results +// + DB_S_NORESULT = $00040EC9; + {$EXTERNALSYM DB_S_NORESULT} + +// +// MessageId: DB_S_CANTRELEASE +// +// MessageText: +// +// Server cannot release or downgrade a lock until the end of the +// transaction +// + DB_S_CANTRELEASE = $00040ECA; + {$EXTERNALSYM DB_S_CANTRELEASE} + +// @@@+ V2.5 +// +// MessageId: DB_S_GOALCHANGED +// +// MessageText: +// +// Specified weight was not supported or exceeded the supported limit +// and was set to 0 or the supported limit +// + DB_S_GOALCHANGED = $00040ECB; + {$EXTERNALSYM DB_S_GOALCHANGED} + +// @@@- V2.5 + +// @@@+ V1.5 +// +// MessageId: DB_S_UNWANTEDOPERATION +// +// MessageText: +// +// Consumer is uninterested in receiving further notification calls for +// this reason +// + DB_S_UNWANTEDOPERATION = $00040ECC; + {$EXTERNALSYM DB_S_UNWANTEDOPERATION} + +// @@@- V1.5 + +// +// MessageId: DB_S_DIALECTIGNORED +// +// MessageText: +// +// Input dialect was ignored and text was returned in different +// dialect +// + DB_S_DIALECTIGNORED = $00040ECD; + {$EXTERNALSYM DB_S_DIALECTIGNORED} + +// +// MessageId: DB_S_UNWANTEDPHASE +// +// MessageText: +// +// Consumer is uninterested in receiving further notification calls for +// this phase +// + DB_S_UNWANTEDPHASE = $00040ECE; + {$EXTERNALSYM DB_S_UNWANTEDPHASE} + +// +// MessageId: DB_S_UNWANTEDREASON +// +// MessageText: +// +// Consumer is uninterested in receiving further notification calls for +// this reason +// + DB_S_UNWANTEDREASON = $00040ECF; + {$EXTERNALSYM DB_S_UNWANTEDREASON} + +// @@@+ V1.5 +// +// MessageId: DB_S_ASYNCHRONOUS +// +// MessageText: +// +// The operation is being processed asynchronously +// + DB_S_ASYNCHRONOUS = $00040ED0; + {$EXTERNALSYM DB_S_ASYNCHRONOUS} + +// @@@- V1.5 + +// +// MessageId: DB_S_COLUMNSCHANGED +// +// MessageText: +// +// In order to reposition to the start of the rowset, the provider had +// to reexecute the query; either the order of the columns changed or +// columns were added to or removed from the rowset +// + DB_S_COLUMNSCHANGED = $00040ED1; + {$EXTERNALSYM DB_S_COLUMNSCHANGED} + +// +// MessageId: DB_S_ERRORSRETURNED +// +// MessageText: +// +// The method had some errors; errors have been returned in the error +// array +// + DB_S_ERRORSRETURNED = $00040ED2; + {$EXTERNALSYM DB_S_ERRORSRETURNED} + +// +// MessageId: DB_S_BADROWHANDLE +// +// MessageText: +// +// Invalid row handle +// + DB_S_BADROWHANDLE = $00040ED3; + {$EXTERNALSYM DB_S_BADROWHANDLE} + +// +// MessageId: DB_S_DELETEDROW +// +// MessageText: +// +// A given HROW referred to a hard-deleted row +// + DB_S_DELETEDROW = $00040ED4; + {$EXTERNALSYM DB_S_DELETEDROW} + +// @@@+ V2.5 +// +// MessageId: DB_S_TOOMANYCHANGES +// +// MessageText: +// +// The provider was unable to keep track of all the changes; the client +// must refetch the data associated with the watch region using another +// method +// + DB_S_TOOMANYCHANGES = $00040ED5; + {$EXTERNALSYM DB_S_TOOMANYCHANGES} + +// @@@- V2.5 + +// +// MessageId: DB_S_STOPLIMITREACHED +// +// MessageText: +// +// Execution stopped because a resource limit has been reached; results +// obtained so far have been returned but execution cannot be resumed +// + DB_S_STOPLIMITREACHED = $00040ED6; + {$EXTERNALSYM DB_S_STOPLIMITREACHED} + +// +// MessageId: DB_S_LOCKUPGRADED +// +// MessageText: +// +// A lock was upgraded from the value specified +// + DB_S_LOCKUPGRADED = $00040ED8; + {$EXTERNALSYM DB_S_LOCKUPGRADED} + +// +// MessageId: DB_S_PROPERTIESCHANGED +// +// MessageText: +// +// One or more properties were changed as allowed by provider +// + DB_S_PROPERTIESCHANGED = $00040ED9; + {$EXTERNALSYM DB_S_PROPERTIESCHANGED} + +// +// MessageId: DB_S_ERRORSOCCURRED +// +// MessageText: +// +// Errors occurred +// + DB_S_ERRORSOCCURRED = $00040EDA; + {$EXTERNALSYM DB_S_ERRORSOCCURRED} + +// +// MessageId: DB_S_PARAMUNAVAILABLE +// +// MessageText: +// +// A specified parameter was invalid +// + DB_S_PARAMUNAVAILABLE = $00040EDB; + {$EXTERNALSYM DB_S_PARAMUNAVAILABLE} + +// +// MessageId: DB_S_MULTIPLECHANGES +// +// MessageText: +// +// Updating this row caused more than one row to be updated in the +// data source +// + DB_S_MULTIPLECHANGES = $00040EDC; + {$EXTERNALSYM DB_S_MULTIPLECHANGES} + +const + DBPROPSET_SQLSERVERDBINIT: TGUID = + '{5cf4ca10-ef21-11d0-97e7-00c04fc2ad98}'; + DBPROPSET_SQLSERVERROWSET: TGUID = + '{5cf4ca11-ef21-11d0-97e7-00c04fc2ad98}'; + DBPROPSET_SQLSERVERDATASOURCE: TGUID = + '{28efaee4-2d2c-11d1-9807-00c04fc2ad98}'; + + // PropIds for DBPROPSET_SQLSERVERDBINIT + SSPROP_INIT_CURRENTLANGUAGE = 4; + SSPROP_INIT_NETWORKADDRESS = 5; + SSPROP_INIT_NETWORKLIBRARY = 6; + SSPROP_INIT_USEPROCFORPREP = 7; + SSPROP_INIT_AUTOTRANSLATE = 8; + SSPROP_INIT_PACKETSIZE = 9; + SSPROP_INIT_APPNAME = 10; + SSPROP_INIT_WSID = 11; + SSPROP_INIT_FILENAME = 12; + + // PropIds for DBPROPSET_SQLSERVERDBINIT - MS SQL Server 2000 specific + SSPROP_INIT_ENCRYPT = 13; + // SSPROP_AUTH_REPL_SERVER_NAME = 14; + // SSPROP_INIT_TAGCOLUMNCOLLATION = 15; + + SSPROP_INIT_MARSCONNECTION = 16; // MS SQL Server 2005 specific + SSPROP_INIT_FAILOVERPARTNER = 18; // MS SQL Server 2005 specific + SSPROP_AUTH_OLD_PASSWORD = 19; // MS SQL Server 2005 specific + + // PropIds for DBPROPSET_SQLSERVERROWSET + SSPROP_ENABLEFASTLOAD = 2; + SSPROP_FASTLOADOPTIONS = 9; + SSPROP_FASTLOADKEEPNULLS = 10; + SSPROP_FASTLOADKEEPIDENTITY = 11; + SSPROP_DEFERPREPARE = 13; + SSPROP_QP_NOTIFICATION_TIMEOUT = 17; + SSPROP_QP_NOTIFICATION_MSGTEXT = 18; + SSPROP_QP_NOTIFICATION_OPTIONS = 19; + + // Values for SSPROP_QP_NOTIFICATION_TIMEOUT + SSPROPVAL_DEFAULT_NOTIFICATION_TIMEOUT = 432000; // in seconds + SSPROPVAL_MAX_NOTIFICATION_TIMEOUT = $7FFFFFFF; // in seconds + + DBPROP_IRowsetBookmark = $124; + + IID_IDBSchemaRowset: TGUID = + '{0c733a7b-2a1c-11ce-ade5-00aa0044773d}'; + + IID_NULL: TGUID = + '{00000000-0000-0000-0000-000000000000}'; + + DBSCHEMA_LINKEDSERVERS: TGUID = + '{9093caf4-2eac-11d1-9809-00c04fc2ad98}'; + DBSCHEMA_SQL_ASSEMBLIES: TGUID = + '{7c1112c8-c2d3-4f6e-949a-983d38a58f46}'; + DBSCHEMA_SQL_ASSEMBLY_DEPENDENCIES: TGUID = + '{cb0f837b-974c-41b8-909d-649caf45ad2f}'; + DBSCHEMA_SQL_USER_TYPES: TGUID = + '{f1198bd8-a424-4ea3-8d4c-607eee2bab60}'; + DBSCHEMA_XML_COLLECTIONS: TGUID = + '{56bfad8c-6e8f-480d-91de-3516d99a5d10}'; + + CRESTRICTIONS_DBSCHEMA_LINKEDSERVERS = 1; + {$EXTERNALSYM CRESTRICTIONS_DBSCHEMA_LINKEDSERVERS} + + CRESTRICTIONS_DBSCHEMA_SQL_ASSEMBLIES = 4; + {$EXTERNALSYM CRESTRICTIONS_DBSCHEMA_SQL_ASSEMBLIES} + + CRESTRICTIONS_DBSCHEMA_SQL_ASSEMBLY_DEPENDENCIES = 4; + {$EXTERNALSYM CRESTRICTIONS_DBSCHEMA_SQL_ASSEMBLY_DEPENDENCIES} + + CRESTRICTIONS_DBSCHEMA_SQL_USER_TYPES = 3; + {$EXTERNALSYM CRESTRICTIONS_DBSCHEMA_SQL_USER_TYPES} + + CRESTRICTIONS_DBSCHEMA_XML_COLLECTIONS = 4; + {$EXTERNALSYM CRESTRICTIONS_DBSCHEMA_XML_COLLECTIONS} + + IID_IRowsetBookmark: TGUID = + '{0c733ac2-2a1c-11ce-ade5-00aa0044773d}'; + + IID_IErrorRecords: TGUID = + '{0c733a67-2a1c-11ce-ade5-00aa0044773d}'; + {$EXTERNALSYM IID_IErrorRecords} + + IID_ISQLServerErrorInfo: TGUID = + '{5cf4ca12-ef21-11d0-97e7-00c04fc2ad98}'; + + CLSID_SQLOLEDB: TGUID = + '{0C7FF16C-38E3-11d0-97AB-00C04FC2AD98}'; {SQLOLEDB CLSID} + CLSID_SQLNCLI: TGUID = + '{85ECAFCC-BDD9-4B03-97A8-FA65CBE3859B}'; {SQLNCLI CLSID} + CLSID_SQLSERVERCE_3_0: TGUID = '{32CE2952-2585-49a6-AEFF-1732076C2945}'; + +(* CLSID_ORAOLEDB: TGUID = + '{E8CC4CBE-FDFF-11D0-B865-00A0C9081C1D}'; + CLSID_NULL: TGUID = + '{00000000-0000-0000-0000-000000000000}';*) + IID_IUnknown: TGUID = + '{00000000-0000-0000-c000-000000000046}'; +(* IID_IStream: TGUID = + '{0000000C-0000-0000-C000-000000000046}'; *) + IID_ISequentialStream: TGUID = + '{0c733a30-2a1c-11ce-ade5-00aa0044773d}'; + +const + // --------------------------------------------------------------------------- + // Copied from SQLFRONT.H + + // Netlib Error problem codes. ConnectionError() should return one of + // these as the dblib-mapped problem code, so the corresponding string + // is sent to the dblib app's error handler as dberrstr. Return NE_E_NOMAP + // for a generic DB-Library error string (as in prior versions of dblib). + + NE_E_NOMAP = 0; // No string; uses dblib default. + NE_E_NOMEMORY = 1; // Insufficient memory. + NE_E_NOACCESS = 2; // Access denied. + NE_E_CONNBUSY = 3; // Connection is busy. + NE_E_CONNBROKEN = 4; // Connection broken. + NE_E_TOOMANYCONN = 5; // Connection limit exceeded. + NE_E_SERVERNOTFOUND = 6; // Specified SQL server not found. + NE_E_NETNOTSTARTED = 7; // The network has not been started. + NE_E_NORESOURCE = 8; // Insufficient network resources. + NE_E_NETBUSY = 9; // Network is busy. + NE_E_NONETACCESS = 10; // Network access denied. + NE_E_GENERAL = 11; // General network error. Check your documentation. + NE_E_CONNMODE = 12; // Incorrect connection mode. + NE_E_NAMENOTFOUND = 13; // Name not found in directory service. + NE_E_INVALIDCONN = 14; // Invalid connection. + NE_E_NETDATAERR = 15; // Error reading or writing network data. + NE_E_TOOMANYFILES = 16; // Too many open file handles. + NE_E_CANTCONNECT = 17; // SQL Server does not exist or access denied. + + NE_MAX_NETERROR = 17; + // --------------------------------------------------------------------------- + + SizeOfDBProp = 52; + + DACProductName = 'SDAC'; + +implementation + + + +initialization + + +finalization + + +end. diff --git a/internal/4.10.0.10/1/Source/OLEDBIntf.pas b/internal/4.10.0.10/1/Source/OLEDBIntf.pas new file mode 100644 index 0000000..fc33c57 --- /dev/null +++ b/internal/4.10.0.10/1/Source/OLEDBIntf.pas @@ -0,0 +1,832 @@ + +unit OLEDBIntf; + +interface + +{$I Dac.inc} + +uses +{$IFDEF VER6P} + FMTBcd, +{$ELSE} + DB, +{$ENDIF} + OLEDBC, + CLRClasses, + ActiveX, + Windows; + +type + PIUnknown = ^IUnknown; + PUintArray = IntPtr; + TUintArray = array of UINT; + PPByte = ^PByte; + PPByteArray = IntPtr; + TPByteArray = array of PByte; + +type + PDBTimeStamp = ^TDBTimeStamp; + DBTIMESTAMP = packed record + year: Smallint; + month: Word; + day: Word; + hour: Word; + minute: Word; + second: Word; + fraction: UINT; + end; + TDBTimeStamp = DBTIMESTAMP; + {$EXTERNALSYM DBTIMESTAMP} + +type + PBoid = ^TBoid; + BOID = packed record + rgb_: array[0..15] of Byte; + end; + TBoid = BOID; + {$EXTERNALSYM BOID} + + XACTTRANSINFO = packed record + uow: BOID; + isoLevel: Integer; + isoFlags: UINT; + grfTCSupported: UINT; + grfRMSupported: UINT; + grfTCSupportedRetaining: UINT; + grfRMSupportedRetaining: UINT; + end; + TXactTransInfo = XACTTRANSINFO; + {$EXTERNALSYM XACTTRANSINFO} + + XACTOPT = packed record + ulTimeout: UINT; + szDescription: array[0..39] of Shortint; + end; + TXActOpt = XACTOPT; + {$EXTERNALSYM XACTOPT} + + XACTSTATS = packed record + cOpen: UINT; + cCommitting: UINT; + cCommitted: UINT; + cAborting: UINT; + cAborted: UINT; + cInDoubt: UINT; + cHeuristicDecision: UINT; + timeTransactionsUp: FILETIME; + end; + TXactStats = XACTSTATS; + {$EXTERNALSYM XACTSTATS} + + PDBBindExt = ^TDBBindExt; + DBBINDEXT = packed record + pExtension: IntPtr; // PByte; + ulExtension: UINT; + end; + TDBBindExt = DBBINDEXT; + {$EXTERNALSYM DBBINDEXT} + + DBOBJECT = packed record + dwFlags: UINT; + iid: TGUID; + end; + TDBObject = DBOBJECT; + {$EXTERNALSYM DBOBJECT} + + PDBBinding = ^TDBBinding; + DBBINDING = packed record + iOrdinal: UINT; + obValue: UINT; + obLength: UINT; + obStatus: UINT; + pTypeInfo: IntPtr; // IUnknown; + pObject: IntPtr; // PDBObject; + pBindExt: IntPtr; // PDBBindExt; + dwPart: DBPART; + dwMemOwner: DBMEMOWNER; + eParamIO: DBPARAMIO; + cbMaxLen: UINT; + dwFlags: UINT; + wType: DBTYPE; + bPrecision: Byte; + bScale: Byte; + end; + TDBBinding = DBBINDING; +{ $IFNDEF VER125} + { $EXTERNALSYM DBBINDING} +{ $ENDIF} + +// PDBBindingArray = ^TDBBindingArray; +// TDBBindingArray = array[0..MAXBOUND] of TDBBinding; + PDBBindingArray = IntPtr; + TDBBindingArray = array of TDBBinding; + + DBIDNAME = record + case Integer of + 0: (pwszName: PWideChar); + 1: (ulPropid: UINT); + end; + TDBIDName = DBIDNAME; + + DBIDGUID = record + case Integer of + 0: (guid: TGUID); + 1: (pguid: ^TGUID); + end; + TDBIDGuid = DBIDGUID; + + DBPROPID = UINT; + {$EXTERNALSYM DBPROPID} + PDBPROPID = ^DBPROPID; + PDBPropIDArray = ^TDBPropIDArray; + TDBPropIDArray = array[0..MAXBOUND] of DBPROPID; + + PPDBID = ^PDBID; + PDBID = ^DBID; + DBID = packed record + uGuid: DBIDGUID; + eKind: DBKIND; + uName: DBIDNAME; + end; + TDBID = DBID; + {$EXTERNALSYM DBID} + + PDBIDArray = ^TDBIDArray; + TDBIDArray = array[0..MAXBOUND] of TDBID; + + PDBPropIDSet = ^TDBPropIDSet; + DBPROPIDSET = packed record + rgPropertyIDs: IntPtr; // PDBPropIDArray; + cPropertyIDs: UINT; + guidPropertySet: TGUID; + end; + TDBPropIDSet = DBPROPIDSET; + {$EXTERNALSYM DBPROPIDSET} + + PDBPropIDSetArray = ^TDBPropIDSetArray; + TDBPropIDSetArray = array[0..MAXBOUND] of TDBPropIDSet; + + PDBProp = ^TDBProp; + DBPROP = packed record + dwPropertyID: DBPROPID; + dwOptions: DBPROPOPTIONS; + dwStatus: DBPROPSTATUS; + colid: DBID; + vValue: OleVariant; + end; + TDBProp = DBPROP; + {$EXTERNALSYM DBPROP} + + PDBPropArray = IntPtr; + TDBPropArray = array[0..MAXBOUND] of TDBProp; + + + PPDBPropSet = ^PDBPropSet; + PDBPropSet = ^TDBPropSet; + DBPROPSET = packed record + rgProperties: PDBPropArray; + cProperties: UINT; + guidPropertySet: TGUID; + end; + TDBPropSet = DBPROPSET; + {$EXTERNALSYM DBPROPSET} + + PDBPropSetArray = ^TDBPropSetArray; + TDBPropSetArray = array[0..MAXBOUND] of TDBPropSet; + + PDBPropInfo = ^TDBPropInfo; + DBPROPINFO = packed record + pwszDescription: PWideChar; + dwPropertyID: DBPROPID; + dwFlags: DBPROPFLAGS; + vtType: Word; + vValues: OleVariant; + end; + TDBPropInfo = DBPROPINFO; + {$EXTERNALSYM DBPROPINFO} + + PDBPropInfoArray = ^TDBPropInfoArray; + TDBPropInfoArray = array[0..MAXBOUND] of TDBPropInfo; + + PDBPropInfoSet = IntPtr; +(* + PDBPropInfoSet = ^TDBPropInfoSet; + DBPROPINFOSET = packed record + rgPropertyInfos: PDBPropInfoArray; + cPropertyInfos: UINT; + guidPropertySet: TGUID; + end; + TDBPropInfoSet = DBPROPINFOSET; + {$EXTERNALSYM DBPROPINFOSET} + *) + + PDBParams = ^TDBPARAMS; + DBPARAMS = packed record + pData: IntPtr; + cParamSets: UINT; + HACCESSOR: HACCESSOR; + end; + TDBParams = DBPARAMS; + {$EXTERNALSYM DBPARAMS} + + PDBColumnInfo = ^TDBColumnInfo; + DBCOLUMNINFO = packed record + pwszName: PWideChar; + pTypeInfo: IntPtr; + iOrdinal: UINT; + dwFlags: DBCOLUMNFLAGS; + ulColumnSize: UINT; + wType: DBTYPE; + bPrecision: Byte; + bScale: Byte; + columnid: DBID; + end; + TDBColumnInfo = DBCOLUMNINFO; + {$EXTERNALSYM DBCOLUMNINFO} + + PDBColumnInfoArray = ^TDBColumnInfoArray; + TDBColumnInfoArray = array[0..MAXCOLS] of TDBColumnInfo; + + PDBLiteralInfo = ^DBLiteralInfo; + DBLITERALINFO = packed record + pwszLiteralValue: PWideChar; + pwszInvalidChars: PWideChar; + pwszInvalidStartingChars: PWideChar; + lt: UINT; + fSupported: BOOL; + cchMaxLen: UINT; + end; + TDBLiteralInfo = DBLITERALINFO; + {$EXTERNALSYM DBLITERALINFO} + + PDBLiteralInfoArray = ^TDBLiteralInfoArray; + TDBLiteralInfoArray = array[0..MAXBOUND] of TDBLiteralInfo; + + PDBColumnDesc = ^TDBColumnDesc; + DBCOLUMNDESC = packed record + pwszTypeName: PWideChar; + pTypeInfo: IntPtr; + rgPropertySets: IntPtr; + pclsid: IntPtr; + cPropertySets: UINT; + ulColumnSize: UINT; + dbcid: DBID; + wType: DBTYPE; + bPrecision: Byte; + bScale: Byte; + end; + TDBColumnDesc = DBCOLUMNDESC; + {$EXTERNALSYM DBCOLUMNDESC} + + PErrorInfo = ^TErrorInfo; + ERRORINFO = packed record + hrError: HResult; + dwMinor: UINT; + clsid: TGUID; + iid: TGUID; + dispid: Integer; + end; + TErrorInfo = ERRORINFO; + {$EXTERNALSYM ERRORINFO} + + PDBParamInfo = IntPtr; +(* PDBParamInfo = ^TDBParamInfo; + DBPARAMINFO = packed record + dwFlags: DBPARAMFLAGS; + iOrdinal: UINT; + pwszName: PWideChar; + pTypeInfo: ITypeInfo; + ulParamSize: UINT; + wType: DBTYPE; + bPrecision: Byte; + bScale: Byte; + end; + TDBParamInfo = DBPARAMINFO; + {$EXTERNALSYM DBPARAMINFO}*) + + PDBParamBindInfo = ^TDBParamBindInfo; + DBPARAMBINDINFO = packed record + pwszDataSourceType: PWideChar; + pwszName: PWideChar; + ulParamSize: UINT; + dwFlags: DBPARAMFLAGS; + bPrecision: Byte; + bScale: Byte; + end; + TDBParamBindInfo = DBPARAMBINDINFO; + {$EXTERNALSYM DBPARAMBINDINFO} + + PDBNumeric = ^TDBNumeric; + DB_NUMERIC = packed record + precision: Byte; + scale: Byte; + sign: Byte; + val: array[0..15] of Byte; + end; + TDBNumeric = DB_NUMERIC; + {$EXTERNALSYM DB_NUMERIC} +const + SizeOfTDBNumeric = SizeOf(TDBNumeric); + +type + PDBParamBindInfoArray = ^TDBParamBindInfoArray; + TDBParamBindInfoArray = array[0..MAXBOUND] of TDBParamBindInfo; + +// *********************************************************************// +// DBID Values +// *********************************************************************// +const + DB_NULLID: DBID = (uguid: (guid: (D1: 0; D2: 0; D3:0; D4: (0, 0, 0, 0, 0, 0, 0, 0))); ekind: DBKIND_GUID_PROPID; uname: (ulpropid:0)); + {$EXTERNALSYM DB_NULLID} + +type + TVariantArray = array [0..0] of OleVariant; + PVariantArray = ^TVariantArray; + + TGUIDArray = array [0..0] of TGUID; + PGUIDArray = ^TGUIDArray; + +// *********************************************************************// +// Interface: ITransaction +// GUID: {0FB15084-AF41-11CE-BD2B-204C4F4F5020} +// *********************************************************************// +{$IFNDEF VER6P} + {$NODEFINE ITransaction} +{$ENDIF} + ITransaction = interface(IUnknown) + ['{0FB15084-AF41-11CE-BD2B-204C4F4F5020}'] + function Commit(fRetaining: BOOL; grfTC: UINT; grfRM: UINT): HResult; stdcall; + function Abort(pboidReason: PBOID; fRetaining: BOOL; fAsync: BOOL): HResult; stdcall; + function GetTransactionInfo(out pinfo: XACTTRANSINFO): HResult; stdcall; + end; + +// *********************************************************************// +// Interface: ITransactionOptions +// GUID: {3A6AD9E0-23B9-11CF-AD60-00AA00A74CCD} +// *********************************************************************// + ITransactionOptions = interface(IUnknown) + ['{3A6AD9E0-23B9-11CF-AD60-00AA00A74CCD}'] + function SetOptions(var pOptions: XACTOPT): HResult; stdcall; + function GetOptions(var pOptions: XACTOPT): HResult; stdcall; + end; + +// *********************************************************************// +// Interface: IAccessor +// GUID: {0C733A8C-2A1C-11CE-ADE5-00AA0044773D} +// *********************************************************************// + IAccessor = interface(IUnknown) + ['{0C733A8C-2A1C-11CE-ADE5-00AA0044773D}'] + function AddRefAccessor(HACCESSOR: HACCESSOR; pcRefCount: PUINT): HResult; stdcall; + function CreateAccessor(dwAccessorFlags: UINT; cBindings: UINT; rgBindings: PDBBindingArray; + cbRowSize: UINT; var phAccessor: HACCESSOR; rgStatus: PUintArray): HResult; stdcall; + function GetBindings(HACCESSOR: HACCESSOR; pdwAccessorFlags: PUINT; var pcBindings: UINT; + out prgBindings: PDBBinding): HResult; stdcall; + function ReleaseAccessor(HACCESSOR: HACCESSOR; pcRefCount: PUINT): HResult; stdcall; + end; + +// *********************************************************************// +// Interface: IRowset +// GUID: {0C733A7C-2A1C-11CE-ADE5-00AA0044773D} +// *********************************************************************// + IRowset = interface(IUnknown) + ['{0C733A7C-2A1C-11CE-ADE5-00AA0044773D}'] + function AddRefRows(cRows: UINT; rghRows: PUintArray; rgRefCounts: PUintArray; + rgRowStatus: PUintArray): HResult; stdcall; + function GetData(HROW: HROW; HACCESSOR: HACCESSOR; pData: IntPtr): HResult; stdcall; + function GetNextRows(hReserved: HCHAPTER; lRowsOffset: Integer; cRows: Integer; + out pcRowsObtained: UINT; var prghRows: PUintArray): HResult; stdcall; + function ReleaseRows( + cRows: UINT; + rghRows: PUintArray; + rgRowOptions, + rgRefCounts, + rgRowStatus: PUintArray): HResult; stdcall; + function RestartPosition(hReserved: HCHAPTER): HResult; stdcall; + end; + +// *********************************************************************// +// Interface: IRowsetInfo +// GUID: {0C733A55-2A1C-11CE-ADE5-00AA0044773D} +// *********************************************************************// + IRowsetInfo = interface(IUnknown) + ['{0C733A55-2A1C-11CE-ADE5-00AA0044773D}'] + function GetProperties(cPropertyIDSets: UINT; rgPropertyIDSets: PDBPropIDSetArray; + out pcPropertySets: UINT; out prgPropertySets: PDBPropSet): HResult; stdcall; + function GetReferencedRowset(iOrdinal: UINT; const riid: TGUID; + out ppReferencedRowset: IUnknown): HResult; stdcall; + function GetSpecification(const riid: TGUID; out ppSpecification: IUnknown): HResult; stdcall; + end; + +// *********************************************************************// +// Interface: IRowsetLocate +// GUID: {0C733A7D-2A1C-11CE-ADE5-00AA0044773D} +// *********************************************************************// + IRowsetLocate = interface(IRowset) + ['{0C733A7D-2A1C-11CE-ADE5-00AA0044773D}'] + function Compare(hReserved: HCHAPTER; cbBookmark1: UINT; pBookmark1: PByte; + cbBookmark2: UINT; pBookmark2: PByte; out pComparison: UINT): HResult; stdcall; + function GetRowsAt(hReserved1: HWATCHREGION; hReserved2: HCHAPTER; cbBookmark: UINT; + pBookmark: PByte; lRowsOffset: Integer; cRows: Integer; + out pcRowsObtained: UINT; var prghRows: PUintArray): HResult; stdcall; + function GetRowsByBookmark(hReserved: HCHAPTER; cRows: UINT; rgcbBookmarks: PUintArray; + rgpBookmarks: PPByteArray; rghRows, rgRowStatus: PUintArray): HResult; stdcall; + function Hash(hReserved: HCHAPTER; cBookmarks: UINT; rgcbBookmarks: PUintArray; + rgpBookmarks: PPByteArray; rgHashedValues, + rgBookmarkStatus: PUintArray): HResult; stdcall; + end; + +// *********************************************************************// +// Interface: IRowsetChange +// GUID: {0C733A05-2A1C-11CE-ADE5-00AA0044773D} +// *********************************************************************// + IRowsetChange = interface(IUnknown) + ['{0C733A05-2A1C-11CE-ADE5-00AA0044773D}'] + function DeleteRows(hReserved: HCHAPTER; cRows: UINT; rghRows: PUintArray; + rgRowStatus: PUintArray): HResult; stdcall; + function SetData(HROW: HROW; HACCESSOR: HACCESSOR; pData: IntPtr): HResult; stdcall; + function InsertRow(hReserved: HCHAPTER; HACCESSOR: HACCESSOR; pData: IntPtr; + out phRow: HROW): HResult; stdcall; + end; + +// *********************************************************************// +// Interface: IRowsetUpdate +// GUID: {0C733A6D-2A1C-11CE-ADE5-00AA0044773D} +// *********************************************************************// + IRowsetUpdate = interface(IRowsetChange) + ['{0C733A6D-2A1C-11CE-ADE5-00AA0044773D}'] + function GetOriginalData(HROW: HROW; HACCESSOR: HACCESSOR; pData: IntPtr): HResult; stdcall; + function GetPendingRows(hReserved: HCHAPTER; dwRowStatus: DBPENDINGSTATUS; pcPendingRows: PUINT; + prgPendingRows: PPHROW; prgPendingStatus: PPDBPENDINGSTATUS): HResult; stdcall; + function GetRowStatus(hReserved: HCHAPTER; cRows: UINT; rghRows: PUintArray; + rgPendingStatus: PUintArray): HResult; stdcall; + function Undo( + hReserved: HCHAPTER; + cRows: UINT; + rghRows: PUintArray; + pcRowsUndone: PUINT; + prgRowsUndone: PPHROW; + prgRowStatus: PPDBROWSTATUS + ): HResult; stdcall; + function Update( + hReserved: HCHAPTER; + cRows: UINT; + rghRows: PUintArray; + pcRows: PUINT; + prgRows: PPHROW; + out prgRowStatus: PDBROWSTATUS + ): HResult; stdcall; + end; + +// *********************************************************************// +// Interface: IMultipleResults +// GUID: {0C733A90-2A1C-11CE-ADE5-00AA0044773D} +// *********************************************************************// + IMultipleResults = interface(IUnknown) + ['{0C733A90-2A1C-11CE-ADE5-00AA0044773D}'] + function GetResult( + const punkOuter: IUnknown; + reserved: Integer; + const riid: TGUID; + out pcRowsAffected: Integer; + out ppRowset: IUnknown): HResult; stdcall; + end; + +// *********************************************************************// +// Interface: ICommandPrepare +// GUID: {0C733A26-2A1C-11CE-ADE5-00AA0044773D} +// *********************************************************************// + ICommandPrepare = interface(IUnknown) + ['{0C733A26-2A1C-11CE-ADE5-00AA0044773D}'] + function Prepare(cExpectedRuns: UINT): HResult; stdcall; + function Unprepare: HResult; stdcall; + end; + +// *********************************************************************// +// Interface: ICommandProperties +// GUID: {0C733A79-2A1C-11CE-ADE5-00AA0044773D} +// *********************************************************************// + + ICommandProperties = interface(IUnknown) + ['{0C733A79-2A1C-11CE-ADE5-00AA0044773D}'] + function GetProperties(cPropertyIDSets: UINT; rgPropertyIDSets: PDBPropIDSetArray; + var pcPropertySets: UINT; out prgPropertySets: PDBPropSet): HResult; stdcall; + function SetProperties(cPropertySets: UINT; rgPropertySets: PDBPropSetArray): HResult; stdcall; + end; + +// *********************************************************************// +// Interface: ICommand +// GUID: {0C733A63-2A1C-11CE-ADE5-00AA0044773D} +// *********************************************************************// + ICommand = interface(IUnknown) + ['{0C733A63-2A1C-11CE-ADE5-00AA0044773D}'] + function Cancel: HResult; stdcall; + function Execute( + const punkOuter: IUnknown; + const riid: TGUID; + var pParams: DBPARAMS; + out pcRowsAffected: Integer; + out ppRowset: IUnknown): HResult; stdcall; + function GetDBSession(const riid: TGUID; out ppSession: IUnknown): HResult; stdcall; + end; + +// *********************************************************************// +// Interface: ICommandText +// GUID: {0C733A27-2A1C-11CE-ADE5-00AA0044773D} +// *********************************************************************// + ICommandText = interface(ICommand) + ['{0C733A27-2A1C-11CE-ADE5-00AA0044773D}'] + function GetCommandText( + var pguidDialect: TGUID; + out ppwszCommand: PWideChar): HResult; stdcall; + function SetCommandText( + const rguidDialect: TGUID; + pwszCommand: PWideChar): HResult; stdcall; + end; + +// *********************************************************************// +// Interface: ICommandWithParameters +// GUID: {0C733A64-2A1C-11CE-ADE5-00AA0044773D} +// *********************************************************************// + ICommandWithParameters = interface(IUnknown) + ['{0C733A64-2A1C-11CE-ADE5-00AA0044773D}'] + function GetParameterInfo(var pcParams: UINT32; out prgParamInfo: PDBPARAMINFO; + ppNamesBuffer: PPOleStr): HResult; stdcall; + function MapParameterNames(cParamNames: UINT; rgParamNames: POleStrList; + rgParamOrdinals: PUintArray): HResult; stdcall; + function SetParameterInfo(cParams: UINT; rgParamOrdinals: PUintArray; + rgParamBindInfo: PDBParamBindInfoArray): HResult; stdcall; + end; + + // *********************************************************************// +// Interface: IColumnsRowset +// GUID: {0C733A10-2A1C-11CE-ADE5-00AA0044773D} +// *********************************************************************// + IColumnsRowset = interface(IUnknown) + ['{0C733A10-2A1C-11CE-ADE5-00AA0044773D}'] + function GetAvailableColumns(var pcOptColumns: UINT; + var prgOptColumns: PDBID): HResult; stdcall; + function GetColumnsRowset(const punkOuter: IUnknown; cOptColumns: UINT; + rgOptColumns: PDBIDArray; const riid: TGUID; cPropertySets: UINT; + rgPropertySets: PDBPropSetArray; out pColRowset: IUnknown): HResult; stdcall; + end; + +// *********************************************************************// +// Interface: IColumnsInfo +// GUID: {0C733A11-2A1C-11CE-ADE5-00AA0044773D} +// *********************************************************************// + IColumnsInfo = interface(IUnknown) + ['{0C733A11-2A1C-11CE-ADE5-00AA0044773D}'] + function GetColumnInfo(var pcColumns: UINT; out prgInfo: PDBColumnInfo; + out ppStringsBuffer: IntPtr): HResult; stdcall; + function MapColumnIDs(cColumnIDs: UINT; rgColumnIDs: PDBIDArray; + rgColumns: PUintArray): HResult; stdcall; + end; + +// *********************************************************************// +// Interface: IDBCreateCommand +// GUID: {0C733A1D-2A1C-11CE-ADE5-00AA0044773D} +// *********************************************************************// + IDBCreateCommand = interface(IUnknown) + ['{0C733A1D-2A1C-11CE-ADE5-00AA0044773D}'] + function CreateCommand(const punkOuter: IUnknown; const riid: TGUID; + out ppCommand: IUnknown): HResult; stdcall; + end; + +// *********************************************************************// +// Interface: IDBCreateSession +// GUID: {0C733A5D-2A1C-11CE-ADE5-00AA0044773D} +// *********************************************************************// + IDBCreateSession = interface(IUnknown) + ['{0C733A5D-2A1C-11CE-ADE5-00AA0044773D}'] + function CreateSession(const punkOuter: IUnknown; const riid: TGUID; + out ppDBSession: IUnknown): HResult; stdcall; + end; + +// *********************************************************************// +// Interface: ISourcesRowset +// GUID: {0C733A1E-2A1C-11CE-ADE5-00AA0044773D} +// *********************************************************************// + ISourcesRowset = interface(IUnknown) + ['{0C733A1E-2A1C-11CE-ADE5-00AA0044773D}'] + function GetSourcesRowset(const punkOuter: IUnknown; const riid: TGUID; cPropertySets: UINT; + rgProperties: PDBPropSetArray; out ppSourcesRowset: IUnknown): HResult; stdcall; + end; + +// *********************************************************************// +// Interface: IDBProperties +// GUID: {0C733A8A-2A1C-11CE-ADE5-00AA0044773D} +// *********************************************************************// + IDBProperties = interface(IUnknown) + ['{0C733A8A-2A1C-11CE-ADE5-00AA0044773D}'] + function GetProperties(cPropertyIDSets: UINT; rgPropertyIDSets: PDBPropIDSetArray; + var pcPropertySets: UINT; out prgPropertySets: PDBPropSet): HResult; stdcall; + function GetPropertyInfo(cPropertyIDSets: UINT; rgPropertyIDSets: PDBPropIDSetArray; + var pcPropertyInfoSets: UINT; out prgPropertyInfoSets: PDBPropInfoSet; + ppDescBuffer: PPOleStr): HResult; stdcall; + function SetProperties(cPropertySets: UINT; rgPropertySets: PDBPropSetArray): HResult; stdcall; + end; + +// *********************************************************************// +// Interface: IDBInitialize +// GUID: {0C733A8B-2A1C-11CE-ADE5-00AA0044773D} +// *********************************************************************// + IDBInitialize = interface(IUnknown) + ['{0C733A8B-2A1C-11CE-ADE5-00AA0044773D}'] + function Initialize: HResult; stdcall; + function Uninitialize: HResult; stdcall; + end; + +// *********************************************************************// +// Interface: IDBDataSourceAdmin +// GUID: {0C733A7A-2A1C-11CE-ADE5-00AA0044773D} +// *********************************************************************// + IDBDataSourceAdmin = interface(IUnknown) + ['{0C733A7A-2A1C-11CE-ADE5-00AA0044773D}'] + function CreateDataSource(cPropertySets: UINT; rgPropertySets: PDBPropSetArray; + const punkOuter: IUnknown; const riid: TGUID; out ppDBSession: IUnknown): HResult; stdcall; + function DestroyDataSource: HResult; stdcall; + function GetCreationProperties(cPropertyIDSets: UINT; rgPropertyIDSets: PDBPropIDSetArray; + pcPropertyInfoSets: PUINT; out prgPropertyInfoSets: PDBPropInfoSet; + ppDescBuffer: PPOleStr): HResult; stdcall; + function ModifyDataSource(cPropertySets: UINT; rgPropertySets: PDBPropSetArray): HResult; stdcall; + end; + +// *********************************************************************// +// Interface: ISessionProperties +// GUID: {0C733A85-2A1C-11CE-ADE5-00AA0044773d} +// *********************************************************************// + ISessionProperties = interface(IUnknown) + ['{0C733A85-2A1C-11CE-ADE5-00AA0044773d}'] + function GetProperties(cPropertyIDSets: UINT; rgPropertyIDSets: PDBPropIDSetArray; + var pcPropertySets: UINT; out prgPropertySets: PDBPropSet): HResult; stdcall; + function SetProperties(cPropertySets: UINT; rgPropertySets: PDBPropSetArray): HResult; stdcall; + end; + +// *********************************************************************// +// Interface: ITransactionLocal +// GUID: {0C733A5F-2A1C-11CE-ADE5-00AA0044773D} +// *********************************************************************// + ITransactionLocal = interface(ITransaction) + ['{0C733A5F-2A1C-11CE-ADE5-00AA0044773D}'] + function GetOptionsObject(out ppOptions: ITransactionOptions): HResult; stdcall; + function StartTransaction(isoLevel: Integer; isoFlags: UINT; + const pOtherOptions: ITransactionOptions; pulTransactionLevel: PUINT): HResult; stdcall; + end; + +// *********************************************************************// +// Interface: IDBPromptInitialize +// GUID: {2206CCB0-19C1-11D1-89E0-00C04FD7A829} +// *********************************************************************// + IDBPromptInitialize = interface(IUnknown) + ['{2206CCB0-19C1-11D1-89E0-00C04FD7A829}'] + function PromptDataSource(const pUnkOuter: IUnknown; hWndParent: HWND; + dwPromptOptions: DBPROMPTOPTIONS; cSourceTypeFilter: ULONG; + rgSourceTypeFilter: PDBSOURCETYPE; pszProviderFilter: POleStr; + const riid: TIID; var DataSource: IUnknown): HResult; stdcall; + function PromptFileName(hWndParent: HWND; dwPromptOptions: DBPROMPTOPTIONS; + pwszInitialDirectory, pwszInitialFile: POleStr; + var ppwszSelectedFile: POleStr): HResult; stdcall; + end; + +// *********************************************************************// +// Interface: IDataInitialize +// GUID: {2206CCB1-19C1-11D1-89E0-00C04FD7A829} +// *********************************************************************// + IDataInitialize = interface(IUnknown) + ['{2206CCB1-19C1-11D1-89E0-00C04FD7A829}'] + function GetDataSource( + const pUnkOuter: IUnknown; + dwClsCtx: DWORD; + pwszInitializationString: POleStr; + const riid: TIID; + var DataSource: IUnknown): HResult; stdcall; + function GetInitializationString( + const DataSource: IUnknown; + fIncludePassword: Boolean; + out pwszInitString: POleStr): HResult; stdcall; + function CreateDBInstance(const clsidProvider: TGUID; + const pUnkOuter: IUnknown; + dwClsCtx: DWORD; pwszReserved: POleStr; + riid: TIID; + var DataSource: IUnknown): HResult; stdcall; + function CreateDBInstanceEx( + const clsidProvider: TGUID; + const pUnkOuter: IUnknown; + dwClsCtx: DWORD; + pwszReserved: POleStr; + pServerInfo: PCoServerInfo; + cmq: ULONG; + rgmqResults: PMultiQI): HResult; stdcall; + function LoadStringFromStorage( + pwszFileName: POleStr; + out pwszInitializationString: POleStr): HResult; stdcall; + function WriteStringToStorage( + pwszFileName, pwszInitializationString: POleStr; + dwCreationDisposition: DWORD): HResult; stdcall; + end; + + IDBSchemaRowset = interface (IUnknown) + ['{0c733a7b-2a1c-11ce-ade5-00aa0044773d}'] + function GetRowset (const pUnkOuter: IUnknown; const rguidSchema: TGUID; + cRestrictions: UINT; rgRestrictions: PVariantArray; const riid: TGUID; + cPropertySets: UINT; rgPropertySets: PDBPropSetArray; + out ppRowset: IUnknown): HResult; stdcall; + function GetSchemas (out pcSchemas: UINT; out prgSchemas: PGUIDArray; + prgRestrictionSupport: PUINTArray): HResult; stdcall; + end; + + IOpenRowset = interface(IUnknown) + ['{0c733a69-2a1c-11ce-ade5-00aa0044773d}'] + function OpenRowset(const punkOuter: IUnknown; pTableID: PDBID; + pIndexID: PDBID; const riid: TGUID; cPropertySets: UINT; + rgPropertySets: PDBPropIDSetArray; out ppReferencedRowset: IUnknown): HRESULT; stdcall; + end; + + IRowsetFastLoad = interface(IUnknown) + ['{5CF4CA13-EF21-11d0-97E7-00C04FC2AD98}'] + function InsertRow(HACCESSOR: HACCESSOR; pData: Pointer): HRESULT; stdcall; + function Commit(fDone: boolean): HRESULT; stdcall; + end; + + IDBAsynchStatus = interface(IUnknown) + ['{0c733a95-2a1c-11ce-ade5-00aa0044773d}'] + function Abort(Chapter: HCHAPTER; Operation: DBASYNCHOP): HRESULT; stdcall; + function GetStatus(Chapter: HCHAPTER; Operation: DBASYNCHOP; var Progress: UINT; + var ProgressMax: UINT; var AsynchPhase: DWORD; var StatusText: PWideChar): HRESULT; stdcall; + end; + + ISSAsynchStatus = interface(IDBAsynchStatus) + ['{1FF1F743-8BB0-4c00-ACC4-C10E43B08FC1}'] + function WaitForAsynchCompletion(MillisecTimeOut: DWORD): HRESULT; stdcall; + end; + + IErrorRecords = interface (IUnknown) + ['{0c733a67-2a1c-11ce-ade5-00aa0044773d}'] + function (* [local] *) AddErrorRecord( + (* [in] *) const pErrorInfo: ERRORINFO; + (* [in] *) dwLookupID: DWORD; + (* [in] *) const pdispparams: DISPPARAMS; + (* [in] *) const punkCustomError: IUnknown; + (* [in] *) dwDynamicErrorID: DWORD): HResult; stdcall; + + function (* [local] *) GetBasicErrorInfo( + (* [in] *) ulRecordNum: ULONG; + (* [out] *) out pErrorInfo: ERRORINFO): HResult; stdcall; + + function (* [local] *) GetCustomErrorObject( + (* [in] *) ulRecordNum: ULONG; + (* [in] *) const riid: TGUID; + (* [iid_is][out] *) out ppObject: IUnknown): HResult; stdcall; + + function (* [local] *) GetErrorInfo( + (* [in] *) ulRecordNum: ULONG; + (* [in] *) lcid: LCID; + (* [out] *) out ppErrorInfo: IErrorInfo): HResult; stdcall; + + function (* [local] *) GetErrorParameters( + (* [in] *) ulRecordNum: ULONG; + (* [out] *) out pdispparams: DISPPARAMS): HResult; stdcall; + + function (* [local] *) GetRecordCount( + (* [out] *) out pcRecords: ULONG): HResult; stdcall; + end; + {$EXTERNALSYM IErrorRecords} + +// the structure returned by ISQLServerErrorInfo::GetSQLServerInfo + SSERRORINFO_ = record + pwszMessage: PWideChar; + pwszServer: PWideChar; + pwszProcedure: PWideChar; + lNative: UINT; + bState: BYTE; + bClass: BYTE; + wLineNumber: WORD; + end; + SSERRORINFO = record + pwszMessage: WideString; + pwszServer: WideString; + pwszProcedure: WideString; + lNative: UINT; + bState: BYTE; + bClass: BYTE; + wLineNumber: WORD; + end; + PSSERRORINFO = ^SSERRORINFO_; + + +type + ISQLServerErrorInfo = interface (IUnknown) + function GetErrorInfo( + (* [out] *) out ppErrorInfo: PSSERRORINFO; + (* [out] *) out ppStringsBuffer: IntPtr{PWideChar}): HResult; stdcall; + end; + + /// WARINING - in 64bit OSes DBBKMARK is int64 + DBBKMARK = integer; + +implementation + +initialization + Assert(SizeOf(DBProp) = SizeOfDBProp); + +end. diff --git a/internal/4.10.0.10/1/Source/Sdac.inc b/internal/4.10.0.10/1/Source/Sdac.inc new file mode 100644 index 0000000..be35d32 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Sdac.inc @@ -0,0 +1,13 @@ + +////////////////////////////////////////////////// +// SQL Server Data Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +////////////////////////////////////////////////// + +// Type of build + +{$I Dac.inc} + +{$DEFINE _TRIAL} // TRIAL + +{$DEFINE _DEBUG} // DEBUG \ No newline at end of file diff --git a/internal/4.10.0.10/1/Source/SdacGui.inc b/internal/4.10.0.10/1/Source/SdacGui.inc new file mode 100644 index 0000000..71af69e --- /dev/null +++ b/internal/4.10.0.10/1/Source/SdacGui.inc @@ -0,0 +1,107 @@ +type + +{ TMSConnectDialog } + + TMSConnectDialog = class(TCustomConnectDialog) + private + function GetConnection: TMSConnection; + + protected + FDatabaseLabel: string; + function DefDialogClass: TClass; override; + function GetKeyPath: string; override; + function GetServerStoreName: string; override; + + {$IFDEF MSWINDOWS} + procedure SaveInfoToRegistry(Registry: TRegistry); override; + procedure LoadInfoFromRegistry(Registry: TRegistry); override; + {$ENDIF} + public + constructor Create(Owner: TComponent); override; + property Connection: TMSConnection read GetConnection; + procedure GetServerList(List: TStrings); override; + + published + property Retries; + property SavePassword; + property DialogClass; + + property Caption; + property UsernameLabel; + property PasswordLabel; + property ServerLabel; + property DatabaseLabel: string read FDatabaseLabel write FDatabaseLabel; + property ConnectButton; + property CancelButton; + + property LabelSet; + property StoreLogInfo; + end; + +function DefConnectDialogClass: TClass; + +implementation + +{$IFDEF MSWINDOWS} +uses + Windows; +{$ENDIF} + +function DefConnectDialogClass: TClass; +begin + Result := TMSConnectDialog; +end; + +const + KeyPath = '\SOFTWARE\CoreLab\SDAC\'; + +{ TConnectDialog } + +function TMSConnectDialog.DefDialogClass: TClass; +begin + Result := TMSConnectForm; +end; + +function TMSConnectDialog.GetKeyPath: string; +begin + Result := KeyPath; +end; + +constructor TMSConnectDialog.Create(Owner: TComponent); +begin + inherited; + FDatabaseLabel := 'Database'; +end; + +function TMSConnectDialog.GetServerStoreName: string; +begin + Result := 'Server'; +end; + +procedure TMSConnectDialog.SaveInfoToRegistry(Registry: TRegistry); +begin + inherited; + + Registry.WriteString('Database', Connection.Database); +end; + +procedure TMSConnectDialog.LoadInfoFromRegistry(Registry: TRegistry); +begin + inherited; + if Registry.ValueExists('Database') then + TMSConnection(Connection).Database := Registry.ReadString('Database'); +end; + +procedure TMSConnectDialog.GetServerList(List: TStrings); +begin + MSAccess.GetServerList(List); +end; + +function TMSConnectDialog.GetConnection: TMSConnection; +begin + Result := (inherited Connection) as TMSConnection; +end; + +initialization + DefConnectDialogClassProc := DefConnectDialogClass; +end. diff --git a/internal/4.10.0.10/1/Source/SdacVcl.pas b/internal/4.10.0.10/1/Source/SdacVcl.pas new file mode 100644 index 0000000..27a4323 --- /dev/null +++ b/internal/4.10.0.10/1/Source/SdacVcl.pas @@ -0,0 +1,14 @@ + +{$IFNDEF CLR} + +{$I Sdac.inc} + +unit SdacVcl; +{$ENDIF} + +interface + +uses + SysUtils, Classes, Registry, DacVcl, DBAccess, MSConnectForm, MSAccess, OLEDBAccess, CRParser; + +{$I SdacGui.inc} diff --git a/internal/4.10.0.10/1/Source/SdacVer.inc b/internal/4.10.0.10/1/Source/SdacVer.inc new file mode 100644 index 0000000..14b5dfb --- /dev/null +++ b/internal/4.10.0.10/1/Source/SdacVer.inc @@ -0,0 +1,9 @@ + +////////////////////////////////////////////////// +// SQL Server Data Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +////////////////////////////////////////////////// + +const + SdacVersion = '4.10.0.10'; + diff --git a/internal/4.10.0.10/1/Source/VirtualTable.pas b/internal/4.10.0.10/1/Source/VirtualTable.pas new file mode 100644 index 0000000..6858e83 --- /dev/null +++ b/internal/4.10.0.10/1/Source/VirtualTable.pas @@ -0,0 +1,1849 @@ +////////////////////////////////////////////////// +// Copyright © 1998-2007 Core Lab. All right reserved. +// Virtual table +// Created: 11.12.98 +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I Dac.inc} + +unit VirtualTable; +{$ENDIF} +interface +uses +{$IFDEF VER6P} + StrUtils, Variants, +{$ENDIF} +{$IFDEF LINUX} + Libc, Classes, SysUtils, DB, MemDS, MemData; +{$ELSE} + Windows, Classes, SysUtils, DB, MemDS, MemData; +{$ENDIF} + +type + TCRFileFormat = (ffVTD, ffXML); + + TVirtualTableOption = (voPersistentData, voStored); + TVirtualTableOptions = set of TVirtualTableOption; + + TVirtualTable = class(TMemDataSet) + private + FOptions: TVirtualTableOptions; + FStreamedActive: boolean; + FAvoidRefreshData: boolean; + FAvoidReload: integer; + FRecordDataStream: TMemoryStream; + + procedure ReadBinaryData(Stream: TStream); + procedure WriteBinaryData(Stream: TStream); + + function IsFieldDefsStored: boolean; + function GetFieldDefs: TFieldDefs; + procedure SetFieldDefs(Value: TFieldDefs); + + protected + FFieldDefsByField: boolean; + + procedure Loaded; override; + + procedure CreateIRecordSet; override; + + procedure OpenCursor(InfoQuery: boolean); override; + procedure InternalOpen; override; + procedure InternalClose; override; + function IsCursorOpen: boolean; override; + + procedure CreateFieldDefs; override; + procedure DefChanged(Sender: TObject); override; + procedure Reload; + {$IFDEF CLR} + procedure DataEvent(Event: TDataEvent; Info: TObject); override; + {$ELSE} + procedure DataEvent(Event: TDataEvent; Info: longint); override; + {$ENDIF} + + procedure DefineProperties(Filer: TFiler); override; + + procedure AssignDataSet(Source: TDataSet); + + procedure SetActive(Value:boolean); override; + + public + constructor Create(Owner: TComponent); override; + destructor Destroy; override; + + function IsSequenced: boolean; override; + + procedure AddField(Name: string; FieldType: TFieldType; Size: integer = 0; Required: boolean = False); + procedure DeleteField(Name: string); + procedure DeleteFields; + + procedure Clear; + + { Stream/File } + procedure LoadFromStream(Stream: TStream; LoadFields: boolean = True); + procedure SaveToStream(Stream: TStream; StoreFields: boolean = True); + + procedure LoadFromFile(const FileName: string); + procedure SaveToFile(const FileName: string); + + procedure Assign(Source: TPersistent); override; + + published + property Options: TVirtualTableOptions read FOptions write FOptions default [voPersistentData, voStored]; + + property Active; + property AutoCalcFields; + property Filtered; + property Filter; + property FilterOptions; + property IndexFieldNames; + property BeforeOpen; + property AfterOpen; + property BeforeClose; + property AfterClose; + property BeforeInsert; + property AfterInsert; + property BeforeEdit; + property AfterEdit; + property BeforePost; + property AfterPost; + property BeforeCancel; + property AfterCancel; + property BeforeDelete; + property AfterDelete; + property BeforeScroll; + property AfterScroll; + property OnCalcFields; + property OnDeleteError; + property OnEditError; + property OnFilterRecord; + property OnNewRecord; + property OnPostError; + + //property Fields stored False; + property FieldDefs: TFieldDefs read GetFieldDefs write SetFieldDefs stored IsFieldDefsStored; + end; + +var + VTOldBehavior: boolean; + +implementation +uses + CRParser, DAConsts, MemUtils, +{$IFDEF VER6P} + FMTBcd, +{$ENDIF} +{$IFDEF CLR} + System.XML, System.IO, System.Runtime.InteropServices, System.Text, DateUtils, RTLConsts; +{$ELSE} + CLRClasses, CRXml; +{$ENDIF} + +const + // Must be sync with 'case' in AddFieldDesc and 'case' in SaveToStream + SupportFieldTypes = [ftString, ftWideString, ftSmallint, ftInteger, ftAutoInc, + ftWord, ftBoolean, ftLargeint, ftFloat, ftCurrency, ftDate, ftTime, + ftDateTime, ftBlob, ftMemo{$IFDEF VER10P}, ftWideMemo{$ENDIF}, ftGuid, ftBCD, {$IFDEF VER6P}ftFmtBcd,{$ENDIF} + ftBytes, ftVarBytes, ftVariant]; + SNotSupportFieldType = 'Field type is not supported by TVirtualTable. '#13 + + 'Valid types is String, WideString, Smallint, Integer, Word, Boolean, Largeint, Float, Currency, Date, Time, DateTime, Blob, Memo, Guid, Bcd, ' + {$IFDEF VER6P} 'FmtBcd, ' + {$ENDIF} 'Bytes, VarBytes, Variant'; + +type + TVirtualData = class (TMemData) + protected + Owner: TDataSet; + + procedure InternalOpen; override; + procedure InternalInitFields; override; + + public + constructor Create; + end; + +{ TVirtualData } + +constructor TVirtualData.Create; +begin + inherited; + + Owner := nil; +end; + +procedure TVirtualData.InternalInitFields; + procedure AddFieldDesc(const FieldName: string; const FieldType: TFieldType; + const FieldSize: integer; const Precision: integer; const Scale: integer; + const Required: boolean; const Fixed: boolean); + var + Field: TFieldDesc; + begin + Field := TFieldDesc.Create; + try + Field.FieldNo := FFields.Count + 1; + Field.Name := FieldName; + Field.DataType := GetDataType(FieldType); + + case FieldType of + ftString: begin + Field.Size := FieldSize + 1; + Field.Length := FieldSize; + end; + ftWideString: begin + Field.Size := (FieldSize + 1) * sizeof(WideChar); + Field.Length := FieldSize; + end; + ftSmallint: + if (Precision <= 4) and (Precision <> 0) then begin + Field.DataType := dtInt8; + Field.Size := sizeof(SmallInt); + Field.Length := Precision; + end + else + Field.Size := sizeof(SmallInt); + ftInteger, ftAutoInc: + Field.Size := sizeof(Integer); + ftWord: + Field.Size := sizeof(word); + ftBoolean: + Field.Size := sizeof(Wordbool); + ftLargeint: + if (Precision <= 10) and (Precision <> 0) then begin + Field.DataType := dtUInt32; + Field.Size := sizeof(Integer); + Field.Length := Precision; + end + else + Field.Size := sizeof(Largeint); + ftFloat: begin + Field.Size := sizeof(Double); + Field.Length := Precision; + end; + ftCurrency: + Field.Size := sizeof(Double); + ftDate, ftTime, ftDateTime: begin + Field.Size := sizeof(TDateTime); + Field.Length := Precision; + end; + ftBlob, ftMemo{$IFDEF VER10P}, ftWideMemo{$ENDIF}: + Field.Size := sizeof(Pointer); + ftGuid: begin + Field.Size := FieldSize + 1; + Field.Length := FieldSize; + end; + ftBCD: begin + Field.Size := sizeof(Currency); + Field.Scale := Scale; + Field.Length := Precision; + end; + {$IFDEF VER6P} + ftFmtBcd: begin + if Precision < SizeOfTBcd then + Field.Size := SizeOfTBcd + else + Field.Size := Precision + 1{'.'} + 1 {#0}; // To right notation of large NUMERIC values + Field.Scale := Scale; + Field.Length := Precision; + end; + {$ENDIF} + ftBytes: begin + Field.Size := FieldSize; + Field.Length := FieldSize; + end; + ftVarbytes: begin + Field.Size := sizeof(word) + FieldSize; + Field.Length := FieldSize; + end; + {$IFDEF VER5P} + ftVariant: begin + Field.Size := sizeof(TVariantObject); + end; + {$ENDIF} + +{ ftBytes, ftVarBytes, ftAutoInc, ftBlob, ftMemo, ftGraphic, ftFmtMemo, + ftParadoxOle, ftDBaseOle, ftTypedBinary, ftCursor, ftFixedChar, ftWideString, + ftLargeint, ftADT, ftArray, ftReference, ftDataSet, ftOraBlob, ftOraClob, + ftVariant, ftInterface, ftIDispatch, ftGuid, ftTimeStamp, ftFMTBcd, ftVariant + } + + else + DatabaseError(SNotSupportFieldType); + end; + Field.Required := Required; + Field.Fixed := Fixed; + FFields.Add(Field); + except + Field.Free; + end; + end; + +var + i: integer; + OwnerField: TField; + OwnerFieldDef: TFieldDef; + DataFieldCount: integer; +begin + inherited; + + DataFieldCount := 0; + for i := 0 to Owner.FieldCount - 1 do + if Owner.Fields[i].FieldKind = fkData then + Inc(DataFieldCount); + + if not Owner.DefaultFields and ((DataFieldCount > Owner.FieldDefs.Count) or (TVirtualTable(Owner).FFieldDefsByField and not VTOldBehavior)) then + // From fields + for i := 0 to Owner.FieldCount - 1 do begin + if Owner.Fields[i].FieldKind = fkData then begin + OwnerField := Owner.Fields[i]; + AddFieldDesc(OwnerField.FieldName, OwnerField.DataType, OwnerField.Size, 0, 0, False, False); + end + end + else + // From FieldDefs + for i := 0 to Owner.FieldDefs.Count - 1 do begin + OwnerFieldDef := Owner.FieldDefs[i]; + + AddFieldDesc(OwnerFieldDef.Name, OwnerFieldDef.DataType, OwnerFieldDef.Size, OwnerFieldDef.Precision, + OwnerFieldDef.Size, faRequired in OwnerFieldDef.Attributes, faFixed in OwnerFieldDef.Attributes); + end +end; + +procedure TVirtualData.InternalOpen; +begin + InitFields; + + inherited; +end; + +{ TVirtualTable } + +constructor TVirtualTable.Create(Owner: TComponent); +begin + inherited; + + Data.EnableEmptyStrings := True; + FOptions := [voPersistentData,voStored]; + FStreamedActive := False; + FRecordDataStream := TMemoryStream.Create; +end; + +destructor TVirtualTable.Destroy; +begin + Data.Close; // Clear data + FRecordDataStream.Free; + + inherited; +end; + +procedure TVirtualTable.Loaded; +begin + inherited; + + try + try + FRecordDataStream.Seek(0, soFromBeginning); + if FRecordDataStream.Size > 0 then + LoadFromStream(FRecordDataStream, False); + finally + FRecordDataStream.Clear; + end; + if FStreamedActive then + Active := True; + except + if csDesigning in ComponentState then + InternalHandleException + else + raise; + end; +end; + +procedure TVirtualTable.CreateIRecordSet; +begin + FCreateCalcFieldDescs := False; + + SetIRecordSet(TVirtualData.Create); + TVirtualData(Data).Owner := Self; +end; + +procedure TVirtualTable.OpenCursor(InfoQuery: boolean); +begin + Inc(FAvoidReload); + try + inherited; + finally + Dec(FAvoidReload); + end; +end; + +procedure TVirtualTable.InternalOpen; +begin + if FAvoidReload = 0 then + FFieldDefsByField := False; + inherited; +end; + +procedure TVirtualTable.InternalClose; +begin + Inc(FAvoidReload); + try + BindFields(False); + if DefaultFields then + DestroyFields; + + if not (voPersistentData in FOptions) then + Data.Close + else + Data.SetToBegin; + finally + Dec(FAvoidReload); + end; +end; + +function TVirtualTable.IsCursorOpen: boolean; +begin + Result := inherited IsCursorOpen; +end; + +procedure TVirtualTable.CreateFieldDefs; +var + DataFieldCount: integer; + OldFieldDefsCount: integer; + i: integer; +begin + OldFieldDefsCount := FieldDefs.Count; + DataFieldCount := 0; + for i := 0 to FieldCount - 1 do + if Fields[i].FieldKind = fkData then + Inc(DataFieldCount); + + if not DefaultFields and + ((DataFieldCount > FieldDefs.Count) or FFieldDefsByField)then + try + // Used to prevent save/load table DefChanged + Inc(FAvoidReload); + inherited; + if FFieldDefsByField then + FFieldDefsByField := (DataFieldCount = FieldDefs.Count) + else + FFieldDefsByField := (OldFieldDefsCount = 0) and (FieldDefs.Count > 0); + finally + Dec(FAvoidReload); + end; +end; + +procedure TVirtualTable.Reload; +var + OldActive: boolean; + Stream: TMemoryStream; +begin + if Data.RecordCount > 0 then begin + OldActive := Active; + Stream := TMemoryStream.Create; + DisableControls; + try + SaveToStream(Stream, False); + Close; + Clear; + finally + LoadFromStream(Stream, False); + Active := OldActive; + Stream.Free; + EnableControls; + end; + end + else begin + OldActive := Active; + Close; + Clear; + Active := OldActive; + end; +end; + +procedure TVirtualTable.DefChanged(Sender: TObject); +var + FieldDef: TFieldDef; + i: integer; +begin + if not FAvoidRefreshData then begin + if Active then + FFieldDefsByField := False; + for i := 0 to TFieldDefs(Sender).Count - 1 do begin + FieldDef := TFieldDefs(Sender)[i]; + if FieldDef.DataType = ftUnknown then begin + FAvoidRefreshData := True; + FieldDef.DataType := ftString; + FieldDef.Size := 20; + FAvoidRefreshData := False; + end; + end; + + if FAvoidReload = 0 then + Reload; + end; +end; + +{$IFDEF CLR} +procedure TVirtualTable.DataEvent(Event: TDataEvent; Info: TObject); +{$ELSE} +procedure TVirtualTable.DataEvent(Event: TDataEvent; Info: longint); +{$ENDIF} +begin + if FFieldDefsByField and (Event = deFieldListChange) and (FAvoidReload = 0) and not VTOldBehavior then begin + Inc(FAvoidReload); + try + FieldDefs.Updated := False; + if Data.Active {and (voPersistentData in FOptions)} then + Reload; + finally + Dec(FAvoidReload); + end; + end; + inherited DataEvent(Event, Info); +end; + +procedure TVirtualTable.Assign(Source: TPersistent); +var + Stream: TMemoryStream; +begin + if Source is TVirtualTable then begin + Stream := TMemoryStream.Create; + try + TVirtualTable(Source).SaveToStream(Stream); + LoadFromStream(Stream); + finally + Stream.Free; + end; + FFieldDefsByField := TVirtualTable(Source).FFieldDefsByField; + end + else + if Source is TDataSet then + AssignDataSet(TDataSet(Source)) + else + inherited; +end; + +procedure TVirtualTable.AssignDataSet(Source: TDataSet); + + procedure CreateFieldDefs(Fields: TFields; FieldDefs: TFieldDefs); + var + I: Integer; + F: TField; + FieldDef: TFieldDef; + SourceFieldDef: TFieldDef; + NewDataType: TFieldType; + begin + FieldDefs.BeginUpdate; + try + for I := 0 to Fields.Count - 1 do + begin + F := Fields[I]; + SourceFieldDef := Source.FieldDefs.Find(F.FieldName); + with F do begin + case DataType of + ftOraBlob: NewDataType := ftBlob; + ftOraClob: NewDataType := ftMemo; + else + NewDataType := DataType; + end; + if (FieldKind = fkData) and (NewDataType in SupportFieldTypes) + then begin + FieldDef := FieldDefs.AddFieldDef; + FieldDef.Name := FieldName; + FieldDef.DataType := NewDataType; + FieldDef.Size := Size; + if Required then + FieldDef.Attributes := [faRequired]; + if ReadOnly then + FieldDef.Attributes := FieldDef.Attributes + [faReadonly]; + if faFixed in SourceFieldDef.Attributes then + FieldDef.Attributes := FieldDef.Attributes + [faFixed]; + if (DataType = ftBCD) and (F is TBCDField) then + FieldDef.Precision := TBCDField(F).Precision; + if F is TObjectField then + CreateFieldDefs(TObjectField(F).Fields, FieldDef.ChildDefs); + end; + end; + end; + + finally + FieldDefs.EndUpdate; + end; + end; + +var + OldActive: boolean; + Bookmark: string; + i: integer; + SourceField: TField; + + FieldsRO: array of boolean; + Value: variant; +begin + OldActive := Active; + Close; + Clear; + DeleteFields; + + CreateFieldDefs(Source.Fields, FieldDefs); + + if Source.Active then begin + DisableControls; + Source.DisableControls; + Bookmark := Source.Bookmark; + Source.First; + + Open; + + // Temporary clear Field.ReadOnly flag + SetLength(FieldsRO, Fields.Count); + for i := 0 to Fields.Count - 1 do begin + FieldsRO[i] := Fields[i].ReadOnly; + Fields[i].ReadOnly := False; + end; + + try + while not Source.EOF do begin + Append; + for i := 0 to Fields.Count - 1 do begin + SourceField := Source.FieldByName(Fields[i].FieldName); + if not SourceField.IsNull then + if Fields[i] is TLargeIntField then + TLargeIntField(Fields[i]).AsLargeInt := TLargeIntField(SourceField).AsLargeInt + else begin + // To avoid memory leaks + Value := Unassigned; + Value := SourceField.Value; + Fields[i].Value := Value; + end; + end; + Post; + Source.Next; + end; + finally + First; + + // Restore Field.ReadOnly flag + for i := 0 to Fields.Count - 1 do + Fields[i].ReadOnly := FieldsRO[i]; + + if Source.RecordCount > 0 then + Source.Bookmark := Bookmark; + + Source.EnableControls; + EnableControls + end; + end; + Active := OldActive; +end; + +procedure TVirtualTable.DefineProperties(Filer: TFiler); + function WriteData: boolean; + begin + Result := True; + end; +begin + inherited DefineProperties(Filer); + + Filer.DefineBinaryProperty('Data', ReadBinaryData, WriteBinaryData, + WriteData); +end; + +procedure TVirtualTable.ReadBinaryData(Stream: TStream); +begin + if voStored in FOptions then begin + FRecordDataStream.Clear; + FRecordDataStream.CopyFrom(Stream, Stream.Size - Stream.Position); + end; +end; + +procedure TVirtualTable.WriteBinaryData(Stream: TStream); +begin + if voStored in FOptions then + SaveToStream(Stream, False); +end; + +function TVirtualTable.IsSequenced: boolean; +begin + Result := True; +end; + +procedure TVirtualTable.AddField(Name: string; FieldType: TFieldType; Size: integer; Required: boolean); +begin + if not (FieldType in SupportFieldTypes) then + DatabaseError(SNotSupportFieldType); + + FieldDefs.Add(Name, FieldType, Size, Required); +end; + +procedure TVirtualTable.DeleteField(Name: string); +var + Stream: TMemoryStream; + OldActive: boolean; + FieldDef: TFieldDef; +begin + FieldDef := FieldDefs.Find(Name); + if VTOldBehavior then begin + OldActive := Active; + Stream := TMemoryStream.Create; + try + SaveToStream(Stream, False); + Close; + Clear; + + FieldDef.Free; + //FieldDefs.Delete(FieldDef.Index); + finally + LoadFromStream(Stream, False); + Active := OldActive; + Stream.Free; + end; + end + else + FieldDef.Free; +end; + +procedure TVirtualTable.DeleteFields; +begin + Clear; + FieldDefs.Clear; +{$IFDEF VER3} + while FieldCount > 0 do + Fields[0].Free; +{$ELSE} + Fields.Clear; +{$ENDIF} +end; + +procedure TVirtualTable.Clear; +begin + if State in [dsInsert,dsEdit] then + Cancel; + Data.Close; + if Active then begin + Data.Open; + Resync([]); + end; +end; + +{ Stream/File } + +{ Storage format: + Version 2 // 0 = 2.00, 1 = 2.10, 2 = 5.10.1.8 (Blob storage) +-- FieldDefs + FieldCount 2 + NameLength 2 + Name Length(Name) + DataType 2 + Size 2 + +-- Fields + FieldCount 2 -| + NameLength 2 | + Name Length(Name) | for 1 + Kind 2 | + DataType 2 | + Size 2 -| + + RecordCount 4 + Size 2 (4 from Version = 2) + Value Size +} + +function XMLDecode(const AStr: String): String; +var + sb: StringBuilder; +begin + sb := StringBuilder.Create(AStr, Length(AStr)); + try + sb.Replace(''', ''''); + sb.Replace('"', '"'); + sb.Replace('<', '<'); + sb.Replace('>', '>'); + sb.Replace('&', '&'); + Result := sb.ToString; + finally + sb.Free; + end; +end; + +type +{$IFDEF VER6P} + TStringListQ = class(TStringList) + protected + function CompareStrings(const S1, S2: string): Integer; override; + end; + +function TStringListQ.CompareStrings(const S1, S2: string): Integer; // +10% to performance +begin + if S1 > S2 then + Result := 1 + else + if S1 < S2 then + Result := -1 + else + Result := 0; +end; +{$ELSE} + TStringListQ = TStringList; +{$ENDIF} + +procedure TVirtualTable.LoadFromStream(Stream: TStream; LoadFields: boolean); +var + LocFieldDefs: TFieldDefs; + FieldAliases: TStringList; + StrReader: StringReader; + Reader: XMLTextReader; + StreamXML: string; + Version: word; + + procedure ReadArray(var A: TBytes; Count: integer; const Offset: integer = 0); + begin + {$IFDEF CLR} + if (Count <> 0) and (Stream.Read(A, Offset, Count) <> Count) then + raise EReadError.Create(SReadError); + {$ELSE} + Stream.ReadBuffer(A[Offset], Count); + {$ENDIF} + end; + + function DetectFileFormat: TCRFileFormat; + var + Signature: TBytes; + Offset: integer; + {$IFDEF CLR} + Bytes: TBytes; + {$ENDIF} + begin + Result := ffVTD; + Stream.Position := 0; + SetLength(Signature, 5); + ReadArray(Signature, 5); + Stream.Position := 0; + + if (Signature[0] = $EF) and (Signature[1] = $BB) and (Signature[2] = $BF) then begin // UTF8 preamble + Stream.Position := 3; + ReadArray(Signature, 5); + end; + + if Signature[0] <> Byte('<') then + Exit; + if Signature[1] = Byte('?') then + Offset := 1 + else + Offset := 0; + if + ((Signature[1 + Offset] <> Byte('x')) and (Signature[1 + Offset] <> Byte('X'))) or + ((Signature[2 + Offset] <> Byte('m')) and (Signature[2 + Offset] <> Byte('M'))) or + ((Signature[3 + Offset] <> Byte('l')) and (Signature[3 + Offset] <> Byte('L'))) + then + Exit; + + Result := ffXML; + StreamXML := ''; + SetLength(StreamXML, Stream.Size); + {$IFDEF CLR} + Bytes := Encoding.Default.GetBytes(StreamXML); + Stream.Read(Bytes, Length(StreamXML)); + StreamXML := Encoding.Default.GetString(Bytes); + {$ELSE} + Stream.Read(StreamXML[1], Length(StreamXML)); + {$ENDIF} + end; + + procedure ReadFieldDefsVTD; + var + FieldCount: word; + i: integer; + D2: word; + FieldName: TBytes; + FieldType: word; + FieldSize: word; + FieldPrecision: integer; + FieldDef: TFieldDef; + begin + Stream.Read(FieldCount, 2); + for i := 0 to FieldCount - 1 do begin + Stream.Read(D2, 2); + SetLength(FieldName, D2); + ReadArray(FieldName, D2); + Stream.Read(FieldType, 2); + Stream.Read(FieldSize, 2); + + if Version >= 3 then + Stream.Read(FieldPrecision, 4); + + LocFieldDefs.Add(Encoding.Default.GetString(FieldName), TFieldType(FieldType), FieldSize, False); + FieldDef := LocFieldDefs.Items[LocFieldDefs.Count - 1]; + + if TFieldType(FieldType) in [ftCurrency, ftFloat, ftInteger, ftSmallInt, ftLargeInt, ftDate, ftTime, ftDateTime] then + FieldDef.Precision := FieldPrecision; + end; + end; + + procedure ReadFieldDefsXML; + function FieldTypeFromXML(FieldType: string; FieldDBType: string; + const IsLong: boolean; const FixedLength: boolean): TFieldType; + var + InternalType: Word; + begin + FieldType := LowerCase(FieldType); + FieldDBType := LowerCase(FieldDBType); + + if (FieldType = 'i8') and (FieldDBType = '') {and FixedLength} then + InternalType := dtInt64 + else + if (FieldType = 'bin.hex') and (FieldDBType = '') then + if IsLong then + InternalType := dtBlob + else + InternalType := dtBytes + else + if (FieldType = 'boolean') and (FieldDBType = '') {and FixedLength} then + InternalType := dtBoolean + else + if (FieldType = 'string') and (FieldDBType = 'variant') then + {$IFDEF VER5P} + InternalType := dtVariant + {$ELSE} + InternalType := dtString + {$ENDIF} + else + if (FieldType = 'string') and (FieldDBType = '') then + if IsLong then + InternalType := {$IFDEF VER10P}dtWideMemo{$ELSE}dtMemo{$ENDIF} + else + InternalType := dtWideString + else + if (FieldType = 'string') and ((FieldDBType = 'str') or (FieldDBType = 'string')) then + if IsLong then + InternalType := dtMemo + else + InternalType := dtString + else + if (FieldType = 'i8') and (FieldDBType = 'currency') {and FixedLength} then + InternalType := dtCurrency + else + if (FieldType = 'number') and (FieldDBType = 'currency') {and FixedLength} then + InternalType := dtCurrency + else + if (FieldType = 'datetime') and (FieldDBType = 'variantdate') {and FixedLength} then + InternalType := dtDateTime + else + if (FieldType = 'date') and (FieldDBType = '') {and FixedLength} then + InternalType := dtDate + else + if (FieldType = 'time') and (FieldDBType = '') {and FixedLength} then + InternalType := dtTime + else + if (FieldType = 'datetime') and (FieldDBType = 'timestamp') {and FixedLength} then + InternalType := dtDateTime + else + if (FieldType = 'number') and (FieldDBType = 'decimal') {and FixedLength} then + InternalType := dtCurrency + else + if (FieldType = 'float') and (FieldDBType = '') {and FixedLength} then + InternalType := dtFloat + else + if (FieldType = 'uuid') and (FieldDBType = '') and FixedLength then + {$IFDEF VER5P} + InternalType := dtGuid + {$ELSE} + InternalType := dtString + {$ENDIF} + else + if (FieldType = 'int') and (FieldDBType = '') {and FixedLength} then + InternalType := dtInt32 + else + if (FieldType = 'number') and (FieldDBType = 'numeric') {and FixedLength} then + {$IFDEF VER6P} + InternalType := dtFmtBCD + {$ELSE} + InternalType := dtBCD + {$ENDIF} + else + if (FieldType = 'r4') and (FieldDBType = '') {and FixedLength} then + InternalType := dtFloat + else + if (FieldType = 'i2') and (FieldDBType = '') {and FixedLength} then + InternalType := dtInt16 + else + if (FieldType = 'i1') and (FieldDBType = '') {and FixedLength} then + InternalType := dtInt8 + else + if (FieldType = 'ui8') and (FieldDBType = '') {and FixedLength} then + InternalType := dtInt64 + else + if (FieldType = 'ui4') and (FieldDBType = '') {and FixedLength} then + InternalType := dtUInt32 + else + if (FieldType = 'ui2') and (FieldDBType = '') {and FixedLength} then + InternalType := dtWord + else + if (FieldType = 'ui1') and (FieldDBType = '') {and FixedLength} then + InternalType := dtWord + else begin + DatabaseError(SDataTypeNotSupported, Self); + InternalType := 0; // to prevent compiler warning + end; + Result := GetFieldType(InternalType); + end; + + var + i: integer; + AttrName, AttrValue: string; + AttributeCount: integer; + FieldDef: TFieldDef; + FieldName: string; + FieldAlias: string; + FieldDataType: TFieldType; + FieldSize: integer; + FieldPrecision: integer; + FieldScale: integer; + FieldRequired: boolean; + FieldFixed: boolean; + FieldType, FieldDBType: string; + FieldIsLong: boolean; + HaveLength: boolean; + TmpValue: string; + begin + while Reader.Read do begin + if (UpperCase(Reader.Name) = 'S:SCHEMA') and (Reader.NodeType = ntEndElement) then + break; + if (UpperCase(Reader.Name) = 'S:ATTRIBUTETYPE') and (Reader.NodeType <> ntEndElement) then begin + AttributeCount := Reader.AttributeCount; + for i := 0 to AttributeCount - 1 do begin + Reader.MoveToAttribute(i); + if LowerCase(Reader.Name) = 'name' then + FieldName := Reader.Value; + if LowerCase(Reader.Name) = 'rs:name' then begin + FieldAlias := Reader.Value; + {$IFDEF CLR} + FieldAlias := XMLDecode(FieldAlias); + {$ENDIF} + end; + end; + if FieldAlias <> '' then begin + TmpValue := FieldName; + FieldName := FieldAlias; + FieldAlias := TmpValue; + FieldAliases.Add(FieldName + '=' + FieldAlias); + end; + while not ((UpperCase(Reader.Name) = 'S:DATATYPE') and (Reader.NodeType <> ntEndElement)) do begin + Reader.Read; + if Reader.EOF then + raise Exception.Create(SInvalidXML); + end; + FieldSize := 0; + FieldPrecision := 0; + FieldScale := 0; + FieldType := ''; + FieldDBType := ''; + FieldIsLong := False; + FieldRequired := False; + FieldFixed := False; + HaveLength := False; + AttributeCount := Reader.AttributeCount; + for i := 0 to AttributeCount - 1 do begin + Reader.MoveToAttribute(i); + AttrName := LowerCase(Reader.Name); + AttrValue := LowerCase(Reader.Value); + + if AttrName = 'rs:fixedlength' then + FieldFixed := StrToBool(AttrValue) + else + if AttrName = 'rs:maybenull' then + FieldRequired := not StrToBool(AttrValue) + else + if AttrName = 'dt:maxlength' then begin + FieldSize := Integer(Round(StrToFloat(AttrValue)) and $7FFFFFFF); + HaveLength := True; + end + else + if AttrName = 'rs:precision' then + FieldPrecision := StrToInt(AttrValue) + else + if AttrName = 'rs:scale' then + FieldScale := StrToInt(AttrValue) + else + if AttrName = 'dt:type' then + FieldType := AttrValue + else + if AttrName = 'rs:dbtype' then + FieldDBType := AttrValue + else + if AttrName = 'rs:long' then + FieldIsLong := StrToBool(AttrValue); + end; + + if (FieldType = '') and (FieldDBType = '') then + raise Exception.Create(SInvalidXML); + + if (not HaveLength) and (FieldDBType = '') then + FieldDBType := 'variant'; + FieldDataType := FieldTypeFromXML(FieldType, FieldDBType, FieldIsLong, FieldFixed); + + if not (FieldDataType in [ftString, ftWideString, ftVariant, ftGuid, ftBcd{$IFDEF VER6P}, ftFmtBcd{$ENDIF}, + ftBytes, ftVarBytes, ftBlob, ftMemo, ftFixedChar{$IFDEF VER6P}, ftTimeStamp{$ENDIF}{$IFDEF VER10P}, ftWideMemo{$ENDIF}]) then + FieldSize := 0; + + if FieldIsLong then + FieldSize := 0; + + if FieldDataType = ftGuid then + FieldSize := 38; + + if (FieldDataType = ftBytes) and not FieldFixed then + FieldDataType := ftVarBytes; + + LocFieldDefs.Add(FieldName, FieldDataType, FieldSize, FieldRequired); + FieldDef := LocFieldDefs.Items[LocFieldDefs.Count - 1]; + + if FieldDataType in [ftCurrency, ftFloat, ftInteger, ftSmallInt, ftLargeInt, ftDate, ftTime, ftDateTime] then + FieldDef.Precision := FieldPrecision + else + if FieldDataType in [ftBCD{$IFDEF VER6P}, ftFMTBCD{$ENDIF}] then begin + FieldDef.Precision := FieldPrecision; + FieldDef.Size := FieldScale; + end; + + {$IFDEF VER5P} + if FieldFixed then + FieldDef.Attributes := FieldDef.Attributes + [DB.faFixed]; + {$ENDIF} + end; + end; + end; + + procedure SetXMLValueToField(Field: TField; const FieldValue: string); + var + Year: integer; + Month: Word; + Day: Word; + Hour: Word; + Minute: Word; + Second: Word; + + function GetNext(const Value: string; Offset: integer; Digits: Integer): string; + var + i: Integer; + begin + SetLength(Result, Digits); + for i := 1 to Digits do begin + if (Value[Offset + i] >= '0') and (Value[Offset + i] <= '9') then + Result[i] := Value[Offset + i] + else + raise Exception.Create(SInvalidXML); + end; + end; + + procedure ConvertDate(const Value: string); + var + Offset: integer; + begin + Offset := 0; + if Value[1] = '-' then + Inc(Offset); + Year := StrToInt(GetNext(Value, Offset, 4)); + Inc(Offset, 5); + Month := StrToInt(GetNext(Value, Offset, 2)); + Inc(Offset, 3); + Day := StrToInt(GetNext(Value, Offset, 2)); + end; + + procedure ConvertTime(const Value: string); + var + Offset: integer; + begin + if Length(Value) < 8 then + raise Exception.Create(SInvalidXML); + Offset := 0; + Hour := StrToInt(GetNext(Value, Offset, 2)); + Inc(Offset, 3); + Minute := StrToInt(GetNext(Value, Offset, 2)); + Inc(Offset, 3); + Second := StrToInt(GetNext(Value, Offset, 2)); + end; + + function DecodeXMLDateTime(const XMLDateTime: string): TDateTime; + var + TimePosition: integer; + begin + TimePosition := Pos('T', XMLDateTime); + if TimePosition > 0 then begin + ConvertDate(Copy(XMLDateTime, 1, TimePosition -1)); + ConvertTime(Copy(XMLDateTime, TimePosition + 1, Length(XMLDateTime) - TimePosition)); + end else begin + Hour := 0; + Minute := 0; + Second := 0; + ConvertDate(XMLDateTime); + end; + Result := {$IFNDEF CLR}MemUtils.{$ENDIF}EncodeDateTime(Year, Month, Day, Hour, Minute, Second, 0); + end; + + function DecodeXMLTime(const XMLTime: string): TDateTime; + begin + Year := 1000; + Month := 1; + Day := 1; + ConvertTime(XMLTime); + Result := {$IFNDEF CLR}MemUtils.{$ENDIF}EncodeDateTime(Year, Month, Day, Hour, Minute, Second, 0); + end; + + var + FieldDesc: TFieldDesc; + {$IFDEF VER6P} + Bcd: TBCD; + TmpBcd: TBCD; + FieldLength, FieldScale: integer; + {$IFDEF VER9P} + Delta: word; + {$ENDIF} + {$ENDIF} + Buffer: TBytes; + i: Integer; + IsValidChar: boolean; + TextOffset, BuffOffset, Count: integer; + {$IFDEF CLR} + TextBytes: TBytes; + {$ENDIF} + begin + FieldDesc := GetFieldDesc(Field); + case FieldDesc.DataType of + dtBoolean: + Field.AsBoolean := StrToBool(FieldValue); + dtInt8, dtInt16, dtInt32, dtInt64, dtUInt16, dtUInt32: + Field.AsString := FieldValue; + dtFloat: + Field.AsFloat := StrToFloat(ChangeDecimalSeparator(FieldValue, '.', DecimalSeparator)); + dtDate, dtDateTime: + Field.AsDateTime := DecodeXMLDateTime(FieldValue); + dtTime: + Field.AsDateTime := DecodeXMLTime(FieldValue); + dtCurrency, dtBcd: + Field.AsCurrency := StrToCurr(ChangeDecimalSeparator(FieldValue, '.', DecimalSeparator)); + {$IFDEF VER6P} + dtFmtBCD: begin + BCD := StrToBCD(ChangeDecimalSeparator(FieldValue, '.', DecimalSeparator)); + FieldLength := FieldDesc.Length; + FieldScale := FieldDesc.Scale; + {$IFDEF VER9P} // Delphi 9 NormalizeBcd Bug + Delta := FieldLength - FieldScale; + if Delta > 34 then begin + Delta := 34; + FieldLength := FieldScale + Delta; + end; + {$ENDIF} + NormalizeBcd(Bcd, TmpBcd, FieldLength, FieldScale); + Field.AsBCD := TmpBcd; + end; + {$ENDIF} + dtBlob, dtBytes, dtVarBytes, dtExtVarBytes: begin + {$IFDEF CLR} + TextBytes := Encoding.Default.GetBytes(FieldValue); + {$ENDIF} + TextOffset := 0; + BuffOffset := 0; + SetLength(Buffer, Length(FieldValue) div 2); + for i := 1 to Length(FieldValue) do begin + IsValidChar := not ((FieldValue[i] = #$D) or (FieldValue[i] = #$A) or (FieldValue[i] = #9)); + if ((not IsValidChar) or (i = Length(FieldValue))) then begin + Count := i - TextOffset; + if not IsValidChar then + Dec(Count); + if Count > 0 then begin + {$IFNDEF CLR} + HexToBin(PChar(Integer(@FieldValue[1]) + TextOffset), PChar(Integer(@Buffer[0]) + BuffOffset), Count); + {$ELSE} + HexToBin(TextBytes, TextOffset, Buffer, BuffOffset, Count div 2); + {$ENDIF} + Inc(BuffOffset, Count div 2); + end; + TextOffset := i; + end; + end; + if Length(Buffer) > BuffOffset then + SetLength(Buffer, BuffOffset); + Field.AsString := Encoding.Default.GetString(Buffer); + end; + else + Field.AsString := FieldValue; + end; + end; + + procedure ProcessXMLData; + var + AttributeCount: integer; + p, i, j: integer; + Field: TField; + FieldList: TStringList; + FieldIndex: integer; + ActualName, Alias: string; + begin + FieldList := TStringListQ.Create; + try + {$IFDEF VER6P} + FieldList.CaseSensitive := True; + {$ENDIF} + FieldList.Sorted := True; + while Reader.Read do + if (UpperCase(Reader.Name) = 'Z:ROW') and (Reader.NodeType <> ntEndElement) then begin + Append; + try + AttributeCount := Reader.AttributeCount; + for i := 0 to AttributeCount - 1 do begin + Reader.MoveToAttribute(i); + FieldIndex := FieldList.IndexOf(Reader.Name); + if FieldIndex > -1 then + Field := FieldList.Objects[FieldIndex] as TField + else begin + Field := FindField(Reader.Name); + FieldList.AddObject(Reader.Name, Field); + if Field = nil then + for j := 0 to FieldAliases.Count - 1 do begin + p := Pos('=', FieldAliases[j]); + if p > 0 then begin + ActualName := LowerCase(Copy(FieldAliases[j], 0, p - 1)); + Alias := Copy(FieldAliases[j], p + 1, Length(FieldAliases[j]) - p); + if Reader.Name = Alias then begin + Field := FindField(ActualName); + if Field <> nil then + break; + end; + end; + end; + end; + if Field = nil then + raise Exception.Create(SInvalidXML); + SetXMLValueToField(Field, UTF8Decode(Reader.Value)); + end; + Post; + finally + Cancel; + end; + end; + finally + FieldList.Free; + end; + end; + +var + D2: word; + D4: cardinal; + FieldName: TBytes; + FieldType: word; + FieldSize: word; + FieldKind: word; + RecordCount: integer; + i, j: integer; + OldActive: boolean; + St: TBytes; + WSt: TBytes; + FieldClass: TFieldClass; + Field: TField; + FieldArr: Array of TField; + Handle: IntPtr; + + FileFormat: TCRFileFormat; + +begin + Inc(FAvoidReload); + try + OldActive := Active; + Close; + Clear; + if LoadFields then begin + LocFieldDefs := FieldDefs; + DeleteFields; + end + else + LocFieldDefs := TFieldDefs.Create(Self); + + Stream.Seek(0, soFromBeginning); + FileFormat := DetectFileFormat; + + Stream.Seek(0, soFromBeginning); + Stream.Read(Version, 2); // Version + + StrReader := nil; + Reader := nil; + + FieldAliases := nil; + try + // FieldDefs + FAvoidRefreshData := True; + try + case FileFormat of + ffVTD: + ReadFieldDefsVTD; + ffXML: begin + FieldAliases := TStringList.Create; + StrReader := StringReader.Create(StreamXML); + Reader := XMLTextReader.Create(StrReader); + ReadFieldDefsXML; + end; + end; + finally + FAvoidRefreshData := False; + end; + + with Stream do begin + if (FileFormat = ffVTD) and (Version >= 1) then begin + // Fields + Read(D2, 2); + for i := 0 to D2 - 1 do begin + Read(D2, 2); + SetLength(FieldName, D2); + ReadArray(FieldName, D2); + Read(FieldKind, 2); + Read(FieldType, 2); + Read(FieldSize, 2); + + if TFieldKind(FieldKind) = fkLookup then continue; + FieldClass := GetFieldClass(TFieldType(FieldType)); + + Field := FieldClass.Create(Self.Owner);// Self); + try + Field.FieldName := Encoding.Default.GetString(FieldName); + Field.FieldKind := TFieldKind(FieldKind); + case TFieldType(FieldType) of + ftString: + Field.Size := FieldSize; + ftWideString: + Field.Size := FieldSize * sizeof(WideChar); + end; + Field.DataSet := Self; + except + Field.Free; + raise; + end; + end; + end; + if FileFormat = ffVTD then + Read(RecordCount, 4); + + if (FileFormat = ffXML) or ((FileFormat = ffVTD) and (RecordCount > 0)) then begin + DisableControls; + if not (csReading in ComponentState) then + Open + else begin + DoBeforeOpen; + try + OpenCursor(False); + SetState(dsBrowse) + except + SetState(dsInactive); + CloseCursor; + raise; + end; + DoAfterOpen; + DoAfterScroll; + end; + + try + case FileFormat of + ffXML: + ProcessXMLData; + ffVTD: begin + SetLength(FieldArr, LocFieldDefs.Count); + for i := 0 to LocFieldDefs.Count - 1 do + FieldArr[i] := FindField(LocFieldDefs[i].Name); + + for j := 0 to RecordCount - 1 do begin + Append; + try + for i := 0 to LocFieldDefs.Count - 1 do begin + Field := FieldArr[i]; + + if Version < 2 then begin + Read(D2, 2); + D4 := D2; + end + else + Read(D4, 4); + + if D4 > 0 then begin + if (Field <> nil) and (Field.DataType = ftWideString) then begin + SetLength(WSt, D4); + ReadArray(WSt, D4); + TWideStringField(Field).Value := + Encoding.Unicode.{$IFDEF CLR}GetString{$ELSE}GetWideString{$ENDIF}(WSt); + end + else + begin + if (Field <> nil) and (Field.DataType = ftVarBytes) then begin + SetLength(St, D4 + 2); + D2 := D4; + St[0] := Lo(D2); + St[1] := Hi(D2); + ReadArray(St, D4, 2); + end + else begin + SetLength(St, D4); + ReadArray(St, D4); + end; + + if Field <> nil then + case Field.DataType of + ftString, ftBlob, ftMemo: + Field.AsString := Encoding.Default.GetString(St); + {$IFDEF VER10P} + ftWideMemo: + TWideMemoField(Field).Value := Encoding.Unicode.{$IFDEF CLR}GetString{$ELSE}GetWideString{$ENDIF}(St); + {$ENDIF} + else + Handle := AllocGCHandle(St, True); + try + Field.SetData(GetAddrOfPinnedObject(Handle)); + finally + FreeGCHandle(Handle); + end; + end; + end; + end; + end; + finally + Post; + end; + end; + end; + else + Assert(False); + end; + finally + First; + EnableControls; + end; + + if not OldActive and (voPersistentData in FOptions) then + if csReading in ComponentState then begin + SetState(dsInactive); + CloseCursor; + end + else + Close; + end + else + Active := OldActive; + end; + + finally + if LocFieldDefs <> FieldDefs then + LocFieldDefs.Free; + FieldAliases.Free; + Reader.Free; + StrReader.Free; + end; + finally + Dec(FAvoidReload); + end; +end; + +{$IFDEF CLR} +function StrLen(S: IntPtr): integer; +begin + Result := 0; + while Marshal.ReadByte(S, Result) <> 0 do + Inc(Result); +end; + +function StrLenW(S: IntPtr): integer; +begin + Result := 0; + while Marshal.ReadInt16(S, Result * 2) <> 0 do + Inc(Result); +end; +{$ENDIF} + +procedure TVirtualTable.SaveToStream(Stream: TStream; StoreFields: boolean); +var + D2: word; + D4: cardinal; + St: {$IFDEF CLR}TBytes{$ELSE}string{$ENDIF}; + i: integer; + OldRecNo: integer; + OldActive: boolean; + TempFields: TFields; + Field: TField; + FieldDesc: TFieldDesc; + FieldArr: array of TField; + FieldDescArr: array of TFieldDesc; + Buffer: TBytes; + pBuffer: IntPtr; + RecBuf: TRecordBuffer; + IsNull: boolean; + Piece: PPieceHeader; + BufLen: cardinal; + Blob: TBlob; + BlobBuffer: TBytes; + Handle: IntPtr; + + procedure AssignFields(Dest: TFields; Source: TFields); + var + Field:TField; + begin + Dest.Clear; + while Source.Count > 0 do begin + Field := Source[0]; + Source.Remove(Field); + Dest.Add(Field); + end; + end; + + procedure WriteArray(const A: TBytes; Count: integer; const Offset: integer = 0); + begin + {$IFDEF CLR} + if (Count <> 0) and (Stream.Write(A, Offset, Count) <> Count) then + raise EWriteError.Create(SWriteError); + {$ELSE} + Stream.WriteBuffer(A[Offset], Count); + {$ENDIF} + end; + +var + Offset: integer; + +begin + Inc(FAvoidReload); + try + OldActive := Active; + with Stream do begin + D2 := 3; + Write(D2, 2); // Version 0 - 2.00 1 - 2.10 + + // FieldDefs + D2 := FieldDefs.Count; + Write(D2, 2); + for i := 0 to FieldDefs.Count - 1 do begin + D2 := Length(FieldDefs[i].Name); + Write(D2, 2); + {$IFDEF CLR} + St := Encoding.Default.GetBytes(FieldDefs[i].Name); + WriteArray(St, D2); + {$ELSE} + St := FieldDefs[i].Name; + Write(PChar(St)^, Length(St)); + {$ENDIF} + D2 := Word(FieldDefs[i].DataType); + Write(D2, 2); + D2 := FieldDefs[i].Size; + Write(D2, 2); + D4 := FieldDefs[i].Precision; + Write(D4, 4); + end; + + // Fields + if DefaultFields or not StoreFields then begin + D2 := 0; + Write(D2, 2); + end + else begin + D2 := FieldCount; + for i := 0 to FieldCount - 1 do + if Fields[i].FieldKind = fkLookup then Dec(D2); + Write(D2, 2); + for i := 0 to FieldCount - 1 do begin + if Fields[i].FieldKind = fkLookup then continue; + D2 := Length(Fields[i].FieldName); + Write(D2, 2); + {$IFDEF CLR} + St := Encoding.Default.GetBytes(Fields[i].FieldName); + WriteArray(St, D2); + {$ELSE} + St := Fields[i].FieldName; + Write(PChar(St)^, Length(St)); + {$ENDIF} + D2 := Word(Fields[i].FieldKind); // for ver 1 + Write(D2, 2); + D2 := Word(Fields[i].DataType); + Write(D2, 2); + D2 := Fields[i].Size; + Write(D2, 2); + end; + end; + + if FieldDefs.Count = 0 then begin + D4 := 0; + Write(D4, 4); + end + else begin + DisableControls; + if Active then + OldRecNo := RecNo + else + OldRecNo := -1; + + if not DefaultFields then begin + Close; + TempFields := TFields.Create(nil); + AssignFields(TempFields, Fields); + Fields.Clear; + end + else + TempFields := nil; + + Open; + First; + + BufLen := 0; + SetLength(FieldArr, FieldDefs.Count); + SetLength(FieldDescArr, FieldDefs.Count); + for i := 0 to FieldDefs.Count - 1 do begin + FieldArr[i] := FindField(FieldDefs[i].Name); + FieldDescArr[i] := Data.FindField(FieldDefs[i].Name); + if (FieldDescArr[i] <> nil) and (FieldDescArr[i].Size > BufLen) then + BufLen := FieldDescArr[i].Size; + end; + + SetLength(Buffer, BufLen); + Handle := AllocGCHandle(Buffer, True); + pBuffer := GetAddrOfPinnedObject(Handle); + + try + D4 := RecordCount; + Write(D4, 4); + + while not EOF do begin + for i := 0 to FieldDefs.Count - 1 do begin + Field := FieldArr[i]; + FieldDesc := FieldDescArr[i]; + + // get field desc and data from record buffer + if FieldDesc <> nil then begin + GetActiveRecBuf(RecBuf); + if FieldDesc.DataType = dtVariant then + FillChar(pBuffer, Length(Buffer), 0); + Data.GetField(FieldDesc.FieldNo, RecBuf, pBuffer, IsNull); + end + else + IsNull := True; + + Blob := nil; + Offset := 0; + if (Field = nil) or (FieldDesc = nil) or IsNull then + D4 := 0 + else begin + // to write field data there must be Field and FieldDesc + case FieldDesc.DataType of + dtString: + D4 := StrLen(pBuffer); + dtWideString: + D4 := StrLenW(pBuffer) * sizeof(WideChar); + dtInt8, dtInt16, dtInt32, dtInt64, dtUInt16, dtUInt32, + dtBoolean, dtCurrency, dtFloat, dtGuid, dtBytes: + D4 := FieldDesc.Size; + dtDateTime, dtDate, dtTime: + D4 := sizeof(TDateTime); + dtBlob, dtMemo{$IFDEF VER10P}, dtWideMemo{$ENDIF}: begin + Blob := TBlob(GetGCHandleTarget(Marshal.ReadIntPtr(pBuffer))); + D4 := Blob.Size; + end; + dtVarBytes: begin + D4 := Marshal.ReadInt16(pBuffer); + Offset := 2; + end; + {$IFDEF VER6P} + dtFMTBCD: + D4 := SizeOfTBcd; + {$ENDIF} + else + Assert(False, SUnknownDataType + ' FieldDesc.DataType=' + IntToStr(Integer(FieldDesc.DataType))); + end; + end; + Write(D4, 4); + if D4 > 0 then begin + if FieldDesc.DataType in [dtBlob, dtMemo{$IFDEF VER10P}, dtWideMemo{$ENDIF}] then begin + // save blob to stream + Piece := Blob.FirstPiece; + + while IntPtr(Piece) <> nil do begin + BufLen := Piece.Used; + + SetLength(BlobBuffer, BufLen); + Marshal.Copy(IntPtr(integer(Piece) + Sizeof(TPieceHeader)), BlobBuffer, 0, BufLen); + WriteArray(BlobBuffer, BufLen); + + Piece := Piece.Next; + end; + end + else + WriteArray(Buffer, D4, Offset); + end; + end; + Next; + end; + finally + FreeGCHandle(Handle); + if TempFields <> nil then begin + Close; + AssignFields(Fields, TempFields); + TempFields.Free; + end; + + Active := OldActive; + if OldActive and (RecordCount > 0) then + RecNo := OldRecNo; + EnableControls; + end; + end; + end; + finally + Dec(FAvoidReload); + end; +end; + +{$IFNDEF D3_CB3} +function TVirtualTable.IsFieldDefsStored: boolean; +begin + Result := FieldDefs.Count > 0; +end; +{$ENDIF} + +procedure TVirtualTable.LoadFromFile(const FileName: string); +var + Stream: TStream; +begin + Stream := TFileStream.Create(FileName, fmOpenRead); + try + LoadFromStream(Stream); + finally + Stream.Free; + end; +end; + +procedure TVirtualTable.SaveToFile(const FileName: string); +var + Stream:TStream; +begin + Stream := TFileStream.Create(FileName, fmCreate); + try + SaveToStream(Stream); + finally + Stream.Free; + end; +end; + +procedure TVirtualTable.SetActive(Value: boolean); +begin + if (csReading in ComponentState) then begin + if not FStreamedActive then + FStreamedActive := Value + end + else + inherited; +end; + +function TVirtualTable.GetFieldDefs: TFieldDefs; +begin + Result := inherited FieldDefs; +end; + +procedure TVirtualTable.SetFieldDefs(Value: TFieldDefs); +begin + inherited FieldDefs := Value; +end; + +initialization + VTOldBehavior := False; + +end. diff --git a/internal/4.10.0.10/1/Source/Win32Timer.pas b/internal/4.10.0.10/1/Source/Win32Timer.pas new file mode 100644 index 0000000..e47fe79 --- /dev/null +++ b/internal/4.10.0.10/1/Source/Win32Timer.pas @@ -0,0 +1,164 @@ + +////////////////////////////////////////////////// +// DB Access Components +// Copyright © 1998-2007 Core Lab. All right reserved. +// SQLMonitor supports +// Created: 17.11.99 +////////////////////////////////////////////////// + +{$IFNDEF CLR} + +{$I Dac.inc} + +unit Win32Timer; +{$ENDIF} + +interface + +uses +{$IFDEF LINUX} + QExtCtrls; +{$ENDIF} +{$IFDEF CLR} + ExtCtrls; +{$ENDIF} +{$IFDEF WIN32} + Classes, Windows, Messages, MemData, DAConsts; +{$ENDIF} + +type +{$IFDEF WIN32} + + TWin32Timer = class(TComponent) + private + FInterval: Cardinal; + FWindowHandle: HWND; + FOnTimer: TNotifyEvent; + FEnabled: Boolean; + procedure UpdateTimer; + procedure SetEnabled(Value: Boolean); + procedure SetInterval(Value: Cardinal); + procedure SetOnTimer(Value: TNotifyEvent); + protected + procedure Timer; dynamic; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + published + property Enabled: Boolean read FEnabled write SetEnabled default True; + property Interval: Cardinal read FInterval write SetInterval default 1000; + property OnTimer: TNotifyEvent read FOnTimer write SetOnTimer; + end; +{$ELSE} + TWin32Timer = TTimer; +{$ENDIF} + + +implementation + +{$IFDEF WIN32} +function TimerWndProc(Window: HWND; Message, WParam: Longint; + LParam: Longint): Longint; stdcall; +var + Timer: TWin32Timer; +begin + Result := 1; + Timer := TWin32Timer(GetWindowLong(Window, GWL_USERDATA)); + if Message = WM_TIMER then + try + Timer.Timer; + except + ApplicationHandleException(Timer); + end + else + Result := DefWindowProc(Window, Message, WParam, LParam); +end; + +var + AlerterWindowClass: TWndClass = ( + style: 0; + lpfnWndProc: @TimerWndProc; + cbClsExtra: 0; + cbWndExtra: 0; + hInstance: 0; + hIcon: 0; + hCursor: 0; + hbrBackground: 0; + lpszMenuName: nil; + lpszClassName: 'TOraAlerterWindow'); + +{ TWin32Timer } + +constructor TWin32Timer.Create(AOwner: TComponent); +var + TempClass: TWndClass; + ClassRegistered: Boolean; +begin + inherited Create(AOwner); + FEnabled := True; + FInterval := 1000; + + // allocate timer window + AlerterWindowClass.hInstance := HInstance; + ClassRegistered := GetClassInfo(HInstance, AlerterWindowClass.lpszClassName, + TempClass); + if not ClassRegistered or (TempClass.lpfnWndProc <> @TimerWndProc) then + begin + if ClassRegistered then + Windows.UnregisterClass(AlerterWindowClass.lpszClassName, HInstance); + Windows.RegisterClass(AlerterWindowClass); + end; + FWindowHandle := CreateWindowEx(WS_EX_TOOLWINDOW, AlerterWindowClass.lpszClassName, + '', WS_POPUP {!0}, 0, 0, 0, 0, 0, 0, HInstance, nil); + + // pass Self to window + SetWindowLong(FWindowHandle, GWL_USERDATA, Longint(Self)); +end; + +destructor TWin32Timer.Destroy; +begin + FEnabled := False; + UpdateTimer; + DestroyWindow(FWindowHandle); + inherited Destroy; +end; + +procedure TWin32Timer.UpdateTimer; +begin + KillTimer(FWindowHandle, 1); + if (FInterval <> 0) and FEnabled and Assigned(FOnTimer) then + if SetTimer(FWindowHandle, 1, FInterval, nil) = 0 then + raise EOutOfResources.Create(SNoTimers); +end; + +procedure TWin32Timer.SetEnabled(Value: Boolean); +begin + if Value <> FEnabled then + begin + FEnabled := Value; + UpdateTimer; + end; +end; + +procedure TWin32Timer.SetInterval(Value: Cardinal); +begin + if Value <> FInterval then + begin + FInterval := Value; + UpdateTimer; + end; +end; + +procedure TWin32Timer.SetOnTimer(Value: TNotifyEvent); +begin + FOnTimer := Value; + UpdateTimer; +end; + +procedure TWin32Timer.Timer; +begin + if Assigned(FOnTimer) then FOnTimer(Self); +end; +{$ENDIF} + +end. diff --git a/internal/4.10.0.10/1/Source/dac.bmk b/internal/4.10.0.10/1/Source/dac.bmk new file mode 100644 index 0000000..21780df --- /dev/null +++ b/internal/4.10.0.10/1/Source/dac.bmk @@ -0,0 +1,216 @@ +# +# This is modified default.bmk +# +# added -I$(INCLUDEPATH) for .pas +# + +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = %VERSION% +# --------------------------------------------------------------------------- +PROJECT = %PROJECT% +OBJFILES = %OBJFILES% +RESFILES = %RESFILES% +MAINSOURCE = %MAINSOURCE% +RESDEPEN = %RESDEPEN% +LIBFILES = %LIBFILES% +IDLFILES = %IDLFILES% +IDLGENFILES = %IDLGENFILES% +LIBRARIES = %LIBRARIES% +PACKAGES = %PACKAGES% +SPARELIBS = %SPARELIBS% +DEFFILE = %DEFFILE% +# --------------------------------------------------------------------------- +PATHCPP = %PATHCPP% +PATHASM = %PATHASM% +PATHPAS = %PATHPAS% +PATHRC = %PATHRC% +DEBUGLIBPATH = %DEBUGLIBPATH% +RELEASELIBPATH = %RELEASELIBPATH% +USERDEFINES = %USERDEFINES% +SYSDEFINES = %SYSDEFINES% +INCLUDEPATH = %INCLUDEPATH% +LIBPATH = %LIBPATH% +WARNINGS= %WARNINGS% +# --------------------------------------------------------------------------- +CFLAG1 = %CFLAG1% +IDLCFLAGS = %IDLCFLAGS% +PFLAGS = %PFLAGS% +RFLAGS = %RFLAGS% +AFLAGS = %AFLAGS% +LFLAGS = %LFLAGS% +# --------------------------------------------------------------------------- +ALLOBJ = %ALLOBJ% +ALLRES = %ALLRES% +ALLLIB = %ALLLIB% +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +!endif +%FILE:.c.cpp.cc:.obj:OBJFILES% +%TARGET%: %DEPENDENCY% + $(BCB)\BIN\$(BCC32) $(CFLAG1) %CFLAG1% %WARNOPTSTR% [-I]%INCLUDEPATH%?$(INCLUDEPATH) [-D]%USERDEFINES%?$(USERDEFINES) -D$(SYSDEFINES) -n$(@D) {$** } + +%END FILE% +%FILE:idl2cpp% +%TOOL% +!if !$d(IDL2CPP) +IDL2CPP = idl2cpp +!endif + +%END TOOL% +!if "$(USERDEFINES)" != "" +DUSERDEFINES = -D$(USERDEFINES:;= -D) +!else +DUSERDEFINES = +!endif +!if "$(SYSDEFINES)" != "" +DSYSDEFINES = -D$(SYSDEFINES:;= -D) +!else +DSYSDEFINES = +!endif +%DEPENDENTS%: %DEPENDENCY% + $(IDL2CPP) $(IDLCFLAGS) %IDLCFLAGS% %IDLROOTDIR% $(DUSERDEFINES) $(DSYSDEFINES) $? + +%END FILE% +%FILE:.asm:.obj:OBJFILES% +%TARGET%: %DEPENDENCY% + $(BCB)\BIN\$(TASM32) $(AFLAGS) %AFLAGS% [-i]%INCLUDEPATH:;= -i%?$(INCLUDEPATH:;= -i) [-d]%USERDEFINES:;= -d%?$(USERDEFINES:;= -d) -d$(SYSDEFINES:;= -d) $**, $@ + +%END FILE% +%FILE:.rc:.res:RESFILES% +%TARGET%: %DEPENDENCY% + $(BCB)\BIN\$(BRCC32) $(RFLAGS) %RFLAGS% [-i]%INCLUDEPATH%?$(INCLUDEPATH) [-d]%USERDEFINES%?$(USERDEFINES) -d$(SYSDEFINES:;= -d) -fo$@ $** + +%END FILE% + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if "$(USERDEFINES)" != "" +AUSERDEFINES = -d$(USERDEFINES:;= -d) +!else +AUSERDEFINES = +!endif + +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(CPP32) +CPP32 = cpp32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif + +%TOOLS% +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) -L$(LIBPATH) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -U$(LIBPATH) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES);$(DccDef) -O$(INCLUDEPATH) --BCB {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -U$(LIBPATH) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES);$(DccDef) -O$(INCLUDEPATH) --BCB {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES);$(DccDef) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES);$(DccDef) -n$(@D) {$< } + +.c.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES);$(DccDef) -n. {$< } + +.cpp.i: + $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES);$(DccDef) -n. {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES);$(DccDef) -fo$@ $< diff --git a/internal/4.10.0.10/1/_Images_/CoreLab.Dac.CRBatchMove.TCRBatchMove.bmp b/internal/4.10.0.10/1/_Images_/CoreLab.Dac.CRBatchMove.TCRBatchMove.bmp new file mode 100644 index 0000000..ed11210 Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/CoreLab.Dac.CRBatchMove.TCRBatchMove.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/CoreLab.Dac.CRBatchMove.TCRBatchMove16.bmp b/internal/4.10.0.10/1/_Images_/CoreLab.Dac.CRBatchMove.TCRBatchMove16.bmp new file mode 100644 index 0000000..226cc6f Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/CoreLab.Dac.CRBatchMove.TCRBatchMove16.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/CoreLab.Dac.CRBatchMove.TCRBatchMove32.bmp b/internal/4.10.0.10/1/_Images_/CoreLab.Dac.CRBatchMove.TCRBatchMove32.bmp new file mode 100644 index 0000000..8d143df Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/CoreLab.Dac.CRBatchMove.TCRBatchMove32.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/CoreLab.Dac.VirtualTable.TVirtualTable.bmp b/internal/4.10.0.10/1/_Images_/CoreLab.Dac.VirtualTable.TVirtualTable.bmp new file mode 100644 index 0000000..a13b884 Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/CoreLab.Dac.VirtualTable.TVirtualTable.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/CoreLab.Dac.VirtualTable.TVirtualTable16.bmp b/internal/4.10.0.10/1/_Images_/CoreLab.Dac.VirtualTable.TVirtualTable16.bmp new file mode 100644 index 0000000..49baee2 Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/CoreLab.Dac.VirtualTable.TVirtualTable16.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/CoreLab.Dac.VirtualTable.TVirtualTable32.bmp b/internal/4.10.0.10/1/_Images_/CoreLab.Dac.VirtualTable.TVirtualTable32.bmp new file mode 100644 index 0000000..2947512 Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/CoreLab.Dac.VirtualTable.TVirtualTable32.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.DataAdapter.MSDataAdapter.bmp b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.DataAdapter.MSDataAdapter.bmp new file mode 100644 index 0000000..5385e73 Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.DataAdapter.MSDataAdapter.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSConnection.bmp b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSConnection.bmp new file mode 100644 index 0000000..7c71aac Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSConnection.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSConnection16.bmp b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSConnection16.bmp new file mode 100644 index 0000000..82c48bd Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSConnection16.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSConnection32.bmp b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSConnection32.bmp new file mode 100644 index 0000000..1067b55 Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSConnection32.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSDataSource.bmp b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSDataSource.bmp new file mode 100644 index 0000000..869f358 Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSDataSource.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSDataSource16.bmp b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSDataSource16.bmp new file mode 100644 index 0000000..2933844 Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSDataSource16.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSDataSource32.bmp b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSDataSource32.bmp new file mode 100644 index 0000000..1c51328 Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSDataSource32.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSMetadata.bmp b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSMetadata.bmp new file mode 100644 index 0000000..459bb3f Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSMetadata.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSMetadata16.bmp b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSMetadata16.bmp new file mode 100644 index 0000000..afc459e Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSMetadata16.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSMetadata32.bmp b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSMetadata32.bmp new file mode 100644 index 0000000..d42bee7 Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSMetadata32.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSQuery.bmp b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSQuery.bmp new file mode 100644 index 0000000..548552d Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSQuery.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSQuery16.bmp b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSQuery16.bmp new file mode 100644 index 0000000..1ea161b Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSQuery16.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSQuery32.bmp b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSQuery32.bmp new file mode 100644 index 0000000..83adcfb Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSQuery32.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSSQL.bmp b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSSQL.bmp new file mode 100644 index 0000000..4c58d5d Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSSQL.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSSQL16.bmp b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSSQL16.bmp new file mode 100644 index 0000000..f3edcd7 Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSSQL16.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSSQL32.bmp b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSSQL32.bmp new file mode 100644 index 0000000..9259b69 Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSSQL32.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSStoredProc.bmp b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSStoredProc.bmp new file mode 100644 index 0000000..660f062 Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSStoredProc.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSStoredProc16.bmp b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSStoredProc16.bmp new file mode 100644 index 0000000..147386c Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSStoredProc16.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSStoredProc32.bmp b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSStoredProc32.bmp new file mode 100644 index 0000000..9b0730b Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSStoredProc32.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSTable.bmp b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSTable.bmp new file mode 100644 index 0000000..4e54b70 Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSTable.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSTable16.bmp b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSTable16.bmp new file mode 100644 index 0000000..e4946e4 Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSTable16.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSTable32.bmp b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSTable32.bmp new file mode 100644 index 0000000..553f327 Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSTable32.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSUpdateSQL.bmp b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSUpdateSQL.bmp new file mode 100644 index 0000000..2097e6d Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSUpdateSQL.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSUpdateSQL16.bmp b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSUpdateSQL16.bmp new file mode 100644 index 0000000..17e1191 Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSUpdateSQL16.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSUpdateSQL32.bmp b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSUpdateSQL32.bmp new file mode 100644 index 0000000..de7b8a3 Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSAccess.TMSUpdateSQL32.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSDump.TMSDump.bmp b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSDump.TMSDump.bmp new file mode 100644 index 0000000..8edd0ab Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSDump.TMSDump.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSDump.TMSDump16.bmp b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSDump.TMSDump16.bmp new file mode 100644 index 0000000..57c805c Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSDump.TMSDump16.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSDump.TMSDump32.bmp b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSDump.TMSDump32.bmp new file mode 100644 index 0000000..1b64aa6 Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSDump.TMSDump32.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSLoader.TMSLoader.bmp b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSLoader.TMSLoader.bmp new file mode 100644 index 0000000..5d92dea Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSLoader.TMSLoader.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSLoader.TMSLoader16.bmp b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSLoader.TMSLoader16.bmp new file mode 100644 index 0000000..3bb672b Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSLoader.TMSLoader16.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSLoader.TMSLoader32.bmp b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSLoader.TMSLoader32.bmp new file mode 100644 index 0000000..e40ca2a Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSLoader.TMSLoader32.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSSQLMonitor.TMSSQLMonitor.bmp b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSSQLMonitor.TMSSQLMonitor.bmp new file mode 100644 index 0000000..edce1aa Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSSQLMonitor.TMSSQLMonitor.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSSQLMonitor.TMSSQLMonitor16.bmp b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSSQLMonitor.TMSSQLMonitor16.bmp new file mode 100644 index 0000000..c6f0e50 Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSSQLMonitor.TMSSQLMonitor16.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSSQLMonitor.TMSSQLMonitor32.bmp b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSSQLMonitor.TMSSQLMonitor32.bmp new file mode 100644 index 0000000..92d8768 Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSSQLMonitor.TMSSQLMonitor32.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSScript.TMSScript.bmp b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSScript.TMSScript.bmp new file mode 100644 index 0000000..68a9efe Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSScript.TMSScript.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSScript.TMSScript16.bmp b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSScript.TMSScript16.bmp new file mode 100644 index 0000000..b8d396b Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSScript.TMSScript16.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSScript.TMSScript32.bmp b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSScript.TMSScript32.bmp new file mode 100644 index 0000000..31f90fe Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSScript.TMSScript32.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSServiceBroker.TMSServiceBroker.bmp b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSServiceBroker.TMSServiceBroker.bmp new file mode 100644 index 0000000..08b7e08 Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSServiceBroker.TMSServiceBroker.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSServiceBroker.TMSServiceBroker16.bmp b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSServiceBroker.TMSServiceBroker16.bmp new file mode 100644 index 0000000..553fe8e Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSServiceBroker.TMSServiceBroker16.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSServiceBroker.TMSServiceBroker32.bmp b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSServiceBroker.TMSServiceBroker32.bmp new file mode 100644 index 0000000..3597e58 Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.MSServiceBroker.TMSServiceBroker32.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.SdacVcl.TMSConnectDialog.bmp b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.SdacVcl.TMSConnectDialog.bmp new file mode 100644 index 0000000..e5a01b6 Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.SdacVcl.TMSConnectDialog.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.SdacVcl.TMSConnectDialog16.bmp b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.SdacVcl.TMSConnectDialog16.bmp new file mode 100644 index 0000000..1eeca6a Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.SdacVcl.TMSConnectDialog16.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.SdacVcl.TMSConnectDialog32.bmp b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.SdacVcl.TMSConnectDialog32.bmp new file mode 100644 index 0000000..2cb61bd Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/CoreLab.Sdac.SdacVcl.TMSConnectDialog32.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/Delphi8/CoreLab.Dac.CRBatchMove.TCRBatchMove.bmp b/internal/4.10.0.10/1/_Images_/Delphi8/CoreLab.Dac.CRBatchMove.TCRBatchMove.bmp new file mode 100644 index 0000000..226cc6f Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/Delphi8/CoreLab.Dac.CRBatchMove.TCRBatchMove.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/Delphi8/CoreLab.Dac.VirtualTable.TVirtualTable.bmp b/internal/4.10.0.10/1/_Images_/Delphi8/CoreLab.Dac.VirtualTable.TVirtualTable.bmp new file mode 100644 index 0000000..49baee2 Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/Delphi8/CoreLab.Dac.VirtualTable.TVirtualTable.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/Delphi8/CoreLab.Sdac.MSAccess.TMSConnection.bmp b/internal/4.10.0.10/1/_Images_/Delphi8/CoreLab.Sdac.MSAccess.TMSConnection.bmp new file mode 100644 index 0000000..82c48bd Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/Delphi8/CoreLab.Sdac.MSAccess.TMSConnection.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/Delphi8/CoreLab.Sdac.MSAccess.TMSDataSource.bmp b/internal/4.10.0.10/1/_Images_/Delphi8/CoreLab.Sdac.MSAccess.TMSDataSource.bmp new file mode 100644 index 0000000..2933844 Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/Delphi8/CoreLab.Sdac.MSAccess.TMSDataSource.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/Delphi8/CoreLab.Sdac.MSAccess.TMSMetadata.bmp b/internal/4.10.0.10/1/_Images_/Delphi8/CoreLab.Sdac.MSAccess.TMSMetadata.bmp new file mode 100644 index 0000000..afc459e Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/Delphi8/CoreLab.Sdac.MSAccess.TMSMetadata.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/Delphi8/CoreLab.Sdac.MSAccess.TMSQuery.bmp b/internal/4.10.0.10/1/_Images_/Delphi8/CoreLab.Sdac.MSAccess.TMSQuery.bmp new file mode 100644 index 0000000..1ea161b Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/Delphi8/CoreLab.Sdac.MSAccess.TMSQuery.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/Delphi8/CoreLab.Sdac.MSAccess.TMSSQL.bmp b/internal/4.10.0.10/1/_Images_/Delphi8/CoreLab.Sdac.MSAccess.TMSSQL.bmp new file mode 100644 index 0000000..f3edcd7 Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/Delphi8/CoreLab.Sdac.MSAccess.TMSSQL.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/Delphi8/CoreLab.Sdac.MSAccess.TMSStoredProc.bmp b/internal/4.10.0.10/1/_Images_/Delphi8/CoreLab.Sdac.MSAccess.TMSStoredProc.bmp new file mode 100644 index 0000000..147386c Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/Delphi8/CoreLab.Sdac.MSAccess.TMSStoredProc.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/Delphi8/CoreLab.Sdac.MSAccess.TMSTable.bmp b/internal/4.10.0.10/1/_Images_/Delphi8/CoreLab.Sdac.MSAccess.TMSTable.bmp new file mode 100644 index 0000000..e4946e4 Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/Delphi8/CoreLab.Sdac.MSAccess.TMSTable.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/Delphi8/CoreLab.Sdac.MSAccess.TMSUpdateSQL.bmp b/internal/4.10.0.10/1/_Images_/Delphi8/CoreLab.Sdac.MSAccess.TMSUpdateSQL.bmp new file mode 100644 index 0000000..17e1191 Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/Delphi8/CoreLab.Sdac.MSAccess.TMSUpdateSQL.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/Delphi8/CoreLab.Sdac.MSDump.TMSDump.bmp b/internal/4.10.0.10/1/_Images_/Delphi8/CoreLab.Sdac.MSDump.TMSDump.bmp new file mode 100644 index 0000000..57c805c Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/Delphi8/CoreLab.Sdac.MSDump.TMSDump.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/Delphi8/CoreLab.Sdac.MSLoader.TMSLoader.bmp b/internal/4.10.0.10/1/_Images_/Delphi8/CoreLab.Sdac.MSLoader.TMSLoader.bmp new file mode 100644 index 0000000..3bb672b Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/Delphi8/CoreLab.Sdac.MSLoader.TMSLoader.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/Delphi8/CoreLab.Sdac.MSSQLMonitor.TMSSQLMonitor.bmp b/internal/4.10.0.10/1/_Images_/Delphi8/CoreLab.Sdac.MSSQLMonitor.TMSSQLMonitor.bmp new file mode 100644 index 0000000..c6f0e50 Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/Delphi8/CoreLab.Sdac.MSSQLMonitor.TMSSQLMonitor.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/Delphi8/CoreLab.Sdac.MSScript.TMSScript.bmp b/internal/4.10.0.10/1/_Images_/Delphi8/CoreLab.Sdac.MSScript.TMSScript.bmp new file mode 100644 index 0000000..b8d396b Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/Delphi8/CoreLab.Sdac.MSScript.TMSScript.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/Delphi8/CoreLab.Sdac.MSServiceBroker.TMSServiceBroker.bmp b/internal/4.10.0.10/1/_Images_/Delphi8/CoreLab.Sdac.MSServiceBroker.TMSServiceBroker.bmp new file mode 100644 index 0000000..553fe8e Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/Delphi8/CoreLab.Sdac.MSServiceBroker.TMSServiceBroker.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/Delphi8/CoreLab.Sdac.SdacVcl.TMSConnectDialog.bmp b/internal/4.10.0.10/1/_Images_/Delphi8/CoreLab.Sdac.SdacVcl.TMSConnectDialog.bmp new file mode 100644 index 0000000..1eeca6a Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/Delphi8/CoreLab.Sdac.SdacVcl.TMSConnectDialog.bmp differ diff --git a/internal/4.10.0.10/1/_Images_/Delphi8/Thumbs.db b/internal/4.10.0.10/1/_Images_/Delphi8/Thumbs.db new file mode 100644 index 0000000..304de0f Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/Delphi8/Thumbs.db differ diff --git a/internal/4.10.0.10/1/_Images_/Thumbs.db b/internal/4.10.0.10/1/_Images_/Thumbs.db new file mode 100644 index 0000000..451ed81 Binary files /dev/null and b/internal/4.10.0.10/1/_Images_/Thumbs.db differ