Discussion:
DBGrid not updated after change to the underlying datasource
(too old to reply)
Vasileios Lourdas
2004-02-25 10:50:34 UTC
Permalink
Hello group,

I'm using Delphi 7 and I have a problem with a DBGrid component. I make
changes to the underlying datasource which the grid uses as a source, but the
problem is that even if I call the Close, Open, or Refresh methods for the
datasource, I don't see the new records just inserted in the grid.

Any help would be appreciated.
- --
+ Vasileios Lourdas,
+ Informatics Engineer,
+ Web page : http://users.otenet.gr/~lourdas
+ Thessaloniki, Greece
Markku Nevalainen
2004-02-27 23:30:20 UTC
Permalink
Post by Vasileios Lourdas
Any help would be appreciated.
Starting to guess through all your possible DB engine, network
environment and operating system versions etc. is a bit tedious...

So maybe some more details would give better responses.
Vasileios Lourdas
2004-03-01 08:31:09 UTC
Permalink
Post by Markku Nevalainen
Starting to guess through all your possible DB engine, network
environment and operating system versions etc. is a bit tedious...
So maybe some more details would give better responses.
Yes, you are right :-)

I'm using ADO as the database engine, Windows XP Professional (sp1) and Delphi
7 Enterprise. I'm using the standard TDBGrid component from the data access
controls.
- --
+ Vasileios Lourdas,
+ Informatics Engineer,
+ Web page : http://users.otenet.gr/~lourdas
+ Thessaloniki, Greece
Markku Nevalainen
2004-03-02 08:36:15 UTC
Permalink
Post by Vasileios Lourdas
I'm using ADO as the database engine, Windows XP Professional (sp1) and Delphi
7 Enterprise.
You are still not telling what is your database, Access, DBase, Excel,
SQL Server, Oracle... And not if it is a multi user network or single
user. What kind of SQL code you are using when posting your data, etc.
Post by Vasileios Lourdas
I'm using the standard TDBGrid component from the data access controls.
First, the problem has nothing to do with TDbGrid. If you can't see
the new data in TDbGrid, then you can't see it in TDbEdit, TDbText or
any other DB control either.

What is the action you have to do that you finally CAN see the
changed data in your data controls. Close and re-open the app??

If the data yet was written and stays to the physical disk DB file,
then there's something wrong with your own code. And without
seeing any part of your code, I have no suggestions what to correct.

I can suggest that you make simplest possible, one Form test application.
Drop your DbGrid on the Form, and do test with your current, or
simplified update routine, and see what happens.

This way, with simple test code, one usually does get the DbGrid
updated normally, and finds what was the problem with the original
code.

Markku Nevalainen
Vasileios Lourdas
2004-03-02 11:49:00 UTC
Permalink
Markku Nevalainen wrote:
[snip]
Post by Markku Nevalainen
This way, with simple test code, one usually does get the DbGrid
updated normally, and finds what was the problem with the original
code.
Alright, I found the problem. It's an error of mine in the first place, I was
using wrong database connections.

I apologize for the time you've spent on this thread, sorry :(
- --
+ Vasileios Lourdas,
+ Informatics Engineer,
+ Web page : http://users.otenet.gr/~lourdas
+ Thessaloniki, Greece
Markku Nevalainen
2004-03-02 20:31:27 UTC
Permalink
Post by Vasileios Lourdas
I apologize for the time you've spent on this thread, sorry :(
I have no complaints, I'm doing this voluntarily anyway:)

And only if I have feeling that now I might have time and lust
to try to answer to some question.

As you can see, it took nearly three days after your original
question before the right feeling arose.<g> The original
question gave almost no basic facts about anything. That's
why it was real close I had not bothered to grab on it.

Then I recalled that I too have made unclear questions during
the years. And still got useful answers from the newsgroups.

Markku Nevalainen

Myron
2004-03-01 11:27:38 UTC
Permalink
Post by Markku Nevalainen
Post by Vasileios Lourdas
Any help would be appreciated.
Starting to guess through all your possible DB engine, network
environment and operating system versions etc. is a bit tedious...
So maybe some more details would give better responses.
I'm just tuning in, but have you tried to refresh the datasource and
the dbgrid after the DB changes?
HTH,
Myron
Vasileios Lourdas
2004-03-01 12:39:55 UTC
Permalink
Post by Myron
I'm just tuning in, but have you tried to refresh the datasource and
the dbgrid after the DB changes?
HTH,
Myron
Yes, I've already said that in my first msg. It did not work... :-(
- --
+ Vasileios Lourdas,
+ Informatics Engineer,
+ Web page : http://users.otenet.gr/~lourdas
+ Thessaloniki, Greece
pr
2004-03-01 18:32:40 UTC
Permalink
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Post by Myron
I'm just tuning in, but have you tried to refresh the datasource and
the dbgrid after the DB changes?
HTH,
Myron
Yes, I've already said that in my first msg. It did not work... :-(
- --
Two possibilities
-dbgrid not connected to the datasource that is closed and reopened
-changes not committed before closing dataset and reopening

PR
pr
2004-03-02 04:52:05 UTC
Permalink
Post by pr
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Post by Myron
I'm just tuning in, but have you tried to refresh the datasource and
the dbgrid after the DB changes?
HTH,
Myron
Yes, I've already said that in my first msg. It did not work... :-(
- --
Two possibilities
-dbgrid not connected to the datasource that is closed and reopened
-changes not committed before closing dataset and reopening
Third possibility:
-posted records filtered out

PR
Loading...