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.


Permlink Replies: 4 - Last Post: Aug 18, 2017 8:35 AM Last Post By: Markus Humm
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 5:31 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 ...

Edited by: Maxime Bonin on Aug 17, 2017 5:39 AM
Jeff Overcash (...

Posts: 1,529
Registered: 9/23/99
Re: Link between dataset and TDBGrid [Edit]
Correct
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 17, 2017 10:56 AM   in response to: Maxime Bonin in response to: Maxime Bonin
Maxime Bonin wrote:
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 ...

Edited by: Maxime Bonin on Aug 17, 2017 5:39 AM

You should ask this in the FireDAC newsgroup. It has nothing to do with
FireMonkey and the dev of FireDAC reads and answers questions in the FireDAC group.

--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
Learning is finding out what you already know. Doing is demonstrating that you
know it. Teaching is reminding others that they know it as well as you. We are
all leaners, doers, teachers. (R Bach)
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 17, 2017 11:05 AM   in response to: Maxime Bonin in response to: Maxime Bonin
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.
Jeff Overcash (...

Posts: 1,529
Registered: 9/23/99
Re: Link between dataset and TDBGrid  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 17, 2017 11:40 AM   in response to: Maxime Bonin in response to: Maxime Bonin
Maxime Bonin wrote:
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.

You haven't shown any code on how you are launching/populating it.

--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
Learning is finding out what you already know. Doing is demonstrating that you
know it. Teaching is reminding others that they know it as well as you. We are
all leaners, doers, teachers. (R Bach)
Markus Humm

Posts: 5,113
Registered: 11/9/03
Re: Link between dataset and TDBGrid  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 18, 2017 8:35 AM   in response to: Jeff Overcash (... in response to: Jeff Overcash (...
Am 17.08.2017 um 20:40 schrieb Jeff Overcash (TeamB):
Maxime Bonin wrote:
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.

You haven't shown any code on how you are launching/populating it.

And he didn't follow your advice to ask this in the apropriate group :-(

Greetings

Markus
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02