Ver Mensaje Individual
  #5  
Antiguo 15-09-2014
principiodual principiodual is offline
Miembro
NULL
 
Registrado: ago 2014
Posts: 26
Reputación: 0
principiodual Va por buen camino
Cita:
Empezado por Casimiro Notevi Ver Mensaje
¿Y el dataset (la tabla) está activo/abierto?
si amigo, así tengo el código donde trabajo el dbnavigator.

Código Delphi [-]
procedure TForm3.cargaDBGRID;
begin
StrSQL:='';

StrSQL:='SELECT * FROM GEINVZLA_TB_CUENTAS;';

  Cn002  := TADOConnection.Create(nil);
  adotComponents := TADOQuery.Create(nil);
  //Conexion a la Base de datos
  Conectado2:=Open_DB (Cn002 , 5 , ServerDB, NameDB2, '', PasswordDB, '' );


  //si hay conexion continue con el proceso
  if Conectado2 then
  Begin

    //Se Abre el DataSet de la factura
    Conectado2:= Open_ADO_Qry(Cn002,adotComponents,StrSQL,false);

    // Verifica si se Abrio el DataSet

  adotComponents.Open;
  adotComponents.Edit;
  adotComponents.Insert;

   if Conectado2 then
    Begin
      with adotComponents do begin
        while not Eof do
        Begin
          dsComponents.DataSet:= adotComponents;
          with DBGrid1 do begin
              TabOrder := 0;
              TitleFont.Color := clWindowText;
              TitleFont.Height := -14  ;
              TitleFont.Name := 'MS Sans Serif';
              TitleFont.Style := [fsBold]   ;
              DataSource := dsComponents  ;
                 end;
           DBNavigator1.DataSource:=dsComponents;
           DBGrid1.DataSource:=dsComponents;
           Next;
        End;
        First;
      End;
    End;
  End;
End;

Última edición por ecfisa fecha: 15-09-2014 a las 23:13:29. Razón: Agregar etiquetas [Delphi]
Responder Con Cita