Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Conexión con bases de datos
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Conexión con bases de datos

 
 
Herramientas Buscar en Tema Desplegado
  #8  
Antiguo 10-12-2016
Avatar de bulc
bulc bulc is offline
Miembro
 
Registrado: jun 2010
Posts: 416
Poder: 17
bulc Va por buen camino
Como lo he arreglado yo.

Tengo un DBGrid que carga con un select ordenado por un campo (INICIO). Al hacer otro select con otro orden (´NUM') me daba el error 'Get Index Out of Range'.
Lo arreglé cambiando el índice y haciéndolo coincidir con el nuevo índice (Campo 'NUM').
Código Delphi [-]
UDataModul4.FDataModul4.ClientDataSet1.Active:=False; //Needed
      DBGrid1.Enabled:= False;
      UDataModul4.FDataModul4.IBQuery1.SQL.Clear;
      UDataModul4.FDataModul4.IBQuery1.SQL.Add('SELECT *  FROM ADIVI WHERE (NUM > :nInt) and (NUM < :nNext) order by NUM') ;
      UDataModul4.FDataModul4.IBQuery1.ParamByName('nInt').AsInteger:= nInt;
      UDataModul4.FDataModul4.IBQuery1.ParamByName('nNext').AsInteger:= nNext;
      UDataModul4.FDataModul4.IBQuery1.Open;
      UDataModul4.FDataModul4.ClientDataSet1.Active:=True;  // Necessary
      UDataModul4.FDataModul4.ClientDataSet1.IndexFieldNames:= 'NUM';   // <-- Esto eliminó el Error: 'Grid Index Out of Range'
      DBGrid1.Enabled:= True;
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 07:05:49.


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