Page 1 of 1

Embedded Server and default collation_connection problem

Posted: Mon 21 Mar 2005 17:23
by nicenk
Hi

I am using
-MyDAC 3.50.0.16
-MySQL 4.1.7-pro
-Embedded libmysqld.dll

I have set up a database in the client/server mode working fine. The default character set for the db is Greek, and all the tables are created with collation greek_general_ci;

I am trying to switch over to a standalone application, utilizing the same database. Used the embedded option in TMyConnection. After I succesfully connect, i try to run a simple query.
'SELECT iProfileID
FROM profiles
WHERE strProfile = :strProfile'

The error I get is "Illegal mix of collations (greek_general_ci,IMPLICIT) and (latin_swedish_ci,COERCIBLE) for operation '='" and i suspect this comes from the parameter. The parameter gets a correct value before i run the query.

Also if I evalute the TMyConnection.charset i get 'latin_swedish_ci'.

Any ideas how I can fix this problem?

Thank you in advance,
nicenk

Posted: Tue 22 Mar 2005 11:49
by Ikar
At once after establishing a connection execute "SET NAMES ..." query.
For details please see MySQL Reference Manual. You can get the same result if to modify server settings (my.ini).

Did not work

Posted: Tue 22 Mar 2005 12:56
by nicenk
I've tried the following:

DBMySQLConnection.Database := 'moneymgr';
DBMySQLConnection.Username := strUserName;
DBMySQLConnection.Password := strPassword;
DBMySQLconnection.Open;
DBMySQLconnection.ExecSQL('set names greek;',[]);

then after I execute the query the system posts the same error. Also I've tried with

DBMySQLConnection.Database := 'moneymgr';
DBMySQLConnection.Username := strUserName;
DBMySQLConnection.Password := strPassword;
DBMySQLconnection.Open;
MyCommand := TMyCommand.Create(self);
MyCommand.SQL.Add('set names greek;');
MyCommand.Connection := DBMySQLconnection;
MyCommand.Execute;

and I get the same error.

Nicenk

Posted: Fri 25 Mar 2005 16:18
by Ikar
So these queries are executed at MySQL server not at Embedded server, aren't they? Is libmysqld the same version that your server?

Try to perform SHOW VARIABLES for both servers and send a result to mydac support
address.