Author: William Gerbert
How can I retrieve a list of available BDE language drivers?
Answer:
The following Delphi procedure returns a formatted list of available BDE language
drivers. The procedure can be called as shown in the buttonclick method below.
Add BDE and DBTables to your unit's uses clause.
1 procedure GetLdList(Lines: TStrings);
2 var3 hCur: hDBICur;
4 LD: LDDesc;
5 cnt: integer;
6 begin7 // get a cursor to the in-mem table containing language8 // driver information...9 cnt := 0;
10 check(dbiinit(nil));
11 Check(DbiOpenLdList(hCur));
12 try13 while (DbiGetNextRecord(hCur, dbiNOLOCK, @LD, nil) = DBIERR_NONE) do14 begin15 cnt := cnt + ;
16 Lines.Add(format('%4d %-6s%- 0s %- 0s%5s %- 0s %- 0s', [cnt, 'Name:',
17 LD.szName,
18 'Code Page:', IntToStr(LD.iCodePage), 'Description:', LD.szDesc]));
19 end;
20 finally Check(DbiCloseCursor(hCur));
21 check(dbiexit);
22 end;
23 end;
24 25 procedure TForm.Button Click(Sender: TObject);
26 begin27 getldlist(memo.lines);
28 end;
29 30 end.