FoxPro/Visual FoxPro - Reccount me devuelve un dato incorrecto

 
Vista:

Reccount me devuelve un dato incorrecto

Publicado por Bernal Delgado (26 intervenciones) el 07/03/2007 23:00:27
Compañeros,

Tengo un problema, tengo un cursor ligado a un grid, cuando le doy doble clic sobre una de filas, ejecuto el siguiente codigo:
select cursor
delete
thisform.grid1.refresh
y hasta ahi todo bien, luego hago un reccount('cursor'), y me devulve el mismo numero de registros que tenía antes de eliminar el registro, cómo hago para ELIMINAR lo registros que no se ven ni siquiera en un Browse!!

Gracias
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:Reccount me devuelve un dato incorrecto

Publicado por Charles Benzon (340 intervenciones) el 07/03/2007 23:19:09
Buenas,
Delete solo los elimina logicamente y RECCOUNT hace un conteo de todos los registros.

si quieres saber el número de registros activos deberias probar con:
count to registros for !delete()
donde registros es la variable donde recibes la cantidad de registros no marcados.

Espero que sirva de algo,

Saludos.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:Reccount me devuelve un dato incorrecto

Publicado por MARCO LARA (2 intervenciones) el 07/03/2007 23:46:02
CUANDO SE HACE DELETE SOBRE UN REGISTRO LO QUE HACE FOX ES MARCARLO PARA BORRADO Y 'DESAPARECERLO' . LO DESAPARECE SOLO SI EL SET DELE SE ENCUENTRA EN 'ON', SI SE ENCUENTRA EN 'OFF' Y SE HACE UN BROWSE SOBRE LA TABLA ESTE REGISTRO APARECERA TODACVIA PERO CON AL MARCA DE BORRADO AL LADO IZQUIERDO DEL BROWSE.
LA FUNCION RECCOUNT() HACE EL CONTEO FISICO DE LOS REGISTROS, SE ENCUENTREN O NO MARCADOS PARA BORRADO, POR LO TANTO LA UNICA OPCION DE CAMBIAR EL NUMERO DE REGISTROS DE UNA TABLA ES MARCAR EL REGISTRO CON 'DELETE' Y LUEGO REALIZAR UN 'PACK', AQUI SURGE OTRO PERO Y ES QUE PARA PODER REALIZAR UN PACK SOBRE UNA TABLA ESTA DEBE ESTAR ABIERTA COMO EXCLUSIVA.

COMO CONSEJO SI QUIERE CONTAR LOS REGISTROS DE UNA TABLA SIN INCLUIR LOS BORRADOS Y NO HACERLE PACK, YA QUE GENERALMENTE UNO DEBE TRABAJAR CON TABLAS COMPARTIDAS, REALICE UN SCAN SOBRE ELLA , PERO RECIORDANDO DEVORVERLA AL REGISTRO EN QUE ESTABA EJEMPLO:


SELE TABLA
NREG=RECNO()
N=0
SCAN
N=N+1
SELE TABLA
ENDSCAN
GO NREG

POR ULTIMO, EN LA VARIABLE 'N' TENDRA EL NUMERO DE REGISTROS
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar