BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Syncing TQuery/TTable

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Language)
View previous topic :: View next topic  
Author Message
Greg Bryant
Guest





PostPosted: Sat Jul 26, 2003 10:40 pm    Post subject: Syncing TQuery/TTable Reply with quote



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
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Language) All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.