Page 1 of 1

QueryRecCount not working for SQLite

Posted: Tue 07 Dec 2010 20:10
by PMKnecht
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]

Posted: Wed 08 Dec 2010 09:10
by AlexP
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.

Posted: Wed 08 Dec 2010 10:47
by PMKnecht
Thanks. I somehow must have missed that option in the documentation :)

Peter

Posted: Wed 08 Dec 2010 10:56
by AlexP
Hello,

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