Ver Mensaje Individual
  #2  
Antiguo 05-04-2013
Avatar de Chris
[Chris] Chris is offline
Miembro Premium
 
Registrado: abr 2007
Ubicación: Jinotepe, Nicaragua
Posts: 1.678
Reputación: 19
Chris Va por buen camino
No sé como funcionan exactamente los componentes que estás usando para acceder a SQLite. Pero si son decendientes de TDataset tu código se resolvería así:

Código Delphi [-]
procedure TForm1.BitBtn2Click(Sender: TObject);
var
nItem: TListItem;
slDBpath: string;
sldb: TSQLiteDatabase;
sltb: TSQLIteTable;
sSQL: String;
i : integer;
 begin
slDBPath := ExtractFilepath(application.exename)
+ 'bd\dbdatos.db';
sldb := TSQLiteDatabase.Create(slDBPath);
//begin a transaction
//end the transaction
sltb := slDb.GetTable('SELECT * FROM Datos');
try

if sltb.Count > 0 then
while not sltb.eof do // <-- Abro un bucle que recorre todos los registros.
begin
//display first row
  nItem := ListView1.Items.Add;
  nItem.Caption := sltb.FieldByName['fecha'] ;
  nItem.SubItems.Add(sltb.FieldByName['area']);
  nItem.SubItems.Add(sltb.FieldByName['tipo']);
  nItem.SubItems.Add(sltb.FieldByName['detalle']);
  sltb.Next;

end;
finally
sltb.Free;
end;
 end;

Saludos!
__________________
Perfil Github - @chrramirez - Delphi Blog - Blog Web
Responder Con Cita