Page 1 of 1

About unicode char fieldname and values

Posted: Sat 12 Sep 2009 04:47
by vga
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 "" -> "?"

Posted: Mon 14 Sep 2009 07:02
by Dimon
Please specify the exact version of your IDE.

Posted: Tue 15 Sep 2009 04:29
by vga
Dimon wrote:Please specify the exact version of your IDE.
delphi 2010
mydac 5.90.051

Posted: Tue 15 Sep 2009 14:17
by Dimon
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.

Posted: Wed 16 Sep 2009 03:32
by vga
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.