Subject | 4.3: TDataset Parameter Value wrong |
---|---|
Author | Ed Dressel |
Post date | 2003-11-18T16:23:03Z |
I have a m/d relationship between TIBODatsets that is on separate
forms established by setting the details.DataSource := master
datasource value. It worked fine in 4.2x version but in 4.3 the
parameter for the detail dataset (CLIENT_ID) is not correct.
Just some further notes (FWIW):
CLIENT_ID in the following line is 1:
qryPension.DataSource.DataSet.FieldByName('CLIENT_ID').AsInteger
but in the following line, it is zero for 4.3 (but 1 for 4.2x):
qryPension.Params[0].AsInteger
**Note that I had this same problem with BDE/Paradox tables but it
disappear in 4.2 and I cleaned up my code.**
Some code snippets:
constructor TdmPenData.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
qryPension.DataSource := dmMaster.dsClient;
...
and then keeping sure that a record exists:
procedure TdmPenData.SetClientID(const Value: integer);
begin
if qryPension.RecordCount = 0 then
begin
qryPension.Append;
qryPension.Post;
end;
...
end;
Any thoughts?
forms established by setting the details.DataSource := master
datasource value. It worked fine in 4.2x version but in 4.3 the
parameter for the detail dataset (CLIENT_ID) is not correct.
Just some further notes (FWIW):
CLIENT_ID in the following line is 1:
qryPension.DataSource.DataSet.FieldByName('CLIENT_ID').AsInteger
but in the following line, it is zero for 4.3 (but 1 for 4.2x):
qryPension.Params[0].AsInteger
**Note that I had this same problem with BDE/Paradox tables but it
disappear in 4.2 and I cleaned up my code.**
Some code snippets:
constructor TdmPenData.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
qryPension.DataSource := dmMaster.dsClient;
...
and then keeping sure that a record exists:
procedure TdmPenData.SetClientID(const Value: integer);
begin
if qryPension.RecordCount = 0 then
begin
qryPension.Append;
qryPension.Post;
end;
...
end;
Any thoughts?