Ver Mensaje Individual
  #1  
Antiguo 06-09-2007
Avatar de enecumene
[enecumene] enecumene is offline
Miembro de Oro
 
Registrado: may 2006
Ubicación: Santo Domingo, Rep. Dom.
Posts: 3.040
Reputación: 22
enecumene Va por buen camino
Problema con una consulta Insert

Hola Compañeros de nuevo vuelvo con otro obstaculo en mi camino (por asi decirlo) esta es mi consulta:

Código Delphi [-]
procedure TFEntrada.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
if Key=#13 then begin
 with AEmpleado do begin
  if active then Close;
  sql.Clear;
  SQL.Add(' SELECT cedula, nombre, cargo, tanda FROM Empleado ');
  SQL.Add('WHERE cedula = '+Edit1.Text+'' );
  Open;
  if not IsEmpty then begin
    DBText1.Caption:=fieldByName('Nombre').AsString;
    DBText2.Caption:=fieldByName('cargo').AsString;
    DBText3.Caption:=fieldByName('tanda').AsString;
    DBText4.Caption:=TimetoStr(now);
    DateSeparator:= '/';
    ShortDateFormat:= 'dd/mm/yyyy';
    DBText5.Caption:= DateToStr(Date);
    AEntrada.SQL.Clear;
    AEntrada.SQL.Add('INSERT INTO Asistencia (cedula, nombre, cargo, tanda, entrada, salida, fecha, excusa, licencia, permiso,vacacion, enfermedad, servicio)');
    AEntrada.SQL.Add(' Values('+Edit1.Text+', '+DBText1.Caption+', '+DBText2.Caption+', '+DBText3.Caption+', '+DBText4.Caption+', "", '+DBText5.Caption+', "EX", "LI", "PE", "VA", "EN", "SE")');
    ShowMessage(AEntrada.SQL.Text);
    AEntrada.ExecSQL;
  end else begin
    ShowMessage('Empleado no existe');
   end;
  end;
 end;
end;

esta es el resultado de la consulta:

Cita:
---------------------------
Asistencia
---------------------------
INSERT INTO Asistencia (cedula, nombre, cargo, tanda, entrada, salida, fecha, excusa, licencia, permiso,vacacion, enfermedad, servicio)
Values(00113783906, Fernando Leonor, Negociador de Compras, Matutina, 10:40:52 p.m., "", 05/09/2007, "EX", "LI", "PE", "VA", "EN", "SE")

---------------------------
OK
---------------------------
y este es el error que me tira:

Cita:
---------------------------
Debugger Exception Notification
---------------------------
Project Asistencia.exe raised exception class EOleException with message 'Parameter object is improperly defined. Inconsistent or incomplete information was provided'. Process stopped. Use Step or Run to continue.
---------------------------
OK Help
---------------------------
Estoy trabajando con ADO, Access y delphi7,

los campos entrada y salida son de tipo Date/Time formato longTime, el campo fecha de tipo Date/Time formato shortDate, el campo cedula es de tipo integer y los demas de tipo texto.

Saludos...
__________________

Mi BLOG - ¡Joder, leanse la guia de estilo!
Las Palabras son enanas, los ejemplos gigantes.

Última edición por enecumene fecha: 06-09-2007 a las 04:59:19.
Responder Con Cita