B
bfox
Unregistered / Unconfirmed
GUEST, unregistred user!
三层的客户端,采用的是MASTER-DETAIL,一个主表,四个从表,每个表对应一个页面。
当当前页面在主表所在的页面时,查询出的记录能够直接修改,可是当当前页面在从表所在的页面时,必须先切换到主表的页面,再切换回来,显示的内容才变成当前记录,谁能告诉我为什么?
另外,三层结构客户端刷新应该怎么作啊,是不是要用到BOOKMARK?
请高人指教
代码如下
with TFrmSeek.Create(self)do
begin
KeyFieldEx := KeyField;
if KeyFieldEx = 'denizen_code' then
begin
DbgDenizen.Visible := true;
DbgFamily.Visible := false;
DbgDenizen.Align := alClient;
Label1.Caption := '输入居民档案号';
end else
begin
DbgDenizen.Visible := false;
DbgFamily.Visible := true;
DbgFamily.Align := alClient;
Label3.caption := '输入户主姓名:';
end;
if ShowModal=mrOK then
begin
if CdsMaster.Active then
Self.CdsBrowse.Data := CdsMaster.Data;
if (KeyValue <> KeyValueEx) and (KeyValueEx <> '') then
begin
KeyValue := KeyValueEx;
CdsBrowse.Locate(KeyField,KeyValue,[]);
OpenSubData(CurrPageIndex);
end;
end;
end;
opensubdata 的代码如下
if keyvalue='' then
exit;
{
if (not CdsBrowse.Active) and keyvalue then
Exit;
}
if (CurrPageIndex =0) then
with CdsImagedo
begin
Active := False;
Params[0].AsString := KeyValue;
Active := True;
end;
with ActiveDataSet(CurrpageIndex)do
begin
if (Params[0].AsString<>KeyValue) then
begin
Active := False;
if CurrPageIndex = 4 then
begin
Params[0].AsString := familycode;
Params[1].AsString := KeyValue;
end else
Params[0].AsString := KeyValue;
Active := True;
end;
end;
if CdsMaster.RecordCount=0 then
with CdsMasterdo
begin
if Params[0].AsString<>KeyValue then
begin
Active := False;
Params[0].AsString := KeyValue;
Active := True;
end;
end;
if ActiveDataSet(CurrPageIndex).State in [dsedit] then
ActiveDataSet(CurrPageIndex).Post;
当当前页面在主表所在的页面时,查询出的记录能够直接修改,可是当当前页面在从表所在的页面时,必须先切换到主表的页面,再切换回来,显示的内容才变成当前记录,谁能告诉我为什么?
另外,三层结构客户端刷新应该怎么作啊,是不是要用到BOOKMARK?
请高人指教
代码如下
with TFrmSeek.Create(self)do
begin
KeyFieldEx := KeyField;
if KeyFieldEx = 'denizen_code' then
begin
DbgDenizen.Visible := true;
DbgFamily.Visible := false;
DbgDenizen.Align := alClient;
Label1.Caption := '输入居民档案号';
end else
begin
DbgDenizen.Visible := false;
DbgFamily.Visible := true;
DbgFamily.Align := alClient;
Label3.caption := '输入户主姓名:';
end;
if ShowModal=mrOK then
begin
if CdsMaster.Active then
Self.CdsBrowse.Data := CdsMaster.Data;
if (KeyValue <> KeyValueEx) and (KeyValueEx <> '') then
begin
KeyValue := KeyValueEx;
CdsBrowse.Locate(KeyField,KeyValue,[]);
OpenSubData(CurrPageIndex);
end;
end;
end;
opensubdata 的代码如下
if keyvalue='' then
exit;
{
if (not CdsBrowse.Active) and keyvalue then
Exit;
}
if (CurrPageIndex =0) then
with CdsImagedo
begin
Active := False;
Params[0].AsString := KeyValue;
Active := True;
end;
with ActiveDataSet(CurrpageIndex)do
begin
if (Params[0].AsString<>KeyValue) then
begin
Active := False;
if CurrPageIndex = 4 then
begin
Params[0].AsString := familycode;
Params[1].AsString := KeyValue;
end else
Params[0].AsString := KeyValue;
Active := True;
end;
end;
if CdsMaster.RecordCount=0 then
with CdsMasterdo
begin
if Params[0].AsString<>KeyValue then
begin
Active := False;
Params[0].AsString := KeyValue;
Active := True;
end;
end;
if ActiveDataSet(CurrPageIndex).State in [dsedit] then
ActiveDataSet(CurrPageIndex).Post;