Page 1 of 1

DESCRIBE doesnt work with UniCode

Posted: Thu 10 Apr 2008 15:45
by ppulkrabek
Hi

I'm using Delphi 2006, MyDac 4.40.25, MySQL 4.1.20, my database is in UTF8 coding. In my app I am using DevExpress components to display and work with data. I have had problems corectly display Slovak characters in the grid/editors. Only one solution worked for me and that's setting of TMyConnection.Options.UseUnicode to True. Ok, but then I've got problem fetching results from DESCRIBE command from MySQL using TMyQuery. I've got enum('None',' instead of enum('None','Poor','Good','Excellent').

Here is MySQl table:

CREATE TABLE `customers` (
`CustomerID` INTEGER(11) NOT NULL AUTO_INCREMENT,
`CustomerName` VARCHAR(50) COLLATE utf8_general_ci DEFAULT NULL,
`WebSiteQuality` ENUM('None','Poor','Good','Excellent') DEFAULT 'None',

PRIMARY KEY (`CustomerID`)
)ENGINE=InnoDB COMMENT='InnoDB free: 80896 kB' CHECKSUM=0 DELAY_KEY_WRITE=0 PACK_KEYS=0 MIN_ROWS=0 MAX_ROWS=0 ROW_FORMAT=DYNAMIC CHARACTER SET 'utf8'
COLLATE 'utf8_general_ci' INSERT_METHOD=NO;
COMMIT;

Here is the delphi code:

procedure TfrmMain.bGetEnumValuesClick(Sender: TObject);
var
Query: TMyQuery;
begin
Query := TMyQuery.Create(nil);
try
Query.Connection := MyConnection;
Query.SQL.Text := ' DESCRIBE `customers` '+QuotedStr('WebSiteQuality');
Query.Open;
eEnumValues.Text := Query.Fields[1].AsString;
Query.Close;
finally
Query.Free;
end;
end;

If I set TMyConnection.Options.UseUnicode := False, Query.Fields[1].AsString returns what expected.

Can any one help, please?
Thanks
Pavel

Posted: Fri 11 Apr 2008 13:11
by Dimon
We have fixed this problem in the current MyDAC version. You can upgrade to MyDAC 5 to solve the problem.

Posted: Fri 11 Apr 2008 13:20
by ppulkrabek
Is there any possible work arround in MyDAC 4.40?

Thanks
Pavel

Posted: Mon 14 Apr 2008 06:42
by Dimon
Please send your registration information to dmitryg*crlab*com. Also specify the Delphi version you are using.