Board index » delphi » Creating FoxPro table with right language driver.

Creating FoxPro table with right language driver.

         Subject says it all - I need to create FoxPro .dbf in my
Delphi program, which itself isn't a problem. Problem is how to set
right language driver for this table.

--
Virgo P?rna
virgo.pa...@mail.ee

 

Re:Creating FoxPro table with right language driver.


In article <slrn9lnt3c.r5.virgo.pa...@dragon.gaiasoft.ee>,
virgo.pa...@mail.ee says...

Quote
> Subject says it all - I need to create FoxPro .dbf in my
> Delphi program, which itself isn't a problem. Problem is how to set
> right language driver for this table.

The Language driver will set the order of the items in your indexes. This
has to be quite different according to your clients' mother tongue. So
the question is: from which Country are you?

If your are from an English-speaking or a French-speaking country, use
'WEurope' ANSI.

Since you are using the BDE, you should know that it has problems dealing
with FoxPro's indexes. I don't remember which versions of the BDE could
be safe safe but please check in the NG archives to get more details. If
it is possible, use dBASE tables instead: the BDE is perfectly compatible
with them.

Jean-Pierre Martel, editor
The dBASE Developers Bulletin
http://www.jpmartel.com/bu12_b.htm

Re:Creating FoxPro table with right language driver.


Quote
On Mon, 23 Jul 2001 08:09:59 -0400, Jean-Pierre Martel wrote:

>has to be quite different according to your clients' mother tongue. So
>the question is: from which Country are you?

    I am from Estonia, but that doesn't matter - the question is - how
can I set language driver, when I create tables in run-time. These
tables does not have index's, but as it turned out, with wrong
language driver I can't insert acsented characters into char fields
(???).

Quote
>be safe safe but please check in the NG archives to get more details. If
>it is possible, use dBASE tables instead: the BDE is perfectly compatible

   These tables would be imported by program, that wants fox dbf's and
one of the tables has memo field (and memos seem to be different in
different dbf's).

--
Virgo P?rna
virgo.pa...@mail.ee

Re:Creating FoxPro table with right language driver.


In article <slrn9lo58g.r5.virgo.pa...@dragon.gaiasoft.ee>,
virgo.pa...@mail.ee says...

Quote
> How can I set language driver, when I create tables in run-time.

To _create_ a table with a language driver different from the default one
in the BDE Administrator, you could use DbiCreateTable. You can find an
example at:
http://www.inprise.com/devsupport/bde/bdeapiex/dbicreatetable.html

To change the language driver of an _existing_ table, you could
use DbiDoRestructure:

procedure ChangeTableLanguage(Table: TTable);
const
   OptData: PChar = 'DBWINWE0';
   OptDesc: FldDesc = (szName: 'LANGDRIVER'; iOffset: 0; iLen: 9);
var
   CursorProp: CurProps;
   TblDesc: CRTblDesc;
   DBHnd: hDBIDb;
begin
   Table.Open;
   Check(DbiGetCursorProps(Table.Handle, CursorProp));
   FillChar(TblDesc, SizeOf(TblDesc), #0);
   with TblDesc do
   begin
      StrCopy(szTblName, CursorProp.szName);
      StrCopy(szTblType, CursorProp.szTableType);
      // Set the language driver
      iOptParams := 1;
      pFldOptParams := @OptDesc;
      pOptData := OptData;
   end;
   DBHnd := Table.Database.Handle;
   Table.Close;
   Check(DbiDoRestructure(DBHnd, 1, @TblDesc, nil, nil, nil, False));
end;

Jean-Pierre Martel, editor
The dBASE Developers Bulletin
http://www.jpmartel.com/bu12_b.htm

Other Threads