encodingvb6odbcparadox

How to decode a string in Visual Basic 6


I'm trying to read .DB (Paradox 5) file within my Visual Basic 6. Everything's OK except encoding/charset. It shows as Iieiei 75a instead of cyrillic string.

This is my ODBC Connection string:

Driver={Microsoft Paradox Driver (*.db )};DriverID=538;Fil=Paradox 4.X;DataCodePage=ANSI;BDE=2;CollatingSequence=ASCII;AutoTranslate=No;DBQ=C:\Database;DefaultDir=C:\Database

Please note that software like Borland Database Desktop shows this strings without any problems. Also everything is fine in another PC.

I set following settings via regedit, by it doesn't help:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4.0\Engines\Xbase] 
"DataCodePage"="ANSI" 
"BDE"=dword:00000002 

I also tried to use CharToOem/Oem2Char Win API functions, it doesn't help.

Any ideas?


Solution

  • Okay I have solved this by changing following registry values:

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4.0\Engines\Xbase] 
    "DataCodePage"="ANSI" 
    "BDE"=dword:00000002 
    
    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\CodePage]
    "1252"="1251.nls"
    

    Last setting has solved the issue.