如何改善TDBMeno 的速度? |
|
fanny
一般會員 發表:10 回覆:26 積分:7 註冊:2002-07-19 發送簡訊給我 |
請問一下:
我在程式中放了兩個TDBMemo,結果執行速度被拖的很慘,
請問是否有其他元件以取代TDBMemo或者改善其速度?
我使用的Database 是SQL Server,用ClientDataSet連結
下面是我載入資料的片段程式,name,description 兩個欄位就是會影響速
度的memo格式,其中Mark掉的程式部分就是會影響速度的地方 procedure TRDFormulaForm.SetRecord;
begin
Screen.Cursor := crHourGlass; //Screen.Cursor :=crArrow;
FormulaDetial.Close;
FormulaProcess.Close;
if not FormulaMaster.Active
then
begin
FormulaMaster.CommandText:='select * from '
' FormulaMaster where id= '
'(select max(id) from FormulaMaster)';
FormulaMaster.Open;
end;
if FormulaMaster.FieldByName('id').Value=null
then
begin
FormulaDetial.CommandText:='select * from'
' FormulaDetialwhere id=' '''' '**--- -- - ' '''';
FormulaProcess.CommandText:='select * from'
' FormulaProcess where id='
'''' '**--- -- - ' '''';
end
else
begin
FormulaDetial.CommandText:='select * from FormulaDetial'
' where id=' ''''
FormulaMaster.FieldByName('id').Value '''';
// FormulaProcess.CommandText:='select '
// 'id,serialno,name,description from FormulaProcess'
// ' where id=' ''''
// FormulaMaster.FieldByName('id').Value '''';
end;
FormulaDetial.Open;
// FormulaProcess.Open;
Screen.Cursor :=crArrow;
end; 發表人 - fanny 於 2002/07/19 15:10:01
|
andersonhsieh
版主 發表:33 回覆:531 積分:439 註冊:2002-06-10 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |