Page 1 of 1

Problem with MyEmbConnection

Posted: Wed 08 Feb 2012 17:23
by nyebit
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.

Posted: Thu 09 Feb 2012 10:10
by AndreyZ
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.

Posted: Thu 09 Feb 2012 17:48
by nyebit
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.

Posted: Fri 10 Feb 2012 08:00
by AndreyZ
It's good to see that the problem was solved. If any other questions come up, please contact us.