PDA

Ver la Versión Completa : Mensaje de error al finalizar aplicacion


salvanano
22-04-2006, 17:38:30
Hola, no se si este post va aqui, pero como mi programa gestiona una base de datos e supuesto que el fallo estara relacionado con la base de datos.
bueno al grano, mi problema es que al finalizar mi aplicacion me sale el mensaje de error "exception eaccessviolation in module idobdc32.dll at 00026234.
access violation at address 4da06234 in module idodbc32.dll. read of address cccccce0".
Alguien sabria decirme de que se trata y que solución tiene?
Gracias de antemano.

AGAG4
22-04-2006, 21:59:15
Posiblemente estes accesando a alguna tabla, query, datamodule, etc. que no este CREADO.

Saludos....

salvanano
23-04-2006, 20:08:25
Ese no es el problema, todas las tablas que tengo declaradas estan siendo utilizadas y desactivadas a la vez que no se utilizan, y a la hora de cerrar la aplicación es cuando me da el error

Lepe
24-04-2006, 11:28:20
Lo que Agag4 quiere decir es que revises el orden de creación y destrucción de los componentes, Datamodules, Forms, etc.

Puede que estes destruyendo el Datamodule, y despues intentes cerrar una tabla que está en el Datamodule.

Suele ser ese tipo de cosas las que dan el error despues del end.

Saludos

salvanano
03-05-2006, 21:42:14
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

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;

vtdeleon
03-05-2006, 21:47:12
Mi madrea SANTISIMA. Por favor usas las etiquetas. Esta vez lo haré por ti, edita tu código para que veas como se utiliza.

Tambien trata de identar el codigo

salvanano
04-05-2006, 11:06:52
Lo siento no sabia de la existencia de las etiquetas, es que soy novato.
No se a que te refieres con identar el codigo, pero ese que he puesto es muy sencillo de comprender.
Espero sus respuesta haber si encuentran el fallo.
saludos

Lepe
04-05-2006, 18:25:10
No se a que te refieres con identar el codigo

Se nota jejeje, vtdeleon se refiere a incluir espacios al principio de una linea cuando tiene el begin .... end, así se sabe a que bloque pertenece cada código.

A lo que vamos, donde estan los Post respectivos de cada tabla?? porque mandas a insertar una y otra vez, pero no mandas a hacer el Post de cada tabla que editas.

saludos

salvanano
04-05-2006, 21:45:25
Separo cada parte con "//----".
Lo que hago ahí es que de varias tablas selecciono un campo y los meto en una tabla auxiliar para imprimirla despues. Al finalizar la impresion borro todos los campos de esta tabla auxiliar dejandola limpia, por lo que no necesito hacer post a las tablas, pero no estoy seguro si debo hacerselo a la tabla auxiliar en algun momento.
Saludos

Lepe
05-05-2006, 07:55:18
Cada tabla.Edit y Tabla.INsert necesita un post.

salvanano
05-05-2006, 09:44:23
OK, probare a poner un post en cada tabla que edite o inserte a ver si me deja de dar el error.
Ya os comento los resultados.
Saludos y gracias

salvanano
06-05-2006, 22:37:20
He probado a postear la tabla pero no me funciona, sigue dando el mismo error. Alguien sabria decirme porque me da ese error? No se si hago algo mal con la tabla o me falta alguna operación, pero creo que en principio el codigo está bien.
Saludos.

Lepe
07-05-2006, 10:13:09
Lo del Post era un fallo independiente del error que te dá, me cito a mi mismo:

Lo que Agag4 quiere decir es que revises el orden de creación y destrucción de los componentes, Datamodules, Forms, etc.

Puede que estes destruyendo el Datamodule, y despues intentes cerrar una tabla que está en el Datamodule.

Suele ser ese tipo de cosas las que dan el error despues del end.


Incluso puede ser que delphi sea el que está intentando cerrar esa tabla. Si tu dejas una tabla que tienes en un Form abierta, y primero se destruye el datamodule, delphi cerrará la tabla en el Datamodule, cuando se vaya a destruir ese Form, puede dar un error de ese tipo.

Este tipo de errores son los más dificiles de encontrar.... no hace falta que lo diga ¿verdad? :(

Saludos

salvanano
07-05-2006, 17:33:39
Entonces debría destruir o cerrar la tabla antes de cerrar el datamodule?
La verdad es que me está costando bastante solucionar este problemilla, es el más dificil con el que me he encontrado hasta el momento .
Seguire probando a ver si lo soluciono. Mientras tanto espero sus consejos.
Saludos

Lepe
08-05-2006, 18:23:35
Se supone que en tu programa no has usado cosas de este estilo:

Dm := Tdatamodule.Create(...);
Tabla := TTable.Create(...);

Por tanto no tienes que destruir nada, solo cerrar las tablas (tabla1.Close). Si usas un objeto TDatabase, cerrando el TDatabase se cierran todas las tablas que esten asociadas con él.

Pon puntos de ruptura en los eventos OnClose de cada ventana (si usas ese evento para algo) y en el OnCloseQuery.

Saludos

waltergomez
09-05-2006, 01:12:45
Lo podiste solucionar ?
Si estas con el problema, decime que base de datos usas (la estructura de la tabla con la instruccion CREATE TABLE ...), que componentes delphi usas (creo que son tables y si es asi usas BDE).

Saludos,

salvanano
24-05-2006, 01:19:13
No soy capaz de solucionarlo.
utilizo una base de datos en acces con un bde y 12 tables con sus correspondientes datasource, todo en un mismo form.
Parte del codigo esta arriba, y es donde me da error.saludos

Paoti
24-05-2006, 18:29:48
viendo tu código, posiblemente este sea el el error.

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;

Si te fijas :


Busscas el registro

Table9.IndexFieldNames:= 'DESCRIPCION';
if Table9.FindKey([DBLooKupComboBox9.Text])=True then
Table12.Insert;

y lo "guardas" temporalmente.

Pero si no lo encuentra, de todos modos guardas vaya saber que cosa. :eek:

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;



saludos.

Y si haces un insert, haz un post.

judit25
24-05-2006, 18:57:44
begin
Table1.IndexFieldNames:= 'DESCRIPCION';
if Table1.FindKey([DBLooKupComboBox1.Text])=True then

begin // aqui iria por ej en esta sentencia

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 // aqui termina
end;


No se si podría ayudarte esto pero intenta agregando un begin end entre cada sentencia IF que utilizas, así solamente cuando se cumpla la condición él pasara por ahí y hará el insert en la tabla.

saludos

Lepe
25-05-2006, 10:33:52
Sería bueno que postearas el código con las correcciones hechas.

Por otra parte, quizás sea conveniente que comentes como funciona la aplicación y si usas componentes de terceros.

Saludos

salvanano
17-06-2006, 21:26:22
He posteado todo los insert y modificado el codigo para que no me guarde cualquier cosa en la tabla temporal (table12).
También he probado a cerrar las tablas y ha cerrar los database, pero no hay manera de uqe deje de darme ese error.
Lo que hace esta aplicación es coger datos de unas tablas, los almacena temporalmente en otra y las imprime, a continuación se borran de dicha tabla auxiliar(Table12) al pulsar un boton.
Este es mi código, a ver si soys capaces de sacar algo en claro.
PD: El error solo me lo da cuando utilizo la tabla 12.

procedure TForm17.BitBtn1Click(Sender: TObject);
begin
Table10.Last;
Table10.Insert;
Table10.Edit;
end;
procedure TForm17.BitBtn2Click(Sender: TObject);
begin
Table10.Post;
Table10.Edit;
end;
procedure TForm17.BitBtn3Click(Sender: TObject);
begin
If Application.MessageBox('SEGURO DE ELIMINARLO?','ATENCION !!',MB_OKCANCEL+
MB_ICONQUESTION)=IDOK then
Table10.Delete;
Table10.First;
end;
procedure TForm17.BitBtn4Click(Sender: TObject);
begin
Table10.Next;
end;
procedure TForm17.BitBtn5Click(Sender: TObject);
begin
Table10.Prior;
end;
procedure TForm17.BitBtn6Click(Sender: TObject);
var
suma : Real;
a,b,c,d,e,f,g,h,i : Real;
begin
//Calculo el precio total dependiendo si estan activas las tablas
if Table1.Active= True then
a:= Table1.FieldByName('PRECIO').AsFloat * StrToFloat(Edit6.Text) else
a:= 0;
if Table2.Active= True then
b:= Table2.FieldByName('PRECIO').AsFloat * StrToFloat(Edit7.Text) else
b:= 0;
if Table3.Active= True then
c:= Table3.FieldByName('PRECIO').AsFloat * StrToFloat(Edit8.Text) else
c:= 0;
if Table4.Active= True then
d:= Table4.FieldByName('PRECIO').AsFloat * StrToFloat(Edit9.Text) else
d:= 0;
if Table5.Active= True then
e:= Table5.FieldByName('PRECIO').AsFloat * StrToFloat(Edit10.Text) else
e:= 0;
if Table6.Active= True then
f:= Table6.FieldByName('PRECIO').AsFloat * StrToFloat(Edit11.Text) else
f:= 0;
if Table7.Active= True then
g:= Table7.FieldByName('PRECIO').AsFloat * StrToFloat(Edit12.Text) else
g:= 0;
if Table8.Active= True then
h:= Table8.FieldByName('PRECIO').AsFloat * StrToFloat(Edit13.Text) else
h:= 0;
if Table9.Active= True then
i:= Table9.FieldByName('PRECIO').AsFloat * StrToFloat(Edit14.Text) else
i:= 0;
suma:= (a+b+c+d+e+f+g+h+i)+ StrToFloat(Edit5.Text);
Label20.Caption:= FloatToStr(suma); //Pongo el valor del total en el label
Table10.Edit;
Table10.FieldByName('TOTAL').AsFloat:= suma; //pongo el valor del total en la tabla
end;
procedure TForm17.BitBtn7Click(Sender: TObject);
begin
If Application.MessageBox('SEGURO DE SALIR DE PRESUPUESTO?','ATENCION !!',MB_OKCANCEL+
MB_ICONQUESTION)=IDOK then
Database2.Close;
Table10.Close;
Table12.Close;
Close;
end;
procedure TForm17.DBLookupComboBox1MouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
Edit6.Text:= '1';
end;
procedure TForm17.DBLookupComboBox2MouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
Edit7.Text:= '1';
end;
procedure TForm17.DBLookupComboBox3MouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
Edit8.Text:= '1';
end;
procedure TForm17.DBLookupComboBox4MouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
Edit9.Text:= '1';
end;
procedure TForm17.DBLookupComboBox5MouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
Edit10.Text:= '1';
end;
procedure TForm17.DBLookupComboBox6MouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
Edit11.Text:= '1';
end;
procedure TForm17.DBLookupComboBox7MouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
Edit12.Text:= '1';
end;
procedure TForm17.DBLookupComboBox8MouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
Edit13.Text:= '1';
end;
procedure TForm17.DBLookupComboBox9MouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
Edit14.Text:= '1';
end;
procedure TForm17.DBLookupComboBox10CloseUp(Sender: TObject);
begin
Table11.IndexFieldNames:= 'NOMBRE';
if Table11.FindKey([DBLookupCombobox10.Text])=True then
DBEdit2.Text:= Table11.FieldByName('DIRECCION').AsString;
DBEdit5.Text:= Table11.FieldByName('TELEFONO').AsString;
DBEdit6.Text:= Table11.FieldByName('NIF').AsString;
end;
procedure TForm17.BitBtn8Click(Sender: TObject);
begin
Form18.QuickRep1.Preview;
end;
procedure TForm17.BitBtn9Click(Sender: TObject);
begin
Table12.First;
while Table12.Eof = False do
Table12.Delete; //Borro los registros de la tabla
Table12.First;
Edit5.Text := '0';
Label20.Caption := '0';
end;
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
begin
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);
Table12.Post;
end
else
showmessage('No se ha encontrado el producto');
end;
//-------------------------------------------------------------
if dblookupcombobox2.Text<>'' then
begin
Table2.IndexFieldNames:= 'DESCRIPCION';
if Table2.FindKey([DBLooKupComboBox2.Text])=True then
begin
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);
Table12.Post;
end
else
showmessage('No se ha encontrado el producto');
end;
//-------------------------------------------------------------
if dblookupcombobox3.Text<>'' then
begin
Table3.IndexFieldNames:= 'DESCRIPCION';
if Table3.FindKey([DBLooKupComboBox3.Text])=True then
begin
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);
Table12.Post;
end
else
showmessage('No se ha encontrado el producto');
end;
//-------------------------------------------------------------
if dblookupcombobox4.Text<>'' then
begin
Table4.IndexFieldNames:= 'DESCRIPCION';
if Table4.FindKey([DBLooKupComboBox4.Text])=True then
begin
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);
Table12.Post;
end
else
showmessage('No se ha encontrado el producto');
end;
//-------------------------------------------------------------
if dblookupcombobox5.Text<>'' then
begin
Table5.IndexFieldNames:= 'DESCRIPCION';
if Table5.FindKey([DBLooKupComboBox5.Text])=True then
begin
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);
Table12.Post;
end
else
showmessage('No se ha encontrado el producto');
end;
//-------------------------------------------------------------
if dblookupcombobox6.Text<>'' then
begin
Table6.IndexFieldNames:= 'DESCRIPCION';
if Table6.FindKey([DBLooKupComboBox6.Text])=True then
begin
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);
Table12.Post;
end
else
showmessage('No se ha encontrado el producto');
end;
//-------------------------------------------------------------
if dblookupcombobox7.Text<>'' then
begin
Table7.IndexFieldNames:= 'DESCRIPCION';
if Table7.FindKey([DBLooKupComboBox7.Text])=True then
begin
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);
Table12.Post;
end
else
showmessage('No se ha encontrado el producto');
end;
//-------------------------------------------------------------
if dblookupcombobox8.Text<>'' then
begin
Table8.IndexFieldNames:= 'DESCRIPCION';
if Table8.FindKey([DBLooKupComboBox8.Text])=True then
begin
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);
Table12.Post;
end
else
showmessage('No se ha encontrado el producto');
end;
//-------------------------------------------------------------
if dblookupcombobox9.Text<>'' then
begin
Table9.IndexFieldNames:= 'DESCRIPCION';
if Table9.FindKey([DBLooKupComboBox9.Text])=True then
begin
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);
Table12.Post;
end
else
showmessage('No se ha encontrado el producto');
end;
end;

end.