Cannot open embedded Database in folder with UNICODE path

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
rahucha
Posts: 24
Joined: Tue 18 Nov 2014 09:52

Cannot open embedded Database in folder with UNICODE path

Post by rahucha » Mon 20 Nov 2017 10:00

Hi,

I'm using the following code to open my embedded database with Delphi XE 10.1 and MyDac (9.1.3):

Code: Select all

var
    FDatabaseEmbedded: TMyEmbConnection;

begin
    FDatabaseEmbedded := TMyEmbConnection.Create(Sender);
    FDatabaseEmbedded.LoginPrompt := False;
    FDatabaseEmbedded.Options.UseUnicode := True;
    FDatabaseEmbedded.DataDir := localDatabasePath;
    FDatabaseEmbedded.Database := 'Database';
    FDatabaseEmbedded.Connected := True;
I have my application and the database in the same folder. The code works great when the folder is an ANSI folder. As soon as I rename the folder with UNICODE chars (Chinese for example) in any part of the path, I get an exception on the "FDatabaseEmbedded.Connected := True" line.

Code: Select all

---------------------------
Debugger Exception Notification
---------------------------
Project Project1.exe raised exception class Exception with message ''.
---------------------------
Break   Continue   Help   
---------------------------
Please, can you let me know what's wrong?

Thanks!

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Cannot open embedded Database in folder with UNICODE path

Post by ViktorV » Mon 20 Nov 2017 13:59

The issue when the the embedded database foldername contains international characters is not related to MyDAC, but is due to the MySQL client library specificities. Unfortunately, we can't affect this behavior.

Post Reply