MyQuery.SQL.text property and Chinese characters
MyQuery.SQL.text property and Chinese characters
Hi,
I have a FoxPro table that has a field that may contain Chinese
characters. I'm copying this table to MySQL using the MyDAC
components (specifically, TMyQuery).
I create a SQL string from the fields and field values of each row in
the FoxPro table and then run MyQuery.ExecSQL;.
For some reasons, it gives me a syntax error near an empty field.
I don't understand this, but realized that the field with the Chinese
characters is next to it. Unfortunately, I'm not clear as to what
format the Chinese characters is stored as.
Does MyQuery.SQL.text support Chinese characters?
Here's the actual SQL text:
insert into article (article,artno,rid,jtype,stype,design,mould,batch,unit,photoid,acctno,price,ucost,mcost,lcost,addcost,desc1,desc2,premark,ldate,user,photo,qmethod,req1,req2,req3,req4,pdesc1,pdesc2,pastdata,sphoto,txmattno,txdate,othref1,mk,uprice_hk,uprice_us,ovdate,kingsing,bom,hqty,uqty,cqty,stonewt,size,ws,factor,artno2,whs,remark,sent,`group`,artset,arttype,artproj,artss,artsp,artclf,tz,ct,ph_height,ph_width,pict_height,pict_width,product,factor2) VALUES ("006723","PSX","","PP","Z","03740","S","0007","PC","","",0,0,0,0,0,"DX","","",'2006/9/15',"Y321","PPZ03740S","","","","","","鑽石寶蓋","","","PPZ","",'1899/12/30',"","",0,0,'1899/12/30',"","",0,0,0,"","","",0,"","","",0,"","","","","","","","","",0,0,0,0,0,0)
And the error is :
#42000You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'PPZ","",'1899/12/30',"","",0,,'1899/12/30',"","",0,0,0,"","","",0,"","","" at line 1'.
Using MyDAC v6.00.0.3, and MySQL Dev tools 4.50.308.0.
Edmund
I have a FoxPro table that has a field that may contain Chinese
characters. I'm copying this table to MySQL using the MyDAC
components (specifically, TMyQuery).
I create a SQL string from the fields and field values of each row in
the FoxPro table and then run MyQuery.ExecSQL;.
For some reasons, it gives me a syntax error near an empty field.
I don't understand this, but realized that the field with the Chinese
characters is next to it. Unfortunately, I'm not clear as to what
format the Chinese characters is stored as.
Does MyQuery.SQL.text support Chinese characters?
Here's the actual SQL text:
insert into article (article,artno,rid,jtype,stype,design,mould,batch,unit,photoid,acctno,price,ucost,mcost,lcost,addcost,desc1,desc2,premark,ldate,user,photo,qmethod,req1,req2,req3,req4,pdesc1,pdesc2,pastdata,sphoto,txmattno,txdate,othref1,mk,uprice_hk,uprice_us,ovdate,kingsing,bom,hqty,uqty,cqty,stonewt,size,ws,factor,artno2,whs,remark,sent,`group`,artset,arttype,artproj,artss,artsp,artclf,tz,ct,ph_height,ph_width,pict_height,pict_width,product,factor2) VALUES ("006723","PSX","","PP","Z","03740","S","0007","PC","","",0,0,0,0,0,"DX","","",'2006/9/15',"Y321","PPZ03740S","","","","","","鑽石寶蓋","","","PPZ","",'1899/12/30',"","",0,0,'1899/12/30',"","",0,0,0,"","","",0,"","","",0,"","","","","","","","","",0,0,0,0,0,0)
And the error is :
#42000You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'PPZ","",'1899/12/30',"","",0,,'1899/12/30',"","",0,0,0,"","","",0,"","","" at line 1'.
Using MyDAC v6.00.0.3, and MySQL Dev tools 4.50.308.0.
Edmund
Looking through the log that I dumped for every sql command, it seems
it isn't the Chinese characters that's screwing up the command. Previous
entries also have Chinese characters so it's something with the makeup
of that particular line. If it was the first entry, sure it could be; but it's
the 10150'th entry.
If anyone can spot the error, I'd appreciate it.
Edmund
it isn't the Chinese characters that's screwing up the command. Previous
entries also have Chinese characters so it's something with the makeup
of that particular line. If it was the first entry, sure it could be; but it's
the 10150'th entry.
If anyone can spot the error, I'd appreciate it.
Edmund
Sorry for talking to myself; but I've done some tests and noticed that
if the sqlstring has this character ('蓋') in it, it chokes. If I remove that
character from the sql string, the insert sql command works.
Unfortunately, I can't do that since it's part of data that needs to
be preserved. Can someone point out how I can preserve this
character, but still have the insert command work?
Thanks
Edmund
if the sqlstring has this character ('蓋') in it, it chokes. If I remove that
character from the sql string, the insert sql command works.
Unfortunately, I can't do that since it's part of data that needs to
be preserved. Can someone point out how I can preserve this
character, but still have the insert command work?
Thanks
Edmund
-
AndreyZ