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

 
 
Herramientas Buscar en Tema Desplegado
  #5  
Antiguo 03-05-2006
salvanano salvanano is offline
Miembro
 
Registrado: abr 2005
Posts: 92
Poder: 22
salvanano Va por buen camino
Question Codigo que da el error

El problema viene cuando manejo una tabla determinada (table12), mientras no toque ese tabla el programa no da ningun problema, por lo que os dejo aqui el codigo donde manipulo dicha tabla a ver si ustedes son capaces de ver el fallo. A mi me trae de cabeza.
Saludos
Código Delphi [-]
procedure TForm17.Button1Click(Sender: TObject);
begin
//coloco la fecha en su campo
DBEdit9.Text:= DateToStr(Date);
table10.Post;
// Registro en la tabla auxiliar para imprimir después
if dblookupcombobox1.Text<>'' then
begin
Table1.IndexFieldNames:= 'DESCRIPCION';
if Table1.FindKey([DBLooKupComboBox1.Text])=True then
Table12.Edit;
Table12.FieldByName('CANTIDAD').AsFloat:= StrToFloat(Form17.Edit6.Text);
Table12.FieldByName('DESCRIPCION').AsString:= Table1.FieldByName('DESCRIPCION').AsString;
Table12.FieldByName('PRECIO').AsFloat:= Table1.FieldByName('PRECIO').AsFloat;
Table12.FieldByName('SUBTOTAL').AsFloat:= Table1.FieldByName('PRECIO').AsFloat * StrToFloat(Form17.Edit6.Text);
end;
//-------------------------------------------------------------
if dblookupcombobox2.Text<>'' then
begin
Table2.IndexFieldNames:= 'DESCRIPCION';
if Table2.FindKey([DBLooKupComboBox2.Text])=True then
Table12.Insert;
Table12.FieldByName('CANTIDAD').AsFloat:= StrToFloat(Form17.Edit7.Text);
Table12.FieldByName('DESCRIPCION').AsString:= Table2.FieldByName('DESCRIPCION').AsString;
Table12.FieldByName('PRECIO').AsFloat:= Table2.FieldByName('PRECIO').AsFloat;
Table12.FieldByName('SUBTOTAL').AsFloat:= Table2.FieldByName('PRECIO').AsFloat * StrToFloat(Form17.Edit7.Text);
end;
//-------------------------------------------------------------
if dblookupcombobox3.Text<>'' then
begin
Table3.IndexFieldNames:= 'DESCRIPCION';
if Table3.FindKey([DBLooKupComboBox3.Text])=True then
Table12.Insert;
Table12.FieldByName('CANTIDAD').AsFloat:= StrToFloat(Form17.Edit8.Text);
Table12.FieldByName('DESCRIPCION').AsString:= Table3.FieldByName('DESCRIPCION').AsString;
Table12.FieldByName('PRECIO').AsFloat:= Table3.FieldByName('PRECIO').AsFloat;
Table12.FieldByName('SUBTOTAL').AsFloat:= Table3.FieldByName('PRECIO').AsFloat * StrToFloat(Form17.Edit8.Text);
end;
//-------------------------------------------------------------
if dblookupcombobox4.Text<>'' then
begin
Table4.IndexFieldNames:= 'DESCRIPCION';
if Table4.FindKey([DBLooKupComboBox4.Text])=True then
Table12.Insert;
Table12.FieldByName('CANTIDAD').AsFloat:= StrToFloat(Form17.Edit9.Text);
Table12.FieldByName('DESCRIPCION').AsString:= Table4.FieldByName('DESCRIPCION').AsString;
Table12.FieldByName('PRECIO').AsFloat:= Table4.FieldByName('PRECIO').AsFloat;
Table12.FieldByName('SUBTOTAL').AsFloat:= Table4.FieldByName('PRECIO').AsFloat * StrToFloat(Form17.Edit9.Text);
end;
//-------------------------------------------------------------
if dblookupcombobox5.Text<>'' then
begin
Table5.IndexFieldNames:= 'DESCRIPCION';
if Table5.FindKey([DBLooKupComboBox5.Text])=True then
Table12.Insert;
Table12.FieldByName('CANTIDAD').AsFloat:= StrToFloat(Form17.Edit10.Text);
Table12.FieldByName('DESCRIPCION').AsString:= Table5.FieldByName('DESCRIPCION').AsString;
Table12.FieldByName('PRECIO').AsFloat:= Table5.FieldByName('PRECIO').AsFloat;
Table12.FieldByName('SUBTOTAL').AsFloat:= Table5.FieldByName('PRECIO').AsFloat * StrToFloat(Form17.Edit10.Text);
end;
//-------------------------------------------------------------
if dblookupcombobox6.Text<>'' then
begin
Table6.IndexFieldNames:= 'DESCRIPCION';
if Table6.FindKey([DBLooKupComboBox6.Text])=True then
Table12.Insert;
Table12.FieldByName('CANTIDAD').AsFloat:= StrToFloat(Form17.Edit11.Text);
Table12.FieldByName('DESCRIPCION').AsString:= Table6.FieldByName('DESCRIPCION').AsString;
Table12.FieldByName('PRECIO').AsFloat:= Table6.FieldByName('PRECIO').AsFloat;
Table12.FieldByName('SUBTOTAL').AsFloat:= Table6.FieldByName('PRECIO').AsFloat * StrToFloat(Form17.Edit11.Text);
end;
//-------------------------------------------------------------
if dblookupcombobox7.Text<>'' then
begin
Table7.IndexFieldNames:= 'DESCRIPCION';
if Table7.FindKey([DBLooKupComboBox7.Text])=True then
Table12.Insert;
Table12.FieldByName('CANTIDAD').AsFloat:= StrToFloat(Form17.Edit12.Text);
Table12.FieldByName('DESCRIPCION').AsString:= Table7.FieldByName('DESCRIPCION').AsString;
Table12.FieldByName('PRECIO').AsFloat:= Table7.FieldByName('PRECIO').AsFloat;
Table12.FieldByName('SUBTOTAL').AsFloat:= Table7.FieldByName('PRECIO').AsFloat * StrToFloat(Form17.Edit12.Text);
end;
//-------------------------------------------------------------
if dblookupcombobox8.Text<>'' then
begin
Table8.IndexFieldNames:= 'DESCRIPCION';
if Table8.FindKey([DBLooKupComboBox8.Text])=True then
Table12.Insert;
Table12.FieldByName('CANTIDAD').AsFloat:= StrToFloat(Form17.Edit13.Text);
Table12.FieldByName('DESCRIPCION').AsString:= Table8.FieldByName('DESCRIPCION').AsString;
Table12.FieldByName('PRECIO').AsFloat:= Table8.FieldByName('PRECIO').AsFloat;
Table12.FieldByName('SUBTOTAL').AsFloat:= Table8.FieldByName('PRECIO').AsFloat * StrToFloat(Form17.Edit13.Text);
end;
//-------------------------------------------------------------
if dblookupcombobox9.Text<>'' then
begin
Table9.IndexFieldNames:= 'DESCRIPCION';
if Table9.FindKey([DBLooKupComboBox9.Text])=True then
Table12.Insert;
Table12.FieldByName('CANTIDAD').AsFloat:= StrToFloat(Form17.Edit14.Text);
Table12.FieldByName('DESCRIPCION').AsString:= Table9.FieldByName('DESCRIPCION').AsString;
Table12.FieldByName('PRECIO').AsFloat:= Table9.FieldByName('PRECIO').AsFloat;
Table12.FieldByName('SUBTOTAL').AsFloat:= Table9.FieldByName('PRECIO').AsFloat * StrToFloat(Form17.Edit14.Text);
end;
end;

Última edición por vtdeleon fecha: 03-05-2006 a las 21:47:30.
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
Finalizar una Condición jdangosto OOP 3 02-12-2005 08:57:38
Mensaje de error majosf Conexión con bases de datos 2 16-11-2005 20:25:46
Mensaje de error Luli Varios 3 31-10-2005 13:59:02
Mensaje de error Ana Tudela Conexión con bases de datos 1 14-09-2004 16:47:43
¿Cómo finalizar una aplicación desde la mía? Lester Varios 7 10-11-2003 22:49:28


La franja horaria es GMT +2. Ahora son las 13:15:10.


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