We help IT Professionals succeed at work.

How to change a locale of a DBase table?

ivobauer
ivobauer asked
on
Hi all!

My friend has a plenty of old DBase tables (*.dbf) encoded with Czech CP852 code page (MS-DOS). When opening table in Delphi through built/in bde components he gets a mixture of weird characters. How does he force bde to open those tables using a the above mentioned locale?

Thanks in advance, Ivo.
Comment
Watch Question

Commented:
You need to change LANGDRIVER parameter on the System\Init page in BDE Administrator.
HTH
TOndrej
CERTIFIED EXPERT

Commented:
Hi,
With BDE Administrator create a new alias using Microsoft DBase Driver. Then for LANGDRIVER property select dBASE CSY cp852. Use that alias when opening your files.

Regards, Geo

Author

Commented:
BDE Admin wants a login & password for me but I didn't remember to specify either.

Ivo

Author

Commented:
Also when attempting to set table name within delphi IDE it prompts me for a login and password. But I didn't specified any of them. Any ideas?

Commented:
I think it's just because TDatabase.LoginPrompt is set to True by default.

You can ignore it, for .dbf login makes no sense. Or set LoginPrompt to False.

Author

Commented:
I'll test it and give you feedback in a hour or two.

Author

Commented:
Nope, it doesn't work at all. I add my new alias in BDE Admin (Microsoft dBase driver). When I put the TDatabase component on the form, set the alias to my new one, set loginprompt to false and attempt to connect it (at design time), I get an exception saying something about that operation is not supported...

Commented:
I was talking about BDE STANDARD driver, not MS ODBC driver.

MS ODBC driver can probably be set up in Control Panel/ODBC...

Author

Commented:
> I was talking about BDE STANDARD driver, not MS ODBC driver.

There is no LANGDRIVER parameter when alias is of STANDARD type.

> With BDE Administrator create a new alias using Microsoft DBase Driver. Then for LANGDRIVER property
select dBASE CSY cp852. Use that alias when opening your files.

When I leave the TDatabase.LoginPrompt on True, ide wants a password for me (ok), but when I set it to False, no password dialog is shown (ok) but entire delphi freezes (sql moouse cursor).

Any ideas?
CERTIFIED EXPERT

Commented:
Hi,

You can use native drivers. In this case start BDE Administrator, select 'Configuration' tab, then Drivers- Native- DBASE and you will see 'LANGDRIVER' field.

Regards, Geo
Commented:
> There is no LANGDRIVER parameter when alias is of
> STANDARD type

I was talking about global BDE setting, not alias specific setting.

Configuration tab
Configuration\Drivers\Native\DBASE

LANGDRIVER is one of the settings.

Using BDE version 5.2.0.2.

The same should be possible with TSession.ModifyDriver, according to the help.

Author

Commented:
I'll take a closer look at your propositions and let you know...

Author

Commented:
Well, it works okay! Thanks to both of you for your time spent on this q.

Best regards, Ivo.

Author

Commented:
Please take a look at this question http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=delphi&qid=20228067

Thanks a lot, Ivo.
CERTIFIED EXPERT

Commented:
As I see the accepted answer is equal to my comment just above it. Correct me if I'm wrong, please.

Regards, Geo

Author

Commented:
I see that you should have been graded too. Please apologize me for this. I'll give you a compensation, just reply to the question "Points for geobul".

Best regards, Ivo.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.