Club Delphi  
    Paypal   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 Buscar Temas de Hoy Marcar Foros Como Leídos

Conexión con bases de datos

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 03-09-2004
Jad Jad is offline
Miembro
 
Registrado: sep 2004
Posts: 17
Poder: 0
Jad Va por buen camino
Lightbulb

Hola Edum,

Si estás usando Paradox mi sugerencia es que evites usar los campos autoincremento. Cuando el equipo se apaga en forma indebida estos campos quedan corruptos y si los usas para índices entonces tendras problemas.

Una forma alterna de tener campos "autoincremento" es que declares un campo de tipo entero y crees un índice para él. Cuando desees usarlo te vas al último registro, tomas el valor del campo y lo incrementas en 1. No olvides usar el FlushBuffers para forzar la grabada.

Saludos.

JAD.
Responder Con Cita
  #2  
Antiguo 03-09-2004
Avatar de roman
roman roman is offline
Moderador
 
Registrado: may 2003
Ubicación: Ciudad de México
Posts: 20.269
Poder: 10
roman Es un diamante en brutoroman Es un diamante en brutoroman Es un diamante en bruto
Cita:
Empezado por Jad
Una forma alterna de tener campos "autoincremento" es que declares un campo de tipo entero y crees un índice para él. Cuando desees usarlo te vas al último registro, tomas el valor del campo y lo incrementas en 1. No olvides usar el FlushBuffers para forzar la grabada.
Nada más hay que tener cuidado aquí de bloquear la tabla al momento de guardar el registro ya que mientras una estación está leyendo el valor máximo otras pueden estar haciendo lo mismo con lo que el valor que se intente grabar será incorrecto.

// Saludos
Responder Con Cita
  #3  
Antiguo 21-09-2004
FD2004 FD2004 is offline
Miembro
 
Registrado: sep 2004
Posts: 12
Poder: 0
FD2004 Va por buen camino
Autoincrement

Son sólo para apps triviales.

te mando este extracto de Liz Woodhouse:

Quote
Autoincrement fields: These fields are good when the sole purpose is to have a unique value. If the value will be used to link tables, if it will have meaning in any way (such as a customer number), if the value must remain the same, don't use an Autoincrement field. Why? Well, there are some problems which make these fields risky: they can 'lose track' of which number they're on; moving data into a copy of the table (for rebuilding the table, or archiving, for example) can reset the field values if you don't do it just right (just right involves restructuring the tables before and after copying or moving data); repairing the table under certain versions of the BDE can lead to the numbers being reset. So, while it's possible to use these fields without ever having a problem, the risk is high and you should be aware of that beforehand.
Unquote

Tienes mucho material sobre este tema en

www.thedbcommunity.com

Saludos, Carlos.
Responder Con Cita
Respuesta


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

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 21:16:58.


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