H
haiyuinfo
Unregistered / Unconfirmed
GUEST, unregistred user!
u_CompFrame 单元
procedure Tfrm_CompFrame.FillControlsComp( rs:tadoDataset);
begin
txtNameCshort.Text:= trim(rs.FieldByName('NameCshort').asstring);
txtNameC.Text:=trim(rs.FieldByName('NameC').asstring);
end;
U_common 单元:
function GetTable(strsql:string;ErrMsg:string;[red]RunPro:TMethod[/red]):integer;
var
rs:TadoDataset;
begin
try
rs:=TADODataSet.Create(application);
rs.Connection :=frm_main.Acon;
rs.CommandText:=strsql;
rs.Open;
if not rs.eof then
begin
result:=1;
[red] RunPro(rs) 如何将RunPro 指向 FillControlsComp(rs) [/red]
end
else
result:=0;
rs.Close;
rs.Destroy;
except
on E:exception do
begin
result:=-1;
frm_main.suiMessageDialogError.Text:=trim(ErrMsg);
frm_main.suiMessageDialogError.ShowModal;
exit;
end;
end;
end;
procedure Tfrm_CompFrame.FillControlsComp( rs:tadoDataset);
begin
txtNameCshort.Text:= trim(rs.FieldByName('NameCshort').asstring);
txtNameC.Text:=trim(rs.FieldByName('NameC').asstring);
end;
U_common 单元:
function GetTable(strsql:string;ErrMsg:string;[red]RunPro:TMethod[/red]):integer;
var
rs:TadoDataset;
begin
try
rs:=TADODataSet.Create(application);
rs.Connection :=frm_main.Acon;
rs.CommandText:=strsql;
rs.Open;
if not rs.eof then
begin
result:=1;
[red] RunPro(rs) 如何将RunPro 指向 FillControlsComp(rs) [/red]
end
else
result:=0;
rs.Close;
rs.Destroy;
except
on E:exception do
begin
result:=-1;
frm_main.suiMessageDialogError.Text:=trim(ErrMsg);
frm_main.suiMessageDialogError.ShowModal;
exit;
end;
end;
end;