Page 1 of 1

Access to a DBF-File is very slow...

Posted: Thu 22 Mar 2012 14:54
by GPL
In my little application I only have to connect an external DBase-File, who came from another System and read on Line of a table. It's a long times ago, that I work with DBF-Files, but it seems easy..., but it isn't...

I use a TUniConnection, a TUniQuery, a TUniDataSource and a TDBFUniProvider in my app.
I conecct to the File, set a little "select * from ..." statement to the UniQuery and open the query.
Now it takes appox. 2 Minutes (!) until the result appears.
The DBF-File is on my local maschine, not in the network or elsewhere.

First I do the same with the Delphi ADO-Components and I get the result in less than one second, but I don't want to use the ADO-Components, because I have many trouble with special characters, especially the german umlauts.
It seems, that UniDAV don't have such problems, so I want to use them.

Do someone have an idea, what I do wrong?

Posted: Thu 22 Mar 2012 15:19
by AlexP
Hello,

By default, when opening DataSet, DBFProvider obtains all records from the table. Try to set the FetchAll property to false and check UniDAC performance once again.

Code: Select all

  UniQuery1.SpecificOptions.Values['FetchAll']:= 'false';

Posted: Thu 22 Mar 2012 15:57
by GPL
This doesn't work, but if I set "ExtendedFieldInfo" to false, it runs in less than a second.

But now I have a second problem: It don't shows me the german Umlauts.
Do you have some suggetion for this?

Posted: Fri 23 Mar 2012 12:37
by AlexP
Hello,

For these symbols to be displayed correctly you need to set the UseUnicode property to true in the following way:

UniConnection1.SpecificOptions.Values['UseUnicode'] := 'true';