Problem with MyEmbConnection

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
nyebit
Posts: 2
Joined: Wed 08 Feb 2012 12:30
Location: Catalunya

Problem with MyEmbConnection

Post by nyebit » Wed 08 Feb 2012 17:23

I'm using MySQL acces components in direct mode, so I don't know how has 'MyEmbConnection' appeared in clausule 'uses' of my Datamodule file.

Well, there is no problem unless you try to run this application on a computer where MySQL is not installed, then program fails and you get this error message: "Can't connect to MySQL server on 'localhost' (10061) Socket error on connect. WSAGetLastError return 10061($274D)" and program brokes.

I've solved this problem simple by deleting 'MyEmbConnection' in 'uses' but I'd like notify it to you for it seems a bit extrange, even when TMyConnection.Server is blank, TMyConnection.Option.Direct=True and TMyConnection.Options.Embedded=False, and it isn't trying to connect to a server yet.

Thanks.

AndreyZ

Post by AndreyZ » Thu 09 Feb 2012 10:10

The MyEmbConnection unit is added automatically to the USES clause only if there is the TMyEmbConnection component on the form. The MyEmbConnection component doesn't influence on work of the TMyConnection component. The "Can't connect to MySQL server on 'localhost'" error means that you are trying to connect to a local MySQL server that doesn't exist. If you leave the TMyConnection.Server property blank, TMyConnection uses the localhost as a server to connect to. To solve the problem, you should set TMyConnection.Server to a valid server name or IP address.

nyebit
Posts: 2
Joined: Wed 08 Feb 2012 12:30
Location: Catalunya

Post by nyebit » Thu 09 Feb 2012 17:48

Right, my problem was that I had set TMyConnection.Server property to blank and TMyConnection.connected to True.

I'm sorry and thank you very much.

AndreyZ

Post by AndreyZ » Fri 10 Feb 2012 08:00

It's good to see that the problem was solved. If any other questions come up, please contact us.

Post Reply