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