Hello,
I have aTMyQuery. The refreshOption.roAfterInsert = True.
If I use the query with one table only it refreshes the autoncrement field, but if i use a similar like below, it will not.
select distinct a.* from a left join b on (a.a_autoinc=b.b_a_autoinc);
In this case I can get the autoinc only if I refresh the whole query and that takes a lot of time. And I must get the autoinc after post because I need to insert rows in the detail table.
How can I do this?
Thank you in advance
Doesn't refresh autoinc field in a joined query
-
swierzbicki
- Posts: 451
- Joined: Wed 19 Jan 2005 09:59
Hello,
I don't have delphi under my hand... I will write what goes out of my head :
- You should set the fullrefresh option to true.
- You should set KeyFields property and set UpdatingTable property
- Double click on your TMyQuery Component and go to the generate SQL Tab. : you will be able there to generate custom SQL statements.
This should works now. Give it a try.
BR
SW
I don't have delphi under my hand... I will write what goes out of my head :
- You should set the fullrefresh option to true.
- You should set KeyFields property and set UpdatingTable property
- Double click on your TMyQuery Component and go to the generate SQL Tab. : you will be able there to generate custom SQL statements.
This should works now. Give it a try.
BR
SW
-
AndreyZ