Description:
I have a problem when using MyODBC (both 2.50.39 and 3.51) with a connection string and MySQL 4.1 (running on a Win2k).
The database is created with the cp1256 character set, system is running latin1.
case 1) use DSN-less connection string
conn.open("Driver={MySQL};Server=10.0.0.111;DATABASE=ar;UID=user;PWD=123;STMT=set names cp1256")
Connection opens fine but it seems like the "set names cp1256" statement hasn't been done. Because when I run a "show variables like
'char%'" it says latin1 the places where it should say cp1256... Also when I perform a select query with a where clause I receive the
following error message:
[mysqld-4.1.1a-alpha-nt-log]Illegal mix of collations (cp1256_general_ci,IMPLICIT) and (latin1_swedish_ci,COERCIBLE) for operation
'='
If I execute the "set names cp1256" on the connection after opening it, the program works fine... But I need this to be embedded in
the connection string.
case 2) use a DSN connection
conn.open "DSN=ar;UID=user;PWD=123" ' DNS contains sql command on connect = set names cp1256;
This works perfectly. But I need it to work with a DSN-less connection (case 1).
Is there anything I'm doing wrong?
How to repeat:
"set names cp1256" on the connection after opening it, the program works fine... But I need this to be embedded in
the connection string.
case 2) use a DSN connection
conn.open "DSN=ar;UID=user;PWD=123" ' DNS contains sql command on connect = set names cp1256;