Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Conexión con bases de datos
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Conexión con bases de datos

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 27-11-2003
Avatar de vpepen
vpepen vpepen is offline
Miembro
 
Registrado: nov 2003
Ubicación: Higüey
Posts: 104
Poder: 21
vpepen Va por buen camino
Exclamation Findkey en ADO !!!

Hola Foro !!!

Por favor, me gustaría saber si existe una función en el componente ADOTable que sea similar al Findkey del componente Table. De ser así cuál sería el procedimiento de usarla?

Las gracias anticipadas,

Víctor.-
Responder Con Cita
  #2  
Antiguo 27-11-2003
Avatar de marcoszorrilla
marcoszorrilla marcoszorrilla is offline
Capo
 
Registrado: may 2003
Ubicación: Cantabria - España
Posts: 11.221
Poder: 10
marcoszorrilla Va por buen camino
De la propia ayuda de Delphi:
Cita:
KeyValues is the value to search for or multiple values if the index is based on multiple fields.

ADODataSet1.Seek(VarArrayOf([90030, 90020]), soFirstEQ);

SeekOption specifies the type of comparison made in determining whether the search was successful. SeekOption can be one of the six constants:

Seek Option Meaning

soFirstEQ Record pointer positioned at the first matching record, if one is found, or at the end of the dataset if one is not found.
soLastEQ Record pointer positioned at the last matching record, if one is found, or at the end of the dataset if one is not found.
soAfterEQ Record pointer positioned at matching record, if found, or just after where that matching record would have been found.
soAfter Record pointer positioned just after where a matching record would have been found.

soBeforeEQ Record pointer positioned at matching record, if found, or just before where that matching record would have been found.
soBefore Record pointer positioned just before where a matching record would have been found.
Un Saludo.
__________________
Guía de Estilo de los Foros
Cita:
- Ça c'est la caisse. Le mouton que tu veux est dedans.
Responder Con Cita
  #3  
Antiguo 27-11-2003
Avatar de vpepen
vpepen vpepen is offline
Miembro
 
Registrado: nov 2003
Ubicación: Higüey
Posts: 104
Poder: 21
vpepen Va por buen camino
If ADOTable2.Seek(ADOTable1Codigo.Value, soFirstEQ) = True Then
ShowMessage('El cliente ya existe !!!')
else
ADOTable1.Post;

Al ejecutar el código de arriba se produce el siguiente error:

'The operation requested by the application is not supported by the provider'
Responder Con Cita
  #4  
Antiguo 05-12-2003
Avatar de Cabanyaler
Cabanyaler Cabanyaler is offline
Miembro
 
Registrado: jun 2003
Ubicación: País Valencià
Posts: 339
Poder: 21
Cabanyaler Va por buen camino
Hola, aunque un tanto mas lento, pero tampoco tanto, puedes utilizar el metodo Locate.

P.e.

DM.ADOQuery_Nombre.Locate('NombreCampoDondeBusca',VariableConValorABuscar,[loCaseInsensitive]))

Suerte
__________________
El meu país és tan petit, que des de dalt d'un campanar es pot veure el campanar veí.
Responder Con Cita
Respuesta



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


La franja horaria es GMT +2. Ahora son las 23:14:22.


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