home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 November / Chip_2002-11_cd1.bin / zkuste / delphi / kompon / d34567 / KADAO.ZIP / KADaoReg.pas < prev    next >
Pascal/Delphi Source File  |  2002-02-26  |  40KB  |  1,209 lines

  1. unit KADaoReg; 
  2. {$I KADaoCommonDirectives.pas}
  3. interface
  4. Uses Classes {$IFNDEF D6UP}, DsgnIntf{$ENDIF}
  5.              {$IFDEF D6UP},  DesignIntf, DesignWindows,  DesignEditors{$ENDIF};
  6.  
  7. Type
  8. //******************************************************************************
  9. //                           EDITOR DEFINITIONS - KADaoDBEngine
  10. //******************************************************************************
  11.   TEngEngineTypeEditor = class(TIntegerProperty)
  12.     Public
  13.      function  GetValue: string; override;
  14.      Procedure GetValues( Proc: TGetStrProc);override;
  15.      procedure SetValue(const Value: string); override;                                               
  16.      Function  GetAttributes: TPropertyAttributes; override;
  17.     End;
  18.  
  19.   TEngSystemDatabaseNameEditor = class(TStringProperty)
  20.     Public
  21.       Procedure Edit;override;
  22.       Procedure SetValue(const Value: string); override;
  23.       Function  GetAttributes: TPropertyAttributes; override;
  24.     End;
  25.  
  26.   {$IFDEF DYNADAO}
  27.   TEngDaoVersionEditor = class(TStringProperty)
  28.     Public
  29.       Procedure GetValues( Proc: TGetStrProc); override;
  30.       Procedure SetValue(const Value: string); override;
  31.       Function  GetAttributes: TPropertyAttributes; override;
  32.     End;
  33.   {$ENDIF}
  34. //******************************************************************************
  35. //                           EDITOR DEFINITIONS - KADaoWorkspace
  36. //******************************************************************************
  37.   TWorkEngineTypeEditor = class(TIntegerProperty)
  38.     Public
  39.      function  GetValue: string; override;
  40.      Procedure GetValues( Proc: TGetStrProc);override;
  41.      procedure SetValue(const Value: string); override;
  42.      Function  GetAttributes: TPropertyAttributes; override;
  43.     End;
  44.  
  45.   TWorkDefaultCursorDriverTypeEditor = class(TIntegerProperty)
  46.     Public
  47.      function  GetValue: string; override;
  48.      Procedure GetValues( Proc: TGetStrProc);override;
  49.      procedure SetValue(const Value: string); override;
  50.      Function  GetAttributes: TPropertyAttributes; override;
  51.     End;
  52. //******************************************************************************
  53. //                           EDITOR DEFINITIONS - KADaoDatabase
  54. //******************************************************************************
  55. TDBDatabaseTypeEditor = class(TStringProperty)
  56.     Public
  57.       Procedure GetValues( Proc: TGetStrProc); override;
  58.       Procedure SetValue(const Value: string); override;
  59.       Function  GetAttributes: TPropertyAttributes; override;
  60.     End;
  61.  
  62. TDBDatabaseNameEditor = class(TStringProperty)
  63.     Public
  64.       Procedure Edit;override;
  65.       Procedure SetValue(const Value: string); override;
  66.       Function  GetAttributes: TPropertyAttributes; override;
  67.     End;
  68.  
  69. TDBSystemDatabaseNameEditor = class(TStringProperty)
  70.     Public
  71.       Procedure Edit;override;
  72.       Procedure SetValue(const Value: string); override;
  73.       Function  GetAttributes: TPropertyAttributes; override;
  74.     End;
  75.  
  76. TDBEngineTypeEditor = class(TIntegerProperty)
  77.     Public
  78.      function  GetValue: string; override;
  79.      Procedure GetValues( Proc: TGetStrProc);override;
  80.      procedure SetValue(const Value: string); override;
  81.      Function  GetAttributes: TPropertyAttributes; override;
  82.     End;
  83.  
  84. TDBDefaultCursorDriverTypeEditor = class(TIntegerProperty)
  85.     Public
  86.      function  GetValue: string; override;
  87.      Procedure GetValues( Proc: TGetStrProc);override;
  88.      procedure SetValue(const Value: string); override;
  89.      Function  GetAttributes: TPropertyAttributes; override;
  90.     End;
  91.  
  92.  
  93. TDBWorkspaceEditor = class(TStringProperty)
  94.     Public
  95.       Procedure GetValues( Proc: TGetStrProc); override;
  96.       Function  GetAttributes: TPropertyAttributes; override;
  97.     End;
  98.  
  99. {$IFDEF DYNADAO}
  100. TDBDaoVersionEditor = class(TStringProperty)
  101.     Public
  102.       Procedure GetValues( Proc: TGetStrProc); override;
  103.       Procedure SetValue(const Value: string); override;
  104.       Function  GetAttributes: TPropertyAttributes; override;
  105.     End;
  106. {$ENDIF}
  107. //******************************************************************************
  108. //                           EDITOR DEFINITIONS - KADaoTable
  109. //******************************************************************************
  110. TTableNameEditor = class(TStringProperty)
  111.     Public
  112.       Procedure GetValues( Proc: TGetStrProc); override;
  113.       Function  GetAttributes: TPropertyAttributes; override;
  114.     End;
  115.  
  116. TQueryNameEditor = class(TStringProperty)
  117.     Public
  118.       Procedure GetValues( Proc: TGetStrProc); override;
  119.       Function  GetAttributes: TPropertyAttributes; override;
  120.     End;
  121.  
  122. TIndexNameEditor = class(TStringProperty)
  123.     Public
  124.       Procedure GetValues( Proc: TGetStrProc); override;
  125.       Function  GetAttributes: TPropertyAttributes; override;
  126.     End;
  127.  
  128. TTableTypeEditor = class(TIntegerProperty)
  129.     Public
  130.      Function  GetValue: string; override;
  131.      Procedure GetValues( Proc: TGetStrProc);override;
  132.      Procedure SetValue(const Value: string); override;
  133.      Function  GetAttributes: TPropertyAttributes; override;
  134.     End;
  135.  
  136. TLockTypeEditor = class(TIntegerProperty)
  137.     Public
  138.      Function  GetValue: string; override;
  139.      Procedure GetValues( Proc: TGetStrProc);override;
  140.      Procedure SetValue(const Value: string); override;
  141.      Function  GetAttributes: TPropertyAttributes; override;
  142.     End;
  143.  
  144. TSortByEditor = class(TStringProperty)
  145.     Public
  146.      Function  GetValue: string; override;
  147.      Procedure Edit;override;
  148.      Procedure SetValue(const Value: string); override;
  149.      Function  GetAttributes: TPropertyAttributes; override;
  150.     End;
  151.  
  152. TQueryDefParamsEditor = class(TStringProperty)
  153.     Public
  154.      Function  GetValue: string; override;
  155.      Procedure Edit;override;
  156.      Procedure SetValue(const Value: string); override;
  157.      Function  GetAttributes: TPropertyAttributes; override;
  158.     End;
  159.  
  160. TMasterFieldsEditor = class(TStringProperty)
  161.     Public
  162.      Procedure Edit;override;
  163.      Function GetValue: string; override;
  164.      Procedure SetValue(const Value: string); override;
  165.      Function  GetAttributes: TPropertyAttributes; override;
  166.     End;
  167.  
  168. TEncrypterEditor= class(TComponentProperty)
  169.     Public
  170.       procedure GetValues(Proc: TGetStrProc);override;
  171.     End;
  172. //******************************************************************************
  173. //                           EDITOR DEFINITIONS - KADaoInfo
  174. //******************************************************************************
  175.   TDIDatabaseNameEditor = class(TStringProperty)
  176.     Public
  177.       Procedure Edit;override;
  178.       Procedure SetValue(const Value: string); override;
  179.       Function  GetAttributes: TPropertyAttributes; override;
  180.     End;
  181.  
  182.   TDIDLLNameEditor = class(TStringProperty)
  183.     Public
  184.       Procedure Edit;override;
  185.       Procedure SetValue(const Value: string); override;
  186.       Function  GetAttributes: TPropertyAttributes; override;
  187.     End;
  188. //******************************************************************************
  189.  
  190. procedure Register;
  191.  
  192. Implementation
  193. Uses SysUtils, Forms, Dialogs, DB, KDaoDBEngine, KDaoWorkspace, KDaoDatabase,
  194.      KDaoTable, KADaoInfo, DaoApi, KADaoEncrypter, TypInfo,
  195.      SortByDialog, MasterDetailFormUnit;
  196.  
  197. //******************************************************************************
  198. //                           EDITOR CODE - KADaoDBEngine
  199. //******************************************************************************
  200. //******************************************************** KADaoDBEngine Editors
  201. //*********************************************************** Engine Type Editor
  202. Function TEngEngineTypeEditor.GetAttributes: TPropertyAttributes;
  203. Begin
  204.   Result := Inherited GetAttributes + [paValueList, paSortList];
  205. End;
  206.  
  207. Function  TEngEngineTypeEditor.GetValue: string;
  208. Begin
  209.  if GetComponent(0) is TKADaoDBEngine then
  210.     Begin
  211.       if TKADaoDBEngine(GetComponent(0)).EngineType=DaoApi.dbUseODBC then
  212.          Result:='dbUseODBC'
  213.       Else
  214.          Result:='dbUseJet';
  215.     End;
  216. End;
  217.  
  218. Procedure TEngEngineTypeEditor.GetValues( Proc: TGetStrProc);
  219. Begin
  220.   if GetComponent(0) is TKADaoDBEngine then
  221.      Begin
  222.        Proc('dbUseODBC');
  223.        Proc('dbUseJet');
  224.      End;
  225. End;
  226.  
  227.  
  228. procedure TEngEngineTypeEditor.SetValue(const Value: string);
  229. Var
  230.  Dat : Integer;
  231. Begin
  232.   if GetComponent(0) is TKADaoDBEngine then
  233.        Begin
  234.        if Value='dbUseODBC' Then
  235.           Dat:=DaoApi.dbUseODBC
  236.        Else
  237.           Dat:=DaoApi.dbUseJet;
  238.        Inherited SetValue(IntToStr(Dat));
  239.        Modified;
  240.      End;
  241. End;
  242.  
  243.  
  244. //******************************************************* System Database Editor
  245. Function TEngSystemDatabaseNameEditor.GetAttributes: TPropertyAttributes;
  246. Begin
  247.   Result:= [paDialog];
  248. End;
  249.  
  250. Procedure TEngSystemDatabaseNameEditor.SetValue(const Value: string);
  251. Begin
  252. if GetComponent(0) is TKADaoDBEngine then
  253.   Begin
  254.     inherited SetValue(Value);
  255.     Modified;
  256.   End;
  257. End;
  258.  
  259. procedure TEngSystemDatabaseNameEditor.Edit;
  260. var
  261.    DlgChooseDatabase : TOpenDialog;
  262.    DBase             : TKADaoDBEngine;
  263.    Filter            : String;
  264. Begin
  265.    DBase:=TKADaoDBEngine(GetComponent(0));
  266.    DlgChooseDatabase := TOpenDialog.Create(Nil);
  267.    DlgChooseDatabase.FilterIndex:=1;
  268.    DlgChooseDatabase.DefaultExt:='mdw';
  269.    DlgChooseDatabase.InitialDir:= ExtractFilePath(DBase.SystemDatabase);
  270.    DlgChooseDatabase.FileName  := ExtractFileName(DBase.SystemDatabase);
  271.    if DlgChooseDatabase.FileName <> '' Then Filter := AnsiLowerCase(ExtractFileExt(DlgChooseDatabase.FileName));
  272.    System.Delete(Filter,1,1);
  273.    DlgChooseDatabase.DefaultExt:= Filter;
  274.    if AnsiLowerCase(ExtractFileExt(DlgChooseDatabase.FileName))='.mda' Then DlgChooseDatabase.FilterIndex:=1
  275.    Else
  276.      if AnsiLowerCase(ExtractFileExt(DlgChooseDatabase.FileName))='.mdw' Then DlgChooseDatabase.FilterIndex:=1
  277.    Else
  278.      if AnsiLowerCase(ExtractFileExt(DlgChooseDatabase.FileName))='.mdb' Then DlgChooseDatabase.FilterIndex:=2
  279.    Else
  280.      DlgChooseDatabase.FilterIndex:=3;
  281.    Filter:='Microsoft Access security files (*.mda *.mdw)|*.mda;*.mdw';
  282.    Filter:=Filter+'|Microsoft Access (*.mdb)|*.mdb';
  283.    Filter:=Filter+'|All files (*.*)|*.*';
  284.    DlgChooseDatabase.Title:='Choose System Database:';
  285.    DlgChooseDatabase.Options:=[ofFileMustExist,ofPathMustExist,ofHideReadOnly];
  286.    DlgChooseDatabase.Filter :=Filter;
  287.    if DlgChooseDatabase.Execute then SetStrValue(DlgChooseDatabase.FileName);
  288.    DlgChooseDatabase.Free;
  289.    Modified;
  290. End;
  291.  
  292. //*********************************************************** DAO Version Editor
  293. {$IFDEF DYNADAO}
  294. Procedure TEngDaoVersionEditor.GetValues( Proc: TGetStrProc);
  295. Var
  296.   DBase : TKADaoDBEngine;
  297.   X     : Integer;
  298. Begin
  299.   if GetComponent(0) is TKADaoDBEngine then
  300.   Begin
  301.     DBase := TKADaoDBEngine(GetComponent(0));
  302.     Try
  303.       For X := 0 to DBase.F_DaoVersionList.Count-1 do Proc(DBase.F_DaoVersionList[X]);
  304.     Finally
  305.     End;
  306.   End;
  307. End;
  308.  
  309. Procedure TEngDaoVersionEditor.SetValue(const Value: string);
  310. Begin
  311.  if GetComponent(0) is TKADaoDBEngine then
  312.   Begin
  313.     inherited SetValue(Value);
  314.     Modified;
  315.   End;
  316. End;
  317.  
  318. Function TEngDaoVersionEditor.GetAttributes: TPropertyAttributes;
  319. Begin
  320.   Result:= Inherited GetAttributes + [paValueList, paSortList];
  321. End;
  322. {$ENDIF}
  323.  
  324. //******************************************************************************
  325. //                           EDITOR CODE - KADaoWorkspace
  326. //******************************************************************************
  327. //******************************************************* KADaoWorkspace Editors
  328. //*********************************************************** Engine Type Editor
  329. Function TWorkEngineTypeEditor.GetAttributes: TPropertyAttributes;
  330. Begin
  331.   Result := Inherited GetAttributes + [paValueList, paSortList];
  332. End;
  333.  
  334. Function  TWorkEngineTypeEditor.GetValue: string;
  335. Begin
  336.  if GetComponent(0) is TKADaoWorkspace then
  337.     Begin
  338.       if TKADaoWorkspace(GetComponent(0)).EngineType=DaoApi.dbUseODBC then
  339.          Result:='dbUseODBC'
  340.       Else
  341.          Result:='dbUseJet';
  342.     End;
  343. End;
  344.  
  345. Procedure TWorkEngineTypeEditor.GetValues( Proc: TGetStrProc);
  346. Begin
  347.   if GetComponent(0) is TKADaoWorkspace then
  348.      Begin
  349.        Proc('dbUseODBC');
  350.        Proc('dbUseJet');
  351.      End;
  352. End;
  353.  
  354.  
  355. procedure TWorkEngineTypeEditor.SetValue(const Value: string);
  356. Var
  357.  Dat : Integer;
  358. Begin
  359.   if GetComponent(0) is TKADaoWorkspace then
  360.        Begin
  361.        if Value='dbUseODBC' Then
  362.           Dat:=DaoApi.dbUseODBC
  363.        Else
  364.           Dat:=DaoApi.dbUseJet;
  365.        Inherited SetValue(IntToStr(Dat));
  366.        Modified;
  367.      End;
  368. End;
  369.  
  370. //*************************************************** DefaultCursorDriver Editor
  371. Function TWorkDefaultCursorDriverTypeEditor.GetAttributes: TPropertyAttributes;
  372. Begin
  373.   Result := Inherited GetAttributes + [paValueList, paSortList];
  374. End;
  375.  
  376. Function  TWorkDefaultCursorDriverTypeEditor.GetValue: string;
  377. Var
  378.  DB : TKADaoWorkspace;
  379. Begin
  380.  if GetComponent(0) is TKADaoWorkspace then
  381.     Begin
  382.      DB := TKADaoWorkspace(GetComponent(0));
  383.      Result:='dbUseDefaultCursor';
  384.      if DB.DefaultCursorDriver=DaoApi.dbUseDefaultCursor     then Result:='dbUseDefaultCursor'
  385.      Else
  386.      if DB.DefaultCursorDriver=DaoApi.dbUseODBCCursor        then Result:='dbUseODBCCursor'
  387.      Else
  388.      if DB.DefaultCursorDriver=DaoApi.dbUseServerCursor      then Result:='dbUseServerCursor'
  389.      Else
  390.      if DB.DefaultCursorDriver=DaoApi.dbUseClientBatchCursor then Result:='dbUseClientBatchCursor'
  391.      Else
  392.      if DB.DefaultCursorDriver=DaoApi.dbUseNoCursor          then Result:='dbUseNoCursor';
  393.     End;
  394. End;
  395.  
  396. Procedure TWorkDefaultCursorDriverTypeEditor.GetValues( Proc: TGetStrProc);
  397. Begin
  398.   if GetComponent(0) is TKADaoWorkspace then
  399.      Begin
  400.        Proc('dbUseDefaultCursor');
  401.        Proc('dbUseODBCCursor');
  402.        Proc('dbUseServerCursor');
  403.        Proc('dbUseClientBatchCursor');
  404.        Proc('dbUseNoCursor');
  405.      End;
  406. End;
  407.  
  408.  
  409. procedure TWorkDefaultCursorDriverTypeEditor.SetValue(const Value: string);
  410. Var
  411.  Dat : Integer;
  412. Begin
  413.   if GetComponent(0) is TKADaoWorkspace then
  414.        Begin
  415.        Dat:=DaoApi.dbUseDefaultCursor;
  416.        if Value='dbUseDefaultCursor' Then Dat:=DaoApi.dbUseDefaultCursor
  417.        Else
  418.        if Value='dbUseODBCCursor' Then Dat:=DaoApi.dbUseODBCCursor
  419.        Else
  420.        if Value='dbUseServerCursor' Then Dat:=DaoApi.dbUseServerCursor
  421.        Else
  422.        if Value='dbUseClientBatchCursor' Then Dat:=DaoApi.dbUseClientBatchCursor
  423.        Else
  424.        if Value='dbUseNoCursor' Then Dat:=DaoApi.dbUseNoCursor;
  425.        Inherited SetValue(IntToStr(Dat));
  426.        Modified;
  427.      End;
  428. End;
  429. //******************************************************************************
  430. //                           EDITOR CODE - KADaoDatabase
  431. //******************************************************************************
  432. //******************************************************** KADaoDatabase Editors
  433. Procedure TDBDatabaseTypeEditor.GetValues( Proc: TGetStrProc);
  434. Var
  435.   DBase : TKADaoDatabase;
  436.   X     : Integer;
  437. Begin
  438.   if GetComponent(0) is TKADaoDatabase then
  439.   Begin
  440.     DBase := TKADaoDatabase(GetComponent(0));
  441.     Try
  442.       For X := 0 to DBase.F_DBTypesList.Count-1 do Proc(DBase.F_DBTypesList[X]);
  443.     Finally
  444.     End;
  445.   End;
  446. End;
  447.  
  448. Procedure TDBDatabaseTypeEditor.SetValue(const Value: string);
  449. Begin
  450.  if GetComponent(0) is TKADaoDatabase then
  451.   Begin
  452.     inherited SetValue(Value);
  453.     Modified;
  454.   End;
  455. End;
  456.  
  457. Function TDBDatabaseTypeEditor.GetAttributes: TPropertyAttributes;
  458. Begin
  459.   Result:= Inherited GetAttributes + [paValueList, paSortList];
  460. End;
  461.  
  462.  
  463. //************************************************************** Database Editor
  464. Function TDBDatabaseNameEditor.GetAttributes: TPropertyAttributes;
  465. Begin
  466.   Result:= [paDialog];
  467. End;
  468.  
  469. Procedure TDBDatabaseNameEditor.SetValue(const Value: string);
  470. Begin
  471. if GetComponent(0) is TKADaoDatabase then
  472.   Begin
  473.     inherited SetValue(Value);
  474.     Modified;
  475.   End;
  476. End;
  477.  
  478. procedure TDBDatabaseNameEditor.Edit;
  479. var
  480.    FileName : String;
  481.    DBase    : TKADaoDatabase;
  482. Begin
  483.    DBase:=TKADaoDatabase(GetComponent(0));
  484.    Filename := DBase.F_ChooseDatabase;
  485.    if Filename <> '' then begin
  486.       SetStrValue(Filename);
  487.       Modified;
  488.    end;
  489. End;
  490.  
  491.  
  492. //******************************************************* System Database Editor
  493. Function TDBSystemDatabaseNameEditor.GetAttributes: TPropertyAttributes;
  494. Begin
  495.   Result:= [paDialog];
  496. End;
  497.  
  498. Procedure TDBSystemDatabaseNameEditor.SetValue(const Value: string);
  499. Begin
  500. if GetComponent(0) is TKADaoDatabase then
  501.   Begin
  502.     inherited SetValue(Value);
  503.     Modified;
  504.   End;
  505. End;
  506.  
  507. procedure TDBSystemDatabaseNameEditor.Edit;
  508. var
  509.    DBase               : TKADaoDatabase;
  510.    Filter              : String;
  511.    DlgChooseDatabase   : TOpenDialog;
  512. Begin
  513.    DBase:=TKADaoDatabase(GetComponent(0));
  514.    DlgChooseDatabase := TOpenDialog.Create(Nil);
  515.    DlgChooseDatabase.FilterIndex:=1;
  516.    DlgChooseDatabase.DefaultExt:='mdw';
  517.    DlgChooseDatabase.InitialDir:= ExtractFilePath(DBase.SystemDatabase);
  518.    DlgChooseDatabase.FileName  := ExtractFileName(DBase.SystemDatabase);
  519.    if DlgChooseDatabase.FileName <> '' Then Filter := AnsiLowerCase(ExtractFileExt(DlgChooseDatabase.FileName));
  520.    System.Delete(Filter,1,1);
  521.    DlgChooseDatabase.DefaultExt:= Filter;
  522.    if AnsiLowerCase(ExtractFileExt(DlgChooseDatabase.FileName))='.mda' Then DlgChooseDatabase.FilterIndex:=1
  523.    Else
  524.      if AnsiLowerCase(ExtractFileExt(DlgChooseDatabase.FileName))='.mdw' Then DlgChooseDatabase.FilterIndex:=1
  525.    Else
  526.      if AnsiLowerCase(ExtractFileExt(DlgChooseDatabase.FileName))='.mdb' Then DlgChooseDatabase.FilterIndex:=2
  527.    Else
  528.      DlgChooseDatabase.FilterIndex:=3;
  529.    Filter:='Microsoft Access security files (*.mda *.mdw)|*.mda;*.mdw';
  530.    Filter:=Filter+'|Microsoft Access (*.mdb)|*.mdb';
  531.    Filter:=Filter+'|All files (*.*)|*.*';
  532.    DlgChooseDatabase.Title:='Choose System Database:';
  533.    DlgChooseDatabase.Options:=[ofFileMustExist,ofPathMustExist,ofHideReadOnly];
  534.    DlgChooseDatabase.Filter :=Filter;
  535.    if DlgChooseDatabase.Execute then SetStrValue(DlgChooseDatabase.FileName);
  536.    DlgChooseDatabase.Free;
  537.    Modified;
  538. End;
  539.  
  540.  
  541. //*********************************************************** Engine Type Editor
  542. Function TDBEngineTypeEditor.GetAttributes: TPropertyAttributes;
  543. Begin
  544.   Result := Inherited GetAttributes + [paValueList, paSortList];
  545. End;
  546.  
  547. Function  TDBEngineTypeEditor.GetValue: string;
  548. Begin
  549.  if GetComponent(0) is TKADaoDatabase then
  550.     Begin
  551.       if TKADaoDatabase(GetComponent(0)).EngineType=DaoApi.dbUseODBC then
  552.          Result:='dbUseODBC'
  553.       Else
  554.          Result:='dbUseJet';
  555.     End;
  556. End;
  557.  
  558. Procedure TDBEngineTypeEditor.GetValues( Proc: TGetStrProc);
  559. Begin
  560.   if GetComponent(0) is TKADaoDatabase then
  561.      Begin
  562.        Proc('dbUseODBC');
  563.        Proc('dbUseJet');
  564.      End;
  565. End;
  566.  
  567.  
  568. procedure TDBEngineTypeEditor.SetValue(const Value: string);
  569. Var
  570.  Dat : Integer;
  571. Begin
  572.   if GetComponent(0) is TKADaoDatabase then
  573.        Begin
  574.        if Value='dbUseODBC' Then
  575.           Dat:=DaoApi.dbUseODBC
  576.        Else
  577.           Dat:=DaoApi.dbUseJet;
  578.        Inherited SetValue(IntToStr(Dat));
  579.        Modified;
  580.      End;
  581. End;
  582. //*************************************************** DefaultCursorDriver Editor
  583. Function TDBDefaultCursorDriverTypeEditor.GetAttributes: TPropertyAttributes;
  584. Begin
  585.   Result := Inherited GetAttributes + [paValueList, paSortList];
  586. End;
  587.  
  588. Function  TDBDefaultCursorDriverTypeEditor.GetValue: string;
  589. Var
  590.  DB : TKADaoDatabase;
  591. Begin
  592.  if GetComponent(0) is TKADaoDatabase then
  593.     Begin
  594.      DB := TKADaoDatabase(GetComponent(0));
  595.      Result:='dbUseDefaultCursor';
  596.      if DB.DefaultCursorDriver=DaoApi.dbUseDefaultCursor     then Result:='dbUseDefaultCursor'
  597.      Else
  598.      if DB.DefaultCursorDriver=DaoApi.dbUseODBCCursor        then Result:='dbUseODBCCursor'
  599.      Else
  600.      if DB.DefaultCursorDriver=DaoApi.dbUseServerCursor      then Result:='dbUseServerCursor'
  601.      Else
  602.      if DB.DefaultCursorDriver=DaoApi.dbUseClientBatchCursor then Result:='dbUseClientBatchCursor'
  603.      Else
  604.      if DB.DefaultCursorDriver=DaoApi.dbUseNoCursor          then Result:='dbUseNoCursor';
  605.     End;
  606. End;
  607.  
  608. Procedure TDBDefaultCursorDriverTypeEditor.GetValues( Proc: TGetStrProc);
  609. Begin
  610.   if GetComponent(0) is TKADaoDatabase then
  611.      Begin
  612.        Proc('dbUseDefaultCursor');
  613.        Proc('dbUseODBCCursor');
  614.        Proc('dbUseServerCursor');
  615.        Proc('dbUseClientBatchCursor');
  616.        Proc('dbUseNoCursor');
  617.      End;
  618. End;
  619.  
  620.  
  621. procedure TDBDefaultCursorDriverTypeEditor.SetValue(const Value: string);
  622. Var
  623.  Dat : Integer;
  624. Begin
  625.   if GetComponent(0) is TKADaoDatabase then
  626.        Begin
  627.        Dat:=DaoApi.dbUseDefaultCursor;
  628.        if Value='dbUseDefaultCursor'     Then Dat:=DaoApi.dbUseDefaultCursor
  629.        Else
  630.        if Value='dbUseODBCCursor'        Then Dat:=DaoApi.dbUseODBCCursor
  631.        Else
  632.        if Value='dbUseServerCursor'      Then Dat:=DaoApi.dbUseServerCursor
  633.        Else
  634.        if Value='dbUseClientBatchCursor' Then Dat:=DaoApi.dbUseClientBatchCursor
  635.        Else
  636.        if Value='dbUseNoCursor'          Then Dat:=DaoApi.dbUseNoCursor;
  637.        Inherited SetValue(IntToStr(Dat));
  638.        Modified;
  639.      End;
  640. End;
  641.  
  642.  
  643. //************************************************************* Workspase Editor
  644. Procedure TDBWorkspaceEditor.GetValues( Proc: TGetStrProc);
  645. Var
  646.   DBase : TKADaoDatabase;
  647.   X     : Integer;
  648. Begin
  649.   if GetComponent(0) is TKADaoDatabase then
  650.   Begin
  651.     DBase := TKADaoDatabase(GetComponent(0));
  652.     Try
  653.       For X := 0 to DBase.CoreDBEngine.Workspaces.Count-1 do
  654.           Begin
  655.             if AnsiCompareText(DBase.CoreDBEngine.Workspaces.Item[X].Name,
  656.                                '#Default Workspace#') <> 0 Then
  657.             Proc(DBase.CoreDBEngine.Workspaces.Item[X].Name);
  658.           End;
  659.     Finally
  660.     End;
  661.   End;
  662. End;
  663.  
  664. Function TDBWorkspaceEditor.GetAttributes: TPropertyAttributes;
  665. Begin
  666.   Result:= Inherited GetAttributes + [paValueList, paSortList];
  667. End;
  668.  
  669. //*********************************************************** DAO Version Editor
  670. {$IFDEF DYNADAO}
  671. Procedure TDBDaoVersionEditor.GetValues( Proc: TGetStrProc);
  672. Var
  673.   DBase : TKADaoDatabase;
  674.   X     : Integer;
  675. Begin
  676.   if GetComponent(0) is TKADaoDatabase then
  677.   Begin
  678.     DBase := TKADaoDatabase(GetComponent(0));
  679.     Try
  680.       For X := 0 to DBase.F_DaoVersionList.Count-1 do Proc(DBase.F_DaoVersionList[X]);
  681.     Finally
  682.     End;
  683.   End;
  684. End;
  685.  
  686. Procedure TDBDaoVersionEditor.SetValue(const Value: string);
  687. Begin
  688.  if GetComponent(0) is TKADaoDatabase then
  689.   Begin
  690.     inherited SetValue(Value);
  691.     Modified;
  692.   End;
  693. End;
  694.  
  695. Function TDBDaoVersionEditor.GetAttributes: TPropertyAttributes;
  696. Begin
  697.   Result:= Inherited GetAttributes + [paValueList, paSortList];
  698. End;
  699. {$ENDIF}
  700.  
  701. //******************************************************************************
  702. //                           EDITOR CODE - KADaoTable
  703. //******************************************************************************
  704. //*********************************************************** KADaoTable Editors
  705. //******************************************************************** TableName
  706. Procedure TTableNameEditor.GetValues( Proc: TGetStrProc);
  707. Var
  708.   DTable : TKADaoTable;
  709.   DBase  : TKADaodatabase;
  710.   X      : Integer;
  711. Begin
  712.   if GetComponent(0) is TKADaoTable then
  713.   Begin
  714.     DTable := TKADaoTable(GetComponent(0));
  715.     if Assigned(DTable.Database) And (DTable.Database.Connected) Then
  716.        Begin
  717.         DBase:=DTable.Database;
  718.         DBase.RefreshDefinitions;
  719.         Try
  720.           For X := 0 to DBase.TableNames.Count-1 do Proc(DBase.TableNames.Strings[X]);
  721.         Finally
  722.         End;
  723.        End;
  724.   End;
  725. End;
  726.  
  727. Function TTableNameEditor.GetAttributes: TPropertyAttributes;
  728. Begin
  729.   Result:= Inherited GetAttributes + [paValueList, paSortList];
  730. End;
  731. //******************************************************************** QueryName
  732.  
  733. Procedure TQueryNameEditor.GetValues( Proc: TGetStrProc);
  734. Var
  735.   DTable : TKADaoTable;
  736.   DBase : TKADaodatabase;
  737.   X     : Integer;
  738. Begin
  739.   if GetComponent(0) is TKADaoTable then
  740.   Begin
  741.     DTable := TKADaoTable(GetComponent(0));
  742.     if Assigned(DTable.Database) And (DTable.Database.Connected) Then
  743.        Begin
  744.         DBase:=DTable.Database;
  745.         DBase.RefreshDefinitions;
  746.         Try
  747.           For X := 0 to DBase.QueryDefNames.Count-1 do Proc(DBase.QueryDefNames.Strings[X]);
  748.         Finally
  749.         End;
  750.        End;
  751.   End;
  752. End;
  753.  
  754. Function TQueryNameEditor.GetAttributes: TPropertyAttributes;
  755. Begin
  756.   Result:= Inherited GetAttributes + [paValueList, paSortList];
  757. End;
  758. //******************************************************************** IndexName
  759. Procedure TIndexNameEditor.GetValues( Proc: TGetStrProc);
  760. Var
  761.   DTable : TKADaoTable;
  762.   DBase  : TKADaodatabase;
  763.   X      : Integer;
  764.   Count  : Integer;
  765. Begin
  766.   if GetComponent(0) is TKADaoTable then
  767.   Begin
  768.     DTable := TKADaoTable(GetComponent(0));
  769.     if Assigned(DTable.Database) And (DTable.Database.Connected)  Then
  770.     if DTable.TableName <> '' Then
  771.        Begin
  772.         DBase:=DTable.Database;
  773.         Try
  774.           DBase.RefreshDefinitions;
  775.           Count :=DBase.CoreDatabase.TableDefs.Item[DTable.TableName].Indexes.Count;
  776.           For X := 0 to  Count-1 do
  777.               Begin
  778.                 Proc(DBase.CoreDatabase.TableDefs.Item[DTable.TableName].Indexes.Item[X].Name);
  779.               End;
  780.         Finally
  781.         End;
  782.        End;
  783.   End;
  784. End;
  785.  
  786.  
  787. Function TIndexNameEditor.GetAttributes: TPropertyAttributes;
  788. Begin
  789.   Result:= Inherited GetAttributes + [paValueList, paSortList];
  790. End;
  791.  
  792. //******************************************************************************
  793.  
  794. Function TTableTypeEditor.GetAttributes: TPropertyAttributes;
  795. Begin
  796.   Result := Inherited GetAttributes + [paValueList, paSortList];
  797. End;
  798.  
  799. Function  TTableTypeEditor.GetValue: string;
  800. Begin
  801.  if GetComponent(0) is TKADaoTable then
  802.     Begin
  803.       Result:='StandardTable';
  804.       if TKADaoTable(GetComponent(0)).TableType=DaoApi.dbOpenTable       then Result:='StandardTable';
  805.       if TKADaoTable(GetComponent(0)).TableType=DaoApi.dbOpenDynaset     then Result:='DynasetTable';
  806.       if TKADaoTable(GetComponent(0)).TableType=DaoApi.dbOpenDynamic     then Result:='DynamicTable';
  807.       if TKADaoTable(GetComponent(0)).TableType=DaoApi.dbOpenSnapshot    then Result:='SnapshotTable';
  808.       if TKADaoTable(GetComponent(0)).TableType=DaoApi.dbOpenForwardOnly then Result:='ForwardOnlyTable';
  809.     End;
  810. End;
  811.  
  812. Procedure TTableTypeEditor.GetValues( Proc: TGetStrProc);
  813. Begin
  814.   if GetComponent(0) is TKADaoTable then
  815.      Begin
  816.        Proc('StandardTable');
  817.        Proc('DynasetTable');
  818.        Proc('DynamicTable');
  819.        Proc('SnapshotTable');
  820.        Proc('ForwardOnlyTable');
  821.      End;
  822. End;
  823.  
  824.  
  825. Procedure TTableTypeEditor.SetValue(const Value: string);
  826. Var
  827.  Dat : Integer;
  828. Begin
  829.   if GetComponent(0) is TKADaoTable then
  830.        Begin
  831.        Dat:=DaoApi.dbOpenTable;
  832.        if Value='StandardTable'    Then Dat:=DaoApi.dbOpenTable;
  833.        if Value='DynasetTable'     Then Dat:=DaoApi.dbOpenDynaset;
  834.        if Value='DynamicTable'     Then Dat:=DaoApi.dbOpenDynamic;
  835.        if Value='SnapshotTable'    Then Dat:=DaoApi.dbOpenSnapshot;
  836.        if Value='ForwardOnlyTable' Then Dat:=DaoApi.dbOpenForwardOnly;
  837.        Inherited SetValue(IntToStr(Dat));
  838.        Modified;
  839.      End;
  840. End;
  841.  
  842. //******************************************************************************
  843.  
  844. Function TLockTypeEditor.GetAttributes: TPropertyAttributes;
  845. Begin
  846.   Result := Inherited GetAttributes + [paValueList, paSortList];
  847. End;
  848.  
  849. Function  TLockTypeEditor.GetValue: string;
  850. Begin
  851.  if GetComponent(0) is TKADaoTable then
  852.     Begin
  853.       Result:='dbPessimistic';
  854.       if TKADaoTable(GetComponent(0)).LockType=DAOApi.dbPessimistic       then Result:='dbPessimistic';
  855.       if TKADaoTable(GetComponent(0)).LockType=DAOApi.dbOptimistic        then Result:='dbOptimistic';
  856.       if TKADaoTable(GetComponent(0)).LockType=DAOApi.dbOptimisticValue   then Result:='dbOptimisticValue';
  857.       if TKADaoTable(GetComponent(0)).LockType=DAOApi.dbReadOnly          then Result:='dbReadOnly';
  858.       if TKADaoTable(GetComponent(0)).LockType=DAOApi.dbOptimisticBatch   then Result:='dbOptimisticBatch';
  859.     End;
  860. End;
  861.  
  862. Procedure TLockTypeEditor.GetValues( Proc: TGetStrProc);
  863. Begin
  864.   if GetComponent(0) is TKADaoTable then
  865.      Begin
  866.        Proc('dbPessimistic');
  867.        Proc('dbOptimistic');
  868.        Proc('dbOptimisticValue');
  869.        Proc('dbReadOnly');                                                            
  870.        Proc('dbOptimisticBatch');
  871.      End;
  872. End;
  873.  
  874.  
  875. Procedure TLockTypeEditor.SetValue(const Value: string);
  876. Var
  877.  Dat : Integer;
  878. Begin
  879.   if GetComponent(0) is TKADaoTable then
  880.        Begin
  881.        Dat:=DAOApi.dbPessimistic;
  882.        if Value='dbPessimistic'     Then Dat:=DAOApi.dbPessimistic;
  883.        if Value='dbOptimistic'      Then Dat:=DAOApi.dbOptimistic;
  884.        if Value='dbOptimisticValue' Then Dat:=DAOApi.dbOptimisticValue;
  885.        if Value='dbReadOnly'        Then Dat:=DAOApi.dbReadOnly;
  886.        if Value='dbOptimisticBatch' Then Dat:=DAOApi.dbOptimisticBatch;
  887.        Inherited SetValue(IntToStr(Dat));
  888.        Modified;
  889.      End;
  890. End;
  891.  
  892.  
  893. Function TSortByEditor.GetValue: string;
  894. Begin
  895.  Result := '(TStringList)'
  896. End;
  897.  
  898. Function TSortByEditor.GetAttributes: TPropertyAttributes;
  899. Begin
  900.   Result:= [paDialog];
  901. End;
  902.  
  903. Procedure TSortByEditor.SetValue(const Value: string);
  904. Begin
  905. if GetComponent(0) is TKADaoTable then
  906.   Begin
  907.     inherited SetValue(Value);
  908.     Modified;
  909.   End;
  910. End;
  911.  
  912. Procedure TSortByEditor.Edit;
  913. Var
  914.  DT:TKADaoTable;
  915. Begin
  916.  if GetComponent(0) is TKADaoTable then
  917.   Begin
  918.     DT:=GetComponent(0) AS TKADaoTable;
  919.     if NOT Assigned(DT.Database) Then Exit;
  920.     if NOT (DT.Database.Connected) Then Exit;
  921.     if (DT.Active=False) And (Not (csLoading in DT.ComponentState)) Then
  922.        Begin
  923.          Try
  924.            DT.Active:=True;
  925.            DT.Active:=False;
  926.          Except
  927.            DT.SortedBy.Clear;
  928.            DatabaseError(E2051);
  929.            Exit;
  930.          End;
  931.        End;
  932.     Application.CreateForm(TSortByDialog,SortDialog);
  933.     if SortDialog.Execute(DT.SortFieldNames,DT.SortedBy,DT.UseBrackets) Then
  934.        Begin
  935.          DT.Sort;
  936.          Modified;
  937.        End;
  938.     SortDialog.Free;
  939.   End;
  940. End;
  941.  
  942. Function TQueryDefParamsEditor.GetValue: string;
  943. Begin
  944.  Result := '(TStringList)'
  945. End;
  946.  
  947. Function TQueryDefParamsEditor.GetAttributes: TPropertyAttributes;
  948. Begin
  949.   Result:= [paDialog];
  950. End;
  951.  
  952. Procedure TQueryDefParamsEditor.SetValue(const Value: string);
  953. Begin
  954. if GetComponent(0) is TKADaoTable then
  955.   Begin
  956.     inherited SetValue(Value);
  957.     Modified;
  958.   End;
  959. End;
  960.  
  961. Procedure TQueryDefParamsEditor.Edit;
  962. Var
  963.  DT      : TKADaoTable;
  964. Begin
  965.  if GetComponent(0) is TKADaoTable then
  966.   Begin
  967.     DT:=GetComponent(0) AS TKADaoTable;
  968.     if DT.PromptQueryDefParameters Then Modified;
  969.   End;
  970. End;
  971.  
  972.  
  973. //******************************************************************************
  974. Function TMasterFieldsEditor.GetValue: string;
  975. Begin
  976.  Result := '(TStringList)'
  977. End;
  978.  
  979. Function TMasterFieldsEditor.GetAttributes: TPropertyAttributes;
  980. Begin
  981.   Result:= [paDialog];
  982. End;
  983.  
  984. Procedure TMasterFieldsEditor.SetValue(const Value: string);
  985. Begin
  986. if GetComponent(0) is TKADaoTable then
  987.   Begin
  988.     inherited SetValue(Value);
  989.     Modified;
  990.   End;
  991. End;
  992.  
  993. Procedure TMasterFieldsEditor.Edit;
  994. Var
  995.  MT,DT        : TKADaoTable;
  996.  MF,DF,TF     : TStrings;
  997. Begin
  998.  if GetComponent(0) is TKADaoTable then
  999.   Begin
  1000.     DT:=GetComponent(0) AS TKADaoTable;
  1001.     if NOT Assigned(DT.Database) Then Exit;
  1002.     If Not (DT.Database.Connected) Then Exit;
  1003.     if Not Assigned(DT.MasterSource) Then
  1004.        Begin
  1005.         DT.F_Master.Clear;
  1006.         DT.F_Detail.Clear;
  1007.         DT.MasterFields.Clear;
  1008.         DatabaseError(E2052);
  1009.         Exit;
  1010.        End;
  1011.     if NOT (DT.MasterSource.DataSet is TKADaoTable) Then
  1012.        Begin
  1013.         DT.F_Master.Clear;
  1014.         DT.F_Detail.Clear;
  1015.         DT.MasterFields.Clear;
  1016.         DatabaseError(E2053);
  1017.         Exit;
  1018.        End;
  1019.     MT:=DT.MasterSource.DataSet As TKADaoTable;
  1020.     if (DT.Active=False) and Not (csLoading in DT.ComponentState) Then
  1021.        Begin
  1022.          Try
  1023.            DT.Active:=True;
  1024.            DT.Active:=False;
  1025.          Except
  1026.            DT.F_Master.Clear;
  1027.            DT.F_Detail.Clear;
  1028.            DT.MasterFields.Clear;
  1029.            DatabaseError(E2054);
  1030.            Exit;
  1031.          End;
  1032.        End;
  1033.     if (MT.Active=False) and Not (csLoading in DT.ComponentState) Then
  1034.        Begin
  1035.          Try
  1036.            MT.Active:=True;
  1037.            MT.Active:=False;
  1038.          Except
  1039.            DT.F_Master.Clear;
  1040.            DT.F_Detail.Clear;
  1041.            DT.MasterFields.Clear;
  1042.            DatabaseError(E2055);
  1043.            Exit;
  1044.          End;
  1045.        End;
  1046.     MF     := TStringList.Create;
  1047.     DF     := TStringList.Create;
  1048.     TF     := TStringList.Create;
  1049.     MF.SetText(MT.F_MDFieldNames.GetText);
  1050.     DF.SetText(DT.F_MDFieldNames.GetText);
  1051.     TF.SetText(DT.MasterFields.GetText);
  1052.     Application.CreateForm(TMasterDetailForm,MasterDetailForm);
  1053.     if MasterDetailForm.Execute(DF,MF,TF) Then;
  1054.     MasterDetailForm.Free;
  1055.     DT.MasterFields:=TF;
  1056.     MF.Free;
  1057.     DF.Free;
  1058.     TF.Free;
  1059.     Modified;
  1060.   End;
  1061. End;
  1062.  
  1063. procedure TEncrypterEditor.GetValues(Proc: TGetStrProc);
  1064. Begin
  1065.  Designer.GetComponentNames(GetTypeData(TKADaoEncrypter.ClassInfo), Proc);
  1066. End;
  1067.  
  1068. //******************************************************************************
  1069. //                           EDITOR CODE - KADaoInfo
  1070. //******************************************************************************
  1071. //************************************************************ KADaoInfo Editors
  1072. //******************************************************************************
  1073. Function TDIDatabaseNameEditor.GetAttributes: TPropertyAttributes;
  1074. Begin
  1075.   Result:= [paDialog];
  1076. End;
  1077.  
  1078. Procedure TDIDatabaseNameEditor.SetValue(const Value: string);
  1079. Begin
  1080. if GetComponent(0) is TKADaoInfo then
  1081.   Begin
  1082.     inherited SetValue(Value);
  1083.     Modified;
  1084.   End;
  1085. End;
  1086.  
  1087. procedure TDIDatabaseNameEditor.Edit;
  1088. var
  1089.    FileName           : String;
  1090.    DBase              : TKADaoInfo;
  1091.    DlgChooseDatabase  : TOpenDialog;
  1092.    Filter             : String;
  1093. Begin
  1094.    DBase:=TKADaoInfo(GetComponent(0));
  1095.    Filename := DBase.Database;
  1096.    DlgChooseDatabase := TOpenDialog.Create(Nil);
  1097.    if FileName = '' then
  1098.         Begin
  1099.            DlgChooseDatabase.FileName   := '';
  1100.         End
  1101.      Else
  1102.         Begin
  1103.            DlgChooseDatabase.FileName   := ExtractFileName(FileName);
  1104.            DlgChooseDatabase.InitialDir := ExtractFileDir(FileName);
  1105.         End;
  1106.    DlgChooseDatabase.FilterIndex:=1;     
  1107.    Filter:='Microsoft Access (*.mdb)|*.mdb';
  1108.    Filter:=Filter+'|All files (*.*)|*.*';
  1109.    DlgChooseDatabase.Title:='Choose MS Access Database:';
  1110.    DlgChooseDatabase.Options:=[ofPathMustExist,ofFileMustExist,ofHideReadOnly];
  1111.    DlgChooseDatabase.Filter :=Filter;
  1112.    DlgChooseDatabase.DefaultExt:='mdb';
  1113.    if DlgChooseDatabase.Execute then Filename := DlgChooseDatabase.FileName;
  1114.    if Filename <> '' then
  1115.       begin
  1116.       SetStrValue(Filename);
  1117.       Modified;
  1118.       end;
  1119.    DlgChooseDatabase.Free;
  1120. End;
  1121.  
  1122. //******************************************************************************
  1123. Function TDIDLLNameEditor.GetAttributes: TPropertyAttributes;
  1124. Begin
  1125.   Result:= [paDialog];
  1126. End;
  1127.  
  1128. Procedure TDIDLLNameEditor.SetValue(const Value: string);
  1129. Begin
  1130. if GetComponent(0) is TKADaoInfo then
  1131.   Begin
  1132.     inherited SetValue(Value);
  1133.     Modified;
  1134.   End;
  1135. End;
  1136.  
  1137. procedure TDIDLLNameEditor.Edit;
  1138. var
  1139.    FileName           : String;
  1140.    DBase              : TKADaoInfo;
  1141.    DlgChooseDatabase  : TOpenDialog;
  1142.    Filter             : String;
  1143. Begin
  1144.    DBase:=TKADaoInfo(GetComponent(0));
  1145.    Filename := DBase.DaoInfoDll;
  1146.    DlgChooseDatabase := TOpenDialog.Create(Nil);
  1147.    if FileName = '' then
  1148.         Begin
  1149.            DlgChooseDatabase.FileName   := '';
  1150.         End
  1151.      Else
  1152.         Begin
  1153.            DlgChooseDatabase.FileName   := ExtractFileName(FileName);
  1154.            DlgChooseDatabase.InitialDir := ExtractFileDir(FileName);
  1155.         End;
  1156.    Filter:='Windows library (*.dll)|*.dll';
  1157.    Filter:=Filter+'|All files (*.*)|*.*';
  1158.    DlgChooseDatabase.Title:='Choose Micospft DAO Info Library:';
  1159.    DlgChooseDatabase.Options:=[ofPathMustExist,ofFileMustExist,ofHideReadOnly];
  1160.    DlgChooseDatabase.Filter :=Filter;
  1161.    DlgChooseDatabase.DefaultExt:='dll';
  1162.    if DlgChooseDatabase.Execute then Filename := DlgChooseDatabase.FileName;
  1163.    if Filename <> '' then
  1164.       begin
  1165.       SetStrValue(Filename);
  1166.       Modified;
  1167.       end;
  1168.    DlgChooseDatabase.Free;
  1169. End;                                   
  1170.  
  1171. //******************************************************************************
  1172. procedure Register;
  1173. begin
  1174.  //***************** KADaoDBEngine
  1175.  RegisterPropertyEditor(TypeInfo(Integer),TKADaoDBEngine,'EngineType', TEngEngineTypeEditor);
  1176.  RegisterPropertyEditor(TypeInfo(String) ,TKADaoDBEngine,'SystemDatabase',TEngSystemDatabaseNameEditor);
  1177.  {$IFDEF DYNADAO}
  1178.  RegisterPropertyEditor(TypeInfo(String),TKADaoDBEngine, 'Version', TEngDaoVersionEditor);
  1179.  {$ENDIF}
  1180.  //***************** KADaoWorkspace
  1181.  RegisterPropertyEditor(TypeInfo(Integer),TKADaoWorkspace,'EngineType', TWorkEngineTypeEditor);
  1182.  RegisterPropertyEditor(TypeInfo(Integer),TKADaoWorkspace, 'DefaultCursorDriver', TWorkDefaultCursorDriverTypeEditor);
  1183.  //***************** KAAdoDatabase
  1184.  RegisterPropertyEditor(TypeInfo(String),TKADaoDatabase,'DatabaseType',TDBDatabaseTypeEditor);
  1185.  RegisterPropertyEditor(TypeInfo(String),TKADaoDatabase,'Database',TDBDatabaseNameEditor);
  1186.  RegisterPropertyEditor(TypeInfo(String),TKADaoDatabase,'SystemDatabase',TDBSystemDatabaseNameEditor);
  1187.  RegisterPropertyEditor(TypeInfo(Integer),TKADaoDatabase, 'EngineType', TDBEngineTypeEditor);
  1188.  RegisterPropertyEditor(TypeInfo(Integer),TKADaoDatabase, 'DefaultCursorDriver', TDBDefaultCursorDriverTypeEditor);
  1189.  RegisterPropertyEditor(TypeInfo(String),TKADaoDatabase, 'Workspace', TDBWorkspaceEditor);
  1190.  {$IFDEF DYNADAO}
  1191.  RegisterPropertyEditor(TypeInfo(String),TKADaoDatabase, 'Version', TDBDaoVersionEditor);
  1192.  {$ENDIF}
  1193.  //***************** KAAdoTable
  1194.  RegisterPropertyEditor(TypeInfo(String),TKADaoTable,'TableName',TTableNameEditor);
  1195.  RegisterPropertyEditor(TypeInfo(String),TKADaoTable,'QueryDefName',TQueryNameEditor);
  1196.  RegisterPropertyEditor(TypeInfo(String),TKADaoTable,'IndexName',TIndexNameEditor);
  1197.  RegisterPropertyEditor(TypeInfo(Integer),TKADaoTable,'TableType',TTableTypeEditor);
  1198.  RegisterPropertyEditor(TypeInfo(Integer),TKADaoTable,'LockType',TLockTypeEditor);
  1199.  RegisterPropertyEditor(TypeInfo(TStrings),TKADaoTable,'SortedBy',TSortByEditor);
  1200.  RegisterPropertyEditor(TypeInfo(TStrings),TKADaoTable,'QueryDefParameters',TQueryDefParamsEditor);
  1201.  RegisterPropertyEditor(TypeInfo(TStrings),TKADaoTable,'MasterFields',TMasterFieldsEditor);
  1202.  RegisterPropertyEditor(TypeInfo(TComponent),TKADaoTable,'Encrypter',TEncrypterEditor);
  1203.  //***************** KAAdoInfo
  1204.  RegisterPropertyEditor(TypeInfo(String),TKADaoInfo,'Database',TDIDatabaseNameEditor);
  1205.  RegisterPropertyEditor(TypeInfo(String),TKADaoInfo,'DaoInfoDll',TDIDLLNameEditor);
  1206. end;
  1207.  
  1208. end.
  1209.