Board index » delphi » Problem to generate a DB in my own Unit

Problem to generate a DB in my own Unit

I have only one Problem,
what must I do to generat a DB-Table in my own Unit

Thank's
Maic

E-Mail : C...@KKF.DE

 

Re:Problem to generate a DB in my own Unit


First you got to create a TTable-Object, like this :

var NewTable: TTable;
begin
  NewTable:=TTable.Create(Self);
  with NewTable do begin
     with FieldDefs do begin
        clear;
        add('1 field',ftString, 20, False);
        ....
      end;
      with IndexDefs do begin
        clear;
        add('1 field','1 field',[ixPrimary]);
     end;
      createtable;
  end;
end;

or something like this, if I remember correctly ...

Hope it helps you .....

Ciao

Maic Abend schrieb:

Quote
> I have only one Problem,
> what must I do to generat a DB-Table in my own Unit

> Thank's
> Maic

> E-Mail : C...@KKF.DE

Re:Problem to generate a DB in my own Unit


Don't forget to set the table settings like DatabaseName, TableType
etc....

Re:Problem to generate a DB in my own Unit


See the TTable.CreateTable method in the on-line help or use a TQuery and
the standare SQL  CREATE TABLE statement.

--
Bill Todd
(Sorry but TeamB cannot answer questions received via email)
(Remove nospam from my email address to contact me for any other reason)

Other Threads