Hello,
I got a small situation with the FetchAll option:
...
cnn.SpecificOptions.Add('FetchAll=false');
UniTable1.Connection:=cnn;
UniTable1.FetchRows:=25;
UniTable1.TableName:='myTable';
UniTable1.Active:=true;
showmessage(inttostr(UniTable1.RecordCount)); -->10015 records ?????? (all recs in myTable)
...
Am I missing something? Is there any additional option I should set?
MySQL 5.5.17, XE7, unidac60d21pro
Thank you very much.
MySQL, FetchAll=false not working
Re: MySQL, FetchAll=false not working
Hi,
I think that RecordCount will always report the complete number of records from the database table regardless of the FetchAll / FetchRows property settings. Those settings only control how many records are pulled from the database to the client application.
I think that RecordCount will always report the complete number of records from the database table regardless of the FetchAll / FetchRows property settings. Those settings only control how many records are pulled from the database to the client application.
Re: MySQL, FetchAll=false not working
The FetchAll option refers to dataset, not to connection. Therefore, in your sample, the UniTable1.RecordCount property returns the number of all records, but not the number of fetched records, since the FetchAll option of UniTable1.SpecificOptions is set to True. to set the FetchAll option of UniTable1.SpecificOptions to False, please replace the first line in your sample with the following:
In addition, pay attention to the QueryRecCount TCustomUniDataSet.Options property. When it is set to True, the UniTable1.RecordCount property will return the number of all records without retrieving all the records from DataSet (FetchAll=False). See more details in the UniDAC help: http://www.devart.com/unidac/docs/Devar ... cCount.htm
Code: Select all
UniTable1.SpecificOptions.Add('MySQL.FetchAll=false');
Re: MySQL, FetchAll=false not working
Thank you very much, this solves my problem.
Re: MySQL, FetchAll=false not working
It is good to see that the problem has been solved.
Feel free to contact us if you have any further questions about UniDAC.
Feel free to contact us if you have any further questions about UniDAC.