TMSConnection error messages
TMSConnection error messages
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
Perhaps a new property for the EMSError class e.g. LastMessageWideString?
Thanks.
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
So there are no plans to introduce a new unicode message property in the component library soon?
Ray Mond
> 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?
> 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?
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
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
> 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.
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.
>> 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
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