手机站
网通分站
电信主站
密 码:
用户名:
当前位置 : 主页>程序设计>delphi>列表

delphi7找不到TBDEClientDataSet控件的解决方案

来源:互联网 作者:西部数码 时间:2008-04-09
西部数码-全国虚拟主机10强!40余项虚拟主机管理功能,全国领先!双线多线虚拟主机南北访问畅通无阻!免费赠送企业邮局,.CN域名,自助建站480元起,免费试用7天,满意再付款! P4主机租用799元/月.月付免压金!

Result := '''''''';
if Assigned(FDataSet) then
Result := FDataSet.PSGetQuoteChar;
end;

procedure TBDEClientDataSet.CloneCursor(Source: TCustomClientDataSet; Reset: Boolean;
KeepSettings: Boolean = False);
begin
if not (Source is TBDEClientDataSet) then
DatabaseError(SInvalidClone);
Provider.DataSet := TBDEClientDataSet(Source).Provider.DataSet;
DBConnection := TBDEClientDataSet(Source).DBConnection;
CommandText := TBDEClientDataSet(Source).CommandText;
inherited CloneCursor(Source, Reset, KeepSettings);
end;

procedure TBDEClientDataSet.Notification(AComponent: TComponent; Operation: TOperation);
begin
inherited Notification(AComponent, Operation);
if Operation = opRemove then
if AComponent = FDatabase then
begin
FDataBase := nil;
SetActive(False);
end;
end;

procedure TBDEClientDataSet.SetLocalParams;

procedure CreateParamsFromMasterFields(Create: Boolean);
var
I: Integer;
List: TStrings;
begin
List := TStringList.Create;
try
if Create then
FLocalParams.Clear;
FDataSet.FKeyFields := MasterFields;
List.CommaText := MasterFields;
for I := 0 to List.Count -1 do
begin
if Create then
FLocalParams.CreateParam( ftUnknown, MasterSource.DataSet.FieldByName(List[I]).FieldName,
ptInput);
FLocalParams[I].AssignField(MasterSource.DataSet.FieldByName(List[I]));
end;
finally
List.Free;
end;
end;

begin
if (MasterFields <> '''''''') and Assigned(MasterSource) and Assigned(MasterSource.DataSet) then
begin
CreateParamsFromMasterFields(True);
FCurrentCommand := AddParamSQLForDetail(FLocalParams, CommandText, True, GetQuoteChar);
end;
end;

procedure TBDEClientDataSet.SetDataSource(Value: TDataSource);
begin
inherited MasterSource := Value;
if Assigned(Value) then
begin
if PacketRecords = -1 then PacketRecords := 0;
end else
begin
if PacketRecords = 0 then PacketRecords := -1;
end;
end;

function TBDEClientDataSet.GetMasterSource: TDataSource;
begin
Result := inherited MasterSource;
end;

procedure TBDEClientDataSet.SetDetailsActive(Value: Boolean);
var
DetailList: TList;
I: Integer;
begin
DetailList := TList.Create;
try
GetDetailDataSets(DetailList);
for I := 0 to DetailList.Count -1 do
if TDataSet(DetailList[I]) is TBDEClientDataSet then
TBDEClientDataSet(TDataSet(DetailList[I])).Active := Value;
finally
DetailList.Free;
end;
end;

procedure TBDEClientDataSet.SetActive(Value: Boolean);
begin
if Value then
begin
if csLoading in ComponentState then
begin
FStreamedActive := True;
exit;
end;
if MasterFields <> '''''''' then
begin
if not (csLoading in ComponentState) then
CheckMasterSourceActive(MasterSource);
SetLocalParams;
SetSQL(FCurrentCommand);
Params := FLocalParams;
FetchParams;
end else
begin
SetSQL(FCommandText);
if Params.Count > 0 then
begin
FDataSet.Params := Params;
FetchParams;
end;
end;
end;
if Value and (FDataSet.ObjectView <> ObjectView) then
FDataSet.ObjectView := ObjectView;
inherited SetActive(Value);
SetDetailsActive(Value);
end;

procedure Register;
begin
RegisterComponents(''''BDE'''', [TBDEClientDataSet]);
end;

end.

//以上经DBLocalB.pas改装而成,可存为任意文件名,当然扩展名是PAS
//然后安装此控件即可

文章整理:西部数码--专业提供域名注册虚拟主机服务
http://www.west263.com
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!