Steema Issues Database

Note: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;
otherwise you can use StackOverflow.
Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy.



Bug 1785 - Problem in case that property getter of RecNo of a Dataset descendent raises an error
Summary: Problem in case that property getter of RecNo of a Dataset descendent raises ...
Status: IN_PROGRESS
Alias: None
Product: TeeGrid for Delphi
Classification: Unclassified
Component: Grid (show other bugs)
Version: unspecified
Hardware: PC Windows
: --- enhancement
Target Milestone: ---
Assignee: david berneda
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-12 14:41 EST by Roland Kossow
Modified: 2017-02-16 11:27 EST (History)
0 users

See Also:
Chart Series: ---
Delphi / C++ Builder RAD IDE Version:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roland Kossow 2017-02-12 14:41:00 EST
When using AureliusDatasets the code in procedure TVirtualDataLink.RecordChanged(Field: TField); is raising an error in  tmp:=DataSet.RecNo; in certain situations which make it impossible to use TeeGrid with Aurelius Datasets in such cases.
This problem could be solved by altering the source code as follows ...

procedure TVirtualDataLink.RecordChanged(Field: TField);
var tmp : Integer;
begin
  inherited;

  if not IChanging then
     if Field=nil then
     begin
       // Tell the Grid the new current row number
       try
          tmp:=DataSet.RecNo;

          if tmp=-1 then  // <-- append / insert new record
             tmp:=0
          else
             tmp:=tmp-1;


       except
          tmp:=tmp-1;
       end;
       IData.ChangeSelectedRow(tmp);
     end;
end;


I do not know if this is a bug in TeeGrid or in TAureliusDataset ...


I have the following callstack ...
:755fa832 KERNELBASE.RaiseException + 0x62
Data.DB.DatabaseError('Operation bei geschlossener Datenmenge nicht ausführbar',$3735160)
Data.DB.TDataSet.CheckActive
Aurelius.Bind.Dataset.TBaseAureliusDataset.GetRecNo
Tee.Grid.Data.DB.TVirtualDataLink.RecordChanged(nil)
Tee.Grid.Data.DB.TVirtualDataLink.ActiveChanged
Data.DB.TDataLink.SetActive(???)
Data.DB.TDataLink.UpdateState
Data.DB.TDataLink.DataEvent(???,???)
Data.DB.TDataSource.NotifyLinkTypes(deUpdateState,0,True)
Data.DB.TDataSource.NotifyDataLinks(deUpdateState,0)
Data.DB.TDataSource.SetState(???)
Data.DB.TDataSource.UpdateState
Data.DB.TDataSource.DataEvent(deUpdateState,0)
Data.DB.TDataSet.DataEvent(deUpdateState,0)
Aurelius.Bind.Dataset.TBaseAureliusDataset.DataEvent(deUpdateState,0)
Data.DB.TDataSet.SetState(???)
Data.DB.TDataSet.SetActive(???)
Data.DB.TDataSet.Close
views.main.TfrSQLStressTestClient.adsQueriesAfterScroll($3734860)
Data.DB.TDataSet.DoAfterScroll
Data.DB.TDataSet.MoveBy(???)
Data.Bind.DBScope.MakeValidRecNo$155$ActRec.$0$Body$156$ActRec.$0$1$Body((($401118, Pointer($122A2B0) as IValueData, 2, 2, 2, $2, TClass($2), 2, 2, 2, 2,80259692864963e-45, 9,88131291682493e-324, 1e-4932, 2, 0,0002, 2, 2, ($2, nil), $2)))
System.Bindings.EvalProtocol.TLocationWrapper.SetValue(???)
System.Bindings.Outputs.TBindingOutput.SetValue($8503E10,TBindingExpressionDefault.Evaluate$4$ActRec($B358910) as TBindOutValueFunc)
System.Bindings.Expression.TBindingExpression.SetOutputs(???)
System.Bindings.ExpressionDefaults.TBindingExpressionDefault.Evaluate
Data.Bind.Components.TCustomBindGridLink.EvaluatePosSource
Data.Bind.Components.TCustomBindGridLink.PosChanged
Data.Bind.ObserverLinks.TBindPositionLinkObserver.PosChanged
System.Classes.TLinkObservers.PositionLinkPosChanged(???)
FMX.TMSLiveGrid.TTMSFMXLiveGrid.NotifyObserver
FMX.TMSLiveGrid.TTMSFMXLiveGrid.SelectCell((1, 2),[],False)
FMX.TMSCustomGrid.TTMSFMXCustomGrid.MouseUp(mbLeft,[],106,65)
FMX.Forms.TCommonCustomForm.MouseUp(mbLeft,[],190,158,???)
FMX.Platform.Win.WndProc(1575602,514,0,10354878)
:7602d2b3 USER32.SetManipulationInputTarget + 0x53
:7600e88a ; C:\WINDOWS\SysWOW64\USER32.dll
:7600e1e4 ; C:\WINDOWS\SysWOW64\USER32.dll
:7600dfa0 USER32.DispatchMessageW + 0x10
FMX.Platform.Win.TPlatformWin.HandleMessage
:008feca0 TPlatformWin.HandleMessage + $34
FMX.Platform.Win.TPlatformWin.Run
FMX.Forms.TApplication.Run
TestFrameworkClient.TestFrameworkClient
:75c262c4 KERNEL32.BaseThreadInitThunk + 0x24
:76ee0fd9 ; 
:76ee0fa4 ;
Comment 1 david berneda 2017-02-16 11:27:57 EST
I've added an extra protection when reading RecNo:

if DataSet.Active then ...


to avoid the exception (dataset is not open).

However, the problem is different. If the dataset is closed, TeeGrid should catch this event and remove all data so RecNo will never be called

( The "adsQueriesAfterScroll" method is closing the dataset )