Hi Folks,
It looks like in version 6, CanModify of TSmartQuery is false for single table queries using ROWID and no primary key. The same code had no problems on Version 5.
i.e. select rowid, t.* from mytabwithnopk t;
version 5: CanModify = True
version 6: CanModify = False
Thanks for any help!
-Mark Ford
Version 6: TSmartQuery not working with ROWID
I've done more testing and it appears that this is a change from ODAC version 5 to version 6. Basically in Version 5, you could call Prepare and if the query included a rowid then CanModify would be true. In version 6 it looks like CanModify is always false after the prepare call and doesn't get set until execute. With version 5 I could do something like:
OQuery.SQL.Text :=
'select rowid, t.* from emp11 t';
OQuery.Prepare;
if not OQuery.CanModify then // in V5 CanModify would be true here.
begin
// Set Keyfields property, etc.
end;
OQuery.Execute();
Any comments or suggestions are greatly appreciated!
-Mark
OQuery.SQL.Text :=
'select rowid, t.* from emp11 t';
OQuery.Prepare;
if not OQuery.CanModify then // in V5 CanModify would be true here.
begin
// Set Keyfields property, etc.
end;
OQuery.Execute();
Any comments or suggestions are greatly appreciated!
-Mark
-
Challenger
- Devart Team
- Posts: 925
- Joined: Thu 17 Nov 2005 10:53