Solved

[Q] Intercepting Database Changes....

Posted on 2001-06-18
4
152 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 300 total points
Comment Utility
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
Comment Utility
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
Comment Utility

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

762 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now