Subject Re: [IBO] Re:Record was not located to update / Helen - Answer to Q
Author Helen Borrie
At 09:03 AM 25/09/2005 +0200, you wrote:
>Good day all
>=-0==-0-0=-0=
>
>In answer to the questions so far.
>
>1)My keylinks are
>
> MEDICAL_AID.CODE
> MEDICAL_AID.RATE_CODE
>This is the Medical aid Code from the Medical aid table and the Rate code
>for that
>Medical aid. Basically a Medical aid can have more than one rate code ,
>thus you can have multiples of
>a medical aid code and have differant rates (The Medical aid Plans)
>
>2) The user must be able to change the Medical aid code and the rate as
>needed. This is to
>make it customizable for there practice.

Which means that your table structure flies in the face of all good advice
on database application design - a case of the *theoretical" primary key
being implemented per se, without regard to the conditions. V. risky, from
the point of view of data integrity. Not to mention the problem of
building this kind of instability into a *medical* application.


>3) It is how the Primary Key is setup. It is a combined field of CODE and
>RATE_CODE

That doesn't say anything, except to confirm what one suspected.


>4) The procedure is as follows. The User can change as many medical aid
>information as they want
>via the Query being in Cached updates and scrolling up and down the grid
>or Finding (Via Locate) the medical aids.
>After EVERY medical aid is changed the user is trained to press a Update
>Record button that Will POST the information to the Query Component
>
>When all is done the user can press the SAVE button that will execute the
>following line of Code
>
>//============= CODE START ==============
>procedure TfrmInformasieBeheer.btnStoorDAtaClick(Sender: TObject);
>begin
> inherited;
> try
> if dsInformasieData.DataSet is TIBOQuery then begin
> if TIBOQuery(dsInformasieData.DataSet).state in [dsEdit,dsInsert]
> then begin
> TIBOQuery(dsInformasieData.DataSet).post;
> end;
> dm.dbMainPromed.ApplyUpdates([TIBOQuery(dsInformasieData.DataSet)]);
> end else begin
> dm.Database1.ApplyUpdates([TQuery(dsInformasieData.DataSet)]);
> end;
>
> close;
> Except
> on e:Exception do begin
> raise Exception.Create('[IB-SDC01] : '+e.Message);
> end;
> end;
>end;
>//============= CODE END ==========================

The mind boggles.

As to the cause of what you were seeing, I'd look around your datasources
and make sure each one is linking controls and data access objects the way
it's meant to be. You have two database connections in your app: one IBO
one and one BDE one. Can't tell whether they are one database or two
different databases. I hope for your sake they are two different
databases. Is it really your intention to keep this BDE/IBO hybrid? The
way you are doing this, it's a matter of *when* it blows up in your face,
not whether, IMO.

Whether you think Keylinks are a good thing or not, they are an essential
part of IBO's functionality.

>I hope this answers the questions.

I can't tell at the moment what (if anything) you still want by way of peer
support. You wanted to know the cause. Several people have told you and
offered advice. You don't seem to want to fix it, so where is this thread
going?

Helen


Helen