Page 1 of 1

MS SQL + Delphi not the correct codepage

Posted: 23.08.2011, 14:31
by mikola123
Dear sirs,
I'm using MS SQL with Cyrillic_General (cp1251) encoding and Delphi. When I'm going to select data, everything works fine, but the update results in writing badly encoded characters in DB. I'm already tried to use codepage=win, codepage=win1251, codepage=cp1251 (and tried the same with codepage_client). Trace shows that query arrives to the DB with already broken chars.

Example query on trace:

update tblEmployee set first_name='Николай' where empl_id=2

Posted: 23.08.2011, 16:02
by mikola123
found here
module ZDbcDbLibStatement, line 213

if FPlainDriver.dbcmd (FHandle, PAnsiChar (UTF8Encode (SQL))) <> DBSUCCEED then

Posted: 23.08.2011, 16:19
by mikola123
I decided to do so
if FPlainDriver.dbcmd (FHandle, PAnsiChar (AnsiString (SQL))) <> DBSUCCEED then

It Works!