Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help needed with Exception (2)

Status
Not open for further replies.

delphiman

Programmer
Dec 13, 2001
422
ZA

I am using Delphi 6 Enterprise and Interbase 6 and have a working model of a 3-Tier system.

Can anyone please tell me why I get the following exception at point "A" below even
though ChildrenDM HAS been declared in the Uses clause of TParentDM?

'Access violation at address 004CBE2C in module 'MDModel.exe'.
Read of address 00000058'.*)

procedure TParentDM.IBFatherDataSetAfterScroll(DataSet: TDataSet);
begin
with ParentDM.IBFatherDataSet do
begin
ParentDM.IBdsTrnsfr.Active := True;
if ParentDM.IBdsTrnsfr.state in dsEditModes then
else
ParentDM.IBdsTrnsfr.edit;
ParentDM.IBdsTrnsfrP_NO.value := ParentDM.IBFatherDataSetP_NO.value;
ParentDM.IBdsTrnsfr.ApplyUpdates;

with ChildrenDM.IBdsChild do .................................A
begin
ChildrenDM.IBdsChild.SelectSQL.Clear;
ChildrenDM.IBdsChild.SelectSQL.Add('select *');
ChildrenDM.IBdsChild.SelectSQL.Add('from');
ChildrenDM.IBdsChild.SelectSQL.Add('CHILD t1,TRNSFR t2');
ChildrenDM.IBdsChild.SelectSQL.Add('where');
ChildrenDM.IBdsChild.SelectSQL.Add('t1.P_NO = t2.P_NO');
end;


Thanks in advance.

Terry.
 
hi,

It's the ApplyUpdates again. Their is nothing to apply.
You use applyUpdates when there are pending Cached Updates. If none you get an error messages.
If you use the IBTable you should use a post. If you use an Query you should use ExecSql.

ExecSql = for Update and Delete Queries
Open = for Select queries

Steph [bigglasses]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top