 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Will Guest
|
Posted: Mon Jan 17, 2005 9:28 pm Post subject: Updating Data in Paradox |
|
|
I'm running an app where changes are made to a Paradox database, but the
changes being made aren't showing up until I shut the app down, and restart
it.
How can I force the changes to appear right away?
Thanks.
--
Will
|
|
| Back to top |
|
 |
Will Guest
|
Posted: Tue Jan 18, 2005 12:40 am Post subject: Re: Updating Data in Paradox |
|
|
"Will" <dragoon136_ns (AT) hotmail (DOT) com> wrote
| Quote: | I'm running an app where changes are made to a Paradox database, but the
changes being made aren't showing up until I shut the app down, and
restart
it.
How can I force the changes to appear right away?
Thanks.
--
Will
|
Well, I figured out a workaround...free the datamodule, and than recreate it
when I reopen the form. Pain in the ass, but it works, and the datamodule is
small, so it doesn't have to do too much work.
--
Will
|
|
| Back to top |
|
 |
Bill Todd Guest
|
Posted: Tue Jan 18, 2005 1:02 am Post subject: Re: Updating Data in Paradox |
|
|
That is not the right solution. Is this a multi-user application? If so,
make sure that the BDE on every PC is configured exactly as described in
http://community.borland.com/article/0,1410,15247,00.html
--
Bill Todd (TeamB)
TeamB cannot answer questions received via email
|
|
| Back to top |
|
 |
Will Guest
|
Posted: Tue Jan 18, 2005 6:09 pm Post subject: Re: Updating Data in Paradox |
|
|
"Bill Todd" <no (AT) no (DOT) com> wrote
Thanks. I'm going to print it out, and make the adjustments as needed.
--
Will
|
|
| Back to top |
|
 |
Will Guest
|
Posted: Tue Jan 18, 2005 9:01 pm Post subject: Re: Updating Data in Paradox |
|
|
"Bill Todd" <no (AT) no (DOT) com> wrote
I did make that change, and I am going to restart Delphi, and Database
Desktop, to see if it works now...well, the changes that I made made no
difference, the stuff still didn't show up until I freed, and re-created the
datamodule.
--
Will
|
|
| Back to top |
|
 |
Bill Todd Guest
|
Posted: Tue Jan 18, 2005 9:29 pm Post subject: Re: Updating Data in Paradox |
|
|
What do you mean by "didn't show up"? What did not show up where? We need
a much more detail (possibly step by step) description of what you are
doing before we can help you. Are you saying that you make a change to a
record in Database Desktop and do not see the change in your application?
If so, is your app using a TTable or a TQuery to view the data?
--
Bill Todd (TeamB)
TeamB cannot answer questions received via email
|
|
| Back to top |
|
 |
Dell Stinnett Guest
|
Posted: Tue Jan 18, 2005 9:34 pm Post subject: Re: Updating Data in Paradox |
|
|
It won't automatically show up in DB Desktop until you do a Refresh.
Two ways to make sure that the data is posted immediately and not cached:
1. As mentioned, in the BDE set LocalShare to True.
-or-
2. Include dbiProcs in your uses clause and in the "AfterPost" event put a
call to dbiSaveChanges:
dbiSaveChanges(table.handle);
Even implementing one of these, you will still have to refresh the table in
DB Desktop in order to see the changes.
-Dell
|
|
| Back to top |
|
 |
Bill Todd Guest
|
Posted: Tue Jan 18, 2005 10:56 pm Post subject: Re: Updating Data in Paradox |
|
|
dbiProcs is from Delphi 1. All the BDE functions were moved to the BDE
unit starting in Delphi 2. The old unit names are aliased so they still
work.
--
Bill Todd (TeamB)
TeamB cannot answer questions received via email
|
|
| Back to top |
|
 |
Will Guest
|
Posted: Wed Jan 19, 2005 12:03 am Post subject: Re: Updating Data in Paradox |
|
|
"Bill Todd" <no (AT) no (DOT) com> wrote
| Quote: | What do you mean by "didn't show up"? What did not show up where? We need
a much more detail (possibly step by step) description of what you are
doing before we can help you. Are you saying that you make a change to a
record in Database Desktop and do not see the change in your application?
If so, is your app using a TTable or a TQuery to view the data?
--
Bill Todd (TeamB)
TeamB cannot answer questions received via email
|
Sorry, I'll give more detail.
Form contains a TDBEdit control.
TDBEdit control is connected to a datasource, connected to a TTable on a
TDatamodule.
TDBEdit is only for viewing data, not modifying.
Value displayed by TDBEdit is modified elsewhere, and then updated via a
TQuery component, which is on the same datamodule as the TTable.
ExecSQL is called on the TQuery, and the table is Refreshed. The change was
not reflected in the TDBEdit.
TTable is opened and closed, and the TDBEdit does not reflect the change
The form is opened and closed, and the TDBEdit does not reflect the change.
The datamodule is freed, and recreated, and the change IS reflected in the
TDBEdit control
I cannot view the table in Database Desktop, because I get a ".Net directory
is controlled by another file" error while the application is running.
Though if I shut the app down, and then view it, the change does appear.
I made the change to the BDE Init that Bill suggested. Since the app is
still under development, the app is not on a network, but local only.
--
Will
|
|
| Back to top |
|
 |
Bill Todd Guest
|
Posted: Wed Jan 19, 2005 1:31 am Post subject: Re: Updating Data in Paradox |
|
|
If the app is still under development I strongly suggest that you not use
the BDE. If you are going to use the BDE and Paradox tables do you use SQL
to update records. I have not see the behavior you describe but I have
heard of it happening. If you must do the update with SQL try running the
update statement in a second BDE session. This will cause the BDE to
effectively see the TTable and the TQuery as two different users and
should solve your problem.
--
Bill Todd (TeamB)
TeamB cannot answer questions received via email
|
|
| Back to top |
|
 |
Will Guest
|
Posted: Wed Jan 19, 2005 5:04 pm Post subject: Re: Updating Data in Paradox |
|
|
"Bill Todd" <no (AT) no (DOT) com> wrote
| Quote: | If the app is still under development I strongly suggest that you not use
the BDE. If you are going to use the BDE and Paradox tables do you use SQL
to update records. I have not see the behavior you describe but I have
heard of it happening. If you must do the update with SQL try running the
update statement in a second BDE session. This will cause the BDE to
effectively see the TTable and the TQuery as two different users and
should solve your problem.
--
Bill Todd (TeamB)
TeamB cannot answer questions received via email
|
Can you use Paradox without the BDE?
So, to get a scond session, I would need to use the TSession class, and
attach the TQuery & TTable to it, but otherwise everything else would stay
the same, correct?
--
Will
|
|
| Back to top |
|
 |
Bill Todd Guest
|
Posted: Wed Jan 19, 2005 6:32 pm Post subject: Re: Updating Data in Paradox |
|
|
No, you cannot use Paradox tables without the BDE.
Add a TSession to the app but only connect the TQuery to the new session.
Leave the TTable in the default session. IIRC this will solve your problem.
--
Bill Todd (TeamB)
TeamB cannot answer questions received via email
|
|
| Back to top |
|
 |
Dell Stinnett Guest
|
Posted: Wed Jan 19, 2005 8:14 pm Post subject: Re: Updating Data in Paradox |
|
|
Well, you can tell where I started with Delphi! <grin!> Actually, it's been
several years since I've worked with Paradox and BDE, but I was remembering
what I had to do to get it to get it to work....Thanks!!
-Dell
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|