QueryRecCount not working for SQLite

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
PMKnecht
Posts: 2
Joined: Tue 07 Dec 2010 19:54

QueryRecCount not working for SQLite

Post by PMKnecht » Tue 07 Dec 2010 20:10

I just bought UniDAC today after checking out the Trial version... and i might have found the first bug ;)

Code: Select all

procedure TForm6.Button3Click(Sender: TObject);
var conn: TUniConnection;
    asd: TUniTable;
begin

 conn := TUniConnection.Create(self);
 conn.ProviderName := 'SQLite';
 conn.Database := 'test.db';
 conn.Connect;

 asd := TUniTable.Create(self);
 asd.Connection := conn;
 asd.TableName := 'testest';
 asd.SpecificOptions.Values['QueryRecCount'] := 'True';
 asd.Execute;

 showmessage(inttostr(asd.RecordCount));

end;
Returns 25. Should return values >25 :)

If this is a bug, can i get a fixed version? I can send you my mail address from which i bought the components, if needed.

Greetings,
Peter[/code]

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

Post by AlexP » Wed 08 Dec 2010 09:10

Hello,

The TUniQuery, TUniTable component has no QueryRecCount SQLite-specific option.
To get the correct record count you should set the TUniTable.Options.QueryRecCount property to true like

procedure TForm6.Button3Click(Sender: TObject);
var conn: TUniConnection;
asd: TUniTable;
begin

conn := TUniConnection.Create(self);
conn.ProviderName := 'SQLite';
conn.Database := 'test.db';
conn.Connect;

asd := TUniTable.Create(self);
asd.Connection := conn;
asd.TableName := 'testest';
asd.Options.QueryRecCount := True;
asd.Execute;

showmessage(inttostr(asd.RecordCount));

end;

For more information please see the Using UniDAC with SQLite topic in the UniDAC help.

PMKnecht
Posts: 2
Joined: Tue 07 Dec 2010 19:54

Post by PMKnecht » Wed 08 Dec 2010 10:47

Thanks. I somehow must have missed that option in the documentation :)

Peter

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

Post by AlexP » Wed 08 Dec 2010 10:56

Hello,

It is good to see that this problem was solved. If any other questions come up, please contact us.

Post Reply