Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > SQL
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

 
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 16-04-2005
miquellg miquellg is offline
Miembro
 
Registrado: abr 2005
Posts: 46
Poder: 0
miquellg Va por buen camino
Error ("not in edit or insert mode") en Update con ADOQuery

ante todo gracias por pararte a leer esto.
me encuentro con un problema en un update que intento realizar a traves de una ADOQuery. Parece ser que el dataset relacionado no me permite editar la fila seleccionada. Paso un trozo del código :

Código Delphi [-]
     ADOConec: TADOConnection;
     ADOQyArticles: TADOQuery;
     DSarticles: TDataSource;
     ADOQyStocks: TADOQuery;
     DSstocks: TDataSource;
  
   while not ADOQyArticles.Eof do
    begin
             ADOQystocks.SQL.Clear;
             ADOQyStocks.SQL.Add('update F_ARTSTOCK ' +
                                 ' set AS_QTEMINI= :Parm_min,AS_QTEMAXI= :Parm_max ' +
                                 ' where AS_PRINCIPAL = 1 ' +
                                 ' AND AR_REF = '+ #39 + codrefe + #39
                               );
             ADOQyStocks.Parameters.ParamValues['Parm_min'] := round (dias_min * venta_dia);
             ADOQyStocks.Parameters.ParamValues['Parm_max'] := round (dias_max * venta_dia);
           ADOQyStocks.ExecSQL;
           ADOQystocks.Active;
     
           AdoQyStocks.Post;
        end;
       ADOQyArticles.Next;           
    end;
  
  ADOConec.CommitTrans;
Leo los registros de la Query ADOQyArticles y realizo el update con ADOQyStocks en una tabla diferente. Creo que me he hecho un lio con el open,close,active ...
El error que me devuelve al hacer el Post es "DataSet not in Edit or insert mode".
Tengo dudas acerca de como hacer el commit una vez realizado todo el proceso.
Gracias por vuestra ayuda.
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 04:22:38.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi