AccessBlog.net

News, links, downloads, tips and tricks on Microsoft Access and related

About Me Search
Alex
Name:Alex Dybenko

Location:Moscow, Russia

Wednesday, August 20, 2008

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...

Labels: , ,

14 Comments:

Anonymous Anonymous said...

This works also for german language.

thank you very much!!!

3:07 PM  
Anonymous Anonymous said...

Alex you saved my life !
It works in French too :-)

6:31 PM  
Blogger Anh Sao Bang said...

thank u very much, I'm have met the same problem with Vietnamese. thanks to your post, i have just recovered it.

6:34 AM  
Blogger Ramiro said...

Thanks! Worked for me in Spanish

10:30 PM  
Anonymous Anonymous said...

thank you, thank you, works like a charm

8:16 PM  
Anonymous Anonymous said...

Alex, your solution does not work for me. But I can in BDEADMIN.EXE set the right code page.

11:54 AM  
Blogger AAD said...

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.

12:33 AM  
Blogger Alex Dybenko said...

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

9:25 AM  
Anonymous Anonymous said...

Eres un maquinón, nos has solucionado la vida , colmenero. Gracias por ty ayuda

8:23 PM  
Anonymous Anonymous said...

Thank you. Merci beaucoup. Gratias amigo.

Worked perfectly!

2:07 AM  
Anonymous keypads said...

New functions are accessible. There are configurations you can make as well.

6:56 AM  
Anonymous Anonymous said...

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.

9:12 PM  
Anonymous Rduke15 said...

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?)

3:38 PM  
Blogger Unknown said...

I have used this post many times - it is great!

6:43 PM  

Post a Comment

<< Home