Creating primary key in access
Delphi 7 Pro, Access XP
In TableParticipants, the primary key currently is MemberID,Event. I need to
change the key to MemberID,Event,EventDate. I need to do this at the program
start when it checks for current database version. I figured a simple drop key
and add key SQL statement would do the trick, but can't get the syntax right.
Any help correcting my code would be appreciated.
with QueryChange do begin
{this portion works}
Close;
SQL.Clear;
SQL.Add('alter table Participants drop PrimaryKey');
ExecSQL;
{this portion doesn't}
Close;
SQL.Clear;
SQL.Add('alter table Participants add PrimaryKey (MemberID,Event,EventDate)');
ExecSQL;
end;
Jon