Page 1 of 1

tablefieldname starts unicode with char.

Posted: Tue 15 Nov 2011 07:22
by Jungwan
Using WIN 7 and Delphi XE2 and MySql Data Access components v. 7.0.2 trial I am unable to insert when tablefieldname starts unicode with char.

Setting debug on shows this

INSERT INTO STEmployee
(EMPSN, USERID)
VALUES
(?, ?)


:EMPSN(Integer,IN)=51
:USERID(WideString[4],IN)='fdfd'

WELL DONE, BUT

INSERT INTO STEmployee
(EMPSN, `성명`)
VALUES
(?, ?)


:EMPSN(Integer,IN)=52
:`성명`(WideString[4],IN)='FDFD' <-- EMyERROR E.CODE = 1064

Error message : Exception class EMyError with message 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 4'.

Do you have any solution for this problem except change all fieldnames to non-unicode char.?

table structure like this.

CREATE TABLE `stemployee` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`EMPSN` int(11) DEFAULT NULL,
`DIVSN` int(11) DEFAULT NULL,
`USERID` varchar(50) DEFAULT NULL,
`USERPASS` varchar(50) DEFAULT NULL,
`성명` varchar(50) DEFAULT NULL,
`이니셜` varchar(10) DEFAULT NULL,
.
.
.
`메모` varchar(255) DEFAULT NULL,
PRIMARY KEY (`ID`)
) ENGINE=MyISAM AUTO_INCREMENT=99 DEFAULT CHARSET=utf8;

Posted: Tue 15 Nov 2011 10:48
by AndreyZ
Hello,

Please check that you set the TMyConnection.Options.UseUnicode property to True. If the problem persists, please specify the exact version of MySQL server you are working with. You can learn it from the Info sheet of TMyConnection Editor.

Posted: Wed 16 Nov 2011 05:52
by Jungwan
AndreyZ wrote:Hello,

Please check that you set the TMyConnection.Options.UseUnicode property to True. If the problem persists, please specify the exact version of MySQL server you are working with. You can learn it from the Info sheet of TMyConnection Editor.
Thanks for helping.

I've already tried this. didn't worked.

I am Using
MySQL server version: 5.1.41-community
MySQL client version: 5.1.41

object MyConnection: TMyConnection
Database = 'brabra'
Options.UseUnicode = True
Options.Charset = 'utf8'
Options.Direct = False
Username = 'brabra'
Password = 'brabra'
Server = '192.168.0.2'
LoginPrompt = False
Left = 32
Top = 16
end

object qrSTEmployee: TMyQuery
Connection = dmDatabase.MyConnection
SQL.Strings = (
'select * from STEmployee'
' where EMPSN = :EMPSN')
Debug = True
CachedUpdates = True
RefreshOptions = [roAfterInsert]
AfterInsert = qrSTEmployeeAfterInsert
AfterPost = qrSTEmployeeAfterPost
AfterCancel = qrSTEmployeeAfterCancel
AfterDelete = qrSTEmployeeAfterDelete
Options.FullRefresh = True
FetchAll = False
Left = 568
Top = 8
.
.

Posted: Wed 16 Nov 2011 10:32
by AndreyZ
I cannot reproduce the problem. Please try creating a small sample to demonstrate the problem and send it to andreyz*devart*com, including a full script to create the stemployee table.

Posted: Thu 17 Nov 2011 02:44
by Jungwan
AndreyZ wrote:I cannot reproduce the problem. Please try creating a small sample to demonstrate the problem and send it to andreyz*devart*com, including a full script to create the stemployee table.
I sent you a sample.
Thank you

Posted: Fri 18 Nov 2011 09:02
by AndreyZ
Unfortunately, your sample is very complicated and I couldn't compile it. I've sent you my test project. Please change it to make it demonstrate the problem and send it back to me.