Hai,
I have TmSquery(Query1), TProvider (Provider1), TClienDataSet (ClientDataSet1) and a TDataSource components on the form.Query1 is attached to the Provider1 which is inturn attached to the ClientDataset1. This ClientdataSet1 is attached as the dataset to the DataSource component.
I am doing a normal insert operation into a table having Identity column using the ClientDataSet1 component.
I am doing the following piece of code:
ClientDataSet1.Insert;
ClientDataSet1.Fieldbyname('').AsInteger := 5;
ClientDataSet1.post;
Now, the table in which i am posting a record is having Identity Column. Now i want to have the identity Value that got generated so that i can pass it for inserting data into child tables. How to obtain the Identity Column value here ?
Note: I have already looked into some Identity Column queries that were posted in the group and did some things like, setting the autogenrateValue property to arAutoinc, setting the ReturnParams Option to TRUE etc..
But i was unable to write "Set :Columnname = SCOPE_Identity" beacuse i dont have any insert statement at all as i am using ClientDataSet.
Thanks in Advance
Regards
Balajee
How to get the Identity Value from ClientDataSet:
Thanks for the reply.
I do know that it is not a restriction of SDAC...
My intention of posting this here is for an alternate solution so that i can get problem solved.
Is there any possible way to obtain Identity value in my case ?? if so please let me know...
I am working on a Migration project and i cannot completely replace the existing components as it is not part of our design..
so if u can provide me any alternative way of obtaining Identity Value it will be of great help to me..
Thanks in Advance...
Balajee
I do know that it is not a restriction of SDAC...
My intention of posting this here is for an alternate solution so that i can get problem solved.
Is there any possible way to obtain Identity value in my case ?? if so please let me know...
I am working on a Migration project and i cannot completely replace the existing components as it is not part of our design..
so if u can provide me any alternative way of obtaining Identity Value it will be of great help to me..
Thanks in Advance...
Balajee