Solved

[Q] Intercepting Database Changes....

Posted on 2001-06-18
4
161 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
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
creating threads in delphi 1 133
Delphi inherited method 6 76
Delphi: Connect to running MS Outlook 4 122
Twebbrowser add css to the header 3 28
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

839 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