Ver Mensaje Individual
  #6  
Antiguo 07-10-2010
Rofocale Rofocale is offline
Miembro
 
Registrado: mar 2010
Posts: 182
Reputación: 15
Rofocale Va por buen camino
este codigo funcionaba bien pero yo le quite uno que otro campo y lo deje como te lo enseñe pero bueno no se porque da error, aqui si funciona bien..
Código Delphi [-]
   with dmDatos.qryAuxiliar1 do begin
        Close;
        SQL.Clear;
        SQL.Add('INSERT INTO ventasareas (areaventa, orden, articulo, codigo, descrip, cantidad, precio, iva, tipo,');
        SQL.Add('descauto, descotorg, descfechas, descusuario, cliente, comprobante, categoria, departamento,');
        SQL.Add('comentario, fecha, vendedor, cantidad_cnt) VALUES(');
        SQL.Add(sAreaVenta + ',' + IntToStr(iRenglon) + ',' + grdDatos.Cells[0,iRenglon] + ',');
        SQL.Add('''' + grdDatos.Cells[1,iRenglon] + ''',''' + grdDatos.Cells[2,iRenglon] + ''',');
        SQL.Add(grdDatos.Cells[3,iRenglon] + ',' + grdDatos.Cells[4,iRenglon] + ',');
        SQL.Add(grdDatos.Cells[5,iRenglon] + ',' + grdDatos.Cells[6,iRenglon] + ',');
        SQL.Add('''' + grdDatos.Cells[7,iRenglon] + ''',' + grdDatos.Cells[8,iRenglon] + ',' + grdDatos.Cells[13,iRenglon] + ',');
        SQL.Add(grdDatos.Cells[9,iRenglon] + ',' + sCliente + ',''' + Copy(txtComprobante.Text,1,1) + ''',');
        if(Length(grdDatos.Cells[10,iRenglon]) > 0) then
            SQL.Add(grdDatos.Cells[10,iRenglon] + ',')
        else
            SQL.Add('null,');
        if(Length(grdDatos.Cells[11,iRenglon]) > 0) then
            SQL.Add(grdDatos.Cells[11,iRenglon] + ',')
        else
            SQL.Add('null,');
        SQL.Add('''' + grdDatos.Cells[14,iRenglon] + ''',' + QuotedStr(grdDatos.Cells[15,iRenglon]) + ',');
        SQL.Add(sVendedor + ',''' + grdDatos.Cells[16,iRenglon] + ''')');
        ExecSQL;
        Close;
Responder Con Cita