Ver Mensaje Individual
  #10  
Antiguo 06-06-2011
Rofocale Rofocale is offline
Miembro
 
Registrado: mar 2010
Posts: 182
Reputación: 15
Rofocale Va por buen camino
Código Delphi [-]
 for i := 0 to grdDatos.RowCount - 1 do begin
            Close;
            SQL.Clear;
            SQL.Add('INSERT INTO ventasdet (venta, orden, articulo, cantidad, precio,');
            SQL.Add('iva, descuento, juego, devolucion, ventareforden, comentario, fecha, cantidad_cnt) VALUES(');
            SQL.Add(sVenta + ',' + IntToStr(i) + ',');
            SQL.Add(grdDatos.Cells[0,i] + ',');
            SQL.Add(grdDatos.Cells[3,i] + ',');
            SQL.Add(grdDatos.Cells[4,i] + ',');
            SQL.Add(grdDatos.Cells[5,i] + ',');
            SQL.Add(grdDatos.Cells[8,i] + ',0,0,');
            if(grdDatos.Cells[12,i] = '') then
                SQL.Add('null,')
            else
                SQL.Add(grdDatos.Cells[12,i] + ',');
            SQL.Add(sClaveComent + ',' + QuotedStr(grdDatos.Cells[15,i]) + ',');
            SQL.Add('''' + grdDatos.Cells[16,i] + ''')');
            ExecSQL;

ese codigo por ejemplo si funciona pero con un stringgrid.. yo no quiero eso queria hacerlo como en el codigo que puse ya que no uso un stringgrid si no un cxgrid

alguna otra sugerencia ? ya que me da error si meto el insert dentro del bucle tambien
gracias
Responder Con Cita