Solved

[Q] Intercepting Database Changes....

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Need Delphi function to get Youtube video title 5 222
IdTelnet1DataAvailable handler freezes the Application 4 62
find a node in VST 2 63
Dev Express grid collapse 2 39
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
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: …

932 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

14 Experts available now in Live!

Get 1:1 Help Now