TMSConnection error messages

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Ray Mond

TMSConnection error messages

Post by Ray Mond » Tue 19 Jul 2005 08:07

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

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Wed 20 Jul 2005 11:38

Now SDAC doesn't provide such functionality. We will consider your suggestion and probably add this functionality.

Ray Mond

Post by Ray Mond » Wed 20 Jul 2005 14:24

Thanks. Looking forward to it.

Ray Mond

Guest

Post by Guest » Tue 13 Sep 2005 03:23

Hi. Will this be in the next version, and if so, when will this be released? Thank you.

Ray Mond

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Tue 13 Sep 2005 11:46

Please send us (sdac*crlab*com) your license number

Ray Mond

Post by Ray Mond » Wed 14 Sep 2005 23:28

Done.

Ray Mond

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Thu 15 Sep 2005 13:22

We can propose quick solution only for users of Pro-version.

Ray Mond

Post by Ray Mond » Thu 15 Sep 2005 15:43

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

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Fri 16 Sep 2005 14:03

> 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?

Ray Mond

Post by Ray Mond » Fri 16 Sep 2005 17:06

Where do I set the DefaultCharset property? Thanks.

Ray Mond

Ray Mond

Post by Ray Mond » Sat 17 Sep 2005 03:17

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

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Mon 19 Sep 2005 10:51

> 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.

Ray Mond

Post by Ray Mond » Mon 19 Sep 2005 16:43

>> 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

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Thu 22 Sep 2005 15:02

We will add new WideString property to EOLEDBError in the nearest build

Ray Mond

Post by Ray Mond » Thu 22 Sep 2005 15:16

Thank you.

Ray Mond

Post Reply