⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ado_qimport2reg.pas

📁 Delphi Advanced Import Component_v2.48.With Full Source.
💻 PAS
字号:
unit ADO_QImport2Reg;

{$I VerCtrl.inc}

interface

uses Classes {$IFNDEF VCL6}, DsgnIntf
    {$ELSE}, DesignIntf, DesignEditors{$ENDIF} , QImport2Reg;

type
  TQAccessFileNameProperty = class(TQFileNameProperty)
  protected
    function GetDefaultExt: string; override;
    function GetFilter: string; override;
  end;

  TQAccessTableNameProperty = class(TStringProperty)
  public
    function GetAttributes: TPropertyAttributes; override;
    procedure GetValues(Proc: TGetStrProc); override;
  end;

procedure Register;

implementation

uses QImport2, QImport2Common, QImport2StrIDs, ADO_QImport2Wizard,
  ADO_QImport2Access;

{$R *.dcr}

procedure Register;
begin
  RegisterComponents(QI_PALETTE_PAGE, [TADO_QImport2Wizard,
                                       TADO_QImport2Access]);
  RegisterPropertyEditor(TypeInfo(string), TADO_QImport2Access, 'FileName',
                         TQAccessFileNameProperty);
  RegisterPropertyEditor(TypeInfo(string), TADO_QImport2Access, 'TableName',
                         TQAccessTableNameProperty);
  RegisterPropertyEditor(TypeInfo(string), TADO_QImport2Wizard, 'FileName',
                         TQWizardFileNameProperty);
  RegisterPropertyEditor(TypeInfo(string), TADO_QImport2Wizard, 'About',
                         TQImportAboutProperty);
  RegisterPropertyEditor(TypeInfo(string), TADO_QImport2Wizard, 'Version',
                         TQImportVersionProperty);
  RegisterPropertyEditor(TypeInfo(string), TADO_QImport2Wizard, 'TemplateFileName',
                         TQTemplateFileNameProperty);

  RegisterComponentEditor(TADO_QImport2Wizard, TQImportWizardEditor);
end;

{ TQAccessFileNameProperty }

function TQAccessFileNameProperty.GetDefaultExt: string;
begin
  Result := 'mdb';
end;

function TQAccessFileNameProperty.GetFilter: string;
begin
  Result := QImportLoadStr(QIF_Access);
end;

{ TQAccessTableNameProperty }

function TQAccessTableNameProperty.GetAttributes: TPropertyAttributes;
begin
  Result := [paValueList, paSortList];
end;

procedure TQAccessTableNameProperty.GetValues(Proc: TGetStrProc);
var
  Imp: TADO_QImport2Access;
  List: TStrings;
  i: integer;
begin
  Imp := GetComponent(0) as TADO_QImport2Access;
  List := TStringList.Create;
  try
    Imp.GetTableNames(List);
    for i := 0 to List.Count - 1 do Proc(List[i]);
  finally
    List.Free;
  end;
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -