Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Link between dataset and TDBGrid


This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 1 - Last Post: Aug 22, 2017 4:52 PM Last Post By: Maxime Bonin
Maxime Bonin

Posts: 61
Registered: 1/23/17
Link between dataset and TDBGrid  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 17, 2017 11:07 AM
hello all,

I'm more looking about hints about where to find the proper documentation then a final answer :

I'm working with Delphi XE8: my project concerns the backend which is the fundation of an array of softwares. The backend is currently using Advantage Database Server, and I am adding the nessary things to make it work with Microsoft SQL Server with FireDAC (Advantage stuff is not using FireDAC).

My question is caused by an obscure problem happening with MSSQL but not in Advantage :

To make things simple :

on one form there is a TDBGrid linked to a dataset.

on a second form, there is a textbox (a TEdit or TMaskEdit).

Expected behavior (with Advantage):

I position the cursor on any record of the TDBGrid. I click the 'ADD' button. The second form opens and the textbox on the second form is populated with the appropriate information.

Actual behavior in MSSQL with FireDAC:

1- I position the cursor on any records of the TDBGrid, except the last and before-last ones. I click the 'ADD' button. The second form opens and the textbox on the second form is populated with the appropriate information.

2- I position the cursor on the last or before last record of the TDBrid. I click the 'ADD' button. The second form opens, but the textbox remains empty.

Code wise, the only difference I can see from a call stack reading is that when I am positionned on the last record, a TDataset.Append is happening, and anywhere else, it is a TDataset.Insert.

In your experience is there a distinct behavior of FireDAC that can explain this, or it is something linked to the idiosyncracy of my particular code base ?

Thanks in advance for your input !

p.-s. : I suspect some issues are linked to CalculatedFields ...

pp-s :
more on this :

same .exe file :

I'm positionned on the first record. Click 'ADD'. The second form open and the textBox is not populated.

I close the program and start it again :

I'm positionned on the first record. Click 'ADD'. The second form open and the textBox is populated.

Maxime Bonin

Posts: 61
Registered: 1/23/17
Re: Link between dataset and TDBGrid  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 22, 2017 4:51 PM   in response to: Maxime Bonin in response to: Maxime Bonin
Solved the issue. We had to dig deep to understand why LookUp fields were filled with data when they were supposed to be empty after an Insert or Append.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02