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

vicentyan 2001-11-05 11:57:41
就象TDataSource或TADODataset一样?
最好有源程序详细讲解,因为本人是一个菜鸟!谢谢!!
...全文
124 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
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
  • 打赏
  • 举报
回复
具体一点

5,388

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧