Mega Code Archive

 
Categories / Delphi / ADO Database
 

How to quickly create a Paradox table using SQL

Title: How to quickly create a Paradox table using SQL procedure TForm1.Button1Click(Sender: TObject); begin with Query1 do begin DatabaseName := 'DBDemos'; with SQL do begin Clear; { CREATE TABLE creates a table with the given name in the current database } Add('CREATE TABLE "PDoxTbl.db" (ID AUTOINC,'); Add('Name CHAR(255),'); Add('PRIMARY KEY(ID))'); { Call ExecSQL to execute the SQL statement currently assigned to the SQL property. } ExecSQL; Clear; Add('CREATE INDEX ByName ON "PDoxTbl.db" (Name)'); ExecSQL; end; end; end; As you can see SQL Language is a pretty familiar one. If you understand SQL you can do everything with databases, and not only.