Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

[Q] Intercepting Database Changes....

Posted on 2001-06-18
4
Medium Priority
?
183 Views
Last Modified: 2010-04-04
What I want to be able to do is intercept all database changes at either a TDataBase or TADOConnection level. Something akin to what SQL monitor does. It appears that TSession.TraceFlags provides an inking of what can be done.

Questions:

1. Why does SQL monitor only show trace information for BDE connections to Server Databases eg SQL Server, Interbase etc. When hooking up a TDataBase to a Paradox database nothing appears in the trace window? Does that mean that BDE Callbacks for cbTRACE only work with remote servers?
2. Has anyone got any alternate ways to do this? I do not want to use a TDataSet descendent that implements a cbTABLECHANGED callback as I would then miss direct SQL changes and would have to have  custom TDataSet descendents. I want to do this at a connection level. ie TDataBase,
TADOConnection etc.
3. Delphi 6 seems to offer a component that does this (TSQLMonitor). Can someone let me know how it does this? (Our copy of D6 is still en route :-() What bothers me about that component however is that it still seems to
indicate that a remote server is involved. I want to get at a local Paradox table.

TIA
0
Comment
Question by:dedye
4 Comments
 
LVL 8

Accepted Solution

by:
TOndrej earned 1200 total points
ID: 6205730
Hi dedye, I'm no BDE/Paradox expert but I have a few notes for you:

1. From Delphi help: "The SQL Monitor enables you to see the actual statement calls made through SQL Links to a remote server or through the ODBC socket to an ODBC data source."
SQL Links is used only for SQL server databases; for local table systems like Paradox, DBF etc. BDE database drivers are used.
TSession.TraceFlags are again only used with SQL Monitor.

> Does that mean that BDE Callbacks for cbTRACE only work with remote servers?
I haven't tried but my guess is that's correct. SQL Trace is part of SQL Links.

2.
> I do not want to use a TDataSet descendent that implements
> a cbTABLECHANGED callback as I would then miss direct SQL changes
Are you sure? I would expect that once you register a cbTABLECHANGED callback, you will receive notification whenever the table is changed even by a TQuery within the same TSession. I haven't tried it though.
If you want to try, there's "Table change notification component with source" on http://www.borland.com/devsupport/bde/delphifiles.html can be useful.
It's definitely not as powerful as SQL Trace though.

3. TSQLMonitor only works with IBX components, AFAIK.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 8440541
Hi dedye,
<Edited by SpideyMod>
An erroneous auto-delete was posted, we have corrected the problem.  Please indicate recommendations and these will not be scheduled for auto-delete, but will be finalized within the standard week notice.

A recommendation of "answered by TOndrej" has already been proposed.

CleanupGuy -- EE database cleanup volunteer
0
 
LVL 26

Expert Comment

by:Russell Libby
ID: 8684167

No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept TOndrej's comment as answer

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 

Thank you,
Russell

EE Cleanup Volunteer
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question