动态创建显示两个数据库表的问题?

scount 2004-05-05 01:12:58
表: PIPELINESET PIPELINEWORK
项名: pipeID pipeWorkID
PipeNo PipeNO
PIpeName PipeWorkNo
PipeLineName
UserID


代码:

procedure TAttdPipeLineFrm.CreatePipeLinePnlField;
var
pTop,pLeft: longint;
procedure PipeLIneNameField(pFieldName: string)
begin



procedure CreatePnlPipelineNoField(AFieldName,ACaption: string);
begin
with TLabel.Create(PnlPipeLine) do
begin
Parent := PnlPipeLine;
Left := 23;
Top := pTop + 30;
Caption := ACaption;
Name := 'lbl' + AFieldName;
end;
pTop := pTop + 60;
end;

procedure CreatePnlPipelineWorkNoField(AFieldName,ACaption: string);
begin
with TLabel.Create(PnlPipeLine) do
begin
Parent := PnlPipeLine;
Left := pLeft + 90;
Top := pTop;
Caption := ACaption;
Name := 'edt' + AFieldName;
end;
pLeft := pLeft + 90;
end;

begin
inherited;
pTop := 20;
pLeft := 30;
with IDcardDM.dtMaster do
begin
Close;
CommandText := 'select * from AttdPipeLineSet';
Open;
First;
while not Eof do
begin

if FieldByName('PipeNo').AsString <> '' then
CreatePnlPipelineNoField(FieldByName('PipeNo').AsString,FieldByName('PipeName').AsString);
Next;
end;
end;
end;

这上面的代码只是取到了PipeLineSet上的列名显示, 我想对应的显示在PipeLineWork上的的相关数据, 遇到的问题是怎么在PipeLineSet中顺序取到一个唯一的值给PipeLineWork做循环条件, 改怎么写?
...全文
42 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
scount 2004-05-05
  • 打赏
  • 举报
回复
菜鸟的问题, 有答就有分!

5,386

社区成员

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

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