给你贴个ACCESS的例子:
procedure CheckTable_CustomIllness; //'CustomIllness';用户自建疾病表
var
CreateStr : string;
begin
if not TableExists(DM.Con_JiuQ,IllnessTable) then
begin
CreateStr := 'Create Table ' + IllnessTable +
' ( [IllID] counter, ' + //病名ID,自动编号的字段
' [Illness] varchar(100), ' + //病名
' [IllKind] Integer,' + //病名的性质
' [IllDetail] Text,' + //疾病阐述
' [IllQueryWord] Text,' + //症状查询字
' [CNRecipe] Text, ' + //中药方
' [WesternRecipe] Text,' + //西药方
' [IntegratedRecipe] Text,' + //综合方
' [OtherRecipe] Text,' + //针炙理疗处方
' [RecipeUse] Text' + //中药方用法
' [CNProductRecipe] Text' + //中成药方
' [OtherUsage] Text' + //针炙理疗治法
' ) ';
Do_ADOSQL(DM.Con_JiuQ,CreateStr);
CreateStr := 'Alter Table ' + IllnessTable + ' Add Primary Key (IllID)';
Do_ADOSQL(dm.Con_JiuQ,CreateStr);
end;
end;