Mydac Embeded example does not work when charset set to gbk
Mydac Embeded example does not work when charset set to gbk
I run the mydac embeded example, when charset set to nothing and unicode to false, it work fine, but my data is utf8 charset, so, i try to change the charset and unicode value, then it does not work!
why?
why?
The thing is that Unicode is supported by MySQL Embedded server version 5.0 and higher (e.g. 5.1.22-rc).
In order to use the UTF8 characters in tables you should specify the corresponding parameter on creating table, like this:
In order to use the UTF8 characters in tables you should specify the corresponding parameter on creating table, like this:
Code: Select all
CREATE TABLE TableName (
Id INT PRIMARY KEY,
...
) CHARACTER SET utf8 COLLATE utf8_bin;I change the script:
CREATE TABLE EMP (
EMPNO INT PRIMARY KEY,
ENAME VARCHAR(10),
JOB VARCHAR(9),
MGR INT,
HIREDATE DATETIME,
SAL FLOAT,
COMM FLOAT,
DEPTNO INT REFERENCES DEPT
) CHARACTER SET utf8 COLLATE utf8_bin;
INSERT INTO EMP VALUES
(7369,'SMITH','CLERK',7902,'1980-12-17',800,NULL,20);
INSERT INTO EMP VALUES
(7499,'ALLEN','SALESMAN',7698,'1981-2-20',1600,300,30);
INSERT INTO EMP VALUES
(7521,'WARD','SALESMAN',7698,'1981-2-22',1250,500,30);
INSERT INTO EMP VALUES
(7566,'JONES','MANAGER',7839,'1981-4-2',2975,NULL,20);
INSERT INTO EMP VALUES
(7654,'MARTIN','SALESMAN',7698,'1981-9-28',1250,1400,30);
INSERT INTO EMP VALUES
(7698,'BLAKE','MANAGER',7839,'1981-5-1',2850,NULL,30);
INSERT INTO EMP VALUES
(7782,'CLARK','MANAGER',7839,'1981-6-9',2450,NULL,10);
INSERT INTO EMP VALUES
(7788,'SCOTT','ANALYST',7566,'1987-7-13',3000,NULL,20);
INSERT INTO EMP VALUES
(7839,'KING','PRESIDENT',NULL,'1981-11-17',5000,NULL,10);
INSERT INTO EMP VALUES
(7844,'TURNER','SALESMAN',7698,'1981-9-8',1500,0,30);
INSERT INTO EMP VALUES
(7876,'ADAMS','CLERK',7788,'1987-7-13',1100,NULL,20);
INSERT INTO EMP VALUES
(7900,'JAMES','CLERK',7698,'1981-12-3',950,NULL,30);
INSERT INTO EMP VALUES
(7902,'FORD','ANALYST',7566,'1981-12-3',3000,NULL,20);
INSERT INTO EMP VALUES
(7934,'MILLER','CLERK',7782,'1982-1-23',1300,NULL,10);
and then delete the test dir,
set the connection charset option to utf8, and run the example, Error occured when click open button
CREATE TABLE EMP (
EMPNO INT PRIMARY KEY,
ENAME VARCHAR(10),
JOB VARCHAR(9),
MGR INT,
HIREDATE DATETIME,
SAL FLOAT,
COMM FLOAT,
DEPTNO INT REFERENCES DEPT
) CHARACTER SET utf8 COLLATE utf8_bin;
INSERT INTO EMP VALUES
(7369,'SMITH','CLERK',7902,'1980-12-17',800,NULL,20);
INSERT INTO EMP VALUES
(7499,'ALLEN','SALESMAN',7698,'1981-2-20',1600,300,30);
INSERT INTO EMP VALUES
(7521,'WARD','SALESMAN',7698,'1981-2-22',1250,500,30);
INSERT INTO EMP VALUES
(7566,'JONES','MANAGER',7839,'1981-4-2',2975,NULL,20);
INSERT INTO EMP VALUES
(7654,'MARTIN','SALESMAN',7698,'1981-9-28',1250,1400,30);
INSERT INTO EMP VALUES
(7698,'BLAKE','MANAGER',7839,'1981-5-1',2850,NULL,30);
INSERT INTO EMP VALUES
(7782,'CLARK','MANAGER',7839,'1981-6-9',2450,NULL,10);
INSERT INTO EMP VALUES
(7788,'SCOTT','ANALYST',7566,'1987-7-13',3000,NULL,20);
INSERT INTO EMP VALUES
(7839,'KING','PRESIDENT',NULL,'1981-11-17',5000,NULL,10);
INSERT INTO EMP VALUES
(7844,'TURNER','SALESMAN',7698,'1981-9-8',1500,0,30);
INSERT INTO EMP VALUES
(7876,'ADAMS','CLERK',7788,'1987-7-13',1100,NULL,20);
INSERT INTO EMP VALUES
(7900,'JAMES','CLERK',7698,'1981-12-3',950,NULL,30);
INSERT INTO EMP VALUES
(7902,'FORD','ANALYST',7566,'1981-12-3',3000,NULL,20);
INSERT INTO EMP VALUES
(7934,'MILLER','CLERK',7782,'1982-1-23',1300,NULL,10);
and then delete the test dir,
set the connection charset option to utf8, and run the example, Error occured when click open button
I could not reproduce the problem.
Please use the MyDAC Embedded demo. Delete from the 'Embedded' directory 'share' and 'data' directories. Copy the 'share' directory from the MySQL server directory version 5.0.9 to 'Embedded'. Copy libmysqld.dll version 5.0.9-beta-embedded-log to 'Embedded'. Check that in the {Windows} directory the my.ini file does not exist.
After that run the Embedded demo and check its work.
Please use the MyDAC Embedded demo. Delete from the 'Embedded' directory 'share' and 'data' directories. Copy the 'share' directory from the MySQL server directory version 5.0.9 to 'Embedded'. Copy libmysqld.dll version 5.0.9-beta-embedded-log to 'Embedded'. Check that in the {Windows} directory the my.ini file does not exist.
After that run the Embedded demo and check its work.