Greg Bryant Guest
|
Posted: Sat Jul 26, 2003 10:40 pm Post subject: Syncing TQuery/TTable |
|
|
Okay, not being a database app programmer, I'm not sure if I've done this
right. I have a TDBGrid that displays info from a TTable (Actually a
TEasyTable, but the distinction, I believe, is moot). One of the fields, a
boolean, is of interest for this exercise.
The components look like this:
DBGameGrid->DataSource->DBTable
I have a menu item that should reset this boolean field ("Favorite"),
whereever true, to be false. Rather than walk the database, or set a
filter, either of which would be immediately reflected in the TDBGrid and
look very odd to the user, I dropped in a TQuery (MyQuery->DataSource->
DBTable), and execute the SQL statement "Update GameInfo Set Favorite=0
Where Favorite<>0;"
This works, i.e. the fields that are true are now false. Unfortunately,
the TDBGrid has apparently cached this info, so it isn't changed until I
completely scroll off the page, and back (or stop the program and restart)
- urgh.
How do I force a refresh of the DBGrid, or is my approach completely
screwed?
Thanks,
Greg
|
|