Thema: Delphi Nextgrid und sqlite

Einzelnen Beitrag anzeigen

Benutzerbild von Cylence
Cylence

Registriert seit: 2. Sep 2004
Ort: Allgäu
246 Beiträge
 
Delphi 7 Enterprise
 
#7

Re: Nextgrid und sqlite

  Alt 4. Jul 2008, 13:13
ok

ich habs jetzt mal soweit das er brav gespeichert hat

Delphi-Quellcode:

         slDBPath := PrgPfad + 'config\Playlist1.db';
         sldb := TSQLiteDatabase.Create(slDBPath);
         if sldb.TableExists('Playlist1') then begin
            sSQL := 'DROP TABLE Playlist1';
            sldb.execsql(sSQL);
         end;
         sSQL := 'CREATE TABLE Playlist1 ([ID] INTEGER PRIMARY KEY,[otherID] INTEGER NULL,';
         sSQL := sSQL + '[AV] FLOAT, [Number] FLOAT, [Title] VARCHAR (255),[Path] VARCHAR (255),[Genre] VARCHAR (255),[Medium] VARCHAR (255),'+
           ' [Quality] VARCHAR (255),[Rate] VARCHAR (255),[Artist] VARCHAR (255),[Album] VARCHAR (255),[Duration] VARCHAR (255), '+ //[picture] BLOB COLLATE NOCASE,
           '[Invalid] VARCHAR (255),[InfosLoaded] VARCHAR (255),[VideoPosition] VARCHAR (255),[Filedate] VARCHAR (255),[Resolution] VARCHAR (255), '+
           '[LastUse] VARCHAR (255),[FileSize] VARCHAR (255),[VideoDelay] VARCHAR (255),[PlayCount] VARCHAR (255),[Memo] BLOB);';
         sldb.execsql(sSQL);
         sldb.execsql('CREATE INDEX Playliste ON [Playlist1]([Path]);');
         sldb.BeginTransaction;
         for i := 0 to JvPlaylist1.RowCount -1 do begin //,picture
            sSQL := 'INSERT INTO Playlist1(otherID,AV,Number,Title,Path,Genre,Medium,Quality,Rate,Artist,Album,Duration,Invalid, '+
                    'InfosLoaded,VideoPosition,Filedate,Resolution,LastUse,FileSize,VideoDelay,PlayCount,Memo) '+
                    'VALUES ("'+JvPlaylist1.Cell[0,i].AsString + '"'+ ','+
                           '"'+JvPlaylist1.Cell[1,i].AsString + '"'+ ','+
                           '"'+JvPlaylist1.Cell[1,i].AsString + '"'+ ','+
                           '"'+JvPlaylist1.Cell[2,i].AsString + '"'+ ','+
                           '"'+JvPlaylist1.Cell[3,i].AsString + '"'+ ','+
                           '"'+JvPlaylist1.Cell[4,i].AsString + '"'+ ','+
                           '"'+JvPlaylist1.Cell[5,i].AsString + '"'+ ','+
                           '"'+JvPlaylist1.Cell[6,i].AsString + '"'+ ','+
                           '"'+JvPlaylist1.Cell[7,i].AsString + '"'+ ','+
                           '"'+JvPlaylist1.Cell[8,i].AsString + '"'+ ','+
                           '"'+JvPlaylist1.Cell[9,i].AsString + '"'+ ','+
                           '"'+JvPlaylist1.Cell[10,i].AsString +'"'+ ','+
                         //'"'+JvPlaylist1.Cell[11,i].AsString + '"'+ ','+
                           '"'+JvPlaylist1.Cell[12,i].AsString + '"'+ ','+
                           '"'+JvPlaylist1.Cell[13,i].AsString + '"'+ ','+
                           '"'+JvPlaylist1.Cell[14,i].AsString + ' "'+ ','+
                           '"'+JvPlaylist1.Cell[15,i].AsString + '"'+ ','+
                           '"'+JvPlaylist1.Cell[16,i].AsString + ' "'+ ','+
                           '"'+JvPlaylist1.Cell[17,i].AsString + '"'+ ','+
                           '"'+JvPlaylist1.Cell[18,i].AsString + '"'+ ','+
                           '"'+JvPlaylist1.Cell[19,i].AsString + '"'+ ','+
                           '"'+JvPlaylist1.Cell[20,i].AsString + '"'+ ','+
                           '"'+JvPlaylist1.Cell[21,i].AsString +'"'+');';
             sldb.ExecSQL(sSQL);
         end;
       sldb.Commit;
       sldb.Free;
jetzt mach ich mich mal ans laden von dem ganzen und test dann ob das ganze schneller ist als Nextgrid.savetofile/ bzw loadfromfile

Gruß

tom
Tom
Just DO it
  Mit Zitat antworten Zitat