Answer the question
In order to leave comments, you need to log in
How to read all data from dfFoxPro2 DB using unidac?
I write on delphi 10, I use the unidac component (from devart).
I have a dbf database (dfFoxPro2). I need to read all data from it. Line by line, in a loop - for example.
The names in the column database are known.
How to do it?
Working with the database in unidac goes through sql queries.
Here is a working code example. Create a table in the database.
UniConnection := TUniConnection.Create(nil);
UniConnection.ProviderName := 'DBF';
UniConnection.Database:='C:\base.dbf';
UniConnection.SpecificOptions.Values['DBFFormat'] := 'dfFoxPro2';
UniConnection.SpecificOptions.Values['Direct'] := 'True';
UniConnection.Connect;
//Имя файла - base (base.dbf) определяется в коде create
UniConnection.ExecSQL('CREATE TABLE base (ID NUMERIC, Customer CHAR(50), Notes MEMO)');
UniConnection.Disconnect;
Answer the question
In order to leave comments, you need to log in
What is the problem? Take and read. You yourself wrote "the work goes through sql queries", well, use TUniQuery. There is documentation on the site, demo projects should be included with the components. There are no fundamental differences from working with standard Delphi components.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question