• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 322
  • Last Modified:

How to update DbCtrlGrid on mysql database change?

How to update DbCtrlGrid on mysql database change?
Database is on server and i want:
if database on server something change
form on my computer maximizes
How to do it?
0
selas
Asked:
selas
  • 3
  • 3
1 Solution
 
kretzschmarCommented:
i guess you have to poll in a defined intervall for changes
0
 
selasAuthor Commented:
you mean timer?
0
 
kretzschmarCommented:
>you mean timer?
yep

maybe additional things must be done,
depending on the complexity of your database-design
-> means, if you have to monitor many tables,
you could define a trigger for each table,
which updates or insert a row into one table,
which you could then easily poll

meikl ;-)
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
selasAuthor Commented:
i added timer, but i don't know how to catch dbctrlgrid change
if something changed i need to maximize...
0
 
kretzschmarCommented:
well, of course,
the database does not tell you that something has changed.

you have to build some kind of logic, where you can detect
a change, but how depends on your compare-values you have,
where you could lookup (query).

tell a bit more

meikl ;-)
0
 
Ivanov_GCommented:
you can use one more table in the DB. Let's say DB_CHANGES

DB_CHANGES
------------------------------------------
TABLE_NAME          IS_CHANGED

and you work with MY_TABLE.
write a trigger for MY_TABLE for AFTER insert, delete, update. When such event occur, you write in DB_CHANGES table.
and OnTimer you should execute this SQL:

SELECT * FROM DB_CHANGES
WHERE TABLE_NAME = 'MY_TABLE'
  AND IS_CHANGED = 1

then check if the DataSet is empty, and update this back to IS_CHANGED = 0. If the table MY_TABLE is changed, you can refresh the bigger DataSet attached to the DBGrid...
0
 
selasAuthor Commented:
i added Dbctrlgrid1.PanelCount
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now