Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Coloboración Paypal con ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #5  
Antiguo 29-10-2007
Avatar de gluglu
[gluglu] gluglu is offline
Miembro Premium
 
Registrado: sep 2004
Ubicación: Málaga - España
Posts: 1.455
Poder: 23
gluglu Va por buen camino
Para saber más acerca de la función Locate podrías hacer referencia a la propia ayuda del Delphi, aunque pienso que también dependerá de los componentes Query que utilizes.

Cita:
Class TIBCustomDataSet

Syntax
function Locate(const KeyFields: string; var KeyValues: Variant; Options: TLocateOptions): Boolean; override;

Description
Call Locate to search a dataset for a specific record and position the cursor on it.

KeyFields is a string containing a semicolon-delimited list of field names on which to search.

KeyValues is a variant that specifies the values to match in the key fields. If KeyFields lists a single field, KeyValues specifies the value for that field on the desired record. To specify multiple search values, pass a variant array as KeyValues, or construct a variant array on the fly using the VarArrayOf routine.

For example:
Código Delphi [-]
        with CustTable do
  Locate('Company;Contact;Phone', VarArrayOf(['Sight Diver', 'P', '408-431-1000']), [loPartialKey]);
     TLocateOptions Opts;
  Opts.Clear();
  Opts << loPartialKey;
  Variant locvalues[3];
  locvalues[0] = Variant("Sight Diver");
  locvalues[1] = Variant("P");
  locvalues[2] = Variant("408-431-1000");
  CustTable->Locate("Company;Contact;Phone", VarArrayOf(locvalues, 2), Opts);

Options is a set that optionally specifies additional search latitude when searching on string fields. If Options contains the loCaseInsensitive setting, then Locate ignores case when matching fields. If Options contains the loPartialKey setting, then Locate allows partial-string matching on strings in KeyValues. If Options is an empty set, or if KeyFields does not include any string fields, Options is ignored.

Locate returns true if it finds a matching record, and makes that record the current one. Otherwise Locate returns false.

Locate uses the fastest possible method to locate matching records. If the search fields in KeyFields are indexed and the index is compatible with the specified search options, Locate uses the index. Otherwise Locate creates a filter for the search.
__________________
Piensa siempre en positivo !
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
ubicarme en la posicion 2 de dbgrid dmagui Conexión con bases de datos 1 02-09-2005 23:55:27
Posicion cursor DBGrid en pantalla aram2r OOP 2 10-03-2005 16:11:09
Posicion de un registro en un DBGrid VRO OOP 6 27-10-2004 10:22:57
insertar en una posicion en un dbgrid felixgo Conexión con bases de datos 4 16-06-2004 18:26:06
Leer Archivo .Q43 de Posición Fija es como un Txt FNADALO Varios 1 25-05-2004 17:15:27


La franja horaria es GMT +2. Ahora son las 16:22:31.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi