Z
zjl77848
Unregistered / Unconfirmed
GUEST, unregistred user!
fr进入的设计器后,在对话矿窗体上使用ADOQuery,sql中使用带有参数的查询,
点击“对象产看器的Params”后出现错误提示:‘**********InValid class type cast********"
跟踪查看到引起错误的是:如下函数的标志语句:
procedure TfrADOQuery.ParamsEditor(Sender: TObject);
var
Params: TParameters;
ParamValues: TfrVariables;
begin
if FQuery.Parameters.Count > 0 then
begin
Params := TParameters.Create(FQuery, TParameter);
[red] Params.Assign(FQuery.Parameters);[/red] ParamValues := TfrVariables.Create;
ParamValues.Assign(FParams);
with TfrADOParamsForm.Create(nil)do
begin
QueryComp := Self;
Query := FQuery;
Caption := Self.Name + ' ' + LoadStr(SParams);
if ShowModal = mrOk then
frDesigner.Modified := True
else
begin
FQuery.Parameters.Assign(Params);
FParams.Assign(ParamValues);
end;
Free;
end;
Params.Free;
ParamValues.Free;
end;
end;
点击“对象产看器的Params”后出现错误提示:‘**********InValid class type cast********"
跟踪查看到引起错误的是:如下函数的标志语句:
procedure TfrADOQuery.ParamsEditor(Sender: TObject);
var
Params: TParameters;
ParamValues: TfrVariables;
begin
if FQuery.Parameters.Count > 0 then
begin
Params := TParameters.Create(FQuery, TParameter);
[red] Params.Assign(FQuery.Parameters);[/red] ParamValues := TfrVariables.Create;
ParamValues.Assign(FParams);
with TfrADOParamsForm.Create(nil)do
begin
QueryComp := Self;
Query := FQuery;
Caption := Self.Name + ' ' + LoadStr(SParams);
if ShowModal = mrOk then
frDesigner.Modified := True
else
begin
FQuery.Parameters.Assign(Params);
FParams.Assign(ParamValues);
end;
Free;
end;
Params.Free;
ParamValues.Free;
end;
end;