Create New DBF Table

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
AngelicTech
Posts: 2
Joined: Tue 13 Jun 2017 02:41

Create New DBF Table

Post by AngelicTech » Tue 13 Jun 2017 02:45

Hello,

Does anyone have an example sql script to create a new table for a DBF database using UniDac in Direct mode.

Thanks

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: Create New DBF Table

Post by MaximG » Wed 14 Jun 2017 06:50

The standard CREATE TABLE statement, corresponding the SQL-92 standard, is used to create DBF table using UniDAC. The following snippet demonstrates this ability:

Code: Select all

UniConnection.ProviderName := 'DBF';
  UniConnection.Database := 'С:\DBF';
  UniConnection.SpecificOptions.Values['DBFFormat'] := 'dfFoxPro2';
  UniConnection.SpecificOptions.Values['Direct'] := 'True';
  UniConnection.Connect;
  UniConnection.ExecSQL('CREATE TABLE MyTable (ID NUMERIC, Customer CHAR(50), Notes MEMO)');

Post Reply