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;
tablefieldname starts unicode with char.
-
AndreyZ
Thanks for helping.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.
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
.
.
-
AndreyZ
-
AndreyZ