Page 1 of 2

TMSConnection error messages

Posted: Tue 19 Jul 2005 08:07
by Ray Mond
Is there a way to retrieve the error messages in WideString? For e.g. I need to test a connection to a Chinese server, and would like to retrieve the error message in Chinese. Using Query Analyzer, I can see the error message in Chinese because I have the necessary fonts installed, but using SDAC, I think the message gets converted to regular AnsiString.

Perhaps a new property for the EMSError class e.g. LastMessageWideString?

Thanks.

Ray Mond

Posted: Wed 20 Jul 2005 11:38
by Ikar
Now SDAC doesn't provide such functionality. We will consider your suggestion and probably add this functionality.

Posted: Wed 20 Jul 2005 14:24
by Ray Mond
Thanks. Looking forward to it.

Ray Mond

Posted: Tue 13 Sep 2005 03:23
by Guest
Hi. Will this be in the next version, and if so, when will this be released? Thank you.

Ray Mond

Posted: Tue 13 Sep 2005 11:46
by Ikar
Please send us (sdac*crlab*com) your license number

Posted: Wed 14 Sep 2005 23:28
by Ray Mond
Done.

Ray Mond

Posted: Thu 15 Sep 2005 13:22
by Ikar
We can propose quick solution only for users of Pro-version.

Posted: Thu 15 Sep 2005 15:43
by Ray Mond
The upgrade is a little costly, to just introduce a new property to get the unicode text. I'm sure the OleDB library already returns messages in unicode, just that you guys decided to use ansistrings instead for the message property of the EMSError class.

So there are no plans to introduce a new unicode message property in the component library soon?

Ray Mond

Posted: Fri 16 Sep 2005 14:03
by Ikar
> you guys decided to use ansistrings instead for the message property of
> the EMSError class.

Substantially, this accepted for compatibility with EDatabaseError. At present we can't change this without giving troubles to other Std users.

> So there are no plans to introduce a new unicode message property in the component library soon?

We think about this task. But it is rare problem and we don't plan to make this change for the next month.


This problem should appear only on systems with DefaultCharset different from error message charset. Can you set DefaultCharset?

Posted: Fri 16 Sep 2005 17:06
by Ray Mond
Where do I set the DefaultCharset property? Thanks.

Ray Mond

Posted: Sat 17 Sep 2005 03:17
by Ray Mond
Actually, I'm not asking that the message property be changed to widestring. I'm asking for a new property, maybe named WideMessage, to get the widestring message. Shouldn't break compatibility anywhere.

The DefaultCharset might not work, because we use English OS and SQL Server, but have database names created in many other languages e.g. Chinese, Japanese etc.

Thanks.

Ray Mond

Posted: Mon 19 Sep 2005 10:51
by Ikar
> Where do I set the DefaultCharset property?

In OS settings. See below example for WinXP Eng:

Control Panel -> Regional and Language Options -> Advanced -> Language for non-Unicode programs

> have database names created in many other languages e.g. Chinese, Japanese
> etc

In that case you can't avoid this problem only by using widestring errormessage. You need widestring TMSConnection.Database too.

Posted: Mon 19 Sep 2005 16:43
by Ray Mond
>> In that case you can't avoid this problem only by using widestring errormessage. You need widestring TMSConnection.Database too.

Not true. There are at least workarounds for that e.g.

I have a Japanese named database. Mu queries always use a database qualified identifier e.g.

SQL := WideFormat('SELECT TOP 10 name FROM [%s]..authors', [DBName]);

Then, I use TMSQuery parameterized queries and sp_executesql e.g.

MSQuery1.SQL.Text := 'sp_executesql :sql';
MSQuery1.ParamByName('sql').DataType := ftWideString;
MSQuery1.ParamByName('sql').AsWideString := SQL;

Works just fine.


Ray Mond

Posted: Thu 22 Sep 2005 15:02
by Ikar
We will add new WideString property to EOLEDBError in the nearest build

Posted: Thu 22 Sep 2005 15:16
by Ray Mond
Thank you.

Ray Mond