Hola
Veamos asi:
Código Delphi
[-]
begin
i:=0;
cant:=DBListBox1.Count;
While (i <> cant) do begin
If(DBListBox1.Selected[i]=True)then
cod:=i+1;
i:=i+1;
end;
FormSistema.ADOQuery1.SQL.Text:='Select Cod_G From TContraseñas Where Cod_G = :cod ) ';
edit1.Text:=IntToStr(cod);
FormSistema.ADOQuery1.Active:=True;
end;
No se exactamente que pretendes hacer, pero hoy no traje la bolita.

Saludos