Hi,
The easiest way what i have used to solve this problem is that I 
used a TDBNavegator component.

Use the component to your main form where you are displaying your 
DBGrid. Use the same datasource (which you are using for DBGrid) to 
the navegator.

After posting any record, [Insert/Append/Update] just call a Refresh 
to the Navegator. This will refesh the Records to the DataSource. 
And DataSource will refresh your DBGrid.

Note: you can make invisible the Navegator.

Thanks
Iqbal

--- In [email protected], "anomander1" <[EMAIL PROTECTED]> 
wrote:
>
> Hello,
> 
> I have a strange problem.
> I have a DbGrid on a Form
> A TADODataSet on a DataModule
> A TADOConnection on another DataModule
> 
> All the data is shown in the DbGrid
> When i use the add button to add data to the database, i get a new 
Form.
> In this form i enter new data and Press Save.
> The program saves the data and i close the Form.
> When i come back to my first form, the newly added data is not 
shown
> in the DbGrid.
> 
> When i exit my form and re-enter the form, the data is shown.
> 
> This is how i work.
> When i start my program, i connect the TADOConnection with the 
database.
> When i start my Form with data, i set up my SQL string (in Source) 
and
> set it to the TADODataSet on the DataModule. The ADODataSet is 
already
> connected to the TADOConnection. The DbGrid is already connected to
> the TADOconnection.
> 
> Can anyone tell me what i need to do more to make the program show 
the
> new data. I do not want to requery my SQL, only that the data is 
shown
> directly.
> 
> The strange thing is... 
> I have another program written in Delphi 5, that has the same 
settings
> for the Connection, Dataset and DbGrid as my new program, and that 
one
> works.
> 
> TIA
> Marco
>


Reply via email to