About unicode char fieldname and values

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

About unicode char fieldname and values

Post by vga » Sat 12 Sep 2009 04:47

my code:
procedure TForm1.Button2Click(Sender: TObject);
begin
MyQuery1.Close;

MyQuery1.SQL.Text :=
'drop table if exists `test`;' +
'CREATE TABLE `test` (' +
'`ID` int(11) unsigned NOT NULL AUTO_INCREMENT,' +
'`錦` char(50) DEFAULT NULL,' +
'PRIMARY KEY (`ID`),' +
'UNIQUE KEY `ID` (`ID`)' +
') ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=gbk;' +
'insert into `test` (`錦`) values (''錦'')';
MyQuery1.Execute;

MyQuery1.SQL.Text := 'select * from `test`';
MyQuery1.Open;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
if MyQuery1.Active then
MyQuery1.Refresh
else
MyQuery1.Open;
end;


when cinnection option use unicode is true , fields valus char "" -> "?"

when cinnection option use unicode is false, field name char "" -> "?"

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Mon 14 Sep 2009 07:02

Please specify the exact version of your IDE.

vga
Posts: 58
Joined: Sat 08 Jul 2006 12:04

Post by vga » Tue 15 Sep 2009 04:29

Dimon wrote:Please specify the exact version of your IDE.
delphi 2010
mydac 5.90.051

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Tue 15 Sep 2009 14:17

This problem is connected with the specificity of MySQL server, but not with MyDAC.
It seems that MySQL doesn't allow to create fields with such symbol.

vga
Posts: 58
Joined: Sat 08 Jul 2006 12:04

Post by vga » Wed 16 Sep 2009 03:32

Dimon wrote:This problem is connected with the specificity of MySQL server, but not with MyDAC.
It seems that MySQL doesn't allow to create fields with such symbol.

thanks.

Post Reply