Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: How can I Copy Fdquery to Fdquery



Permlink Replies: 1 - Last Post: Nov 23, 2016 10:07 PM Last Post By: Dmitry Arefiev Threads: [ Previous | Next ]
Ahmet Nuri DENİZ

Posts: 23
Registered: 6/26/13
How can I Copy Fdquery to Fdquery
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 21, 2016 5:30 AM
Hi we are porting our vcl applications to Rad Studio
Our old program is useing Ado for database connection.
We can copy adoquery to adoquery with clone commend.

But we can not make it with firedac.

We test it with 2 method
1. method is clonecursore

MainQ.Active := True;
ChildQ.Active := Flase;.
ChildQ.CloneCursor(MainQ,False,False);
ChildQ.open;

this is working fist time
But it is not working second time. there is error
error is :
commandText must not be empty,

2.method is copydataset
ManQ.Active := True;
ChildQ.Active := Flase;.
ChildQ.CopyDataset(MainQ,[CoStructure,coRestart,coAppend]);
ChildQ.Open;
that time there is error
[Sql Server] iolation of Primary key constraint'pk_tablename' can not insert duplicate key in object
Dmitry Arefiev

Posts: 1,406
Registered: 12/7/03
Re: How can I Copy Fdquery to Fdquery
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 23, 2016 10:07 PM   in response to: Ahmet Nuri DENİZ in response to: Ahmet Nuri DENİZ
Not sure what you mean "copy".
But if you need to create a clone of TFDQuery, then you should use TFDMemTable as a cloned dataset.

--
With best regards,
Dmitry
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02