Connect to a MySQL Embedded Server using TMyConnection

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
eduardosic
Posts: 387
Joined: Fri 18 Nov 2005 00:26
Location: Brazil

Connect to a MySQL Embedded Server using TMyConnection

Post by eduardosic » Wed 05 Nov 2008 19:39

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

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Thu 06 Nov 2008 12:11

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.

eduardosic
Posts: 387
Joined: Fri 18 Nov 2005 00:26
Location: Brazil

Post by eduardosic » Thu 06 Nov 2008 12:24

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?

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Fri 07 Nov 2008 14:03

It is peculiarity of MySQL Embedded server work. It finds a configuration file only in its own list specified directories.

eduardosic
Posts: 387
Joined: Fri 18 Nov 2005 00:26
Location: Brazil

Post by eduardosic » Fri 07 Nov 2008 14:20

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

Post Reply