Ver Mensaje Individual
  #1  
Antiguo 04-02-2009
GOG GOG is offline
Miembro
 
Registrado: abr 2008
Posts: 17
Reputación: 0
GOG Va por buen camino
Filtros en ADOTable

Hola a todos y gracias de antemano. Tengo un problema al querer filtrar una tabla por distintos criterios... La cosa viene así:
trabajando con Delphi6 y una base de datos de Access y componentes ADOTable.
// Tabla: CLICOM
// Comemp: campo de tipo Integer.
// Comcli: campo de tipo Integer.
// Comtip: campo de tipo character.
// variables: filtro1 y filtro2 de tipo string.
----------------------------------------------------------
filtro1:= '[COMCLI] = ' + QuotedStr(IntToStr(codcli)) + ' and ' +
'[COMEMP] = ' + QuotedStr(IntToStr(codemp));

filtro2:= '[COMTIP] = ' + QuotedStr('1A') + ' or ' +
'[COMTIP] = ' + QuotedStr('1B') + ' or ' +
'[COMTIP] = ' + QuotedStr('1 ') + ' or ' +
'[COMTIP] = ' + QuotedStr('3A') + ' or ' +
'[COMTIP] = ' + QuotedStr('3B') + ' or ' +
'[COMTIP] = ' + QuotedStr('3 ') + ' or ' +
'[COMTIP] = ' + QuotedStr('4A') + ' or ' +
'[COMTIP] = ' + QuotedStr('4B') + ' or ' +
'[COMTIP] = ' + QuotedStr('4 ') + ' or ' +
'[COMTIP] = ' + QuotedStr('9A') + ' or ' +
'[COMTIP] = ' + QuotedStr('9B') + ' or ' +
'[COMTIP] = ' + QuotedStr('9 ');

filtro:= ((Filtro1) + ' and ' + (Filtro2));
Clicom.Filtered:= false;
Clicom.Filter:= filtro;
Clicom.Filtered:= true;
---------------------------------------------------------
Cuando lo ejecuto, me dá error...
Nuevamente gracias.
Responder Con Cita