Board index » delphi » Fields in SELECT clause v fields in underlying table
my.name
![]() Delphi Developer |
Sun, 08 Aug 2004 17:28:30 GMT
Fields in SELECT clause v fields in underlying table
I have been working on save/reopen functions (following some threads a
few weeks ago about bookmarks and their non-validity for that purpose). For my purposes, all datasets which can be repositioned contain a field 'ID'. The difficulty comes when I have an aggregate query such as SELECT COUNT(*) FROM MYTABLE as well as a standard dataset such as SELECT X,Y,Z FROM MYTABLE. Using (MyQuery as TDataset).FindField('ID').AsInteger seems to return a non-nil value from both datasets, but of course when MyQuery.Locate('ID', myOldIDValue, []) I get an error on the aggregate dataset. If push comes to shove, I guess I have to parse the SelectSQL, but |