• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 248
  • Last Modified:

Creating pdox table by SQL

How to create a new paradox table via a TQuery component?

CREATE TABLE bombs me with the message "capability not
supported".

Any _working_ examples?
0
krisz
Asked:
krisz
1 Solution
 
ronit051397Commented:
This is from Lloyd's Help file. I didn't check if it works.

Q:   How to I create a Paradox table with an Auto Increment type field programatically?  I'm using TTable.CreateTable, but TFieldType doesn't include this type.

A:   Use a TQuery and SQL CREATE TABLE statement.  For example:

procedure TForm1.Button1Click(Sender: TObject);
begin
  with Query1 do
  begin
    DatabaseName := 'DBDemos';
    with SQL do
    begin
      Clear;
      Add('CREATE TABLE "PDoxTbl.db" (ID AUTOINC,');
      Add('Name CHAR(255),');
      Add('PRIMARY KEY(ID))');
      ExecSQL;
      Clear;
      Add('CREATE INDEX ByName ON "PDoxTbl.db" (Name)');
      ExecSQL;
    end;

  end;
end;


{ This code came from Lloyd's help file! }
0
 
kriszAuthor Commented:
The problem solved in an other way, but your example works, so
I accept it. I think you agree with grade B.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now