TUniQuery and LiveBinding - SQLite Dataset does not refresh after post

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Christoph
Posts: 5
Joined: Wed 23 Jan 2013 07:24

TUniQuery and LiveBinding - SQLite Dataset does not refresh after post

Post by Christoph » Wed 15 Oct 2014 06:39

Hi,
I used to be able (before XE7?) to do this with SQLite :

Code: Select all

procedure SaveData(var aDataRec : TDataRec);
var q : TUniQuery;
begin
 q := TUniQuery.Create(Self);
 try
  with q do begin
    Connection:=UniConnection1;
    SQL.Text:=Format('select * from myTable where ID=%d',[aDataRec.ID]);
    open;
    if RecordCount=0
       then append
       else edit;
 // ID is auto incremented
    FieldByName('myData').AsString := aDataRec.MyData;
    post;
    aDataRec.ID := FieldByName('ID').AsInteger;
  end; // with q
 finally
  q.Free;
end;
Instead of calling "select last_insert_rowid() id" I used to do get the new value for my primary key from FieldByName('ID').AsInteger after the POST. However it does not work anymore!!??

SQLite :

Code: Select all

CREATE TABLE `MyTable` (
	`ID` INTEGER PRIMARY KEY AUTOINCREMENT,
	`myData` varchar(35)
  );
Please advise.
Thanks
Christoph

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: TUniQuery and LiveBinding - SQLite Dataset does not refresh after post

Post by AlexP » Wed 15 Oct 2014 07:15

Hello,

We cannot reproduce the problem on the latest UniDAC version. Try to reproduce the problem on the latest UniDAC trial version: http://www.devart.com/unidac/download.html , and let us know the results

Christoph
Posts: 5
Joined: Wed 23 Jan 2013 07:24

Re: TUniQuery and LiveBinding - SQLite Dataset does not refresh after post

Post by Christoph » Wed 15 Oct 2014 10:12

Hi,
thanks for your quick reply.
Like you, I created a little test project, and everything worked fine.
However, my current project still does not behave as expected.
If you do not mind, please download my echo_db project from
http://www.ckcmed.com.au/test/echo_db.zup and have a look yourself.
Thanks again for your timely response.
Cheers
Christoph

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: TUniQuery and LiveBinding - SQLite Dataset does not refresh after post

Post by AlexP » Wed 15 Oct 2014 11:16

Thank you for the sample. We have reproduced and fixed the problem. The fix will be included into the next build.

Christoph
Posts: 5
Joined: Wed 23 Jan 2013 07:24

Re: TUniQuery and LiveBinding - SQLite Dataset does not refresh after post

Post by Christoph » Thu 16 Oct 2014 06:01

Thanks. Do you have an estimated date of release?

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: TUniQuery and LiveBinding - SQLite Dataset does not refresh after post

Post by AlexP » Thu 16 Oct 2014 06:57

We are going to release the new build within a month.

jbucher
Posts: 13
Joined: Wed 20 Aug 2014 06:05

Re: TUniQuery and LiveBinding - SQLite Dataset does not refresh after post

Post by jbucher » Thu 20 Aug 2015 09:53

Hi,
seems that this problem is back with Version 6.1.6!!!

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: TUniQuery and LiveBinding - SQLite Dataset does not refresh after post

Post by AlexP » Thu 27 Aug 2015 10:47

The example Christoph sent on the current version works properly, please send your example to alexp*devar*com

Post Reply