Ver Mensaje Individual
  #1  
Antiguo 05-04-2013
jonydread jonydread is offline
Miembro
NULL
 
Registrado: nov 2011
Posts: 157
Reputación: 13
jonydread Va por buen camino
cargar datos a listview desde bd sqlite

amigos ya no encuentro como y requiero de alguna ayuda
estoy trabajando con sqlite y sqilte wrapper para trabajar la bd y quiero cargar los datos a una listview tengo esto
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
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;

pero solo me agrega el primer registro ya no se que mas hacer
espero su ayuda


saludos!
Responder Con Cita