如果存在就删除:
begin
qryDelece:=TADOQuery.Create(nil);
try
if TableExists(tempTable)=true then
begin
with qryDelece do
begin
ConnectionString:=strA+ExtractFilePath(ParamStr(0))+mdb+strB; //
Close;SQL.Clear;SQL.Add('drop table tempTable');ExecSQL; //
end;
end;
finally
qryDelece.Free;
end;
end;
如果不存在就建立:
begin
qry:=TADOQuery.Create(nil);
try
with qry do
begin
ConnectionString:=strA+ExtractFilePath(ParamStr(0))+mdb+strB; //
Close;SQL.Clear;SQL.Add('select * into tempTable from SurceTable');ExecSQL; //
end;
finally
qry.Free;
end;
end;