Solved

[Q] Intercepting Database Changes....

Posted on 2001-06-18
4
165 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
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…

752 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