Ver Mensaje Individual
  #4 (permalink)  
Antiguo 17/12/2007, 23:36
Falconvela
 
Fecha de Ingreso: diciembre-2007
Mensajes: 3
Antigüedad: 16 años, 4 meses
Puntos: 0
Re: comprobar registros en tabla!!!

Hola Juancho24:
en realidad hay varias formas, una de las que veo mas fácil es


rst.recordsource = "Select * from Tabla"
rst.refresh
if rst.recordset.recordcount > 0 then '======> tiene registros
'instrucciones
else '=====no tiene registros
end if

Otra es..

rst.recordsource = "Select count(*) as CantReg from Tabla"
rst.refresh
if rst.recordset.CantReg > 0 then '======> tiene registros
'instrucciones
else '=====no tiene registros
end if

Para buscar u rneg es muy similar

rst.recordsource = "Select * from Tabla where <condicion>"
rst.refresh
if rst.recordset.recordcount > 0 then '======> encontro uno o mas registros
'instrucciones
else '=====no tiene registros
end if


ojala te haya entendido bien y te sirva de algo
Bendiciones...