Ver Mensaje Individual
  #10  
Antiguo 04-07-2012
Avatar de Neftali [Germán.Estévez]
Neftali [Germán.Estévez] Neftali [Germán.Estévez] is offline
[becario]
 
Registrado: jul 2004
Ubicación: Barcelona - España
Posts: 18.329
Reputación: 10
Neftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en bruto
Puedes hacer otra cosa, generar la sentencias sin parámetros y visualizara antes de insertar, al menos para ver qué está generando:
Por cierto, ahora que veo tienes 4 campos y 5 parámetros en la SQL.

Código Delphi [-]

for i := 1 to StringGrid1.RowCount do
    Query.SQL.Clear;
    Str := 'insert into cobro( cantidad, codigo, descripcion, unitario) values(%s, %s, %s %s) ';
 

    // NOTA: A los que sean tipo String hay que añadirles la función QuotedStr
    Str := Format (Str, [stringGrid1.Cells[1, i],
                                stringGrid1.Cells[2, i]. 
                                QuotedStr(stringGrid1.Cells[3, i]), 
                                stringGrid1.Cells[4, i]  ]);

    MessageDlg(Format('SQL: %s  ',[Str]), mtInformation, [mbOK], 0);   

    Query.SQL.Text := Str;
    // ejecutarla
    Query.ExecSQL;
end;
__________________
Germán Estévez => Web/Blog
Guía de estilo, Guía alternativa
Utiliza TAG's en tus mensajes.
Contactar con el Clubdelphi

P.D: Más tiempo dedicado a la pregunta=Mejores respuestas.
Responder Con Cita