home *** CD-ROM | disk | FTP | other *** search
/ Chip 1997 April / Chip_1997-04_cd.bin / prezent / cb / data.z / DBREG.PAS < prev    next >
Pascal/Delphi Source File  |  1997-01-16  |  22KB  |  797 lines

  1.  
  2. {*******************************************************}
  3. {                                                       }
  4. {       Delphi Visual Component Library                 }
  5. {                                                       }
  6. {       Copyright (c) 1995,96 Borland International     }
  7. {                                                       }
  8. {*******************************************************}
  9.  
  10. unit DBReg;
  11.  
  12. interface
  13.  
  14. procedure Register;
  15.  
  16. implementation
  17.  
  18. uses
  19.   SysUtils, Classes, DsgnIntf, Controls, Forms, DB, DBTables, DBCtrls,
  20.   DBGrids,
  21.   DBCGrids,
  22.   Report,
  23.   MaskProp, MaskText, Mask, DBConsts, DBLookup, DSDesign, DBEdit, FldLinks,
  24.   TypInfo, EditIntf, ExptIntf, ToolIntf, LibConst, QBE, QBindDlg, ProcDlg,
  25.   IxEdit, dbColEdt, DbxTarg, UpdSqlEd, DbXPlor, DBExpt, DBInpReq;
  26.  
  27. { TDataSetEditor }
  28.  
  29. type
  30.   TDataSetEditor = class(TComponentEditor)
  31.     procedure ExecuteVerb(Index: Integer); override;
  32.     function GetVerb(Index: Integer): string; override;
  33.     function GetVerbCount: Integer; override;
  34.   end;
  35.  
  36. procedure TDataSetEditor.ExecuteVerb(Index: Integer);
  37. begin
  38.   case Index of
  39.     0: ShowDatasetDesigner(Designer, TTable(Component));
  40.     1: ExploreDataset(TDBDataset(Component));
  41.   end;
  42. end;
  43.  
  44. function TDataSetEditor.GetVerb(Index: Integer): string;
  45. begin
  46.   case Index of
  47.     0: Result := LoadStr(SDatasetDesigner);
  48.     1: Result := LoadStr(SExplore);
  49.   end;
  50. end;
  51.  
  52. function TDataSetEditor.GetVerbCount: Integer;
  53. begin
  54.   Result := Ord(Component is TDBDataset) + 1;
  55. end;
  56.  
  57. { TDatabaseEditor }
  58.  
  59. type
  60.   TDatabaseEditor = class(TComponentEditor)
  61.     procedure ExecuteVerb(Index: Integer); override;
  62.     function GetVerb(Index: Integer): string; override;
  63.     function GetVerbCount: Integer; override;
  64.   end;
  65.  
  66. procedure TDatabaseEditor.ExecuteVerb(Index: Integer);
  67. begin
  68.   case Index of
  69.     0: if EditDatabase(TDatabase(Component)) then Designer.Modified;
  70.     1: ExploreDatabase(TDatabase(Component));
  71.   end;
  72. end;
  73.  
  74. function TDatabaseEditor.GetVerb(Index: Integer): string;
  75. begin
  76.   case Index of
  77.     0: Result := LoadStr(SDatabaseEditor);
  78.     1: Result := LoadStr(SExplore);
  79.   end;
  80. end;
  81.  
  82. function TDatabaseEditor.GetVerbCount: Integer;
  83. begin
  84.   Result := 2;
  85. end;
  86.  
  87. { TBatchMoveEditor }
  88.  
  89. type
  90.   TBatchMoveEditor = class(TDefaultEditor)
  91.     procedure ExecuteVerb(Index: Integer); override;
  92.     function GetVerb(Index: Integer): string; override;
  93.     function GetVerbCount: Integer; override;
  94.   end;
  95.  
  96. procedure TBatchMoveEditor.ExecuteVerb(Index: Integer);
  97. begin
  98.   TBatchMove(Component).Execute;
  99. end;
  100.  
  101. function TBatchMoveEditor.GetVerb(Index: Integer): string;
  102. begin
  103.   Result := LoadStr(SBatchExecute);
  104. end;
  105.  
  106. function TBatchMoveEditor.GetVerbCount: Integer;
  107. begin
  108.   Result := 1;
  109. end;
  110.  
  111. { TDataSetProperty }
  112.  
  113. type
  114.   TDataSetProperty = class(TComponentProperty)
  115.   private
  116.     FCheckProc: TGetStrProc;
  117.     procedure CheckComponent(const Value: string);
  118.   public
  119.     procedure GetValues(Proc: TGetStrProc); override;
  120.   end;
  121.  
  122. procedure TDataSetProperty.CheckComponent(const Value: string);
  123. var
  124.   J: Integer;
  125.   Dataset: TDataset;
  126. begin
  127.   Dataset := TDataset(Designer.GetComponent(Value));
  128.   for J := 0 to PropCount - 1 do
  129.     if TDataSource(GetComponent(J)).IsLinkedTo(Dataset) then
  130.       Exit;
  131.   FCheckProc(Value);
  132. end;
  133.  
  134. procedure TDataSetProperty.GetValues(Proc: TGetStrProc);
  135. begin
  136.   FCheckProc := Proc;
  137.   inherited GetValues(CheckComponent);
  138. end;
  139.  
  140. { TDataSourceProperty }
  141.  
  142. type
  143.   TDataSourceProperty = class(TComponentProperty)
  144.   private
  145.     FCheckProc: TGetStrProc;
  146.     procedure CheckComponent(const Value: string);
  147.   public
  148.     procedure GetValues(Proc: TGetStrProc); override;
  149.   end;
  150.  
  151. procedure TDataSourceProperty.CheckComponent(const Value: string);
  152. var
  153.   J: Integer;
  154.   DataSource: TDataSource;
  155. begin
  156.   DataSource := TDataSource(Designer.GetComponent(Value));
  157.   for J := 0 to PropCount - 1 do
  158.     if TDataSet(GetComponent(J)).IsLinkedTo(DataSource) then
  159.       Exit;
  160.   FCheckProc(Value);
  161. end;
  162.  
  163. procedure TDataSourceProperty.GetValues(Proc: TGetStrProc);
  164. begin
  165.   FCheckProc := Proc;
  166.   inherited GetValues(CheckComponent);
  167. end;
  168.  
  169. { TDBStringProperty }
  170.  
  171. type
  172.   TDBStringProperty = class(TStringProperty)
  173.   public
  174.     function GetAttributes: TPropertyAttributes; override;
  175.     procedure GetValueList(List: TStrings); virtual; abstract;
  176.     procedure GetValues(Proc: TGetStrProc); override;
  177.   end;
  178.  
  179. function TDBStringProperty.GetAttributes: TPropertyAttributes;
  180. begin
  181.   Result := [paValueList, paSortList, paMultiSelect];
  182. end;
  183.  
  184. procedure TDBStringProperty.GetValues(Proc: TGetStrProc);
  185. var
  186.   I: Integer;
  187.   Values: TStringList;
  188. begin
  189.   Values := TStringList.Create;
  190.   try
  191.     GetValueList(Values);
  192.     for I := 0 to Values.Count - 1 do Proc(Values[I]);
  193.   finally
  194.     Values.Free;
  195.   end;
  196. end;
  197.  
  198. { TSessionNameProperty }
  199.  
  200. type
  201.   TSessionNameProperty = class(TDBStringProperty)
  202.   public
  203.     procedure GetValueList(List: TStrings); override;
  204.   end;
  205.  
  206. procedure TSessionNameProperty.GetValueList(List: TStrings);
  207. begin
  208.   Sessions.GetSessionNames(List);
  209. end;
  210.  
  211. { TDatabaseNameProperty }
  212.  
  213. type
  214.   TDatabaseNameProperty = class(TDBStringProperty)
  215.   public
  216.     procedure GetValueList(List: TStrings); override;
  217.   end;
  218.  
  219. procedure TDatabaseNameProperty.GetValueList(List: TStrings);
  220. begin
  221.   (GetComponent(0) as TDBDataSet).DBSession.GetDatabaseNames(List);
  222. end;
  223.  
  224. { TAliasNameProperty }
  225.  
  226. type
  227.   TAliasNameProperty = class(TDBStringProperty)
  228.   public
  229.     procedure GetValueList(List: TStrings); override;
  230.   end;
  231.  
  232. procedure TAliasNameProperty.GetValueList(List: TStrings);
  233. begin
  234.   (GetComponent(0) as TDatabase).Session.GetAliasNames(List);
  235. end;
  236.  
  237. { TDriverNameProperty }
  238.  
  239. type
  240.   TDriverNameProperty = class(TDBStringProperty)
  241.   public
  242.     procedure GetValueList(List: TStrings); override;
  243.   end;
  244.  
  245. procedure TDriverNameProperty.GetValueList(List: TStrings);
  246. begin
  247.   (GetComponent(0) as TDatabase).Session.GetDriverNames(List);
  248. end;
  249.  
  250. { TTableNameProperty }
  251.  
  252. type
  253.   TTableNameProperty = class(TDBStringProperty)
  254.   public
  255.     procedure GetValueList(List: TStrings); override;
  256.   end;
  257.  
  258. procedure TTableNameProperty.GetValueList(List: TStrings);
  259. const
  260.   Masks: array[TTableType] of string[5] = ('', '*.DB', '*.DBF', '*.TXT');
  261. var
  262.   Table: TTable;
  263. begin
  264.   Table := GetComponent(0) as TTable;
  265.   Table.DBSession.GetTableNames(Table.DatabaseName, Masks[Table.TableType],
  266.     Table.TableType = ttDefault, False, List);
  267. end;
  268.  
  269. { TIndexNameProperty }
  270.  
  271. type
  272.   TIndexNameProperty = class(TDBStringProperty)
  273.   public
  274.     procedure GetValueList(List: TStrings); override;
  275.   end;
  276.  
  277. procedure TIndexNameProperty.GetValueList(List: TStrings);
  278. begin
  279.   (GetComponent(0) as TTable).GetIndexNames(List);
  280. end;
  281.  
  282. { TProcedureNameProperty }
  283.  
  284. type
  285.   TProcedureNameProperty = class(TDBStringProperty)
  286.   public
  287.     procedure GetValueList(List: TStrings); override;
  288.   end;
  289.  
  290. procedure TProcedureNameProperty.GetValueList(List: TStrings);
  291. var
  292.   DBDataSet: TDBDataSet;
  293. begin
  294.   DBDataSet := GetComponent(0) as TDBDataSet;
  295.   DBDataSet.DBSession.GetStoredProcNames(DBDataSet.DatabaseName, List);
  296. end;
  297.  
  298. { TIndexFieldNamesProperty }
  299.  
  300. type
  301.   TIndexFieldNamesProperty = class(TDBStringProperty)
  302.   public
  303.     procedure GetValueList(List: TStrings); override;
  304.   end;
  305.  
  306. procedure TIndexFieldNamesProperty.GetValueList(List: TStrings);
  307. var
  308.   I: Integer;
  309. begin
  310.   with GetComponent(0) as TTable do
  311.   begin
  312.     IndexDefs.Update;
  313.     for I := 0 to IndexDefs.Count - 1 do
  314.       with IndexDefs[I] do
  315.         if not (ixExpression in Options) then List.Add(Fields);
  316.   end;
  317. end;
  318.  
  319. { TDataFieldProperty }
  320.  
  321. type
  322.   TDataFieldProperty = class(TDBStringProperty)
  323.   public
  324.     function GetDataSourcePropName: string; virtual;
  325.     procedure GetValueList(List: TStrings); override;
  326.   end;
  327.  
  328. function TDataFieldProperty.GetDataSourcePropName: string;
  329. begin
  330.   Result := 'DataSource';
  331. end;
  332.  
  333. procedure TDataFieldProperty.GetValueList(List: TStrings);
  334. var
  335.   Instance: TComponent;
  336.   PropInfo: PPropInfo;
  337.   DataSource: TDataSource;
  338. begin
  339.   Instance := GetComponent(0);
  340.   PropInfo := TypInfo.GetPropInfo(Instance.ClassInfo, GetDataSourcePropName);
  341.   if (PropInfo <> nil) and (PropInfo^.PropType^.Kind = tkClass) then
  342.   begin
  343.     DataSource := TObject(GetOrdProp(Instance, PropInfo)) as TDataSource;
  344.     if (DataSource <> nil) and (DataSource.DataSet <> nil) then
  345.       DataSource.DataSet.GetFieldNames(List);
  346.   end;
  347. end;
  348.  
  349. { TLookupSourceProperty }
  350.  
  351. type
  352.   TLookupSourceProperty = class(TDBStringProperty)
  353.   public
  354.     procedure GetValueList(List: TStrings); override;
  355.   end;
  356.  
  357. procedure TLookupSourceProperty.GetValueList(List: TStrings);
  358. begin
  359.   with GetComponent(0) as TField do
  360.     if DataSet <> nil then DataSet.GetFieldNames(List);
  361. end;
  362.  
  363. { TLookupDestProperty }
  364.  
  365. type
  366.   TLookupDestProperty = class(TDBStringProperty)
  367.   public
  368.     procedure GetValueList(List: TStrings); override;
  369.   end;
  370.  
  371. procedure TLookupDestProperty.GetValueList(List: TStrings);
  372. begin
  373.   with GetComponent(0) as TField do
  374.     if LookupDataSet <> nil then LookupDataSet.GetFieldNames(List);
  375. end;
  376.  
  377. { TListFieldProperty }
  378.  
  379. type
  380.   TListFieldProperty = class(TDataFieldProperty)
  381.   public
  382.     function GetDataSourcePropName: string; override;
  383.   end;
  384.  
  385. function TListFieldProperty.GetDataSourcePropName: string;
  386. begin
  387.   Result := 'ListSource';
  388. end;
  389.  
  390. { TLookupFieldProperty }
  391.  
  392. type
  393.   TLookupFieldProperty = class(TDataFieldProperty)
  394.   public
  395.     function GetDataSourcePropName: string; override;
  396.   end;
  397.  
  398. function TLookupFieldProperty.GetDataSourcePropName: string;
  399. begin
  400.   Result := 'LookupSource';
  401. end;
  402.  
  403. { TLookupIndexProperty }
  404.  
  405. type
  406.   TLookupIndexProperty = class(TLookupFieldProperty)
  407.   public
  408.     procedure GetValueList(List: TStrings); override;
  409.   end;
  410.  
  411. procedure TLookupIndexProperty.GetValueList(List: TStrings);
  412. var
  413.   Instance: TComponent;
  414.   PropInfo: PPropInfo;
  415.   DataSource: TDataSource;
  416. begin
  417.   Instance := GetComponent(0);
  418.   PropInfo := TypInfo.GetPropInfo(Instance.ClassInfo, GetDataSourcePropName);
  419.   if (PropInfo <> nil) and (PropInfo^.PropType^.Kind = tkClass) then
  420.   begin
  421.     DataSource := TObject(GetOrdProp(Instance, PropInfo)) as TDataSource;
  422.     if (DataSource <> nil) and (DataSource.DataSet <> nil) then
  423.     begin
  424.       if (DataSource.DataSet is TTable) and
  425.           (TTable(DataSource.DataSet).IndexFieldCount > 0) then
  426.         List.Add(TTable(DataSource.DataSet).IndexFields[0].FieldName)
  427.       else
  428.         DataSource.DataSet.GetFieldNames(List);
  429.     end;
  430.   end;
  431. end;
  432.  
  433. { TDBImageEditor }
  434.  
  435. type
  436.   TDBImageEditor = class(TDefaultEditor)
  437.   public
  438.     procedure Copy; override;
  439.   end;
  440.  
  441. procedure TDBImageEditor.Copy;
  442. begin
  443.   TDBImage(Component).CopyToClipboard;
  444. end;
  445.  
  446. { TQueryEditor }
  447.  
  448. type
  449.   TQueryEditor = class(TComponentEditor)
  450.   private
  451.     procedure ExecuteVerb(Index: Integer); override;
  452.     function GetVerb(Index: Integer): string; override;
  453.     function GetVerbCount: Integer; override;
  454.   end;
  455.  
  456. procedure TQueryEditor.ExecuteVerb(Index: Integer);
  457. var
  458.   Query: TQuery;
  459.   List: TParams;
  460. begin
  461.   Query := Component as TQuery;
  462.   case Index of
  463.     0: ShowDatasetDesigner(Designer, TTable(Component));
  464.     1:
  465.       begin
  466.         List := TParams.Create;
  467.         try
  468.           List.Assign(Query.Params);
  469.           if EditQueryParams(Query, List) then
  470.           begin
  471.             Query.Close;
  472.             Query.Params := List;
  473.             if Designer <> nil then Designer.Modified;
  474.           end;
  475.         finally
  476.           List.Free;
  477.         end;
  478.      end;
  479.     2: ExploreDataset(TDBDataset(Component));
  480.     3:
  481.       begin
  482.         ExecBuilder(Query);
  483.         if Designer <> nil then Designer.Modified;
  484.       end;
  485.   end;
  486. end;
  487.  
  488. function TQueryEditor.GetVerb(Index: Integer): string;
  489. begin
  490.   case Index of
  491.     0: Result := LoadStr(SSQLDatasetDesigner);
  492.     1: Result := LoadStr(SBindVerb);
  493.     2: Result := LoadStr(SExplore);
  494.     3: Result := LoadStr(SQBEVerb);
  495.   end;
  496. end;
  497.  
  498. function TQueryEditor.GetVerbCount: Integer;
  499. begin
  500.   if not VQBLoadAttempted then InitVQB;
  501.   if VQBLoaded then Result := 4
  502.   else Result := 3;
  503. end;
  504.  
  505. { TStoredProcEditor }
  506.  
  507. procedure EditStoredProcParams(StoredProc: TStoredProc; Designer: TDesigner);
  508. var
  509.   List: TParams;
  510. begin
  511.   List := TParams.Create;
  512.   try
  513.     StoredProc.CopyParams(List);
  514.     if EditProcParams(StoredProc, List) then
  515.     begin
  516.       StoredProc.Params := List;
  517.       if Designer <> nil then Designer.Modified;
  518.     end;
  519.   finally
  520.     List.Free;
  521.   end;
  522. end;
  523.  
  524. type
  525.   TStoredProcEditor = class(TComponentEditor)
  526.   private
  527.     procedure Edit; override;
  528.     procedure ExecuteVerb(Index: Integer); override;
  529.     function GetVerb(Index: Integer): string; override;
  530.     function GetVerbCount: Integer; override;
  531.   end;
  532.  
  533. procedure TStoredProcEditor.Edit;
  534. begin
  535.   ShowDatasetDesigner(Designer, TTable(Component));
  536. end;
  537.  
  538. procedure TStoredProcEditor.ExecuteVerb(Index: Integer);
  539. var
  540.   StoredProc: TStoredProc;
  541. begin
  542.   StoredProc := Component as TStoredProc;
  543.   case Index of
  544.     0: Edit;
  545.     1: EditStoredProcParams(StoredProc, Designer);
  546.     2: ExploreDataset(StoredProc);
  547.   end;
  548. end;
  549.  
  550. function TStoredProcEditor.GetVerb(Index: Integer): string;
  551. begin
  552.   case Index of
  553.     0: Result := LoadStr(SDatasetDesigner);
  554.     1: Result := LoadStr(SBindVerb);
  555.     2: Result := LoadStr(SExplore);
  556.   end;
  557. end;
  558.  
  559. function TStoredProcEditor.GetVerbCount: Integer;
  560. begin
  561.   Result := 3;
  562. end;
  563.  
  564. { TParamsProperty }
  565.  
  566. type
  567.   TParamsProperty = class(TPropertyEditor)
  568.   public
  569.     function GetValue: string; override;
  570.     function GetAttributes: TPropertyAttributes; override;
  571.   end;
  572.  
  573. function TParamsProperty.GetValue: string;
  574. begin
  575.   Result := Format('(%s)', [TParams.ClassName]);
  576. end;
  577.  
  578. function TParamsProperty.GetAttributes: TPropertyAttributes;
  579. begin
  580.   Result := [paMultiSelect, paDialog];
  581. end;
  582.  
  583. { TStoredParamsProperty }
  584.  
  585. type
  586.   TStoredParamsProperty = class(TParamsProperty)
  587.     procedure Edit; override;
  588.   end;
  589.  
  590. procedure TStoredParamsProperty.Edit;
  591. begin
  592.   EditStoredProcParams(GetComponent(0) as TStoredProc, Designer);
  593. end;
  594.  
  595. { TQueryParamsProperty }
  596.  
  597. type
  598.   TQueryParamsProperty = class(TParamsProperty)
  599.     procedure Edit; override;
  600.   end;
  601.  
  602. procedure TQueryParamsProperty.Edit;
  603. var
  604.   List: TParams;
  605.   Query: TQuery;
  606. begin
  607.   Query := GetComponent(0) as TQuery;
  608.   List := TParams.Create;
  609.   try
  610.     List.Assign(Query.Params);
  611.     if EditQueryParams(Query, List) and not List.IsEqual(Query.Params) then
  612.     begin
  613.       Modified;
  614.       Query.Close;
  615.       Query.Params := List;
  616.     end;
  617.   finally
  618.     List.Free;
  619.   end;
  620. end;
  621.  
  622. { TIndexFilesProperty }
  623.  
  624. type
  625.   TIndexFilesProperty = class(TPropertyEditor)
  626.   public
  627.     function GetAttributes: TPropertyAttributes; override;
  628.     procedure Edit; override;
  629.     function GetValue: string; override;
  630.   end;
  631.  
  632. function TIndexFilesProperty.GetAttributes: TPropertyAttributes;
  633. begin
  634.   Result := [paDialog, paReadOnly];
  635. end;
  636.  
  637. function TIndexFilesProperty.GetValue: string;
  638. begin
  639.   Result := Format('(%s)', [TIndexFiles.ClassName]);
  640. end;
  641.  
  642. procedure TIndexFilesProperty.Edit;
  643. var
  644.   List: TStringList;
  645.   Table: TTable;
  646.   I: Integer;
  647.   IndexFile: string;
  648. begin
  649.   Table := GetComponent(0) as TTable;
  650.   List := TStringList.Create;
  651.   try
  652.     List.Assign(Table.IndexFiles);
  653.     if EditIndexFiles(Table, List) then
  654.     begin
  655.       for I := 0 to List.Count - 1 do
  656.       begin
  657.         IndexFile := List[I];
  658.         with Table.IndexFiles do
  659.           if IndexOf(IndexFile) = -1 then Add(IndexFile);
  660.       end;
  661.       for I := Table.IndexFiles.Count - 1 downto 0 do
  662.       begin
  663.         IndexFile := Table.IndexFiles[I];
  664.         with Table.IndexFiles do
  665.           if List.IndexOf(IndexFile) = -1 then Delete(IndexOf(IndexFile));
  666.       end;
  667.       Modified;
  668.     end;
  669.   finally
  670.     List.Free;
  671.   end;
  672. end;
  673.  
  674. { TDBColumnAttributesProperty }
  675.  
  676. type
  677.   TDBColumnAttributesProperty = class(TClassProperty)
  678.   public
  679.     procedure Edit; override;
  680.     function GetAttributes: TPropertyAttributes; override;
  681.   end;
  682.  
  683. procedure TDBColumnAttributesProperty.Edit;
  684. begin
  685.   if EditDBGridColumns(TDBGridColumns(GetOrdValue)) then Modified;
  686. end;
  687.  
  688. function TDBColumnAttributesProperty.GetAttributes: TPropertyAttributes;
  689. begin
  690.   Result := [paDialog, paReadOnly];
  691. end;
  692.  
  693. { TDBGridEditor }
  694. type
  695.   TDBGridEditor = class(TComponentEditor)
  696.     procedure ExecuteVerb(Index: Integer); override;
  697.     function GetVerb(Index: Integer): string; override;
  698.     function GetVerbCount: Integer; override;
  699.   end;
  700.  
  701. procedure TDBGridEditor.ExecuteVerb(Index: Integer);
  702. begin
  703.   if EditDBGridColumns(TDBGrid(Component).Columns) then
  704.     Designer.Modified;
  705. end;
  706.  
  707. function TDBGridEditor.GetVerb(Index: Integer): string;
  708. begin
  709.   Result := LoadStr(SDBGridColEditor);
  710. end;
  711.  
  712. function TDBGridEditor.GetVerbCount: Integer;
  713. begin
  714.   Result := 1;
  715. end;
  716.  
  717. { TUpdateSQLEditor }
  718.  
  719. type
  720.   TUpdateSQLEditor = class(TComponentEditor)
  721.     procedure ExecuteVerb(Index: Integer); override;
  722.     function GetVerb(Index: Integer): string; override;
  723.     function GetVerbCount: Integer; override;
  724.   end;
  725.  
  726. procedure TUpdateSQLEditor.ExecuteVerb(Index: Integer);
  727. begin
  728.   if EditUpdateSQL(TUpdateSQL(Component)) then Designer.Modified;
  729. end;
  730.  
  731. function TUpdateSQLEditor.GetVerb(Index: Integer): string;
  732. begin
  733.   Result := LoadStr(SUpdateSQLEditor);
  734. end;
  735.  
  736. function TUpdateSQLEditor.GetVerbCount: Integer;
  737. begin
  738.   Result := 1;
  739. end;
  740.  
  741. { Registration }
  742.  
  743. procedure Register;
  744. begin
  745.   RegisterComponents(LoadStr(srDAccess), [TDataSource, TTable, TQuery,
  746.     TStoredProc, TDatabase, TSession, TBatchMove, TUpdateSQL]);
  747.   RegisterComponents(LoadStr(srDControls), [TDBGrid, TDBNavigator, TDBText,
  748.     TDBEdit, TDBMemo, TDBImage, TDBListBox, TDBComboBox, TDBCheckBox,
  749.     TDBRadioGroup, TDBLookupListBox, TDBLookupComboBox]);
  750.   RegisterComponents(LoadStr(srDControls), [TDBCtrlGrid]);
  751.   RegisterComponents(LoadStr(srWin31), [TDBLookupList, TDBLookupCombo]);
  752.   RegisterNoIcon([TField]);
  753.   RegisterFields([TStringField, TIntegerField, TSmallintField, TWordField,
  754.     TFloatField, TCurrencyField, TBCDField, TBooleanField, TDateField,
  755.     TVarBytesField, TBytesField, TTimeField, TDateTimeField,
  756.     TBlobField, TMemoField, TGraphicField, TAutoIncField]);
  757.   RegisterPropertyEditor(TypeInfo(TDataSet), TDataSource, 'DataSet', TDataSetProperty);
  758.   RegisterPropertyEditor(TypeInfo(TDataSource), TTable, 'MasterSource', TDataSourceProperty);
  759.   RegisterPropertyEditor(TypeInfo(TDataSource), TQuery, 'DataSource', TDataSourceProperty);
  760.   RegisterPropertyEditor(TypeInfo(string), TDatabase, 'AliasName', TAliasNameProperty);
  761.   RegisterPropertyEditor(TypeInfo(string), TDatabase, 'DriverName', TDriverNameProperty);
  762.   RegisterPropertyEditor(TypeInfo(string), TDatabase, 'SessionName', TSessionNameProperty);
  763.   RegisterPropertyEditor(TypeInfo(string), TDBDataSet, 'SessionName', TSessionNameProperty);
  764.   RegisterPropertyEditor(TypeInfo(string), TDBDataSet, 'DatabaseName', TDatabaseNameProperty);
  765.   RegisterPropertyEditor(TypeInfo(TDataSetUpdateObject), TDataSet, 'UpdateObject', TComponentProperty);
  766.   RegisterPropertyEditor(TypeInfo(string), TTable, 'TableName', TTableNameProperty);
  767.   RegisterPropertyEditor(TypeInfo(string), TTable, 'IndexName', TIndexNameProperty);
  768.   RegisterPropertyEditor(TypeInfo(string), TTable, 'IndexFieldNames', TIndexFieldNamesProperty);
  769.   RegisterPropertyEditor(TypeInfo(string), TField, 'KeyFields', TLookupSourceProperty);
  770.   RegisterPropertyEditor(TypeInfo(string), TField, 'LookupKeyFields', TLookupDestProperty);
  771.   RegisterPropertyEditor(TypeInfo(string), TField, 'LookupResultField', TLookupDestProperty);
  772.   RegisterPropertyEditor(TypeInfo(string), TComponent, 'DataField', TDataFieldProperty);
  773.   RegisterPropertyEditor(TypeInfo(string), TDBLookupControl, 'KeyField', TListFieldProperty);
  774.   RegisterPropertyEditor(TypeInfo(string), TDBLookupControl, 'ListField', TListFieldProperty);
  775.   RegisterPropertyEditor(TypeInfo(string), TWinControl, 'LookupField', TLookupIndexProperty);
  776.   RegisterPropertyEditor(TypeInfo(string), TWinControl, 'LookupDisplay', TLookupFieldProperty);
  777.   RegisterPropertyEditor(TypeInfo(string), TDBEdit, 'EditMask', TMaskProperty);
  778.   RegisterPropertyEditor(TypeInfo(string), TField, 'EditMask', TMaskProperty);
  779.   RegisterPropertyEditor(TypeInfo(string), TTable, 'MasterFields', TFieldLinkProperty);
  780.   RegisterPropertyEditor(TypeInfo(TParams), TQuery, 'Params', TQueryParamsProperty);
  781.   RegisterPropertyEditor(TypeInfo(string), TStoredProc, 'StoredProcName', TProcedureNameProperty);
  782.   RegisterPropertyEditor(TypeInfo(TParams), TStoredProc, 'Params', TStoredParamsProperty);
  783.   RegisterPropertyEditor(TypeInfo(TStrings), TTable, 'IndexFiles', TIndexFilesProperty);
  784.   RegisterPropertyEditor(TypeInfo(TDBGridColumns), nil, '', TDBColumnAttributesProperty);
  785.   RegisterComponentEditor(TDataset, TDataSetEditor);
  786.   RegisterComponentEditor(TDatabase, TDatabaseEditor);
  787.   RegisterComponentEditor(TBatchMove, TBatchMoveEditor);
  788.   RegisterComponentEditor(TQuery, TQueryEditor);
  789.   RegisterComponentEditor(TDBImage, TDBImageEditor);
  790.   RegisterComponentEditor(TStoredProc, TStoredProcEditor);
  791.   RegisterComponentEditor(TDBGrid, TDBGridEditor);
  792.   RegisterComponentEditor(TUpdateSQL, TUpdateSQLEditor);
  793.   DBExpt.Register;
  794. end;
  795.  
  796. end.
  797.