Page 1 of 1

Connect to a MySQL Embedded Server using TMyConnection

Posted: Wed 05 Nov 2008 19:39
by eduardosic
Hi Devart.

i need to connect a MySQL Embedded Server with TMyConnection. I set

Code: Select all

    with MyConn_drd do begin
     Embedded := True;
     Options.Embedded := True;
     Server           := '';
     Database         := 'democivil';
     UserName         := '';
     Password         := '';
     Port             := 3306;
     Connect;
    end;
My Application test is located in C:\MyApp
in C:\MyApp a have :
C:\MyApp\data
C:\MyApp\share\english

but the program find for the mysql files files in C:\

i try to use a my.ini in apptest folder, but don't work

[Server]
basedir=C:/MyApp/data
datadir=C:/MyApp/

Using TMyEmbConnection work's fine.. but i can't use it.. i need to uso TMyConnection

but don't work.. you can help-me

you can download a demo in http://www.drdsistemas.com.br/util/MyEm ... devart.zip

i test with MyDAC 5.55.0.39 - Delphi 2007 and
MyDAC 5.70.0.41 - Delphi 2009 some problem.

thank's

Posted: Thu 06 Nov 2008 12:11
by Dimon
If you are using TMyConnection to connect to Embedded server, you can not specify the connection parameters. For this you should use the TMyEmbConnection component.
To specify parameters in the my.ini configuration file this file must be placed in the {Windows} directory.

Posted: Thu 06 Nov 2008 12:24
by eduardosic
Dimon wrote:If you are using TMyConnection to connect to Embedded server, you can not specify the connection parameters. For this you should use the TMyEmbConnection component.
To specify parameters in the my.ini configuration file this file must be placed in the {Windows} directory.

Hi Dimon, i put the my.ini file in Windows directory and tmyconnection work's fine with EmbServer..

what file my.ini can't be in application directory?

Posted: Fri 07 Nov 2008 14:03
by Dimon
It is peculiarity of MySQL Embedded server work. It finds a configuration file only in its own list specified directories.

Posted: Fri 07 Nov 2008 14:20
by eduardosic
Dimon wrote:It is peculiarity of MySQL Embedded server work. It finds a configuration file only in its own list specified directories.
ok Dimon, problem solved, thank's for support
:D