Solved TD-23945 (regression 7.0.4): incorrect context row 0 after calling SalTblDeleteRow()

Post found bugs and possible workarounds.
Uwe van der Horst
Site Admin
Site Admin
Germany
Posts: 62
Joined: 05 Mar 2017, 14:21
Location: Wetter (Ruhr), Germany

TD-23945 (regression 7.0.4): incorrect context row 0 after calling SalTblDeleteRow()

Post by Uwe van der Horst » 15 Feb 2018, 14:10

We have found a mayor problem with 7.0.4. In some cases we are filling Grids in the follwing way (columns as bind variables):

Call SqlPrepareAndExecute( hSql, 'select x, y into :col1, :col2 from z' )
Call SalTblSetContext( hWndForm, SalTblInsertRow( hWndForm, TBL_MaxRow ) )
While SqlFetchNext( hSql, nDummy )
...Call SalTblSetContext( hWndForm, SalTblInsertRow( hWndForm, TBL_MaxRow ) )
Call SalTblDeleteRow( hWndForm, SalTblQueryContext( hWndForm ), TBL_MaxRow )

Logically after processing the While SqlFetchNext... we have to delete the last row because it is empty. Here is the regression:

With TD 7.0.3 and all previous versions after calling SalTblDeleteRow() the context row is "TBL_Error". This is the expected behaviour.
With TD 7.0.4 after calling SalTblDeleteRow() the context row is "row 0". This can cause some heavy unwanted effects.

I have attached a test case that shows the probem. Extract the .zip and run the .exe (not the .apt). With the cdlli70.dll (version 7.0.4) the context row is 0 (wrong). With the cdlli70.dll (version 7.0.3) the context row is TBL_Error (ok).

I will make a support case.
SalTblDeleteRowGivesWrongContextRow.zip
You do not have the required permissions to view the files attached to this post.
Best regards,
Uwe van der Horst
Advo-web GmbH

Dave Rabelink
Founder/Site Admin
Founder/Site Admin
Netherlands
Posts: 471
Joined: 24 Feb 2017, 09:12
Location: Gouda, The Netherlands

Re: 7.0.4: incorrect context row 0 after calling SalTblDeleteRow()

Post by Dave Rabelink » 16 Feb 2018, 06:18

I can confirm this, Uwe.
Regards,
Dave Rabelink

Image
Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel

Uwe van der Horst
Site Admin
Site Admin
Germany
Posts: 62
Joined: 05 Mar 2017, 14:21
Location: Wetter (Ruhr), Germany

Re: 7.0.4: incorrect context row 0 after calling SalTblDeleteRow()

Post by Uwe van der Horst » 22 Feb 2018, 10:16

The bug number is TD-23945.
Best regards,
Uwe van der Horst
Advo-web GmbH

Uwe van der Horst
Site Admin
Site Admin
Germany
Posts: 62
Joined: 05 Mar 2017, 14:21
Location: Wetter (Ruhr), Germany

Re: TD-23945 (regression 7.0.4): incorrect context row 0 after calling SalTblDeleteRow()

Post by Uwe van der Horst » 12 Jul 2018, 18:32

This bug is fixed in TD 7.05 and 7.1.
Best regards,
Uwe van der Horst
Advo-web GmbH

Return to “Bug Reports”

Who is online

Users browsing this forum: Ccbot [Crawler] and 0 guests