Frederick Posted July 10, 2019 Share Posted July 10, 2019 I use PostgreSQL as my database backend and in my application, I allow the user to add records continuously until they decide to stop. When the form is shown for the first time after the add request is initiated, a procedure called AddRecord is called and it contains the following code. procedure TMainForm.AddRecord; begin oQry.Append; oQry.FieldByName('code').AsString:='*CODE'; oQry.FieldByName('name').AsString:='Name'; oQry.FieldByName('pricemonth').AsFloat:=0.00; oQry.FieldByName('priceyear').AsFloat:=0.00; oQry.FieldByName('priceonetime').AsFloat:=0.00; oQry.FieldByName('priceupdate').AsFloat:=0.00; end; Once the user clicks the Save button, the following code is called. procedure TMainForm.SaveRecord; begin oQry.Post; addrecord; Field1.Setfocus; end; and the cycle repeats. In a VCL application, as the first and second records are appended, you can see all the field content in the TDBGrid on the left, as well as in the individual TDBEdit components. In a UniGUI application, the record content for the first append is shown normally in the TUniGrid and the TUniDBEdit components. However, after the Save button is clicked, the second append results in blank content as shown in the TUniGrid and TUniDBEdit components. Why is this? -- Frederick (UniGUI Complete - Professional Edition 1.90.0.1504) Quote Link to comment Share on other sites More sharing options...
Frederick Posted July 19, 2019 Author Share Posted July 19, 2019 I previously submitted this post but it seems to have fallen between the cracks. Can someone from technical support please take a look at this problem? I am attaching an animated GIF of the same problem with a SQLite database. Let me know if you need a test case file. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 19, 2019 Share Posted July 19, 2019 1 hour ago, Frederick said: I am attaching an animated GIF of the same problem with a SQLite database. Let me know if you need a test case file. If possible please make a testcase. Quote Link to comment Share on other sites More sharing options...
Frederick Posted July 19, 2019 Author Share Posted July 19, 2019 On 7/19/2019 at 12:58 PM, Sherzod said: If possible please make a testcase. Please find attached. Quote Link to comment Share on other sites More sharing options...
Frederick Posted July 29, 2019 Author Share Posted July 29, 2019 On 7/19/2019 at 5:56 PM, Frederick said: Please find attached. Hi Sherzod, Has there been any progress on this issue? Version 1.90.1506 does not solve the problem. Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted July 29, 2019 Administrators Share Posted July 29, 2019 I will check it... Quote Link to comment Share on other sites More sharing options...
Frederick Posted July 29, 2019 Author Share Posted July 29, 2019 Thanks. Quote Link to comment Share on other sites More sharing options...
Frederick Posted August 12, 2019 Author Share Posted August 12, 2019 On 7/29/2019 at 11:12 PM, Farshad Mohajeri said: I will check it... I see that version 1.90.0.1508 still does not solve this problem. Do you have a workaround I can use while you work on a permanent solution? Quote Link to comment Share on other sites More sharing options...
Frederick Posted August 19, 2019 Author Share Posted August 19, 2019 Any progress on this? Quote Link to comment Share on other sites More sharing options...
Frederick Posted October 9, 2019 Author Share Posted October 9, 2019 Can this problem be resolved? Version 1.90.0.1510 still does not fix it. Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted October 14, 2019 Administrators Share Posted October 14, 2019 Analyzing... Quote Link to comment Share on other sites More sharing options...
Frederick Posted October 14, 2019 Author Share Posted October 14, 2019 Ok, thanks. Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted October 14, 2019 Administrators Share Posted October 14, 2019 Problem here is that Grid needs to reload rows after each Append/Post. This causes to loose the last appended row data which are not posted yet. To resolve this issue you must use OnNewRecord event of your dataset as below: procedure TMyForm2.qryNewRecord(DataSet: TDataSet); var nNextno : Integer; begin oQrynextno.Close; oQrynextno.Open; nNextno:=oQrynextno.fieldbyname('nextno').asInteger; oQrynextno.Close; with DataSet do begin fieldbyname('id').AsInteger:=nNextno; fieldbyname('compname').asString:='*New Compname'; fieldbyname('model').asString:='*New Model'; end; end; also: procedure TMyForm2.AddRecord; begin with oQry do begin append; end; end; Quote Link to comment Share on other sites More sharing options...
Frederick Posted October 14, 2019 Author Share Posted October 14, 2019 Thank you. It is working as expected now. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.