Page 1 of 1

Mysql embedded

Posted: 16.01.2007, 12:59
by dip56245
Please advice
How to set the codepade cp1251 while connect libmysqld50.dll?
I've tried --with-charset, --default-character-set and others: after .Connect() i receive the error message or the application crashes.

Posted: 18.01.2007, 21:22
by zippo
Try to set it when the connection is started. I do this in the OnConnect event

query1.sql.text = 'SET NAMES cp1251'
query1.execsql;

But include a try-except for non MySQL 5 servers (ex. 3.23.50)

Posted: 20.01.2007, 12:49
by dip56245
zippo wrote:Try to set it when the connection is started. I do this in the OnConnect event

query1.sql.text = 'SET NAMES cp1251'
query1.execsql;

But include a try-except for non MySQL 5 servers (ex. 3.23.50)
now work on 4.1 embedded.
But i use utf8, (cp1251 not work - type "charset not found", in charset's dir cp1251.xml exist). Now problem when i do select * from test where name like 'russian text%' - some time result wrong, and order by work not correct. 8(

Posted: 20.01.2007, 13:44
by zippo
Try win1251 instead of cp1251