Je suis en train d'étudier l'accès DBE avec sa propre API.

L'example de Borland (Template Delphi 6) tourne trés bien si j'enlève la procédure Check. Par exemple: (DbiInit(nil)); au lieu de Check(DbiInit(nil));
Evidemment je perds la fonctionalité de "Check".

Below is the complete program that puts all of the individual steps together. It demonstrates each of the basic steps described in the "Basic procedure" for BDE application development. You can execute the template program and step through it to see how it works: it opens a BDE sample table, visits one record, and retrieves the value from one field in that record. Use this template program as a skeleton on which to build your own BDE programs.

In this example program, the handler for the OnClick event of the TButton component Button1 executes the BDE code. The BDE code accesses a Paradox table and retrieves the value from a field in that table. The retrieved field value is assigned as the value of the Caption property of the TLabel component Label1.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
unit BDEProg1;
 
interface
 
uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, BDE;
 
type
  TForm1 = class(TForm)
    Button1: TButton;
    Label1: TLabel;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
end;
 
var
  Form1: TForm1;
 
implementation
 
{$R *.DFM}
 
procedure TForm1.Button1Click(Sender: TObject);
 
var
  hDB: hDBIDb; // Database handle
  hCur: hDBICur; // Handle to the data cursor
  szTableName: array [0..DBIMAXNAMELEN] of Char; // Table name
  CursorProps: CURProps; // Data cursor properties
  RecordBuffer: pBYTE; // Buffer into which to load a record
  Company: array [0..30] of Char;  // Variable for Company field
  IsBlank: BOOL; // Variable for blank fields
begin
  Check(DbiInit(nil));
  Check(DbiOpenDatabase(nil, nil, dbiREADONLY, dbiOPENSHARED, nil, 0, nil, nil, hDB));
 
  Check(DbiSetDirectory(hDB, 'd:\Program Files\Borland\Borland Shared\Data'));
  Check(DbiSetPrivateDir('c:\Temp'));
  szTableName := 'Customer';
  Check(DbiOpenTable(hDB, szTableName, szPARADOX, nil, nil, 0, dbiREADONLY, dbiOPENSHARED, xltFIELD, False, nil, hCur));
  Check(DbiGetCursorProps(hCur, CursorProps));
  RecordBuffer := AllocMem(CursorProps.iRecBufSize * SizeOf(BYTE));
  Check(DbiSetToBegin(hCur));
  Check(DbiGetNextRecord(hCur, dbiNOLOCK, RecordBuffer, nil));
 
  Check(DbiGetField(hCur, 2, RecordBuffer, pBYTE(@Company), IsBlank));
  FreeMem(RecordBuffer);
  if not (hCur = nil) then Check(DbiCloseCursor(hCur));
  if not (hDB = nil) then Check(DbiCloseDatabase(hDB));
  Check(DbiExit);
  Label1.Caption := StrPas(Company);
end;
 
end.
Si je la laisse le compilo me réponds Undeclared identifier "Check".

Quelle est ma bêtise ?

Merci, cordialement,
Horacio