暂时没有时间写,谢谢您的光临

 

{问题使者样的我想重写tadoquery控件相关事件,例如AfterOpen,AfterClose相关事件
由于我所用到的TadoQuery控件在打开和关闭时都调用需要调用同一个函数,所以想重新封装一下
TAdoQuery控件
我的简单代码
如下:}
unit   YHCADOQuery;

interface

uses
    SysUtils,   Classes,   DB,   ADODB;

type
    TYHCADOQuery   =   class(TADOQuery)
    private
        {   Private   declarations   }
        sDefaultWhere:   String;
        sOrderBy:   String;
        sViewName:   String;
        function   GetDefaultWhere:   String;
        procedure   SetDefaultWhere(const   Value:   String);
        function   GetOrderBy:   String;
        procedure   SetOrderBy(const   Value:   String);
        function   GetViewName:   String;
        procedure   SetViewName(const   Value:   String);
        procedure   AfterOpen(DataSet:   TDataSet);
    protected
        {   Protected   declarations   }
    public
        {   Public   declarations   }
    published
        {   Published   declarations}
        //自己增加几个自定义属性
        property   ViewName:   String   read   GetViewName   write   SetViewName;
        property   DefaultWhere:   String   read   GetDefaultWhere   write   SetDefaultWhere;
        property   OrderBy:   String   read   GetOrderBy   write   SetOrderBy;
    end;

procedure   Register;

implementation

procedure   Register;
begin
    RegisterComponents( "RedSuper ",   [TYHCADOQuery]);
end;

function   TYHCADOQuery.GetDefaultWhere:   String;
begin
    Result   :=   sDefaultWhere;
end;

procedure   TYHCADOQuery.SetDefaultWhere(const   Value:   String);
begin
    sDefaultWhere   :=   Value;
end;
function   TYHCADOQuery.GetOrderBy:   String;
begin
    Result   :=   sOrderBy;
end;
procedure   TYHCADOQuery.SetOrderBy(const   Value:   String);
begin
    sOrderBy   :=   Value;
end;
function   TYHCADOQuery.GetViewName:   String;
begin
    Result   :=   sViewName;
end;
procedure   TYHCADOQuery.SetViewName(const   Value:   String);
begin
    sViewName   :=   Value;
end;
procedure   TYHCADOQuery.AfterOpen(DataSet:   TDataSet);
begin
//但是事件不知道怎么写了,请教大侠帮忙。
    inherited;
end;
end.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值