TMyConnection and property Params

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
joelthomas
Posts: 2
Joined: Wed 12 Jun 2013 14:21

TMyConnection and property Params

Post by joelthomas » Wed 12 Jun 2013 14:30

Hi

Is it possible to change the default file path for the my.ini file.
By default, this file is stored in the windows directory. Is it possible to store my.ini file in an other folder (none admin profile user are not allowed to write in the windows directory)

Context :
Delphi 7
MyDac : 7.0.2
embedded mode
Component : TMyConnection

Thanks

Joel

DemetrionQ
Devart Team
Posts: 271
Joined: Wed 23 Jan 2013 11:21

Re: TMyConnection and property Params

Post by DemetrionQ » Wed 12 Jun 2013 16:41

Hello.

MyDAC uses the libmysqld.dll library to connect to the MySQL embedded server. The library searches the my.ini file in the "C:\" and "C:\WINDOWS" directories (there are also other search paths depending on the libmysql.dll version). To solve the problem, you can use TMyEmbConnection instead of TMyConnection. TMyEmbConnection allows you to work without the my.ini file, providing access to the MySQL embedded server settings by the TMyEmbConnection.Params, TMyEmbConnection.BaseDir and TMyEmbConnection.DataDir properties. You can find detailed information about TMyEmbConnection and its properties in the MyDAC documentation.

joelthomas
Posts: 2
Joined: Wed 12 Jun 2013 14:21

Re: TMyConnection and property Params

Post by joelthomas » Mon 17 Jun 2013 13:51

Hi,

Thanks for your answer.
Our internal framework is based on the TMyConnection component and it takes a lot of time to change it.
is there any other solution with a TMyConnection component ? I just need to transfer to the mysql dll, the path to store the my.ini file.

Thanks

Joel

DemetrionQ
Devart Team
Posts: 271
Joined: Wed 23 Jan 2013 11:21

Re: TMyConnection and property Params

Post by DemetrionQ » Thu 20 Jun 2013 12:49

Hello.

    The TMyConnection component doesn't provide a possibility to modify Embedded connection parameters. For this, you should use TMyEmbConnection. To change this behaviour, you can buy MyDAC with source code and add the possibility to set parameters via TMyConnection by yourself.

Post Reply