Solved

BDE Callback for Paradox tables

Posted on 1997-10-05
2
716 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

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

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

821 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