Ver Mensaje Individual
  #2  
Antiguo 16-02-2005
Avatar de Investment
Investment Investment is offline
Miembro
 
Registrado: may 2003
Posts: 378
Reputación: 21
Investment Va por buen camino
He modificado un poco tu codigo, limpiando las querys antes de añadir una nueva sql y mostrando mensajes para saber en que lugar falla excatamente.

Espero que te sirva.

Código:
  if edit1.text = '' then
    showmessage ('Introduzca el codigo del modelo')
  else
    if edit2.Text = '' then
 	 showmessage ('Introduzca el nombre del modelo')
    else
    begin
 	 principalpedidos.modelosquery.sql.Clear; //limpio antes de añadir
 	 principalpedidos.modelosquery.sql.text :=
 		' insert into modeloxasis (codmodelo, nombre) '+
 		' values ('+quotedstr(edit1.text)+', '+quotedstr(edit2.text)+')';
 	 try
 	   principalpedidos.modelosquery.ExecSQL;
 	 except
 	   //CONTROL DE POSIBLES EXCEPCIONES
 	   ShowMessage('Fallo en primera query');
 	 end;
 	 edit1.text := '';
 	 edit2.Text := '';
 	 configmodelo.adoquery1.SQL.Clear; //limpio antes de añadir
 	 configmodelo.adoquery1.SQL.text :=
 		  ' insert into modelo_articuloxasis select codarticulo '+
 		  ' from modelo_articuloxasis where codmodelo = '+
 		  quotedstr(configmodelo.label4.caption);
 	 try
 	   configmodelo.adoquery1.ExecSQL;
 	 except
 	   //CONTROL DE POSIBLES EXCEPCIONES
 	   ShowMessage('Fallo en segunda query');
 	 end;
 	 configmodelo.adoquery1.SQL.Clear; //limpio antes de añadir
 	 configmodelo.adoquery1.SQL.Text :=
 		 'update modelo_articuloxasis set codmodelo = '+
 		  quotedstr(edit1.text)+' WHERE (codmodelo Is Null)';
 	 try
 	   configmodelo.adoquery1.ExecSQL;
 	 except
 	   //CONTROL DE POSIBLES EXCEPCIONES
 	   ShowMessage('Fallo en tercera query');
 	 end;
    end;
__________________
Saludos,
Peter Investment
Responder Con Cita