LANGDRIVER 
Author Message
 LANGDRIVER
I'm using D5 with Paradox tables.
How to set LANGDRIVER at runtime ?

Marc PLEYSIER
Solune Informatique - Service technique



Mon, 22 Dec 2003 20:01:07 GMT
 LANGDRIVER

As far as I know, the language driver is set for each table, and
affects that table only. In the BDE administrator, you can set the
default language driver that will be used when creating a new table,
unless you create it with a different driver specified. I know of no
way to change this default setting in code.

The BDE help has a listing of all the language drivers and some
descriptions of how they work and are set. From this, I understand
there is no way to change the driver for a given table without copying
it to a new table or at least restructuring it.

Have you looked in borland.community.com? I haven't needed this info
before, so I can't say, but there are many good answers there.

hth,
Dan



Quote:
>I'm using D5 with Paradox tables.
>How to set LANGDRIVER at runtime ?

>Marc PLEYSIER
>Solune Informatique - Service technique


--
Dan Brennand
CMDC systems, inc.
Configuration Management and Document Control:
visit us at www.cmdcsystems.com



Tue, 23 Dec 2003 00:15:07 GMT
 LANGDRIVER
Quote:
> As far as I know, the language driver is set for each table, and
> affects that table only.
OK
> In the BDE administrator, you can set the
> default language driver that will be used when creating a new table,

OK. I want to set it by code before creating a new table.
I read that we can do that with :
Params.Add('LANGDRIVER=xxx');//Params is a StringList.
Session.ModifyDriver('PARADOX',Params);
But it don't seem to work.

Thanks for your help.

Marc



Tue, 23 Dec 2003 01:16:29 GMT
 LANGDRIVER
Did you set Session.ConfigMode correctly and did you call
Session.SaveConfigFile ?



Quote:
> > As far as I know, the language driver is set for each table, and
> > affects that table only.
> OK
> > In the BDE administrator, you can set the
> > default language driver that will be used when creating a new table,
> OK. I want to set it by code before creating a new table.
> I read that we can do that with :
> Params.Add('LANGDRIVER=xxx');//Params is a StringList.
> Session.ModifyDriver('PARADOX',Params);
> But it don't seem to work.

> Thanks for your help.

> Marc



Tue, 23 Dec 2003 17:37:05 GMT
 LANGDRIVER
I don't call SaveConfigFile because I don't want to modify the default BDE
parameters. I just want to modify the setting for my session.
I try to use Session.ModifyDriver with different setting of ConfigMode
without results.

Actually, the only solution I've found to set my parameters is modifying the
registry directly (but the default BDE parameters are changed).

The settings I want are :
LANGDRIVER=intl850
LOCAL SHARE=true
MAXFILEHANDLES=250
SHAREDMEMSIZE=4096



Quote:
> Did you set Session.ConfigMode correctly and did you call
> Session.SaveConfigFile ?



> > > As far as I know, the language driver is set for each table, and
> > > affects that table only.
> > OK
> > > In the BDE administrator, you can set the
> > > default language driver that will be used when creating a new table,
> > OK. I want to set it by code before creating a new table.
> > I read that we can do that with :
> > Params.Add('LANGDRIVER=xxx');//Params is a StringList.
> > Session.ModifyDriver('PARADOX',Params);
> > But it don't seem to work.

> > Thanks for your help.

> > Marc



Tue, 23 Dec 2003 22:04:52 GMT
 LANGDRIVER
procedure ChangeLangDriver(Table: TTable; sDriver: string);
var
  hDb: hDBIDb;
  TblDesc: CRTblDesc;
  Props: CurProps;
  pFDesc: FLDDesc;

begin
  if not (Table.Active and Table.Exclusive) then
    raise EDatabaseError.Create('Table must be opened
exclusively');
  Check(DbiGetCursorProps(Table.Handle, Props));
  Check(DbiGetObjFromObj(hDBIObj(Table.Handle), objDATABASE,
hDBIObj(hDb)));
  Table.Close;
  FillChar(TblDesc, SizeOf(TblDesc), #0);
  StrPCopy(TblDesc.szTblName, Table.Tablename);
  StrCopy(TblDesc.szTblType, szParadox);
  pFDesc.iOffset := 0;
  pFDesc.iLen := Length(sDriver) + 1;
  StrPCopy(pFDesc.szName, 'LANGDRIVER');
  TblDesc.iOptParams := 1;

  TblDesc.pOptData := PChar(sDriver);
  try

False));
  finally
    Table.Open;
  end;
end;

This procedure will do what you want. You should call it like
this:

  Table1.Exclusive := True;
  Table1.Active := True;
  ChangeLangDriver(Table1, 'intl850');

As you can see, you'll need to create the table first and then
call this procedure.

--
Jovan Sedlan

http://www.sedlan.com
#7 Components Home


Quote:
> I don't call SaveConfigFile because I don't want to modify the
default BDE
> parameters. I just want to modify the setting for my session.
> I try to use Session.ModifyDriver with different setting of
ConfigMode
> without results.

> Actually, the only solution I've found to set my parameters is
modifying the
> registry directly (but the default BDE parameters are changed).

> The settings I want are :
> LANGDRIVER=intl850
> LOCAL SHARE=true
> MAXFILEHANDLES=250
> SHAREDMEMSIZE=4096




> > Did you set Session.ConfigMode correctly and did you call
> > Session.SaveConfigFile ?



> > > > As far as I know, the language driver is set for each
table, and
> > > > affects that table only.
> > > OK
> > > > In the BDE administrator, you can set the
> > > > default language driver that will be used when creating a
new table,
> > > OK. I want to set it by code before creating a new table.
> > > I read that we can do that with :
> > > Params.Add('LANGDRIVER=xxx');//Params is a StringList.
> > > Session.ModifyDriver('PARADOX',Params);
> > > But it don't seem to work.

> > > Thanks for your help.

> > > Marc



Fri, 26 Dec 2003 17:29:42 GMT
 LANGDRIVER
Thanks, it work, but it's not enough :
I create my table at runtime and I need to call your procedure after
Table.CreateTable because your procedure open the table.
I define my Fields with Table.IndexDef.Add before Table.CreateTable.
So my FieldNames are created with the wrong CodePage and characters like
are modified (I'm Frenchy) !

Marc PLEYSIER
Solune Informatique - Service technique



Quote:
> procedure ChangeLangDriver(Table: TTable; sDriver: string);
> var
>   hDb: hDBIDb;
>   TblDesc: CRTblDesc;
>   Props: CurProps;
>   pFDesc: FLDDesc;

> begin
>   if not (Table.Active and Table.Exclusive) then
>     raise EDatabaseError.Create('Table must be opened
> exclusively');
>   Check(DbiGetCursorProps(Table.Handle, Props));
>   Check(DbiGetObjFromObj(hDBIObj(Table.Handle), objDATABASE,
> hDBIObj(hDb)));
>   Table.Close;
>   FillChar(TblDesc, SizeOf(TblDesc), #0);
>   StrPCopy(TblDesc.szTblName, Table.Tablename);
>   StrCopy(TblDesc.szTblType, szParadox);
>   pFDesc.iOffset := 0;
>   pFDesc.iLen := Length(sDriver) + 1;
>   StrPCopy(pFDesc.szName, 'LANGDRIVER');
>   TblDesc.iOptParams := 1;

>   TblDesc.pOptData := PChar(sDriver);
>   try

> False));
>   finally
>     Table.Open;
>   end;
> end;

> This procedure will do what you want. You should call it like
> this:

>   Table1.Exclusive := True;
>   Table1.Active := True;
>   ChangeLangDriver(Table1, 'intl850');

> As you can see, you'll need to create the table first and then
> call this procedure.

> --
> Jovan Sedlan

> http://www.sedlan.com
> #7 Components Home



> > I don't call SaveConfigFile because I don't want to modify the
> default BDE
> > parameters. I just want to modify the setting for my session.
> > I try to use Session.ModifyDriver with different setting of
> ConfigMode
> > without results.

> > Actually, the only solution I've found to set my parameters is
> modifying the
> > registry directly (but the default BDE parameters are changed).

> > The settings I want are :
> > LANGDRIVER=intl850
> > LOCAL SHARE=true
> > MAXFILEHANDLES=250
> > SHAREDMEMSIZE=4096




> > > Did you set Session.ConfigMode correctly and did you call
> > > Session.SaveConfigFile ?



> > > > > As far as I know, the language driver is set for each
> table, and
> > > > > affects that table only.
> > > > OK
> > > > > In the BDE administrator, you can set the
> > > > > default language driver that will be used when creating a
> new table,
> > > > OK. I want to set it by code before creating a new table.
> > > > I read that we can do that with :
> > > > Params.Add('LANGDRIVER=xxx');//Params is a StringList.
> > > > Session.ModifyDriver('PARADOX',Params);
> > > > But it don't seem to work.

> > > > Thanks for your help.

> > > > Marc



Sat, 27 Dec 2003 01:20:59 GMT
 LANGDRIVER
In that case, you should just adjust your previous solution (see
below) to use SaveConfigFile as Mr. Avegaart suggested. Using it,
you will accomplish the same thing as writing to registry
directly. After your tables are created, you can change the
LANGDRIVER to its original value and (again) use SaveConfigFile.

--
Jovan Sedlan

http://www.sedlan.com
#7 Components Home


Quote:
> Thanks, it work, but it's not enough :
> I create my table at runtime and I need to call your procedure
after
> Table.CreateTable because your procedure open the table.
> I define my Fields with Table.IndexDef.Add before
Table.CreateTable.
> So my FieldNames are created with the wrong CodePage and

characters like
Quote:
> are modified (I'm Frenchy) !

> Marc PLEYSIER
> Solune Informatique - Service technique




> > procedure ChangeLangDriver(Table: TTable; sDriver: string);
> > var
> >   hDb: hDBIDb;
> >   TblDesc: CRTblDesc;
> >   Props: CurProps;
> >   pFDesc: FLDDesc;

> > begin
> >   if not (Table.Active and Table.Exclusive) then
> >     raise EDatabaseError.Create('Table must be opened
> > exclusively');
> >   Check(DbiGetCursorProps(Table.Handle, Props));
> >   Check(DbiGetObjFromObj(hDBIObj(Table.Handle), objDATABASE,
> > hDBIObj(hDb)));
> >   Table.Close;
> >   FillChar(TblDesc, SizeOf(TblDesc), #0);
> >   StrPCopy(TblDesc.szTblName, Table.Tablename);
> >   StrCopy(TblDesc.szTblType, szParadox);
> >   pFDesc.iOffset := 0;
> >   pFDesc.iLen := Length(sDriver) + 1;
> >   StrPCopy(pFDesc.szName, 'LANGDRIVER');
> >   TblDesc.iOptParams := 1;

> >   TblDesc.pOptData := PChar(sDriver);
> >   try

> > False));
> >   finally
> >     Table.Open;
> >   end;
> > end;

> > This procedure will do what you want. You should call it like
> > this:

> >   Table1.Exclusive := True;
> >   Table1.Active := True;
> >   ChangeLangDriver(Table1, 'intl850');

> > As you can see, you'll need to create the table first and
then
> > call this procedure.

> > --
> > Jovan Sedlan

> > http://www.sedlan.com
> > #7 Components Home



> > > I don't call SaveConfigFile because I don't want to modify
the
> > default BDE
> > > parameters. I just want to modify the setting for my
session.
> > > I try to use Session.ModifyDriver with different setting of
> > ConfigMode
> > > without results.

> > > Actually, the only solution I've found to set my parameters
is
> > modifying the
> > > registry directly (but the default BDE parameters are
changed).

> > > The settings I want are :
> > > LANGDRIVER=intl850
> > > LOCAL SHARE=true
> > > MAXFILEHANDLES=250
> > > SHAREDMEMSIZE=4096




> > > > Did you set Session.ConfigMode correctly and did you call
> > > > Session.SaveConfigFile ?



> > > > > > As far as I know, the language driver is set for each
> > table, and
> > > > > > affects that table only.
> > > > > OK
> > > > > > In the BDE administrator, you can set the
> > > > > > default language driver that will be used when
creating a
> > new table,
> > > > > OK. I want to set it by code before creating a new
table.
> > > > > I read that we can do that with :
> > > > > Params.Add('LANGDRIVER=xxx');//Params is a StringList.
> > > > > Session.ModifyDriver('PARADOX',Params);
> > > > > But it don't seem to work.

> > > > > Thanks for your help.

> > > > > Marc



Mon, 29 Dec 2003 15:00:01 GMT
 
 [ 8 post ] 

 Relevant Pages 

1. LangDriver Paradox

2. several LANGDRIVER with DBASE

3. Changing Paradox LangDriver in Code

4. BDE LANGDRIVERS

5. HEEEELP : Converting Table to new LangDriver

6. Changing LANGDRIVER at runtime

7. changing LANGDRIVER at runtime

8. Delphi 1: Change langdriver at runtime

9. How can I change LANGDRIVER of table programatically?

10. BDE langdriver

11. Need CYRILLIC langdriver for PDOX 8

12. LangDriver?


 
Powered by phpBB® Forum Software