Recent

Author Topic: RxDBGrid and DisplayFormat  (Read 3971 times)

JochenKauz

  • New Member
  • *
  • Posts: 13
RxDBGrid and DisplayFormat
« on: July 13, 2017, 05:36:44 pm »
Hi,
got a Sigsev crash if I use Footer Columns (FvtSum, FvtCount) and DisplayFormat property in a column. This is regardless if the column has got a footer value, or not.

I tried newest trunk revision of rxdbgrid, but no change.
My environment
Lazarus 1.8.0RC3 and FPC 3.0.2
RxDBGrid bound to MSSQLConnection.

CallStack shows me that packages\fcl-db\src\base\bufdataset.pas raises the SigSev in getrecno.

I fixed it for me with moving savepos:=DHS.recno in CalcStatTotals right after SaveState

Code: Pascal  [Select][+][-]
  1. procedure TRxDBGrid.CalcStatTotals;
  2. ...
  3.   {$IFDEF NoAutomatedBookmark}
  4.   P:=DataSource.DataSet.GetBookmark;
  5.   {$ELSE}
  6.   P := DHS.Bookmark;
  7.   {$ENDIF}
  8.  
  9.   SaveState:=DHS.SetTempState(dsBrowse);
  10.   SavePos:=DHS.RecNo;
  11.  
  12.   SaveAfterScroll:=DHS.AfterScroll;
  13.   SaveBeforeScroll:=DHS.BeforeScroll;
  14.   DHS.AfterScroll:=nil;
  15.   DHS.BeforeScroll:=nil;
  16.  
  17.   SaveActiveRecord:=Datalink.ActiveRecord;
  18.   Datalink.ActiveRecord:=0;
  19.   # SavePos:=DHS.RecNo;
  20.  

Cheers
JochenKauz

alexs75

  • Full Member
  • ***
  • Posts: 112
Re: RxDBGrid and DisplayFormat
« Reply #1 on: July 17, 2017, 09:55:38 am »
1. Please - send test. I'm test with ZEOS, DBDataSet, RxMemDatatSet - work normal.

2. variable SavePos - position of first visible record in grid. it's not current record.

JochenKauz

  • New Member
  • *
  • Posts: 13
Re: RxDBGrid and DisplayFormat
« Reply #2 on: July 17, 2017, 10:44:33 am »
Hi,
I use MSSQLConnection with TSQLTransaction and TSQLQuery.
First TSQLQuery.open works as expected.
It does happen if I close the TSQLQuery, and then reissue a TSQLQuery.open.
I will try to make a strip of my application and send it to you.

alexs75

  • Full Member
  • ***
  • Posts: 112
Re: RxDBGrid and DisplayFormat
« Reply #3 on: July 18, 2017, 08:42:01 am »
I do not have MS SQL, can I have an example on PostgreSQL or Firebird?

JochenKauz

  • New Member
  • *
  • Posts: 13
Re: RxDBGrid and DisplayFormat
« Reply #4 on: July 18, 2017, 01:36:35 pm »
Hmm.. I can try to install Firebird Server.
Perhaps it is a specific problem with TinyTDS and MSSQL-Server.

 

TinyPortal © 2005-2018