Codepage to import dbf files
English/Dutch speaking people should be happy that they do not need to know about codepage. But we, Russian programmers, very good know what it means. The problem that there is one kind of codepage in MS-DOS, and different - in Windows. You can write text file in notepad, and then your can’t read it in MS-DOS – Russian characters have different ascii codes.
DBF files were originally encoded in OEM (MS-DOS), but now can be also encoded in ANSI (Windows), so when you read dbf file from Access (import or link) you have to use proper code page. The only way (as I know) to change it - is to set registry key DataCodePage:
Access 2000-2003 (Jet 4):
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4.0\Engines\Xbase]
Access 2007:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\12.0\Access Connectivity
Engine\Engines\Xbase]
Possible values can be ANSI or OEM.
Of course, you need to have enough permissions to do so, plus keep in mind that you also change it for other users logged to this PC. And you have to restart Access in order new option take place. VB 6 help states that there is an option to set code page to local user, but I have not succeeded with it...
14 Comments:
This works also for german language.
thank you very much!!!
Alex you saved my life !
It works in French too :-)
thank u very much, I'm have met the same problem with Vietnamese. thanks to your post, i have just recovered it.
Thanks! Worked for me in Spanish
thank you, thank you, works like a charm
Alex, your solution does not work for me. But I can in BDEADMIN.EXE set the right code page.
Alex, I cannot get his to work. I am importing a dbf file from Russia, and I get strange charaters. Œ®áª¢ instead of Москва
I have changed the registry but no change.
Hi,
normally dbf in Russia encoded in OEM. Perhaps you need to change: Control panel-Regional and Language options-Advanced and set "Select a language to match the language version of the non-Unicode program you want to use" to Russian.
If you like - you can send me this file, and i will check what encoding there
Eres un maquinón, nos has solucionado la vida , colmenero. Gracias por ty ayuda
Thank you. Merci beaucoup. Gratias amigo.
Worked perfectly!
New functions are accessible. There are configurations you can make as well.
By the way, the keyname in Windows 7 with MS Office 2010 is:
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Office\14.0\Access Connectivity Engine\Engines\Xbase]
Since your post helped me in the past, perhaps I can return the favour to you and your readers now.
Thank you! For the lazy, this is the command-line to copy/paste for Access 2003:
REG add HKLM\SOFTWARE\Microsoft\Jet\4.0\Engines\Xbase /v DataCodePage /t REG_SZ /d ANSI /f
or to switch back:
REG add HKLM\SOFTWARE\Microsoft\Jet\4.0\Engines\Xbase /v DataCodePage /t REG_SZ /d OEM /f
Access needs to be restarted (or maybe just the DB closed and re-opened?)
I have used this post many times - it is great!
Post a Comment
<< Home