HELP PLEASE MASTER-DETAIL > IBX + CLIENTDATASET

HELP PLEASE MASTER-DETAIL > IBX + CLIENTDATASET

Post by Antonio Ca » Mon, 08 Dec 2003 22:23:40


Hello
I need help
I don't get to do a relationship to work Master-Detail with IBX +
ClientDataSet, made an example and I tried to send to the newsgroup, but it
was refused.
Somebody could send in private for ( XXXX@XXXXX.COM ) a
functional example of Relao Master-Detail with connection through
IBDataBase + IBTransaction + IBQuery + ClientDataSet + DatSetProvider +
DataSource in Delphi 7.I didn't get to implement just in Delphi 7 in the 5.
At once I thank for any help.
Excuse my terrible English.

Antonio Carlos
Rio de Janeiro - Brazil
 
 
 

HELP PLEASE MASTER-DETAIL > IBX + CLIENTDATASET

Post by Antonio Ca » Wed, 10 Dec 2003 02:26:02

The mentioned article served as base for the development of the relationship
Master-Detail in Delphi5. I made an only change, I used only 01
IBTransaction to do all the operations they run in the context of just a
transaction and this totally functional.
The problem is that don't get to reproduce the relationship Master-Detail in
Delphi7.
Does Delphi7 need additional parameters?
If somebody can send in private a small functional example of Master-Detail
with IBX + ClientDataSet in Delphi7 so that I can find the mistake that I am
making, I thank.

Antonio Carlos
Rio de Janeiro - Brazil
Developer Student
XXXX@XXXXX.COM


"Bill Todd (TeamB)" < XXXX@XXXXX.COM > escreveu na mensagem

 
 
 

HELP PLEASE MASTER-DETAIL > IBX + CLIENTDATASET

Post by Antonio Ca » Fri, 12 Dec 2003 07:23:04

I posted a new message with the subject: Relationship IBX+ClientDataSet
doesn't work (CORRECT) that shows the system error and the working
environment that this happening

I thank if it can help

Antonio Carlos

"Bill Todd (TeamB)" < XXXX@XXXXX.COM > escreveu na mensagem


in
 
 
 

HELP PLEASE MASTER-DETAIL > IBX + CLIENTDATASET

Post by Antonio Ca » Fri, 12 Dec 2003 07:24:35

Please, if somebody can help myself, I thank.
I set up a relationship Master-detail with IBX + ClientDataSet in Delphi 7,
the relationship this working in the visualization but I don't get to make
Insert-delete-Update.
When I make ApplyUpdate(0), the system error create : Parameter name
expected

I describe the working environment of used test below, Components and
altered
Properties, other default

Thank you again

Antonio Carlos
Rio de Janeiro - Brasil

Create table "GGROUP" (
"GG_COD" Integer NOT NULL,
"GG_NAME" Varchar(20),
"GG_STATUS" Varchar(10),
Primary Key ("GG_COD")
);

Create table "MEMBERS" (
"M_COD" Integer,
"GG_COD" Integer NOT NULL,
"M_NAME" Varchar(50),
"M_AGE" Varchar(2),
Primary Key ("G_COD")
);

Alter table "MEMBERS" add foreign key ("GG_COD") references "GGROUP"
("GG_COD") on update cascade on delete cascade;


Form1, Form2(ReconcileErrorForm)

IBDataBase1
Name : db
SQLDialect : 3

IBTransaction1
AutoStopAction : saCommit
DefaulDatabase : db
Name : IBTrans
Params : read_committed , rec_version, nowait

IBQuery1
Database : db
Name : ibqMaster
SQL : select * from GGROUP
Transaction : IBTrans
UniDirectional : True

DataSource1
DataSet : ibqMaster
Name : dsMD

IBQuery2
Database : db
DataSource : dsMD
Name : ibqDetail
SQL : select * from MEMBERS where GG_COD = :GG_COD
Transaction : IBTrans
UniDirectional : True

DataSetProvider1
DataSet : ibqMaster
Name : DSP
UpdateMode : upWhereChange

ClientDataSet1
Name : cdsMaster
ProviderName : DSP

ClientDataSet2
DataSetField : cdsMasteribqDetail
Name : cdsDetail
Params : 0 - GG_COD
DataType : ftInteger
Name : GG_COD
ParamType : ptInput

DataSource 2
DataSet : cdsMaster
name : dsMaster

DataSouce 3
SataSet : cdsDetail
name : dsDetail

DBGrid1
DataSource : dsMaster

DBNavigator1
DataSource : dsMaster

DBGrid2
DataSource : dsDetail

DBNavigator2
DataSource : dsDetail

procedure TForm1.FormActivate(Sender: TObject);
begin
db.Connected := True;
cdsMaster.Open;
end;

procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
db.Connected := False;
cdsMaster.Close;
end;

procedure TForm1.cdsMasterReconcileError(DataSet: TCustomClientDataSet;
E: EReconcileError; UpdateKind: TUpdateKind;
var Action: TReconcileAction);
begin
Action := HandleReconcileError(DataSet,UpdateKind,E);
end;

procedure TForm1.cdsMasterAfterPost(DataSet: TDataSet);
begin
cdsMaster.ApplyUpdates(0);
cdsMaster.Refresh;
end;

procedure TForm1.cdsMasterAfterDelete(DataSet: TDataSet);
begin
cdsMaster.ApplyUpdates(0);
cdsMaster.Refresh;
end;



"Bill Todd (TeamB)" < XXXX@XXXXX.COM > escreveu na mensagem


in
 
 
 

HELP PLEASE MASTER-DETAIL > IBX + CLIENTDATASET

Post by Antonio Ca » Sat, 13 Dec 2003 07:57:26

Respected Bill,
As suggested, I used EMPLOYEE.GDB, the table Employee (Master) and
Salary_History (Detail).

SYSTEM ERROR is the same: Parameter name expected

I describe below, the components and the altered properties.
( Does a form exist of sending the source? in private maybe? )

Form1, Form2(ReconcileErrorForm)

IBDataBase1
Name : db
SQLDialect : 3

IBTransaction1
AutoStopAction : saCommit
DefaulDatabase : db
Name : IBTrans
Params : read_committed , rec_version, nowait

IBQuery1
Database : db
Name : ibqMaster
SQL : SELECT * FROM EMPLOYEE
Transaction : IBTrans
UniDirectional : True

DataSource1
DataSet : ibqMaster
Name : dsMD

IBQuery2
Database : db
DataSource : dsMD
Name : ibqDetail
SQL : SELECT * FROM SALARY_HISTORY WHERE EMP_NO = :EMP_NO
Transaction : IBTrans
UniDirectional : True

DataSetProvider1
DataSet : ibqMaster
Name : DSP
UpdateMode : upWhereChange

ClientDataSet1
Name : cdsMaster
ProviderName : DSP

ClientDataSet2
DataSetField : cdsMasteribqDetail
Name : cdsDetail
Params : 0 - EMP_NO
DataType : ftInteger
Name : EMP_NO
ParamType : ptInput

DataSource 2
DataSet : cdsMaster
name : dsMaster

DataSouce 3
SataSet : cdsDetail
name : dsDetail

DBGrid1
DataSource : dsMaster

DBNavigator1
DataSource : dsMaster

DBGrid2
DataSource : dsDetail

DBNavigator2
DataSource : dsDetail

procedure TForm1.FormActivate(Sender: TObject);
begin
db.Connected := True;
cdsMaster.Open;
end;

procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
db.Connected := False;
cdsMaster.Close;
end;

procedure TForm1.cdsMasterReconcileError(DataSet: TCustomClientDataSet;
E: EReconcileError; UpdateKind: TUpdateKind;
var Action: TReconcileAction);
begin
Action := HandleReconcileError(DataSet,UpdateKind,E);
end;

procedure TForm1.cdsMasterAfterPost(DataSet: TDataSet);
begin
cdsMaster.ApplyUpdates(0);
cdsMaster.Refresh;
end;

procedure TForm1.cdsMasterAfterDelete(DataSet: TDataSet);
begin
cdsMaster.ApplyUpdates(0);
cdsMaster.Refresh;
end;



"Bill Todd (TeamB)" < XXXX@XXXXX.COM > escreveu na mensagem
 
 
 

HELP PLEASE MASTER-DETAIL > IBX + CLIENTDATASET

Post by Antonio Ca » Sat, 13 Dec 2003 20:00:42

Respected Bill,
I don't know if I proceeded correctly, I sent for borland.public.attachment
a new message with the project in attachment, with the same subject.
Please confirm reception.

Antonio Carlos
Rio de Janeiro - Brazil

"Bill Todd (TeamB)" < XXXX@XXXXX.COM > escreveu na mensagem
 
 
 

HELP PLEASE MASTER-DETAIL > IBX + CLIENTDATASET

Post by Antonio Ca » Sun, 14 Dec 2003 01:07:30

Respected Bill,
In working environment, I use InterBase 6.2, as for Firebird, just the
version 1.5 are not more compatible with the suite IBX.
In the way that the sources were sent, it usually compiled, the problem felt
when Inserting, to Alter, to Delete Data, the mistake of the system is:
Parameter name expected

Antonio Carlos

"Bill Todd (TeamB)" < XXXX@XXXXX.COM > escreveu na mensagem
 
 
 

HELP PLEASE MASTER-DETAIL > IBX + CLIENTDATASET

Post by Antonio Ca » Sun, 14 Dec 2003 03:40:18

Respected Bill,

Will it be that every problem would be version? My Delphi 7 is Professional
7.0 build 4.453 IBX is the default, in IBDataBase it is visible just
Interbase express 6.
Could you make the kindness of giving me the link for Update? I entered in
http://www.yqcomputer.com/
and I didn't find the service pack 1

Antonio Carlos

"Bill Todd (TeamB)" < XXXX@XXXXX.COM > escreveu na mensagem
 
 
 

HELP PLEASE MASTER-DETAIL > IBX + CLIENTDATASET

Post by Antonio Ca » Sun, 14 Dec 2003 04:20:56

Dear BILL.......
As I didn't find ServicePack1 of the Delphi7 professional, I updated IBX for
7.08 and,....., work perfectly:)))))

Then in the property of IBDatabase, Interbase Express 6 was not 7.06 and yes
6.00 of Delphi6?


"Bill Todd (TeamB)" < XXXX@XXXXX.COM > escreveu na mensagem