Board index » delphi » TADOTable.Refresh doesn't work ??

TADOTable.Refresh doesn't work ??

Hello

I have a problem with that code. The .Refresh doesnt work. When I do it,
the table has one record.
If I Close and Open the table, it works, but I think it's not the best way.
Someone can help me?? Thank you

    Esteban

****************************************
Tabla:TADOTable
...
(* Tabla is empty, and I insert a Row *)
..

Tabla.Refresh;
If Not(Tabla.IsEmpty) then begin
    ...
   (* Do something *)
    ...
end;
****************************************

--
Esteban Olm
S.I.T.E.M., S.L.
Consultoria Tcnica en Sistemas de Informacin Geogrfica y Teledeteccin
Barcelona, Espa?a
http://www.sitem-consulting.com

 

Re:TADOTable.Refresh doesn't work ??


Quote
>Tabla:TADOTable
>...
>(* Tabla is empty, and I insert a Row *)
>..

>Tabla.Refresh;
>If Not(Tabla.IsEmpty) then begin
>    ...
>   (* Do something *)
>    ...
>end;

What are you expecting to happen?   It looks to me like you should be using Post
here not refresh.
Anyway Refresh is not well implemented under ADO express controls.  I suggest
you use a TadoDataset and use Requery instead.

--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Re:TADOTable.Refresh doesn't work ??


Hello Brian

I wanted to say this:

****************************************
Tabla:TADOTable
...
(* Tabla is empty, and I insert a Row *)

    Conection.StartTrans;                 <-ADD
FORM HERE
    try
        Tabla.Append;
        (* Write all the Fields in the Row *)
        Tabla.Post;
        Conection.CommitTrans;
    except
        Conection.RollbackTrans;
    end;                                  <-TO
HERE
..

Tabla.Refresh;
If Not(Tabla.IsEmpty) then begin
    ...
   (* Do something *)
    ...
end;
****************************************

All works (here is in pseudocode), but the Refresh
doesn't work, and the rows IS appended ok at the
table.

I think the refresh is not well implemented. But
if Borland knows it.... Wy does'nt Borland give us
a well implemented unit???

Thanks!!

P.D.: What does "Team B" means???

"Brian Bushay TeamB" <BBus...@Nmpls.com> escribi
en el mensaje
news:gomghton8rosk4kh88becbjao20993e22t@4ax.com...

Quote

> >Tabla:TADOTable
> >...
> >(* Tabla is empty, and I insert a Row *)
> >..

> >Tabla.Refresh;
> >If Not(Tabla.IsEmpty) then begin
> >    ...
> >   (* Do something *)
> >    ...
> >end;

> What are you expecting to happen?   It looks to

me like you should be using Post
Quote
> here not refresh.
> Anyway Refresh is not well implemented under ADO

express controls.  I suggest

Quote
> you use a TadoDataset and use Requery instead.

> --
> Brian Bushay (TeamB)
> Bbus...@NMPLS.com

--
Esteban Olm
S.I.T.E.M., S.L.
Consultoria Tcnica en Sistemas de Informacin
Geogrfica y Teledeteccin
Barcelona, Espa?a
http://www.sitem-consulting.com

Re:TADOTable.Refresh doesn't work ??


Quote
>I think the refresh is not well implemented. But
>if Borland knows it.... Wy does'nt Borland give us
>a well implemented unit???

Borland tried to create dataset components for ADO that closely mirrored the BDE
dataset properties and methods.  However these do not always match up well to
ADO capabilities.  Borland also provided methods to use ADO capabilities.   So
use Requery.

--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Other Threads