Board index » delphi » BDE and language drivers

BDE and language drivers

Hi there,
Does anybody know how to create Paradox-tables with a language driver
different than the language driver that is standard for the alias used ?
I need to display some texts in different languages, such as polish,
cyrillic or danish. Some of the charcters used in this languages
are not displayed correctly when the wrong language driver
is used for the table.
The only way I know is to change the driver, using the database desktop
programm supplied with delphi.
I think there must be a way to do this in an own programm, perhaps
with "DBIDoRestructure". But i don't know how to set the parameters
for this routine correctly, since the parameters for languagedrivers
are "optional parameters" and the LDDesc-structure is not explained
clearly in my help files (which is the symbolic name for a language driver,
which is it's descriptive name ???)

Thanks in advance,
Ralf

 

Re:BDE and language drivers


In article <6spap0$mc...@news.metronet.de>,
        "Ralf Kaiser" <rkaiser....@metronet.de> writes:

Quote
> Does anybody know how to create Paradox-tables with a language driver
> different than the language driver that is standard for the alias used ?

> I think there must be a way to do this in an own programm, perhaps
> with "DBIDoRestructure". But i don't know how to set the parameters

Here it is a example:

procedure TForm1.ChangeLangDriver(TableName, LangDriver: String);
var
  hDb:     hDbiDb;
  TblDesc: CRTblDesc;
  Dir: Array[0..255] of char;
  OpType: CROpType;
  OptFldDesc: FLDDesc;
  OptData: Array[0..255] of char;

begin
    Table.TableName := TableName;
    Table.open; {}
    Check( DbiGetDirectory( hDBIDb(Table.DBHandle), False, @Dir ) );
    Table.close;

    Check( DbiOpenDatabase( nil, nil, dbiReadWrite, DBIOpenExcl, nil, 0, nil, nil, hDb ) );
    Check( DbiSetDirectory( hDb, @Dir ) );
    FillChar( TblDesc, sizeof( CRTblDesc ), #0 );
    TblDesc.iValChkCount := 0;
    TblDesc.pVChkDesc := nil;
    OpType := crNOOP;
    TblDesc.pecrValChkOp := @OpType;
    StrPCopy( TblDesc.szTblName, Table.TableName );
    StrCopy( TblDesc.szTblType, szParadox );
    StrPCopy( TblDesc.szErrTblName, copy(Table.TableName, 1, 6) + '__' );
    with OptFldDesc do begin
      iFldNum := 1;                           { Feldnummer }
      StrPCopy( szName, szCFGDRVLANGDRIVER ); { Name des Feldes = Op. Language Treiber ?ndern }
      iFldType := fldZString;                 { Typ von szName: String  }
      iSubType := fldUNKNOWN;                 { Subtype des Feldes: nicht verwendet }
      iUnits1  := DBIMAXTBLNAMELEN;           { (Max.) L?nge des Feldes/Strings }
      iUnits2  := 0;                          { Dezimalstellen: nicht verwendet }
      iOffset  := 0;                          { Offset des Feldes im Record: nicht verwendet }
      iLen     := DBIMAXSCFLDLEN;             { L?nge des Feldes: max. L?nge }
      iNullOffset := 0;                       { Offset des NULL-Indikators: nicht verwendet }
      efldvVchk := fldvNOCHECKS;              { Types of Vaildaty Checks: keine }
      efldrRights := fldrREADWRITE;           { Benutzerrechte frs Feld: Read/write }
    end; { Array of field descriptors }
    StrPCopy( OptData, Langdriver );
    TblDesc.iOptParams := 1;                  { Anzahl der optionalen Parameter }
    TblDesc.pfldOptParams := @OptFldDesc;     { Zeiger auf Array welches die zu ?ndernden
                                                Felder und die Operationen beschreibt }
    TblDesc.pOptData := @OptData;             { Zeiger auf die neuen Werte }
    cbClientData := 0;

    Check(DbiDoRestructure(hDb, 1, @TblDesc, nil, 'KEYVIOL', 'ERROR', false));
    DBICloseDatabase( hDB );
end;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        end;

--
 _____      _  __          Uferweg 9         tobias.kretsch...@gmx.de
|_   _|    | |/ /          02791 Niederoderwitz  tkretsch...@isgus.de
  |_|obias |_|\_\retschmar             http://www.kretschmar.ddns.org

Other Threads