Title: How to create a table including an AutoInc field (ADO/MSSQL)
uses AdoDB;
var
q: TAdoQuery;
db: TAdoConnection;
begin
// Initialize db here
q := TADOQuery.Create(nil);
q.Connection := db;
q.Close;
q.SQL.Clear;
q.SQL.Add('Create Table MYTABLENAME (ID COUNTER PRIMARY KEY, MYTEXT1 String, MYTEXT2 String);');
q.Prepared := True;
try
q.ExecSQL;
except
end;
q.Free;
end;