Solved

BDE Callback for Paradox tables

Posted on 1997-10-05
2
704 Views
Last Modified: 2008-03-10
Anyone know how to use DbiRegisterCallBack to tell when a table has been edited?  I have Delphi applications that share a Paradox database on a network and I want each application running on a different machine to know when certain tables in the database are updated so I can update the application's display.  I only care about a few of the tables, not all of them.  I tried a dbiRegisterCallback and then went into Database Desktop and edited a record in a table and nothing happend.  Here is the code of my test application:

{Our callback  function}
function DbiCbFn(ecbType     : CBType;
                 iClientData : Longint;
                 CbInfo      : pointer): CBRType stdcall;
var
  s : string;
begin
  showmessage('Callback succeeded!');
end;


procedure TForm1.Button1Click(Sender: TObject);
begin
 {Make sure the table we are moving from is open}
  Table1.Open;
 {register our callback}
  DbiRegisterCallBack(table1.handle,
                      cbTABLECHANGED,
                      0,
                      0,
                      nil,
                      @DbiCbFn);


end;

Note: I am using Delphi 2 with BDE 3.5 for this application.
I can upgrade to BDE 4.0 if necessary but not Delphi 3.
0
Comment
Question by:pswenson
2 Comments
 

Author Comment

by:pswenson
ID: 1346851
Adjusted points to 75
0
 
LVL 8

Accepted Solution

by:
ZifNab earned 70 total points
ID: 1346852
Borland has an example of this.

piece of support page :

Example 2: Register the cbTABLECHAGNED callback for notification when a Paradox table's data has changed

This example is too complicated to be shown here. A sample Delphi registration component with an example is available that will do all the registration work for you. Simply install the new TTable component (TRegisterTable in RegisterTable.pas) and compile the included project. This component will work with all table types, but will only use the callback with Paradox table types.

You can go to this page:

http://www.borland.com/devsupport/bde/bdeapiex/dbiregistercallback.html

Or you can download the example zip-file from :

http://www.borland.com/devsupport/bde/files/tablechanged.zip

Have fun,
c.u. ZifNab;
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

760 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

23 Experts available now in Live!

Get 1:1 Help Now