Cyrillic Problem

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
dsedov
Posts: 1
Joined: Sat 08 Jul 2006 17:21

Cyrillic Problem

Post by dsedov » Sat 08 Jul 2006 17:25

If I type in all the fields in English then everything works, however, if I type in fields with cyrillic symbols I get an error: ... raised exception class EMySqlException with message ' #33001 Data too long for column 'first_name' at row 1'

Here is my code:

SqlQuery->SQL->Clear();
SqlQuery->SQL->Add("INSERT INTO users (id, first_name, last_name, email, phone, type, login, password) VALUES (NULL, '"
+ pFirstName->Text +"', '"
+ pLastName->Text +"', '"
+ pEmail->Text +"', '"
+ pPhoneNumber->Text +"', '"
+ pType->Text +"', '"
+ pLogin->Text +"', '"
+ pPassword->Text +"')");
SqlQuery->Execute();

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Mon 10 Jul 2006 11:37

Please check if Charset option of MyConnection is set to cp1251. Remember that you have to set corresponding character set to the server objects (tables, databases) too.

Post Reply