On Monday 14 July 2014 08:59:19 amateur wrote:
> oops forgot in "frm_on_created" add:
>   tsqlite3connection1.DatabaseName := karaoke.s3;
>
or set "databasename" to "bin/karaoke.s3" at design time.

> and close database in form close...
>
Not necessary, will be done automatically by form destroying.

Some optimisations:

"
procedure tmainfo.GetCurrentPage(Dir: TDirQuery);
var
  i: Integer;
  f0,f1,f2: tfield;
  
begin

[...]

//  SQLQuery1.Close;
//  SQLQuery1.Open;
  SQLQuery1.refresh(); //no unnecessary prepare <<<<<<<<<
  
[...]
  //Заполняем коллекцию
  FSongs.Clear;

                       //no dataset scroll <<<<<<<<<<<
  f0:= SQLQuery1.fields[0];
  f1:= SQLQuery1.fields[1];
  f2:= SQLQuery1.fields[2];
  for i:= 0 to SQLQuery1.recordcount-1 do begin
    With FSongs.Add Do
    Begin
      Id := inttostr(SQLQuery1.currentasinteger[f0,i]);
      Solist := SQLQuery1.currentasmsestring[f1,i];
      SongName := SQLQuery1.currentasmsestring[f2,i];
    End;
  end;
"
Instead to use "tmsesqlquery" one could use "tsqlresult" for readonly queries 
which is even faster. :-)

Also instead to use collections one could use a "ttreelistitem" descendent 
from unit "msedatanodes" which probably is faster and can be displayed and 
edited by "ttreeitemedit" in a "twidgetgrid".

Martin

------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck&#174;
Code Sight&#153; - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
mseide-msegui-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

Reply via email to