请教一个问题:如何将一个组件输出为一个DataSource或DataSet?

vicentyan 2001-11-05 11:57:41
就象TDataSource或TADODataset一样?
最好有源程序详细讲解,因为本人是一个菜鸟!谢谢!!
...全文
94 点赞 收藏 3
写回复
3 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
vicentyan 2001-11-07
为何没有人理我???
回复
vicentyan 2001-11-06
就是想让某组件输出一个DataSource,让DBGrid能够获取数据源。
具体的组件声明如下(未完成):
type
TFindCompent = class(TGroupBox)
FindMode:TCombobox;
FindModeLable:Tlabel;

FindString:TEdit;
FindStringLabel:Tlabel;

private
FDataSet: TADODataSet;
FDataSource:TDataSource;

FTableName:string;
FConnectionString:string;
FPlaceMode:integer;

FindModeLeft, FindModeTop, FindModeWidth, FindModeHeight:integer;
FindStringLeft, FindStringTop, FindStringWidth, FindStringHeight:integer;
procedure SetDataSet(ADataSet: TADODataSet);
procedure SetTableName(TableName:string);
Procedure SetConnectionString(ConnectionString:String);
procedure InitFindMode();
{ Private declarations }
protected
Margin:integer;
SubMinWidth:integer;
MinWidth:integer;

procedure Resize; override;
procedure Repositioning;
procedure Paint; override;
procedure SetPlaceMode(PlaceMode:integer); //设置控件放置模式
{ Protected declarations }
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
{ Public declarations }
published
property TableName:string read FTableName write SetTablename;
property Connectionstring:string read FConnectionString write SetConnectionString;
property PlaceMode:integer read FPlaceMode write SetPlaceMode;
property DataSet: TADODataSet read FDataSet write SetDataSet;

{ Published declarations }
end;
回复
cobi 2001-11-06
具体一点
回复
相关推荐
发帖
Delphi
创建于2007-08-02

4925

社区成员

Delphi 开发及应用
申请成为版主
帖子事件
创建了帖子
2001-11-05 11:57
社区公告
暂无公告