Ver Mensaje Individual
  #2  
Antiguo 02-06-2003
FRANKER FRANKER is offline
Miembro
 
Registrado: may 2003
Ubicación: Elche
Posts: 71
Reputación: 22
FRANKER Va por buen camino
Arrow

Hola:

Para Asignar un índice a una tabla tienes que modificar su propieda indexname:
Código:
 Table1.indexname := 'nombreIndice';
si tienes todos los indices en un comboBox se quedaría mas o menos asi :
Código:
 Table1.indexname := ComboBox.Text;
Para posicionarte en el registro que más se parece a una condición puedes usar el método FindNearest del TTable.
Aqui te dejo un trozo de texto extraído de la ayuda de Delphi 5:
Cita:
The following example performs an incremental search on a table. The form contains a db grid, an edit box, a data source, and a table. As the user types in the edit box, the cursor of the grid moves to the nearest match in the table.
Código:
procedure TForm1.FormActivate(Sender: TObject);

begin
  Table1.DatabaseName := 'DBDemos';
  Table1.TableName := 'Customer.db';
  Table1.Active := True;
  Table1.IndexName := 'ByCompany';
end;

procedure TForm1.Edit1Change(Sender: TObject);

begin
    Table1.FindNearest([Edit1.Text]);
end;
Saludos y Suerte!!.
__________________
.:.::FRANKER::.:.
Responder Con Cita