Lazarus ODBC DBF setting is changed by BDE lazarus / 16-Databases ---------------------------------------------------------------------- jixian.yang · 2011-02-06 15:46 There was a example source code to connect DBF file with TODBCConnection on XP and it worked fine. But one day, when I clicked the EXE file to run it, characters changed to be irrecognizable. Tested the program on other PC it worked fine. So I check the PC in regstration table and recall what the difference. Delphi BDE was installed by a free software from internet one day. So I disable the register key "Database Engine" and run the test program again, the characers get right. And the register key "Database Engine" appeared again. Does TODBCConnection use the register key "Database Engine"? ---------------------------------------------------------------------- jixian.yang · 2011-02-06 15:49 The full path is HKEY_LOCAL_MACHINE\SOFTWARE\Borland\Database Engine ---------------------------------------------------------------------- Lacak2 · 2011-02-07 08:06 No TODBCCOnnection does not use registry key "Database Engine" and TODBCConnection has no relation to Borland BDE. ---------------------------------------------------------------------- jixian.yang · 2011-02-07 14:30 I believe so too. But unfortunetely the registry key has been found on the other PC without BDE installed. The exe file was build several month ago, only the registry key changed the characters. ---------------------------------------------------------------------- xenblaise · 2011-02-07 19:44 QuoteThere was a example source code to connect DBF file with TODBCConnection on XP and it worked fine. But one day, when I clicked the EXE file to run it, characters changed to be irrecognizable. Tested the program on other PC it worked fine. So I check the PC in regstration table and recall what the difference. Delphi BDE was installed by a free software from internet one day. So I disable the register key "Database Engine" and run the test program again, the characers get right. And the register key "Database Engine" appeared again. I've encountered this one, but really did not figure it out, why it happens. Listening... ---------------------------------------------------------------------- Lacak2 · 2011-02-08 06:05 If so, then I guess, that BDE must somehow affect behavior of ODBC. May that replaces some DLLs or hooks into ODBC operations ... ---------------------------------------------------------------------- jixian.yang · 2011-02-09 02:05 Quote from: Lacak2 on February 08, 2011, 07:05:26 amIf so, then I guess, that BDE must somehow affect behavior of ODBC. May that replaces some DLLs or hooks into ODBC operations ... It seems that ODBC hooked by BDE. The registry key never reappeared on the PC whithout BDE installed. If BDE has been installed, the registry key can reappear automatically after it is deleted and the test program run. But it is not a solution to delete the BDE registry key to make the characters right. BTW, there is no effect on MS Access(*.mdb) setting. ---------------------------------------------------------------------- Lacak2 · 2011-02-09 06:23 So characters are displayed wrong in DB-aware controls ? (DBGrid, DBEdit) What is encoding of DBF files ? When you open DBF table and then try for example UTF8Encode(Fields[0].AsString) ? Which ODBC driver do you use ? (Visual FoxPro Tables?) Have you set collating in Driver/DSN properties? ---------------------------------------------------------------------- jixian.yang · 2011-02-09 15:29 It is wrong in any contols. And there is UTF8Encode with the patch http://bugs.freepascal.org/view.php?id=17376. Driver is Microsoft dBase Driver (*.dbf). The sub registry key is "HKEY_LOCAL_MACHINE\SOFTWARE\Borland\Database Engine\CONFIGFILE01" Disable the key, the characters are right and the key reappear but the content is different. After that there is no problem on the characters again. The DSN properties need not be set. Just set driver and params.Add('DBQ=path');