Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Bases de datos > Firebird e Interbase
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

 
 
Herramientas Buscar en Tema Desplegado
  #7  
Antiguo 30-01-2008
miss flakita miss flakita is offline
Miembro
 
Registrado: ene 2008
Posts: 14
Poder: 0
miss flakita Va por buen camino
Gracias Delphius muy amable de hecho si me dieron la guia peroooo no tengo chansilla de leerla, eje...

Bueno mira estoy trabajando con interbase en monousuario y en los eventos de las tablas tengo lo siguiente:

tabla del encabezado
After Post
if (datos.TBLORDENCOMPRA.State=DsEdit) then
begin
datos.TBLORDENCOMPRASUBTOTAL.Value:=datos.TBLORDENCOMPRASUBTOTAL.Value+importe;
datos.TBLORDENCOMPRATOTAL.value:=datos.TBLORDENCOMPRASUBTOTAL.value*0.15;
datos.TBLORDENCOMPRA.post;
datos.TBLORDENCOMPRA.refresh;
end;
// calculo importes y totales

OnnewRecord
cont:=0;
renglones:=1;
datos.TBLORDENCOMPRASUBTOTAL.Value:=0;
datos.TBLORDENCOMPRATOTAL.Value:=0;
importe:=0;
//inicializo variables

en la tabla de detalles....
After post
ren:=datos.tordenDetallesNDETALLES.value;
DATOS.TBLFOLIOS.Edit;
datos.TBLFOLIOSFOLIO.Value:=ren;
DATOS.TBLFOLIOS.Post;
datos.TBLFOLIOS.Refresh;
cont:=cont+1;
// tengo el contador para el control de los renglones del dbgrid, ke por cierto sale un error medio extraño aqui. Ademas de controlo los folios

Before Post
if cont=6 then
begin
datos.tordenDetalles.cancel;
error();
end else
if (datos.tordenDetalles.State=dsinsert)then
begin
datos.tordenDetallesIMPORTE.value:=datos.tordenDetallesCANTIDAD.value*datos.tordenDetallesPU.Value;
importe:=datos.tordenDetallesIMPORTE.value;
renglones:=renglones+1;
datos.TBLORDENCOMPRA.Edit;
datos.TBLORDENCOMPRASUBTOTAL.value:=datos.tordenDetallesIMPORTE.Value+datos.TBLORDENCOMPRASUBTOTAL.v alue;
datos.TBLORDENCOMPRAIVA.value:=datos.TBLORDENCOMPRASUBTOTAL.Value*0.15;
datos.TBLORDENCOMPRATOTAL.Value:=datos.TBLORDENCOMPRASUBTOTAL.value+datos.TBLORDENCOMPRAIVA.value;
end;

y fnalmente OnNewRecord
if (datos.tordenDetalles.eof) then
begin
datos.tordenDetallesRENGLONES.Value:=renglones;
ren:=datos.TBLFOLIOSFOLIO.VALUE;
datos.tordenDetallesNDETALLES.value:=ren+1;
datos.REL_UN_OCNORDEN.Value:=datos.TBLORDENCOMPRANORDEN.Value;
datos.REL_EMP_OCNORDEN.Value:=datos.TBLORDENCOMPRANORDEN.Value;
datos.REL_UN_OCNRENGLON.Value:=renglones;
datos.REL_EMP_OCNCARgo.Value:=renglones;
end;
if ((datos.tordenDetallesCANTIDAD.value=0)or (datos.tordenDetallesCANTIDAD.IsNull=true))then
begin
datos.tordenDetallesCANTIDAD.value:=1;
end;
if ((datos.tordenDetallesPU.value=0)or(datos.tordenDetallesPU.IsNull=true))then
begin
datos.tordenDetallesPU.Value:=1;
end;

y el error ke me sale al tratar de modificar uno de los renglones del dbgrid ke esta relacionado con la tabla detalles es:

Proyect LAPIMI.exe raised Exception class EDataBaseError with message 'Tordendetalles: Dataset not in Edit or Insert mode'
Responder Con Cita
 


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

Temas Similares
Tema Autor Foro Respuestas Último mensaje
conectarse a una base de datos a traves de internet andressanchez Firebird e Interbase 3 28-12-2006 10:07:09
bases de datos a través de la red royrogers84 Varios 1 01-12-2006 17:32:09
Leer datos a traves del COM1 Sr.Scorpion Varios 2 31-05-2005 19:47:25
¿Como puedo mandar Datos a traves del Socket? juliopag1 Internet 1 23-04-2004 14:44:05
Capturar datos que llegan a traves de cable de red txeka Varios 3 26-08-2003 18:30:48


La franja horaria es GMT +2. Ahora son las 18:10:04.


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